diff --git a/av2/encoder/intra_mode_search.c b/av2/encoder/intra_mode_search.c index d9edce8398..efa87493f6 100644 --- a/av2/encoder/intra_mode_search.c +++ b/av2/encoder/intra_mode_search.c @@ -577,7 +577,7 @@ int64_t av2_rd_pick_intra_sbuv_mode(const AV2_COMP *const cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, const PICK_MODE_CONTEXT *ctx, - BLOCK_SIZE bsize, TX_SIZE max_tx_size, + BLOCK_SIZE bsize, ModeRDInfoUV *mode_rd_info_uv) { const AV2_COMMON *const cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; @@ -707,10 +707,7 @@ int64_t av2_rd_pick_intra_sbuv_mode(const AV2_COMP *const cpi, MACROBLOCK *x, } int this_rate; RD_STATS tokenonly_rd_stats; - if (!(cpi->sf.intra_sf - .intra_uv_mode_mask[txsize_sqr_up_map[max_tx_size]] & - (1 << mode))) - continue; + if (!intra_mode_cfg->enable_smooth_intra && mode >= UV_SMOOTH_PRED && mode <= UV_SMOOTH_H_PRED) continue; @@ -907,12 +904,10 @@ int av2_search_palette_mode(IntraModeSearchState *intra_search_state, if (num_planes > 1) { { // We have not found any good uv mode yet, so we need to search for it. - TX_SIZE uv_tx = av2_get_tx_size(AVM_PLANE_U, xd); - av2_rd_pick_intra_sbuv_mode(cpi, x, &intra_search_state->rate_uv_intra, - &intra_search_state->rate_uv_tokenonly, - &intra_search_state->dist_uvs, - &intra_search_state->skip_uvs, ctx, bsize, - uv_tx, NULL /*ModeRDInfoUV*/ + av2_rd_pick_intra_sbuv_mode( + cpi, x, &intra_search_state->rate_uv_intra, + &intra_search_state->rate_uv_tokenonly, &intra_search_state->dist_uvs, + &intra_search_state->skip_uvs, ctx, bsize, NULL /*ModeRDInfoUV*/ ); intra_search_state->mode_uv = mbmi->uv_mode; if (xd->lossless[mbmi->segment_id]) { @@ -1316,11 +1311,10 @@ int64_t av2_handle_intra_mode(IntraModeSearchState *intra_search_state, intra_search_state->skip_intra_modes = 1; return INT64_MAX; } - const TX_SIZE uv_tx = av2_get_tx_size(AVM_PLANE_U, xd); av2_rd_pick_intra_sbuv_mode( cpi, x, &intra_search_state->rate_uv_intra, &intra_search_state->rate_uv_tokenonly, &intra_search_state->dist_uvs, - &intra_search_state->skip_uvs, ctx, bsize, uv_tx, + &intra_search_state->skip_uvs, ctx, bsize, sf->intra_sf.reuse_uv_mode_rd_info ? mode_rd_info_uv : NULL); intra_search_state->mode_uv = mbmi->uv_mode; if (xd->lossless[mbmi->segment_id]) { diff --git a/av2/encoder/intra_mode_search.h b/av2/encoder/intra_mode_search.h index 56397978b0..ff345a37ab 100644 --- a/av2/encoder/intra_mode_search.h +++ b/av2/encoder/intra_mode_search.h @@ -328,7 +328,6 @@ int64_t av2_rd_pick_intra_sby_mode(const AV2_COMP *const cpi, ThreadData *td, * copy the tx_type and txfm_skip arrays. * \param[in] mode_rd_info_uv Buffer to hold UV modes RD information. * \param[in] bsize Current partition block size. - * \param[in] max_tx_size The maximum tx_size available * * \return Returns the rd_cost of the best uv mode found. This also updates the * mbmi, the rate and distortion, distortion. @@ -337,7 +336,7 @@ int64_t av2_rd_pick_intra_sbuv_mode(const AV2_COMP *const cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, int64_t *distortion, int *skippable, const PICK_MODE_CONTEXT *ctx, - BLOCK_SIZE bsize, TX_SIZE max_tx_size, + BLOCK_SIZE bsize, ModeRDInfoUV *mode_rd_info_uv); /*! \brief Return the number of colors in src. Used by palette mode. diff --git a/av2/encoder/rdopt.c b/av2/encoder/rdopt.c index 0c82e1fcf8..9200e45aeb 100644 --- a/av2/encoder/rdopt.c +++ b/av2/encoder/rdopt.c @@ -7024,10 +7024,9 @@ void av2_rd_pick_intra_mode_sb(const struct AV2_COMP *cpi, ThreadData *td, sizeof(*txfm_info->blk_skip[AVM_PLANE_Y]) * ctx->num_4x4_blk); av2_copy_array(xd->tx_type_map, ctx->tx_type_map, ctx->num_4x4_blk); } - const TX_SIZE max_uv_tx_size = av2_get_tx_size(AVM_PLANE_U, xd); av2_rd_pick_intra_sbuv_mode(cpi, x, &rate_uv, &rate_uv_tokenonly, &dist_uv, &uv_skip_txfm, ctx, bsize, - max_uv_tx_size, NULL /*ModeRDInfoUV*/ + NULL /*ModeRDInfoUV*/ ); av2_copy_array(ctx->cctx_type_map, xd->cctx_type_map, ctx->num_4x4_blk_chroma); @@ -7635,8 +7634,7 @@ static AVM_INLINE void default_skip_mask(mode_skip_mask_t *mask, } static AVM_INLINE void init_mode_skip_mask(mode_skip_mask_t *mask, - const AV2_COMP *cpi, MACROBLOCK *x, - BLOCK_SIZE bsize) { + const AV2_COMP *cpi, MACROBLOCK *x) { const AV2_COMMON *const cm = &cpi->common; const SPEED_FEATURES *const sf = &cpi->sf; REF_SET ref_set = REF_SET_FULL; @@ -7691,13 +7689,6 @@ static AVM_INLINE void init_mode_skip_mask(mode_skip_mask_t *mask, } } } - - if (bsize > sf->part_sf.max_intra_bsize) { - disable_reference(INTRA_FRAME, mask->ref_combo); - } - - mask->pred_modes[INTRA_FRAME_INDEX] |= - ~(sf->intra_sf.intra_y_mode_mask[max_txsize_lookup[bsize]]); } static AVM_INLINE int prune_ref_frame(const AV2_COMP *cpi, const MACROBLOCK *x, @@ -7814,7 +7805,7 @@ static AVM_INLINE void set_params_rd_pick_inter_mode( } } - init_mode_skip_mask(mode_skip_mask, cpi, x, bsize); + init_mode_skip_mask(mode_skip_mask, cpi, x); // Set params for mode evaluation set_mode_eval_params(cpi, x, MODE_EVAL); diff --git a/av2/encoder/speed_features.c b/av2/encoder/speed_features.c index fe08bd459d..f1a4a036fa 100644 --- a/av2/encoder/speed_features.c +++ b/av2/encoder/speed_features.c @@ -220,7 +220,6 @@ static void set_good_speed_feature_framesize_dependent( sf->part_sf.partition_search_breakout_dist_thr = (1 << 25); sf->part_sf.partition_search_breakout_rate_thr = 200; } else { - sf->part_sf.max_intra_bsize = BLOCK_32X32; sf->part_sf.partition_search_breakout_dist_thr = (1 << 23); sf->part_sf.partition_search_breakout_rate_thr = 120; } @@ -639,9 +638,6 @@ static void set_good_speed_features_framesize_independent( // Disabling it until it is fixed. // sf->inter_sf.prune_comp_using_best_single_mode_ref = 2; - sf->intra_sf.intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V; - sf->intra_sf.intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; - sf->intra_sf.intra_y_mode_mask[TX_64X64] = INTRA_DC_H_V; // TODO(any): Experiment with this speed feature set to 2 for higher quality // presets as well sf->intra_sf.skip_intra_in_interframe = 2; @@ -827,7 +823,6 @@ static AVM_INLINE void init_part_sf(PARTITION_SPEED_FEATURES *part_sf) { part_sf->default_max_partition_size = BLOCK_LARGEST; part_sf->default_min_partition_size = BLOCK_4X4; part_sf->allow_partition_search_skip = 0; - part_sf->max_intra_bsize = BLOCK_LARGEST; // This setting only takes effect when partition_search_type is set // to FIXED_PARTITION. part_sf->fixed_partition_size = BLOCK_16X16; @@ -998,10 +993,6 @@ static AVM_INLINE void init_intra_sf(INTRA_MODE_SPEED_FEATURES *intra_sf) { intra_sf->include_dip_for_top_n_model_rd_pruning = false; intra_sf->skip_intra_dip_search = false; - for (int i = 0; i < TX_SIZES; i++) { - intra_sf->intra_y_mode_mask[i] = INTRA_ALL; - intra_sf->intra_uv_mode_mask[i] = UV_INTRA_ALL; - } intra_sf->disable_smooth_intra = 0; } diff --git a/av2/encoder/speed_features.h b/av2/encoder/speed_features.h index d0eec4ac85..ca461d00e1 100644 --- a/av2/encoder/speed_features.h +++ b/av2/encoder/speed_features.h @@ -32,22 +32,6 @@ typedef struct MESH_PATTERN { int interval; } MESH_PATTERN; -enum { - INTRA_ALL = (1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED) | (1 << D45_PRED) | - (1 << D135_PRED) | (1 << D113_PRED) | (1 << D157_PRED) | - (1 << D203_PRED) | (1 << D67_PRED) | (1 << SMOOTH_PRED) | - (1 << SMOOTH_V_PRED) | (1 << SMOOTH_H_PRED) | (1 << PAETH_PRED), - UV_INTRA_ALL = - (1 << UV_DC_PRED) | (1 << UV_V_PRED) | (1 << UV_H_PRED) | - (1 << UV_D45_PRED) | (1 << UV_D135_PRED) | (1 << UV_D113_PRED) | - (1 << UV_D157_PRED) | (1 << UV_D203_PRED) | (1 << UV_D67_PRED) | - (1 << UV_SMOOTH_PRED) | (1 << UV_SMOOTH_V_PRED) | - (1 << UV_SMOOTH_H_PRED) | (1 << UV_PAETH_PRED) | (1 << UV_CFL_PRED), - UV_INTRA_DC_H_V_CFL = (1 << UV_DC_PRED) | (1 << UV_V_PRED) | - (1 << UV_H_PRED) | (1 << UV_CFL_PRED), - INTRA_DC_H_V = (1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED), -}; - enum { INTER_ALL = (1 << NEARMV) | (1 << GLOBALMV) | (1 << NEWMV) | (1 << WARP_NEWMV) | (1 << NEAR_NEARMV) | (1 << NEW_NEWMV) | @@ -376,11 +360,6 @@ typedef struct PARTITION_SPEED_FEATURES { // the number of steps by the value contained in this variable. int simple_motion_search_reduce_search_steps; - // This variable controls the maximum block size where intra blocks can be - // used in inter frames. - // TODO(aconverse): Fold this into one of the other many mode skips - BLOCK_SIZE max_intra_bsize; - // Use CNN with luma pixels on source frame on each of the 64x64 subblock to // perform split/no_split decision on intra-frames. int intra_cnn_split; @@ -885,11 +864,6 @@ typedef struct INTERP_FILTER_SPEED_FEATURES { } INTERP_FILTER_SPEED_FEATURES; typedef struct INTRA_MODE_SPEED_FEATURES { - // These bit masks allow you to enable or disable intra modes for each - // transform size separately. - int intra_y_mode_mask[TX_SIZES]; - int intra_uv_mode_mask[TX_SIZES]; - // flag to allow skipping intra mode for inter frame prediction int skip_intra_in_interframe;