Commit d26fde2b authored by Jingning Han's avatar Jingning Han

Merge identical entries in max_txsize_rect_lookup table

Change-Id: Ia0f1f2e928f2cef740aabd2b39eaa410fcb1f084
parent 5d2b9da4
......@@ -788,7 +788,8 @@ static INLINE int get_ext_tx_types(TX_SIZE tx_size, BLOCK_SIZE bs, int is_inter,
#define TXSIZEMIN(t1, t2) (tx_size_2d[(t1)] <= tx_size_2d[(t2)] ? (t1) : (t2))
static INLINE TX_SIZE get_max_rect_tx_size(BLOCK_SIZE bsize, int is_inter) {
return max_txsize_rect_lookup[is_inter][bsize];
(void)is_inter;
return max_txsize_rect_lookup[bsize];
}
static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode,
......@@ -872,7 +873,7 @@ get_plane_block_size(BLOCK_SIZE bsize, const struct macroblockd_plane *pd) {
static INLINE int av1_get_txb_size_index(BLOCK_SIZE bsize, int blk_row,
int blk_col) {
TX_SIZE txs = max_txsize_rect_lookup[1][bsize];
TX_SIZE txs = max_txsize_rect_lookup[bsize];
for (int level = 0; level < MAX_VARTX_DEPTH - 1; ++level)
txs = sub_tx_size_map[1][txs];
const int tx_w = tx_size_wide_unit[txs];
......@@ -982,7 +983,8 @@ static INLINE TX_SIZE av1_get_max_uv_txsize(BLOCK_SIZE bsize, int is_inter,
int ss_x, int ss_y) {
const BLOCK_SIZE plane_bsize = ss_size_lookup[bsize][ss_x][ss_y];
assert(plane_bsize < BLOCK_SIZES_ALL);
TX_SIZE uv_tx = max_txsize_rect_lookup[is_inter][plane_bsize];
(void)is_inter;
TX_SIZE uv_tx = max_txsize_rect_lookup[plane_bsize];
switch (uv_tx) {
case TX_64X64:
case TX_64X32:
......
......@@ -460,9 +460,7 @@ static const TX_SIZE max_txsize_lookup[BLOCK_SIZES_ALL] = {
#endif // CONFIG_EXT_PARTITION
};
static const TX_SIZE max_txsize_rect_lookup[2][BLOCK_SIZES_ALL] = {
{
// Intra
static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES_ALL] = {
// 4X4
TX_4X4,
// 4X8, 8X4, 8X8
......@@ -498,44 +496,6 @@ static const TX_SIZE max_txsize_rect_lookup[2][BLOCK_SIZES_ALL] = {
// 32x128 128x32
TX_32X64, TX_64X32
#endif // CONFIG_EXT_PARTITION
}, {
// Inter
// 4X4
TX_4X4,
// 4X8, 8X4, 8X8
TX_4X8, TX_8X4, TX_8X8,
// 8X16, 16X8, 16X16
TX_8X16, TX_16X8, TX_16X16,
// 16X32, 32X16, 32X32
TX_16X32, TX_32X16, TX_32X32,
// 32X64, 64X32,
TX_32X64, TX_64X32,
// 64X64
TX_64X64,
#if CONFIG_EXT_PARTITION
// 64x128, 128x64, 128x128
TX_64X64, TX_64X64, TX_64X64,
#endif // CONFIG_EXT_PARTITION
#if CONFIG_EXT_PARTITION_TYPES && CONFIG_RECT_TX_EXT
// 4x16, 16x4, 8x32
TX_4X16, TX_16X4, TX_8X32,
// 32x8
TX_32X8,
// 16x64, 64x16
TX_16X64, TX_64X16,
#else
// 4x16, 16x4, 8x32
TX_4X8, TX_8X4, TX_8X16,
// 32x8
TX_16X8,
// 16x64, 64x16
TX_16X32, TX_32X16,
#endif // CONFIG_EXT_PARTITION_TYPES && CONFIG_RECT_TX_EXT
#if CONFIG_EXT_PARTITION
// 32x128 128x32
TX_32X64, TX_64X32
#endif // CONFIG_EXT_PARTITION
},
};
static const TX_TYPE_1D vtx_tab[TX_TYPES] = {
......
......@@ -340,7 +340,8 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p6(
// The prediction flags in these dummy entries are initialized to 0.
static INLINE int get_tx_size_context(const MACROBLOCKD *xd, int is_inter) {
const MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
const TX_SIZE max_tx_size = max_txsize_rect_lookup[is_inter][mbmi->sb_type];
(void)is_inter;
const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->sb_type];
const int max_tx_wide = tx_size_wide[max_tx_size];
const int max_tx_high = tx_size_high[max_tx_size];
const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
......
......@@ -4661,7 +4661,7 @@ static int find_tx_size_rd_records(MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row,
uint8_t child_idx_buf[MAX_MIB_SIZE * MAX_MIB_SIZE] = { 0 };
const int hash_dc_level = 1 << x->e_mbd.bd;
TX_SIZE cur_tx_size = max_txsize_rect_lookup[1][bsize];
TX_SIZE cur_tx_size = max_txsize_rect_lookup[bsize];
while (cur_tx_depth <= MAX_VARTX_DEPTH) {
const int cur_tx_bw = tx_size_wide[cur_tx_size];
const int cur_tx_bh = tx_size_high[cur_tx_size];
......@@ -4907,7 +4907,7 @@ static void select_tx_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x,
TX_TYPE tx_type, best_tx_type = DCT_DCT;
const int is_inter = is_inter_block(mbmi);
TX_SIZE best_tx_size[INTER_TX_SIZE_BUF_LEN] = { 0 };
TX_SIZE best_tx = max_txsize_rect_lookup[1][bsize];
TX_SIZE best_tx = max_txsize_rect_lookup[bsize];
TX_SIZE best_min_tx_size = TX_SIZES_ALL;
uint8_t best_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE];
TX_TYPE txk_start = DCT_DCT;
......@@ -4918,8 +4918,7 @@ static void select_tx_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x,
#endif
const int n4 = bsize_to_num_blk(bsize);
// Get the tx_size 1 level down
const TX_SIZE min_tx_size =
sub_tx_size_map[1][max_txsize_rect_lookup[1][bsize]];
const TX_SIZE min_tx_size = sub_tx_size_map[1][max_txsize_rect_lookup[bsize]];
const TxSetType tx_set_type = get_ext_tx_set_type(
min_tx_size, bsize, is_inter, cm->reduced_tx_set_used);
int within_border = mi_row >= xd->tile.mi_row_start &&
......@@ -10603,7 +10602,7 @@ PALETTE_EXIT:
// Set up tx_size related variables for skip-specific loop filtering.
best_mbmode.tx_size = block_signals_txsize(bsize)
? tx_size_from_tx_mode(bsize, cm->tx_mode, 1)
: max_txsize_rect_lookup[1][bsize];
: max_txsize_rect_lookup[bsize];
memset(best_mbmode.inter_tx_size, best_mbmode.tx_size,
sizeof(best_mbmode.inter_tx_size));
best_mbmode.min_tx_size = best_mbmode.tx_size;
......
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