diff options
author | Måns Rullgård <mans@mansr.com> | 2009-08-24 10:36:13 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-08-24 10:36:13 +0000 |
commit | b662e8395b81ee58e8e9b293904314f8918c8fae (patch) | |
tree | 9ba997466ee49928c14812e6e3d6bf2f8570d11d /libavcodec/ppc/gmc_altivec.c | |
parent | 1feec476aa1afa25cdeaef358821f70d7648820f (diff) | |
download | ffmpeg-b662e8395b81ee58e8e9b293904314f8918c8fae.tar.gz |
PPC: simplify loading some values into altivec registers
Instead of filling a local array with the desired value and loading it,
load a single element and vec_splat() it to fill the vector.
Originally committed as revision 19691 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/gmc_altivec.c')
-rw-r--r-- | libavcodec/ppc/gmc_altivec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/ppc/gmc_altivec.c b/libavcodec/ppc/gmc_altivec.c index c77c7162b3..70c0cf9eb8 100644 --- a/libavcodec/ppc/gmc_altivec.c +++ b/libavcodec/ppc/gmc_altivec.c @@ -23,6 +23,7 @@ #include "libavcodec/dsputil.h" #include "dsputil_ppc.h" #include "util_altivec.h" +#include "types_altivec.h" /* altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8, @@ -32,9 +33,7 @@ void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder) { POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND); - const DECLARE_ALIGNED_16(unsigned short, rounder_a[8]) = - {rounder, rounder, rounder, rounder, - rounder, rounder, rounder, rounder}; + const DECLARE_ALIGNED_16(unsigned short, rounder_a) = rounder; const DECLARE_ALIGNED_16(unsigned short, ABCD[8]) = { (16-x16)*(16-y16), /* A */ @@ -60,7 +59,7 @@ POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND); Cv = vec_splat(tempA, 2); Dv = vec_splat(tempA, 3); - rounderV = vec_ld(0, (unsigned short*)rounder_a); + rounderV = vec_splat((vec_u16)vec_lde(0, &rounder_a), 0); // we'll be able to pick-up our 9 char elements // at src from those 32 bytes |