]> granicus.if.org Git - libvpx/commitdiff
vpx_dsp: added vpx_highbd_idct32x32_1_add_sse2()
authorScott LaVarnway <slavarnway@google.com>
Wed, 7 Sep 2016 12:58:29 +0000 (05:58 -0700)
committerScott LaVarnway <slavarnway@google.com>
Wed, 7 Sep 2016 12:58:29 +0000 (05:58 -0700)
Change-Id: I140d93aebadb0eaf6220881e61a0451450081227

vpx_dsp/vpx_dsp_rtcd_defs.pl
vpx_dsp/x86/inv_txfm_sse2.c

index c7bad52226cf06d0ec64240a1ff2ef3bc811a81e..bac98fc8215c5da6aa30b39fe14daf218202fa25 100644 (file)
@@ -695,7 +695,7 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
   specialize qw/vpx_highbd_idct32x32_34_add/;
 
   add_proto qw/void vpx_highbd_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int bd";
-  specialize qw/vpx_highbd_idct32x32_1_add/;
+  specialize qw/vpx_highbd_idct32x32_1_add sse2/;
 
   add_proto qw/void vpx_highbd_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int bd";
   specialize qw/vpx_highbd_iwht4x4_1_add/;
index a6fc1161f120b99db58b6331ff2660bd9d5d02cb..330ae8d6a38933773d4d03ba3aef161990c64579 100644 (file)
@@ -4020,4 +4020,32 @@ void vpx_highbd_idct16x16_10_add_sse2(const tran_low_t *input, uint8_t *dest8,
     }
   }
 }
+
+void vpx_highbd_idct32x32_1_add_sse2(const tran_low_t *input, uint8_t *dest8,
+                                     int stride, int bd) {
+  __m128i dc_value, d;
+  const __m128i zero = _mm_setzero_si128();
+  const __m128i one = _mm_set1_epi16(1);
+  const __m128i max = _mm_subs_epi16(_mm_slli_epi16(one, bd), one);
+  int a, i, j;
+  uint16_t *dest = CONVERT_TO_SHORTPTR(dest8);
+  tran_low_t out;
+
+  out = highbd_dct_const_round_shift(input[0] * cospi_16_64);
+  out = highbd_dct_const_round_shift(out * cospi_16_64);
+  a = ROUND_POWER_OF_TWO(out, 6);
+
+  d = _mm_set1_epi32(a);
+  dc_value = _mm_packs_epi32(d, d);
+  for (i = 0; i < 32; ++i) {
+    for (j = 0; j < 4; ++j) {
+      d = _mm_loadu_si128((const __m128i *)(&dest[j * 8]));
+      d = _mm_adds_epi16(d, dc_value);
+      d = _mm_max_epi16(d, zero);
+      d = _mm_min_epi16(d, max);
+      _mm_storeu_si128((__m128i *)(&dest[j * 8]), d);
+    }
+    dest += stride;
+  }
+}
 #endif  // CONFIG_VP9_HIGHBITDEPTH