]> git.videolan.org Git - x264.git/commitdiff
Prevent VBV from lowering quantizer too much
authorJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 9 Aug 2008 15:36:04 +0000 (09:36 -0600)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 9 Aug 2008 15:41:04 +0000 (09:41 -0600)
This code seemed to act up unexpectedly sometimes, creating a situation where in 1-pass VBV mode, a frame's quantizer would drop all the way to qpmin and then shoot back upwards to qpmax, causing serious visual issues.
This change may decrease bitrate in VBV mode, but that is preferable to the artifacting produced by this code.

encoder/ratecontrol.c

index 10f4df0652f06dde018bd5061ca3d12e9cfa1f1f..fc60c025f8c6f1e5d84deb35eaa3cfca351a9c78 100644 (file)
@@ -977,7 +977,7 @@ void x264_ratecontrol_mb( x264_t *h, int bits )
             }
 
             while( rc->qpm > i_qp_min
-                   && ((buffer_left_planned > rc->buffer_size * 0.4) || rc->qpm > h->fdec->i_row_qp[0])
+                   && rc->qpm > h->fdec->i_row_qp[0]
                    && ((b1 < rc->frame_size_planned * 0.8 && rc->qpm <= prev_row_qp)
                      || b1 < (rc->buffer_fill - rc->buffer_size + rc->buffer_rate) * 1.1) )
             {