ref: 2f66fdd3750737b2c220dd7f2b4c0e0323abed47
parent: 7b756183aa84b97d2e787d70adb266c6ae652e4e
author: Marco <[email protected]>
date: Wed Jul 15 07:45:52 EDT 2015
Adjust some logic for dynamic_resize 1 pass mode. Use drop_frames_water_mark for threshold on buffer underflow, and change threshold for resize down. Change-Id: I2de19adce50abe9bcdc0b107528cec8cc1857fcc
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1813,7 +1813,8 @@
if (cpi->rc.frames_since_key > 2 * cpi->framerate) {
const int window = (int)(5 * cpi->framerate);
cpi->resize_avg_qp += cm->base_qindex;
- if (cpi->rc.buffer_level < 0)
+ if (cpi->rc.buffer_level < (int)(cpi->oxcf.drop_frames_water_mark *
+ rc->optimal_buffer_level / 100))
++cpi->resize_buffer_underflow;
++cpi->resize_count;
// Check for resize action every "window" frames.
@@ -1824,7 +1825,7 @@
// Resize back up if average QP is low, and we are currently in a resized
// down state.
if (cpi->resize_state == 0 &&
- cpi->resize_buffer_underflow > (cpi->resize_count >> 3)) {
+ cpi->resize_buffer_underflow > (cpi->resize_count >> 2)) {
resize_now = 1;
} else if (cpi->resize_state == 1 &&
avg_qp < 40 * cpi->rc.worst_quality / 100) {