diff --git a/av1/common/common_data.h b/av1/common/common_data.h index 6bbac1f4b..e1e1dd1da 100644 --- a/av1/common/common_data.h +++ b/av1/common/common_data.h @@ -577,7 +577,11 @@ static const TX_SIZE sub_tx_size_map[TX_SIZES_ALL] = { TX_8X8, // TX_8X16 TX_8X8, // TX_16X8 TX_16X16, // TX_16X32 - TX_16X16 // TX_32X16 + TX_16X16, // TX_32X16 + TX_4X4, // TX_4X16 + TX_4X4, // TX_16X4 + TX_8X8, // TX_8X32 + TX_8X8, // TX_32X8 }; static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = { @@ -596,7 +600,11 @@ static const TX_SIZE txsize_horz_map[TX_SIZES_ALL] = { TX_8X8, // TX_8X16 TX_16X16, // TX_16X8 TX_16X16, // TX_16X32 - TX_32X32 // TX_32X16 + TX_32X32, // TX_32X16 + TX_4X4, // TX_4X16 + TX_16X16, // TX_16X4 + TX_8X8, // TX_8X32 + TX_32X32, // TX_32X8 }; static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = { @@ -615,7 +623,11 @@ static const TX_SIZE txsize_vert_map[TX_SIZES_ALL] = { TX_16X16, // TX_8X16 TX_8X8, // TX_16X8 TX_32X32, // TX_16X32 - TX_16X16 // TX_32X16 + TX_16X16, // TX_32X16 + TX_16X16, // TX_4X16 + TX_4X4, // TX_16X4 + TX_32X32, // TX_8X32 + TX_8X8, // TX_32X8 }; // Transform block width in pixels @@ -627,7 +639,7 @@ static const int tx_size_wide[TX_SIZES_ALL] = { #if CONFIG_TX64X64 64, #endif // CONFIG_TX64X64 - 4, 8, 8, 16, 16, 32, + 4, 8, 8, 16, 16, 32, 4, 16, 8, 32 }; // Transform block height in pixels @@ -639,7 +651,7 @@ static const int tx_size_high[TX_SIZES_ALL] = { #if CONFIG_TX64X64 64, #endif // CONFIG_TX64X64 - 8, 4, 16, 8, 32, 16, + 8, 4, 16, 8, 32, 16, 16, 4, 32, 8 }; // Transform block width in unit @@ -649,13 +661,13 @@ static const int tx_size_wide_unit[TX_SIZES_ALL] = { #if CONFIG_TX64X64 32, #endif // CONFIG_TX64X64 - 2, 4, 4, 8, 8, 16, + 2, 4, 4, 8, 8, 16, 2, 8, 4, 16 #else // CONFIG_CB4X4 1, 2, 4, 8, #if CONFIG_TX64X64 16, #endif // CONFIG_TX64X64 - 1, 2, 2, 4, 4, 8, + 1, 2, 2, 4, 4, 8, 1, 4, 2, 8 #endif // CONFIG_CB4X4 }; @@ -666,13 +678,13 @@ static const int tx_size_high_unit[TX_SIZES_ALL] = { #if CONFIG_TX64X64 32, #endif // CONFIG_TX64X64 - 4, 2, 8, 4, 16, 8, + 4, 2, 8, 4, 16, 8, 8, 2, 16, 4 #else // CONFIG_CB4X4 1, 2, 4, 8, #if CONFIG_TX64X64 16, #endif // CONFIG_TX64X64 - 2, 1, 4, 2, 8, 4, + 2, 1, 4, 2, 8, 4, 4, 1, 8, 2 #endif // CONFIG_CB4X4 }; @@ -685,7 +697,7 @@ static const int tx_size_wide_log2[TX_SIZES_ALL] = { #if CONFIG_TX64X64 6, #endif // CONFIG_TX64X64 - 2, 3, 3, 4, 4, 5, + 2, 3, 3, 4, 4, 5, 2, 4, 3, 5 }; // Transform block height in log2 @@ -697,7 +709,7 @@ static const int tx_size_high_log2[TX_SIZES_ALL] = { #if CONFIG_TX64X64 6, #endif // CONFIG_TX64X64 - 3, 2, 4, 3, 5, 4, + 3, 2, 4, 3, 5, 4, 4, 2, 5, 3 }; static const int tx_size_2d[TX_SIZES_ALL] = { @@ -708,7 +720,7 @@ static const int tx_size_2d[TX_SIZES_ALL] = { #if CONFIG_TX64X64 4096, #endif // CONFIG_TX64X64 - 32, 32, 128, 128, 512, 512, + 32, 32, 128, 128, 512, 512, 64, 64, 256, 256 }; static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = { @@ -720,14 +732,18 @@ static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = { BLOCK_16X16, // TX_16X16 BLOCK_32X32, // TX_32X32 #if CONFIG_TX64X64 - BLOCK_64X64, // TX_64X64 -#endif // CONFIG_TX64X64 - BLOCK_4X8, // TX_4X8 - BLOCK_8X4, // TX_8X4 - BLOCK_8X16, // TX_8X16 - BLOCK_16X8, // TX_16X8 - BLOCK_16X32, // TX_16X32 - BLOCK_32X16, // TX_32X16 + BLOCK_64X64, // TX_64X64 +#endif // CONFIG_TX64X64 + BLOCK_4X8, // TX_4X8 + BLOCK_8X4, // TX_8X4 + BLOCK_8X16, // TX_8X16 + BLOCK_16X8, // TX_16X8 + BLOCK_16X32, // TX_16X32 + BLOCK_32X16, // TX_32X16 + BLOCK_INVALID, // TX_4X16 + BLOCK_INVALID, // TX_16X4 + BLOCK_INVALID, // TX_8X32 + BLOCK_INVALID, // TX_32X8 }; static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = { @@ -747,6 +763,10 @@ static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = { TX_8X8, // TX_16X8 TX_16X16, // TX_16X32 TX_16X16, // TX_32X16 + TX_4X4, // TX_4X16 + TX_4X4, // TX_16X4 + TX_8X8, // TX_8X32 + TX_8X8, // TX_32X8 }; static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = { @@ -766,6 +786,10 @@ static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = { TX_16X16, // TX_16X8 TX_32X32, // TX_16X32 TX_32X32, // TX_32X16 + TX_16X16, // TX_4X16 + TX_16X16, // TX_16X4 + TX_32X32, // TX_8X32 + TX_32X32, // TX_32X8 }; /* clang-format off */ @@ -835,6 +859,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_2X4 @@ -852,6 +880,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_2X4 @@ -869,6 +901,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, { { TX_2X2, TX_2X2 }, { TX_2X2, TX_2X2 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, #endif { @@ -891,6 +927,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { 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_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_4X8 @@ -912,6 +952,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_4X8, TX_4X4 }, { TX_4X4, TX_4X4 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_8X4 @@ -933,6 +977,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, { { TX_8X4, TX_4X4 }, { TX_4X4, TX_4X4 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_8X8 @@ -952,6 +1000,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } }, { { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } }, { { TX_8X8, TX_8X4 }, { TX_4X8, TX_4X4 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_8X16 @@ -971,6 +1023,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_8X16, TX_8X8 }, { TX_4X8, TX_4X8 } }, { { TX_8X16, TX_8X8 }, { TX_4X8, TX_4X8 } }, { { TX_8X16, TX_8X8 }, { TX_4X8, TX_4X8 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_16X8 @@ -990,6 +1046,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_8X4 }, { TX_8X8, TX_8X4 } }, // used { { TX_16X8, TX_8X4 }, { TX_8X8, TX_8X4 } }, { { TX_16X8, TX_8X4 }, { TX_8X8, TX_8X4 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_16X16 @@ -1009,6 +1069,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_8X8, TX_8X8 } }, { { TX_16X16, TX_16X8 }, { TX_8X16, TX_8X8 } }, { { TX_16X16, TX_16X8 }, { TX_8X16, TX_8X8 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_16X32 @@ -1028,6 +1092,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_8X8, TX_8X8 } }, { { TX_16X32, TX_16X16 }, { TX_8X16, TX_8X16 } }, // used { { TX_16X32, TX_16X16 }, { TX_8X16, TX_8X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_32X16 @@ -1047,6 +1115,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_32X16, TX_16X8 }, { TX_16X16, TX_16X8 } }, { { TX_32X16, TX_16X8 }, { TX_16X16, TX_16X8 } }, // used + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_32X32 @@ -1066,6 +1138,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X16 }, { TX_16X32, TX_16X16 } }, { { TX_32X16, TX_32X16 }, { TX_16X16, TX_16X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_32X64 @@ -1085,6 +1161,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X32 }, { TX_16X16, TX_16X16 } }, { { TX_32X16, TX_32X16 }, { TX_16X16, TX_16X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_64X32 @@ -1104,6 +1184,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X16 }, { TX_16X32, TX_16X16 } }, { { TX_32X16, TX_16X16 }, { TX_32X16, TX_16X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_64X64 @@ -1123,6 +1207,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } }, { { TX_32X16, TX_32X16 }, { TX_32X16, TX_16X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, #if CONFIG_EXT_PARTITION { @@ -1143,6 +1231,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } }, { { TX_32X16, TX_32X16 }, { TX_32X16, TX_32X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_128X64 @@ -1162,6 +1254,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } }, { { TX_32X16, TX_32X16 }, { TX_32X16, TX_32X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, { // BLOCK_128X128 @@ -1181,6 +1277,10 @@ static const TX_SIZE uv_txsize_lookup[BLOCK_SIZES][TX_SIZES_ALL][2][2] = { { { TX_16X8, TX_16X8 }, { TX_16X8, TX_16X8 } }, { { TX_16X32, TX_16X32 }, { TX_16X32, TX_16X32 } }, { { TX_32X16, TX_32X16 }, { TX_32X16, TX_32X16 } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, + { { TX_INVALID, TX_INVALID }, { TX_INVALID, TX_INVALID } }, }, #endif // CONFIG_EXT_PARTITION }; diff --git a/av1/common/entropy.c b/av1/common/entropy.c index 688d3000b..2c069ec3f 100644 --- a/av1/common/entropy.c +++ b/av1/common/entropy.c @@ -70,6 +70,8 @@ const uint16_t band_count_table[TX_SIZES_ALL][8] = { { 1, 2, 3, 4, 8, 32 - 18, 0 }, { 1, 2, 3, 4, 8, 32 - 18, 0 }, { 1, 2, 3, 4, 11, 128 - 21, 0 }, { 1, 2, 3, 4, 11, 128 - 21, 0 }, { 1, 2, 3, 4, 11, 512 - 21, 0 }, { 1, 2, 3, 4, 11, 512 - 21, 0 }, + { 1, 2, 3, 4, 11, 64 - 21, 0 }, { 1, 2, 3, 4, 11, 64 - 21, 0 }, + { 1, 2, 3, 4, 11, 256 - 21, 0 }, { 1, 2, 3, 4, 11, 256 - 21, 0 }, }; const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = { @@ -84,8 +86,8 @@ const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = { { 0, 1, 3, 6, 10, 18, 32, 0 }, { 0, 1, 3, 6, 10, 18, 32, 0 }, { 0, 1, 3, 6, 10, 21, 128, 0 }, { 0, 1, 3, 6, 10, 21, 128, 0 }, { 0, 1, 3, 6, 10, 21, 512, 0 }, { 0, 1, 3, 6, 10, 21, 512, 0 }, -#if CONFIG_TX64X64 -#endif // CONFIG_TX64X64 + { 0, 1, 3, 6, 10, 21, 64, 0 }, { 0, 1, 3, 6, 10, 21, 64, 0 }, + { 0, 1, 3, 6, 10, 21, 256, 0 }, { 0, 1, 3, 6, 10, 21, 256, 0 }, }; const uint8_t av1_coefband_trans_8x8plus[MAX_TX_SQUARE] = { @@ -253,12 +255,10 @@ const uint8_t av1_coefband_trans_8x8plus[MAX_TX_SQUARE] = { #endif // CONFIG_TX64X64 }; -#if CONFIG_EXT_TX const uint8_t av1_coefband_trans_4x8_8x4[32] = { 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, }; -#endif // CONFIG_EXT_TX const uint8_t av1_coefband_trans_4x4[16] = { 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, diff --git a/av1/common/entropy.h b/av1/common/entropy.h index 8d2a71fda..91e7b2561 100644 --- a/av1/common/entropy.h +++ b/av1/common/entropy.h @@ -156,9 +156,7 @@ void av1_partial_adapt_probs(struct AV1Common *cm, int mi_row, int mi_col); DECLARE_ALIGNED(16, extern const uint8_t, av1_coefband_trans_8x8plus[MAX_TX_SQUARE]); -#if CONFIG_EXT_TX DECLARE_ALIGNED(16, extern const uint8_t, av1_coefband_trans_4x8_8x4[32]); -#endif // CONFIG_EXT_TX DECLARE_ALIGNED(16, extern const uint8_t, av1_coefband_trans_4x4[16]); DECLARE_ALIGNED(16, extern const uint16_t, band_count_table[TX_SIZES_ALL][8]); @@ -168,9 +166,8 @@ DECLARE_ALIGNED(16, extern const uint16_t, static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) { switch (tx_size) { case TX_4X4: return av1_coefband_trans_4x4; -#if CONFIG_EXT_TX + case TX_8X4: case TX_4X8: return av1_coefband_trans_4x8_8x4; -#endif // CONFIG_EXT_TX default: return av1_coefband_trans_8x8plus; } } diff --git a/av1/common/enums.h b/av1/common/enums.h index 1e1c730f4..c2e9329ec 100644 --- a/av1/common/enums.h +++ b/av1/common/enums.h @@ -155,11 +155,10 @@ typedef enum ATTRIBUTE_PACKED { TX_16X8, // 16x8 transform TX_16X32, // 16x32 transform TX_32X16, // 32x16 transform -#if 0 // CONFIG_TX64X64 - // TODO(debargha): To be enabled later - TX_32X64, // 32x64 transform - TX_64X32, // 64x32 transform -#endif // CONFIG_TX64X64 + TX_4X16, // 4x16 transform + TX_16X4, // 16x4 transform + TX_8X32, // 8x32 transform + TX_32X8, // 32x8 transform TX_SIZES_ALL, // Includes rectangular transforms TX_SIZES = TX_4X8, // Does NOT include rectangular transforms TX_INVALID = 255 // Invalid transform size diff --git a/av1/common/scan.c b/av1/common/scan.c index b4bb2eeed..0376b8239 100644 --- a/av1/common/scan.c +++ b/av1/common/scan.c @@ -76,6 +76,176 @@ DECLARE_ALIGNED(16, static const int16_t, mrow_scan_8x4[32]) = { }; #endif +DECLARE_ALIGNED(16, static const int16_t, default_scan_4x16[64]) = { + 0, 1, 4, 2, 5, 8, 3, 6, 9, 12, 7, 10, 13, 16, 11, 14, + 17, 20, 15, 18, 21, 24, 19, 22, 25, 28, 23, 26, 29, 32, 27, 30, + 33, 36, 31, 34, 37, 40, 35, 38, 41, 44, 39, 42, 45, 48, 43, 46, + 49, 52, 47, 50, 53, 56, 51, 54, 57, 60, 55, 58, 61, 59, 62, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, default_scan_16x4[64]) = { + 0, 1, 16, 2, 17, 32, 3, 18, 33, 48, 4, 19, 34, 49, 5, 20, + 35, 50, 6, 21, 36, 51, 7, 22, 37, 52, 8, 23, 38, 53, 9, 24, + 39, 54, 10, 25, 40, 55, 11, 26, 41, 56, 12, 27, 42, 57, 13, 28, + 43, 58, 14, 29, 44, 59, 15, 30, 45, 60, 31, 46, 61, 47, 62, 63, +}; + +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_4x16[64]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_16x4[64]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_4x16[64]) = { + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, + 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, + 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, + 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_16x4[64]) = { + 0, 16, 32, 48, 1, 17, 33, 49, 2, 18, 34, 50, 3, 19, 35, 51, + 4, 20, 36, 52, 5, 21, 37, 53, 6, 22, 38, 54, 7, 23, 39, 55, + 8, 24, 40, 56, 9, 25, 41, 57, 10, 26, 42, 58, 11, 27, 43, 59, + 12, 28, 44, 60, 13, 29, 45, 61, 14, 30, 46, 62, 15, 31, 47, 63, +}; +#endif // CONFIG_EXT_TX + +DECLARE_ALIGNED(16, static const int16_t, default_scan_8x32[256]) = { + 0, 1, 8, 2, 9, 16, 3, 10, 17, 24, 4, 11, 18, 25, 32, + 5, 12, 19, 26, 33, 40, 6, 13, 20, 27, 34, 41, 48, 7, 14, + 21, 28, 35, 42, 49, 56, 15, 22, 29, 36, 43, 50, 57, 64, 23, + 30, 37, 44, 51, 58, 65, 72, 31, 38, 45, 52, 59, 66, 73, 80, + 39, 46, 53, 60, 67, 74, 81, 88, 47, 54, 61, 68, 75, 82, 89, + 96, 55, 62, 69, 76, 83, 90, 97, 104, 63, 70, 77, 84, 91, 98, + 105, 112, 71, 78, 85, 92, 99, 106, 113, 120, 79, 86, 93, 100, 107, + 114, 121, 128, 87, 94, 101, 108, 115, 122, 129, 136, 95, 102, 109, 116, + 123, 130, 137, 144, 103, 110, 117, 124, 131, 138, 145, 152, 111, 118, 125, + 132, 139, 146, 153, 160, 119, 126, 133, 140, 147, 154, 161, 168, 127, 134, + 141, 148, 155, 162, 169, 176, 135, 142, 149, 156, 163, 170, 177, 184, 143, + 150, 157, 164, 171, 178, 185, 192, 151, 158, 165, 172, 179, 186, 193, 200, + 159, 166, 173, 180, 187, 194, 201, 208, 167, 174, 181, 188, 195, 202, 209, + 216, 175, 182, 189, 196, 203, 210, 217, 224, 183, 190, 197, 204, 211, 218, + 225, 232, 191, 198, 205, 212, 219, 226, 233, 240, 199, 206, 213, 220, 227, + 234, 241, 248, 207, 214, 221, 228, 235, 242, 249, 215, 222, 229, 236, 243, + 250, 223, 230, 237, 244, 251, 231, 238, 245, 252, 239, 246, 253, 247, 254, + 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, default_scan_32x8[256]) = { + 0, 1, 32, 2, 33, 64, 3, 34, 65, 96, 4, 35, 66, 97, 128, + 5, 36, 67, 98, 129, 160, 6, 37, 68, 99, 130, 161, 192, 7, 38, + 69, 100, 131, 162, 193, 224, 8, 39, 70, 101, 132, 163, 194, 225, 9, + 40, 71, 102, 133, 164, 195, 226, 10, 41, 72, 103, 134, 165, 196, 227, + 11, 42, 73, 104, 135, 166, 197, 228, 12, 43, 74, 105, 136, 167, 198, + 229, 13, 44, 75, 106, 137, 168, 199, 230, 14, 45, 76, 107, 138, 169, + 200, 231, 15, 46, 77, 108, 139, 170, 201, 232, 16, 47, 78, 109, 140, + 171, 202, 233, 17, 48, 79, 110, 141, 172, 203, 234, 18, 49, 80, 111, + 142, 173, 204, 235, 19, 50, 81, 112, 143, 174, 205, 236, 20, 51, 82, + 113, 144, 175, 206, 237, 21, 52, 83, 114, 145, 176, 207, 238, 22, 53, + 84, 115, 146, 177, 208, 239, 23, 54, 85, 116, 147, 178, 209, 240, 24, + 55, 86, 117, 148, 179, 210, 241, 25, 56, 87, 118, 149, 180, 211, 242, + 26, 57, 88, 119, 150, 181, 212, 243, 27, 58, 89, 120, 151, 182, 213, + 244, 28, 59, 90, 121, 152, 183, 214, 245, 29, 60, 91, 122, 153, 184, + 215, 246, 30, 61, 92, 123, 154, 185, 216, 247, 31, 62, 93, 124, 155, + 186, 217, 248, 63, 94, 125, 156, 187, 218, 249, 95, 126, 157, 188, 219, + 250, 127, 158, 189, 220, 251, 159, 190, 221, 252, 191, 222, 253, 223, 254, + 255, +}; + +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_8x32[256]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_32x8[256]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_8x32[256]) = { + 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, + 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, + 240, 248, 1, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, + 105, 113, 121, 129, 137, 145, 153, 161, 169, 177, 185, 193, 201, 209, 217, + 225, 233, 241, 249, 2, 10, 18, 26, 34, 42, 50, 58, 66, 74, 82, + 90, 98, 106, 114, 122, 130, 138, 146, 154, 162, 170, 178, 186, 194, 202, + 210, 218, 226, 234, 242, 250, 3, 11, 19, 27, 35, 43, 51, 59, 67, + 75, 83, 91, 99, 107, 115, 123, 131, 139, 147, 155, 163, 171, 179, 187, + 195, 203, 211, 219, 227, 235, 243, 251, 4, 12, 20, 28, 36, 44, 52, + 60, 68, 76, 84, 92, 100, 108, 116, 124, 132, 140, 148, 156, 164, 172, + 180, 188, 196, 204, 212, 220, 228, 236, 244, 252, 5, 13, 21, 29, 37, + 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 149, 157, + 165, 173, 181, 189, 197, 205, 213, 221, 229, 237, 245, 253, 6, 14, 22, + 30, 38, 46, 54, 62, 70, 78, 86, 94, 102, 110, 118, 126, 134, 142, + 150, 158, 166, 174, 182, 190, 198, 206, 214, 222, 230, 238, 246, 254, 7, + 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127, + 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, 247, + 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_32x8[256]) = { + 0, 32, 64, 96, 128, 160, 192, 224, 1, 33, 65, 97, 129, 161, 193, 225, + 2, 34, 66, 98, 130, 162, 194, 226, 3, 35, 67, 99, 131, 163, 195, 227, + 4, 36, 68, 100, 132, 164, 196, 228, 5, 37, 69, 101, 133, 165, 197, 229, + 6, 38, 70, 102, 134, 166, 198, 230, 7, 39, 71, 103, 135, 167, 199, 231, + 8, 40, 72, 104, 136, 168, 200, 232, 9, 41, 73, 105, 137, 169, 201, 233, + 10, 42, 74, 106, 138, 170, 202, 234, 11, 43, 75, 107, 139, 171, 203, 235, + 12, 44, 76, 108, 140, 172, 204, 236, 13, 45, 77, 109, 141, 173, 205, 237, + 14, 46, 78, 110, 142, 174, 206, 238, 15, 47, 79, 111, 143, 175, 207, 239, + 16, 48, 80, 112, 144, 176, 208, 240, 17, 49, 81, 113, 145, 177, 209, 241, + 18, 50, 82, 114, 146, 178, 210, 242, 19, 51, 83, 115, 147, 179, 211, 243, + 20, 52, 84, 116, 148, 180, 212, 244, 21, 53, 85, 117, 149, 181, 213, 245, + 22, 54, 86, 118, 150, 182, 214, 246, 23, 55, 87, 119, 151, 183, 215, 247, + 24, 56, 88, 120, 152, 184, 216, 248, 25, 57, 89, 121, 153, 185, 217, 249, + 26, 58, 90, 122, 154, 186, 218, 250, 27, 59, 91, 123, 155, 187, 219, 251, + 28, 60, 92, 124, 156, 188, 220, 252, 29, 61, 93, 125, 157, 189, 221, 253, + 30, 62, 94, 126, 158, 190, 222, 254, 31, 63, 95, 127, 159, 191, 223, 255, +}; +#endif // CONFIG_EXT_TX + DECLARE_ALIGNED(16, static const int16_t, default_scan_8x8[64]) = { 0, 8, 1, 16, 9, 2, 17, 24, 10, 3, 18, 25, 32, 11, 4, 26, 33, 19, 40, 12, 34, 27, 5, 41, 20, 48, 13, 35, 42, 28, 21, 6, @@ -1422,6 +1592,308 @@ DECLARE_ALIGNED(16, static const int16_t, }; #endif // CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, + default_scan_4x16_neighbors[65 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 4, 4, 2, 2, 2, 5, 5, 8, 8, + 8, 3, 6, 6, 9, 9, 12, 12, 12, 7, 10, 10, 13, 13, 16, 16, 16, 11, 14, + 14, 17, 17, 20, 20, 20, 15, 18, 18, 21, 21, 24, 24, 24, 19, 22, 22, 25, 25, + 28, 28, 28, 23, 26, 26, 29, 29, 32, 32, 32, 27, 30, 30, 33, 33, 36, 36, 36, + 31, 34, 34, 37, 37, 40, 40, 40, 35, 38, 38, 41, 41, 44, 44, 44, 39, 42, 42, + 45, 45, 48, 48, 48, 43, 46, 46, 49, 49, 52, 52, 52, 47, 50, 50, 53, 53, 56, + 56, 56, 51, 54, 54, 57, 57, 60, 55, 58, 58, 61, 59, 62, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + default_scan_16x4_neighbors[65 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 0, 0, 1, 1, 1, 16, 16, 16, 2, 2, 2, 17, 17, 32, 32, + 32, 3, 3, 3, 18, 18, 33, 33, 48, 4, 4, 4, 19, 19, 34, 34, 49, 5, 5, + 5, 20, 20, 35, 35, 50, 6, 6, 6, 21, 21, 36, 36, 51, 7, 7, 7, 22, 22, + 37, 37, 52, 8, 8, 8, 23, 23, 38, 38, 53, 9, 9, 9, 24, 24, 39, 39, 54, + 10, 10, 10, 25, 25, 40, 40, 55, 11, 11, 11, 26, 26, 41, 41, 56, 12, 12, 12, + 27, 27, 42, 42, 57, 13, 13, 13, 28, 28, 43, 43, 58, 14, 14, 14, 29, 29, 44, + 44, 59, 15, 30, 30, 45, 45, 60, 31, 46, 46, 61, 47, 62, 0, 0 +}; + +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_4x16_neighbors[65 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 0, 0, 1, 1, 1, 16, 16, 16, 2, 2, 2, 17, 17, 32, 32, + 32, 3, 3, 3, 18, 18, 33, 33, 48, 4, 4, 4, 19, 19, 34, 34, 49, 5, 5, + 5, 20, 20, 35, 35, 50, 6, 6, 6, 21, 21, 36, 36, 51, 7, 7, 7, 22, 22, + 37, 37, 52, 8, 8, 8, 23, 23, 38, 38, 53, 9, 9, 9, 24, 24, 39, 39, 54, + 10, 10, 10, 25, 25, 40, 40, 55, 11, 11, 11, 26, 26, 41, 41, 56, 12, 12, 12, + 27, 27, 42, 42, 57, 13, 13, 13, 28, 28, 43, 43, 58, 14, 14, 14, 29, 29, 44, + 44, 59, 15, 30, 30, 45, 45, 60, 31, 46, 46, 61, 47, 62, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_16x4_neighbors[65 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, + 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 0, 0, 1, 16, 2, 17, + 3, 18, 4, 19, 5, 20, 6, 21, 7, 22, 8, 23, 9, 24, 10, 25, 11, 26, 12, + 27, 13, 28, 14, 29, 15, 30, 16, 16, 17, 32, 18, 33, 19, 34, 20, 35, 21, 36, + 22, 37, 23, 38, 24, 39, 25, 40, 26, 41, 27, 42, 28, 43, 29, 44, 30, 45, 31, + 46, 32, 32, 33, 48, 34, 49, 35, 50, 36, 51, 37, 52, 38, 53, 39, 54, 40, 55, + 41, 56, 42, 57, 43, 58, 44, 59, 45, 60, 46, 61, 47, 62, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_4x16_neighbors[65 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 4, 4, 8, 8, 12, 12, 16, 16, 20, 20, 24, 24, 28, 28, 32, + 32, 36, 36, 40, 40, 44, 44, 48, 48, 52, 52, 56, 56, 0, 0, 1, 4, 5, 8, + 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29, 32, 33, 36, 37, 40, 41, 44, 45, + 48, 49, 52, 53, 56, 57, 60, 1, 1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, + 22, 25, 26, 29, 30, 33, 34, 37, 38, 41, 42, 45, 46, 49, 50, 53, 54, 57, 58, + 61, 2, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34, + 35, 38, 39, 42, 43, 46, 47, 50, 51, 54, 55, 58, 59, 62, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_16x4_neighbors[65 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 16, 16, 32, 32, 0, 0, 1, 16, 17, 32, 33, 48, 1, 1, 2, + 17, 18, 33, 34, 49, 2, 2, 3, 18, 19, 34, 35, 50, 3, 3, 4, 19, 20, 35, + 36, 51, 4, 4, 5, 20, 21, 36, 37, 52, 5, 5, 6, 21, 22, 37, 38, 53, 6, + 6, 7, 22, 23, 38, 39, 54, 7, 7, 8, 23, 24, 39, 40, 55, 8, 8, 9, 24, + 25, 40, 41, 56, 9, 9, 10, 25, 26, 41, 42, 57, 10, 10, 11, 26, 27, 42, 43, + 58, 11, 11, 12, 27, 28, 43, 44, 59, 12, 12, 13, 28, 29, 44, 45, 60, 13, 13, + 14, 29, 30, 45, 46, 61, 14, 14, 15, 30, 31, 46, 47, 62, 0, 0 +}; +#endif // CONFIG_EXT_TX + +DECLARE_ALIGNED(16, static const int16_t, + default_scan_8x32_neighbors[257 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 0, 0, 1, 1, 1, 8, 8, 8, 2, 2, 2, + 9, 9, 16, 16, 16, 3, 3, 3, 10, 10, 17, 17, 24, 24, 24, + 4, 4, 4, 11, 11, 18, 18, 25, 25, 32, 32, 32, 5, 5, 5, + 12, 12, 19, 19, 26, 26, 33, 33, 40, 40, 40, 6, 6, 6, 13, + 13, 20, 20, 27, 27, 34, 34, 41, 41, 48, 48, 48, 7, 14, 14, + 21, 21, 28, 28, 35, 35, 42, 42, 49, 49, 56, 56, 56, 15, 22, + 22, 29, 29, 36, 36, 43, 43, 50, 50, 57, 57, 64, 64, 64, 23, + 30, 30, 37, 37, 44, 44, 51, 51, 58, 58, 65, 65, 72, 72, 72, + 31, 38, 38, 45, 45, 52, 52, 59, 59, 66, 66, 73, 73, 80, 80, + 80, 39, 46, 46, 53, 53, 60, 60, 67, 67, 74, 74, 81, 81, 88, + 88, 88, 47, 54, 54, 61, 61, 68, 68, 75, 75, 82, 82, 89, 89, + 96, 96, 96, 55, 62, 62, 69, 69, 76, 76, 83, 83, 90, 90, 97, + 97, 104, 104, 104, 63, 70, 70, 77, 77, 84, 84, 91, 91, 98, 98, + 105, 105, 112, 112, 112, 71, 78, 78, 85, 85, 92, 92, 99, 99, 106, + 106, 113, 113, 120, 120, 120, 79, 86, 86, 93, 93, 100, 100, 107, 107, + 114, 114, 121, 121, 128, 128, 128, 87, 94, 94, 101, 101, 108, 108, 115, + 115, 122, 122, 129, 129, 136, 136, 136, 95, 102, 102, 109, 109, 116, 116, + 123, 123, 130, 130, 137, 137, 144, 144, 144, 103, 110, 110, 117, 117, 124, + 124, 131, 131, 138, 138, 145, 145, 152, 152, 152, 111, 118, 118, 125, 125, + 132, 132, 139, 139, 146, 146, 153, 153, 160, 160, 160, 119, 126, 126, 133, + 133, 140, 140, 147, 147, 154, 154, 161, 161, 168, 168, 168, 127, 134, 134, + 141, 141, 148, 148, 155, 155, 162, 162, 169, 169, 176, 176, 176, 135, 142, + 142, 149, 149, 156, 156, 163, 163, 170, 170, 177, 177, 184, 184, 184, 143, + 150, 150, 157, 157, 164, 164, 171, 171, 178, 178, 185, 185, 192, 192, 192, + 151, 158, 158, 165, 165, 172, 172, 179, 179, 186, 186, 193, 193, 200, 200, + 200, 159, 166, 166, 173, 173, 180, 180, 187, 187, 194, 194, 201, 201, 208, + 208, 208, 167, 174, 174, 181, 181, 188, 188, 195, 195, 202, 202, 209, 209, + 216, 216, 216, 175, 182, 182, 189, 189, 196, 196, 203, 203, 210, 210, 217, + 217, 224, 224, 224, 183, 190, 190, 197, 197, 204, 204, 211, 211, 218, 218, + 225, 225, 232, 232, 232, 191, 198, 198, 205, 205, 212, 212, 219, 219, 226, + 226, 233, 233, 240, 240, 240, 199, 206, 206, 213, 213, 220, 220, 227, 227, + 234, 234, 241, 241, 248, 207, 214, 214, 221, 221, 228, 228, 235, 235, 242, + 242, 249, 215, 222, 222, 229, 229, 236, 236, 243, 243, 250, 223, 230, 230, + 237, 237, 244, 244, 251, 231, 238, 238, 245, 245, 252, 239, 246, 246, 253, + 247, 254, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + default_scan_32x8_neighbors[257 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 0, 0, 1, 1, 1, 32, 32, 32, 2, 2, 2, + 33, 33, 64, 64, 64, 3, 3, 3, 34, 34, 65, 65, 96, 96, 96, + 4, 4, 4, 35, 35, 66, 66, 97, 97, 128, 128, 128, 5, 5, 5, + 36, 36, 67, 67, 98, 98, 129, 129, 160, 160, 160, 6, 6, 6, 37, + 37, 68, 68, 99, 99, 130, 130, 161, 161, 192, 192, 192, 7, 7, 7, + 38, 38, 69, 69, 100, 100, 131, 131, 162, 162, 193, 193, 224, 8, 8, + 8, 39, 39, 70, 70, 101, 101, 132, 132, 163, 163, 194, 194, 225, 9, + 9, 9, 40, 40, 71, 71, 102, 102, 133, 133, 164, 164, 195, 195, 226, + 10, 10, 10, 41, 41, 72, 72, 103, 103, 134, 134, 165, 165, 196, 196, + 227, 11, 11, 11, 42, 42, 73, 73, 104, 104, 135, 135, 166, 166, 197, + 197, 228, 12, 12, 12, 43, 43, 74, 74, 105, 105, 136, 136, 167, 167, + 198, 198, 229, 13, 13, 13, 44, 44, 75, 75, 106, 106, 137, 137, 168, + 168, 199, 199, 230, 14, 14, 14, 45, 45, 76, 76, 107, 107, 138, 138, + 169, 169, 200, 200, 231, 15, 15, 15, 46, 46, 77, 77, 108, 108, 139, + 139, 170, 170, 201, 201, 232, 16, 16, 16, 47, 47, 78, 78, 109, 109, + 140, 140, 171, 171, 202, 202, 233, 17, 17, 17, 48, 48, 79, 79, 110, + 110, 141, 141, 172, 172, 203, 203, 234, 18, 18, 18, 49, 49, 80, 80, + 111, 111, 142, 142, 173, 173, 204, 204, 235, 19, 19, 19, 50, 50, 81, + 81, 112, 112, 143, 143, 174, 174, 205, 205, 236, 20, 20, 20, 51, 51, + 82, 82, 113, 113, 144, 144, 175, 175, 206, 206, 237, 21, 21, 21, 52, + 52, 83, 83, 114, 114, 145, 145, 176, 176, 207, 207, 238, 22, 22, 22, + 53, 53, 84, 84, 115, 115, 146, 146, 177, 177, 208, 208, 239, 23, 23, + 23, 54, 54, 85, 85, 116, 116, 147, 147, 178, 178, 209, 209, 240, 24, + 24, 24, 55, 55, 86, 86, 117, 117, 148, 148, 179, 179, 210, 210, 241, + 25, 25, 25, 56, 56, 87, 87, 118, 118, 149, 149, 180, 180, 211, 211, + 242, 26, 26, 26, 57, 57, 88, 88, 119, 119, 150, 150, 181, 181, 212, + 212, 243, 27, 27, 27, 58, 58, 89, 89, 120, 120, 151, 151, 182, 182, + 213, 213, 244, 28, 28, 28, 59, 59, 90, 90, 121, 121, 152, 152, 183, + 183, 214, 214, 245, 29, 29, 29, 60, 60, 91, 91, 122, 122, 153, 153, + 184, 184, 215, 215, 246, 30, 30, 30, 61, 61, 92, 92, 123, 123, 154, + 154, 185, 185, 216, 216, 247, 31, 62, 62, 93, 93, 124, 124, 155, 155, + 186, 186, 217, 217, 248, 63, 94, 94, 125, 125, 156, 156, 187, 187, 218, + 218, 249, 95, 126, 126, 157, 157, 188, 188, 219, 219, 250, 127, 158, 158, + 189, 189, 220, 220, 251, 159, 190, 190, 221, 221, 252, 191, 222, 222, 253, + 223, 254, 0, 0 +}; + +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_8x32_neighbors[257 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, + 6, 0, 0, 1, 8, 2, 9, 3, 10, 4, 11, 5, 12, 6, 13, + 7, 14, 8, 8, 9, 16, 10, 17, 11, 18, 12, 19, 13, 20, 14, + 21, 15, 22, 16, 16, 17, 24, 18, 25, 19, 26, 20, 27, 21, 28, + 22, 29, 23, 30, 24, 24, 25, 32, 26, 33, 27, 34, 28, 35, 29, + 36, 30, 37, 31, 38, 32, 32, 33, 40, 34, 41, 35, 42, 36, 43, + 37, 44, 38, 45, 39, 46, 40, 40, 41, 48, 42, 49, 43, 50, 44, + 51, 45, 52, 46, 53, 47, 54, 48, 48, 49, 56, 50, 57, 51, 58, + 52, 59, 53, 60, 54, 61, 55, 62, 56, 56, 57, 64, 58, 65, 59, + 66, 60, 67, 61, 68, 62, 69, 63, 70, 64, 64, 65, 72, 66, 73, + 67, 74, 68, 75, 69, 76, 70, 77, 71, 78, 72, 72, 73, 80, 74, + 81, 75, 82, 76, 83, 77, 84, 78, 85, 79, 86, 80, 80, 81, 88, + 82, 89, 83, 90, 84, 91, 85, 92, 86, 93, 87, 94, 88, 88, 89, + 96, 90, 97, 91, 98, 92, 99, 93, 100, 94, 101, 95, 102, 96, 96, + 97, 104, 98, 105, 99, 106, 100, 107, 101, 108, 102, 109, 103, 110, 104, + 104, 105, 112, 106, 113, 107, 114, 108, 115, 109, 116, 110, 117, 111, 118, + 112, 112, 113, 120, 114, 121, 115, 122, 116, 123, 117, 124, 118, 125, 119, + 126, 120, 120, 121, 128, 122, 129, 123, 130, 124, 131, 125, 132, 126, 133, + 127, 134, 128, 128, 129, 136, 130, 137, 131, 138, 132, 139, 133, 140, 134, + 141, 135, 142, 136, 136, 137, 144, 138, 145, 139, 146, 140, 147, 141, 148, + 142, 149, 143, 150, 144, 144, 145, 152, 146, 153, 147, 154, 148, 155, 149, + 156, 150, 157, 151, 158, 152, 152, 153, 160, 154, 161, 155, 162, 156, 163, + 157, 164, 158, 165, 159, 166, 160, 160, 161, 168, 162, 169, 163, 170, 164, + 171, 165, 172, 166, 173, 167, 174, 168, 168, 169, 176, 170, 177, 171, 178, + 172, 179, 173, 180, 174, 181, 175, 182, 176, 176, 177, 184, 178, 185, 179, + 186, 180, 187, 181, 188, 182, 189, 183, 190, 184, 184, 185, 192, 186, 193, + 187, 194, 188, 195, 189, 196, 190, 197, 191, 198, 192, 192, 193, 200, 194, + 201, 195, 202, 196, 203, 197, 204, 198, 205, 199, 206, 200, 200, 201, 208, + 202, 209, 203, 210, 204, 211, 205, 212, 206, 213, 207, 214, 208, 208, 209, + 216, 210, 217, 211, 218, 212, 219, 213, 220, 214, 221, 215, 222, 216, 216, + 217, 224, 218, 225, 219, 226, 220, 227, 221, 228, 222, 229, 223, 230, 224, + 224, 225, 232, 226, 233, 227, 234, 228, 235, 229, 236, 230, 237, 231, 238, + 232, 232, 233, 240, 234, 241, 235, 242, 236, 243, 237, 244, 238, 245, 239, + 246, 240, 240, 241, 248, 242, 249, 243, 250, 244, 251, 245, 252, 246, 253, + 247, 254, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_32x8_neighbors[257 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, + 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, + 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, + 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, + 29, 29, 30, 30, 0, 0, 1, 32, 2, 33, 3, 34, 4, 35, 5, + 36, 6, 37, 7, 38, 8, 39, 9, 40, 10, 41, 11, 42, 12, 43, + 13, 44, 14, 45, 15, 46, 16, 47, 17, 48, 18, 49, 19, 50, 20, + 51, 21, 52, 22, 53, 23, 54, 24, 55, 25, 56, 26, 57, 27, 58, + 28, 59, 29, 60, 30, 61, 31, 62, 32, 32, 33, 64, 34, 65, 35, + 66, 36, 67, 37, 68, 38, 69, 39, 70, 40, 71, 41, 72, 42, 73, + 43, 74, 44, 75, 45, 76, 46, 77, 47, 78, 48, 79, 49, 80, 50, + 81, 51, 82, 52, 83, 53, 84, 54, 85, 55, 86, 56, 87, 57, 88, + 58, 89, 59, 90, 60, 91, 61, 92, 62, 93, 63, 94, 64, 64, 65, + 96, 66, 97, 67, 98, 68, 99, 69, 100, 70, 101, 71, 102, 72, 103, + 73, 104, 74, 105, 75, 106, 76, 107, 77, 108, 78, 109, 79, 110, 80, + 111, 81, 112, 82, 113, 83, 114, 84, 115, 85, 116, 86, 117, 87, 118, + 88, 119, 89, 120, 90, 121, 91, 122, 92, 123, 93, 124, 94, 125, 95, + 126, 96, 96, 97, 128, 98, 129, 99, 130, 100, 131, 101, 132, 102, 133, + 103, 134, 104, 135, 105, 136, 106, 137, 107, 138, 108, 139, 109, 140, 110, + 141, 111, 142, 112, 143, 113, 144, 114, 145, 115, 146, 116, 147, 117, 148, + 118, 149, 119, 150, 120, 151, 121, 152, 122, 153, 123, 154, 124, 155, 125, + 156, 126, 157, 127, 158, 128, 128, 129, 160, 130, 161, 131, 162, 132, 163, + 133, 164, 134, 165, 135, 166, 136, 167, 137, 168, 138, 169, 139, 170, 140, + 171, 141, 172, 142, 173, 143, 174, 144, 175, 145, 176, 146, 177, 147, 178, + 148, 179, 149, 180, 150, 181, 151, 182, 152, 183, 153, 184, 154, 185, 155, + 186, 156, 187, 157, 188, 158, 189, 159, 190, 160, 160, 161, 192, 162, 193, + 163, 194, 164, 195, 165, 196, 166, 197, 167, 198, 168, 199, 169, 200, 170, + 201, 171, 202, 172, 203, 173, 204, 174, 205, 175, 206, 176, 207, 177, 208, + 178, 209, 179, 210, 180, 211, 181, 212, 182, 213, 183, 214, 184, 215, 185, + 216, 186, 217, 187, 218, 188, 219, 189, 220, 190, 221, 191, 222, 192, 192, + 193, 224, 194, 225, 195, 226, 196, 227, 197, 228, 198, 229, 199, 230, 200, + 231, 201, 232, 202, 233, 203, 234, 204, 235, 205, 236, 206, 237, 207, 238, + 208, 239, 209, 240, 210, 241, 211, 242, 212, 243, 213, 244, 214, 245, 215, + 246, 216, 247, 217, 248, 218, 249, 219, 250, 220, 251, 221, 252, 222, 253, + 223, 254, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_8x32_neighbors[257 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 8, 8, 16, 16, 24, 24, 32, 32, 40, 40, 48, + 48, 56, 56, 64, 64, 72, 72, 80, 80, 88, 88, 96, 96, 104, 104, + 112, 112, 120, 120, 128, 128, 136, 136, 144, 144, 152, 152, 160, 160, 168, + 168, 176, 176, 184, 184, 192, 192, 200, 200, 208, 208, 216, 216, 224, 224, + 232, 232, 240, 240, 0, 0, 1, 8, 9, 16, 17, 24, 25, 32, 33, + 40, 41, 48, 49, 56, 57, 64, 65, 72, 73, 80, 81, 88, 89, 96, + 97, 104, 105, 112, 113, 120, 121, 128, 129, 136, 137, 144, 145, 152, 153, + 160, 161, 168, 169, 176, 177, 184, 185, 192, 193, 200, 201, 208, 209, 216, + 217, 224, 225, 232, 233, 240, 241, 248, 1, 1, 2, 9, 10, 17, 18, + 25, 26, 33, 34, 41, 42, 49, 50, 57, 58, 65, 66, 73, 74, 81, + 82, 89, 90, 97, 98, 105, 106, 113, 114, 121, 122, 129, 130, 137, 138, + 145, 146, 153, 154, 161, 162, 169, 170, 177, 178, 185, 186, 193, 194, 201, + 202, 209, 210, 217, 218, 225, 226, 233, 234, 241, 242, 249, 2, 2, 3, + 10, 11, 18, 19, 26, 27, 34, 35, 42, 43, 50, 51, 58, 59, 66, + 67, 74, 75, 82, 83, 90, 91, 98, 99, 106, 107, 114, 115, 122, 123, + 130, 131, 138, 139, 146, 147, 154, 155, 162, 163, 170, 171, 178, 179, 186, + 187, 194, 195, 202, 203, 210, 211, 218, 219, 226, 227, 234, 235, 242, 243, + 250, 3, 3, 4, 11, 12, 19, 20, 27, 28, 35, 36, 43, 44, 51, + 52, 59, 60, 67, 68, 75, 76, 83, 84, 91, 92, 99, 100, 107, 108, + 115, 116, 123, 124, 131, 132, 139, 140, 147, 148, 155, 156, 163, 164, 171, + 172, 179, 180, 187, 188, 195, 196, 203, 204, 211, 212, 219, 220, 227, 228, + 235, 236, 243, 244, 251, 4, 4, 5, 12, 13, 20, 21, 28, 29, 36, + 37, 44, 45, 52, 53, 60, 61, 68, 69, 76, 77, 84, 85, 92, 93, + 100, 101, 108, 109, 116, 117, 124, 125, 132, 133, 140, 141, 148, 149, 156, + 157, 164, 165, 172, 173, 180, 181, 188, 189, 196, 197, 204, 205, 212, 213, + 220, 221, 228, 229, 236, 237, 244, 245, 252, 5, 5, 6, 13, 14, 21, + 22, 29, 30, 37, 38, 45, 46, 53, 54, 61, 62, 69, 70, 77, 78, + 85, 86, 93, 94, 101, 102, 109, 110, 117, 118, 125, 126, 133, 134, 141, + 142, 149, 150, 157, 158, 165, 166, 173, 174, 181, 182, 189, 190, 197, 198, + 205, 206, 213, 214, 221, 222, 229, 230, 237, 238, 245, 246, 253, 6, 6, + 7, 14, 15, 22, 23, 30, 31, 38, 39, 46, 47, 54, 55, 62, 63, + 70, 71, 78, 79, 86, 87, 94, 95, 102, 103, 110, 111, 118, 119, 126, + 127, 134, 135, 142, 143, 150, 151, 158, 159, 166, 167, 174, 175, 182, 183, + 190, 191, 198, 199, 206, 207, 214, 215, 222, 223, 230, 231, 238, 239, 246, + 247, 254, 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_32x8_neighbors[257 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 32, 32, 64, 64, 96, 96, 128, 128, 160, 160, 192, 192, + 0, 0, 1, 32, 33, 64, 65, 96, 97, 128, 129, 160, 161, 192, 193, 224, + 1, 1, 2, 33, 34, 65, 66, 97, 98, 129, 130, 161, 162, 193, 194, 225, + 2, 2, 3, 34, 35, 66, 67, 98, 99, 130, 131, 162, 163, 194, 195, 226, + 3, 3, 4, 35, 36, 67, 68, 99, 100, 131, 132, 163, 164, 195, 196, 227, + 4, 4, 5, 36, 37, 68, 69, 100, 101, 132, 133, 164, 165, 196, 197, 228, + 5, 5, 6, 37, 38, 69, 70, 101, 102, 133, 134, 165, 166, 197, 198, 229, + 6, 6, 7, 38, 39, 70, 71, 102, 103, 134, 135, 166, 167, 198, 199, 230, + 7, 7, 8, 39, 40, 71, 72, 103, 104, 135, 136, 167, 168, 199, 200, 231, + 8, 8, 9, 40, 41, 72, 73, 104, 105, 136, 137, 168, 169, 200, 201, 232, + 9, 9, 10, 41, 42, 73, 74, 105, 106, 137, 138, 169, 170, 201, 202, 233, + 10, 10, 11, 42, 43, 74, 75, 106, 107, 138, 139, 170, 171, 202, 203, 234, + 11, 11, 12, 43, 44, 75, 76, 107, 108, 139, 140, 171, 172, 203, 204, 235, + 12, 12, 13, 44, 45, 76, 77, 108, 109, 140, 141, 172, 173, 204, 205, 236, + 13, 13, 14, 45, 46, 77, 78, 109, 110, 141, 142, 173, 174, 205, 206, 237, + 14, 14, 15, 46, 47, 78, 79, 110, 111, 142, 143, 174, 175, 206, 207, 238, + 15, 15, 16, 47, 48, 79, 80, 111, 112, 143, 144, 175, 176, 207, 208, 239, + 16, 16, 17, 48, 49, 80, 81, 112, 113, 144, 145, 176, 177, 208, 209, 240, + 17, 17, 18, 49, 50, 81, 82, 113, 114, 145, 146, 177, 178, 209, 210, 241, + 18, 18, 19, 50, 51, 82, 83, 114, 115, 146, 147, 178, 179, 210, 211, 242, + 19, 19, 20, 51, 52, 83, 84, 115, 116, 147, 148, 179, 180, 211, 212, 243, + 20, 20, 21, 52, 53, 84, 85, 116, 117, 148, 149, 180, 181, 212, 213, 244, + 21, 21, 22, 53, 54, 85, 86, 117, 118, 149, 150, 181, 182, 213, 214, 245, + 22, 22, 23, 54, 55, 86, 87, 118, 119, 150, 151, 182, 183, 214, 215, 246, + 23, 23, 24, 55, 56, 87, 88, 119, 120, 151, 152, 183, 184, 215, 216, 247, + 24, 24, 25, 56, 57, 88, 89, 120, 121, 152, 153, 184, 185, 216, 217, 248, + 25, 25, 26, 57, 58, 89, 90, 121, 122, 153, 154, 185, 186, 217, 218, 249, + 26, 26, 27, 58, 59, 90, 91, 122, 123, 154, 155, 186, 187, 218, 219, 250, + 27, 27, 28, 59, 60, 91, 92, 123, 124, 155, 156, 187, 188, 219, 220, 251, + 28, 28, 29, 60, 61, 92, 93, 124, 125, 156, 157, 188, 189, 220, 221, 252, + 29, 29, 30, 61, 62, 93, 94, 125, 126, 157, 158, 189, 190, 221, 222, 253, + 30, 30, 31, 62, 63, 94, 95, 126, 127, 158, 159, 190, 191, 222, 223, 254, + 0, 0 +}; +#endif // CONFIG_EXT_TX + DECLARE_ALIGNED(16, static const int16_t, col_scan_8x8_neighbors[65 * MAX_NEIGHBORS]) = { 0, 0, 0, 0, 8, 8, 8, 0, 16, 16, 1, 8, 24, 24, 9, 16, 9, 1, 32, @@ -3854,6 +4326,175 @@ DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_8x4[32]) = { }; #endif // CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_4x16[64]) = { + 0, 1, 3, 6, 2, 4, 7, 10, 5, 8, 11, 14, 9, 12, 15, 18, + 13, 16, 19, 22, 17, 20, 23, 26, 21, 24, 27, 30, 25, 28, 31, 34, + 29, 32, 35, 38, 33, 36, 39, 42, 37, 40, 43, 46, 41, 44, 47, 50, + 45, 48, 51, 54, 49, 52, 55, 58, 53, 56, 59, 61, 57, 60, 62, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_16x4[64]) = { + 0, 1, 3, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, + 2, 4, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 58, + 5, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 59, 61, + 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 60, 62, 63, +}; + +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_4x16[64]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_16x4[64]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_4x16[64]) = { + 0, 16, 32, 48, 1, 17, 33, 49, 2, 18, 34, 50, 3, 19, 35, 51, + 4, 20, 36, 52, 5, 21, 37, 53, 6, 22, 38, 54, 7, 23, 39, 55, + 8, 24, 40, 56, 9, 25, 41, 57, 10, 26, 42, 58, 11, 27, 43, 59, + 12, 28, 44, 60, 13, 29, 45, 61, 14, 30, 46, 62, 15, 31, 47, 63, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_16x4[64]) = { + 0, 16, 32, 48, 1, 17, 33, 49, 2, 18, 34, 50, 3, 19, 35, 51, + 4, 20, 36, 52, 5, 21, 37, 53, 6, 22, 38, 54, 7, 23, 39, 55, + 8, 24, 40, 56, 9, 25, 41, 57, 10, 26, 42, 58, 11, 27, 43, 59, + 12, 28, 44, 60, 13, 29, 45, 61, 14, 30, 46, 62, 15, 31, 47, 63, +}; +#endif // CONFIG_EXT_TX + +DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_8x32[256]) = { + 0, 1, 3, 6, 10, 15, 21, 28, 2, 4, 7, 11, 16, 22, 29, + 36, 5, 8, 12, 17, 23, 30, 37, 44, 9, 13, 18, 24, 31, 38, + 45, 52, 14, 19, 25, 32, 39, 46, 53, 60, 20, 26, 33, 40, 47, + 54, 61, 68, 27, 34, 41, 48, 55, 62, 69, 76, 35, 42, 49, 56, + 63, 70, 77, 84, 43, 50, 57, 64, 71, 78, 85, 92, 51, 58, 65, + 72, 79, 86, 93, 100, 59, 66, 73, 80, 87, 94, 101, 108, 67, 74, + 81, 88, 95, 102, 109, 116, 75, 82, 89, 96, 103, 110, 117, 124, 83, + 90, 97, 104, 111, 118, 125, 132, 91, 98, 105, 112, 119, 126, 133, 140, + 99, 106, 113, 120, 127, 134, 141, 148, 107, 114, 121, 128, 135, 142, 149, + 156, 115, 122, 129, 136, 143, 150, 157, 164, 123, 130, 137, 144, 151, 158, + 165, 172, 131, 138, 145, 152, 159, 166, 173, 180, 139, 146, 153, 160, 167, + 174, 181, 188, 147, 154, 161, 168, 175, 182, 189, 196, 155, 162, 169, 176, + 183, 190, 197, 204, 163, 170, 177, 184, 191, 198, 205, 212, 171, 178, 185, + 192, 199, 206, 213, 220, 179, 186, 193, 200, 207, 214, 221, 228, 187, 194, + 201, 208, 215, 222, 229, 235, 195, 202, 209, 216, 223, 230, 236, 241, 203, + 210, 217, 224, 231, 237, 242, 246, 211, 218, 225, 232, 238, 243, 247, 250, + 219, 226, 233, 239, 244, 248, 251, 253, 227, 234, 240, 245, 249, 252, 254, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_32x8[256]) = { + 0, 1, 3, 6, 10, 15, 21, 28, 36, 44, 52, 60, 68, 76, 84, + 92, 100, 108, 116, 124, 132, 140, 148, 156, 164, 172, 180, 188, 196, 204, + 212, 220, 2, 4, 7, 11, 16, 22, 29, 37, 45, 53, 61, 69, 77, + 85, 93, 101, 109, 117, 125, 133, 141, 149, 157, 165, 173, 181, 189, 197, + 205, 213, 221, 228, 5, 8, 12, 17, 23, 30, 38, 46, 54, 62, 70, + 78, 86, 94, 102, 110, 118, 126, 134, 142, 150, 158, 166, 174, 182, 190, + 198, 206, 214, 222, 229, 235, 9, 13, 18, 24, 31, 39, 47, 55, 63, + 71, 79, 87, 95, 103, 111, 119, 127, 135, 143, 151, 159, 167, 175, 183, + 191, 199, 207, 215, 223, 230, 236, 241, 14, 19, 25, 32, 40, 48, 56, + 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, + 184, 192, 200, 208, 216, 224, 231, 237, 242, 246, 20, 26, 33, 41, 49, + 57, 65, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145, 153, 161, 169, + 177, 185, 193, 201, 209, 217, 225, 232, 238, 243, 247, 250, 27, 34, 42, + 50, 58, 66, 74, 82, 90, 98, 106, 114, 122, 130, 138, 146, 154, 162, + 170, 178, 186, 194, 202, 210, 218, 226, 233, 239, 244, 248, 251, 253, 35, + 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 123, 131, 139, 147, 155, + 163, 171, 179, 187, 195, 203, 211, 219, 227, 234, 240, 245, 249, 252, 254, + 255, +}; + +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_8x32[256]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_32x8[256]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_8x32[256]) = { + 0, 32, 64, 96, 128, 160, 192, 224, 1, 33, 65, 97, 129, 161, 193, 225, + 2, 34, 66, 98, 130, 162, 194, 226, 3, 35, 67, 99, 131, 163, 195, 227, + 4, 36, 68, 100, 132, 164, 196, 228, 5, 37, 69, 101, 133, 165, 197, 229, + 6, 38, 70, 102, 134, 166, 198, 230, 7, 39, 71, 103, 135, 167, 199, 231, + 8, 40, 72, 104, 136, 168, 200, 232, 9, 41, 73, 105, 137, 169, 201, 233, + 10, 42, 74, 106, 138, 170, 202, 234, 11, 43, 75, 107, 139, 171, 203, 235, + 12, 44, 76, 108, 140, 172, 204, 236, 13, 45, 77, 109, 141, 173, 205, 237, + 14, 46, 78, 110, 142, 174, 206, 238, 15, 47, 79, 111, 143, 175, 207, 239, + 16, 48, 80, 112, 144, 176, 208, 240, 17, 49, 81, 113, 145, 177, 209, 241, + 18, 50, 82, 114, 146, 178, 210, 242, 19, 51, 83, 115, 147, 179, 211, 243, + 20, 52, 84, 116, 148, 180, 212, 244, 21, 53, 85, 117, 149, 181, 213, 245, + 22, 54, 86, 118, 150, 182, 214, 246, 23, 55, 87, 119, 151, 183, 215, 247, + 24, 56, 88, 120, 152, 184, 216, 248, 25, 57, 89, 121, 153, 185, 217, 249, + 26, 58, 90, 122, 154, 186, 218, 250, 27, 59, 91, 123, 155, 187, 219, 251, + 28, 60, 92, 124, 156, 188, 220, 252, 29, 61, 93, 125, 157, 189, 221, 253, + 30, 62, 94, 126, 158, 190, 222, 254, 31, 63, 95, 127, 159, 191, 223, 255, +}; + +DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_32x8[256]) = { + 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, + 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, + 240, 248, 1, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, + 105, 113, 121, 129, 137, 145, 153, 161, 169, 177, 185, 193, 201, 209, 217, + 225, 233, 241, 249, 2, 10, 18, 26, 34, 42, 50, 58, 66, 74, 82, + 90, 98, 106, 114, 122, 130, 138, 146, 154, 162, 170, 178, 186, 194, 202, + 210, 218, 226, 234, 242, 250, 3, 11, 19, 27, 35, 43, 51, 59, 67, + 75, 83, 91, 99, 107, 115, 123, 131, 139, 147, 155, 163, 171, 179, 187, + 195, 203, 211, 219, 227, 235, 243, 251, 4, 12, 20, 28, 36, 44, 52, + 60, 68, 76, 84, 92, 100, 108, 116, 124, 132, 140, 148, 156, 164, 172, + 180, 188, 196, 204, 212, 220, 228, 236, 244, 252, 5, 13, 21, 29, 37, + 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 149, 157, + 165, 173, 181, 189, 197, 205, 213, 221, 229, 237, 245, 253, 6, 14, 22, + 30, 38, 46, 54, 62, 70, 78, 86, 94, 102, 110, 118, 126, 134, 142, + 150, 158, 166, 174, 182, 190, 198, 206, 214, 222, 230, 238, 246, 254, 7, + 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127, + 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239, 247, + 255, +}; +#endif // CONFIG_EXT_TX + #if CONFIG_EXT_TX DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_8x8[64]) = { 0, 8, 16, 24, 32, 40, 48, 56, 1, 9, 17, 25, 33, 41, 49, 57, @@ -5590,7 +6231,127 @@ const SCAN_ORDER av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = { { mrow_scan_32x16, av1_mrow_iscan_32x16, mrow_scan_32x16_neighbors }, { mcol_scan_32x16, av1_mcol_iscan_32x16, mcol_scan_32x16_neighbors }, #endif // CONFIG_EXT_TX - } + }, + { + // TX_4X16 + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, +#if CONFIG_EXT_TX + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { default_scan_4x16, av1_default_iscan_4x16, + default_scan_4x16_neighbors }, + { mrow_scan_4x16, av1_mrow_iscan_4x16, mrow_scan_4x16_neighbors }, + { mrow_scan_4x16, av1_mrow_iscan_4x16, mrow_scan_4x16_neighbors }, + { mcol_scan_4x16, av1_mcol_iscan_4x16, mcol_scan_4x16_neighbors }, + { mrow_scan_4x16, av1_mrow_iscan_4x16, mrow_scan_4x16_neighbors }, + { mcol_scan_4x16, av1_mcol_iscan_4x16, mcol_scan_4x16_neighbors }, + { mrow_scan_4x16, av1_mrow_iscan_4x16, mrow_scan_4x16_neighbors }, + { mcol_scan_4x16, av1_mcol_iscan_4x16, mcol_scan_4x16_neighbors }, +#endif // CONFIG_EXT_TX + }, + { + // TX_16X4 + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, +#if CONFIG_EXT_TX + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { default_scan_16x4, av1_default_iscan_16x4, + default_scan_16x4_neighbors }, + { mrow_scan_16x4, av1_mrow_iscan_16x4, mrow_scan_16x4_neighbors }, + { mrow_scan_16x4, av1_mrow_iscan_16x4, mrow_scan_16x4_neighbors }, + { mcol_scan_16x4, av1_mcol_iscan_16x4, mcol_scan_16x4_neighbors }, + { mrow_scan_16x4, av1_mrow_iscan_16x4, mrow_scan_16x4_neighbors }, + { mcol_scan_16x4, av1_mcol_iscan_16x4, mcol_scan_16x4_neighbors }, + { mrow_scan_16x4, av1_mrow_iscan_16x4, mrow_scan_16x4_neighbors }, + { mcol_scan_16x4, av1_mcol_iscan_16x4, mcol_scan_16x4_neighbors }, +#endif // CONFIG_EXT_TX + }, + { + // TX_8X32 + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, +#if CONFIG_EXT_TX + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { default_scan_8x32, av1_default_iscan_8x32, + default_scan_8x32_neighbors }, + { mrow_scan_8x32, av1_mrow_iscan_8x32, mrow_scan_8x32_neighbors }, + { mrow_scan_8x32, av1_mrow_iscan_8x32, mrow_scan_8x32_neighbors }, + { mcol_scan_8x32, av1_mcol_iscan_8x32, mcol_scan_8x32_neighbors }, + { mrow_scan_8x32, av1_mrow_iscan_8x32, mrow_scan_8x32_neighbors }, + { mcol_scan_8x32, av1_mcol_iscan_8x32, mcol_scan_8x32_neighbors }, + { mrow_scan_8x32, av1_mrow_iscan_8x32, mrow_scan_8x32_neighbors }, + { mcol_scan_8x32, av1_mcol_iscan_8x32, mcol_scan_8x32_neighbors }, +#endif // CONFIG_EXT_TX + }, + { + // TX_32X8 + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, +#if CONFIG_EXT_TX + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { default_scan_32x8, av1_default_iscan_32x8, + default_scan_32x8_neighbors }, + { mrow_scan_32x8, av1_mrow_iscan_32x8, mrow_scan_32x8_neighbors }, + { mrow_scan_32x8, av1_mrow_iscan_32x8, mrow_scan_32x8_neighbors }, + { mcol_scan_32x8, av1_mcol_iscan_32x8, mcol_scan_32x8_neighbors }, + { mrow_scan_32x8, av1_mrow_iscan_32x8, mrow_scan_32x8_neighbors }, + { mcol_scan_32x8, av1_mcol_iscan_32x8, mcol_scan_32x8_neighbors }, + { mrow_scan_32x8, av1_mrow_iscan_32x8, mrow_scan_32x8_neighbors }, + { mcol_scan_32x8, av1_mcol_iscan_32x8, mcol_scan_32x8_neighbors }, +#endif // CONFIG_EXT_TX + }, }; #if CONFIG_ADAPT_SCAN