[FFmpeg-cvslog] r18498 - trunk/libavcodec/flacenc.c
koorogi
subversion
Mon Apr 13 20:07:02 CEST 2009
Author: koorogi
Date: Mon Apr 13 20:07:02 2009
New Revision: 18498
Log:
Skip loop iterations which are no-ops due to data1[-lag..-1] being zero.
Modified:
trunk/libavcodec/flacenc.c
Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c Mon Apr 13 18:59:38 2009 (r18497)
+++ trunk/libavcodec/flacenc.c Mon Apr 13 20:07:02 2009 (r18498)
@@ -594,7 +594,7 @@ void ff_flac_compute_autocorr(const int3
for(j=0; j<lag; j+=2){
double sum0 = 1.0, sum1 = 1.0;
- for(i=0; i<len; i++){
+ for(i=j; i<len; i++){
sum0 += data1[i] * data1[i-j];
sum1 += data1[i] * data1[i-j-1];
}
@@ -604,7 +604,7 @@ void ff_flac_compute_autocorr(const int3
if(j==lag){
double sum = 1.0;
- for(i=0; i<len; i+=2){
+ for(i=j-1; i<len; i+=2){
sum += data1[i ] * data1[i-j ]
+ data1[i+1] * data1[i-j+1];
}
More information about the ffmpeg-cvslog
mailing list