From: Ronald S. Bultje Date: Sat, 12 May 2012 00:48:20 +0000 (-0700) Subject: Don't use compound prediction for golden frames based on alt-ref frames. X-Git-Tag: v1.3.0~1217^2~379^2~40^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=959b296a40a8b2111cff474e039034fc41f17aa9;p=libvpx Don't use compound prediction for golden frames based on alt-ref frames. These frames can force reference frame (arf), mode (zeromv) and skip, which means that if we use compound prediction (i.e. arf+last), we might use a blend of a perfect (arf) and an imperfect (last) predictor, leading to semi-garbage display and thus a huge drop in SSIM/PSNR (up to 10dB for some frames I analyzed). Gives a +0.2% gain on YT. Change-Id: If1f2b7899ad165684af3808fd379295e82558cbb --- diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index a044f8cb9..ec3e1602c 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -1288,11 +1288,13 @@ void vp8_encode_frame(VP8_COMP *cpi) else frame_type = 2; - if (cpi->rd_prediction_type_threshes[frame_type][1] > - cpi->rd_prediction_type_threshes[frame_type][0] && - cpi->rd_prediction_type_threshes[frame_type][1] > - cpi->rd_prediction_type_threshes[frame_type][2] && - check_dual_ref_flags(cpi)) + if (frame_type == 3) + pred_type = SINGLE_PREDICTION_ONLY; + else if (cpi->rd_prediction_type_threshes[frame_type][1] > + cpi->rd_prediction_type_threshes[frame_type][0] && + cpi->rd_prediction_type_threshes[frame_type][1] > + cpi->rd_prediction_type_threshes[frame_type][2] && + check_dual_ref_flags(cpi)) pred_type = COMP_PREDICTION_ONLY; else if (cpi->rd_prediction_type_threshes[frame_type][0] > cpi->rd_prediction_type_threshes[frame_type][1] &&