diff options
author | Jingning Han <jingning@google.com> | 2018-09-28 17:38:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-09-28 17:38:26 +0000 |
commit | 1794bac3fbd08096741bf8d7c486c86bfeb02589 (patch) | |
tree | 1562cae4005981d373df5d957d970a31b2bf639a /vp9 | |
parent | 4e61b2eec7dda9409927fdbdc5c1513081f3ea6f (diff) | |
parent | 01ba4cf0ac28f6a84f7a60dae14d3c1e3c0c45c0 (diff) | |
download | libvpx-1794bac3fbd08096741bf8d7c486c86bfeb02589.tar libvpx-1794bac3fbd08096741bf8d7c486c86bfeb02589.tar.gz libvpx-1794bac3fbd08096741bf8d7c486c86bfeb02589.tar.bz2 libvpx-1794bac3fbd08096741bf8d7c486c86bfeb02589.zip |
Merge "Fix minor bug in calculation of max arf group length."
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index c8978259a..0f975f157 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2527,8 +2527,11 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { { int int_max_q = (int)(vp9_convert_qindex_to_q(twopass->active_worst_quality, cpi->common.bit_depth)); - int int_lbq = (int)(vp9_convert_qindex_to_q(rc->last_boosted_qindex, - cpi->common.bit_depth)); + int q_term = (cm->current_video_frame == 0) + ? int_max_q / 32 + : (int)(vp9_convert_qindex_to_q(rc->last_boosted_qindex, + cpi->common.bit_depth) / + 6); active_min_gf_interval = rc->min_gf_interval + arf_active_or_kf + VPXMIN(2, int_max_q / 200); active_min_gf_interval = @@ -2538,7 +2541,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { // bits to spare and are better with a smaller interval and smaller boost. // At high Q when there are few bits to spare we are better with a longer // interval to spread the cost of the GF. - active_max_gf_interval = 12 + arf_active_or_kf + VPXMIN(4, (int_lbq / 6)); + active_max_gf_interval = 12 + arf_active_or_kf + VPXMIN(4, q_term); // We have: active_min_gf_interval <= // rc->max_gf_interval + arf_active_or_kf. |