[FFmpeg-cvslog] rc: finetune convergence failure fix

Michael Niedermayer git at videolan.org
Fri Sep 9 19:00:37 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Sep  9 18:50:00 2011 +0200| [73e0ec2ff453799e361c67395b93df11986609b3] | committer: Michael Niedermayer

rc: finetune convergence failure fix

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 1c29dbd..d085f04 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -866,7 +866,7 @@ 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++){
+        for(i=FFMAX(0, rcc->num_entries-300); i<rcc->num_entries; i++){
             RateControlEntry *rce= &rcc->entry[i];
 
             qscale[i]= get_diff_limited_q(s, rce, qscale[i]);



More information about the ffmpeg-cvslog mailing list