ref: 9fdeeaf41106894ea1a3564cb081207c3a9a5938
parent: 7a79fa136228b349b202b9d5bae2b4f95d1ef517
parent: ff0a87ce3885597ea577b9547ef4162707db8476
author: Marco Paniconi <marpan@google.com>
date: Thu Aug 4 13:50:55 EDT 2016
Merge "vp9 1pass vbr: Adjustment to gf interval."
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1522,7 +1522,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).
@@ -2115,10 +2115,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.
@@ -2126,8 +2125,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;