aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2006-08-03 13:19:32 +0000
committerLuca Barbato <lu_zero@gentoo.org>2006-08-03 13:19:32 +0000
commit3b0df5254ef7dd9570dfb8ac36dea47f6fb0e12a (patch)
tree74824d48af46c22986bd23cf373f24ac90647549 /libavcodec
parent90530cec20604e5e2b015529c3be6cc06c6bb049 (diff)
downloadffmpeg-3b0df5254ef7dd9570dfb8ac36dea47f6fb0e12a.tar.gz
vorbis_inverse_coupling_altivec
Originally committed as revision 5914 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ppc/dsputil_altivec.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c
index 4c32f721f9..f292bf6143 100644
--- a/libavcodec/ppc/dsputil_altivec.c
+++ b/libavcodec/ppc/dsputil_altivec.c
@@ -1698,6 +1698,29 @@ int has_altivec(void)
#endif /* __AMIGAOS4__ */
}
+static void vorbis_inverse_coupling_altivec(float *mag, float *ang,
+ int blocksize)
+{
+ int i;
+ vector float m, a;
+ vector bool int t0, t1;
+ const vector unsigned int v_31 = //XXX
+ vec_add(vec_add(vec_splat_u32(15),vec_splat_u32(15)),vec_splat_u32(1));
+ for(i=0; i<blocksize; i+=4) {
+ m = vec_ld(0, mag+i);
+ a = vec_ld(0, ang+i);
+ t0 = vec_cmple(m, (vector float)vec_splat_u32(0));
+ t1 = vec_cmple(a, (vector float)vec_splat_u32(0));
+ a = vec_xor(a, vec_sl((vector unsigned int)t0, v_31)); // (a ^ sign(m))
+ t0 = vec_and(a, t1);
+ t1 = vec_andc(a, t1);
+ a = vec_add(m, t0);
+ m = vec_sub(m, t1);
+ vec_ste(a, 0, ang+i);
+ vec_ste(m, 0, mag+i);
+ }
+}
+
/* next one assumes that ((line_size % 8) == 0) */
void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{