From: Jingning Han Date: Wed, 8 Jun 2016 17:04:34 +0000 (-0700) Subject: Take out skip_recode speed feature X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=025fa11c755711095ef1dc08035a01624f6eeba9;p=libvpx Take out skip_recode speed feature The assumption doesn't hold true in the current codebase. Remove this speed feature to simplify the codebase. Change-Id: I9b69f484c9b7cd612b825047cc5b2fce63ee0af7 --- diff --git a/vp10/encoder/block.h b/vp10/encoder/block.h index 4b5831d16..d4adf0de5 100644 --- a/vp10/encoder/block.h +++ b/vp10/encoder/block.h @@ -77,7 +77,6 @@ struct macroblock { MB_MODE_INFO_EXT *mbmi_ext; int skip_block; int select_tx_size; - int skip_recode; int skip_optimize; int q_index; diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index 51141d685..39b0d8e2e 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -1707,7 +1707,6 @@ static void rd_pick_sb_modes(VP10_COMP *cpi, ctx->is_coded = 0; ctx->skippable = 0; ctx->pred_pixel_ready = 0; - x->skip_recode = 0; // Set to zero to make sure we do not use the previous encoded frame stats mbmi->skip = 0; @@ -2263,8 +2262,6 @@ static void encode_sb(VP10_COMP *cpi, ThreadData *td, set_offsets(cpi, tile, x, mi_row, mi_col, bsize); if (!x->skip) { - // TODO(geza.lore): Investigate if this can be relaxed - x->skip_recode = 0; memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); x->skip_optimize = 0; @@ -4970,10 +4967,7 @@ static void encode_superblock(VP10_COMP *cpi, ThreadData *td, const int mi_width = num_8x8_blocks_wide_lookup[bsize]; const int mi_height = num_8x8_blocks_high_lookup[bsize]; - x->skip_recode = 0; - - if (!x->skip_recode) - memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); + memset(x->skip_txfm, 0, sizeof(x->skip_txfm)); x->skip_optimize = ctx->is_coded; ctx->is_coded = 1; diff --git a/vp10/encoder/encodemb.c b/vp10/encoder/encodemb.c index 966a13303..b9412cc5a 100644 --- a/vp10/encoder/encodemb.c +++ b/vp10/encoder/encodemb.c @@ -436,10 +436,9 @@ static void encode_block(int plane, int block, int blk_row, int blk_col, // Assert not magic number (uninitialised). assert(x->blk_skip[plane][(blk_row << bwl) + blk_col] != 234); - if (!x->skip_recode && - x->blk_skip[plane][(blk_row << bwl) + blk_col] == 0) { + if (x->blk_skip[plane][(blk_row << bwl) + blk_col] == 0) { #else - if (!x->skip_recode) { + { #endif if (x->quant_fp) { // Encoding process for rtc mode @@ -479,12 +478,11 @@ static void encode_block(int plane, int block, int blk_row, int blk_col, } #if CONFIG_VAR_TX else { - if (!x->skip_recode) - p->eobs[block] = 0; + p->eobs[block] = 0; } #endif - if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { + if (x->optimize) { int ctx; #if CONFIG_VAR_TX switch (tx_size) { @@ -661,10 +659,9 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) { int block = 0; int step = 1 << (max_tx_size * 2); #endif - if (!x->skip_recode) - vp10_subtract_plane(x, bsize, plane); + vp10_subtract_plane(x, bsize, plane); - if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { + if (x->optimize) { #if CONFIG_VAR_TX vp10_get_entropy_contexts(bsize, TX_4X4, pd, ctx.ta[plane], ctx.tl[plane]); @@ -761,24 +758,15 @@ void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col, src_stride, dst, dst_stride); #endif // CONFIG_VP9_HIGHBITDEPTH -#if CONFIG_EXT_INTRA vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size, VP10_XFORM_QUANT_B); -#else - if (!x->skip_recode) - vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size, - VP10_XFORM_QUANT_B); - else - vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size, - VP10_XFORM_QUANT_SKIP_QUANT); -#endif // CONFIG_EXT_INTRA if (args->ctx != NULL) { struct optimize_ctx *const ctx = args->ctx; ENTROPY_CONTEXT *a, *l; a = &ctx->ta[plane][blk_col]; l = &ctx->tl[plane][blk_row]; - if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { + if (x->optimize) { int ctx; ctx = combine_entropy_contexts(*a, *l); *a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0; @@ -814,8 +802,7 @@ void vp10_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane, struct optimize_ctx ctx; struct encode_b_args arg = {x, &ctx, &xd->mi[0]->mbmi.skip}; - if (enable_optimize_b && x->optimize && - (!x->skip_recode || !x->skip_optimize)) { + if (enable_optimize_b && x->optimize) { const struct macroblockd_plane* const pd = &xd->plane[plane]; const TX_SIZE tx_size = plane ? get_uv_tx_size(&xd->mi[0]->mbmi, pd) : xd->mi[0]->mbmi.tx_size; diff --git a/vp10/encoder/firstpass.c b/vp10/encoder/firstpass.c index 9ebb5a892..1504462c4 100644 --- a/vp10/encoder/firstpass.c +++ b/vp10/encoder/firstpass.c @@ -563,7 +563,6 @@ void vp10_first_pass(VP10_COMP *cpi, const struct lookahead_entry *source) { pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1]; p[i].eobs = ctx->eobs_pbuf[i][1]; } - x->skip_recode = 0; vp10_init_mv_probs(cm); vp10_initialize_rd_consts(cpi); diff --git a/vp10/encoder/speed_features.c b/vp10/encoder/speed_features.c index 92b071e73..3f411b77e 100644 --- a/vp10/encoder/speed_features.c +++ b/vp10/encoder/speed_features.c @@ -131,7 +131,6 @@ static void set_good_speed_feature(VP10_COMP *cpi, VP10_COMMON *cm, const int boosted = frame_is_boosted(cpi); sf->adaptive_rd_thresh = 1; - sf->allow_skip_recode = 1; if (speed >= 1) { if ((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) || @@ -335,7 +334,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf, sf->mv.subpel_iters_per_step = 1; sf->adaptive_rd_thresh = 4; sf->mode_skip_start = 6; - sf->allow_skip_recode = 0; sf->optimize_coefficients = 0; sf->disable_split_mask = DISABLE_ALL_SPLIT; sf->lpf_pick = LPF_PICK_FROM_Q; @@ -369,7 +367,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf, sf->inter_mode_mask[BLOCK_128X128] = INTER_NEAREST; #endif // CONFIG_EXT_PARTITION sf->max_intra_bsize = BLOCK_32X32; - sf->allow_skip_recode = 1; } if (speed >= 5) { @@ -382,7 +379,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf, (frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1); sf->max_delta_qindex = is_keyframe ? 20 : 15; sf->partition_search_type = REFERENCE_PARTITION; - sf->allow_skip_recode = 0; sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO; sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO; sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO; @@ -532,7 +528,6 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) { } sf->use_rd_breakout = 0; sf->use_uv_intra_rd_estimate = 0; - sf->allow_skip_recode = 0; sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE; sf->use_fast_coef_updates = TWO_LOOP; sf->use_fast_coef_costing = 0; @@ -567,12 +562,6 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) { else if (oxcf->mode == GOOD) set_good_speed_feature(cpi, cm, sf, oxcf->speed); -#if CONFIG_REF_MV - // TODO(geza): Temporarily turn this off for ref-mv to fix tests. - // Investigate/reimplement skip_recode better to enable this. - sf->allow_skip_recode = 0; -#endif // CONFIG_REF_MV - // sf->partition_search_breakout_dist_thr is set assuming max 64x64 // blocks. Normalise this if the blocks are bigger. if (MAX_SB_SIZE_LOG2 > 6) { diff --git a/vp10/encoder/speed_features.h b/vp10/encoder/speed_features.h index dc966e9ac..2ddf4be67 100644 --- a/vp10/encoder/speed_features.h +++ b/vp10/encoder/speed_features.h @@ -288,10 +288,6 @@ typedef struct SPEED_FEATURES { // mode to be evaluated. A high value means we will be faster. int adaptive_rd_thresh; - // Speed feature to allow or disallow skipping of recode at block - // level within a frame. - int allow_skip_recode; - // Coefficient probability model approximation step size int coeff_prob_appx_step;