]> granicus.if.org Git - libx264/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)
committerFiona Glaser <fiona@x264.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 90baaba9b5c4c8ec85bd83191d89bf0fe4150d15..75c600ab73748a32da4d0590df3a40da5115e609 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;