Merge pull request #2436 from saamas/processing-add-avx2-vaa-routines

[Processing] Add AVX2 VAA routines
This commit is contained in:
ruil2 2016-04-28 09:08:03 +08:00
commit 56618249d7
4 changed files with 1656 additions and 99 deletions

View File

@ -64,6 +64,13 @@ void CVAACalculation::InitVaaFuncs (SVaaFuncs& sVaaFuncs, int32_t iCpuFlag) {
sVaaFuncs.pfVAACalcSadSsdBgd = VAACalcSadSsdBgd_sse2;
sVaaFuncs.pfVAACalcSadVar = VAACalcSadVar_sse2;
}
if (iCpuFlag & WELS_CPU_AVX2) {
sVaaFuncs.pfVAACalcSad = VAACalcSad_avx2;
sVaaFuncs.pfVAACalcSadBgd = VAACalcSadBgd_avx2;
sVaaFuncs.pfVAACalcSadSsd = VAACalcSadSsd_avx2;
sVaaFuncs.pfVAACalcSadSsdBgd = VAACalcSadSsdBgd_avx2;
sVaaFuncs.pfVAACalcSadVar = VAACalcSadVar_avx2;
}
#endif//X86_ASM
#ifdef HAVE_NEON
if ((iCpuFlag & WELS_CPU_NEON) == WELS_CPU_NEON) {

View File

@ -104,6 +104,11 @@ VAACalcSadSsdBgdFunc VAACalcSadSsdBgd_sse2;
VAACalcSadFunc VAACalcSad_sse2;
VAACalcSadVarFunc VAACalcSadVar_sse2;
VAACalcSadSsdFunc VAACalcSadSsd_sse2;
VAACalcSadBgdFunc VAACalcSadBgd_avx2;
VAACalcSadSsdBgdFunc VAACalcSadSsdBgd_avx2;
VAACalcSadFunc VAACalcSad_avx2;
VAACalcSadVarFunc VAACalcSadVar_avx2;
VAACalcSadSsdFunc VAACalcSadSsd_avx2;
WELSVP_EXTERN_C_END
#endif

File diff suppressed because it is too large Load Diff

View File

@ -590,7 +590,8 @@ TEST (VAACalcFuncTest, func) { \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
pic_width_c = pic_width_a = 320-16; \
for (int i=0; i<4; i++) { \
pic_width_c = pic_width_a = 320-16*i; \
pic_height_c = pic_height_a = 320; \
pic_stride_c = pic_stride_a = 320; \
psadframe_c = psadframe_a = 0; \
@ -604,6 +605,7 @@ TEST (VAACalcFuncTest, func) { \
ASSERT_EQ (psadframe_a, psadframe_c); \
for (int j=0; j<(BUFFER_SIZE/64); j++) \
ASSERT_EQ (psad8x8_a[j], psad8x8_c[j]); \
} \
}
@ -633,7 +635,8 @@ TEST (VAACalcFuncTest, func) { \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
pic_width_c = pic_width_a = 320-16; \
for (int i=0; i<4; i++) { \
pic_width_c = pic_width_a = 320-16*i; \
pic_height_c = pic_height_a = 320; \
pic_stride_c = pic_stride_a = 320; \
psadframe_c = psadframe_a = 0; \
@ -652,6 +655,7 @@ TEST (VAACalcFuncTest, func) { \
ASSERT_EQ (psd8x8_a[j], psd8x8_c[j]); \
ASSERT_EQ (pmad8x8_a[j], pmad8x8_c[j]); \
} \
} \
}
#define GENERATE_VAACalcSadSsd_UT(func, ASM, CPUFLAGS) \
@ -682,7 +686,8 @@ TEST (VAACalcFuncTest, func) { \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
pic_width_c = pic_width_a = 320-16; \
for (int i=0; i<4; i++) { \
pic_width_c = pic_width_a = 320-16*i; \
pic_height_c = pic_height_a = 320; \
pic_stride_c = pic_stride_a = 320; \
psadframe_c = psadframe_a = 0; \
@ -705,6 +710,7 @@ TEST (VAACalcFuncTest, func) { \
ASSERT_EQ (psqsum16x16_a[j], psqsum16x16_c[j]); \
ASSERT_EQ (psqdiff16x16_a[j], psqdiff16x16_c[j]); \
} \
} \
}
#define GENERATE_VAACalcSadVar_UT(func, ASM, CPUFLAGS) \
@ -733,7 +739,8 @@ TEST (VAACalcFuncTest, func) { \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
pic_width_c = pic_width_a = 320-16; \
for (int i=0; i<4; i++) { \
pic_width_c = pic_width_a = 320-16*i; \
pic_height_c = pic_height_a = 320; \
pic_stride_c = pic_stride_a = 320; \
psadframe_c = psadframe_a = 0; \
@ -754,6 +761,7 @@ TEST (VAACalcFuncTest, func) { \
ASSERT_EQ (psum16x16_a[j], psum16x16_c[j]); \
ASSERT_EQ (psqsum16x16_a[j], psqsum16x16_c[j]); \
} \
} \
}
#define GENERATE_VAACalcSadSsdBgd_UT(func, ASM, CPUFLAGS) \
@ -788,7 +796,8 @@ TEST (VAACalcFuncTest, func) { \
int32_t pic_height_a; \
int32_t pic_stride_a; \
int32_t psadframe_a; \
pic_width_c = pic_width_a = 320-16; \
for (int i=0; i<4; i++) { \
pic_width_c = pic_width_a = 320-16*i; \
pic_height_c = pic_height_a = 320; \
pic_stride_c = pic_stride_a = 320; \
psadframe_c = psadframe_a = 0; \
@ -815,6 +824,7 @@ TEST (VAACalcFuncTest, func) { \
ASSERT_EQ (psqsum16x16_a[j], psqsum16x16_c[j]); \
ASSERT_EQ (psqdiff16x16_a[j], psqdiff16x16_c[j]); \
} \
} \
}
GENERATE_VAACalcSad_UT (VAACalcSad_c, 0, 0)
@ -828,6 +838,12 @@ GENERATE_VAACalcSadBgd_UT (VAACalcSadBgd_sse2, 1, WELS_CPU_SSE2)
GENERATE_VAACalcSadSsdBgd_UT (VAACalcSadSsdBgd_sse2, 1, WELS_CPU_SSE2)
GENERATE_VAACalcSadSsd_UT (VAACalcSadSsd_sse2, 1, WELS_CPU_SSE2)
GENERATE_VAACalcSadVar_UT (VAACalcSadVar_sse2, 1, WELS_CPU_SSE2)
GENERATE_VAACalcSad_UT (VAACalcSad_avx2, 1, WELS_CPU_AVX2)
GENERATE_VAACalcSadBgd_UT (VAACalcSadBgd_avx2, 1, WELS_CPU_AVX2)
GENERATE_VAACalcSadSsdBgd_UT (VAACalcSadSsdBgd_avx2, 1, WELS_CPU_AVX2)
GENERATE_VAACalcSadSsd_UT (VAACalcSadSsd_avx2, 1, WELS_CPU_AVX2)
GENERATE_VAACalcSadVar_UT (VAACalcSadVar_avx2, 1, WELS_CPU_AVX2)
#endif
#if defined(HAVE_NEON)