[FFmpeg-soc] [soc]: r3328 - in aacenc: aacenc.c aacpsy.c

kostya subversion at mplayerhq.hu
Fri Aug 15 18:53:30 CEST 2008


Author: kostya
Date: Fri Aug 15 18:53:30 2008
New Revision: 3328

Log:
Mark unused scalefactors so they won't create a problem when coding an empty band with nonzero codebook

Modified:
   aacenc/aacenc.c
   aacenc/aacpsy.c

Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c	(original)
+++ aacenc/aacenc.c	Fri Aug 15 18:53:30 2008
@@ -523,6 +523,7 @@ static void encode_scale_factors(AVCodec
     for(wg = 0; wg < cpe->ch[channel].ics.num_window_groups; wg++){
         for(i = 0; i < cpe->ch[channel].ics.max_sfb; i++){
             if(!cpe->ch[channel].zeroes[w][i]){
+                if(cpe->ch[channel].sf_idx[w][i] == 256) cpe->ch[channel].sf_idx[w][i] = off;
                 diff = cpe->ch[channel].sf_idx[w][i] - off + SCALE_DIFF_ZERO;
                 if(diff < 0 || diff > 120) av_log(avctx, AV_LOG_ERROR, "Scalefactor difference is too big to be coded\n");
                 off = cpe->ch[channel].sf_idx[w][i];

Modified: aacenc/aacpsy.c
==============================================================================
--- aacenc/aacpsy.c	(original)
+++ aacenc/aacpsy.c	Fri Aug 15 18:53:30 2008
@@ -794,8 +794,10 @@ static void psy_3gpp_process(AACPsyConte
             }
         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].zeroes[w][g])
+                    cpe->ch[ch].sf_idx[w][g] = 256;
+                else
+                    cpe->ch[ch].sf_idx[w][g] = av_clip(SCALE_ONE_POS + cpe->ch[ch].sf_idx[w][g], 0, SCALE_MAX_POS);
             }
 
         //adjust scalefactors for window groups



More information about the FFmpeg-soc mailing list