]> granicus.if.org Git - libvpx/commitdiff
Clamp rate error estimate.
authorPaul Wilkins <paulwilkins@google.com>
Mon, 13 Oct 2014 17:03:54 +0000 (18:03 +0100)
committerPaul Wilkins <paulwilkins@google.com>
Mon, 13 Oct 2014 17:07:58 +0000 (18:07 +0100)
Add back clamp which ensures that the Q adaptation
is turned off when the over_shoot_pct and under_shoot_pct
parameters are set to 100.

Change-Id: Id0161b114d39a3029cd3eb28020caab0c3914922

vp9/encoder/vp9_firstpass.c

index c9588a343f4feefcb260267f038a1351ae2217e0..98daa17fa25d4c919d78c1cebda4cd6b14de2415 100644 (file)
@@ -2478,6 +2478,7 @@ void vp9_twopass_postencode_update(VP9_COMP *cpi) {
   if (rc->total_actual_bits) {
     rc->rate_error_estimate =
       (int)((rc->vbr_bits_off_target * 100) / rc->total_actual_bits);
+    rc->rate_error_estimate = clamp(rc->rate_error_estimate, -100, 100);
   } else {
     rc->rate_error_estimate = 0;
   }