aacenc: Prevent premature termination of the two loop search.
authorAlex Converse <alex.converse@gmail.com>
Sat, 24 Jul 2010 04:23:26 +0000 (04:23 +0000)
committerAlex Converse <alex.converse@gmail.com>
Sat, 24 Jul 2010 04:23:26 +0000 (04:23 +0000)
Originally committed as revision 24476 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/aaccoder.c

index b0945ed..9d768d4 100644 (file)
@@ -795,10 +795,8 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
                         sce->sf_idx[i] -= qstep;
             }
             qstep >>= 1;
-            if (!qstep && tbits > destbits*1.02)
+            if (!qstep && tbits > destbits*1.02 && sce->sf_idx[0] < 217)
                 qstep = 1;
-            if (sce->sf_idx[0] >= 217)
-                break;
         } while (qstep);
 
         fflag = 0;