[FFmpeg-soc] [soc]: r2963 - aacenc/aacpsy.c
kostya
subversion at mplayerhq.hu
Thu Jul 31 19:04:08 CEST 2008
Author: kostya
Date: Thu Jul 31 19:04:08 2008
New Revision: 2963
Log:
Scalefactors limit should be calculated and applied over full frame, not an individual window
Modified:
aacenc/aacpsy.c
Modified: aacenc/aacpsy.c
==============================================================================
--- aacenc/aacpsy.c (original)
+++ aacenc/aacpsy.c Thu Jul 31 19:04:08 2008
@@ -745,21 +745,25 @@ static void psy_3gpp_process(AACPsyConte
cpe->ch[ch].sf_idx[w][g] = av_clip(cpe->ch[ch].sf_idx[w][g], prev_scale - SCALE_MAX_DIFF, prev_scale + SCALE_MAX_DIFF);
prev_scale = cpe->ch[ch].sf_idx[w][g];
}
+ }
//limit scalefactors
+ for(w = 0; w < cpe->ch[ch].ics.num_windows; w++)
for(g = 0; g < cpe->ch[ch].ics.num_swb; g++){
if(cpe->ch[ch].zeroes[w][g]) continue;
min_scale = FFMIN(min_scale, cpe->ch[ch].sf_idx[w][g]);
}
+ for(w = 0; w < cpe->ch[ch].ics.num_windows; w++)
for(g = 0; g < cpe->ch[ch].ics.num_swb; g++){
if(cpe->ch[ch].zeroes[w][g]) continue;
cpe->ch[ch].sf_idx[w][g] = FFMIN(cpe->ch[ch].sf_idx[w][g], min_scale + SCALE_MAX_DIFF);
}
+ for(w = 0; w < cpe->ch[ch].ics.num_windows; w++)
for(g = 0; g < cpe->ch[ch].ics.num_swb; g++){
if(cpe->ch[ch].zeroes[w][g]) continue;
cpe->ch[ch].sf_idx[w][g] = av_clip(SCALE_ONE_POS + cpe->ch[ch].sf_idx[w][g], 0, SCALE_MAX_POS);
if(!cpe->ch[ch].gain) cpe->ch[ch].gain = cpe->ch[ch].sf_idx[w][g];
}
- }
+
//adjust scalefactors for window groups
for(w = 0; w < cpe->ch[ch].ics.num_windows - 1; w++){
int min_scale = 256;
More information about the FFmpeg-soc
mailing list