Add Neon implementation of av1_highbd_convolve_y_sr_intrabc Add Neon implementation of av1_highbd_convolve_y_sr_intrabc as well as the corresponding tests. Change-Id: I03c32807aaea7f8aaf1542678300d33a36fb889c
diff --git a/av1/common/arm/highbd_convolve_neon.c b/av1/common/arm/highbd_convolve_neon.c index c68ef94..9818a5f 100644 --- a/av1/common/arm/highbd_convolve_neon.c +++ b/av1/common/arm/highbd_convolve_neon.c
@@ -1906,6 +1906,57 @@ } } +// Filter used is [64, 64]. +void av1_highbd_convolve_y_sr_intrabc_neon( + const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, + int h, const InterpFilterParams *filter_params_y, const int subpel_y_qn, + int bd) { + assert(subpel_y_qn == 8); + assert(filter_params_y->taps == 2); + (void)filter_params_y; + (void)subpel_y_qn; + (void)bd; + + if (w <= 4) { + do { + uint16x4_t s0 = vld1_u16(src); + uint16x4_t s1 = vld1_u16(src + src_stride); + + uint16x4_t d0 = vrhadd_u16(s0, s1); + + if (w == 2) { + store_u16_2x1(dst, d0, 0); + } else { + vst1_u16(dst, d0); + } + + src += src_stride; + dst += dst_stride; + } while (--h != 0); + } else { + do { + const uint16_t *src_ptr = src; + uint16_t *dst_ptr = dst; + int height = h; + + do { + uint16x8_t s0 = vld1q_u16(src_ptr); + uint16x8_t s1 = vld1q_u16(src_ptr + src_stride); + + uint16x8_t d0 = vrhaddq_u16(s0, s1); + + vst1q_u16(dst_ptr, d0); + + src_ptr += src_stride; + dst_ptr += dst_stride; + } while (--height != 0); + src += 8; + dst += 8; + w -= 8; + } while (w != 0); + } +} + // Both horizontal and vertical passes use the same 2-tap filter: [64, 64]. void av1_highbd_convolve_2d_sr_intrabc_neon( const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w,
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl index a8aecc0..752ec25 100644 --- a/av1/common/av1_rtcd_defs.pl +++ b/av1/common/av1_rtcd_defs.pl
@@ -613,6 +613,7 @@ specialize qw/av1_highbd_convolve_2d_sr_intrabc neon/; specialize qw/av1_highbd_convolve_x_sr ssse3 avx2 neon/; specialize qw/av1_highbd_convolve_y_sr ssse3 avx2 neon/; + specialize qw/av1_highbd_convolve_y_sr_intrabc neon/; specialize qw/av1_highbd_convolve_2d_scale sse4_1 neon/; }
diff --git a/test/av1_convolve_test.cc b/test/av1_convolve_test.cc index fdb9fcd..b913eff 100644 --- a/test/av1_convolve_test.cc +++ b/test/av1_convolve_test.cc
@@ -984,6 +984,12 @@ INSTANTIATE_TEST_SUITE_P(C, AV1ConvolveYHighbdIntraBCTest, BuildHighbdParams(av1_highbd_convolve_y_sr_intrabc_c)); +#if HAVE_NEON +INSTANTIATE_TEST_SUITE_P( + NEON, AV1ConvolveYHighbdIntraBCTest, + BuildHighbdParams(av1_highbd_convolve_y_sr_intrabc_neon)); +#endif + #endif // CONFIG_AV1_HIGHBITDEPTH //////////////////////////////////////////////////////////////