Commit 9cc1f692 authored by Marco's avatar Marco

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
parent d488236c
......@@ -1506,6 +1506,11 @@ void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) {
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 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
// 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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment