Commit 814f41e7 authored by Hui Su's avatar Hui Su

Remove symbol mapping of intra modes

The _ind and _inv mapping tables are not necessary. The CDF tables are
updated with new values converted from the old tables. Performance
impact is small and neutral.

Change-Id: I65845ab3c80f88794abd9ab9e61494af56099c7c
parent d7c8bd51
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -557,8 +557,6 @@ extern const aom_prob av1_default_palette_y_mode_prob[PALETTE_BLOCK_SIZES]
extern const aom_prob
av1_default_palette_uv_mode_prob[PALETTE_UV_MODE_CONTEXTS];
extern const int av1_intra_mode_ind[INTRA_MODES];
extern const int av1_intra_mode_inv[INTRA_MODES];
#if CONFIG_EXT_TX
extern int av1_ext_tx_ind[EXT_TX_SET_TYPES][TX_TYPES];
extern int av1_ext_tx_inv[EXT_TX_SET_TYPES][TX_TYPES];
......
......@@ -36,8 +36,7 @@
#define DEC_MISMATCH_DEBUG 0
static PREDICTION_MODE read_intra_mode(aom_reader *r, aom_cdf_prob *cdf) {
return (PREDICTION_MODE)
av1_intra_mode_inv[aom_read_symbol(r, cdf, INTRA_MODES, ACCT_STR)];
return (PREDICTION_MODE)aom_read_symbol(r, cdf, INTRA_MODES, ACCT_STR);
}
static int read_delta_qindex(AV1_COMMON *cm, MACROBLOCKD *xd, aom_reader *r,
......
......@@ -153,7 +153,7 @@ static void write_intra_mode_kf(const AV1_COMMON *cm, FRAME_CONTEXT *frame_ctx,
#if CONFIG_INTRABC
assert(!is_intrabc_block(&mi->mbmi));
#endif // CONFIG_INTRABC
aom_write_symbol(w, av1_intra_mode_ind[mode],
aom_write_symbol(w, mode,
get_y_mode_cdf(frame_ctx, mi, above_mi, left_mi, block),
INTRA_MODES);
(void)cm;
......@@ -1628,8 +1628,7 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
static void write_intra_mode(FRAME_CONTEXT *frame_ctx, BLOCK_SIZE bsize,
PREDICTION_MODE mode, aom_writer *w) {
aom_write_symbol(w, av1_intra_mode_ind[mode],
frame_ctx->y_mode_cdf[size_group_lookup[bsize]],
aom_write_symbol(w, mode, frame_ctx->y_mode_cdf[size_group_lookup[bsize]],
INTRA_MODES);
}
......@@ -1637,7 +1636,7 @@ static void write_intra_uv_mode(FRAME_CONTEXT *frame_ctx,
UV_PREDICTION_MODE uv_mode,
PREDICTION_MODE y_mode, aom_writer *w) {
#if !CONFIG_CFL
uv_mode = av1_intra_mode_ind[get_uv_mode(uv_mode)];
uv_mode = get_uv_mode(uv_mode);
#endif
aom_write_symbol(w, uv_mode, frame_ctx->uv_mode_cdf[y_mode], UV_INTRA_MODES);
}
......
......@@ -5917,13 +5917,13 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
const PREDICTION_MODE l = av1_left_block_mode(mi, left_mi, bidx);
++counts->kf_y_mode[a][l][bmode];
#endif // CONFIG_ENTROPY_STATS
update_cdf(get_y_mode_cdf(fc, mi, above_mi, left_mi, bidx),
av1_intra_mode_ind[bmode], INTRA_MODES);
update_cdf(get_y_mode_cdf(fc, mi, above_mi, left_mi, bidx), bmode,
INTRA_MODES);
} else {
#if CONFIG_ENTROPY_STATS
++counts->y_mode[0][bmode];
#endif // CONFIG_ENTROPY_STATS
update_cdf(fc->y_mode_cdf[0], av1_intra_mode_ind[bmode], INTRA_MODES);
update_cdf(fc->y_mode_cdf[0], bmode, INTRA_MODES);
}
}
} else {
......@@ -5933,14 +5933,13 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
const PREDICTION_MODE left = av1_left_block_mode(mi, left_mi, 0);
++counts->kf_y_mode[above][left][y_mode];
#endif // CONFIG_ENTROPY_STATS
update_cdf(get_y_mode_cdf(fc, mi, above_mi, left_mi, 0),
av1_intra_mode_ind[y_mode], INTRA_MODES);
update_cdf(get_y_mode_cdf(fc, mi, above_mi, left_mi, 0), y_mode,
INTRA_MODES);
} else {
#if CONFIG_ENTROPY_STATS
++counts->y_mode[size_group_lookup[bsize]][y_mode];
#endif // CONFIG_ENTROPY_STATS
update_cdf(fc->y_mode_cdf[size_group_lookup[bsize]],
av1_intra_mode_ind[y_mode], INTRA_MODES);
update_cdf(fc->y_mode_cdf[size_group_lookup[bsize]], y_mode, INTRA_MODES);
}
#if CONFIG_FILTER_INTRA
......@@ -5984,8 +5983,7 @@ static void sum_intra_stats(FRAME_COUNTS *counts, MACROBLOCKD *xd,
#if CONFIG_ENTROPY_STATS
++counts->uv_mode[y_mode][uv_mode];
#endif // CONFIG_ENTROPY_STATS
update_cdf(fc->uv_mode_cdf[y_mode], av1_intra_mode_ind[uv_mode],
UV_INTRA_MODES);
update_cdf(fc->uv_mode_cdf[y_mode], uv_mode, UV_INTRA_MODES);
}
#if CONFIG_VAR_TX
......
......@@ -139,22 +139,13 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
for (i = 0; i < INTRA_MODES; ++i)
for (j = 0; j < INTRA_MODES; ++j)
av1_cost_tokens_from_cdf(x->y_mode_costs[i][j], fc->kf_y_cdf[i][j],
av1_intra_mode_inv);
av1_cost_tokens_from_cdf(x->y_mode_costs[i][j], fc->kf_y_cdf[i][j], NULL);
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
av1_cost_tokens_from_cdf(x->mbmode_cost[i], fc->y_mode_cdf[i],
av1_intra_mode_inv);
const int *uv_mode_inv_map =
#if CONFIG_CFL
// CfL codes the uv_mode without reordering it
NULL;
#else
av1_intra_mode_inv;
#endif
av1_cost_tokens_from_cdf(x->mbmode_cost[i], fc->y_mode_cdf[i], NULL);
for (i = 0; i < INTRA_MODES; ++i)
av1_cost_tokens_from_cdf(x->intra_uv_mode_cost[i], fc->uv_mode_cdf[i],
uv_mode_inv_map);
NULL);
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
av1_cost_tokens_from_cdf(x->switchable_interp_costs[i],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment