Fix bug in wiener_convolve neon function
BUG=aomedia:2398
Change-Id: I180d51e3392ec3aef48ad844ddbf24e5372fb59b
diff --git a/av1/common/arm/convolve_neon.h b/av1/common/arm/convolve_neon.h
index f382984..dbcfab6 100644
--- a/av1/common/arm/convolve_neon.h
+++ b/av1/common/arm/convolve_neon.h
@@ -73,7 +73,7 @@
int32x4_t sum_0, sum_1;
int32x4_t s3_0, s3_1;
const int32_t round_const_0 = (1 << (bd + FILTER_BITS - 1));
- const int32_t round_const_1 = (1 << ((bd) + 1 + FILTER_BITS - round0_bits));
+ const int32_t round_const_1 = (1 << (bd + 1 + FILTER_BITS - round0_bits)) - 1;
/* for the purpose of right shift by { conv_params->round_0 } */
const int32x4_t round_bits = vdupq_n_s32(-round0_bits);
@@ -124,7 +124,7 @@
int16x4_t sum, temp0, temp1, temp2;
const int32_t round_const_0 = (1 << (bd + FILTER_BITS - 1));
- const int32_t round_const_1 = (1 << ((bd) + 1 + FILTER_BITS - round0_bits));
+ const int32_t round_const_1 = (1 << (bd + 1 + FILTER_BITS - round0_bits)) - 1;
const int32x4_t round_bits = vdupq_n_s32(-round0_bits);
const int32x4_t zero = vdupq_n_s32(0);
const int32x4_t round_vec_0 = vdupq_n_s32(round_const_0);
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl
index efd8966..53e140e 100644
--- a/av1/common/av1_rtcd_defs.pl
+++ b/av1/common/av1_rtcd_defs.pl
@@ -85,8 +85,7 @@
add_proto qw/void av1_highbd_wiener_convolve_add_src/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, const ConvolveParams *conv_params, int bd";
-# TODO(http://crbug.com/aomedia/2398): Disable NEON version due to test vector mismatch.
-specialize qw/av1_wiener_convolve_add_src sse2 avx2/; # neon/;
+specialize qw/av1_wiener_convolve_add_src sse2 avx2 neon/;
specialize qw/av1_highbd_wiener_convolve_add_src ssse3/;
specialize qw/av1_highbd_wiener_convolve_add_src avx2/;
diff --git a/test/hiprec_convolve_test.cc b/test/hiprec_convolve_test.cc
index 75e6166..dcf8523 100644
--- a/test/hiprec_convolve_test.cc
+++ b/test/hiprec_convolve_test.cc
@@ -34,13 +34,11 @@
libaom_test::AV1HiprecConvolve::BuildParams(
av1_wiener_convolve_add_src_avx2));
#endif
-// TODO(http://crbug.com/aomedia/2398): Re-enable this unit test for NEON
-// version after the functions are fixed.
-// #if HAVE_NEON
-// INSTANTIATE_TEST_CASE_P(NEON, AV1HiprecConvolveTest,
-// libaom_test::AV1HiprecConvolve::BuildParams(
-// av1_wiener_convolve_add_src_neon));
-// #endif
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(NEON, AV1HiprecConvolveTest,
+ libaom_test::AV1HiprecConvolve::BuildParams(
+ av1_wiener_convolve_add_src_neon));
+#endif
#if HAVE_SSSE3 || HAVE_AVX2
TEST_P(AV1HighbdHiprecConvolveTest, CheckOutput) {