Commit fe67ed6a authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Jingning Han

cb4x4: Move sub-4X4 TX sizes behind CONFIG_CHROMA_2X2.

cb4x4 itself should not require these sizes.

This simplifies compatibility with other experiments, since we can
first make them work with cb4x4 (which is now on by default), and
then worry about chroma_2x2 (which is not) in separate steps.

Encoder and decoder output should remain unchanged.

Change-Id: I4e9fcdae49f238b5099a3c74a398fe993c2545f8
parent 6e4955d4
......@@ -127,14 +127,14 @@ void av1_fwd_txfm2d_64x64_c(const int16_t *input, int32_t *output, int stride,
static const TXFM_1D_CFG *fwd_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
// DCT
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_col_cfg_dct_4, &fwd_txfm_1d_col_cfg_dct_8,
&fwd_txfm_1d_col_cfg_dct_16, &fwd_txfm_1d_col_cfg_dct_32 },
// ADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_col_cfg_adst_4, &fwd_txfm_1d_col_cfg_adst_8,
......@@ -142,14 +142,14 @@ static const TXFM_1D_CFG *fwd_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
#if CONFIG_EXT_TX
// FLIPADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_col_cfg_adst_4, &fwd_txfm_1d_col_cfg_adst_8,
&fwd_txfm_1d_col_cfg_adst_16, &fwd_txfm_1d_col_cfg_adst_32 },
// IDENTITY
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_cfg_identity_4, &fwd_txfm_1d_cfg_identity_8,
......@@ -160,14 +160,14 @@ static const TXFM_1D_CFG *fwd_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
static const TXFM_1D_CFG *fwd_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
// DCT
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_row_cfg_dct_4, &fwd_txfm_1d_row_cfg_dct_8,
&fwd_txfm_1d_row_cfg_dct_16, &fwd_txfm_1d_row_cfg_dct_32 },
// ADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_row_cfg_adst_4, &fwd_txfm_1d_row_cfg_adst_8,
......@@ -175,14 +175,14 @@ static const TXFM_1D_CFG *fwd_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
#if CONFIG_EXT_TX
// FLIPADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_row_cfg_adst_4, &fwd_txfm_1d_row_cfg_adst_8,
&fwd_txfm_1d_row_cfg_adst_16, &fwd_txfm_1d_row_cfg_adst_32 },
// IDENTITY
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&fwd_txfm_1d_cfg_identity_4, &fwd_txfm_1d_cfg_identity_8,
......
......@@ -38,14 +38,14 @@ static INLINE TxfmFunc inv_txfm_type_to_func(TXFM_TYPE txfm_type) {
static const TXFM_1D_CFG *inv_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
// DCT
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_col_cfg_dct_4, &inv_txfm_1d_col_cfg_dct_8,
&inv_txfm_1d_col_cfg_dct_16, &inv_txfm_1d_col_cfg_dct_32 },
// ADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_col_cfg_adst_4, &inv_txfm_1d_col_cfg_adst_8,
......@@ -53,14 +53,14 @@ static const TXFM_1D_CFG *inv_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
#if CONFIG_EXT_TX
// FLIPADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_col_cfg_adst_4, &inv_txfm_1d_col_cfg_adst_8,
&inv_txfm_1d_col_cfg_adst_16, &inv_txfm_1d_col_cfg_adst_32 },
// IDENTITY
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_cfg_identity_4, &inv_txfm_1d_cfg_identity_8,
......@@ -71,14 +71,14 @@ static const TXFM_1D_CFG *inv_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
static const TXFM_1D_CFG *inv_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
// DCT
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_row_cfg_dct_4, &inv_txfm_1d_row_cfg_dct_8,
&inv_txfm_1d_row_cfg_dct_16, &inv_txfm_1d_row_cfg_dct_32 },
// ADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_row_cfg_adst_4, &inv_txfm_1d_row_cfg_adst_8,
......@@ -86,14 +86,14 @@ static const TXFM_1D_CFG *inv_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES] = {
#if CONFIG_EXT_TX
// FLIPADST
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_row_cfg_adst_4, &inv_txfm_1d_row_cfg_adst_8,
&inv_txfm_1d_row_cfg_adst_16, &inv_txfm_1d_row_cfg_adst_32 },
// IDENTITY
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
NULL,
#endif
&inv_txfm_1d_cfg_identity_4, &inv_txfm_1d_cfg_identity_8,
......
......@@ -42,7 +42,7 @@
//
// A loopfilter should be applied to every other 8x8 horizontally.
static const uint64_t left_64x64_txform_mask[TX_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
0xffffffffffffffffULL, // TX_2X2
#endif
0xffffffffffffffffULL, // TX_4X4
......@@ -72,7 +72,7 @@ static const uint64_t left_64x64_txform_mask[TX_SIZES] = {
//
// A loopfilter should be applied to every other 4 the row vertically.
static const uint64_t above_64x64_txform_mask[TX_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
0xffffffffffffffffULL, // TX_4X4
#endif
0xffffffffffffffffULL, // TX_4X4
......@@ -171,7 +171,7 @@ static const uint64_t above_border = 0x000000ff000000ffULL;
// 16 bit masks for uv transform sizes.
static const uint16_t left_64x64_txform_mask_uv[TX_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
0xffff, // TX_2X2
#endif
0xffff, // TX_4X4
......@@ -184,7 +184,7 @@ static const uint16_t left_64x64_txform_mask_uv[TX_SIZES] = {
};
static const uint16_t above_64x64_txform_mask_uv[TX_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
0xffff, // TX_2X2
#endif
0xffff, // TX_4X4
......@@ -1918,7 +1918,7 @@ static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = {
static const uint32_t av1_transform_masks[NUM_EDGE_DIRS][TX_SIZES_ALL] = {
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
2 - 1, // TX_2X2
#endif
4 - 1, // TX_4X4
......@@ -1940,7 +1940,7 @@ static const uint32_t av1_transform_masks[NUM_EDGE_DIRS][TX_SIZES_ALL] = {
32 - 1 // TX_32X8
},
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
2 - 1, // TX_2X2
#endif
4 - 1, // TX_4X4
......
......@@ -799,7 +799,7 @@ static INLINE int get_ext_tx_set(TX_SIZE tx_size, BLOCK_SIZE bs, int is_inter,
static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][EXT_TX_SIZES] =
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 1, 1, 1, 1, 1 }, // unused
{ 0, 1, 1, 0, 0 },
{ 0, 0, 0, 1, 0 },
......@@ -807,12 +807,12 @@ static const int use_intra_ext_tx_for_txsize[EXT_TX_SETS_INTRA][EXT_TX_SIZES] =
{ 1, 1, 1, 1 }, // unused
{ 1, 1, 0, 0 },
{ 0, 0, 1, 0 },
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2
};
static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][EXT_TX_SIZES] =
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 1, 1, 1, 1, 1 }, // unused
{ 0, 1, 1, 0, 0 },
{ 0, 0, 0, 1, 0 },
......@@ -822,7 +822,7 @@ static const int use_inter_ext_tx_for_txsize[EXT_TX_SETS_INTER][EXT_TX_SIZES] =
{ 1, 1, 0, 0 },
{ 0, 0, 1, 0 },
{ 0, 0, 0, 1 },
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2
};
// Transform types used in each intra set
......@@ -1055,7 +1055,7 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, const MACROBLOCKD *xd,
if (is_inter_block(mbmi)) {
// UV Inter only
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
if (tx_size < TX_4X4) return DCT_DCT;
#endif
return (mbmi->tx_type == IDTX && txsize_sqr_map[tx_size] >= TX_32X32)
......@@ -1066,11 +1066,13 @@ static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, const MACROBLOCKD *xd,
#if CONFIG_CB4X4
(void)block;
#if CONFIG_CHROMA_2X2
if (tx_size < TX_4X4)
return DCT_DCT;
else
#endif
return intra_mode_to_tx_type_context[mbmi->uv_mode];
#else
#else // CONFIG_CB4X4
// Sub8x8-Inter/Intra OR UV-Intra
if (is_inter_block(mbmi)) // Sub8x8-Inter
......@@ -1114,7 +1116,7 @@ static INLINE TX_SIZE depth_to_tx_size(int depth) {
static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi,
const struct macroblockd_plane *pd) {
TX_SIZE uv_txsize;
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
assert(mbmi->tx_size > TX_2X2);
#endif
......@@ -1126,9 +1128,6 @@ static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi,
uv_txsize = uv_txsize_lookup[mbmi->sb_type][mbmi->tx_size][pd->subsampling_x]
[pd->subsampling_y];
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
uv_txsize = AOMMAX(uv_txsize, TX_4X4);
#endif
assert(uv_txsize != TX_INVALID);
return uv_txsize;
}
......
This diff is collapsed.
......@@ -135,7 +135,7 @@ const aom_prob av1_cat6_prob[] = {
};
const uint16_t band_count_table[TX_SIZES_ALL][8] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 1, 2, 2, 3, 0, 0, 0 },
#endif
{ 1, 2, 3, 4, 3, 16 - 13, 0 }, { 1, 2, 3, 4, 11, 64 - 21, 0 },
......@@ -151,7 +151,7 @@ const uint16_t band_count_table[TX_SIZES_ALL][8] = {
};
const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0, 1, 3, 6, 10, 13, 16, 0 },
#endif
{ 0, 1, 3, 6, 10, 13, 16, 0 }, { 0, 1, 3, 6, 10, 21, 64, 0 },
......@@ -896,7 +896,7 @@ const aom_cdf_prob av1_pareto8_tail_probs[COEFF_PROB_MODELS][TAIL_NODES] = {
const av1_coeff_probs_model
default_qctx_coef_probs[QCTX_BINS][TX_SIZES][PLANE_TYPES] = {
{ // Q_Index 0
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ // TX_SIZE 0
{ // Y plane
{ // Intra
......@@ -1562,7 +1562,7 @@ default_qctx_coef_probs[QCTX_BINS][TX_SIZES][PLANE_TYPES] = {
#endif // CONFIG_TX64X64
},
{ // Q_Index 1
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ // TX_SIZE 0
{ // Y plane
{ // Intra
......@@ -2228,7 +2228,7 @@ default_qctx_coef_probs[QCTX_BINS][TX_SIZES][PLANE_TYPES] = {
#endif // CONFIG_TX64X64
},
{ // Q_Index 2
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ // TX_SIZE 0
{ // Y plane
{ // Intra
......@@ -2894,7 +2894,7 @@ default_qctx_coef_probs[QCTX_BINS][TX_SIZES][PLANE_TYPES] = {
#endif // CONFIG_TX64X64
},
{ // Q_Index 3
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ // TX_SIZE 0
{ // Y plane
{ // Intra
......@@ -4075,7 +4075,7 @@ static const av1_coeff_probs_model default_coef_probs_64x64[PLANE_TYPES] = {
#endif // CONFIG_Q_ADAPT_PROBS
static const aom_prob av1_default_blockzero_probs[TX_SIZES][PLANE_TYPES]
[REF_TYPES][BLOCKZ_CONTEXTS] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ // TX_2x2
{ // Y plane
{ 195, 84, 8, }, // Intra
......@@ -5448,7 +5448,7 @@ static void av1_default_coef_cdfs(FRAME_CONTEXT *fc) {
for (j = 0; j < REF_TYPES; ++j)
for (k = 0; k < COEF_BANDS; ++k)
for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
av1_copy(fc->coef_head_cdfs[TX_2X2][i][j][k][l],
default_coef_head_cdf_4x4[i][j][k][l]);
#endif
......@@ -5500,7 +5500,7 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
ROUND_POWER_OF_TWO(cm->base_qindex, 8 - QCTX_BIN_BITS), QCTX_BINS - 1);
av1_copy(cm->fc->coef_probs, default_qctx_coef_probs[index]);
#else
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
av1_copy(cm->fc->coef_probs[TX_2X2], default_coef_probs_4x4);
#endif
av1_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4);
......
......@@ -125,7 +125,7 @@ static INLINE int av1_get_cat6_extrabits_size(TX_SIZE tx_size,
// TODO(debargha): Does TX_64X64 require an additional extrabit?
if (tx_size > TX_32X32) tx_size = TX_32X32;
#endif
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
int tx_offset = (tx_size < TX_4X4) ? 0 : (int)(tx_size - TX_4X4);
#else
int tx_offset = (int)(tx_size - TX_4X4);
......@@ -263,7 +263,7 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
const ENTROPY_CONTEXT *l) {
ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
switch (tx_size) {
case TX_2X2:
above_ec = a[0] != 0;
......@@ -338,7 +338,7 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
default: assert(0 && "Invalid transform size."); break;
}
return combine_entropy_contexts(above_ec, left_ec);
#endif
#endif // CONFIG_CHROMA_2X2
switch (tx_size) {
case TX_4X4:
......
......@@ -18,7 +18,7 @@
#if CONFIG_LV_MAP
const aom_prob default_txb_skip[TX_SIZES][TXB_SKIP_CONTEXTS] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
#endif
{ 252, 71, 126, 184, 178, 218, 251, 49, 133, 221, 27, 92, 197 },
......@@ -32,7 +32,7 @@ const aom_prob default_dc_sign[PLANE_TYPES][DC_SIGN_CONTEXTS] = {
const aom_prob default_coeff_base
[TX_SIZES][PLANE_TYPES][NUM_BASE_LEVELS][COEFF_BASE_CONTEXTS] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ // TX_2X2
{
{ 73, 128, 131, 204, 165, 226, 169, 236, 18, 128, 51,
......@@ -168,7 +168,7 @@ const aom_prob default_coeff_base
};
const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 34, 103, 61, 106, 62, 160, 112, 54, 173, 121,
75, 157, 92, 75, 157, 129, 94, 65, 52, 37 },
......@@ -203,7 +203,7 @@ const aom_prob default_nz_map[TX_SIZES][PLANE_TYPES][SIG_COEF_CONTEXTS] = {
};
const aom_prob default_eob_flag[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 229, 236, 231, 222, 239, 236, 214, 201, 236, 226, 195, 134, 228,
210, 150, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
......@@ -238,7 +238,7 @@ const aom_prob default_eob_flag[TX_SIZES][PLANE_TYPES][EOB_COEF_CONTEXTS] = {
};
const aom_prob default_coeff_lps[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 164, 128, 134, 165, 128, 137, 168, 128, 97, 136, 167, 128,
182, 205, 143, 172, 200, 145, 173, 193, 103, 137, 170, 191,
......@@ -1852,7 +1852,7 @@ static const aom_prob
default_inter_ext_tx_prob[EXT_TX_SETS_INTER][EXT_TX_SIZES][TX_TYPES - 1] = {
{
// ToDo(yaowu): remove unused entry 0.
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ 0 },
......@@ -1861,7 +1861,7 @@ static const aom_prob
{ 0 },
},
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ 10, 24, 30, 128, 128, 128, 128, 112, 160, 128, 128, 128, 128, 128,
......@@ -1874,7 +1874,7 @@ static const aom_prob
128 },
},
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ 10, 30, 128, 112, 160, 128, 128, 128, 128, 128, 128 },
......@@ -1883,7 +1883,7 @@ static const aom_prob
{ 10, 30, 128, 112, 160, 128, 128, 128, 128, 128, 128 },
},
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ 12 },
......@@ -1900,7 +1900,7 @@ static const aom_prob
[TX_TYPES - 1] = {
{
// ToDo(yaowu): remove unused entry 0.
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 0 },
},
......@@ -1983,7 +1983,7 @@ static const aom_prob
},
},
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 0 },
},
......@@ -2066,7 +2066,7 @@ static const aom_prob
},
},
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 0 },
},
......@@ -2164,7 +2164,7 @@ int av1_ext_tx_inv[TX_TYPES];
static const aom_prob
default_intra_ext_tx_prob[EXT_TX_SIZES][TX_TYPES][TX_TYPES - 1] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ { 240, 85, 128 }, { 4, 1, 248 }, { 4, 1, 8 }, { 4, 248, 128 } },
#endif
{ { 240, 85, 128 }, { 4, 1, 248 }, { 4, 1, 8 }, { 4, 248, 128 } },
......@@ -2173,7 +2173,7 @@ static const aom_prob
};
static const aom_prob default_inter_ext_tx_prob[EXT_TX_SIZES][TX_TYPES - 1] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 160, 85, 128 },
#endif
{ 160, 85, 128 },
......@@ -2203,7 +2203,7 @@ static const aom_prob default_filter_intra_probs[2] = { 230, 230 };
#if CONFIG_SUPERTX
static const aom_prob
default_supertx_prob[PARTITION_SUPERTX_CONTEXTS][TX_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
#if CONFIG_TX64X64
{ 1, 1, 160, 160, 170, 180 }, { 1, 1, 200, 200, 210, 220 },
#else
......@@ -2214,8 +2214,8 @@ static const aom_prob
{ 1, 160, 160, 170, 180 }, { 1, 200, 200, 210, 220 },
#else
{ 1, 160, 160, 170 }, { 1, 200, 200, 210 },
#endif // CONFIG_CB4X4
#endif // CONFIG_TX64X64
#endif // CONFIG_CHROMA_2X2
};
#endif // CONFIG_SUPERTX
......@@ -2562,7 +2562,7 @@ static const aom_cdf_prob default_intra_ext_tx_cdf
[EXT_TX_SETS_INTRA][EXT_TX_SIZES][INTRA_MODES][CDF_SIZE(TX_TYPES)] = {
{
// FIXME: unused zero positions, from uncoded trivial transform set
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{
{ 0 },
},
......@@ -2917,7 +2917,7 @@ static const aom_cdf_prob
default_inter_ext_tx_cdf[EXT_TX_SETS_INTER][EXT_TX_SIZES][CDF_SIZE(
TX_TYPES)] = {
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ 0 },
......@@ -2925,7 +2925,7 @@ static const aom_cdf_prob
{ 0 },
{ 0 } },
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ AOM_ICDF(1280), AOM_ICDF(1453), AOM_ICDF(1626), AOM_ICDF(2277),
......@@ -2949,7 +2949,7 @@ static const aom_cdf_prob
AOM_ICDF(28253), AOM_ICDF(29758), AOM_ICDF(31263), AOM_ICDF(32768),
0 } },
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ AOM_ICDF(1280), AOM_ICDF(3125), AOM_ICDF(4970), AOM_ICDF(17132),
......@@ -2969,7 +2969,7 @@ static const aom_cdf_prob
AOM_ICDF(28370), AOM_ICDF(29836), AOM_ICDF(31302), AOM_ICDF(32768),
0 } },
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ 0 },
#endif
{ AOM_ICDF(1536), AOM_ICDF(32768), 0 },
......@@ -2980,7 +2980,7 @@ static const aom_cdf_prob
#else
static const aom_cdf_prob
default_intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][CDF_SIZE(TX_TYPES)] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ { AOM_ICDF(30720), AOM_ICDF(31400), AOM_ICDF(32084), AOM_ICDF(32768),
0 },
{ AOM_ICDF(512), AOM_ICDF(638), AOM_ICDF(31764), AOM_ICDF(32768), 0 },
......@@ -3011,7 +3011,7 @@ static const aom_cdf_prob
static const aom_cdf_prob
default_inter_ext_tx_cdf[EXT_TX_SIZES][CDF_SIZE(TX_TYPES)] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
{ AOM_ICDF(20480), AOM_ICDF(24560), AOM_ICDF(28664), AOM_ICDF(32768), 0 },
#endif
{ AOM_ICDF(20480), AOM_ICDF(24560), AOM_ICDF(28664), AOM_ICDF(32768), 0 },
......
......@@ -106,7 +106,7 @@ typedef struct frame_contexts {
[SWITCHABLE_FILTERS - 1];
#if CONFIG_ADAPT_SCAN
// TODO(angiebird): try aom_prob
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
uint32_t non_zero_prob_2x2[TX_TYPES][4];
#endif
uint32_t non_zero_prob_4X4[TX_TYPES][16];
......@@ -121,7 +121,7 @@ typedef struct frame_contexts {
uint32_t non_zero_prob_32X16[TX_TYPES][512];
uint32_t non_zero_prob_16X32[TX_TYPES][512];
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
DECLARE_ALIGNED(16, int16_t, scan_2x2[TX_TYPES][4]);
#endif
DECLARE_ALIGNED(16, int16_t, scan_4X4[TX_TYPES][16]);
......@@ -136,7 +136,7 @@ typedef struct frame_contexts {
DECLARE_ALIGNED(16, int16_t, scan_16X32[TX_TYPES][512]);
DECLARE_ALIGNED(16, int16_t, scan_32X16[TX_TYPES][512]);
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
DECLARE_ALIGNED(16, int16_t, iscan_2x2[TX_TYPES][4]);
#endif
DECLARE_ALIGNED(16, int16_t, iscan_4X4[TX_TYPES][16]);
......@@ -151,7 +151,7 @@ typedef struct frame_contexts {
DECLARE_ALIGNED(16, int16_t, iscan_16X32[TX_TYPES][512]);
DECLARE_ALIGNED(16, int16_t, iscan_32X16[TX_TYPES][512]);
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
int16_t nb_2x2[TX_TYPES][(4 + 1) * 2];
#endif
int16_t nb_4X4[TX_TYPES][(16 + 1) * 2];
......@@ -324,9 +324,9 @@ typedef struct FRAME_COUNTS {
unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS];
#if CONFIG_ADAPT_SCAN
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
unsigned int non_zero_count_2x2[TX_TYPES][4];
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2
unsigned int non_zero_count_4X4[TX_TYPES][16];
unsigned int non_zero_count_8X8[TX_TYPES][64];
unsigned int non_zero_count_16X16[TX_TYPES][256];
......
......@@ -149,7 +149,7 @@ typedef char PARTITION_CONTEXT;
// block transform size
typedef enum ATTRIBUTE_PACKED {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
TX_2X2, // 2x2 transform
#endif
TX_4X4, // 4x4 transform
......@@ -249,15 +249,15 @@ typedef enum {
} BOUNDARY_TYPE;
#if CONFIG_EXT_TX
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
#define EXT_TX_SIZES 5 // number of sizes that use extended transforms
#else
#define EXT_TX_SIZES 4 // number of sizes that use extended transforms
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2
#define EXT_TX_SETS_INTER 4 // Sets of transform selections for INTER
#define EXT_TX_SETS_INTRA 3 // Sets of transform selections for INTRA
#else
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
#define EXT_TX_SIZES 4 // number of sizes that use extended transforms
#else
#define EXT_TX_SIZES 3 // number of sizes that use extended transforms
......
......@@ -1295,7 +1295,7 @@ static void idct64x64_add(const tran_low_t *input, uint8_t *dest, int stride,
}
#endif // CONFIG_TX64X64
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
static void inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest, int stride,
int eob, TX_TYPE tx_type, int lossless) {
tran_high_t a1 = input[0] >> UNIT_QUANT_SHIFT;
......@@ -2465,7 +2465,7 @@ void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
aom_highbd_iwht4x4_1_add(input, dest, stride, bd);
}
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
static void highbd_inv_txfm_add_2x2(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd,
TX_TYPE tx_type, int lossless) {
......@@ -2778,7 +2778,7 @@ void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
// case.
inv_txfm_add_4x4(input, dest, stride, eob, tx_type, lossless);