Commit 5694aa7b authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge
Browse files

Remove the av1_intra_mode_tree const with EC_ADAPT.

When EC_ADAPT is enabled, this adds const av1_intra_mode_ind and
 av1_intra_mode_inv arrays and removes the av1_intra_mode_tree const.
This commit has no effect on metrics.

Change-Id: I1de8f4ea91269adacd7fdadbc8426f641ef866f0
parent 693eedd1
......@@ -1255,8 +1255,10 @@ static const aom_cdf_prob default_delta_lf_cdf[CDF_SIZE(DELTA_LF_PROBS + 1)] = {
};
#endif
#endif
#if !CONFIG_EC_ADAPT
int av1_intra_mode_ind[INTRA_MODES];
int av1_intra_mode_inv[INTRA_MODES];
#endif
#if CONFIG_EXT_TX
int av1_ext_tx_intra_ind[EXT_TX_SETS_INTRA][TX_TYPES];
int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES];
......@@ -1264,6 +1266,26 @@ int av1_ext_tx_inter_ind[EXT_TX_SETS_INTER][TX_TYPES];
int av1_ext_tx_inter_inv[EXT_TX_SETS_INTER][TX_TYPES];
#endif
#if CONFIG_EC_ADAPT
#if CONFIG_ALT_INTRA
#if CONFIG_SMOOTH_HV
const int av1_intra_mode_ind[INTRA_MODES] = { 0, 2, 3, 6, 4, 5, 8,
9, 7, 10, 11, 12, 1 };
const int av1_intra_mode_inv[INTRA_MODES] = { 0, 12, 1, 2, 4, 5, 3,
8, 6, 7, 9, 10, 11 };
#else
const int av1_intra_mode_ind[INTRA_MODES] = {
0, 2, 3, 6, 4, 5, 8, 9, 7, 10, 1
};
const int av1_intra_mode_inv[INTRA_MODES] = {
0, 10, 1, 2, 4, 5, 3, 8, 6, 7, 9
};
#endif // CONFIG_SMOOTH_HV
#else
const int av1_intra_mode_ind[INTRA_MODES] = { 0, 2, 3, 6, 4, 5, 8, 9, 7, 1 };
const int av1_intra_mode_inv[INTRA_MODES] = { 0, 9, 1, 2, 4, 5, 3, 8, 6, 7 }
#endif // CONFIG_ALT_INTRA
#else
#if CONFIG_ALT_INTRA
#if CONFIG_SMOOTH_HV
const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
......@@ -1319,6 +1341,7 @@ const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-D153_PRED, -D207_PRED /* 8 = D153_NODE */
};
#endif // CONFIG_ALT_INTRA
#endif // !CONFIG_EC_ADAPT
#if CONFIG_EXT_INTER
/* clang-format off */
......
......@@ -497,9 +497,14 @@ extern const aom_prob av1_default_palette_uv_color_index_prob
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1];
#endif // CONFIG_PALETTE
#if !CONFIG_EC_ADAPT
extern const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
extern int av1_intra_mode_ind[INTRA_MODES];
extern int av1_intra_mode_inv[INTRA_MODES];
#else
extern const int av1_intra_mode_ind[INTRA_MODES];
extern const int av1_intra_mode_inv[INTRA_MODES];
#endif
#if CONFIG_EXT_TX
extern int av1_ext_tx_intra_ind[EXT_TX_SETS_INTRA][TX_TYPES];
extern int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES];
......
......@@ -50,8 +50,10 @@ static void initialize_dec(void) {
av1_init_wedge_masks();
#endif // CONFIG_EXT_INTER
init_done = 1;
#if !CONFIG_EC_ADAPT
av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv,
av1_intra_mode_tree);
#endif
av1_indices_from_tree(av1_switchable_interp_ind, av1_switchable_interp_inv,
av1_switchable_interp_tree);
#if CONFIG_EXT_TX
......
......@@ -198,8 +198,10 @@ void av1_encode_token_init(void) {
#else
av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, av1_ext_tx_tree);
#endif
#if !CONFIG_EC_ADAPT
av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv,
av1_intra_mode_tree);
#endif
}
static void write_intra_mode_kf(const AV1_COMMON *cm, FRAME_CONTEXT *frame_ctx,
......
......@@ -28,6 +28,64 @@
#include "./aom_config.h"
#include "av1/common/entropymode.h"
#if CONFIG_EC_ADAPT
#if CONFIG_ALT_INTRA
#if CONFIG_SMOOTH_HV
const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-DC_PRED,
2, /* 0 = DC_NODE */
-TM_PRED,
4, /* 1 = TM_NODE */
-V_PRED,
6, /* 2 = V_NODE */
8,
12, /* 3 = COM_NODE */
-H_PRED,
10, /* 4 = H_NODE */
-D135_PRED,
-D117_PRED, /* 5 = D135_NODE */
-D45_PRED,
14, /* 6 = D45_NODE */
-D63_PRED,
16, /* 7 = D63_NODE */
-D153_PRED,
18, /* 8 = D153_NODE */
-D207_PRED,
20, /* 9 = D207_NODE */
-SMOOTH_PRED,
22, /* 10 = SMOOTH_NODE */
-SMOOTH_V_PRED,
-SMOOTH_H_PRED /* 11 = SMOOTH_V_NODE */
};
#else
const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-DC_PRED, 2, /* 0 = DC_NODE */
-TM_PRED, 4, /* 1 = TM_NODE */
-V_PRED, 6, /* 2 = V_NODE */
8, 12, /* 3 = COM_NODE */
-H_PRED, 10, /* 4 = H_NODE */
-D135_PRED, -D117_PRED, /* 5 = D135_NODE */
-D45_PRED, 14, /* 6 = D45_NODE */
-D63_PRED, 16, /* 7 = D63_NODE */
-D153_PRED, 18, /* 8 = D153_NODE */
-D207_PRED, -SMOOTH_PRED, /* 9 = D207_NODE */
};
#endif // CONFIG_SMOOTH_HV
#else
const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-DC_PRED, 2, /* 0 = DC_NODE */
-TM_PRED, 4, /* 1 = TM_NODE */
-V_PRED, 6, /* 2 = V_NODE */
8, 12, /* 3 = COM_NODE */
-H_PRED, 10, /* 4 = H_NODE */
-D135_PRED, -D117_PRED, /* 5 = D135_NODE */
-D45_PRED, 14, /* 6 = D45_NODE */
-D63_PRED, 16, /* 7 = D63_NODE */
-D153_PRED, -D207_PRED /* 8 = D153_NODE */
};
#endif // CONFIG_ALT_INTRA
#endif
#define SPACES_PER_TAB 2
typedef unsigned int aom_count_type;
......
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