[FFmpeg-cvslog] r11881 - trunk/libavcodec/flacenc.c
michael
subversion
Sat Feb 9 04:42:48 CET 2008
Author: michael
Date: Sat Feb 9 04:42:48 2008
New Revision: 11881
Log:
optimize apply_welch_window()
Modified:
trunk/libavcodec/flacenc.c
Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c (original)
+++ trunk/libavcodec/flacenc.c Sat Feb 9 04:42:48 2008
@@ -595,11 +595,14 @@ static void apply_welch_window(const int
n2 = (len >> 1);
c = 2.0 / (len - 1.0);
+
+ w_data+=n2;
+ data+=n2;
for(i=0; i<n2; i++) {
- w = c - i - 1.0;
+ w = c - n2 + i;
w = 1.0 - (w * w);
- w_data[i] = data[i] * w;
- w_data[len-1-i] = data[len-1-i] * w;
+ w_data[-i-1] = data[-i-1] * w;
+ w_data[+i ] = data[+i ] * w;
}
}
More information about the ffmpeg-cvslog
mailing list