Commit 607fa6a6 authored by Jingning Han's avatar Jingning Han
Browse files

Support potential 2x2 transform block unit

Make the codec support 2x2 tranform block unit for chroma components.

Change-Id: Ic454535bd5620abe88a2e99789160cc4664ee518
parent b5a30821
...@@ -68,18 +68,27 @@ static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES] = { ...@@ -68,18 +68,27 @@ static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES] = {
}; };
static const uint8_t num_4x4_blocks_txsize_lookup[TX_SIZES_ALL] = { static const uint8_t num_4x4_blocks_txsize_lookup[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
1,
#endif
1, 4, 16, 64, 1, 4, 16, 64,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
2, 2, 8, 8, 32, 32 2, 2, 8, 8, 32, 32
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}; };
static const uint8_t num_4x4_blocks_wide_txsize_lookup[TX_SIZES_ALL] = { static const uint8_t num_4x4_blocks_wide_txsize_lookup[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
1,
#endif
1, 2, 4, 8, 1, 2, 4, 8,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
1, 2, 2, 4, 4, 8 1, 2, 2, 4, 4, 8
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}; };
static const uint8_t num_4x4_blocks_high_txsize_lookup[TX_SIZES_ALL] = { static const uint8_t num_4x4_blocks_high_txsize_lookup[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
1,
#endif
1, 2, 4, 8, 1, 2, 4, 8,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
2, 1, 4, 2, 8, 4 2, 1, 4, 2, 8, 4
...@@ -87,18 +96,27 @@ static const uint8_t num_4x4_blocks_high_txsize_lookup[TX_SIZES_ALL] = { ...@@ -87,18 +96,27 @@ static const uint8_t num_4x4_blocks_high_txsize_lookup[TX_SIZES_ALL] = {
}; };
static const uint8_t num_4x4_blocks_txsize_log2_lookup[TX_SIZES_ALL] = { static const uint8_t num_4x4_blocks_txsize_log2_lookup[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
0,
#endif
0, 2, 4, 6, 0, 2, 4, 6,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
1, 1, 3, 3, 5, 5 1, 1, 3, 3, 5, 5
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}; };
static const uint8_t num_4x4_blocks_wide_txsize_log2_lookup[TX_SIZES_ALL] = { static const uint8_t num_4x4_blocks_wide_txsize_log2_lookup[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
0,
#endif
0, 1, 2, 3, 0, 1, 2, 3,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
0, 1, 1, 2, 2, 3 0, 1, 1, 2, 2, 3
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}; };
static const uint8_t num_4x4_blocks_high_txsize_log2_lookup[TX_SIZES_ALL] = { static const uint8_t num_4x4_blocks_high_txsize_log2_lookup[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
0,
#endif
0, 1, 2, 3, 0, 1, 2, 3,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
1, 0, 2, 1, 3, 2 1, 0, 2, 1, 3, 2
...@@ -419,6 +437,9 @@ static const int32_t inter_tx_size_cat_lookup[BLOCK_SIZES] = { ...@@ -419,6 +437,9 @@ static const int32_t inter_tx_size_cat_lookup[BLOCK_SIZES] = {
/* clang-format on */ /* clang-format on */
static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = { static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
TX_2X2, // TX_2X2
#endif
TX_4X4, // TX_4X4 TX_4X4, // TX_4X4
TX_8X8, // TX_8X8 TX_8X8, // TX_8X8
TX_16X16, // TX_16X16 TX_16X16, // TX_16X16
...@@ -434,6 +455,9 @@ static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = { ...@@ -434,6 +455,9 @@ static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = {
}; };
static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = { static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
TX_2X2, // TX_2X2
#endif
TX_4X4, // TX_4X4 TX_4X4, // TX_4X4
TX_8X8, // TX_8X8 TX_8X8, // TX_8X8
TX_16X16, // TX_16X16 TX_16X16, // TX_16X16
...@@ -450,6 +474,9 @@ static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = { ...@@ -450,6 +474,9 @@ static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = {
// Transform block width in pixels // Transform block width in pixels
static const int tx_size_wide[TX_SIZES_ALL] = { static const int tx_size_wide[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
2,
#endif
4, 8, 16, 32, 4, 8, 16, 32,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
4, 8, 8, 16, 16, 32, 4, 8, 8, 16, 16, 32,
...@@ -458,6 +485,9 @@ static const int tx_size_wide[TX_SIZES_ALL] = { ...@@ -458,6 +485,9 @@ static const int tx_size_wide[TX_SIZES_ALL] = {
// Transform block height in pixels // Transform block height in pixels
static const int tx_size_high[TX_SIZES_ALL] = { static const int tx_size_high[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
2,
#endif
4, 8, 16, 32, 4, 8, 16, 32,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
8, 4, 16, 8, 32, 16, 8, 4, 16, 8, 32, 16,
...@@ -466,6 +496,9 @@ static const int tx_size_high[TX_SIZES_ALL] = { ...@@ -466,6 +496,9 @@ static const int tx_size_high[TX_SIZES_ALL] = {
// Transform block width in unit // Transform block width in unit
static const int tx_size_wide_unit[TX_SIZES_ALL] = { static const int tx_size_wide_unit[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
1,
#endif
1, 2, 4, 8, 1, 2, 4, 8,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
1, 2, 2, 4, 4, 8, 1, 2, 2, 4, 4, 8,
...@@ -474,6 +507,9 @@ static const int tx_size_wide_unit[TX_SIZES_ALL] = { ...@@ -474,6 +507,9 @@ static const int tx_size_wide_unit[TX_SIZES_ALL] = {
// Transform block height in unit // Transform block height in unit
static const int tx_size_high_unit[TX_SIZES_ALL] = { static const int tx_size_high_unit[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
1,
#endif
1, 2, 4, 8, 1, 2, 4, 8,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
2, 1, 4, 2, 8, 4, 2, 1, 4, 2, 8, 4,
...@@ -482,6 +518,9 @@ static const int tx_size_high_unit[TX_SIZES_ALL] = { ...@@ -482,6 +518,9 @@ static const int tx_size_high_unit[TX_SIZES_ALL] = {
// Transform block width in log2 // Transform block width in log2
static const int tx_size_wide_log2[TX_SIZES_ALL] = { static const int tx_size_wide_log2[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
2,
#endif
2, 3, 4, 5, 2, 3, 4, 5,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
2, 3, 3, 4, 4, 5, 2, 3, 3, 4, 4, 5,
...@@ -490,6 +529,9 @@ static const int tx_size_wide_log2[TX_SIZES_ALL] = { ...@@ -490,6 +529,9 @@ static const int tx_size_wide_log2[TX_SIZES_ALL] = {
// Transform block height in log2 // Transform block height in log2
static const int tx_size_high_log2[TX_SIZES_ALL] = { static const int tx_size_high_log2[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
2,
#endif
2, 3, 4, 5, 2, 3, 4, 5,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
3, 2, 4, 3, 5, 4, 3, 2, 4, 3, 5, 4,
...@@ -497,6 +539,9 @@ static const int tx_size_high_log2[TX_SIZES_ALL] = { ...@@ -497,6 +539,9 @@ static const int tx_size_high_log2[TX_SIZES_ALL] = {
}; };
static const int tx_size_2d[TX_SIZES_ALL] = { static const int tx_size_2d[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
4,
#endif
16, 64, 256, 1024, 16, 64, 256, 1024,
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
32, 32, 128, 128, 512, 512, 32, 32, 128, 128, 512, 512,
...@@ -509,6 +554,9 @@ static const uint8_t tx_size_1d_log2[TX_SIZES] = { 2, 3, 4, 5 }; ...@@ -509,6 +554,9 @@ static const uint8_t tx_size_1d_log2[TX_SIZES] = { 2, 3, 4, 5 };
static const int tx_size_1d_in_unit_log2[TX_SIZES] = { 0, 1, 2, 3 }; static const int tx_size_1d_in_unit_log2[TX_SIZES] = { 0, 1, 2, 3 };
static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = { static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
BLOCK_4X4, // TX_2X2
#endif
BLOCK_4X4, // TX_4X4 BLOCK_4X4, // TX_4X4
BLOCK_8X8, // TX_8X8 BLOCK_8X8, // TX_8X8
BLOCK_16X16, // TX_16X16 BLOCK_16X16, // TX_16X16
...@@ -524,6 +572,9 @@ static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = { ...@@ -524,6 +572,9 @@ static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = {
}; };
static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = { static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
TX_2X2, // TX_2X2
#endif
TX_4X4, // TX_4X4 TX_4X4, // TX_4X4
TX_8X8, // TX_8X8 TX_8X8, // TX_8X8
TX_16X16, // TX_16X16 TX_16X16, // TX_16X16
...@@ -539,6 +590,9 @@ static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = { ...@@ -539,6 +590,9 @@ static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = {
}; };
static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = { static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = {
#if CONFIG_CB4X4
TX_2X2, // TX_2X2
#endif
TX_4X4, // TX_4X4 TX_4X4, // TX_4X4
TX_8X8, // TX_8X8 TX_8X8, // TX_8X8
TX_16X16, // TX_16X16 TX_16X16, // TX_16X16
...@@ -589,7 +643,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -589,7 +643,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1 // ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1 // ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
{ {
// BLOCK_4X4 // BLOCK_4X4
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
...@@ -604,7 +661,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -604,7 +661,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_4X8 // BLOCK_4X8
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
...@@ -623,7 +683,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -623,7 +683,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_8X4 // BLOCK_8X4
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
...@@ -642,7 +705,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -642,7 +705,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_8X8 // BLOCK_8X8
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_8X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } }, { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
...@@ -657,7 +723,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -657,7 +723,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_8X16 // BLOCK_8X16
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } }, { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } }, { { TX_8X8, TX_8X8 }, { TX_4X4, TX_4X4 } },
...@@ -676,7 +745,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -676,7 +745,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_16X8 // BLOCK_16X8
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_4X4 }, { TX_8X8, TX_4X4 } }, { { TX_8X8, TX_4X4 }, { TX_8X8, TX_4X4 } },
{ { TX_8X8, TX_4X4 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_4X4 }, { TX_8X8, TX_8X8 } },
...@@ -695,7 +767,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -695,7 +767,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_16X16 // BLOCK_16X16
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_16X16, TX_8X8 }, { TX_8X8, TX_8X8 } },
...@@ -710,7 +785,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -710,7 +785,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_16X32 // BLOCK_16X32
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_8X8, TX_8X8 } }, { { TX_16X16, TX_16X16 }, { TX_8X8, TX_8X8 } },
...@@ -729,7 +807,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -729,7 +807,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_32X16 // BLOCK_32X16
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_8X8 }, { TX_16X16, TX_8X8 } }, { { TX_16X16, TX_8X8 }, { TX_16X16, TX_8X8 } },
...@@ -748,7 +829,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -748,7 +829,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_32X32 // BLOCK_32X32
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -763,7 +847,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -763,7 +847,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_32X64 // BLOCK_32X64
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -778,7 +865,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -778,7 +865,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_64X32 // BLOCK_64X32
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -793,7 +883,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -793,7 +883,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_64X64 // BLOCK_64X64
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -801,7 +894,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -801,7 +894,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#if CONFIG_EXT_PARTITION #if CONFIG_EXT_PARTITION
}, },
{ {
// BLOCK_64X128 // BLOCK_64X128
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -816,7 +912,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -816,7 +912,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_128X64 // BLOCK_128X64
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -831,7 +930,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { ...@@ -831,7 +930,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = {
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
}, },
{ {
// BLOCK_128X128 // BLOCK_128X128
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_8X8, TX_8X8 }, { TX_8X8, TX_8X8 } },
{ { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } }, { { TX_16X16, TX_16X16 }, { TX_16X16, TX_16X16 } },
...@@ -891,8 +993,11 @@ static const struct { ...@@ -891,8 +993,11 @@ static const struct {
#if CONFIG_SUPERTX #if CONFIG_SUPERTX
static const TX_SIZE uvsupertx_size_lookup[TX_SIZES][2][2] = { static const TX_SIZE uvsupertx_size_lookup[TX_SIZES][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1 // ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1 // ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
#if CONFIG_CB4X4
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
#endif
{ { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X4, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_8X8, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_8X8, TX_4X4 }, { TX_4X4, TX_4X4 } },
{ { TX_16X16, TX_8X8 }, { TX_8X8, TX_8X8 } }, { { TX_16X16, TX_8X8 }, { TX_8X8, TX_8X8 } },
......
...@@ -58,6 +58,9 @@ const aom_prob av1_cat6_prob_high12[] = { 255, 255, 255, 255, 254, 254, ...@@ -58,6 +58,9 @@ const aom_prob av1_cat6_prob_high12[] = { 255, 255, 255, 255, 254, 254,
#endif #endif
const uint16_t band_count_table[TX_SIZES_ALL][8] = { const uint16_t band_count_table[TX_SIZES_ALL][8] = {
#if CONFIG_CB4X4
{ 1, 2, 2, 3, 0, 0, 0 },
#endif
{ 1, 2, 3, 4, 3, 16 - 13, 0 }, { 1, 2, 3, 4, 11, 64 - 21, 0 }, { 1, 2, 3, 4, 3, 16 - 13, 0 }, { 1, 2, 3, 4, 11, 64 - 21, 0 },
{ 1, 2, 3, 4, 11, 256 - 21, 0 }, { 1, 2, 3, 4, 11, 1024 - 21, 0 }, { 1, 2, 3, 4, 11, 256 - 21, 0 }, { 1, 2, 3, 4, 11, 1024 - 21, 0 },
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
...@@ -68,6 +71,9 @@ const uint16_t band_count_table[TX_SIZES_ALL][8] = { ...@@ -68,6 +71,9 @@ const uint16_t band_count_table[TX_SIZES_ALL][8] = {
}; };
const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = { const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = {
#if CONFIG_CB4X4
{ 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 }, { 0, 1, 3, 6, 10, 13, 16, 0 }, { 0, 1, 3, 6, 10, 21, 64, 0 },
{ 0, 1, 3, 6, 10, 21, 256, 0 }, { 0, 1, 3, 6, 10, 21, 1024, 0 }, { 0, 1, 3, 6, 10, 21, 256, 0 }, { 0, 1, 3, 6, 10, 21, 1024, 0 },
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
...@@ -2833,6 +2839,9 @@ void av1_default_coef_probs(AV1_COMMON *cm) { ...@@ -2833,6 +2839,9 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
ROUND_POWER_OF_TWO(cm->base_qindex, 8 - QCTX_BIN_BITS), QCTX_BINS - 1); 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]); av1_copy(cm->fc->coef_probs, default_qctx_coef_probs[index]);
#else #else
#if CONFIG_CB4X4
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); av1_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4);
av1_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8); av1_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8);
av1_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16); av1_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16);
......
...@@ -851,18 +851,18 @@ static const int palette_color_context_lookup[PALETTE_COLOR_CONTEXTS] = { ...@@ -851,18 +851,18 @@ static const int palette_color_context_lookup[PALETTE_COLOR_CONTEXTS] = {
}; };
#endif // CONFIG_PALETTE #endif // CONFIG_PALETTE
const aom_tree_index av1_tx_size_tree[TX_SIZES - 1][TREE_SIZE(TX_SIZES)] = { const aom_tree_index av1_tx_size_tree[MAX_TX_DEPTH][TREE_SIZE(TX_SIZES)] = {
{ {
// Max tx_size is 8X8 // Max tx_size is 8X8
-TX_4X4, -TX_8X8, -0, -1,
}, },
{ {
// Max tx_size is 16X16 // Max tx_size is 16X16
-TX_4X4, 2, -TX_8X8, -TX_16X16, -0, 2, -1, -2,
}, },
{ {
// Max tx_size is 32X32 // Max tx_size is 32X32
-TX_4X4, 2, -TX_8X8, 4, -TX_16X16, -TX_32X32, -0, 2, -1, 4, -2, -3,
}, },
}; };
...@@ -1309,13 +1309,21 @@ int av1_ext_tx_inv[TX_TYPES]; ...@@ -1309,13 +1309,21 @@ int av1_ext_tx_inv[TX_TYPES];