]> git.videolan.org Git - x264.git/commitdiff
Fix I and B-frame QPs with threads
authorAnton Mitrofanov <BugMaster@narod.ru>
Tue, 16 Feb 2010 17:41:55 +0000 (09:41 -0800)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Tue, 16 Feb 2010 23:00:17 +0000 (15:00 -0800)
Rounding errors resulted in slightly wrong QPs with threads enabled.

encoder/ratecontrol.c

index 8c6158293d770c3db589343c41b4b243b81307da..3d86aaac006b3c445ed705386c1d19fc2d90aac3 100644 (file)
@@ -1077,15 +1077,15 @@ void x264_ratecontrol_start( x264_t *h, int i_force_qp, int overhead )
 
     rc->qpa_rc =
     rc->qpa_aq = 0;
-    h->fdec->f_qp_avg_rc =
-    h->fdec->f_qp_avg_aq =
     rc->qpm =
     rc->qp = x264_clip3( (int)(q + 0.5), 0, 51 );
+    h->fdec->f_qp_avg_rc =
+    h->fdec->f_qp_avg_aq =
     rc->f_qpm = q;
     if( rce )
         rce->new_qp = rc->qp;
 
-    accum_p_qp_update( h, rc->qp );
+    accum_p_qp_update( h, rc->f_qpm );
 
     if( h->sh.i_type != SLICE_TYPE_B )
         rc->last_non_b_pict_type = h->sh.i_type;