summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-04-15 10:06:18 -0700
committerMarco <marpan@google.com>2016-04-18 13:01:27 -0700
commitd488236ce3f46c70796df77c4a0f26972e056bbc (patch)
treeb7acb4e2f548f02ee82d36380ce2635c1c580971 /vp9/encoder
parent2e0841931c76e3433242fa9ea4c6b1d361b88371 (diff)
downloadlibvpx-d488236ce3f46c70796df77c4a0f26972e056bbc.tar
libvpx-d488236ce3f46c70796df77c4a0f26972e056bbc.tar.gz
libvpx-d488236ce3f46c70796df77c4a0f26972e056bbc.tar.bz2
libvpx-d488236ce3f46c70796df77c4a0f26972e056bbc.zip
vp9: Adjustment to active_best_quality for inter_frame, 1 pass vbr.
Change only affects 1 pass vbr. Use a q value somewhat larger (~6%) than avg_frame_qindex[INTER] as basis for active_best_quality for inter-frames. And use the minium of this (avg_frame_qindex) and the active_worst_quality. This reduces some overshoot in ytlive clips. Overall small but positive average increase in metrics (up on average ~0.2%). Change-Id: Icdbaae7872d5675fd38a13c0ec6ce0e2e3b919ce
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_ratectrl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index dab7f6730..300080ba1 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -948,11 +948,15 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
FIXED_GF_INTERVAL], cm->bit_depth);
active_best_quality = VPXMAX(qindex + delta_qindex, rc->best_quality);
} else {
- // Use the lower of active_worst_quality and recent/average Q.
- if (cm->current_video_frame > 1)
- active_best_quality = inter_minq[rc->avg_frame_qindex[INTER_FRAME]];
- else
+ // Use the min of the average Q (with some increase) and
+ // active_worst_quality as basis for active_best.
+ if (cm->current_video_frame > 1) {
+ q = VPXMIN(((17 * rc->avg_frame_qindex[INTER_FRAME]) >> 4),
+ active_worst_quality);
+ active_best_quality = inter_minq[q];
+ } else {
active_best_quality = inter_minq[rc->avg_frame_qindex[KEY_FRAME]];
+ }
// For the constrained quality mode we don't want
// q to fall below the cq level.
if ((oxcf->rc_mode == VPX_CQ) &&