[x264-devel] commit: Fix a potential failure in VBV (Jason Garrett-Glaser )

git version control git at videolan.org
Mon Aug 17 20:30:35 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Thu Aug 13 17:13:33 2009 -0700| [8236cc979e1b4d8aae1aecbaae28c3017e375a6f] | committer: Jason Garrett-Glaser 

Fix a potential failure in VBV
If VBV does underflow, ratecontrol could be permanently broken for the rest of the clip.
Revert part of the previous VBV changes to fix this.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=8236cc979e1b4d8aae1aecbaae28c3017e375a6f
---

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

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index f60fc43..8eaa178 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1459,7 +1459,7 @@ static double clip_qscale( x264_t *h, int pict_type, double q )
         double bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd );
         double qf = 1.0;
         if( bits > rcc->buffer_fill/2 )
-            qf = rcc->buffer_fill/(2*bits);
+            qf = x264_clip3f( rcc->buffer_fill/(2*bits), 0.2, 1.0 );
         q /= qf;
         bits *= qf;
         if( bits < rcc->buffer_rate/2 )



More information about the x264-devel mailing list