shithub: libvpx

Download patch

ref: 8be1dcb4cbbab433f63ac3516616cb748e2e626a
parent: b946e5ce0f0038babb610c2a071bcff6abdb7a39
parent: 1c39998e39eb660b7617321a753da37f61a0c4af
author: Frank Galligan <[email protected]>
date: Thu Jul 16 01:45:15 EDT 2015

Merge "Add vp9_int_pro_col_neon."

--- a/test/vp9_avg_test.cc
+++ b/test/vp9_avg_test.cc
@@ -291,6 +291,12 @@
         make_tuple(16, &vp9_int_pro_row_neon, &vp9_int_pro_row_c),
         make_tuple(32, &vp9_int_pro_row_neon, &vp9_int_pro_row_c),
         make_tuple(64, &vp9_int_pro_row_neon, &vp9_int_pro_row_c)));
+
+INSTANTIATE_TEST_CASE_P(
+    NEON, IntProColTest, ::testing::Values(
+        make_tuple(16, &vp9_int_pro_col_neon, &vp9_int_pro_col_c),
+        make_tuple(32, &vp9_int_pro_col_neon, &vp9_int_pro_col_c),
+        make_tuple(64, &vp9_int_pro_col_neon, &vp9_int_pro_col_c)));
 #endif
 
 #if HAVE_MSA
--- a/vp9/common/vp9_rtcd_defs.pl
+++ b/vp9/common/vp9_rtcd_defs.pl
@@ -824,7 +824,7 @@
 specialize qw/vp9_int_pro_row sse2 neon/;
 
 add_proto qw/int16_t vp9_int_pro_col/, "uint8_t const *ref, const int width";
-specialize qw/vp9_int_pro_col sse2/;
+specialize qw/vp9_int_pro_col sse2 neon/;
 
 add_proto qw/int vp9_vector_var/, "int16_t const *ref, int16_t const *src, const int bwl";
 specialize qw/vp9_vector_var sse2/;
--- a/vp9/encoder/arm/neon/vp9_avg_neon.c
+++ b/vp9/encoder/arm/neon/vp9_avg_neon.c
@@ -100,3 +100,17 @@
   hbuf += 8;
   vst1q_s16(hbuf, vreinterpretq_s16_u16(vec_sum_hi));
 }
+
+int16_t vp9_int_pro_col_neon(uint8_t const *ref, const int width) {
+  int i;
+  uint16x8_t vec_sum = vdupq_n_u16(0);
+
+  for (i = 0; i < width; i += 16) {
+    const uint8x16_t vec_row = vld1q_u8(ref);
+    vec_sum = vaddw_u8(vec_sum, vget_low_u8(vec_row));
+    vec_sum = vaddw_u8(vec_sum, vget_high_u8(vec_row));
+    ref += 16;
+  }
+
+  return horizontal_add_u16x8(vec_sum);
+}