shithub: libvpx

Download patch

ref: 2d403737b88f76ce8410237a8eb682cc556ac302
parent: d2fb6a1785f21cc4a460adf419548c04bbf0f3d0
parent: 892c855313fa068067299001a3d0c9bbe2b68c4f
author: Marco Paniconi <marpan@google.com>
date: Sun Feb 24 23:43:13 EST 2019

Merge "vp9-rtc: Fix to Q clamp in adjust_q_cbr"

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -668,7 +668,7 @@
   }
   if (cpi->oxcf.content == VP9E_CONTENT_SCREEN)
     vp9_cyclic_refresh_limit_q(cpi, &q);
-  return q;
+  return VPXMAX(VPXMIN(q, cpi->rc.worst_quality), cpi->rc.best_quality);
 }
 
 static double get_rate_correction_factor(const VP9_COMP *cpi) {
@@ -1076,6 +1076,7 @@
         q = *top_index;
     }
   }
+
   assert(*top_index <= rc->worst_quality && *top_index >= rc->best_quality);
   assert(*bottom_index <= rc->worst_quality &&
          *bottom_index >= rc->best_quality);