[FFmpeg-cvslog] ratecontrol: estimate twice the qscale values

Luca Barbato git at videolan.org
Mon Oct 17 03:49:03 CEST 2011


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Fri Sep 16 19:54:03 2011 +0200| [fe896ec2f9c416da3313e605c67458ee3773d639] | committer: Luca Barbato

ratecontrol: estimate twice the qscale values

This had been the fix used by Michael Niedermayer to solve the
ratecontrol convergence issue.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fe896ec2f9c416da3313e605c67458ee3773d639
---

 libavcodec/ratecontrol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index e984ed5..64dab15 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -862,8 +862,8 @@ static int init_pass2(MpegEncContext *s)
         /* find qscale */
         for(i=0; i<rcc->num_entries; i++){
             RateControlEntry *rce= &rcc->entry[i];
-            qscale[i]= get_qscale(s, &rcc->entry[i], rate_factor, i);
-            rcc->last_qscale_for[rce->pict_type] = qscale[i];
+            double q = get_qscale(s, &rcc->entry[i], rate_factor, i);
+            qscale[i] = get_diff_limited_q(s, rce, q);
         }
         assert(filter_size%2==1);
 



More information about the ffmpeg-cvslog mailing list