rc: fix convergence failure
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Sep 2011 16:06:51 +0000 (18:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Sep 2011 16:06:51 +0000 (18:06 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ratecontrol.c

index af8289e..1c29dbd 100644 (file)
@@ -866,6 +866,12 @@ static int init_pass2(MpegEncContext *s)
         assert(filter_size%2==1);
 
         /* fixed I/B QP relative to P mode */
+        for(i=0; i<rcc->num_entries; i++){
+            RateControlEntry *rce= &rcc->entry[i];
+
+            qscale[i]= get_diff_limited_q(s, rce, qscale[i]);
+        }
+
         for(i=rcc->num_entries-1; i>=0; i--){
             RateControlEntry *rce= &rcc->entry[i];