Commit 0d9888bd authored by Hui Su's avatar Hui Su

Remove ext-tx tree

Hard code av1_ext_tx_ind[] and av1_ext_tx_inv[].

Change-Id: Ife650d41be3f85d048f5585659ad57e03f54b39b
parent 72c37c67
......@@ -2653,86 +2653,6 @@ static const aom_cdf_prob default_skip_cdfs[SKIP_CONTEXTS][CDF_SIZE(2)] = {
};
#endif
#if CONFIG_EXT_TX
/* clang-format off */
const aom_tree_index av1_ext_tx_tree[EXT_TX_SET_TYPES][TREE_SIZE(TX_TYPES)] = {
// TODO(yaowu@google.com): remove used entry 0.
{ 0 },
{ -IDTX, -DCT_DCT, },
#if CONFIG_MRC_TX
{ -DCT_DCT, -MRC_DCT, },
{ -IDTX, 2,
-DCT_DCT, -MRC_DCT, },
#endif // CONFIG_MRC_TX
{
-IDTX, 2,
-DCT_DCT, 4,
-ADST_ADST, 6,
-ADST_DCT, -DCT_ADST,
},
{
-IDTX, 2,
-DCT_DCT, 4,
6, 8,
-V_DCT, -H_DCT,
-ADST_ADST, 10,
-ADST_DCT, -DCT_ADST,
},
{
-IDTX, 2,
4, 6,
-V_DCT, -H_DCT,
-DCT_DCT, 8,
10, 16,
12, 14,
-ADST_DCT, -DCT_ADST,
-FLIPADST_DCT, -DCT_FLIPADST,
18, 20,
-ADST_ADST, -FLIPADST_FLIPADST,
-ADST_FLIPADST, -FLIPADST_ADST,
},
{
-IDTX, 2,
4, 14,
6, 8,
-V_DCT, -H_DCT,
10, 12,
-V_ADST, -H_ADST,
-V_FLIPADST, -H_FLIPADST,
-DCT_DCT, 16,
18, 24,
20, 22,
-ADST_DCT, -DCT_ADST,
-FLIPADST_DCT, -DCT_FLIPADST,
26, 28,
-ADST_ADST, -FLIPADST_FLIPADST,
-ADST_FLIPADST, -FLIPADST_ADST,
},
};
/* clang-format on */
int av1_ext_tx_ind[EXT_TX_SET_TYPES][TX_TYPES];
int av1_ext_tx_inv[EXT_TX_SET_TYPES][TX_TYPES];
#else // !CONFIG_EXT_TX
/* clang-format off */
#if CONFIG_MRC_TX
const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)] = {
-DCT_DCT, 2,
-MRC_DCT, 4,
-ADST_ADST, 6,
-ADST_DCT, -DCT_ADST
};
#else
const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)] = {
-DCT_DCT, 2,
-ADST_ADST, 4,
-ADST_DCT, -DCT_ADST
};
#endif // CONFIG_MRC_TX
/* clang-format on */
int av1_ext_tx_ind[TX_TYPES];
int av1_ext_tx_inv[TX_TYPES];
#endif // CONFIG_EXT_TX
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
static const aom_prob
default_intra_filter_probs[INTRA_FILTERS + 1][INTRA_FILTERS - 1] = {
......
......@@ -558,9 +558,80 @@ extern const aom_prob
av1_default_palette_uv_mode_prob[PALETTE_UV_MODE_CONTEXTS];
#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];
#endif
static const int av1_ext_tx_ind[EXT_TX_SET_TYPES][TX_TYPES] = {
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
#if CONFIG_MRC_TX
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
},
{
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
},
#endif // CONFIG_MRC_TX
{
1, 3, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
1, 5, 6, 4, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0,
},
{
3, 4, 5, 8, 6, 7, 9, 10, 11, 0, 1, 2, 0, 0, 0, 0,
},
{
7, 8, 9, 12, 10, 11, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6,
},
};
static const int av1_ext_tx_inv[EXT_TX_SET_TYPES][TX_TYPES] = {
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
#if CONFIG_MRC_TX
{
0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
9, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
#endif // CONFIG_MRC_TX
{
9, 0, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
9, 0, 10, 11, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
9, 10, 11, 0, 1, 2, 4, 5, 3, 6, 7, 8, 0, 0, 0, 0,
},
{
9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 4, 5, 3, 6, 7, 8,
},
};
#else
#if CONFIG_MRC_TX
static const int av1_ext_tx_ind[TX_TYPES] = {
0, 3, 4, 2, 1,
};
static const int av1_ext_tx_inv[TX_TYPES] = {
0, 4, 3, 1, 2,
};
#else
static const int av1_ext_tx_ind[TX_TYPES] = {
0, 2, 3, 1,
};
static const int av1_ext_tx_inv[TX_TYPES] = {
0, 3, 1, 2,
};
#endif // CONFIG_MRC_TX
#endif // CONFIG_EXT_TX
#if CONFIG_INTERINTRA
extern const aom_tree_index
......@@ -611,10 +682,6 @@ void av1_setup_past_independence(struct AV1Common *cm);
void av1_adapt_intra_frame_probs(struct AV1Common *cm);
void av1_adapt_inter_frame_probs(struct AV1Common *cm);
#if !CONFIG_EXT_TX
extern int av1_ext_tx_ind[TX_TYPES];
extern int av1_ext_tx_inv[TX_TYPES];
#endif
static INLINE int av1_ceil_log2(int n) {
int i = 1, p = 2;
......
......@@ -50,14 +50,6 @@ static void initialize_dec(void) {
av1_init_intra_predictors();
av1_init_wedge_masks();
init_done = 1;
#if CONFIG_EXT_TX
for (int s = 1; s < EXT_TX_SET_TYPES; ++s) {
av1_indices_from_tree(av1_ext_tx_ind[s], av1_ext_tx_inv[s],
av1_ext_tx_tree[s]);
}
#else
av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, av1_ext_tx_tree);
#endif
}
}
......
......@@ -115,18 +115,6 @@ static int remux_tiles(const AV1_COMMON *const cm, uint8_t *dst,
int *const tile_col_size_bytes);
#endif
void av1_encode_token_init(void) {
#if CONFIG_EXT_TX
for (int s = 1; s < EXT_TX_SET_TYPES; ++s) {
av1_indices_from_tree(av1_ext_tx_ind[s], av1_ext_tx_inv[s],
av1_ext_tx_tree[s]);
}
#else
/* This hack is necessary because the four TX_TYPES are not consecutive,
e.g., 0, 1, 2, 3, when doing an in-order traversal of the av1_ext_tx_tree
structure. */
av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, av1_ext_tx_tree);
#endif // CONFIG_EXT_TX
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
av1_tokens_from_tree(intra_filter_encodings, av1_intra_filter_tree);
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
......
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