From: Ronald S. Bultje Date: Wed, 8 Feb 2012 22:55:46 +0000 (-0800) Subject: Fix dual prediction recode loop. X-Git-Tag: v1.3.0~1217^2~380^2~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=915f13bd5972c7e004b48533a455c9c7b7bc6d2d;p=libvpx Fix dual prediction recode loop. We should only change the dual prediction mode if we actually entered the recode branch. Else, it may potentially undo beneficial changes to the dual prediction mode in the first encode iteration. Change-Id: I79fc53e5fd0bb551092ed422c797619f1566f002 --- diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index f06930968..388d8a6bb 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -1537,21 +1537,21 @@ void vp8_encode_frame(VP8_COMP *cpi) if (redo) { encode_frame_internal(cpi); - } - if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) - { - if (cpi->dual_pred_count[0] == 0 && - cpi->dual_pred_count[1] == 0 && - cpi->dual_pred_count[2] == 0) - { - cpi->common.dual_pred_mode = SINGLE_PREDICTION_ONLY; - } - else if (cpi->single_pred_count[0] == 0 && - cpi->single_pred_count[1] == 0 && - cpi->single_pred_count[2] == 0) + if (cpi->common.dual_pred_mode == HYBRID_PREDICTION) { - cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY; + if (cpi->dual_pred_count[0] == 0 && + cpi->dual_pred_count[1] == 0 && + cpi->dual_pred_count[2] == 0) + { + cpi->common.dual_pred_mode = SINGLE_PREDICTION_ONLY; + } + else if (cpi->single_pred_count[0] == 0 && + cpi->single_pred_count[1] == 0 && + cpi->single_pred_count[2] == 0) + { + cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY; + } } } }