[x264-devel] Fix crash with VBV + forced QP

Anton Mitrofanov git at videolan.org
Wed Jun 15 04:54:16 CEST 2011


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue May 31 00:13:22 2011 +0400| [774555b37ab6f3c2df7b1e2ac576c54e04a7381e] | committer: Jason Garrett-Glaser

Fix crash with VBV + forced QP

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

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

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index af15d1f..2e90fbe 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1256,11 +1256,7 @@ void x264_ratecontrol_start( x264_t *h, int i_force_qp, int overhead )
     if( h->sh.i_type != SLICE_TYPE_B )
         rc->bframes = h->fenc->i_bframes;
 
-    if( i_force_qp != X264_QP_AUTO )
-    {
-        q = i_force_qp - 1;
-    }
-    else if( rc->b_abr )
+    if( rc->b_abr )
     {
         q = qscale2qp( rate_estimate_qscale( h ) );
     }
@@ -1284,6 +1280,8 @@ void x264_ratecontrol_start( x264_t *h, int i_force_qp, int overhead )
                 q -= 6*log2f( zone->f_bitrate_factor );
         }
     }
+    if( i_force_qp != X264_QP_AUTO )
+        q = i_force_qp - 1;
 
     q = x264_clip3f( q, h->param.rc.i_qp_min, h->param.rc.i_qp_max );
 



More information about the x264-devel mailing list