From 0c60db7def133eb93e9479480f7a019fc6386de0 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 11 May 2016 12:18:53 -0700 Subject: [PATCH] vp9: Fix to quality regression issue for 1 pass. BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1217 Issue introduced in https://chromium-review.googlesource.com/#/c/339162/. The factor on avg_frame_qindex[INTER_FRAME] in that CL, used for q-basis to set active_best, can cause the QP to decrease too slowly or get stuck in some cases when max-q=63. Removing that factor fixes the regression in issue#1217. Change-Id: I97fe28dca3c2bc2d852b1775f39c62164e032d4f --- vp9/encoder/vp9_ratectrl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 1e6c152..0ec93a9 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -953,11 +953,10 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi, FIXED_GF_INTERVAL], cm->bit_depth); active_best_quality = VPXMAX(qindex + delta_qindex, rc->best_quality); } else { - // Use the min of the average Q (with some increase) and - // active_worst_quality as basis for active_best. + // Use the min of the average Q and active_worst_quality as basis for + // active_best. if (cm->current_video_frame > 1) { - q = VPXMIN(((17 * rc->avg_frame_qindex[INTER_FRAME]) >> 4), - active_worst_quality); + q = VPXMIN(rc->avg_frame_qindex[INTER_FRAME], active_worst_quality); active_best_quality = inter_minq[q]; } else { active_best_quality = inter_minq[rc->avg_frame_qindex[KEY_FRAME]]; -- 2.7.4