shithub: libvpx

Download patch

ref: aff0a802e70ee87cd0a1673f3cffaa0b9d6112b4
parent: bb8eebc0e09969881968fcc411e5a00d2ec6e6fa
author: Marco <[email protected]>
date: Mon Feb 8 09:28:41 EST 2016

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

--- a/test/resize_test.cc
+++ b/test/resize_test.cc
@@ -94,13 +94,39 @@
   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 @@
  public:
   ResizingVideoSource() {
     SetSize(kInitialWidth, kInitialHeight);
-    limit_ = 60;
+    limit_ = 200;
   }
 
   virtual ~ResizingVideoSource() {}
@@ -347,6 +373,8 @@
 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));
 
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1540,6 +1540,10 @@
   }
   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 ||