summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-10-10 11:42:47 -0700
committerMarco <marpan@google.com>2016-10-11 08:34:12 -0700
commitcdbd89197ec878c9c9fed8876c5c3f436ae8994d (patch)
treef881747bd19071849814731c5e716e93f53cb803 /vp9
parent294a734a5f12037d7091e50e0ac17a048589f479 (diff)
downloadlibvpx-cdbd89197ec878c9c9fed8876c5c3f436ae8994d.tar
libvpx-cdbd89197ec878c9c9fed8876c5c3f436ae8994d.tar.gz
libvpx-cdbd89197ec878c9c9fed8876c5c3f436ae8994d.tar.bz2
libvpx-cdbd89197ec878c9c9fed8876c5c3f436ae8994d.zip
vp9: 1 pass vbr: some adjustments to gf interval.
Put limit on gf interval based on lag, and allow for the adjustment on next gf group also on key frame. Small/neutral change on ytlive metrics. Change only affects 1 pass vbr real-time mode. Change-Id: I339c8f4398848698b6e10fe9482c52ca661b94a5
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_ratectrl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index 93eddd655..da1f2c84a 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1499,8 +1499,8 @@ void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) {
if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cpi->oxcf.pass == 0) {
vp9_cyclic_refresh_set_golden_update(cpi);
} else {
- rc->baseline_gf_interval =
- (rc->min_gf_interval + rc->max_gf_interval) / 2;
+ rc->baseline_gf_interval = VPXMIN(
+ 20, VPXMAX(10, (rc->min_gf_interval + rc->max_gf_interval) / 2));
}
rc->af_ratio_onepass_vbr = 10;
if (rc->rolling_target_bits > 0)
@@ -2088,8 +2088,8 @@ void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi, uint64_t avg_sad_current) {
rc->high_source_sad_lagindex = high_source_sad_lagindex;
// Adjust some factors for the next GF group, ignore initial key frame,
// and only for lag_in_frames not too small.
- if (cpi->refresh_golden_frame == 1 && cm->frame_type != KEY_FRAME &&
- cm->current_video_frame > 30 && cpi->oxcf.lag_in_frames > 8) {
+ if (cpi->refresh_golden_frame == 1 && cm->current_video_frame > 30 &&
+ cpi->oxcf.lag_in_frames > 8) {
int frame_constraint;
if (rc->rolling_target_bits > 0)
rate_err =
@@ -2110,6 +2110,8 @@ void adjust_gf_boost_lag_one_pass_vbr(VP9_COMP *cpi, uint64_t avg_sad_current) {
? VPXMAX(10, rc->baseline_gf_interval >> 1)
: VPXMAX(6, rc->baseline_gf_interval >> 1);
}
+ if (rc->baseline_gf_interval > cpi->oxcf.lag_in_frames - 1)
+ rc->baseline_gf_interval = cpi->oxcf.lag_in_frames - 1;
// Check for constraining gf_interval for up-coming scene/content changes,
// or for up-coming key frame, whichever is closer.
frame_constraint = rc->frames_to_key;