ref: 9cc1f692bdbfcc1495b600eb1af2f7c0ffeb8abe
parent: d488236ce3f46c70796df77c4a0f26972e056bbc
author: Marco <[email protected]>
date: Mon Apr 18 06:51:07 EDT 2016
vp9: 1 pass vbr: More even spacing for gf near key frame. More even spacing near key frame and avoid gf on scene cut if its close to key frame. Small increase in metrics for ytlive set (which uses key-period=150). (~0.2% gain) Change only affects 1 pass vbr mode. Change-Id: If1e5a59baf1e0befbaf998522fbc47d94ac5b5df
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1506,6 +1506,11 @@
rc->baseline_gf_interval =
(rc->min_gf_interval + rc->max_gf_interval) / 2;
}
+ // Reset the gf interval to make more equal spacing for up-coming key frame.
+ if ((rc->frames_to_key <= 7 * rc->baseline_gf_interval >> 2) &&
+ (rc->frames_to_key > rc->baseline_gf_interval)) {
+ rc->baseline_gf_interval = rc->frames_to_key >> 1;
+ }
rc->frames_till_gf_update_due = rc->baseline_gf_interval;
// NOTE: frames_till_gf_update_due must be <= frames_to_key.
if (rc->frames_till_gf_update_due > rc->frames_to_key) {
@@ -2092,6 +2097,7 @@
// For VBR, under scene change/high content change, force golden refresh.
if (cpi->oxcf.rc_mode == VPX_VBR &&
rc->high_source_sad &&
+ rc->frames_to_key > 3 &&
rc->count_last_scene_change > 4 &&
cpi->ext_refresh_frame_flags_pending == 0) {
int target;