6x faster.
Change-Id: I717995b4056e5579c68191d11b495372971fe1ae
vpx_v_predictor_16x16_vsx, vpx_h_predictor_16x16_vsx, NULL,
NULL, NULL, NULL, NULL, NULL, vpx_tm_predictor_16x16_vsx)
-INTRA_PRED_TEST(VSX, TestIntraPred32, NULL, NULL, NULL,
- vpx_dc_128_predictor_32x32_vsx, vpx_v_predictor_32x32_vsx,
- vpx_h_predictor_32x32_vsx, NULL, NULL, NULL, NULL, NULL, NULL,
- vpx_tm_predictor_32x32_vsx)
+INTRA_PRED_TEST(VSX, TestIntraPred32, NULL, vpx_dc_left_predictor_32x32_vsx,
+ vpx_dc_top_predictor_32x32_vsx, vpx_dc_128_predictor_32x32_vsx,
+ vpx_v_predictor_32x32_vsx, vpx_h_predictor_32x32_vsx, NULL,
+ NULL, NULL, NULL, NULL, NULL, vpx_tm_predictor_32x32_vsx)
#endif // HAVE_VSX
// -----------------------------------------------------------------------------
dc_fill_predictor_16x16(dst, stride, avg16(above));
}
+
+static uint8x16_t avg32(const uint8_t *values) {
+ const uint8x16_t v0 = vec_vsx_ld(0, values);
+ const uint8x16_t v1 = vec_vsx_ld(16, values);
+ const int32x4_t v16 = vec_sl(vec_splat_s32(1), vec_splat_u32(4));
+ const int32x4_t sum4s =
+ (int32x4_t)vec_sum4s(v0, vec_sum4s(v1, vec_splat_u32(0)));
+ const uint32x4_t sum = (uint32x4_t)vec_sums(sum4s, v16);
+ const uint32x4_t avg = (uint32x4_t)vec_sr(sum, vec_splat_u32(5));
+
+ return vec_splat(vec_pack(vec_pack(avg, vec_splat_u32(0)), vec_splat_u16(0)),
+ 3);
+}
+
+void vpx_dc_left_predictor_32x32_vsx(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *above,
+ const uint8_t *left) {
+ (void)above;
+
+ dc_fill_predictor_32x32(dst, stride, avg32(left));
+}
+
+void vpx_dc_top_predictor_32x32_vsx(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *above, const uint8_t *left) {
+ (void)left;
+
+ dc_fill_predictor_32x32(dst, stride, avg32(above));
+}
specialize qw/vpx_dc_predictor_32x32 msa neon sse2/;
add_proto qw/void vpx_dc_top_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/vpx_dc_top_predictor_32x32 msa neon sse2/;
+specialize qw/vpx_dc_top_predictor_32x32 msa neon sse2 vsx/;
add_proto qw/void vpx_dc_left_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
-specialize qw/vpx_dc_left_predictor_32x32 msa neon sse2/;
+specialize qw/vpx_dc_left_predictor_32x32 msa neon sse2 vsx/;
add_proto qw/void vpx_dc_128_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
specialize qw/vpx_dc_128_predictor_32x32 msa neon sse2 vsx/;