Mercurial > libavcodec.hg
diff ppc/float_altivec.c @ 10300:4d1b9ca628fc libavcodec
Drop unused args from vector_fmul_add_add, simpify code, and rename
The src3 and step arguments to vector_fmul_add_add() are always zero
and one, respectively. This removes these arguments from the function,
simplifies the code accordingly, and renames the function to better
match the new operation.
author | mru |
---|---|
date | Sun, 27 Sep 2009 16:51:54 +0000 |
parents | dd2b5e52336a |
children | 02798c603744 |
line wrap: on
line diff
--- a/ppc/float_altivec.c Sun Sep 27 09:43:11 2009 +0000 +++ b/ppc/float_altivec.c Sun Sep 27 16:51:54 2009 +0000 @@ -66,71 +66,15 @@ } } -static void vector_fmul_add_add_altivec(float *dst, const float *src0, - const float *src1, const float *src2, - int src3, int len, int step) +static void vector_fmul_add_altivec(float *dst, const float *src0, + const float *src1, const float *src2, + int len) { int i; vector float d, s0, s1, s2, t0, t1, edges; vector unsigned char align = vec_lvsr(0,dst), mask = vec_lvsl(0, dst); -#if 0 //FIXME: there is still something wrong - if (step == 2) { - int y; - vector float d0, d1, s3, t2; - vector unsigned int sel = - vec_mergeh(vec_splat_u32(-1), vec_splat_u32(0)); - t1 = vec_ld(16, dst); - for (i=0,y=0; i<len-3; i+=4,y+=8) { - - s0 = vec_ld(0,src0+i); - s1 = vec_ld(0,src1+i); - s2 = vec_ld(0,src2+i); - -// t0 = vec_ld(0, dst+y); //[x x x|a] -// t1 = vec_ld(16, dst+y); //[b c d|e] - t2 = vec_ld(31, dst+y); //[f g h|x] - - d = vec_madd(s0,s1,s2); // [A B C D] - - // [A A B B] - - // [C C D D] - - d0 = vec_perm(t0, t1, mask); // [a b c d] - - d0 = vec_sel(vec_mergeh(d, d), d0, sel); // [A b B d] - - edges = vec_perm(t1, t0, mask); - - t0 = vec_perm(edges, d0, align); // [x x x|A] - - t1 = vec_perm(d0, edges, align); // [b B d|e] - - vec_stl(t0, 0, dst+y); - - d1 = vec_perm(t1, t2, mask); // [e f g h] - - d1 = vec_sel(vec_mergel(d, d), d1, sel); // [C f D h] - - edges = vec_perm(t2, t1, mask); - - t1 = vec_perm(edges, d1, align); // [b B d|C] - - t2 = vec_perm(d1, edges, align); // [f D h|x] - - vec_stl(t1, 16, dst+y); - - t0 = t1; - - vec_stl(t2, 31, dst+y); - - t1 = t2; - } - } else - #endif - if (step == 1 && src3 == 0) for (i=0; i<len-3; i+=4) { t0 = vec_ld(0, dst+i); t1 = vec_ld(15, dst+i); @@ -144,8 +88,6 @@ vec_st(t1, 15, dst+i); vec_st(t0, 0, dst+i); } - else - ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step); } static void vector_fmul_window_altivec(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len) @@ -299,7 +241,7 @@ { c->vector_fmul = vector_fmul_altivec; c->vector_fmul_reverse = vector_fmul_reverse_altivec; - c->vector_fmul_add_add = vector_fmul_add_add_altivec; + c->vector_fmul_add = vector_fmul_add_altivec; c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec; if(!(avctx->flags & CODEC_FLAG_BITEXACT)) { c->vector_fmul_window = vector_fmul_window_altivec;