]> granicus.if.org Git - libvpx/commitdiff
enable vpx_idct32x32_135_add_neon in hbd builds
authorJames Zern <jzern@google.com>
Wed, 23 Nov 2016 01:47:38 +0000 (17:47 -0800)
committerJames Zern <jzern@google.com>
Thu, 24 Nov 2016 03:59:43 +0000 (19:59 -0800)
BUG=webm:1294

Change-Id: Ide6d3994fe01c4320c9d143e6d059b49568048e4

vpx_dsp/arm/idct32x32_135_add_neon.c
vpx_dsp/arm/idct_neon.h
vpx_dsp/vpx_dsp.mk
vpx_dsp/vpx_dsp_rtcd_defs.pl

index db9ffef6c643399e45ae511d2fd8d6669b2a288e..28b94655848d2c63d120cbf5706d47f9dc094e7b 100644 (file)
 #include "vpx_dsp/arm/transpose_neon.h"
 #include "vpx_dsp/txfm_common.h"
 
+static INLINE void load_8x8_s16(const tran_low_t *input, int16x8_t *const in0,
+                                int16x8_t *const in1, int16x8_t *const in2,
+                                int16x8_t *const in3, int16x8_t *const in4,
+                                int16x8_t *const in5, int16x8_t *const in6,
+                                int16x8_t *const in7) {
+  *in0 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in1 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in2 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in3 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in4 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in5 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in6 = load_tran_low_to_s16q(input);
+  input += 32;
+  *in7 = load_tran_low_to_s16q(input);
+}
+
+static INLINE void load_4x8_s16(const tran_low_t *input, int16x4_t *const in0,
+                                int16x4_t *const in1, int16x4_t *const in2,
+                                int16x4_t *const in3, int16x4_t *const in4,
+                                int16x4_t *const in5, int16x4_t *const in6,
+                                int16x4_t *const in7) {
+  *in0 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in1 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in2 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in3 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in4 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in5 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in6 = load_tran_low_to_s16d(input);
+  input += 32;
+  *in7 = load_tran_low_to_s16d(input);
+}
+
 // Only for the first pass of the  _135_ variant. Since it only uses values from
 // the top left 16x16 it can safely assume all the remaining values are 0 and
 // skip an awful lot of calculations. In fact, only the first 12 columns make
@@ -43,7 +87,7 @@
 // 13  84  93 103 110 125
 // 14  98 106 115 127
 // 15 117 128
-static void idct32_12_neon(const int16_t *input, int16_t *output) {
+static void idct32_12_neon(const tran_low_t *input, int16_t *output) {
   int16x8_t in0, in1, in2, in3, in4, in5, in6, in7;
   int16x4_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
   int16x8_t in8, in9, in10, in11;
@@ -66,27 +110,11 @@ static void idct32_12_neon(const int16_t *input, int16_t *output) {
       s7_11, s7_12, s7_13, s7_14, s7_15, s7_20, s7_21, s7_22, s7_23, s7_24,
       s7_25, s7_26, s7_27;
 
-  load_and_transpose_s16_8x8(input, 32, &in0, &in1, &in2, &in3, &in4, &in5,
-                             &in6, &in7);
-
-  input += 8;
-
-  tmp0 = vld1_s16(input);
-  input += 32;
-  tmp1 = vld1_s16(input);
-  input += 32;
-  tmp2 = vld1_s16(input);
-  input += 32;
-  tmp3 = vld1_s16(input);
-  input += 32;
-  tmp4 = vld1_s16(input);
-  input += 32;
-  tmp5 = vld1_s16(input);
-  input += 32;
-  tmp6 = vld1_s16(input);
-  input += 32;
-  tmp7 = vld1_s16(input);
+  load_8x8_s16(input, &in0, &in1, &in2, &in3, &in4, &in5, &in6, &in7);
+  transpose_s16_8x8(&in0, &in1, &in2, &in3, &in4, &in5, &in6, &in7);
 
+  load_4x8_s16(input + 8, &tmp0, &tmp1, &tmp2, &tmp3, &tmp4, &tmp5, &tmp6,
+               &tmp7);
   transpose_s16_4x8(tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, &in8, &in9,
                     &in10, &in11);
 
@@ -669,7 +697,7 @@ static void idct32_16_neon(const int16_t *input, uint8_t *output, int stride) {
                        output + (24 * stride), stride);
 }
 
-void vpx_idct32x32_135_add_neon(const int16_t *input, uint8_t *dest,
+void vpx_idct32x32_135_add_neon(const tran_low_t *input, uint8_t *dest,
                                 int stride) {
   int i;
   int16_t temp[32 * 16];
index a1f766e6dd781d8c8addf6b2f35f28082300f323..e4493a1050b19dbd438c6bd4eaea7792e72b437e 100644 (file)
@@ -18,8 +18,8 @@
 #include "vpx_dsp/vpx_dsp_common.h"
 
 //------------------------------------------------------------------------------
+// Helper functions used to load tran_low_t into int16, narrowing if necessary.
 
-// Helper function used to load tran_low_t into int16, narrowing if necessary.
 static INLINE int16x8_t load_tran_low_to_s16q(const tran_low_t *buf) {
 #if CONFIG_VP9_HIGHBITDEPTH
   const int32x4_t v0 = vld1q_s32(buf);
@@ -32,6 +32,17 @@ static INLINE int16x8_t load_tran_low_to_s16q(const tran_low_t *buf) {
 #endif
 }
 
+static INLINE int16x4_t load_tran_low_to_s16d(const tran_low_t *buf) {
+#if CONFIG_VP9_HIGHBITDEPTH
+  const int32x4_t v0 = vld1q_s32(buf);
+  return vmovn_s32(v0);
+#else
+  return vld1_s16(buf);
+#endif
+}
+
+//------------------------------------------------------------------------------
+
 // Multiply a by a_const. Saturate, shift and narrow by 14.
 static INLINE int16x8_t multiply_shift_and_narrow_s16(const int16x8_t a,
                                                       const int16_t a_const) {
index bb1143cca0a84d81e53624284add5e0c979c2796..200ef07f1ef7df787ff91445f166d2068dc51a89 100644 (file)
@@ -213,7 +213,6 @@ endif  # HAVE_NEON
 endif  # HAVE_NEON_ASM
 DSP_SRCS-$(HAVE_NEON)  += arm/idct16x16_neon.c
 DSP_SRCS-$(HAVE_NEON)  += arm/idct32x32_add_neon.c
-DSP_SRCS-$(HAVE_NEON)  += arm/idct32x32_135_add_neon.c
 
 DSP_SRCS-$(HAVE_MSA)   += mips/inv_txfm_msa.h
 DSP_SRCS-$(HAVE_MSA)   += mips/idct4x4_msa.c
@@ -246,6 +245,7 @@ endif  # HAVE_NEON_ASM
 DSP_SRCS-$(HAVE_NEON) += arm/idct_neon.h
 DSP_SRCS-$(HAVE_NEON) += arm/idct32x32_1_add_neon.c
 DSP_SRCS-$(HAVE_NEON) += arm/idct32x32_34_add_neon.c
+DSP_SRCS-$(HAVE_NEON) += arm/idct32x32_135_add_neon.c
 
 endif  # CONFIG_VP9
 
index bba6b4f78062dccab9218c6aa9072ba3c8e1d301..d78a3575747192ebc2e8f39cce3124bb71f85d2a 100644 (file)
@@ -698,7 +698,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
     specialize qw/vpx_idct32x32_1024_add sse2/, "$ssse3_x86_64";
 
     add_proto qw/void vpx_idct32x32_135_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride";
-    specialize qw/vpx_idct32x32_135_add sse2/, "$ssse3_x86_64";
+    specialize qw/vpx_idct32x32_135_add neon sse2/, "$ssse3_x86_64";
     # Need to add 135 eob idct32x32 implementations.
     $vpx_idct32x32_135_add_sse2=vpx_idct32x32_1024_add_sse2;