summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorpaulwilkins <paulwilkins@google.com>2015-03-09 17:12:33 +0000
committerpaulwilkins <paulwilkins@google.com>2015-03-09 17:13:55 +0000
commit2cff9c4efe25298e638ee6ee39c4aa404afec978 (patch)
treeaf6296bc6f997f8916e918d9d3e81184053faa45 /vp9/encoder
parentb12f531cc52945aaa51d51bf98b9237caf8b8fe3 (diff)
downloadlibvpx-2cff9c4efe25298e638ee6ee39c4aa404afec978.tar
libvpx-2cff9c4efe25298e638ee6ee39c4aa404afec978.tar.gz
libvpx-2cff9c4efe25298e638ee6ee39c4aa404afec978.tar.bz2
libvpx-2cff9c4efe25298e638ee6ee39c4aa404afec978.zip
Allow q adjustment for VPX_CQ and VPX_CBR.
Adjustment previously only enabled in VBR mode. This patch allows adjustment of min and max q for CBR and adjustment of max q only for CQ mode. Change-Id: Id5e583f3d50453cd544fc57249acacd946457482
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_firstpass.c6
-rw-r--r--vp9/encoder/vp9_ratectrl.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 6c8bbdb6d..046c64170 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2621,11 +2621,13 @@ void vp9_twopass_postencode_update(VP9_COMP *cpi) {
++twopass->gf_group.index;
// If the rate control is drifting consider adjustment to min or maxq.
- if ((cpi->oxcf.rc_mode == VPX_VBR) &&
+ if ((cpi->oxcf.rc_mode != VPX_Q) &&
(cpi->twopass.gf_zeromotion_pct < VLOW_MOTION_THRESHOLD) &&
!cpi->rc.is_src_frame_alt_ref) {
const int maxq_adj_limit =
rc->worst_quality - twopass->active_worst_quality;
+ const int minq_adj_limit =
+ (cpi->oxcf.rc_mode == VPX_CQ) ? 0 : MINQ_ADJ_LIMIT;
// Undershoot.
if (rc->rate_error_estimate > cpi->oxcf.under_shoot_pct) {
@@ -2650,7 +2652,7 @@ void vp9_twopass_postencode_update(VP9_COMP *cpi) {
--twopass->extend_maxq;
}
- twopass->extend_minq = clamp(twopass->extend_minq, 0, MINQ_ADJ_LIMIT);
+ twopass->extend_minq = clamp(twopass->extend_minq, 0, minq_adj_limit);
twopass->extend_maxq = clamp(twopass->extend_maxq, 0, maxq_adj_limit);
}
}
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index f33fe5100..a11e09851 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1050,7 +1050,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
// Extension to max or min Q if undershoot or overshoot is outside
// the permitted range.
- if ((cpi->oxcf.rc_mode == VPX_VBR) &&
+ if ((cpi->oxcf.rc_mode != VPX_Q) &&
(cpi->twopass.gf_zeromotion_pct < VLOW_MOTION_THRESHOLD)) {
if (frame_is_intra_only(cm) ||
(!rc->is_src_frame_alt_ref &&