Commit de53e6de authored by jackychen's avatar jackychen

Add the check of resolution in VP9 dynamic resizing.

The resolution check fixs the issue which resets resize_pending
unnecessarily and causes not-bitexact with previous one-step version.

Change-Id: I4e7660b3c8f34f59781e2e61ca30d61080c322de
parent 5e6533e7
......@@ -1852,18 +1852,20 @@ int vp9_resize_one_pass_cbr(VP9_COMP *cpi) {
// Resize back up if average QP is low, and we are currently in a resized
// down state, i.e. 1/2 or 3/4 of original resolution.
// Currently, use a flag to turn 3/4 resizing feature on/off.
if (cpi->resize_buffer_underflow > (cpi->resize_count >> 1)) {
if (cpi->resize_state == ORIG &&
cpi->resize_buffer_underflow > (cpi->resize_count >> 1)) {
resize_action = DOWN_ONEHALF;
cpi->resize_state = ONE_HALF;
} else if (cpi->resize_buffer_underflow > (cpi->resize_count >> 2)) {
if (cpi->resize_state == THREE_QUARTER || ONEHALFONLY_RESIZE) {
if (cpi->resize_state == THREE_QUARTER) {
resize_action = DOWN_ONEHALF;
cpi->resize_state = ONE_HALF;
} else if (cpi->resize_state == ORIG) {
resize_action = DOWN_THREEFOUR;
cpi->resize_state = THREE_QUARTER;
resize_action = ONEHALFONLY_RESIZE ? DOWN_ONEHALF : DOWN_THREEFOUR;
cpi->resize_state = ONEHALFONLY_RESIZE ? ONE_HALF : THREE_QUARTER;
}
} else if (avg_qp < 60 * cpi->rc.worst_quality / 100) {
} else if (cpi->resize_state != ORIG &&
avg_qp < 60 * cpi->rc.worst_quality / 100) {
if (cpi->resize_state == THREE_QUARTER ||
avg_qp < 40 * cpi->rc.worst_quality / 100 ||
ONEHALFONLY_RESIZE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment