ppc Add vpx_sad32x16/32/64_vsx
Change-Id: I3c4f9d595275669580413a71b3c3c810e7ddcacd
This commit is contained in:
parent
a12ea1d5e9
commit
0b15bf1e54
@ -924,8 +924,12 @@ INSTANTIATE_TEST_CASE_P(MSA, SADx4Test, ::testing::ValuesIn(x4d_msa_tests));
|
||||
// VSX functions
|
||||
#if HAVE_VSX
|
||||
const SadMxNParam vsx_tests[] = {
|
||||
SadMxNParam(32, 64, &vpx_sad32x64_vsx),
|
||||
SadMxNParam(32, 32, &vpx_sad32x32_vsx),
|
||||
SadMxNParam(32, 16, &vpx_sad32x16_vsx),
|
||||
SadMxNParam(16, 32, &vpx_sad16x32_vsx),
|
||||
SadMxNParam(16, 16, &vpx_sad16x16_vsx), SadMxNParam(16, 8, &vpx_sad16x8_vsx),
|
||||
SadMxNParam(16, 16, &vpx_sad16x16_vsx),
|
||||
SadMxNParam(16, 8, &vpx_sad16x8_vsx),
|
||||
};
|
||||
INSTANTIATE_TEST_CASE_P(VSX, SADTest, ::testing::ValuesIn(vsx_tests));
|
||||
#endif // HAVE_VSX
|
||||
|
@ -48,6 +48,30 @@
|
||||
return sad[3] + sad[2] + sad[1] + sad[0]; \
|
||||
}
|
||||
|
||||
#define SAD32(height) \
|
||||
unsigned int vpx_sad32x##height##_vsx(const uint8_t *a, int a_stride, \
|
||||
const uint8_t *b, int b_stride) { \
|
||||
int y; \
|
||||
unsigned int sad[4]; \
|
||||
uint8x16_t v_a, v_b; \
|
||||
int16x8_t v_ah, v_al, v_bh, v_bl, v_absh, v_absl, v_subh, v_subl; \
|
||||
int32x4_t v_sad = vec_splat_s32(0); \
|
||||
\
|
||||
for (y = 0; y < height; y++) { \
|
||||
PROCESS16(0); \
|
||||
PROCESS16(16); \
|
||||
\
|
||||
a += a_stride; \
|
||||
b += b_stride; \
|
||||
} \
|
||||
vec_vsx_st((uint32x4_t)v_sad, 0, sad); \
|
||||
\
|
||||
return sad[3] + sad[2] + sad[1] + sad[0]; \
|
||||
}
|
||||
|
||||
SAD16(8);
|
||||
SAD16(16);
|
||||
SAD16(32);
|
||||
SAD32(16);
|
||||
SAD32(32);
|
||||
SAD32(64);
|
||||
|
@ -702,13 +702,13 @@ add_proto qw/unsigned int vpx_sad64x32/, "const uint8_t *src_ptr, int src_stride
|
||||
specialize qw/vpx_sad64x32 avx2 msa sse2/;
|
||||
|
||||
add_proto qw/unsigned int vpx_sad32x64/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
|
||||
specialize qw/vpx_sad32x64 avx2 msa sse2/;
|
||||
specialize qw/vpx_sad32x64 avx2 msa sse2 vsx/;
|
||||
|
||||
add_proto qw/unsigned int vpx_sad32x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
|
||||
specialize qw/vpx_sad32x32 avx2 neon msa sse2/;
|
||||
specialize qw/vpx_sad32x32 avx2 neon msa sse2 vsx/;
|
||||
|
||||
add_proto qw/unsigned int vpx_sad32x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
|
||||
specialize qw/vpx_sad32x16 avx2 msa sse2/;
|
||||
specialize qw/vpx_sad32x16 avx2 msa sse2 vsx/;
|
||||
|
||||
add_proto qw/unsigned int vpx_sad16x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride";
|
||||
specialize qw/vpx_sad16x32 msa sse2 vsx/;
|
||||
|
Loading…
x
Reference in New Issue
Block a user