Commit fb838778 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove compile guards for VAR_TX experiment

This experiment has been adopted.

Change-Id: Ife4c18a59791268b7ac0de5a8a08e762a042cae2
parent 2ec2a6f1
......@@ -39,15 +39,12 @@ typedef struct daala_writer aom_writer;
typedef struct TOKEN_STATS {
int cost;
#if CONFIG_VAR_TX
#if CONFIG_RD_DEBUG
int txb_coeff_cost_map[TXB_COEFF_COST_MAP_SIZE][TXB_COEFF_COST_MAP_SIZE];
#endif
#endif
} TOKEN_STATS;
static INLINE void init_token_stats(TOKEN_STATS *token_stats) {
#if CONFIG_VAR_TX
#if CONFIG_RD_DEBUG
int r, c;
for (r = 0; r < TXB_COEFF_COST_MAP_SIZE; ++r) {
......@@ -55,7 +52,6 @@ static INLINE void init_token_stats(TOKEN_STATS *token_stats) {
token_stats->txb_coeff_cost_map[r][c] = 0;
}
}
#endif
#endif
token_stats->cost = 0;
}
......
......@@ -201,7 +201,6 @@ void av1_free_context_buffers(AV1_COMMON *cm) {
aom_free(cm->above_seg_context);
cm->above_seg_context = NULL;
cm->above_context_alloc_cols = 0;
#if CONFIG_VAR_TX
aom_free(cm->above_txfm_context);
cm->above_txfm_context = NULL;
......@@ -209,7 +208,6 @@ void av1_free_context_buffers(AV1_COMMON *cm) {
aom_free(cm->top_txfm_context[i]);
cm->top_txfm_context[i] = NULL;
}
#endif
}
int av1_alloc_context_buffers(AV1_COMMON *cm, int width, int height) {
......@@ -250,7 +248,6 @@ int av1_alloc_context_buffers(AV1_COMMON *cm, int width, int height) {
aligned_mi_cols, sizeof(*cm->above_seg_context));
if (!cm->above_seg_context) goto fail;
#if CONFIG_VAR_TX
aom_free(cm->above_txfm_context);
cm->above_txfm_context = (TXFM_CONTEXT *)aom_calloc(
aligned_mi_cols << TX_UNIT_WIDE_LOG2, sizeof(*cm->above_txfm_context));
......@@ -263,7 +260,6 @@ int av1_alloc_context_buffers(AV1_COMMON *cm, int width, int height) {
sizeof(*cm->top_txfm_context[0]));
if (!cm->top_txfm_context[i]) goto fail;
}
#endif
cm->above_context_alloc_cols = aligned_mi_cols;
}
......
......@@ -2139,7 +2139,6 @@ static void get_filter_level_and_masks_non420(
const int r_step = (r >> ss_y);
const int col_mask = 1 << c_step;
#if CONFIG_VAR_TX
if (is_inter_block(mbmi) && !mbmi->skip) {
const int tx_row_idx =
(blk_row * mi_size_high[BLOCK_8X8] << TX_UNIT_HIGH_LOG2) >> 1;
......@@ -2156,7 +2155,6 @@ static void get_filter_level_and_masks_non420(
? uv_txsize_lookup[bsize][mb_tx_size][0][0]
: mb_tx_size;
}
#endif
// Filter level can vary per MI
#if CONFIG_EXT_DELTA_Q
......@@ -2176,7 +2174,6 @@ static void get_filter_level_and_masks_non420(
if (!(lfl_r[c_step] = get_filter_level(&cm->lf_info, mbmi))) continue;
#endif
#if CONFIG_VAR_TX
TX_SIZE tx_size_horz_edge, tx_size_vert_edge;
// filt_len_vert_edge is the length of deblocking filter for a vertical edge
......@@ -2212,15 +2209,6 @@ static void get_filter_level_and_masks_non420(
memset(cm->left_txfm_context[pl] +
(((mi_row + idx_r) & MAX_MIB_MASK) << TX_UNIT_HIGH_LOG2),
tx_size, mi_size_high[BLOCK_8X8] << TX_UNIT_HIGH_LOG2);
#else
// The length (or equally the square tx size) of deblocking filter is only
// determined by
// a) current block's width for a vertical deblocking edge
// b) current block's height for a horizontal deblocking edge
TX_SIZE tx_size_vert_edge = txsize_horz_map[tx_size];
TX_SIZE tx_size_horz_edge = txsize_vert_map[tx_size];
(void)pl;
#endif // CONFIG_VAR_TX
if (tx_size_vert_edge == TX_32X32)
tx_size_mask = 3;
......@@ -2254,13 +2242,8 @@ static void get_filter_level_and_masks_non420(
col_masks.m4x4 |= col_mask;
}
#if CONFIG_VAR_TX
if (!skip_this && tx_wide_cur < 8 && !skip_border_4x4_c &&
(c_step & tx_size_mask) == 0)
#else
if (!skip_this && tx_size_vert_edge < TX_8X8 && !skip_border_4x4_c &&
(c_step & tx_size_mask) == 0)
#endif // CONFIG_VAR_TX
mask_4x4_int_c |= col_mask;
}
......@@ -2295,13 +2278,8 @@ static void get_filter_level_and_masks_non420(
row_masks.m4x4 |= col_mask;
}
#if CONFIG_VAR_TX
if (!skip_this && tx_high_cur < 8 && !skip_border_4x4_r &&
(r_step & tx_size_mask) == 0)
#else
if (!skip_this && tx_size_horz_edge < TX_8X8 && !skip_border_4x4_r &&
(r_step & tx_size_mask) == 0)
#endif // CONFIG_VAR_TX
mask_4x4_int_r |= col_mask;
}
}
......@@ -2783,7 +2761,6 @@ static TX_SIZE av1_get_transform_size(const MODE_INFO *const mi,
: av1_get_uv_tx_size(mbmi, plane_ptr);
assert(tx_size < TX_SIZES_ALL);
#if CONFIG_VAR_TX
// mi_row and mi_col is the absolute position of the MI block.
// idx_c and idx_r is the relative offset of the MI within the super block
// c and r is the relative offset of the 8x8 block within the supert block
......@@ -2818,12 +2795,6 @@ static TX_SIZE av1_get_transform_size(const MODE_INFO *const mi,
: uv_txsize_lookup[bsize][mb_tx_size][0][0];
assert(tx_size < TX_SIZES_ALL);
}
#else
(void)mi_row;
(void)mi_col;
(void)scale_horz;
(void)scale_vert;
#endif // CONFIG_VAR_TX
// since in case of chrominance or non-square transorm need to convert
// transform size into transform size in particular direction.
......@@ -3468,17 +3439,13 @@ void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, AV1_COMMON *cm,
int plane;
#if !CONFIG_PARALLEL_DEBLOCKING
#if CONFIG_VAR_TX
for (int i = 0; i < MAX_MB_PLANE; ++i)
memset(cm->top_txfm_context[i], TX_32X32, cm->mi_cols << TX_UNIT_WIDE_LOG2);
#endif // CONFIG_VAR_TX
for (mi_row = start; mi_row < stop; mi_row += cm->mib_size) {
MODE_INFO **mi = cm->mi_grid_visible + mi_row * cm->mi_stride;
#if CONFIG_VAR_TX
for (int i = 0; i < MAX_MB_PLANE; ++i)
memset(cm->left_txfm_context[i], TX_32X32,
MAX_MIB_SIZE << TX_UNIT_HIGH_LOG2);
#endif // CONFIG_VAR_TX
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += cm->mib_size) {
av1_setup_dst_planes(planes, cm->sb_size, frame_buffer, mi_row, mi_col);
......
......@@ -273,11 +273,9 @@ typedef struct {
} FILTER_INTRA_MODE_INFO;
#endif // CONFIG_FILTER_INTRA
#if CONFIG_VAR_TX
#if CONFIG_RD_DEBUG
#define TXB_COEFF_COST_MAP_SIZE (2 * MAX_MIB_SIZE)
#endif
#endif
typedef struct RD_STATS {
int rate;
......@@ -295,10 +293,8 @@ typedef struct RD_STATS {
uint8_t invalid_rate;
#if CONFIG_RD_DEBUG
int txb_coeff_cost[MAX_MB_PLANE];
#if CONFIG_VAR_TX
int txb_coeff_cost_map[MAX_MB_PLANE][TXB_COEFF_COST_MAP_SIZE]
[TXB_COEFF_COST_MAP_SIZE];
#endif // CONFIG_VAR_TX
#endif // CONFIG_RD_DEBUG
} RD_STATS;
......@@ -322,12 +318,10 @@ typedef struct MB_MODE_INFO {
BLOCK_SIZE sb_type;
PREDICTION_MODE mode;
TX_SIZE tx_size;
#if CONFIG_VAR_TX
// TODO(jingning): This effectively assigned a separate entry for each
// 8x8 block. Apparently it takes much more space than needed.
TX_SIZE inter_tx_size[MAX_MIB_SIZE][MAX_MIB_SIZE];
TX_SIZE min_tx_size;
#endif
int8_t skip;
int8_t segment_id;
int8_t seg_id_predicted; // valid only when temporal_update is enabled
......@@ -709,11 +703,9 @@ typedef struct macroblockd {
PARTITION_CONTEXT *above_seg_context;
PARTITION_CONTEXT left_seg_context[MAX_MIB_SIZE];
#if CONFIG_VAR_TX
TXFM_CONTEXT *above_txfm_context;
TXFM_CONTEXT *left_txfm_context;
TXFM_CONTEXT left_txfm_context_buffer[2 * MAX_MIB_SIZE];
#endif
#if CONFIG_LOOP_RESTORATION
WienerInfo wiener_info[MAX_MB_PLANE];
......@@ -832,7 +824,7 @@ static INLINE int is_rect_tx(TX_SIZE tx_size) { return tx_size >= TX_SIZES; }
#endif // CONFIG_RECT_TX
static INLINE int block_signals_txsize(BLOCK_SIZE bsize) {
#if (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX
#if CONFIG_RECT_TX
return bsize > BLOCK_4X4;
#else
return bsize >= BLOCK_8X8;
......@@ -1081,7 +1073,7 @@ static INLINE int is_rect_tx_allowed(const MACROBLOCKD *xd,
#endif // CONFIG_RECT_TX
#endif // CONFIG_EXT_TX
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
static INLINE int is_quarter_tx_allowed_bsize(BLOCK_SIZE bsize) {
static const char LUT_QTTX[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
......@@ -1133,13 +1125,13 @@ static INLINE int is_quarter_tx_allowed(const MACROBLOCKD *xd,
static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode,
int is_inter) {
const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
#if (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX
#if CONFIG_RECT_TX
const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bsize];
#else
const TX_SIZE max_tx_size = max_txsize_lookup[bsize];
#endif // (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX
#endif // CONFIG_RECT_TX
(void)is_inter;
#if CONFIG_VAR_TX && CONFIG_RECT_TX
#if CONFIG_RECT_TX
if (bsize == BLOCK_4X4)
return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size)
......@@ -1154,7 +1146,7 @@ static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode,
}
#else
return AOMMIN(max_tx_size, largest_tx_size);
#endif // CONFIG_VAR_TX && CONFIG_RECT_TX
#endif // CONFIG_RECT_TX
}
#if CONFIG_EXT_INTRA
......@@ -1407,7 +1399,6 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) {
return (mbmi->ref_frame[1] == INTRA_FRAME) && is_interintra_allowed(mbmi);
}
#if CONFIG_VAR_TX
static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi,
BLOCK_SIZE bsize, int subsampled) {
(void)mbmi;
......@@ -1428,7 +1419,6 @@ static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi,
return max_txsize;
}
#endif // CONFIG_VAR_TX
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
......
......@@ -605,7 +605,7 @@ static const TX_SIZE max_txsize_lookup[BLOCK_SIZES_ALL] = {
#endif // CONFIG_EXT_PARTITION
};
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES_ALL] = {
// 2X2, 2X4, 4X2,
#if CONFIG_CHROMA_SUB8X8
......@@ -689,7 +689,7 @@ static const TX_SIZE quarter_txsize_lookup[BLOCK_SIZES_ALL] = {
#endif
#else
#define max_txsize_rect_lookup max_txsize_lookup
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
static const TX_TYPE_1D vtx_tab[TX_TYPES] = {
DCT_1D, ADST_1D, DCT_1D, ADST_1D,
......@@ -707,7 +707,7 @@ static const TX_TYPE_1D htx_tab[TX_TYPES] = {
#endif // CONFIG_EXT_TX
};
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
// Same as "max_txsize_lookup[bsize] - TX_8X8", except for rectangular
// block which may use a rectangular transform, in which case it is
// "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8
......@@ -797,7 +797,7 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
#define inter_tx_size_cat_lookup intra_tx_size_cat_lookup
......
......@@ -2319,9 +2319,7 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(skip_cdfs)
#if CONFIG_VAR_TX
AVERAGE_TILE_CDFS(txfm_partition_cdf)
#endif
#endif // CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(palette_y_size_cdf)
AVERAGE_TILE_CDFS(palette_uv_size_cdf)
......@@ -2333,7 +2331,7 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(palette_y_mode_cdf)
AVERAGE_TILE_CDFS(palette_uv_mode_cdf)
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
AVERAGE_TILE_CDFS(quarter_tx_size_cdf)
#endif
#endif
......
......@@ -324,7 +324,7 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
left_ec = !!*(const uint64_t *)l;
break;
#endif // CONFIG_TX64X64
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
case TX_4X16:
above_ec = a[0] != 0;
left_ec = !!*(const uint32_t *)l;
......
......@@ -2283,7 +2283,7 @@ static const int palette_color_index_context_lookup[MAX_COLOR_CONTEXT_HASH +
1] = { -1, -1, 0, -1, -1,
4, 3, 2, 1 };
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
static const aom_prob default_quarter_tx_size_prob = 192;
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_quarter_tx_size_cdf[CDF_SIZE(2)] = {
......@@ -2393,7 +2393,6 @@ int av1_get_palette_color_index_context(const uint8_t *color_map, int stride,
#undef NUM_PALETTE_NEIGHBORS
#undef MAX_COLOR_CONTEXT_HASH
#if CONFIG_VAR_TX
static const aom_prob default_txfm_partition_probs[TXFM_PARTITION_CONTEXTS] = {
#if CONFIG_TX64X64
249, 240, 223, 249, 229, 177, 250, 243, 208, 226, 187,
......@@ -2448,7 +2447,6 @@ static const aom_cdf_prob
#endif // CONFIG_TX64X64
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_VAR_TX
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob default_skip_cdfs[SKIP_CONTEXTS][CDF_SIZE(2)] = {
......@@ -6265,17 +6263,15 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->comp_inter_mode_prob, default_comp_inter_mode_p);
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
fc->quarter_tx_size_prob = default_quarter_tx_size_prob;
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->quarter_tx_size_cdf, default_quarter_tx_size_cdf);
#endif // CONFIG_NEW_MULTISYMBOL
#endif
#if CONFIG_VAR_TX
av1_copy(fc->txfm_partition_prob, default_txfm_partition_probs);
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->txfm_partition_cdf, default_txfm_partition_cdf);
#endif
#endif
av1_copy(fc->newmv_prob, default_newmv_prob);
av1_copy(fc->zeromv_prob, default_zeromv_prob);
......@@ -6517,19 +6513,17 @@ void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
const FRAME_COUNTS *counts = &cm->counts;
if (cm->tx_mode == TX_MODE_SELECT) {
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
fc->quarter_tx_size_prob = av1_mode_mv_merge_probs(
pre_fc->quarter_tx_size_prob, counts->quarter_tx_size);
#endif
}
#if CONFIG_VAR_TX
if (cm->tx_mode == TX_MODE_SELECT) {
for (i = 0; i < TXFM_PARTITION_CONTEXTS; ++i)
fc->txfm_partition_prob[i] = av1_mode_mv_merge_probs(
pre_fc->txfm_partition_prob[i], counts->txfm_partition[i]);
}
#endif
#if !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < SKIP_CONTEXTS; ++i)
......
......@@ -285,18 +285,16 @@ typedef struct frame_contexts {
#if CONFIG_COMPOUND_SINGLEREF
aom_prob comp_inter_mode_prob[COMP_INTER_MODE_CONTEXTS];
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
aom_prob quarter_tx_size_prob;
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob quarter_tx_size_cdf[CDF_SIZE(2)];
#endif
#endif
#if CONFIG_VAR_TX
aom_prob txfm_partition_prob[TXFM_PARTITION_CONTEXTS];
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob txfm_partition_cdf[TXFM_PARTITION_CONTEXTS][CDF_SIZE(2)];
#endif
#endif // CONFIG_VAR_TX
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob skip_cdfs[SKIP_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob intra_inter_cdf[INTRA_INTER_CONTEXTS][CDF_SIZE(2)];
......@@ -477,12 +475,10 @@ typedef struct FRAME_COUNTS {
// TODO(urvang): Only needed for !CONFIG_VAR_TX case. So can be removed when
// CONFIG_VAR_TX flag is removed.
unsigned int tx_size[MAX_TX_DEPTH][TX_SIZE_CONTEXTS][MAX_TX_DEPTH + 1];
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
unsigned int quarter_tx_size[2];
#endif
#if CONFIG_VAR_TX
unsigned int txfm_partition[TXFM_PARTITION_CONTEXTS][2];
#endif
unsigned int skip[SKIP_CONTEXTS][2];
nmv_context_counts mv[NMV_CONTEXTS];
#if CONFIG_INTRABC
......
......@@ -72,11 +72,9 @@ extern "C" {
#endif
#endif // CONFIG_EXT_TILE
#if CONFIG_VAR_TX
#define MAX_VARTX_DEPTH 2
#define SQR_VARTX_DEPTH_INIT 0
#define RECT_VARTX_DEPTH_INIT 0
#endif
#define MI_SIZE_64X64 (64 >> MI_SIZE_LOG2)
......@@ -673,10 +671,8 @@ typedef enum ATTRIBUTE_PACKED {
#define COMP_INTER_MODE_CONTEXTS 4
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_VAR_TX
#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 2)
typedef uint8_t TXFM_CONTEXT;
#endif
#define NONE_FRAME -1
#define INTRA_FRAME 0
......
......@@ -2629,7 +2629,7 @@ static void inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride,
}
// These will be used by the masked-tx experiment in the future.
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
static void inv_txfm_add_4x16(const tran_low_t *input, uint8_t *dest,
int stride, const TxfmParam *txfm_param) {
#if CONFIG_LGT
......@@ -3189,7 +3189,7 @@ void av1_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
// case.
inv_txfm_add_4x4(input, dest, stride, txfm_param);
break;
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX_EXT
case TX_32X8: inv_txfm_add_32x8(input, dest, stride, txfm_param); break;
case TX_8X32: inv_txfm_add_8x32(input, dest, stride, txfm_param); break;
case TX_16X4: inv_txfm_add_16x4(input, dest, stride, txfm_param); break;
......
......@@ -462,11 +462,9 @@ typedef struct AV1Common {
PARTITION_CONTEXT *above_seg_context;
ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
#if CONFIG_VAR_TX
TXFM_CONTEXT *above_txfm_context;
TXFM_CONTEXT *top_txfm_context[MAX_MB_PLANE];
TXFM_CONTEXT left_txfm_context[MAX_MB_PLANE][2 * MAX_MIB_SIZE];
#endif
int above_context_alloc_cols;
// scratch memory for intraonly/keyframe forward updates from default tables
......@@ -716,9 +714,7 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
}
xd->fc = cm->fc;
xd->above_seg_context = cm->above_seg_context;
#if CONFIG_VAR_TX
xd->above_txfm_context = cm->above_txfm_context;
#endif
#if CONFIG_CFL
cfl_init(cfl, cm);
xd->cfl = cfl;
......@@ -1142,18 +1138,14 @@ static INLINE void av1_zero_above_context(AV1_COMMON *const cm,
av1_zero_array(cm->above_seg_context + mi_col_start, aligned_width);
#if CONFIG_VAR_TX
av1_zero_array(cm->above_txfm_context + (mi_col_start << TX_UNIT_WIDE_LOG2),
aligned_width << TX_UNIT_WIDE_LOG2);
#endif // CONFIG_VAR_TX
}
static INLINE void av1_zero_left_context(MACROBLOCKD *const xd) {
av1_zero(xd->left_context);
av1_zero(xd->left_seg_context);
#if CONFIG_VAR_TX
av1_zero(xd->left_txfm_context_buffer);
#endif
}
// Disable array-bounds checks as the TX_SIZE enum contains values larger than
......@@ -1171,7 +1163,6 @@ static INLINE TX_SIZE get_min_tx_size(TX_SIZE tx_size) {
#pragma GCC diagnostic warning "-Warray-bounds"
#endif
#if CONFIG_VAR_TX
static INLINE void set_txfm_ctx(TXFM_CONTEXT *txfm_ctx, uint8_t txs, int len) {
int i;
for (i = 0; i < len; ++i) txfm_ctx[i] = txs;
......@@ -1245,7 +1236,6 @@ static INLINE int txfm_partition_context(TXFM_CONTEXT *above_ctx,
if (category == TXFM_PARTITION_CONTEXTS - 1) return category;
return category * 3 + above + left;
}
#endif
// Compute the next partition in the direction of the sb_type stored in the mi
// array, starting with bsize.
......
......@@ -45,8 +45,7 @@ enum {
#endif // CONFIG_INTRA_EDGE
#define INTRA_USES_EXT_TRANSFORMS 1
#define INTRA_USES_RECT_TRANSFORMS \
(CONFIG_RECT_TX && (CONFIG_VAR_TX || CONFIG_EXT_TX))
#define INTRA_USES_RECT_TRANSFORMS (CONFIG_RECT_TX)
static const uint8_t extend_modes[INTRA_MODES] = {
NEED_ABOVE | NEED_LEFT, // DC
......
......@@ -7869,14 +7869,14 @@ static uint32_t *get_non_zero_prob(FRAME_CONTEXT *fc, TX_SIZE tx_size,
case TX_8X8: return fc->non_zero_prob_8X8[tx_type];
case TX_16X16: return fc->non_zero_prob_16X16[tx_type];
case TX_32X32: return fc->non_zero_prob_32X32[tx_type];
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
case TX_4X8: return fc->non_zero_prob_4X8[tx_type];
case TX_8X4: return fc->non_zero_prob_8X4[tx_type];
case TX_8X16: return fc->non_zero_prob_8X16[tx_type];
case TX_16X8: return fc->non_zero_prob_16X8[tx_type];
case TX_16X32: return fc->non_zero_prob_16X32[tx_type];
case TX_32X16: return fc->non_zero_prob_32X16[tx_type];
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
default: assert(0); return NULL;
}
}
......@@ -7888,14 +7888,14 @@ static int16_t *get_adapt_scan(FRAME_CONTEXT *fc, TX_SIZE tx_size,
case TX_8X8: return fc->scan_8X8[tx_type];
case TX_16X16: return fc->scan_16X16[tx_type];
case TX_32X32: return fc->scan_32X32[tx_type];
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
case TX_4X8: return fc->scan_4X8[tx_type];
case TX_8X4: return fc->scan_8X4[tx_type];
case TX_8X16: return fc->scan_8X16[tx_type];
case TX_16X8: return fc->scan_16X8[tx_type];
case TX_16X32: return fc->scan_16X32[tx_type];
case TX_32X16: return fc->scan_32X16[tx_type];
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
default: assert(0); return NULL;
}
}
......@@ -7907,14 +7907,14 @@ static int16_t *get_adapt_iscan(FRAME_CONTEXT *fc, TX_SIZE tx_size,
case TX_8X8: return fc->iscan_8X8[tx_type];
case TX_16X16: return fc->iscan_16X16[tx_type];
case TX_32X32: return fc->iscan_32X32[tx_type];
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
case TX_4X8: return fc->iscan_4X8[tx_type];
case TX_8X4: return fc->iscan_8X4[tx_type];
case TX_8X16: return fc->iscan_8X16[tx_type];
case TX_16X8: return fc->iscan_16X8[tx_type];
case TX_16X32: return fc->iscan_16X32[tx_type];
case TX_32X16: return fc->iscan_32X16[tx_type];
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
default: assert(0); return NULL;
}
}
......@@ -7926,14 +7926,14 @@ static int16_t *get_adapt_nb(FRAME_CONTEXT *fc, TX_SIZE tx_size,
case TX_8X8: return fc->nb_8X8[tx_type];
case TX_16X16: return fc->nb_16X16[tx_type];
case TX_32X32: return fc->nb_32X32[tx_type];
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
case TX_4X8: return fc->nb_4X8[tx_type];
case TX_8X4: return fc->nb_8X4[tx_type];
case TX_8X16: return fc->nb_8X16[tx_type];
case TX_16X8: return fc->nb_16X8[tx_type];
case TX_16X32: return fc->nb_16X32[tx_type];
case TX_32X16: return fc->nb_32X16[tx_type];
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
default: assert(0); return NULL;
}
}
......@@ -7945,14 +7945,14 @@ static uint32_t *get_non_zero_counts(FRAME_COUNTS *counts, TX_SIZE tx_size,
case TX_8X8: return counts->non_zero_count_8X8[tx_type];
case TX_16X16: return counts->non_zero_count_16X16[tx_type];
case TX_32X32: return counts->non_zero_count_32X32[tx_type];
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
case TX_4X8: return counts->non_zero_count_4x8[tx_type];
case TX_8X4: return counts->non_zero_count_8x4[tx_type];
case TX_8X16: return counts->non_zero_count_8x16[tx_type];
case TX_16X8: return counts->non_zero_count_16x8[tx_type];
case TX_16X32: return counts->non_zero_count_16x32[tx_type];
case TX_32X16: return counts->non_zero_count_32x16[tx_type];
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
default: assert(0); return NULL;
}
}
......@@ -8449,11 +8449,11 @@ void av1_init_scan_order(AV1_COMMON *cm) {
TX_SIZE tx_size;
TX_TYPE tx_type;
for (tx_size = 0; tx_size < TX_SIZES_ALL; ++tx_size) {
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
if (tx_size > TX_32X16) continue;
#else
if (tx_size >= TX_SIZES) continue;
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) {
if (do_adapt_scan(tx_size, tx_type)) {
uint32_t *non_zero_prob = get_non_zero_prob(cm->fc, tx_size, tx_type);
......@@ -8484,11 +8484,11 @@ void av1_adapt_scan_order(AV1_COMMON *cm) {
#endif // CACHE_SCAN_PROB
for (tx_size = 0; tx_size < TX_SIZES_ALL; ++tx_size) {
#if CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#if CONFIG_RECT_TX
if (tx_size > TX_32X16) continue;
#else
if (tx_size >= TX_SIZES) continue;
#endif // CONFIG_RECT_TX && (CONFIG_EXT_TX || CONFIG_VAR_TX)
#endif // CONFIG_RECT_TX
TX_TYPE tx_type;
for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) {
if (do_adapt_scan(tx_size, tx_type)) {
......
......@@ -82,13 +82,8 @@ static INLINE int get_coef_context(const int16_t *neighbors,
static INLINE const SCAN_ORDER *get_default_scan(TX_SIZE tx_size,
TX_TYPE tx_type,
int is_inter) {
#if CONFIG_EXT_TX || CONFIG_VAR_TX
return is_inter ? &av1_inter_scan_orders[tx_size][tx_type]
: &av1_intra_scan_orders[tx_size][tx_type];
#else
(void)is_inter;
return &av1_intra_scan_orders[tx_size][tx_type];
#endif // CONFIG_EXT_TX
}
static INLINE int do_adapt_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
......