From: Anton Mitrofanov Date: Tue, 16 Feb 2010 17:41:55 +0000 (-0800) Subject: Fix I and B-frame QPs with threads X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=4784723450ae1dd28ede1ff04a93f1849d6444e5;p=x264.git Fix I and B-frame QPs with threads Rounding errors resulted in slightly wrong QPs with threads enabled. --- diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index 8c615829..3d86aaac 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -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;