]> granicus.if.org Git - libvpx/commitdiff
ppc: d63 predictor 16x16
authorLuca Barbato <lu_zero@gentoo.org>
Sun, 9 Apr 2017 00:09:56 +0000 (00:09 +0000)
committerJames Zern <jzern@google.com>
Thu, 20 Apr 2017 02:57:51 +0000 (19:57 -0700)
About 18x faster.

Change-Id: Id043bf76c011e03e992085bb5e20f330d3e98cd4

test/test_intra_pred_speed.cc
vpx_dsp/ppc/intrapred_vsx.c
vpx_dsp/vpx_dsp_rtcd_defs.pl

index 0e89dfb0e5e8ddcee02bf9d18b62bf3d632ba2ef..e578d430fbfcb69a7ab43f78611b64b1d79fb5a0 100644 (file)
@@ -320,7 +320,8 @@ INTRA_PRED_TEST(VSX, TestIntraPred16, vpx_dc_predictor_16x16_vsx,
                 vpx_dc_left_predictor_16x16_vsx, vpx_dc_top_predictor_16x16_vsx,
                 vpx_dc_128_predictor_16x16_vsx, vpx_v_predictor_16x16_vsx,
                 vpx_h_predictor_16x16_vsx, vpx_d45_predictor_16x16_vsx, NULL,
-                NULL, NULL, NULL, NULL, vpx_tm_predictor_16x16_vsx)
+                NULL, NULL, NULL, vpx_d63_predictor_16x16_vsx,
+                vpx_tm_predictor_16x16_vsx)
 
 INTRA_PRED_TEST(VSX, TestIntraPred32, vpx_dc_predictor_32x32_vsx,
                 vpx_dc_left_predictor_32x32_vsx, vpx_dc_top_predictor_32x32_vsx,
index dba062762b341f176aefea4252a150c445fe27b2..5a00c3debf9793e749ea1da240267591da1657c7 100644 (file)
@@ -541,3 +541,24 @@ void vpx_d45_predictor_32x32_vsx(uint8_t *dst, ptrdiff_t stride,
     row1 = vec_perm(row1, above_right, sl1);
   }
 }
+
+void vpx_d63_predictor_16x16_vsx(uint8_t *dst, ptrdiff_t stride,
+                                 const uint8_t *above, const uint8_t *left) {
+  const uint8x16_t a0 = vec_vsx_ld(0, above);
+  const uint8x16_t a1 = vec_vsx_ld(16, above);
+  const uint8x16_t above_right = vec_splat(a1, 0);
+  const uint8x16_t b = vec_perm(a0, above_right, sl1);
+  const uint8x16_t c = vec_perm(b, above_right, sl1);
+  uint8x16_t row0 = vec_avg(a0, b);
+  uint8x16_t row1 = avg3(a0, b, c);
+  int i;
+  (void)left;
+
+  for (i = 0; i < 8; i++) {
+    vec_vsx_st(row0, 0, dst);
+    vec_vsx_st(row1, 0, dst + stride);
+    dst += stride * 2;
+    row0 = vec_perm(row0, above_right, sl1);
+    row1 = vec_perm(row1, above_right, sl1);
+  }
+}
index ac08d0d9c6f000342853b8eb70f62722faed9cc5..8c65c17bd0deb66c8ced56c8765b163a11054ff7 100644 (file)
@@ -116,7 +116,7 @@ add_proto qw/void vpx_d45_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, c
 specialize qw/vpx_d45_predictor_16x16 neon ssse3 vsx/;
 
 add_proto qw/void vpx_d63_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/vpx_d63_predictor_16x16 ssse3/;
+specialize qw/vpx_d63_predictor_16x16 ssse3 vsx/;
 
 add_proto qw/void vpx_h_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
 specialize qw/vpx_h_predictor_16x16 neon dspr2 msa sse2 vsx/;