diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2017-05-11 03:58:34 +0000 |
---|---|---|
committer | James Zern <jzern@google.com> | 2017-05-12 17:23:00 +0200 |
commit | 143b21e362efadf432352e57666d8d9853492d88 (patch) | |
tree | 720352f2ab29630e22270f5524e12e4ee253d573 /vpx_dsp/ppc/variance_vsx.c | |
parent | 6d225eb5f972f6a0d7b6eac7df652f5b664e2b31 (diff) | |
download | libvpx-143b21e362efadf432352e57666d8d9853492d88.tar libvpx-143b21e362efadf432352e57666d8d9853492d88.tar.gz libvpx-143b21e362efadf432352e57666d8d9853492d88.tar.bz2 libvpx-143b21e362efadf432352e57666d8d9853492d88.zip |
ppc: Add get_mb_ss_vsx
Change-Id: I1b54a7a5bb642e4b836d786ea1ae506eed025e3f
Diffstat (limited to 'vpx_dsp/ppc/variance_vsx.c')
-rw-r--r-- | vpx_dsp/ppc/variance_vsx.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vpx_dsp/ppc/variance_vsx.c b/vpx_dsp/ppc/variance_vsx.c index 8eb6f1a12..1efe2f005 100644 --- a/vpx_dsp/ppc/variance_vsx.c +++ b/vpx_dsp/ppc/variance_vsx.c @@ -38,6 +38,23 @@ uint32_t vpx_get4x4sse_cs_vsx(const uint8_t *a, int a_stride, const uint8_t *b, return distortion; } +// TODO(lu_zero): Unroll +uint32_t vpx_get_mb_ss_vsx(const int16_t *a) { + unsigned int i, sum = 0; + int32x4_t s = vec_splat_s32(0); + + for (i = 0; i < 256; i += 8) { + const int16x8_t v = vec_vsx_ld(0, a + i); + s = vec_msum(v, v, s); + } + + s = vec_splat(vec_sums(s, vec_splat_s32(0)), 3); + + vec_ste((uint32x4_t)s, 0, &sum); + + return sum; +} + void vpx_comp_avg_pred_vsx(uint8_t *comp_pred, const uint8_t *pred, int width, int height, const uint8_t *ref, int ref_stride) { int i, j; |