From: Jingning Han Date: Mon, 29 Oct 2018 21:08:20 +0000 (-0700) Subject: Properly space qp in q mode for multi-layer ARF X-Git-Tag: v1.8.0~197^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50a90744407be7b88c47737d1bba79e7ffb5c2d3;p=platform%2Fupstream%2Flibvpx.git Properly space qp in q mode for multi-layer ARF Space the quantization parameter distribution according to the layer depth for multi-layer ARF coding structure. This allows lower layers to have relatively smaller quantization parameters than higher layers. It improves the compression performance in constant q mode for multi-layer ARF system: avg PSNR overall PSNR SSIM lowres -0.33% -0.31% -1.44% midres -0.29% -0.38% -1.14% hdres -0.27% -0.49% -1.02% Change-Id: I9cfe2f27e6c0029c30614970a46de3045840264e --- diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index dc43bb1..c8931ae 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1303,8 +1303,14 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, int *bottom_index, // Modify best quality for second level arfs. For mode VPX_Q this // becomes the baseline frame q. - if (gf_group->rf_level[gf_group_index] == GF_ARF_LOW) - active_best_quality = (active_best_quality + cq_level + 1) / 2; + if (gf_group->rf_level[gf_group_index] == GF_ARF_LOW) { + const int layer_depth = gf_group->layer_depth[gf_group_index]; + // linearly fit the frame q depending on the layer depth index from + // the base layer ARF. + active_best_quality = ((layer_depth - 1) * cq_level + + active_best_quality + layer_depth / 2) / + layer_depth; + } } } else { active_best_quality = get_gf_active_quality(cpi, q, cm->bit_depth);