# HG changeset patch # User gpoirier # Date 1229507226 0 # Node ID d33b47d1f4c12f0f8418234beb2813cce5ce1092 # Parent 4a01f7144da547512d407bd0e6d7e9e87766c77f add AltiVec implementation of int32_to_float_fmul_scalar diff -r 4a01f7144da5 -r d33b47d1f4c1 ppc/float_altivec.c --- a/ppc/float_altivec.c Wed Dec 17 03:41:48 2008 +0000 +++ b/ppc/float_altivec.c Wed Dec 17 09:47:06 2008 +0000 @@ -150,6 +150,30 @@ } +static void int32_to_float_fmul_scalar_altivec(float *dst, const int *src, float mul, int len) +{ + union { + vector float v; + float s[4]; + } mul_u; + int i; + vector float src1, src2, dst1, dst2, mul_v, zero; + + zero = (vector float)vec_splat_u32(0); + mul_u.s[0] = mul; + mul_v = vec_splat(mul_u.v, 0); + + 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; + c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec; if(!(avctx->flags & CODEC_FLAG_BITEXACT)) { c->float_to_int16 = float_to_int16_altivec; c->float_to_int16_interleave = float_to_int16_interleave_altivec;