shithub: libvpx

Download patch

ref: 3da6564f90d44d8cea1c5873ee9e20c0daeb5633
parent: 87b2495f952b86709c673d923d6f60dfe5df852d
parent: 37293583cd53f2bf8a5ff32018bf6e3f3ff6ad04
author: Marco Paniconi <[email protected]>
date: Mon Oct 5 10:11:43 EDT 2015

Merge "Stabilize the encoder buffer from going too negative."

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -271,6 +271,13 @@
 
   // Clip the buffer level to the maximum specified buffer size.
   rc->bits_off_target = VPXMIN(rc->bits_off_target, rc->maximum_buffer_size);
+
+  // For screen-content mode, and if frame-dropper is off, don't let buffer
+  // level go below threshold, given here as -rc->maximum_ buffer_size.
+  if (cpi->oxcf.content == VP9E_CONTENT_SCREEN &&
+      cpi->oxcf.drop_frames_water_mark == 0)
+    rc->bits_off_target = VPXMAX(rc->bits_off_target, -rc->maximum_buffer_size);
+
   rc->buffer_level = rc->bits_off_target;
 
   if (is_one_pass_cbr_svc(cpi)) {