Mercurial > libavcodec.hg
diff dsputil.c @ 7263:fc843d00867c libavcodec
exploit mdct symmetry
2% faster vorbis on conroe, k8. 7% on celeron.
author | lorenm |
---|---|
date | Sun, 13 Jul 2008 15:03:58 +0000 |
parents | 032a49f033e8 |
children | e267f2519248 |
line wrap: on
line diff
--- a/dsputil.c Sun Jul 13 14:59:39 2008 +0000 +++ b/dsputil.c Sun Jul 13 15:03:58 2008 +0000 @@ -3931,9 +3931,18 @@ } void ff_vector_fmul_window_c(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len){ - int i; - for(i=0; i<len; i++) - dst[i] = src0[i]*win[len-i-1] + src1[i]*win[i] + add_bias; + int i,j; + dst += len; + win += len; + src0+= len; + for(i=-len, j=len-1; i<0; i++, j--) { + float s0 = src0[i]; + float s1 = src1[j]; + float wi = win[i]; + float wj = win[j]; + dst[i] = s0*wj - s1*wi + add_bias; + dst[j] = s0*wi + s1*wj + add_bias; + } } static av_always_inline int float_to_int16_one(const float *src){