From e1f27dc22b5b441553e84d3ed0c8aa504591c278 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 23 Aug 2008 21:09:46 +0000 Subject: Introduce float_to_int16_interleave_altivec, tested with vorbis Originally committed as revision 14928 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ppc/float_altivec.c | 55 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'libavcodec/ppc') diff --git a/libavcodec/ppc/float_altivec.c b/libavcodec/ppc/float_altivec.c index 298172554d..600ce2774e 100644 --- a/libavcodec/ppc/float_altivec.c +++ b/libavcodec/ppc/float_altivec.c @@ -186,11 +186,64 @@ void float_to_int16_altivec(int16_t *dst, const float *src, int len) } } +static void +float_to_int16_interleave_altivec(int16_t *dst, const float **src, + long len, int channels) +{ + int i; + vector signed short d0, d1, d2, c0, c1, t0, t1; + vector unsigned char align; + if(channels == 1) + float_to_int16_altivec(dst, src[0], len); + else + if (channels == 2) { + if(((long)dst)&15) + for(i=0; ivector_fmul = vector_fmul_altivec; c->vector_fmul_reverse = vector_fmul_reverse_altivec; c->vector_fmul_add_add = vector_fmul_add_add_altivec; - if(!(avctx->flags & CODEC_FLAG_BITEXACT)) + if(!(avctx->flags & CODEC_FLAG_BITEXACT)) { c->float_to_int16 = float_to_int16_altivec; + c->float_to_int16_interleave = float_to_int16_interleave_altivec; + } } -- cgit v1.2.3