summaryrefslogtreecommitdiff
path: root/vpx_dsp/ppc/intrapred_vsx.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2017-04-08 02:55:33 +0000
committerJames Zern <jzern@google.com>2017-04-19 19:49:31 -0700
commitad9dea1f6d1cea9c704c4f936742288ac5c0c2c6 (patch)
tree85e3c6db07f6383bcb246baaef705652d0a42922 /vpx_dsp/ppc/intrapred_vsx.c
parentd68d37872c82ab81da384a65ce17b684d4e2cc24 (diff)
downloadlibvpx-ad9dea1f6d1cea9c704c4f936742288ac5c0c2c6.tar
libvpx-ad9dea1f6d1cea9c704c4f936742288ac5c0c2c6.tar.gz
libvpx-ad9dea1f6d1cea9c704c4f936742288ac5c0c2c6.tar.bz2
libvpx-ad9dea1f6d1cea9c704c4f936742288ac5c0c2c6.zip
ppc: dc top and left predictor 16x16
13x faster. Change-Id: I1771ac39fda599153f933cb3f0506c9f97a6cbe6
Diffstat (limited to 'vpx_dsp/ppc/intrapred_vsx.c')
-rw-r--r--vpx_dsp/ppc/intrapred_vsx.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/vpx_dsp/ppc/intrapred_vsx.c b/vpx_dsp/ppc/intrapred_vsx.c
index 9350170f3..71c35e3e3 100644
--- a/vpx_dsp/ppc/intrapred_vsx.c
+++ b/vpx_dsp/ppc/intrapred_vsx.c
@@ -398,3 +398,28 @@ void vpx_dc_128_predictor_32x32_vsx(uint8_t *dst, ptrdiff_t stride,
dc_fill_predictor_32x32(dst, stride, v128);
}
+
+static uint8x16_t avg16(const uint8_t *values) {
+ const int32x4_t sum4s =
+ (int32x4_t)vec_sum4s(vec_vsx_ld(0, values), vec_splat_u32(0));
+ const uint32x4_t sum = (uint32x4_t)vec_sums(sum4s, vec_splat_s32(8));
+ const uint32x4_t avg = (uint32x4_t)vec_sr(sum, vec_splat_u32(4));
+
+ return vec_splat(vec_pack(vec_pack(avg, vec_splat_u32(0)), vec_splat_u16(0)),
+ 3);
+}
+
+void vpx_dc_left_predictor_16x16_vsx(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *above,
+ const uint8_t *left) {
+ (void)above;
+
+ dc_fill_predictor_16x16(dst, stride, avg16(left));
+}
+
+void vpx_dc_top_predictor_16x16_vsx(uint8_t *dst, ptrdiff_t stride,
+ const uint8_t *above, const uint8_t *left) {
+ (void)left;
+
+ dc_fill_predictor_16x16(dst, stride, avg16(above));
+}