]> granicus.if.org Git - libvpx/commitdiff
hadamard highbd neon: use tran_low_t for coeff
authorJohann <johannkoenig@google.com>
Tue, 31 Jan 2017 00:16:27 +0000 (16:16 -0800)
committerJohann <johannkoenig@google.com>
Wed, 1 Feb 2017 19:50:46 +0000 (11:50 -0800)
BUG=webm:1365

Change-Id: I7e15192ead3a3631755b386f102c979f06e26279

test/hadamard_test.cc
vpx_dsp/arm/hadamard_neon.c
vpx_dsp/arm/idct_neon.h
vpx_dsp/vpx_dsp_rtcd_defs.pl

index bc09e952d2333b4f63025c4ceb43afdb47af3786..3b19b23be392e400167c9592f58b9eaf50984b9e 100644 (file)
@@ -157,12 +157,14 @@ INSTANTIATE_TEST_CASE_P(SSE2, Hadamard8x8Test,
 INSTANTIATE_TEST_CASE_P(SSSE3, Hadamard8x8Test,
                         ::testing::Values(&vpx_hadamard_8x8_ssse3));
 #endif  // HAVE_SSSE3 && ARCH_X86_64
+#endif  // !CONFIG_VP9_HIGHBITDEPTH
 
 #if HAVE_NEON
 INSTANTIATE_TEST_CASE_P(NEON, Hadamard8x8Test,
                         ::testing::Values(&vpx_hadamard_8x8_neon));
 #endif  // HAVE_NEON
 
+#if !CONFIG_VP9_HIGHBITDEPTH
 #if HAVE_MSA
 INSTANTIATE_TEST_CASE_P(MSA, Hadamard8x8Test,
                         ::testing::Values(&vpx_hadamard_8x8_msa));
@@ -220,12 +222,12 @@ INSTANTIATE_TEST_CASE_P(SSE2, Hadamard16x16Test,
                         ::testing::Values(&vpx_hadamard_16x16_sse2));
 #endif  // HAVE_SSE2
 
-#if !CONFIG_VP9_HIGHBITDEPTH
 #if HAVE_NEON
 INSTANTIATE_TEST_CASE_P(NEON, Hadamard16x16Test,
                         ::testing::Values(&vpx_hadamard_16x16_neon));
 #endif  // HAVE_NEON
 
+#if !CONFIG_VP9_HIGHBITDEPTH
 #if HAVE_MSA
 INSTANTIATE_TEST_CASE_P(MSA, Hadamard16x16Test,
                         ::testing::Values(&vpx_hadamard_16x16_msa));
index 977323497a832562caa6a68d6734f3de079e152f..ebeafed31fdbfb2ad758eea2b0b2041d28702753 100644 (file)
@@ -11,6 +11,8 @@
 #include <arm_neon.h>
 
 #include "./vpx_dsp_rtcd.h"
+#include "vpx/vpx_integer.h"
+#include "vpx_dsp/arm/idct_neon.h"
 #include "vpx_dsp/arm/transpose_neon.h"
 
 static void hadamard8x8_one_pass(int16x8_t *a0, int16x8_t *a1, int16x8_t *a2,
@@ -45,7 +47,7 @@ static void hadamard8x8_one_pass(int16x8_t *a0, int16x8_t *a1, int16x8_t *a2,
 }
 
 void vpx_hadamard_8x8_neon(const int16_t *src_diff, int src_stride,
-                           int16_t *coeff) {
+                           tran_low_t *coeff) {
   int16x8_t a0 = vld1q_s16(src_diff);
   int16x8_t a1 = vld1q_s16(src_diff + src_stride);
   int16x8_t a2 = vld1q_s16(src_diff + 2 * src_stride);
@@ -63,18 +65,18 @@ void vpx_hadamard_8x8_neon(const int16_t *src_diff, int src_stride,
 
   // Skip the second transpose because it is not required.
 
-  vst1q_s16(coeff + 0, a0);
-  vst1q_s16(coeff + 8, a1);
-  vst1q_s16(coeff + 16, a2);
-  vst1q_s16(coeff + 24, a3);
-  vst1q_s16(coeff + 32, a4);
-  vst1q_s16(coeff + 40, a5);
-  vst1q_s16(coeff + 48, a6);
-  vst1q_s16(coeff + 56, a7);
+  store_s16q_to_tran_low(coeff + 0, a0);
+  store_s16q_to_tran_low(coeff + 8, a1);
+  store_s16q_to_tran_low(coeff + 16, a2);
+  store_s16q_to_tran_low(coeff + 24, a3);
+  store_s16q_to_tran_low(coeff + 32, a4);
+  store_s16q_to_tran_low(coeff + 40, a5);
+  store_s16q_to_tran_low(coeff + 48, a6);
+  store_s16q_to_tran_low(coeff + 56, a7);
 }
 
 void vpx_hadamard_16x16_neon(const int16_t *src_diff, int src_stride,
-                             int16_t *coeff) {
+                             tran_low_t *coeff) {
   int i;
 
   /* Rearrange 16x16 to 8x32 and remove stride.
@@ -88,10 +90,10 @@ void vpx_hadamard_16x16_neon(const int16_t *src_diff, int src_stride,
   vpx_hadamard_8x8_neon(src_diff + 8 + 8 * src_stride, src_stride, coeff + 192);
 
   for (i = 0; i < 64; i += 8) {
-    const int16x8_t a0 = vld1q_s16(coeff + 0);
-    const int16x8_t a1 = vld1q_s16(coeff + 64);
-    const int16x8_t a2 = vld1q_s16(coeff + 128);
-    const int16x8_t a3 = vld1q_s16(coeff + 192);
+    const int16x8_t a0 = load_tran_low_to_s16q(coeff + 0);
+    const int16x8_t a1 = load_tran_low_to_s16q(coeff + 64);
+    const int16x8_t a2 = load_tran_low_to_s16q(coeff + 128);
+    const int16x8_t a3 = load_tran_low_to_s16q(coeff + 192);
 
     const int16x8_t b0 = vhaddq_s16(a0, a1);
     const int16x8_t b1 = vhsubq_s16(a0, a1);
@@ -103,10 +105,10 @@ void vpx_hadamard_16x16_neon(const int16_t *src_diff, int src_stride,
     const int16x8_t c2 = vsubq_s16(b0, b2);
     const int16x8_t c3 = vsubq_s16(b1, b3);
 
-    vst1q_s16(coeff + 0, c0);
-    vst1q_s16(coeff + 64, c1);
-    vst1q_s16(coeff + 128, c2);
-    vst1q_s16(coeff + 192, c3);
+    store_s16q_to_tran_low(coeff + 0, c0);
+    store_s16q_to_tran_low(coeff + 64, c1);
+    store_s16q_to_tran_low(coeff + 128, c2);
+    store_s16q_to_tran_low(coeff + 192, c3);
 
     coeff += 8;
   }
index d9b85223c76749b4f9ec42d401027a87fc608592..2f30a5adddeccbf8c952ed802184545ce81f6124 100644 (file)
@@ -76,6 +76,17 @@ static INLINE int16x4_t load_tran_low_to_s16d(const tran_low_t *buf) {
 #endif
 }
 
+static INLINE void store_s16q_to_tran_low(tran_low_t *buf, const int16x8_t a) {
+#if CONFIG_VP9_HIGHBITDEPTH
+  const int32x4_t v0 = vmovl_s16(vget_low_s16(a));
+  const int32x4_t v1 = vmovl_s16(vget_high_s16(a));
+  vst1q_s32(buf, v0);
+  vst1q_s32(buf + 4, v1);
+#else
+  vst1q_s16(buf, a);
+#endif
+}
+
 //------------------------------------------------------------------------------
 
 // Multiply a by a_const. Saturate, shift and narrow by 14.
index 133f2fbcd0321a2111b70061259853cc156fedb1..cf85cc89b6a510f879a3d388159f689617914bdc 100644 (file)
@@ -888,10 +888,10 @@ if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") {
 
   if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
     add_proto qw/void vpx_hadamard_8x8/, "const int16_t *src_diff, int src_stride, tran_low_t *coeff";
-    specialize qw/vpx_hadamard_8x8 sse2/;
+    specialize qw/vpx_hadamard_8x8 sse2 neon/;
 
     add_proto qw/void vpx_hadamard_16x16/, "const int16_t *src_diff, int src_stride, tran_low_t *coeff";
-    specialize qw/vpx_hadamard_16x16 sse2/;
+    specialize qw/vpx_hadamard_16x16 sse2 neon/;
 
     add_proto qw/int vpx_satd/, "const tran_low_t *coeff, int length";
     specialize qw/vpx_satd/;