From a6f2a9619bcb9b3509c81c614463f91b70cf8f6e Mon Sep 17 00:00:00 2001 From: paulwilkins Date: Tue, 30 Jun 2015 10:18:42 +0100 Subject: [PATCH] Add extra resize trigger for frames above maximum allowed size. Even if the recode loop is not enabled for the current frame type trap the case where the projected size of a a frame is above the maximum allowed in recode_loop_test() Change-Id: I453004694b8f8699e3c2a83252e9f83adccdda4e --- vp9/encoder/vp9_encoder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index f27f57a24..fb8cd59bc 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2627,9 +2627,10 @@ static int recode_loop_test(VP9_COMP *cpi, const int frame_is_kfgfarf = frame_is_kf_gf_arf(cpi); int force_recode = 0; - if ((cpi->sf.recode_loop == ALLOW_RECODE) || + if ((rc->projected_frame_size >= rc->max_frame_bandwidth) || + (cpi->sf.recode_loop == ALLOW_RECODE) || (frame_is_kfgfarf && - (cpi->sf.recode_loop == ALLOW_RECODE_KFARFGF))) { + (cpi->sf.recode_loop == ALLOW_RECODE_KFARFGF))) { if (frame_is_kfgfarf && (oxcf->resize_mode == RESIZE_DYNAMIC) && scale_down(cpi, q)) {