summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2014-01-03 15:41:57 -0800
committerDeb Mukherjee <debargha@google.com>2014-01-06 10:49:25 -0800
commitcf3d2c8d5a8438fd63ed739f11f1116e0f21d3a0 (patch)
tree86d2d749afa7c392adff120426588a79993829ad /vp9/encoder/vp9_ratectrl.c
parentb49e9fb433620dff5b3f7045901d2c874cd647da (diff)
downloadlibvpx-cf3d2c8d5a8438fd63ed739f11f1116e0f21d3a0.tar
libvpx-cf3d2c8d5a8438fd63ed739f11f1116e0f21d3a0.tar.gz
libvpx-cf3d2c8d5a8438fd63ed739f11f1116e0f21d3a0.tar.bz2
libvpx-cf3d2c8d5a8438fd63ed739f11f1116e0f21d3a0.zip
Corerctly sets frame type in the 2 pass case
This patch sets frame types correctly in the new vp9_get_second_pass_params() function called prior to encode_frame_to_data_rate() function, so that the latter function can just work with what is passed to it. This will allow multiple vp9_get_second_pass_params() to be created for various encode strategies without messing with the core encode function. There is no difference in derf and yt. stdhd/hd are pending. Change-Id: I70dfb97e9f497e9cee04052e0e8e0c2892eab0c3
Diffstat (limited to 'vp9/encoder/vp9_ratectrl.c')
-rw-r--r--vp9/encoder/vp9_ratectrl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index 8a0dd4cee..bae87b714 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -750,7 +750,6 @@ int vp9_rc_pick_q_and_adjust_q_bounds(const VP9_COMP *cpi,
// Limit Q range for the adaptive loop.
if (cm->frame_type == KEY_FRAME && !cpi->rc.this_key_frame_forced) {
if (!(cpi->pass == 0 && cpi->common.current_video_frame == 0)) {
- *top_index = active_worst_quality;
*top_index =
(active_worst_quality + active_best_quality * 3) / 4;
}
@@ -790,6 +789,12 @@ int vp9_rc_pick_q_and_adjust_q_bounds(const VP9_COMP *cpi,
printf("frame:%d q:%d\n", cm->current_video_frame, q);
}
#endif
+ assert(*top_index <= cpi->rc.worst_quality &&
+ *top_index >= cpi->rc.best_quality);
+ assert(*bottom_index <= cpi->rc.worst_quality &&
+ *bottom_index >= cpi->rc.best_quality);
+ assert(q <= cpi->rc.worst_quality &&
+ q >= cpi->rc.best_quality);
return q;
}