Browse code

Be sure to increment our position in the coefficient array when skipping a zero band in the twoloop scalefactor search.

Originally committed as revision 19480 to svn://svn.ffmpeg.org/ffmpeg/trunk

Alex Converse authored on 2009/07/22 12:53:30
Showing 2 changed files
... ...
@@ -677,8 +677,10 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
677 677
                     float mindist = INFINITY;
678 678
                     int minbits = 0;
679 679
 
680
-                    if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218)
680
+                    if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
681
+                        start += sce->ics.swb_sizes[g];
681 682
                         continue;
683
+                    }
682 684
                     minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
683 685
                     for (cb = 0; cb <= ESC_BT; cb++) {
684 686
                         float dist = 0.0f;
... ...
@@ -193,7 +193,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
193 193
     lengths[1] = ff_aac_num_swb_128[i];
194 194
     ff_psy_init(&s->psy, avctx, 2, sizes, lengths);
195 195
     s->psypp = ff_psy_preprocess_init(avctx);
196
-    s->coder = &ff_aac_coders[0];
196
+    s->coder = &ff_aac_coders[2];
197 197
 
198 198
     s->lambda = avctx->global_quality ? avctx->global_quality : 120;
199 199
 #if !CONFIG_HARDCODED_TABLES