From 6dbb9e4d4478f44fb3d30a098c217763fdfdb8cd Mon Sep 17 00:00:00 2001 From: Paul Wilkins Date: Mon, 13 Oct 2014 18:03:54 +0100 Subject: [PATCH] Clamp rate error estimate. 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index c9588a343..98daa17fa 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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; }