diff options
author | Jingning Han <jingning@google.com> | 2018-11-27 15:54:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-11-27 15:54:45 +0000 |
commit | d3d22aa7c9ff19af3af2cf21cd7c7739fc2c6263 (patch) | |
tree | 2bb83732b279f0647127a87c90fbe195458afcb3 | |
parent | 45d303632b696115a9d5a36611b594c0d63afed9 (diff) | |
parent | 8d9b1a7d82f691cc4f0afca6bfaadcc8d818ac26 (diff) | |
download | libvpx-d3d22aa7c9ff19af3af2cf21cd7c7739fc2c6263.tar libvpx-d3d22aa7c9ff19af3af2cf21cd7c7739fc2c6263.tar.gz libvpx-d3d22aa7c9ff19af3af2cf21cd7c7739fc2c6263.tar.bz2 libvpx-d3d22aa7c9ff19af3af2cf21cd7c7739fc2c6263.zip |
Merge "Fix ARF rate allocation for cq mode"
-rw-r--r-- | vp9/encoder/vp9_ratectrl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 779529b24..d081f1a49 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1364,6 +1364,16 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, int *bottom_index, // Constrained quality use slightly lower active best. active_best_quality = active_best_quality * 15 / 16; + // 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) { + 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) * q + active_best_quality + layer_depth / 2) / + layer_depth; + } } else if (oxcf->rc_mode == VPX_Q) { if (!cpi->refresh_alt_ref_frame) { active_best_quality = cq_level; |