From fa37ac13b593fe86869f7c0c14828d0d56219a50 Mon Sep 17 00:00:00 2001 From: Hui Su Date: Tue, 21 Aug 2018 22:02:42 -0700 Subject: [PATCH] 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 --- vp9/encoder/vp9_rdopt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index cf4b5d033..376c06222 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -3103,7 +3103,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data, 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 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data, 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: -- 2.40.0