shithub: libvpx

Download patch

ref: fa37ac13b593fe86869f7c0c14828d0d56219a50
parent: 5226940ef2ae65ea324c82859557ebb39b023bae
author: Hui Su <huisu@google.com>
date: Tue Aug 21 18:02:42 EDT 2018

Rework the ref_frame_skip_mask feature in RDO

Previously we often skip all compound inter prediction modes,
causing large coding loss. This patch modifies how we set the
ref_frame_skip_mask so that compound modes are considered in RDO.

This affects speed>=1.

Coding gains(overall psnr):
          lowres       midres     hdres     average
speed 1    0.54%       0.43%      0.64%      0.53%
speed 2    0.59%       0.48%      0.60%      0.56%

Tested encoding speed on 10 HD sequences, average speed loss is
5% for speed 1; 2% for speed 2.

Change-Id: Ib8758af7ee7c9812022bd21c5fe61631e2bb8e5c

--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3103,7 +3103,7 @@
   const int intra_cost_penalty =
       vp9_get_intra_cost_penalty(cpi, bsize, cm->base_qindex, cm->y_dc_delta_q);
   int best_skip2 = 0;
-  uint8_t ref_frame_skip_mask[2] = { 0 };
+  uint8_t ref_frame_skip_mask[2] = { 0, 1 };
   uint16_t mode_skip_mask[MAX_REF_FRAMES] = { 0 };
   int mode_skip_start = sf->mode_skip_start + 1;
   const int *const rd_threshes = rd_opt->threshes[segment_id][bsize];
@@ -3279,13 +3279,9 @@
     if (midx == mode_skip_start && best_mode_index >= 0) {
       switch (best_mbmode.ref_frame[0]) {
         case INTRA_FRAME: break;
-        case LAST_FRAME:
-          ref_frame_skip_mask[0] |= LAST_FRAME_MODE_MASK;
-          ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK;
-          break;
+        case LAST_FRAME: ref_frame_skip_mask[0] |= LAST_FRAME_MODE_MASK; break;
         case GOLDEN_FRAME:
           ref_frame_skip_mask[0] |= GOLDEN_FRAME_MODE_MASK;
-          ref_frame_skip_mask[1] |= SECOND_REF_FRAME_MASK;
           break;
         case ALTREF_FRAME: ref_frame_skip_mask[0] |= ALT_REF_MODE_MASK; break;
         case NONE: