]> granicus.if.org Git - libvpx/commitdiff
vp9: Be more responsive to massive overshoot.
authorAlex Converse <aconverse@google.com>
Mon, 25 Jan 2016 20:03:50 +0000 (12:03 -0800)
committerAlex Converse <aconverse@google.com>
Mon, 25 Jan 2016 20:03:50 +0000 (12:03 -0800)
Limit oscilation detection in the case where overshoot is very very
large.

This keeps the 9-bit cost patch from breaking the DownUp reisze test.
The patch pushed us to an 11% undershoot right before a scene cut
causing a 1200% overshoot. (Whereas before we were undershooting by
only 6% before overshooting by 1200%).

Change-Id: Id90ccfab8aba872ccadc45b73b3bb097b895677f

vp9/encoder/vp9_ratectrl.c

index 2579c600551f78913863d917c129c0a81060294f..5df2909ccaed1fc7d36b9e5353c5f27275ff0328 100644 (file)
@@ -500,6 +500,12 @@ void vp9_rc_update_rate_correction_factors(VP9_COMP *cpi) {
   else
     cpi->rc.rc_1_frame = 0;
 
+  // Turn off oscilation detection in the case of massive overshoot.
+  if (cpi->rc.rc_1_frame == -1 && cpi->rc.rc_2_frame == 1 &&
+      correction_factor > 1000) {
+    cpi->rc.rc_2_frame = 0;
+  }
+
   if (correction_factor > 102) {
     // We are not already at the worst allowable quality
     correction_factor = (int)(100 + ((correction_factor - 100) *