aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2008-07-13 15:03:58 +0000
committerLoren Merritt <lorenm@u.washington.edu>2008-07-13 15:03:58 +0000
commitb9fa32082c71013e90eab9e9997967d2939cf4a6 (patch)
tree83edd135988c73a75b017fbd12396e156de5e0a4 /libavcodec/dsputil.c
parenteb2cd99c73df74cba8ce0173f9ee2b70313adaa6 (diff)
downloadffmpeg-b9fa32082c71013e90eab9e9997967d2939cf4a6.tar.gz
exploit mdct symmetry
2% faster vorbis on conroe, k8. 7% on celeron. Originally committed as revision 14207 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 55929d0e76..212e2415da 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -3931,9 +3931,18 @@ void ff_vector_fmul_add_add_c(float *dst, const float *src0, const float *src1,
}
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){