ref: bbfc3290a4da45f0166bc81a7d0da0e097f3f9b3
parent: 49434a1201f821c67f8602328470df441cc67353
author: Paul Wilkins <paulwilkins@google.com>
date: Tue Jul 24 05:56:25 EDT 2018
Limit min Q for normal frames. This patch limits the active min Q for normal frames based on the previous KF/GF/ARF. In a few cases, especially at the end of a clip where there has been systemic underspend, (as is often the case with slide shows), this prevents the encoder rapidly dropping Q on normal frames (just to try and use up bits), such that they end up with a lower Q than the key frame / GF / ARF off which they key. Change-Id: Ic8def5c0d1e37ca2202e007ec1d13e501c0a91dd
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1329,6 +1329,14 @@
}
}
+ // For normal frames do not allow an active minq lower than the q used for
+ // the last boosted frame.
+ if (!frame_is_intra_only(cm) &&
+ (!(cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) ||
+ rc->is_src_frame_alt_ref)) {
+ active_best_quality = VPXMAX(active_best_quality, rc->last_boosted_qindex);
+ }
+
#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY
vpx_clear_system_state();
// Static forced key frames Q restrictions dealt with elsewhere.