Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions av2/encoder/intra_mode_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]) {
Expand Down Expand Up @@ -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]) {
Expand Down
3 changes: 1 addition & 2 deletions av2/encoder/intra_mode_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
15 changes: 3 additions & 12 deletions av2/encoder/rdopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions av2/encoder/speed_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
26 changes: 0 additions & 26 deletions av2/encoder/speed_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
Loading