]> granicus.if.org Git - libvpx/commitdiff
Don't use compound prediction for golden frames based on alt-ref frames.
authorRonald S. Bultje <rbultje@google.com>
Sat, 12 May 2012 00:48:20 +0000 (17:48 -0700)
committerRonald S. Bultje <rbultje@google.com>
Sat, 12 May 2012 00:48:20 +0000 (17:48 -0700)
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

vp8/encoder/encodeframe.c

index a044f8cb98bcfe05625b2f0d768ca6776f002e50..ec3e1602c16e8e0d1dbfccb24442ba53c109f274 100644 (file)
@@ -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] &&