ref: ff0a87ce3885597ea577b9547ef4162707db8476
parent: dc5618f3bb56a420976f03ccfb62097b9792e3ca
author: Marco <[email protected]>
date: Wed Aug 3 07:39:52 EDT 2016
vp9 1pass vbr: Adjustment to gf interval. Increase the minimum distance. Reduces the overshoot somewhat on some clips, small gain in avgPSNR (~0.1%) on ytlive set. Change-Id: Id5ddde20c2907dbdb536e79542eff775019c142b
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1580,7 +1580,7 @@
VPXMIN(15, (3 * rc->baseline_gf_interval) >> 1);
} else if (rc->avg_frame_low_motion < 20) {
// Decrease gf interval for high motion case.
- rc->baseline_gf_interval = VPXMAX(5, rc->baseline_gf_interval >> 1);
+ rc->baseline_gf_interval = VPXMAX(6, rc->baseline_gf_interval >> 1);
}
// Adjust boost and af_ratio based on avg_frame_low_motion, which varies
// between 0 and 100 (stationary, 100% zero/small motion).
@@ -2185,10 +2185,9 @@
VPXMIN(15, (3 * rc->baseline_gf_interval) >> 1);
} else if (high_content) {
rc->gfu_boost = DEFAULT_GF_BOOST >> 1;
- if (rate_err > 3.0)
- rc->baseline_gf_interval = VPXMAX(10, rc->baseline_gf_interval >> 1);
- else
- rc->baseline_gf_interval = VPXMAX(5, rc->baseline_gf_interval >> 1);
+ rc->baseline_gf_interval = (rate_err > 3.0) ?
+ VPXMAX(10, rc->baseline_gf_interval >> 1) :
+ VPXMAX(6, rc->baseline_gf_interval >> 1);
}
// Check for constraining gf_interval for up-coming scene/content changes,
// or for up-coming key frame, whichever is closer.
@@ -2196,8 +2195,7 @@
if (rc->high_source_sad_lagindex > 0 &&
frame_constraint > rc->high_source_sad_lagindex)
frame_constraint = rc->high_source_sad_lagindex;
- if (steady_sad_lagindex > 0 && steady_sad_lagindex > 2 &&
- frame_constraint > steady_sad_lagindex)
+ if (steady_sad_lagindex > 3 && frame_constraint > steady_sad_lagindex)
frame_constraint = steady_sad_lagindex;
adjust_gfint_frame_constraint(cpi, frame_constraint);
rc->frames_till_gf_update_due = rc->baseline_gf_interval;