From 4784723450ae1dd28ede1ff04a93f1849d6444e5 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Tue, 16 Feb 2010 09:41:55 -0800 Subject: [PATCH] Fix I and B-frame QPs with threads Rounding errors resulted in slightly wrong QPs with threads enabled. --- encoder/ratecontrol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.47.3