Commit aff0a802 authored by Marco's avatar Marco

vp9-aq-mode=3: Reset cyclic refresh under config/external size change.

If the application changes frame size (external size changes),
and aq-mode=3 is on, reset the cyclic refresh.

Modify the TestExternalResize unittest (longer run with more resize
actions). Without this change an assert would be triggered on this
longer test.

Change-Id: I0eefd2cd7ffa0c557cca96ae30d607034a2599ce
parent bb8eebc0
......@@ -94,13 +94,39 @@ unsigned int ScaleForFrameNumber(unsigned int frame, unsigned int val) {
if (frame < 10)
return val;
if (frame < 20)
return val / 2;
return val * 3 / 4;
if (frame < 30)
return val * 2 / 3;
return val / 2;
if (frame < 40)
return val / 4;
return val;
if (frame < 50)
return val * 7 / 8;
return val * 3 / 4;
if (frame < 60)
return val / 2;
if (frame < 70)
return val * 3 / 4;
if (frame < 80)
return val;
if (frame < 90)
return val * 3 / 4;
if (frame < 100)
return val / 2;
if (frame < 110)
return val * 3 / 4;
if (frame < 120)
return val;
if (frame < 130)
return val * 3 / 4;
if (frame < 140)
return val / 2;
if (frame < 150)
return val * 3 / 4;
if (frame < 160)
return val;
if (frame < 170)
return val / 2;
if (frame < 180)
return val * 3 / 4;
return val;
}
......@@ -108,7 +134,7 @@ class ResizingVideoSource : public ::libvpx_test::DummyVideoSource {
public:
ResizingVideoSource() {
SetSize(kInitialWidth, kInitialHeight);
limit_ = 60;
limit_ = 200;
}
virtual ~ResizingVideoSource() {}
......@@ -347,6 +373,8 @@ class ResizeRealtimeTest : public ::libvpx_test::EncoderTest,
TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
ResizingVideoSource video;
DefaultConfig();
// Disable internal resize for this test.
cfg_.rc_resize_allowed = 0;
change_bitrate_ = false;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
......
......@@ -1540,6 +1540,10 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
}
update_frame_size(cpi);
if ((last_w != cpi->oxcf.width || last_h != cpi->oxcf.height) &&
cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
vp9_cyclic_refresh_reset_resize(cpi);
if ((cpi->svc.number_temporal_layers > 1 &&
cpi->oxcf.rc_mode == VPX_CBR) ||
((cpi->svc.number_temporal_layers > 1 ||
......
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