From 720814572268a9c3cb89d25381040f8ba81aa9bc Mon Sep 17 00:00:00 2001 From: Debargha Mukherjee Date: Fri, 22 Jul 2016 08:55:42 -0700 Subject: [PATCH] Adding 8x16/16x8/32x16/16x32 transforms Adds forward, inverse transforms and scan orders. Change-Id: Iab6994f4b0ef65e660b714d111b79b1c8172d6a8 --- vp10/common/common_data.h | 58 +- vp10/common/entropy.c | 16 +- vp10/common/entropy.h | 20 +- vp10/common/enums.h | 10 +- vp10/common/idct.c | 640 ++++++++++-- vp10/common/scan.c | 1765 +++++++++++++++++++++++++++++--- vp10/common/vp10_rtcd_defs.pl | 128 ++- vp10/encoder/dct.c | 249 ++++- vp10/encoder/hybrid_fwd_txfm.c | 123 ++- vp10/encoder/rd.c | 44 +- vp10/encoder/rdopt.c | 16 + 11 files changed, 2804 insertions(+), 265 deletions(-) diff --git a/vp10/common/common_data.h b/vp10/common/common_data.h index cb11822d1..084c825e3 100644 --- a/vp10/common/common_data.h +++ b/vp10/common/common_data.h @@ -60,41 +60,41 @@ static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES] = { 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, IF_EXT_PARTITION(8, 4, 8) }; -static const uint8_t num_4x4_blocks_txsize_lookup[TX_SIZES_ALL] = { 1, 4, - 16, 64, +static const uint8_t num_4x4_blocks_txsize_lookup[TX_SIZES_ALL] = { + 1, 4, 16, 64, #if CONFIG_EXT_TX - 2, 2 + 2, 2, 8, 8, 32, 32 #endif // CONFIG_EXT_TX }; -static const uint8_t num_4x4_blocks_wide_txsize_lookup[TX_SIZES_ALL] = { 1, 2, - 4, 8, +static const uint8_t num_4x4_blocks_wide_txsize_lookup[TX_SIZES_ALL] = { + 1, 2, 4, 8, #if CONFIG_EXT_TX - 1, 2 + 1, 2, 2, 4, 4, 8 #endif // CONFIG_EXT_TX }; -static const uint8_t num_4x4_blocks_high_txsize_lookup[TX_SIZES_ALL] = { 1, 2, - 4, 8, +static const uint8_t num_4x4_blocks_high_txsize_lookup[TX_SIZES_ALL] = { + 1, 2, 4, 8, #if CONFIG_EXT_TX - 2, 1 + 2, 1, 4, 2, 8, 4 #endif // CONFIG_EXT_TX }; -static const uint8_t num_4x4_blocks_txsize_log2_lookup[TX_SIZES_ALL] = { 0, 2, - 4, 6, +static const uint8_t num_4x4_blocks_txsize_log2_lookup[TX_SIZES_ALL] = { + 0, 2, 4, 6, #if CONFIG_EXT_TX - 1, 1 + 1, 1, 3, 3, 5, 5 #endif // CONFIG_EXT_TX }; static const uint8_t num_4x4_blocks_wide_txsize_log2_lookup[TX_SIZES_ALL] = { 0, 1, 2, 3, #if CONFIG_EXT_TX - 0, 1 + 0, 1, 1, 2, 2, 3 #endif // CONFIG_EXT_TX }; static const uint8_t num_4x4_blocks_high_txsize_log2_lookup[TX_SIZES_ALL] = { 0, 1, 2, 3, #if CONFIG_EXT_TX - 1, 0 + 1, 0, 2, 1, 3, 2 #endif // CONFIG_EXT_TX }; @@ -374,9 +374,13 @@ static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = { BLOCK_16X16, // TX_16X16 BLOCK_32X32, // TX_32X32 #if CONFIG_EXT_TX - BLOCK_4X8, // TX_4X8 - BLOCK_8X4, // TX_8X4 -#endif // CONFIG_EXT_TX + BLOCK_4X8, // TX_4X8 + BLOCK_8X4, // TX_8X4 + BLOCK_8X16, // TX_8X16 + BLOCK_16X8, // TX_16X8 + BLOCK_16X32, // TX_16X32 + BLOCK_32X16, // TX_32X16 +#endif // CONFIG_EXT_TX }; static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = { @@ -385,9 +389,13 @@ static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = { TX_16X16, // TX_16X16 TX_32X32, // TX_32X32 #if CONFIG_EXT_TX - TX_4X4, // TX_4X8 - TX_4X4, // TX_8X4 -#endif // CONFIG_EXT_TX + TX_4X4, // TX_4X8 + TX_4X4, // TX_8X4 + TX_8X8, // TX_8X16 + TX_8X8, // TX_16X8 + TX_16X16, // TX_16X32 + TX_16X16, // TX_32X16 +#endif // CONFIG_EXT_TX }; static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = { @@ -396,9 +404,13 @@ static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = { TX_16X16, // TX_16X16 TX_32X32, // TX_32X32 #if CONFIG_EXT_TX - TX_8X8, // TX_4X8 - TX_8X8, // TX_8X4 -#endif // CONFIG_EXT_TX + TX_8X8, // TX_4X8 + TX_8X8, // TX_8X4 + TX_16X16, // TX_8X16 + TX_16X16, // TX_16X8 + TX_32X32, // TX_16X32 + TX_32X32, // TX_32X16 +#endif // CONFIG_EXT_TX }; static const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = { diff --git a/vp10/common/entropy.c b/vp10/common/entropy.c index 4f51c53da..aa9c68cb7 100644 --- a/vp10/common/entropy.c +++ b/vp10/common/entropy.c @@ -59,7 +59,12 @@ const uint16_t band_count_table[TX_SIZES_ALL][8] = { { 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 }, #if CONFIG_EXT_TX - { 1, 2, 3, 4, 8, 32 - 18, 0 }, { 1, 2, 3, 4, 8, 32 - 18, 0 }, + { 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 }, #endif // CONFIG_EXT_TX }; @@ -67,7 +72,12 @@ const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = { { 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 }, #if CONFIG_EXT_TX - { 0, 1, 3, 6, 10, 18, 32, 0 }, { 0, 1, 3, 6, 10, 18, 32, 0 }, + { 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 }, #endif // CONFIG_EXT_TX }; @@ -116,7 +126,7 @@ const uint8_t vp10_coefband_trans_8x8plus[1024] = { }; #if CONFIG_EXT_TX -const uint8_t vp10_coefband_trans_8x4_4x8[32] = { +const uint8_t vp10_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, }; diff --git a/vp10/common/entropy.h b/vp10/common/entropy.h index 19ff33526..917f5b017 100644 --- a/vp10/common/entropy.h +++ b/vp10/common/entropy.h @@ -156,7 +156,7 @@ void vp10_partial_adapt_probs(struct VP10Common *cm, int mi_row, int mi_col); DECLARE_ALIGNED(16, extern const uint8_t, vp10_coefband_trans_8x8plus[1024]); #if CONFIG_EXT_TX -DECLARE_ALIGNED(16, extern const uint8_t, vp10_coefband_trans_8x4_4x8[32]); +DECLARE_ALIGNED(16, extern const uint8_t, vp10_coefband_trans_4x8_8x4[32]); #endif // CONFIG_EXT_TX DECLARE_ALIGNED(16, extern const uint8_t, vp10_coefband_trans_4x4[16]); @@ -169,7 +169,7 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) { case TX_4X4: return vp10_coefband_trans_4x4; #if CONFIG_EXT_TX case TX_4X8: - case TX_8X4: return vp10_coefband_trans_8x4_4x8; + return vp10_coefband_trans_4x8_8x4; #endif // CONFIG_EXT_TX default: return vp10_coefband_trans_8x8plus; } @@ -228,6 +228,22 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, above_ec = !!*(const uint16_t *)a; left_ec = l[0] != 0; break; + case TX_8X16: + above_ec = !!*(const uint16_t *)a; + left_ec = !!*(const uint32_t *)l; + break; + case TX_16X8: + above_ec = !!*(const uint32_t *)a; + left_ec = !!*(const uint16_t *)l; + break; + case TX_16X32: + above_ec = !!*(const uint32_t *)a; + left_ec = !!*(const uint64_t *)l; + break; + case TX_32X16: + above_ec = !!*(const uint64_t *)a; + left_ec = !!*(const uint32_t *)l; + break; #endif // CONFIG_EXT_TX case TX_8X8: above_ec = !!*(const uint16_t *)a; diff --git a/vp10/common/enums.h b/vp10/common/enums.h index e02fa0c80..60fa43ee5 100644 --- a/vp10/common/enums.h +++ b/vp10/common/enums.h @@ -138,9 +138,13 @@ typedef uint8_t TX_SIZE; #define TX_SIZES ((TX_SIZE)4) #if CONFIG_EXT_TX -#define TX_4X8 ((TX_SIZE)4) // 4x8 transform -#define TX_8X4 ((TX_SIZE)5) // 8x4 transform -#define TX_SIZES_ALL ((TX_SIZE)6) // Includes rectangular transforms +#define TX_4X8 ((TX_SIZE)4) // 4x8 transform +#define TX_8X4 ((TX_SIZE)5) // 8x4 transform +#define TX_8X16 ((TX_SIZE)6) // 8x16 transform +#define TX_16X8 ((TX_SIZE)7) // 16x8 transform +#define TX_16X32 ((TX_SIZE)8) // 16x32 transform +#define TX_32X16 ((TX_SIZE)9) // 32x16 transform +#define TX_SIZES_ALL ((TX_SIZE)10) // Includes rectangular transforms #else #define TX_SIZES_ALL ((TX_SIZE)4) #endif // CONFIG_EXT_TX diff --git a/vp10/common/idct.c b/vp10/common/idct.c index 5f05b7038..c3add18d6 100644 --- a/vp10/common/idct.c +++ b/vp10/common/idct.c @@ -540,6 +540,7 @@ void vp10_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride, } } +#if CONFIG_EXT_TX void vp10_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type) { static const transform_2d IHT_4x8[] = { @@ -547,9 +548,8 @@ void vp10_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iadst8_c, idct4_c }, // ADST_DCT { idct8_c, iadst4_c }, // DCT_ADST { iadst8_c, iadst4_c }, // ADST_ADST -#if CONFIG_EXT_TX - { iadst8_c, idct4_c }, // FLIPADST_DCT - { idct8_c, iadst4_c }, // DCT_FLIPADST + { iadst8_c, idct4_c }, // FLIPADST_DCT + { idct8_c, iadst4_c }, // DCT_FLIPADST { iadst8_c, iadst4_c }, // FLIPADST_FLIPADST { iadst8_c, iadst4_c }, // ADST_FLIPADST { iadst8_c, iadst4_c }, // FLIPADST_ADST @@ -560,34 +560,33 @@ void vp10_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx8_c, iadst4_c }, // H_ADST { iadst8_c, iidtx4_c }, // V_FLIPADST { iidtx8_c, iadst4_c }, // H_FLIPADST -#endif // CONFIG_EXT_TX }; + const int n = 4; + const int n2 = 8; int i, j; tran_low_t out[4][8], outtmp[4]; tran_low_t *outp = &out[0][0]; - int outstride = 8; + int outstride = n2; // inverse transform row vectors and transpose - for (i = 0; i < 8; ++i) { + for (i = 0; i < n2; ++i) { IHT_4x8[tx_type].rows(input, outtmp); - for (j = 0; j < 4; ++j) + for (j = 0; j < n; ++j) out[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2); - input += 4; + input += n; } // inverse transform column vectors - for (i = 0; i < 4; ++i) { + for (i = 0; i < n; ++i) { IHT_4x8[tx_type].cols(out[i], out[i]); } -#if CONFIG_EXT_TX - maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, 8, 4); -#endif + maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n2, n); // Sum with the destination - for (i = 0; i < 8; ++i) { - for (j = 0; j < 4; ++j) { + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) { int d = i * stride + j; int s = j * outstride + i; dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 5)); @@ -602,9 +601,8 @@ void vp10_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iadst4_c, idct8_c }, // ADST_DCT { idct4_c, iadst8_c }, // DCT_ADST { iadst4_c, iadst8_c }, // ADST_ADST -#if CONFIG_EXT_TX - { iadst4_c, idct8_c }, // FLIPADST_DCT - { idct4_c, iadst8_c }, // DCT_FLIPADST + { iadst4_c, idct8_c }, // FLIPADST_DCT + { idct4_c, iadst8_c }, // DCT_FLIPADST { iadst4_c, iadst8_c }, // FLIPADST_FLIPADST { iadst4_c, iadst8_c }, // ADST_FLIPADST { iadst4_c, iadst8_c }, // FLIPADST_ADST @@ -615,34 +613,33 @@ void vp10_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, { iidtx4_c, iadst8_c }, // H_ADST { iadst4_c, iidtx8_c }, // V_FLIPADST { iidtx4_c, iadst8_c }, // H_FLIPADST -#endif // CONFIG_EXT_TX }; + const int n = 4; + const int n2 = 8; int i, j; tran_low_t out[8][4], outtmp[8]; tran_low_t *outp = &out[0][0]; - int outstride = 4; + int outstride = n; // inverse transform row vectors and transpose - for (i = 0; i < 4; ++i) { + for (i = 0; i < n; ++i) { IHT_8x4[tx_type].rows(input, outtmp); - for (j = 0; j < 8; ++j) + for (j = 0; j < n2; ++j) out[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2); - input += 8; + input += n2; } // inverse transform column vectors - for (i = 0; i < 8; ++i) { + for (i = 0; i < n2; ++i) { IHT_8x4[tx_type].cols(out[i], out[i]); } -#if CONFIG_EXT_TX - maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, 4, 8); -#endif + maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n, n2); // Sum with the destination - for (i = 0; i < 4; ++i) { - for (j = 0; j < 8; ++j) { + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) { int d = i * stride + j; int s = j * outstride + i; dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 5)); @@ -650,6 +647,219 @@ void vp10_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest, int stride, } } +void vp10_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest, + int stride, int tx_type) { + static const transform_2d IHT_8x16[] = { + { idct16_c, idct8_c }, // DCT_DCT + { iadst16_c, idct8_c }, // ADST_DCT + { idct16_c, iadst8_c }, // DCT_ADST + { iadst16_c, iadst8_c }, // ADST_ADST + { iadst16_c, idct8_c }, // FLIPADST_DCT + { idct16_c, iadst8_c }, // DCT_FLIPADST + { iadst16_c, iadst8_c }, // FLIPADST_FLIPADST + { iadst16_c, iadst8_c }, // ADST_FLIPADST + { iadst16_c, iadst8_c }, // FLIPADST_ADST + { iidtx16_c, iidtx8_c }, // IDTX + { idct16_c, iidtx8_c }, // V_DCT + { iidtx16_c, idct8_c }, // H_DCT + { iadst16_c, iidtx8_c }, // V_ADST + { iidtx16_c, iadst8_c }, // H_ADST + { iadst16_c, iidtx8_c }, // V_FLIPADST + { iidtx16_c, iadst8_c }, // H_FLIPADST + }; + + const int n = 8; + const int n2 = 16; + int i, j; + tran_low_t out[8][16], outtmp[8]; + tran_low_t *outp = &out[0][0]; + int outstride = n2; + + // inverse transform row vectors and transpose + for (i = 0; i < n2; ++i) { + IHT_8x16[tx_type].rows(input, outtmp); + for (j = 0; j < n; ++j) + out[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2); + input += n; + } + + // inverse transform column vectors + for (i = 0; i < n; ++i) { + IHT_8x16[tx_type].cols(out[i], out[i]); + } + + maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n2, n); + + // Sum with the destination + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 6)); + } + } +} + +void vp10_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest, + int stride, int tx_type) { + static const transform_2d IHT_16x8[] = { + { idct8_c, idct16_c }, // DCT_DCT + { iadst8_c, idct16_c }, // ADST_DCT + { idct8_c, iadst16_c }, // DCT_ADST + { iadst8_c, iadst16_c }, // ADST_ADST + { iadst8_c, idct16_c }, // FLIPADST_DCT + { idct8_c, iadst16_c }, // DCT_FLIPADST + { iadst8_c, iadst16_c }, // FLIPADST_FLIPADST + { iadst8_c, iadst16_c }, // ADST_FLIPADST + { iadst8_c, iadst16_c }, // FLIPADST_ADST + { iidtx8_c, iidtx16_c }, // IDTX + { idct8_c, iidtx16_c }, // V_DCT + { iidtx8_c, idct16_c }, // H_DCT + { iadst8_c, iidtx16_c }, // V_ADST + { iidtx8_c, iadst16_c }, // H_ADST + { iadst8_c, iidtx16_c }, // V_FLIPADST + { iidtx8_c, iadst16_c }, // H_FLIPADST + }; + const int n = 8; + const int n2 = 16; + + int i, j; + tran_low_t out[16][8], outtmp[16]; + tran_low_t *outp = &out[0][0]; + int outstride = n; + + // inverse transform row vectors and transpose + for (i = 0; i < n; ++i) { + IHT_16x8[tx_type].rows(input, outtmp); + for (j = 0; j < n2; ++j) + out[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2); + input += n2; + } + + // inverse transform column vectors + for (i = 0; i < n2; ++i) { + IHT_16x8[tx_type].cols(out[i], out[i]); + } + + maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n, n2); + + // Sum with the destination + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 6)); + } + } +} + +void vp10_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest, + int stride, int tx_type) { + static const transform_2d IHT_16x32[] = { + { idct32_c, idct16_c }, // DCT_DCT + { ihalfright32_c, idct16_c }, // ADST_DCT + { idct32_c, iadst16_c }, // DCT_ADST + { ihalfright32_c, iadst16_c }, // ADST_ADST + { ihalfright32_c, idct16_c }, // FLIPADST_DCT + { idct32_c, iadst16_c }, // DCT_FLIPADST + { ihalfright32_c, iadst16_c }, // FLIPADST_FLIPADST + { ihalfright32_c, iadst16_c }, // ADST_FLIPADST + { ihalfright32_c, iadst16_c }, // FLIPADST_ADST + { iidtx32_c, iidtx16_c }, // IDTX + { idct32_c, iidtx16_c }, // V_DCT + { iidtx32_c, idct16_c }, // H_DCT + { ihalfright32_c, iidtx16_c }, // V_ADST + { iidtx32_c, iadst16_c }, // H_ADST + { ihalfright32_c, iidtx16_c }, // V_FLIPADST + { iidtx32_c, iadst16_c }, // H_FLIPADST + }; + + const int n = 16; + const int n2 = 32; + int i, j; + tran_low_t out[16][32], outtmp[16]; + tran_low_t *outp = &out[0][0]; + int outstride = n2; + + // inverse transform row vectors and transpose + for (i = 0; i < n2; ++i) { + IHT_16x32[tx_type].rows(input, outtmp); + for (j = 0; j < n; ++j) + out[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2); + input += n; + } + + // inverse transform column vectors + for (i = 0; i < n; ++i) { + IHT_16x32[tx_type].cols(out[i], out[i]); + } + + maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n2, n); + + // Sum with the destination + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 6)); + } + } +} + +void vp10_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest, + int stride, int tx_type) { + static const transform_2d IHT_32x16[] = { + { idct16_c, idct32_c }, // DCT_DCT + { iadst16_c, idct32_c }, // ADST_DCT + { idct16_c, ihalfright32_c }, // DCT_ADST + { iadst16_c, ihalfright32_c }, // ADST_ADST + { iadst16_c, idct32_c }, // FLIPADST_DCT + { idct16_c, ihalfright32_c }, // DCT_FLIPADST + { iadst16_c, ihalfright32_c }, // FLIPADST_FLIPADST + { iadst16_c, ihalfright32_c }, // ADST_FLIPADST + { iadst16_c, ihalfright32_c }, // FLIPADST_ADST + { iidtx16_c, iidtx32_c }, // IDTX + { idct16_c, iidtx32_c }, // V_DCT + { iidtx16_c, idct32_c }, // H_DCT + { iadst16_c, iidtx32_c }, // V_ADST + { iidtx16_c, ihalfright32_c }, // H_ADST + { iadst16_c, iidtx32_c }, // V_FLIPADST + { iidtx16_c, ihalfright32_c }, // H_FLIPADST + }; + const int n = 16; + const int n2 = 32; + + int i, j; + tran_low_t out[32][16], outtmp[32]; + tran_low_t *outp = &out[0][0]; + int outstride = n; + + // inverse transform row vectors and transpose + for (i = 0; i < n; ++i) { + IHT_32x16[tx_type].rows(input, outtmp); + for (j = 0; j < n2; ++j) + out[j][i] = (tran_low_t)dct_const_round_shift(outtmp[j] * Sqrt2); + input += n2; + } + + // inverse transform column vectors + for (i = 0; i < n2; ++i) { + IHT_32x16[tx_type].cols(out[i], out[i]); + } + + maybe_flip_strides(&dest, &stride, &outp, &outstride, tx_type, n, n2); + + // Sum with the destination + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = clip_pixel_add(dest[d], ROUND_POWER_OF_TWO(outp[s], 6)); + } + } +} +#endif // CONFIG_EXT_TX + void vp10_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type) { static const transform_2d IHT_8[] = { @@ -930,16 +1140,40 @@ void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride, } #if CONFIG_EXT_TX -void vp10_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride, - int eob, TX_TYPE tx_type) { - (void)eob; +void vp10_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, + int stride, int eob, TX_TYPE tx_type) { + (void) eob; + vp10_iht4x8_32_add(input, dest, stride, tx_type); +} + +void vp10_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, + int stride, int eob, TX_TYPE tx_type) { + (void) eob; vp10_iht8x4_32_add(input, dest, stride, tx_type); } -void vp10_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride, - int eob, TX_TYPE tx_type) { - (void)eob; - vp10_iht4x8_32_add(input, dest, stride, tx_type); +void vp10_inv_txfm_add_8x16(const tran_low_t *input, uint8_t *dest, + int stride, int eob, TX_TYPE tx_type) { + (void) eob; + vp10_iht8x16_128_add(input, dest, stride, tx_type); +} + +void vp10_inv_txfm_add_16x8(const tran_low_t *input, uint8_t *dest, + int stride, int eob, TX_TYPE tx_type) { + (void) eob; + vp10_iht16x8_128_add(input, dest, stride, tx_type); +} + +void vp10_inv_txfm_add_16x32(const tran_low_t *input, uint8_t *dest, + int stride, int eob, TX_TYPE tx_type) { + (void) eob; + vp10_iht16x32_512_add(input, dest, stride, tx_type); +} + +void vp10_inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest, + int stride, int eob, TX_TYPE tx_type) { + (void) eob; + vp10_iht32x16_512_add(input, dest, stride, tx_type); } #endif // CONFIG_EXT_TX @@ -1116,34 +1350,36 @@ void vp10_highbd_iht4x8_32_add_c(const tran_low_t *input, uint8_t *dest8, { vpx_highbd_iadst8_c, highbd_iidtx4_c }, // V_FLIPADST { highbd_iidtx8_c, vpx_highbd_iadst4_c }, // H_FLIPADST }; + const int n = 4; + const int n2 = 8; uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); int i, j; tran_low_t out[4][8], outtmp[4]; tran_low_t *outp = &out[0][0]; - int outstride = 8; + int outstride = n2; // inverse transform row vectors, and transpose - for (i = 0; i < 8; ++i) { + for (i = 0; i < n2; ++i) { HIGH_IHT_4x8[tx_type].rows(input, outtmp, bd); - for (j = 0; j < 4; ++j) { - out[j][i] = - HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); + for (j = 0; j < n; ++j) { + out[j][i] = HIGHBD_WRAPLOW( + highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); } - input += 4; + input += n; } // inverse transform column vectors - for (i = 0; i < 4; ++i) { + for (i = 0; i < n; ++i) { HIGH_IHT_4x8[tx_type].cols(out[i], out[i], bd); } - maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, 8, 4); + maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, n2, n); // Sum with the destination - for (i = 0; i < 8; ++i) { - for (j = 0; j < 4; ++j) { + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) { int d = i * stride + j; int s = j * outstride + i; dest[d] = @@ -1172,34 +1408,36 @@ void vp10_highbd_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest8, { vpx_highbd_iadst4_c, highbd_iidtx8_c }, // V_FLIPADST { highbd_iidtx4_c, vpx_highbd_iadst8_c }, // H_FLIPADST }; + const int n = 4; + const int n2 = 8; uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); int i, j; tran_low_t out[8][4], outtmp[8]; tran_low_t *outp = &out[0][0]; - int outstride = 4; + int outstride = n; // inverse transform row vectors, and transpose - for (i = 0; i < 4; ++i) { + for (i = 0; i < n; ++i) { HIGH_IHT_8x4[tx_type].rows(input, outtmp, bd); - for (j = 0; j < 8; ++j) { - out[j][i] = - HIGHBD_WRAPLOW(highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); + for (j = 0; j < n2; ++j) { + out[j][i] = HIGHBD_WRAPLOW( + highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); } - input += 8; + input += n2; } // inverse transform column vectors - for (i = 0; i < 8; ++i) { + for (i = 0; i < n2; ++i) { HIGH_IHT_8x4[tx_type].cols(out[i], out[i], bd); } - maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, 4, 8); + maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, n, n2); // Sum with the destination - for (i = 0; i < 4; ++i) { - for (j = 0; j < 8; ++j) { + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) { int d = i * stride + j; int s = j * outstride + i; dest[d] = @@ -1207,6 +1445,234 @@ void vp10_highbd_iht8x4_32_add_c(const tran_low_t *input, uint8_t *dest8, } } } + +void vp10_highbd_iht8x16_128_add_c(const tran_low_t *input, uint8_t *dest8, + int stride, int tx_type, int bd) { + static const highbd_transform_2d HIGH_IHT_8x16[] = { + { vpx_highbd_idct16_c, vpx_highbd_idct8_c }, // DCT_DCT + { vpx_highbd_iadst16_c, vpx_highbd_idct8_c }, // ADST_DCT + { vpx_highbd_idct16_c, vpx_highbd_iadst8_c }, // DCT_ADST + { vpx_highbd_iadst16_c, vpx_highbd_iadst8_c }, // ADST_ADST + { vpx_highbd_iadst16_c, vpx_highbd_idct8_c }, // FLIPADST_DCT + { vpx_highbd_idct16_c, vpx_highbd_iadst8_c }, // DCT_FLIPADST + { vpx_highbd_iadst16_c, vpx_highbd_iadst8_c }, // FLIPADST_FLIPADST + { vpx_highbd_iadst16_c, vpx_highbd_iadst8_c }, // ADST_FLIPADST + { vpx_highbd_iadst16_c, vpx_highbd_iadst8_c }, // FLIPADST_ADST + { highbd_iidtx16_c, highbd_iidtx8_c }, // IDTX + { vpx_highbd_idct16_c, highbd_iidtx8_c }, // V_DCT + { highbd_iidtx16_c, vpx_highbd_idct8_c }, // H_DCT + { vpx_highbd_iadst16_c, highbd_iidtx8_c }, // V_ADST + { highbd_iidtx16_c, vpx_highbd_iadst8_c }, // H_ADST + { vpx_highbd_iadst16_c, highbd_iidtx8_c }, // V_FLIPADST + { highbd_iidtx16_c, vpx_highbd_iadst8_c }, // H_FLIPADST + }; + const int n = 8; + const int n2 = 16; + + uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); + + int i, j; + tran_low_t out[8][16], outtmp[8]; + tran_low_t *outp = &out[0][0]; + int outstride = n2; + + // inverse transform row vectors, and transpose + for (i = 0; i < n2; ++i) { + HIGH_IHT_8x16[tx_type].rows(input, outtmp, bd); + for (j = 0; j < n; ++j) + out[j][i] = HIGHBD_WRAPLOW( + highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); + input += n; + } + + // inverse transform column vectors + for (i = 0; i < n; ++i) { + HIGH_IHT_8x16[tx_type].cols(out[i], out[i], bd); + } + + maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, n2, n); + + // Sum with the destination + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = highbd_clip_pixel_add(dest[d], + ROUND_POWER_OF_TWO(outp[s], 6), bd); + } + } +} + +void vp10_highbd_iht16x8_128_add_c(const tran_low_t *input, uint8_t *dest8, + int stride, int tx_type, int bd) { + static const highbd_transform_2d HIGH_IHT_16x8[] = { + { vpx_highbd_idct8_c, vpx_highbd_idct16_c }, // DCT_DCT + { vpx_highbd_iadst8_c, vpx_highbd_idct16_c }, // ADST_DCT + { vpx_highbd_idct8_c, vpx_highbd_iadst16_c }, // DCT_ADST + { vpx_highbd_iadst8_c, vpx_highbd_iadst16_c }, // ADST_ADST + { vpx_highbd_iadst8_c, vpx_highbd_idct16_c }, // FLIPADST_DCT + { vpx_highbd_idct8_c, vpx_highbd_iadst16_c }, // DCT_FLIPADST + { vpx_highbd_iadst8_c, vpx_highbd_iadst16_c }, // FLIPADST_FLIPADST + { vpx_highbd_iadst8_c, vpx_highbd_iadst16_c }, // ADST_FLIPADST + { vpx_highbd_iadst8_c, vpx_highbd_iadst16_c }, // FLIPADST_ADST + { highbd_iidtx8_c, highbd_iidtx16_c }, // IDTX + { vpx_highbd_idct8_c, highbd_iidtx16_c }, // V_DCT + { highbd_iidtx8_c, vpx_highbd_idct16_c }, // H_DCT + { vpx_highbd_iadst8_c, highbd_iidtx16_c }, // V_ADST + { highbd_iidtx8_c, vpx_highbd_iadst16_c }, // H_ADST + { vpx_highbd_iadst8_c, highbd_iidtx16_c }, // V_FLIPADST + { highbd_iidtx8_c, vpx_highbd_iadst16_c }, // H_FLIPADST + }; + const int n = 8; + const int n2 = 16; + + uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); + + int i, j; + tran_low_t out[16][8], outtmp[16]; + tran_low_t *outp = &out[0][0]; + int outstride = n; + + // inverse transform row vectors, and transpose + for (i = 0; i < n; ++i) { + HIGH_IHT_16x8[tx_type].rows(input, outtmp, bd); + for (j = 0; j < n2; ++j) + out[j][i] = HIGHBD_WRAPLOW( + highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); + input += n2; + } + + // inverse transform column vectors + for (i = 0; i < n2; ++i) { + HIGH_IHT_16x8[tx_type].cols(out[i], out[i], bd); + } + + maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, n, n2); + + // Sum with the destination + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = highbd_clip_pixel_add(dest[d], + ROUND_POWER_OF_TWO(outp[s], 6), bd); + } + } +} + +void vp10_highbd_iht16x32_512_add_c(const tran_low_t *input, uint8_t *dest8, + int stride, int tx_type, int bd) { + static const highbd_transform_2d HIGH_IHT_16x32[] = { + { vpx_highbd_idct32_c, vpx_highbd_idct16_c }, // DCT_DCT + { highbd_ihalfright32_c, vpx_highbd_idct16_c }, // ADST_DCT + { vpx_highbd_idct32_c, vpx_highbd_iadst16_c }, // DCT_ADST + { highbd_ihalfright32_c, vpx_highbd_iadst16_c }, // ADST_ADST + { highbd_ihalfright32_c, vpx_highbd_idct16_c }, // FLIPADST_DCT + { vpx_highbd_idct32_c, vpx_highbd_iadst16_c }, // DCT_FLIPADST + { highbd_ihalfright32_c, vpx_highbd_iadst16_c }, // FLIPADST_FLIPADST + { highbd_ihalfright32_c, vpx_highbd_iadst16_c }, // ADST_FLIPADST + { highbd_ihalfright32_c, vpx_highbd_iadst16_c }, // FLIPADST_ADST + { highbd_iidtx32_c, highbd_iidtx16_c }, // IDTX + { vpx_highbd_idct32_c, highbd_iidtx16_c }, // V_DCT + { highbd_iidtx32_c, vpx_highbd_idct16_c }, // H_DCT + { highbd_ihalfright32_c, highbd_iidtx16_c }, // V_ADST + { highbd_iidtx32_c, vpx_highbd_iadst16_c }, // H_ADST + { highbd_ihalfright32_c, highbd_iidtx16_c }, // V_FLIPADST + { highbd_iidtx32_c, vpx_highbd_iadst16_c }, // H_FLIPADST + }; + const int n = 16; + const int n2 = 32; + + uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); + + int i, j; + tran_low_t out[16][32], outtmp[16]; + tran_low_t *outp = &out[0][0]; + int outstride = n2; + + // inverse transform row vectors, and transpose + for (i = 0; i < n2; ++i) { + HIGH_IHT_16x32[tx_type].rows(input, outtmp, bd); + for (j = 0; j < n; ++j) + out[j][i] = HIGHBD_WRAPLOW( + highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); + input += n; + } + + // inverse transform column vectors + for (i = 0; i < n; ++i) { + HIGH_IHT_16x32[tx_type].cols(out[i], out[i], bd); + } + + maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, n2, n); + + // Sum with the destination + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = highbd_clip_pixel_add(dest[d], + ROUND_POWER_OF_TWO(outp[s], 6), bd); + } + } +} + +void vp10_highbd_iht32x16_512_add_c(const tran_low_t *input, uint8_t *dest8, + int stride, int tx_type, int bd) { + static const highbd_transform_2d HIGH_IHT_32x16[] = { + { vpx_highbd_idct16_c, vpx_highbd_idct32_c }, // DCT_DCT + { vpx_highbd_iadst16_c, vpx_highbd_idct32_c }, // ADST_DCT + { vpx_highbd_idct16_c, highbd_ihalfright32_c }, // DCT_ADST + { vpx_highbd_iadst16_c, highbd_ihalfright32_c }, // ADST_ADST + { vpx_highbd_iadst16_c, vpx_highbd_idct32_c }, // FLIPADST_DCT + { vpx_highbd_idct16_c, highbd_ihalfright32_c }, // DCT_FLIPADST + { vpx_highbd_iadst16_c, highbd_ihalfright32_c }, // FLIPADST_FLIPADST + { vpx_highbd_iadst16_c, highbd_ihalfright32_c }, // ADST_FLIPADST + { vpx_highbd_iadst16_c, highbd_ihalfright32_c }, // FLIPADST_ADST + { highbd_iidtx16_c, highbd_iidtx32_c }, // IDTX + { vpx_highbd_idct16_c, highbd_iidtx32_c }, // V_DCT + { highbd_iidtx16_c, vpx_highbd_idct32_c }, // H_DCT + { vpx_highbd_iadst16_c, highbd_iidtx32_c }, // V_ADST + { highbd_iidtx16_c, highbd_ihalfright32_c }, // H_ADST + { vpx_highbd_iadst16_c, highbd_iidtx32_c }, // V_FLIPADST + { highbd_iidtx16_c, highbd_ihalfright32_c }, // H_FLIPADST + }; + const int n = 16; + const int n2 = 32; + + uint16_t *dest = CONVERT_TO_SHORTPTR(dest8); + + int i, j; + tran_low_t out[32][16], outtmp[32]; + tran_low_t *outp = &out[0][0]; + int outstride = n; + + // inverse transform row vectors, and transpose + for (i = 0; i < n; ++i) { + HIGH_IHT_32x16[tx_type].rows(input, outtmp, bd); + for (j = 0; j < n2; ++j) + out[j][i] = HIGHBD_WRAPLOW( + highbd_dct_const_round_shift(outtmp[j] * Sqrt2), bd); + input += n2; + } + + // inverse transform column vectors + for (i = 0; i < n2; ++i) { + HIGH_IHT_32x16[tx_type].cols(out[i], out[i], bd); + } + + maybe_flip_strides16(&dest, &stride, &outp, &outstride, tx_type, n, n2); + + // Sum with the destination + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) { + int d = i * stride + j; + int s = j * outstride + i; + dest[d] = highbd_clip_pixel_add(dest[d], + ROUND_POWER_OF_TWO(outp[s], 6), bd); + } + } +} #endif // CONFIG_EXT_TX void vp10_highbd_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest8, @@ -1511,18 +1977,46 @@ void vp10_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, } #if CONFIG_EXT_TX -void vp10_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, +void vp10_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, int stride, int eob, int bd, TX_TYPE tx_type) { - (void)eob; - vp10_highbd_iht8x4_32_add_c(input, dest, stride, tx_type, bd); + (void) eob; + vp10_highbd_iht4x8_32_add_c(input, dest, stride, tx_type, bd); } -void vp10_highbd_inv_txfm_add_4x8(const tran_low_t *input, uint8_t *dest, +void vp10_highbd_inv_txfm_add_8x4(const tran_low_t *input, uint8_t *dest, int stride, int eob, int bd, TX_TYPE tx_type) { - (void)eob; - vp10_highbd_iht4x8_32_add_c(input, dest, stride, tx_type, bd); + (void) eob; + vp10_highbd_iht8x4_32_add_c(input, dest, stride, tx_type, bd); +} + +void vp10_highbd_inv_txfm_add_8x16(const tran_low_t *input, uint8_t *dest, + int stride, int eob, int bd, + TX_TYPE tx_type) { + (void) eob; + vp10_highbd_iht8x16_128_add_c(input, dest, stride, tx_type, bd); +} + +void vp10_highbd_inv_txfm_add_16x8(const tran_low_t *input, uint8_t *dest, + int stride, int eob, int bd, + TX_TYPE tx_type) { + (void) eob; + vp10_highbd_iht16x8_128_add_c(input, dest, stride, tx_type, bd); +} + +void vp10_highbd_inv_txfm_add_16x32(const tran_low_t *input, uint8_t *dest, + int stride, int eob, int bd, + TX_TYPE tx_type) { + (void) eob; + vp10_highbd_iht16x32_512_add_c(input, dest, stride, tx_type, bd); +} + +void vp10_highbd_inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest, + int stride, int eob, int bd, + TX_TYPE tx_type) { + (void) eob; + vp10_highbd_iht32x16_512_add_c(input, dest, stride, tx_type, bd); } #endif // CONFIG_EXT_TX @@ -1661,6 +2155,18 @@ void inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, case TX_8X4: vp10_inv_txfm_add_8x4(input, dest, stride, eob, tx_type); break; + case TX_8X16: + vp10_inv_txfm_add_8x16(input, dest, stride, eob, tx_type); + break; + case TX_16X8: + vp10_inv_txfm_add_16x8(input, dest, stride, eob, tx_type); + break; + case TX_16X32: + vp10_inv_txfm_add_16x32(input, dest, stride, eob, tx_type); + break; + case TX_32X16: + vp10_inv_txfm_add_32x16(input, dest, stride, eob, tx_type); + break; #endif // CONFIG_EXT_TX case TX_4X4: // this is like vp10_short_idct4x4 but has a special case around eob<=1 @@ -1698,6 +2204,18 @@ void highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride, case TX_8X4: vp10_highbd_inv_txfm_add_8x4(input, dest, stride, eob, bd, tx_type); break; + case TX_8X16: + vp10_highbd_inv_txfm_add_8x16(input, dest, stride, eob, bd, tx_type); + break; + case TX_16X8: + vp10_highbd_inv_txfm_add_16x8(input, dest, stride, eob, bd, tx_type); + break; + case TX_16X32: + vp10_highbd_inv_txfm_add_16x32(input, dest, stride, eob, bd, tx_type); + break; + case TX_32X16: + vp10_highbd_inv_txfm_add_32x16(input, dest, stride, eob, bd, tx_type); + break; #endif // CONFIG_EXT_TX case TX_4X4: // this is like vp10_short_idct4x4 but has a special case around eob<=1 diff --git a/vp10/common/scan.c b/vp10/common/scan.c index fd611b959..142b557d5 100644 --- a/vp10/common/scan.c +++ b/vp10/common/scan.c @@ -103,6 +103,368 @@ DECLARE_ALIGNED(16, static const int16_t, row_scan_8x8[64]) = { 58, 45, 38, 52, 31, 59, 53, 46, 60, 39, 61, 47, 54, 55, 62, 63, }; +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, default_scan_8x16[128]) = { + 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, 87, + 94, 101, 108, 115, 122, 95, 102, 109, 116, 123, 103, 110, + 117, 124, 111, 118, 125, 119, 126, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, default_scan_16x8[128]) = { + 0, 1, 16, 2, 17, 32, 3, 18, 33, 48, 4, 19, + 34, 49, 64, 5, 20, 35, 50, 65, 80, 6, 21, 36, + 51, 66, 81, 96, 7, 22, 37, 52, 67, 82, 97, 112, + 8, 23, 38, 53, 68, 83, 98, 113, 9, 24, 39, 54, + 69, 84, 99, 114, 10, 25, 40, 55, 70, 85, 100, 115, + 11, 26, 41, 56, 71, 86, 101, 116, 12, 27, 42, 57, + 72, 87, 102, 117, 13, 28, 43, 58, 73, 88, 103, 118, + 14, 29, 44, 59, 74, 89, 104, 119, 15, 30, 45, 60, + 75, 90, 105, 120, 31, 46, 61, 76, 91, 106, 121, 47, + 62, 77, 92, 107, 122, 63, 78, 93, 108, 123, 79, 94, + 109, 124, 95, 110, 125, 111, 126, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_8x16[128]) = { + 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, + 96, 104, 112, 120, 1, 9, 17, 25, 33, 41, 49, 57, + 65, 73, 81, 89, 97, 105, 113, 121, 2, 10, 18, 26, + 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, 122, + 3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, + 99, 107, 115, 123, 4, 12, 20, 28, 36, 44, 52, 60, + 68, 76, 84, 92, 100, 108, 116, 124, 5, 13, 21, 29, + 37, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, + 6, 14, 22, 30, 38, 46, 54, 62, 70, 78, 86, 94, + 102, 110, 118, 126, 7, 15, 23, 31, 39, 47, 55, 63, + 71, 79, 87, 95, 103, 111, 119, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_16x8[128]) = { + 0, 16, 32, 48, 64, 80, 96, 112, 1, 17, 33, 49, + 65, 81, 97, 113, 2, 18, 34, 50, 66, 82, 98, 114, + 3, 19, 35, 51, 67, 83, 99, 115, 4, 20, 36, 52, + 68, 84, 100, 116, 5, 21, 37, 53, 69, 85, 101, 117, + 6, 22, 38, 54, 70, 86, 102, 118, 7, 23, 39, 55, + 71, 87, 103, 119, 8, 24, 40, 56, 72, 88, 104, 120, + 9, 25, 41, 57, 73, 89, 105, 121, 10, 26, 42, 58, + 74, 90, 106, 122, 11, 27, 43, 59, 75, 91, 107, 123, + 12, 28, 44, 60, 76, 92, 108, 124, 13, 29, 45, 61, + 77, 93, 109, 125, 14, 30, 46, 62, 78, 94, 110, 126, + 15, 31, 47, 63, 79, 95, 111, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_8x16[128]) = { + 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, +}; + +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_16x8[128]) = { + 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, +}; + +DECLARE_ALIGNED(16, static const int16_t, default_scan_16x32[512]) = { + 0, 1, 16, 2, 17, 32, 3, 18, 33, 48, 4, 19, + 34, 49, 64, 5, 20, 35, 50, 65, 80, 6, 21, 36, + 51, 66, 81, 96, 7, 22, 37, 52, 67, 82, 97, 112, + 8, 23, 38, 53, 68, 83, 98, 113, 128, 9, 24, 39, + 54, 69, 84, 99, 114, 129, 144, 10, 25, 40, 55, 70, + 85, 100, 115, 130, 145, 160, 11, 26, 41, 56, 71, 86, + 101, 116, 131, 146, 161, 176, 12, 27, 42, 57, 72, 87, + 102, 117, 132, 147, 162, 177, 192, 13, 28, 43, 58, 73, + 88, 103, 118, 133, 148, 163, 178, 193, 208, 14, 29, 44, + 59, 74, 89, 104, 119, 134, 149, 164, 179, 194, 209, 224, + 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, + 195, 210, 225, 240, 31, 46, 61, 76, 91, 106, 121, 136, + 151, 166, 181, 196, 211, 226, 241, 256, 47, 62, 77, 92, + 107, 122, 137, 152, 167, 182, 197, 212, 227, 242, 257, 272, + 63, 78, 93, 108, 123, 138, 153, 168, 183, 198, 213, 228, + 243, 258, 273, 288, 79, 94, 109, 124, 139, 154, 169, 184, + 199, 214, 229, 244, 259, 274, 289, 304, 95, 110, 125, 140, + 155, 170, 185, 200, 215, 230, 245, 260, 275, 290, 305, 320, + 111, 126, 141, 156, 171, 186, 201, 216, 231, 246, 261, 276, + 291, 306, 321, 336, 127, 142, 157, 172, 187, 202, 217, 232, + 247, 262, 277, 292, 307, 322, 337, 352, 143, 158, 173, 188, + 203, 218, 233, 248, 263, 278, 293, 308, 323, 338, 353, 368, + 159, 174, 189, 204, 219, 234, 249, 264, 279, 294, 309, 324, + 339, 354, 369, 384, 175, 190, 205, 220, 235, 250, 265, 280, + 295, 310, 325, 340, 355, 370, 385, 400, 191, 206, 221, 236, + 251, 266, 281, 296, 311, 326, 341, 356, 371, 386, 401, 416, + 207, 222, 237, 252, 267, 282, 297, 312, 327, 342, 357, 372, + 387, 402, 417, 432, 223, 238, 253, 268, 283, 298, 313, 328, + 343, 358, 373, 388, 403, 418, 433, 448, 239, 254, 269, 284, + 299, 314, 329, 344, 359, 374, 389, 404, 419, 434, 449, 464, + 255, 270, 285, 300, 315, 330, 345, 360, 375, 390, 405, 420, + 435, 450, 465, 480, 271, 286, 301, 316, 331, 346, 361, 376, + 391, 406, 421, 436, 451, 466, 481, 496, 287, 302, 317, 332, + 347, 362, 377, 392, 407, 422, 437, 452, 467, 482, 497, 303, + 318, 333, 348, 363, 378, 393, 408, 423, 438, 453, 468, 483, + 498, 319, 334, 349, 364, 379, 394, 409, 424, 439, 454, 469, + 484, 499, 335, 350, 365, 380, 395, 410, 425, 440, 455, 470, + 485, 500, 351, 366, 381, 396, 411, 426, 441, 456, 471, 486, + 501, 367, 382, 397, 412, 427, 442, 457, 472, 487, 502, 383, + 398, 413, 428, 443, 458, 473, 488, 503, 399, 414, 429, 444, + 459, 474, 489, 504, 415, 430, 445, 460, 475, 490, 505, 431, + 446, 461, 476, 491, 506, 447, 462, 477, 492, 507, 463, 478, + 493, 508, 479, 494, 509, 495, 510, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, default_scan_32x16[512]) = { + 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, 256, 9, 40, 71, + 102, 133, 164, 195, 226, 257, 288, 10, 41, 72, 103, 134, + 165, 196, 227, 258, 289, 320, 11, 42, 73, 104, 135, 166, + 197, 228, 259, 290, 321, 352, 12, 43, 74, 105, 136, 167, + 198, 229, 260, 291, 322, 353, 384, 13, 44, 75, 106, 137, + 168, 199, 230, 261, 292, 323, 354, 385, 416, 14, 45, 76, + 107, 138, 169, 200, 231, 262, 293, 324, 355, 386, 417, 448, + 15, 46, 77, 108, 139, 170, 201, 232, 263, 294, 325, 356, + 387, 418, 449, 480, 16, 47, 78, 109, 140, 171, 202, 233, + 264, 295, 326, 357, 388, 419, 450, 481, 17, 48, 79, 110, + 141, 172, 203, 234, 265, 296, 327, 358, 389, 420, 451, 482, + 18, 49, 80, 111, 142, 173, 204, 235, 266, 297, 328, 359, + 390, 421, 452, 483, 19, 50, 81, 112, 143, 174, 205, 236, + 267, 298, 329, 360, 391, 422, 453, 484, 20, 51, 82, 113, + 144, 175, 206, 237, 268, 299, 330, 361, 392, 423, 454, 485, + 21, 52, 83, 114, 145, 176, 207, 238, 269, 300, 331, 362, + 393, 424, 455, 486, 22, 53, 84, 115, 146, 177, 208, 239, + 270, 301, 332, 363, 394, 425, 456, 487, 23, 54, 85, 116, + 147, 178, 209, 240, 271, 302, 333, 364, 395, 426, 457, 488, + 24, 55, 86, 117, 148, 179, 210, 241, 272, 303, 334, 365, + 396, 427, 458, 489, 25, 56, 87, 118, 149, 180, 211, 242, + 273, 304, 335, 366, 397, 428, 459, 490, 26, 57, 88, 119, + 150, 181, 212, 243, 274, 305, 336, 367, 398, 429, 460, 491, + 27, 58, 89, 120, 151, 182, 213, 244, 275, 306, 337, 368, + 399, 430, 461, 492, 28, 59, 90, 121, 152, 183, 214, 245, + 276, 307, 338, 369, 400, 431, 462, 493, 29, 60, 91, 122, + 153, 184, 215, 246, 277, 308, 339, 370, 401, 432, 463, 494, + 30, 61, 92, 123, 154, 185, 216, 247, 278, 309, 340, 371, + 402, 433, 464, 495, 31, 62, 93, 124, 155, 186, 217, 248, + 279, 310, 341, 372, 403, 434, 465, 496, 63, 94, 125, 156, + 187, 218, 249, 280, 311, 342, 373, 404, 435, 466, 497, 95, + 126, 157, 188, 219, 250, 281, 312, 343, 374, 405, 436, 467, + 498, 127, 158, 189, 220, 251, 282, 313, 344, 375, 406, 437, + 468, 499, 159, 190, 221, 252, 283, 314, 345, 376, 407, 438, + 469, 500, 191, 222, 253, 284, 315, 346, 377, 408, 439, 470, + 501, 223, 254, 285, 316, 347, 378, 409, 440, 471, 502, 255, + 286, 317, 348, 379, 410, 441, 472, 503, 287, 318, 349, 380, + 411, 442, 473, 504, 319, 350, 381, 412, 443, 474, 505, 351, + 382, 413, 444, 475, 506, 383, 414, 445, 476, 507, 415, 446, + 477, 508, 447, 478, 509, 479, 510, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_16x32[512]) = { + 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, + 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, + 384, 400, 416, 432, 448, 464, 480, 496, 1, 17, 33, 49, + 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, + 257, 273, 289, 305, 321, 337, 353, 369, 385, 401, 417, 433, + 449, 465, 481, 497, 2, 18, 34, 50, 66, 82, 98, 114, + 130, 146, 162, 178, 194, 210, 226, 242, 258, 274, 290, 306, + 322, 338, 354, 370, 386, 402, 418, 434, 450, 466, 482, 498, + 3, 19, 35, 51, 67, 83, 99, 115, 131, 147, 163, 179, + 195, 211, 227, 243, 259, 275, 291, 307, 323, 339, 355, 371, + 387, 403, 419, 435, 451, 467, 483, 499, 4, 20, 36, 52, + 68, 84, 100, 116, 132, 148, 164, 180, 196, 212, 228, 244, + 260, 276, 292, 308, 324, 340, 356, 372, 388, 404, 420, 436, + 452, 468, 484, 500, 5, 21, 37, 53, 69, 85, 101, 117, + 133, 149, 165, 181, 197, 213, 229, 245, 261, 277, 293, 309, + 325, 341, 357, 373, 389, 405, 421, 437, 453, 469, 485, 501, + 6, 22, 38, 54, 70, 86, 102, 118, 134, 150, 166, 182, + 198, 214, 230, 246, 262, 278, 294, 310, 326, 342, 358, 374, + 390, 406, 422, 438, 454, 470, 486, 502, 7, 23, 39, 55, + 71, 87, 103, 119, 135, 151, 167, 183, 199, 215, 231, 247, + 263, 279, 295, 311, 327, 343, 359, 375, 391, 407, 423, 439, + 455, 471, 487, 503, 8, 24, 40, 56, 72, 88, 104, 120, + 136, 152, 168, 184, 200, 216, 232, 248, 264, 280, 296, 312, + 328, 344, 360, 376, 392, 408, 424, 440, 456, 472, 488, 504, + 9, 25, 41, 57, 73, 89, 105, 121, 137, 153, 169, 185, + 201, 217, 233, 249, 265, 281, 297, 313, 329, 345, 361, 377, + 393, 409, 425, 441, 457, 473, 489, 505, 10, 26, 42, 58, + 74, 90, 106, 122, 138, 154, 170, 186, 202, 218, 234, 250, + 266, 282, 298, 314, 330, 346, 362, 378, 394, 410, 426, 442, + 458, 474, 490, 506, 11, 27, 43, 59, 75, 91, 107, 123, + 139, 155, 171, 187, 203, 219, 235, 251, 267, 283, 299, 315, + 331, 347, 363, 379, 395, 411, 427, 443, 459, 475, 491, 507, + 12, 28, 44, 60, 76, 92, 108, 124, 140, 156, 172, 188, + 204, 220, 236, 252, 268, 284, 300, 316, 332, 348, 364, 380, + 396, 412, 428, 444, 460, 476, 492, 508, 13, 29, 45, 61, + 77, 93, 109, 125, 141, 157, 173, 189, 205, 221, 237, 253, + 269, 285, 301, 317, 333, 349, 365, 381, 397, 413, 429, 445, + 461, 477, 493, 509, 14, 30, 46, 62, 78, 94, 110, 126, + 142, 158, 174, 190, 206, 222, 238, 254, 270, 286, 302, 318, + 334, 350, 366, 382, 398, 414, 430, 446, 462, 478, 494, 510, + 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, + 207, 223, 239, 255, 271, 287, 303, 319, 335, 351, 367, 383, + 399, 415, 431, 447, 463, 479, 495, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, mcol_scan_32x16[512]) = { + 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, + 384, 416, 448, 480, 1, 33, 65, 97, 129, 161, 193, 225, + 257, 289, 321, 353, 385, 417, 449, 481, 2, 34, 66, 98, + 130, 162, 194, 226, 258, 290, 322, 354, 386, 418, 450, 482, + 3, 35, 67, 99, 131, 163, 195, 227, 259, 291, 323, 355, + 387, 419, 451, 483, 4, 36, 68, 100, 132, 164, 196, 228, + 260, 292, 324, 356, 388, 420, 452, 484, 5, 37, 69, 101, + 133, 165, 197, 229, 261, 293, 325, 357, 389, 421, 453, 485, + 6, 38, 70, 102, 134, 166, 198, 230, 262, 294, 326, 358, + 390, 422, 454, 486, 7, 39, 71, 103, 135, 167, 199, 231, + 263, 295, 327, 359, 391, 423, 455, 487, 8, 40, 72, 104, + 136, 168, 200, 232, 264, 296, 328, 360, 392, 424, 456, 488, + 9, 41, 73, 105, 137, 169, 201, 233, 265, 297, 329, 361, + 393, 425, 457, 489, 10, 42, 74, 106, 138, 170, 202, 234, + 266, 298, 330, 362, 394, 426, 458, 490, 11, 43, 75, 107, + 139, 171, 203, 235, 267, 299, 331, 363, 395, 427, 459, 491, + 12, 44, 76, 108, 140, 172, 204, 236, 268, 300, 332, 364, + 396, 428, 460, 492, 13, 45, 77, 109, 141, 173, 205, 237, + 269, 301, 333, 365, 397, 429, 461, 493, 14, 46, 78, 110, + 142, 174, 206, 238, 270, 302, 334, 366, 398, 430, 462, 494, + 15, 47, 79, 111, 143, 175, 207, 239, 271, 303, 335, 367, + 399, 431, 463, 495, 16, 48, 80, 112, 144, 176, 208, 240, + 272, 304, 336, 368, 400, 432, 464, 496, 17, 49, 81, 113, + 145, 177, 209, 241, 273, 305, 337, 369, 401, 433, 465, 497, + 18, 50, 82, 114, 146, 178, 210, 242, 274, 306, 338, 370, + 402, 434, 466, 498, 19, 51, 83, 115, 147, 179, 211, 243, + 275, 307, 339, 371, 403, 435, 467, 499, 20, 52, 84, 116, + 148, 180, 212, 244, 276, 308, 340, 372, 404, 436, 468, 500, + 21, 53, 85, 117, 149, 181, 213, 245, 277, 309, 341, 373, + 405, 437, 469, 501, 22, 54, 86, 118, 150, 182, 214, 246, + 278, 310, 342, 374, 406, 438, 470, 502, 23, 55, 87, 119, + 151, 183, 215, 247, 279, 311, 343, 375, 407, 439, 471, 503, + 24, 56, 88, 120, 152, 184, 216, 248, 280, 312, 344, 376, + 408, 440, 472, 504, 25, 57, 89, 121, 153, 185, 217, 249, + 281, 313, 345, 377, 409, 441, 473, 505, 26, 58, 90, 122, + 154, 186, 218, 250, 282, 314, 346, 378, 410, 442, 474, 506, + 27, 59, 91, 123, 155, 187, 219, 251, 283, 315, 347, 379, + 411, 443, 475, 507, 28, 60, 92, 124, 156, 188, 220, 252, + 284, 316, 348, 380, 412, 444, 476, 508, 29, 61, 93, 125, + 157, 189, 221, 253, 285, 317, 349, 381, 413, 445, 477, 509, + 30, 62, 94, 126, 158, 190, 222, 254, 286, 318, 350, 382, + 414, 446, 478, 510, 31, 63, 95, 127, 159, 191, 223, 255, + 287, 319, 351, 383, 415, 447, 479, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_16x32[512]) = { + 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, mrow_scan_32x16[512]) = { + 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, +}; +#endif // CONFIG_EXT_TX + DECLARE_ALIGNED(16, static const int16_t, default_scan_16x16[256]) = { 0, 16, 1, 32, 17, 2, 48, 33, 18, 3, 64, 34, 49, 19, 65, 80, 50, 4, 35, 66, 20, 81, 96, 51, 5, 36, 82, 97, 67, 112, @@ -843,6 +1205,717 @@ DECLARE_ALIGNED(16, static const int16_t, 31, 38, 53, 60, 46, 53, 39, 46, 54, 61, 47, 54, 55, 62, 0, 0, }; +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, + default_scan_8x16_neighbors[129 * 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, 79, 86, + 86, 93, 93, 100, 100, 107, 107, 114, 114, 121, 87, 94, + 94, 101, 101, 108, 108, 115, 115, 122, 95, 102, 102, 109, + 109, 116, 116, 123, 103, 110, 110, 117, 117, 124, 111, 118, + 118, 125, 119, 126, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + default_scan_16x8_neighbors[129 * 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, 48, 48, 4, 4, 4, 19, 19, 34, + 34, 49, 49, 64, 64, 64, 5, 5, 5, 20, 20, 35, + 35, 50, 50, 65, 65, 80, 80, 80, 6, 6, 6, 21, + 21, 36, 36, 51, 51, 66, 66, 81, 81, 96, 96, 96, + 7, 7, 7, 22, 22, 37, 37, 52, 52, 67, 67, 82, + 82, 97, 97, 112, 8, 8, 8, 23, 23, 38, 38, 53, + 53, 68, 68, 83, 83, 98, 98, 113, 9, 9, 9, 24, + 24, 39, 39, 54, 54, 69, 69, 84, 84, 99, 99, 114, + 10, 10, 10, 25, 25, 40, 40, 55, 55, 70, 70, 85, + 85, 100, 100, 115, 11, 11, 11, 26, 26, 41, 41, 56, + 56, 71, 71, 86, 86, 101, 101, 116, 12, 12, 12, 27, + 27, 42, 42, 57, 57, 72, 72, 87, 87, 102, 102, 117, + 13, 13, 13, 28, 28, 43, 43, 58, 58, 73, 73, 88, + 88, 103, 103, 118, 14, 14, 14, 29, 29, 44, 44, 59, + 59, 74, 74, 89, 89, 104, 104, 119, 15, 30, 30, 45, + 45, 60, 60, 75, 75, 90, 90, 105, 105, 120, 31, 46, + 46, 61, 61, 76, 76, 91, 91, 106, 106, 121, 47, 62, + 62, 77, 77, 92, 92, 107, 107, 122, 63, 78, 78, 93, + 93, 108, 108, 123, 79, 94, 94, 109, 109, 124, 95, 110, + 110, 125, 111, 126, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_8x16_neighbors[129 * 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, 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, 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, + 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, 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, 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, + 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, 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, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_16x8_neighbors[129 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 16, 16, 32, 32, 48, 48, 64, 64, + 80, 80, 96, 96, 0, 0, 1, 16, 17, 32, 33, 48, + 49, 64, 65, 80, 81, 96, 97, 112, 1, 1, 2, 17, + 18, 33, 34, 49, 50, 65, 66, 81, 82, 97, 98, 113, + 2, 2, 3, 18, 19, 34, 35, 50, 51, 66, 67, 82, + 83, 98, 99, 114, 3, 3, 4, 19, 20, 35, 36, 51, + 52, 67, 68, 83, 84, 99, 100, 115, 4, 4, 5, 20, + 21, 36, 37, 52, 53, 68, 69, 84, 85, 100, 101, 116, + 5, 5, 6, 21, 22, 37, 38, 53, 54, 69, 70, 85, + 86, 101, 102, 117, 6, 6, 7, 22, 23, 38, 39, 54, + 55, 70, 71, 86, 87, 102, 103, 118, 7, 7, 8, 23, + 24, 39, 40, 55, 56, 71, 72, 87, 88, 103, 104, 119, + 8, 8, 9, 24, 25, 40, 41, 56, 57, 72, 73, 88, + 89, 104, 105, 120, 9, 9, 10, 25, 26, 41, 42, 57, + 58, 73, 74, 89, 90, 105, 106, 121, 10, 10, 11, 26, + 27, 42, 43, 58, 59, 74, 75, 90, 91, 106, 107, 122, + 11, 11, 12, 27, 28, 43, 44, 59, 60, 75, 76, 91, + 92, 107, 108, 123, 12, 12, 13, 28, 29, 44, 45, 60, + 61, 76, 77, 92, 93, 108, 109, 124, 13, 13, 14, 29, + 30, 45, 46, 61, 62, 77, 78, 93, 94, 109, 110, 125, + 14, 14, 15, 30, 31, 46, 47, 62, 63, 78, 79, 94, + 95, 110, 111, 126, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_8x16_neighbors[129 * 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, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_16x8_neighbors[129 * 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, 48, 48, 49, 64, + 50, 65, 51, 66, 52, 67, 53, 68, 54, 69, 55, 70, + 56, 71, 57, 72, 58, 73, 59, 74, 60, 75, 61, 76, + 62, 77, 63, 78, 64, 64, 65, 80, 66, 81, 67, 82, + 68, 83, 69, 84, 70, 85, 71, 86, 72, 87, 73, 88, + 74, 89, 75, 90, 76, 91, 77, 92, 78, 93, 79, 94, + 80, 80, 81, 96, 82, 97, 83, 98, 84, 99, 85, 100, + 86, 101, 87, 102, 88, 103, 89, 104, 90, 105, 91, 106, + 92, 107, 93, 108, 94, 109, 95, 110, 96, 96, 97, 112, + 98, 113, 99, 114, 100, 115, 101, 116, 102, 117, 103, 118, + 104, 119, 105, 120, 106, 121, 107, 122, 108, 123, 109, 124, + 110, 125, 111, 126, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + default_scan_16x32_neighbors[513 * 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, 48, 48, 4, 4, 4, 19, 19, 34, + 34, 49, 49, 64, 64, 64, 5, 5, 5, 20, 20, 35, + 35, 50, 50, 65, 65, 80, 80, 80, 6, 6, 6, 21, + 21, 36, 36, 51, 51, 66, 66, 81, 81, 96, 96, 96, + 7, 7, 7, 22, 22, 37, 37, 52, 52, 67, 67, 82, + 82, 97, 97, 112, 112, 112, 8, 8, 8, 23, 23, 38, + 38, 53, 53, 68, 68, 83, 83, 98, 98, 113, 113, 128, + 128, 128, 9, 9, 9, 24, 24, 39, 39, 54, 54, 69, + 69, 84, 84, 99, 99, 114, 114, 129, 129, 144, 144, 144, + 10, 10, 10, 25, 25, 40, 40, 55, 55, 70, 70, 85, + 85, 100, 100, 115, 115, 130, 130, 145, 145, 160, 160, 160, + 11, 11, 11, 26, 26, 41, 41, 56, 56, 71, 71, 86, + 86, 101, 101, 116, 116, 131, 131, 146, 146, 161, 161, 176, + 176, 176, 12, 12, 12, 27, 27, 42, 42, 57, 57, 72, + 72, 87, 87, 102, 102, 117, 117, 132, 132, 147, 147, 162, + 162, 177, 177, 192, 192, 192, 13, 13, 13, 28, 28, 43, + 43, 58, 58, 73, 73, 88, 88, 103, 103, 118, 118, 133, + 133, 148, 148, 163, 163, 178, 178, 193, 193, 208, 208, 208, + 14, 14, 14, 29, 29, 44, 44, 59, 59, 74, 74, 89, + 89, 104, 104, 119, 119, 134, 134, 149, 149, 164, 164, 179, + 179, 194, 194, 209, 209, 224, 224, 224, 15, 30, 30, 45, + 45, 60, 60, 75, 75, 90, 90, 105, 105, 120, 120, 135, + 135, 150, 150, 165, 165, 180, 180, 195, 195, 210, 210, 225, + 225, 240, 240, 240, 31, 46, 46, 61, 61, 76, 76, 91, + 91, 106, 106, 121, 121, 136, 136, 151, 151, 166, 166, 181, + 181, 196, 196, 211, 211, 226, 226, 241, 241, 256, 256, 256, + 47, 62, 62, 77, 77, 92, 92, 107, 107, 122, 122, 137, + 137, 152, 152, 167, 167, 182, 182, 197, 197, 212, 212, 227, + 227, 242, 242, 257, 257, 272, 272, 272, 63, 78, 78, 93, + 93, 108, 108, 123, 123, 138, 138, 153, 153, 168, 168, 183, + 183, 198, 198, 213, 213, 228, 228, 243, 243, 258, 258, 273, + 273, 288, 288, 288, 79, 94, 94, 109, 109, 124, 124, 139, + 139, 154, 154, 169, 169, 184, 184, 199, 199, 214, 214, 229, + 229, 244, 244, 259, 259, 274, 274, 289, 289, 304, 304, 304, + 95, 110, 110, 125, 125, 140, 140, 155, 155, 170, 170, 185, + 185, 200, 200, 215, 215, 230, 230, 245, 245, 260, 260, 275, + 275, 290, 290, 305, 305, 320, 320, 320, 111, 126, 126, 141, + 141, 156, 156, 171, 171, 186, 186, 201, 201, 216, 216, 231, + 231, 246, 246, 261, 261, 276, 276, 291, 291, 306, 306, 321, + 321, 336, 336, 336, 127, 142, 142, 157, 157, 172, 172, 187, + 187, 202, 202, 217, 217, 232, 232, 247, 247, 262, 262, 277, + 277, 292, 292, 307, 307, 322, 322, 337, 337, 352, 352, 352, + 143, 158, 158, 173, 173, 188, 188, 203, 203, 218, 218, 233, + 233, 248, 248, 263, 263, 278, 278, 293, 293, 308, 308, 323, + 323, 338, 338, 353, 353, 368, 368, 368, 159, 174, 174, 189, + 189, 204, 204, 219, 219, 234, 234, 249, 249, 264, 264, 279, + 279, 294, 294, 309, 309, 324, 324, 339, 339, 354, 354, 369, + 369, 384, 384, 384, 175, 190, 190, 205, 205, 220, 220, 235, + 235, 250, 250, 265, 265, 280, 280, 295, 295, 310, 310, 325, + 325, 340, 340, 355, 355, 370, 370, 385, 385, 400, 400, 400, + 191, 206, 206, 221, 221, 236, 236, 251, 251, 266, 266, 281, + 281, 296, 296, 311, 311, 326, 326, 341, 341, 356, 356, 371, + 371, 386, 386, 401, 401, 416, 416, 416, 207, 222, 222, 237, + 237, 252, 252, 267, 267, 282, 282, 297, 297, 312, 312, 327, + 327, 342, 342, 357, 357, 372, 372, 387, 387, 402, 402, 417, + 417, 432, 432, 432, 223, 238, 238, 253, 253, 268, 268, 283, + 283, 298, 298, 313, 313, 328, 328, 343, 343, 358, 358, 373, + 373, 388, 388, 403, 403, 418, 418, 433, 433, 448, 448, 448, + 239, 254, 254, 269, 269, 284, 284, 299, 299, 314, 314, 329, + 329, 344, 344, 359, 359, 374, 374, 389, 389, 404, 404, 419, + 419, 434, 434, 449, 449, 464, 464, 464, 255, 270, 270, 285, + 285, 300, 300, 315, 315, 330, 330, 345, 345, 360, 360, 375, + 375, 390, 390, 405, 405, 420, 420, 435, 435, 450, 450, 465, + 465, 480, 480, 480, 271, 286, 286, 301, 301, 316, 316, 331, + 331, 346, 346, 361, 361, 376, 376, 391, 391, 406, 406, 421, + 421, 436, 436, 451, 451, 466, 466, 481, 481, 496, 287, 302, + 302, 317, 317, 332, 332, 347, 347, 362, 362, 377, 377, 392, + 392, 407, 407, 422, 422, 437, 437, 452, 452, 467, 467, 482, + 482, 497, 303, 318, 318, 333, 333, 348, 348, 363, 363, 378, + 378, 393, 393, 408, 408, 423, 423, 438, 438, 453, 453, 468, + 468, 483, 483, 498, 319, 334, 334, 349, 349, 364, 364, 379, + 379, 394, 394, 409, 409, 424, 424, 439, 439, 454, 454, 469, + 469, 484, 484, 499, 335, 350, 350, 365, 365, 380, 380, 395, + 395, 410, 410, 425, 425, 440, 440, 455, 455, 470, 470, 485, + 485, 500, 351, 366, 366, 381, 381, 396, 396, 411, 411, 426, + 426, 441, 441, 456, 456, 471, 471, 486, 486, 501, 367, 382, + 382, 397, 397, 412, 412, 427, 427, 442, 442, 457, 457, 472, + 472, 487, 487, 502, 383, 398, 398, 413, 413, 428, 428, 443, + 443, 458, 458, 473, 473, 488, 488, 503, 399, 414, 414, 429, + 429, 444, 444, 459, 459, 474, 474, 489, 489, 504, 415, 430, + 430, 445, 445, 460, 460, 475, 475, 490, 490, 505, 431, 446, + 446, 461, 461, 476, 476, 491, 491, 506, 447, 462, 462, 477, + 477, 492, 492, 507, 463, 478, 478, 493, 493, 508, 479, 494, + 494, 509, 495, 510, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + default_scan_32x16_neighbors[513 * 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, 224, 224, 8, 8, 8, 39, 39, 70, + 70, 101, 101, 132, 132, 163, 163, 194, 194, 225, 225, 256, + 256, 256, 9, 9, 9, 40, 40, 71, 71, 102, 102, 133, + 133, 164, 164, 195, 195, 226, 226, 257, 257, 288, 288, 288, + 10, 10, 10, 41, 41, 72, 72, 103, 103, 134, 134, 165, + 165, 196, 196, 227, 227, 258, 258, 289, 289, 320, 320, 320, + 11, 11, 11, 42, 42, 73, 73, 104, 104, 135, 135, 166, + 166, 197, 197, 228, 228, 259, 259, 290, 290, 321, 321, 352, + 352, 352, 12, 12, 12, 43, 43, 74, 74, 105, 105, 136, + 136, 167, 167, 198, 198, 229, 229, 260, 260, 291, 291, 322, + 322, 353, 353, 384, 384, 384, 13, 13, 13, 44, 44, 75, + 75, 106, 106, 137, 137, 168, 168, 199, 199, 230, 230, 261, + 261, 292, 292, 323, 323, 354, 354, 385, 385, 416, 416, 416, + 14, 14, 14, 45, 45, 76, 76, 107, 107, 138, 138, 169, + 169, 200, 200, 231, 231, 262, 262, 293, 293, 324, 324, 355, + 355, 386, 386, 417, 417, 448, 448, 448, 15, 15, 15, 46, + 46, 77, 77, 108, 108, 139, 139, 170, 170, 201, 201, 232, + 232, 263, 263, 294, 294, 325, 325, 356, 356, 387, 387, 418, + 418, 449, 449, 480, 16, 16, 16, 47, 47, 78, 78, 109, + 109, 140, 140, 171, 171, 202, 202, 233, 233, 264, 264, 295, + 295, 326, 326, 357, 357, 388, 388, 419, 419, 450, 450, 481, + 17, 17, 17, 48, 48, 79, 79, 110, 110, 141, 141, 172, + 172, 203, 203, 234, 234, 265, 265, 296, 296, 327, 327, 358, + 358, 389, 389, 420, 420, 451, 451, 482, 18, 18, 18, 49, + 49, 80, 80, 111, 111, 142, 142, 173, 173, 204, 204, 235, + 235, 266, 266, 297, 297, 328, 328, 359, 359, 390, 390, 421, + 421, 452, 452, 483, 19, 19, 19, 50, 50, 81, 81, 112, + 112, 143, 143, 174, 174, 205, 205, 236, 236, 267, 267, 298, + 298, 329, 329, 360, 360, 391, 391, 422, 422, 453, 453, 484, + 20, 20, 20, 51, 51, 82, 82, 113, 113, 144, 144, 175, + 175, 206, 206, 237, 237, 268, 268, 299, 299, 330, 330, 361, + 361, 392, 392, 423, 423, 454, 454, 485, 21, 21, 21, 52, + 52, 83, 83, 114, 114, 145, 145, 176, 176, 207, 207, 238, + 238, 269, 269, 300, 300, 331, 331, 362, 362, 393, 393, 424, + 424, 455, 455, 486, 22, 22, 22, 53, 53, 84, 84, 115, + 115, 146, 146, 177, 177, 208, 208, 239, 239, 270, 270, 301, + 301, 332, 332, 363, 363, 394, 394, 425, 425, 456, 456, 487, + 23, 23, 23, 54, 54, 85, 85, 116, 116, 147, 147, 178, + 178, 209, 209, 240, 240, 271, 271, 302, 302, 333, 333, 364, + 364, 395, 395, 426, 426, 457, 457, 488, 24, 24, 24, 55, + 55, 86, 86, 117, 117, 148, 148, 179, 179, 210, 210, 241, + 241, 272, 272, 303, 303, 334, 334, 365, 365, 396, 396, 427, + 427, 458, 458, 489, 25, 25, 25, 56, 56, 87, 87, 118, + 118, 149, 149, 180, 180, 211, 211, 242, 242, 273, 273, 304, + 304, 335, 335, 366, 366, 397, 397, 428, 428, 459, 459, 490, + 26, 26, 26, 57, 57, 88, 88, 119, 119, 150, 150, 181, + 181, 212, 212, 243, 243, 274, 274, 305, 305, 336, 336, 367, + 367, 398, 398, 429, 429, 460, 460, 491, 27, 27, 27, 58, + 58, 89, 89, 120, 120, 151, 151, 182, 182, 213, 213, 244, + 244, 275, 275, 306, 306, 337, 337, 368, 368, 399, 399, 430, + 430, 461, 461, 492, 28, 28, 28, 59, 59, 90, 90, 121, + 121, 152, 152, 183, 183, 214, 214, 245, 245, 276, 276, 307, + 307, 338, 338, 369, 369, 400, 400, 431, 431, 462, 462, 493, + 29, 29, 29, 60, 60, 91, 91, 122, 122, 153, 153, 184, + 184, 215, 215, 246, 246, 277, 277, 308, 308, 339, 339, 370, + 370, 401, 401, 432, 432, 463, 463, 494, 30, 30, 30, 61, + 61, 92, 92, 123, 123, 154, 154, 185, 185, 216, 216, 247, + 247, 278, 278, 309, 309, 340, 340, 371, 371, 402, 402, 433, + 433, 464, 464, 495, 31, 62, 62, 93, 93, 124, 124, 155, + 155, 186, 186, 217, 217, 248, 248, 279, 279, 310, 310, 341, + 341, 372, 372, 403, 403, 434, 434, 465, 465, 496, 63, 94, + 94, 125, 125, 156, 156, 187, 187, 218, 218, 249, 249, 280, + 280, 311, 311, 342, 342, 373, 373, 404, 404, 435, 435, 466, + 466, 497, 95, 126, 126, 157, 157, 188, 188, 219, 219, 250, + 250, 281, 281, 312, 312, 343, 343, 374, 374, 405, 405, 436, + 436, 467, 467, 498, 127, 158, 158, 189, 189, 220, 220, 251, + 251, 282, 282, 313, 313, 344, 344, 375, 375, 406, 406, 437, + 437, 468, 468, 499, 159, 190, 190, 221, 221, 252, 252, 283, + 283, 314, 314, 345, 345, 376, 376, 407, 407, 438, 438, 469, + 469, 500, 191, 222, 222, 253, 253, 284, 284, 315, 315, 346, + 346, 377, 377, 408, 408, 439, 439, 470, 470, 501, 223, 254, + 254, 285, 285, 316, 316, 347, 347, 378, 378, 409, 409, 440, + 440, 471, 471, 502, 255, 286, 286, 317, 317, 348, 348, 379, + 379, 410, 410, 441, 441, 472, 472, 503, 287, 318, 318, 349, + 349, 380, 380, 411, 411, 442, 442, 473, 473, 504, 319, 350, + 350, 381, 381, 412, 412, 443, 443, 474, 474, 505, 351, 382, + 382, 413, 413, 444, 444, 475, 475, 506, 383, 414, 414, 445, + 445, 476, 476, 507, 415, 446, 446, 477, 477, 508, 447, 478, + 478, 509, 479, 510, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_16x32_neighbors[513 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 16, 16, 32, 32, 48, 48, 64, 64, + 80, 80, 96, 96, 112, 112, 128, 128, 144, 144, 160, 160, + 176, 176, 192, 192, 208, 208, 224, 224, 240, 240, 256, 256, + 272, 272, 288, 288, 304, 304, 320, 320, 336, 336, 352, 352, + 368, 368, 384, 384, 400, 400, 416, 416, 432, 432, 448, 448, + 464, 464, 480, 480, 0, 0, 1, 16, 17, 32, 33, 48, + 49, 64, 65, 80, 81, 96, 97, 112, 113, 128, 129, 144, + 145, 160, 161, 176, 177, 192, 193, 208, 209, 224, 225, 240, + 241, 256, 257, 272, 273, 288, 289, 304, 305, 320, 321, 336, + 337, 352, 353, 368, 369, 384, 385, 400, 401, 416, 417, 432, + 433, 448, 449, 464, 465, 480, 481, 496, 1, 1, 2, 17, + 18, 33, 34, 49, 50, 65, 66, 81, 82, 97, 98, 113, + 114, 129, 130, 145, 146, 161, 162, 177, 178, 193, 194, 209, + 210, 225, 226, 241, 242, 257, 258, 273, 274, 289, 290, 305, + 306, 321, 322, 337, 338, 353, 354, 369, 370, 385, 386, 401, + 402, 417, 418, 433, 434, 449, 450, 465, 466, 481, 482, 497, + 2, 2, 3, 18, 19, 34, 35, 50, 51, 66, 67, 82, + 83, 98, 99, 114, 115, 130, 131, 146, 147, 162, 163, 178, + 179, 194, 195, 210, 211, 226, 227, 242, 243, 258, 259, 274, + 275, 290, 291, 306, 307, 322, 323, 338, 339, 354, 355, 370, + 371, 386, 387, 402, 403, 418, 419, 434, 435, 450, 451, 466, + 467, 482, 483, 498, 3, 3, 4, 19, 20, 35, 36, 51, + 52, 67, 68, 83, 84, 99, 100, 115, 116, 131, 132, 147, + 148, 163, 164, 179, 180, 195, 196, 211, 212, 227, 228, 243, + 244, 259, 260, 275, 276, 291, 292, 307, 308, 323, 324, 339, + 340, 355, 356, 371, 372, 387, 388, 403, 404, 419, 420, 435, + 436, 451, 452, 467, 468, 483, 484, 499, 4, 4, 5, 20, + 21, 36, 37, 52, 53, 68, 69, 84, 85, 100, 101, 116, + 117, 132, 133, 148, 149, 164, 165, 180, 181, 196, 197, 212, + 213, 228, 229, 244, 245, 260, 261, 276, 277, 292, 293, 308, + 309, 324, 325, 340, 341, 356, 357, 372, 373, 388, 389, 404, + 405, 420, 421, 436, 437, 452, 453, 468, 469, 484, 485, 500, + 5, 5, 6, 21, 22, 37, 38, 53, 54, 69, 70, 85, + 86, 101, 102, 117, 118, 133, 134, 149, 150, 165, 166, 181, + 182, 197, 198, 213, 214, 229, 230, 245, 246, 261, 262, 277, + 278, 293, 294, 309, 310, 325, 326, 341, 342, 357, 358, 373, + 374, 389, 390, 405, 406, 421, 422, 437, 438, 453, 454, 469, + 470, 485, 486, 501, 6, 6, 7, 22, 23, 38, 39, 54, + 55, 70, 71, 86, 87, 102, 103, 118, 119, 134, 135, 150, + 151, 166, 167, 182, 183, 198, 199, 214, 215, 230, 231, 246, + 247, 262, 263, 278, 279, 294, 295, 310, 311, 326, 327, 342, + 343, 358, 359, 374, 375, 390, 391, 406, 407, 422, 423, 438, + 439, 454, 455, 470, 471, 486, 487, 502, 7, 7, 8, 23, + 24, 39, 40, 55, 56, 71, 72, 87, 88, 103, 104, 119, + 120, 135, 136, 151, 152, 167, 168, 183, 184, 199, 200, 215, + 216, 231, 232, 247, 248, 263, 264, 279, 280, 295, 296, 311, + 312, 327, 328, 343, 344, 359, 360, 375, 376, 391, 392, 407, + 408, 423, 424, 439, 440, 455, 456, 471, 472, 487, 488, 503, + 8, 8, 9, 24, 25, 40, 41, 56, 57, 72, 73, 88, + 89, 104, 105, 120, 121, 136, 137, 152, 153, 168, 169, 184, + 185, 200, 201, 216, 217, 232, 233, 248, 249, 264, 265, 280, + 281, 296, 297, 312, 313, 328, 329, 344, 345, 360, 361, 376, + 377, 392, 393, 408, 409, 424, 425, 440, 441, 456, 457, 472, + 473, 488, 489, 504, 9, 9, 10, 25, 26, 41, 42, 57, + 58, 73, 74, 89, 90, 105, 106, 121, 122, 137, 138, 153, + 154, 169, 170, 185, 186, 201, 202, 217, 218, 233, 234, 249, + 250, 265, 266, 281, 282, 297, 298, 313, 314, 329, 330, 345, + 346, 361, 362, 377, 378, 393, 394, 409, 410, 425, 426, 441, + 442, 457, 458, 473, 474, 489, 490, 505, 10, 10, 11, 26, + 27, 42, 43, 58, 59, 74, 75, 90, 91, 106, 107, 122, + 123, 138, 139, 154, 155, 170, 171, 186, 187, 202, 203, 218, + 219, 234, 235, 250, 251, 266, 267, 282, 283, 298, 299, 314, + 315, 330, 331, 346, 347, 362, 363, 378, 379, 394, 395, 410, + 411, 426, 427, 442, 443, 458, 459, 474, 475, 490, 491, 506, + 11, 11, 12, 27, 28, 43, 44, 59, 60, 75, 76, 91, + 92, 107, 108, 123, 124, 139, 140, 155, 156, 171, 172, 187, + 188, 203, 204, 219, 220, 235, 236, 251, 252, 267, 268, 283, + 284, 299, 300, 315, 316, 331, 332, 347, 348, 363, 364, 379, + 380, 395, 396, 411, 412, 427, 428, 443, 444, 459, 460, 475, + 476, 491, 492, 507, 12, 12, 13, 28, 29, 44, 45, 60, + 61, 76, 77, 92, 93, 108, 109, 124, 125, 140, 141, 156, + 157, 172, 173, 188, 189, 204, 205, 220, 221, 236, 237, 252, + 253, 268, 269, 284, 285, 300, 301, 316, 317, 332, 333, 348, + 349, 364, 365, 380, 381, 396, 397, 412, 413, 428, 429, 444, + 445, 460, 461, 476, 477, 492, 493, 508, 13, 13, 14, 29, + 30, 45, 46, 61, 62, 77, 78, 93, 94, 109, 110, 125, + 126, 141, 142, 157, 158, 173, 174, 189, 190, 205, 206, 221, + 222, 237, 238, 253, 254, 269, 270, 285, 286, 301, 302, 317, + 318, 333, 334, 349, 350, 365, 366, 381, 382, 397, 398, 413, + 414, 429, 430, 445, 446, 461, 462, 477, 478, 493, 494, 509, + 14, 14, 15, 30, 31, 46, 47, 62, 63, 78, 79, 94, + 95, 110, 111, 126, 127, 142, 143, 158, 159, 174, 175, 190, + 191, 206, 207, 222, 223, 238, 239, 254, 255, 270, 271, 286, + 287, 302, 303, 318, 319, 334, 335, 350, 351, 366, 367, 382, + 383, 398, 399, 414, 415, 430, 431, 446, 447, 462, 463, 478, + 479, 494, 495, 510, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mcol_scan_32x16_neighbors[513 * MAX_NEIGHBORS]) = { + 0, 0, 0, 0, 32, 32, 64, 64, 96, 96, 128, 128, + 160, 160, 192, 192, 224, 224, 256, 256, 288, 288, 320, 320, + 352, 352, 384, 384, 416, 416, 448, 448, 0, 0, 1, 32, + 33, 64, 65, 96, 97, 128, 129, 160, 161, 192, 193, 224, + 225, 256, 257, 288, 289, 320, 321, 352, 353, 384, 385, 416, + 417, 448, 449, 480, 1, 1, 2, 33, 34, 65, 66, 97, + 98, 129, 130, 161, 162, 193, 194, 225, 226, 257, 258, 289, + 290, 321, 322, 353, 354, 385, 386, 417, 418, 449, 450, 481, + 2, 2, 3, 34, 35, 66, 67, 98, 99, 130, 131, 162, + 163, 194, 195, 226, 227, 258, 259, 290, 291, 322, 323, 354, + 355, 386, 387, 418, 419, 450, 451, 482, 3, 3, 4, 35, + 36, 67, 68, 99, 100, 131, 132, 163, 164, 195, 196, 227, + 228, 259, 260, 291, 292, 323, 324, 355, 356, 387, 388, 419, + 420, 451, 452, 483, 4, 4, 5, 36, 37, 68, 69, 100, + 101, 132, 133, 164, 165, 196, 197, 228, 229, 260, 261, 292, + 293, 324, 325, 356, 357, 388, 389, 420, 421, 452, 453, 484, + 5, 5, 6, 37, 38, 69, 70, 101, 102, 133, 134, 165, + 166, 197, 198, 229, 230, 261, 262, 293, 294, 325, 326, 357, + 358, 389, 390, 421, 422, 453, 454, 485, 6, 6, 7, 38, + 39, 70, 71, 102, 103, 134, 135, 166, 167, 198, 199, 230, + 231, 262, 263, 294, 295, 326, 327, 358, 359, 390, 391, 422, + 423, 454, 455, 486, 7, 7, 8, 39, 40, 71, 72, 103, + 104, 135, 136, 167, 168, 199, 200, 231, 232, 263, 264, 295, + 296, 327, 328, 359, 360, 391, 392, 423, 424, 455, 456, 487, + 8, 8, 9, 40, 41, 72, 73, 104, 105, 136, 137, 168, + 169, 200, 201, 232, 233, 264, 265, 296, 297, 328, 329, 360, + 361, 392, 393, 424, 425, 456, 457, 488, 9, 9, 10, 41, + 42, 73, 74, 105, 106, 137, 138, 169, 170, 201, 202, 233, + 234, 265, 266, 297, 298, 329, 330, 361, 362, 393, 394, 425, + 426, 457, 458, 489, 10, 10, 11, 42, 43, 74, 75, 106, + 107, 138, 139, 170, 171, 202, 203, 234, 235, 266, 267, 298, + 299, 330, 331, 362, 363, 394, 395, 426, 427, 458, 459, 490, + 11, 11, 12, 43, 44, 75, 76, 107, 108, 139, 140, 171, + 172, 203, 204, 235, 236, 267, 268, 299, 300, 331, 332, 363, + 364, 395, 396, 427, 428, 459, 460, 491, 12, 12, 13, 44, + 45, 76, 77, 108, 109, 140, 141, 172, 173, 204, 205, 236, + 237, 268, 269, 300, 301, 332, 333, 364, 365, 396, 397, 428, + 429, 460, 461, 492, 13, 13, 14, 45, 46, 77, 78, 109, + 110, 141, 142, 173, 174, 205, 206, 237, 238, 269, 270, 301, + 302, 333, 334, 365, 366, 397, 398, 429, 430, 461, 462, 493, + 14, 14, 15, 46, 47, 78, 79, 110, 111, 142, 143, 174, + 175, 206, 207, 238, 239, 270, 271, 302, 303, 334, 335, 366, + 367, 398, 399, 430, 431, 462, 463, 494, 15, 15, 16, 47, + 48, 79, 80, 111, 112, 143, 144, 175, 176, 207, 208, 239, + 240, 271, 272, 303, 304, 335, 336, 367, 368, 399, 400, 431, + 432, 463, 464, 495, 16, 16, 17, 48, 49, 80, 81, 112, + 113, 144, 145, 176, 177, 208, 209, 240, 241, 272, 273, 304, + 305, 336, 337, 368, 369, 400, 401, 432, 433, 464, 465, 496, + 17, 17, 18, 49, 50, 81, 82, 113, 114, 145, 146, 177, + 178, 209, 210, 241, 242, 273, 274, 305, 306, 337, 338, 369, + 370, 401, 402, 433, 434, 465, 466, 497, 18, 18, 19, 50, + 51, 82, 83, 114, 115, 146, 147, 178, 179, 210, 211, 242, + 243, 274, 275, 306, 307, 338, 339, 370, 371, 402, 403, 434, + 435, 466, 467, 498, 19, 19, 20, 51, 52, 83, 84, 115, + 116, 147, 148, 179, 180, 211, 212, 243, 244, 275, 276, 307, + 308, 339, 340, 371, 372, 403, 404, 435, 436, 467, 468, 499, + 20, 20, 21, 52, 53, 84, 85, 116, 117, 148, 149, 180, + 181, 212, 213, 244, 245, 276, 277, 308, 309, 340, 341, 372, + 373, 404, 405, 436, 437, 468, 469, 500, 21, 21, 22, 53, + 54, 85, 86, 117, 118, 149, 150, 181, 182, 213, 214, 245, + 246, 277, 278, 309, 310, 341, 342, 373, 374, 405, 406, 437, + 438, 469, 470, 501, 22, 22, 23, 54, 55, 86, 87, 118, + 119, 150, 151, 182, 183, 214, 215, 246, 247, 278, 279, 310, + 311, 342, 343, 374, 375, 406, 407, 438, 439, 470, 471, 502, + 23, 23, 24, 55, 56, 87, 88, 119, 120, 151, 152, 183, + 184, 215, 216, 247, 248, 279, 280, 311, 312, 343, 344, 375, + 376, 407, 408, 439, 440, 471, 472, 503, 24, 24, 25, 56, + 57, 88, 89, 120, 121, 152, 153, 184, 185, 216, 217, 248, + 249, 280, 281, 312, 313, 344, 345, 376, 377, 408, 409, 440, + 441, 472, 473, 504, 25, 25, 26, 57, 58, 89, 90, 121, + 122, 153, 154, 185, 186, 217, 218, 249, 250, 281, 282, 313, + 314, 345, 346, 377, 378, 409, 410, 441, 442, 473, 474, 505, + 26, 26, 27, 58, 59, 90, 91, 122, 123, 154, 155, 186, + 187, 218, 219, 250, 251, 282, 283, 314, 315, 346, 347, 378, + 379, 410, 411, 442, 443, 474, 475, 506, 27, 27, 28, 59, + 60, 91, 92, 123, 124, 155, 156, 187, 188, 219, 220, 251, + 252, 283, 284, 315, 316, 347, 348, 379, 380, 411, 412, 443, + 444, 475, 476, 507, 28, 28, 29, 60, 61, 92, 93, 124, + 125, 156, 157, 188, 189, 220, 221, 252, 253, 284, 285, 316, + 317, 348, 349, 380, 381, 412, 413, 444, 445, 476, 477, 508, + 29, 29, 30, 61, 62, 93, 94, 125, 126, 157, 158, 189, + 190, 221, 222, 253, 254, 285, 286, 317, 318, 349, 350, 381, + 382, 413, 414, 445, 446, 477, 478, 509, 30, 30, 31, 62, + 63, 94, 95, 126, 127, 158, 159, 190, 191, 222, 223, 254, + 255, 286, 287, 318, 319, 350, 351, 382, 383, 414, 415, 446, + 447, 478, 479, 510, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_16x32_neighbors[513 * 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, 48, 48, 49, 64, + 50, 65, 51, 66, 52, 67, 53, 68, 54, 69, 55, 70, + 56, 71, 57, 72, 58, 73, 59, 74, 60, 75, 61, 76, + 62, 77, 63, 78, 64, 64, 65, 80, 66, 81, 67, 82, + 68, 83, 69, 84, 70, 85, 71, 86, 72, 87, 73, 88, + 74, 89, 75, 90, 76, 91, 77, 92, 78, 93, 79, 94, + 80, 80, 81, 96, 82, 97, 83, 98, 84, 99, 85, 100, + 86, 101, 87, 102, 88, 103, 89, 104, 90, 105, 91, 106, + 92, 107, 93, 108, 94, 109, 95, 110, 96, 96, 97, 112, + 98, 113, 99, 114, 100, 115, 101, 116, 102, 117, 103, 118, + 104, 119, 105, 120, 106, 121, 107, 122, 108, 123, 109, 124, + 110, 125, 111, 126, 112, 112, 113, 128, 114, 129, 115, 130, + 116, 131, 117, 132, 118, 133, 119, 134, 120, 135, 121, 136, + 122, 137, 123, 138, 124, 139, 125, 140, 126, 141, 127, 142, + 128, 128, 129, 144, 130, 145, 131, 146, 132, 147, 133, 148, + 134, 149, 135, 150, 136, 151, 137, 152, 138, 153, 139, 154, + 140, 155, 141, 156, 142, 157, 143, 158, 144, 144, 145, 160, + 146, 161, 147, 162, 148, 163, 149, 164, 150, 165, 151, 166, + 152, 167, 153, 168, 154, 169, 155, 170, 156, 171, 157, 172, + 158, 173, 159, 174, 160, 160, 161, 176, 162, 177, 163, 178, + 164, 179, 165, 180, 166, 181, 167, 182, 168, 183, 169, 184, + 170, 185, 171, 186, 172, 187, 173, 188, 174, 189, 175, 190, + 176, 176, 177, 192, 178, 193, 179, 194, 180, 195, 181, 196, + 182, 197, 183, 198, 184, 199, 185, 200, 186, 201, 187, 202, + 188, 203, 189, 204, 190, 205, 191, 206, 192, 192, 193, 208, + 194, 209, 195, 210, 196, 211, 197, 212, 198, 213, 199, 214, + 200, 215, 201, 216, 202, 217, 203, 218, 204, 219, 205, 220, + 206, 221, 207, 222, 208, 208, 209, 224, 210, 225, 211, 226, + 212, 227, 213, 228, 214, 229, 215, 230, 216, 231, 217, 232, + 218, 233, 219, 234, 220, 235, 221, 236, 222, 237, 223, 238, + 224, 224, 225, 240, 226, 241, 227, 242, 228, 243, 229, 244, + 230, 245, 231, 246, 232, 247, 233, 248, 234, 249, 235, 250, + 236, 251, 237, 252, 238, 253, 239, 254, 240, 240, 241, 256, + 242, 257, 243, 258, 244, 259, 245, 260, 246, 261, 247, 262, + 248, 263, 249, 264, 250, 265, 251, 266, 252, 267, 253, 268, + 254, 269, 255, 270, 256, 256, 257, 272, 258, 273, 259, 274, + 260, 275, 261, 276, 262, 277, 263, 278, 264, 279, 265, 280, + 266, 281, 267, 282, 268, 283, 269, 284, 270, 285, 271, 286, + 272, 272, 273, 288, 274, 289, 275, 290, 276, 291, 277, 292, + 278, 293, 279, 294, 280, 295, 281, 296, 282, 297, 283, 298, + 284, 299, 285, 300, 286, 301, 287, 302, 288, 288, 289, 304, + 290, 305, 291, 306, 292, 307, 293, 308, 294, 309, 295, 310, + 296, 311, 297, 312, 298, 313, 299, 314, 300, 315, 301, 316, + 302, 317, 303, 318, 304, 304, 305, 320, 306, 321, 307, 322, + 308, 323, 309, 324, 310, 325, 311, 326, 312, 327, 313, 328, + 314, 329, 315, 330, 316, 331, 317, 332, 318, 333, 319, 334, + 320, 320, 321, 336, 322, 337, 323, 338, 324, 339, 325, 340, + 326, 341, 327, 342, 328, 343, 329, 344, 330, 345, 331, 346, + 332, 347, 333, 348, 334, 349, 335, 350, 336, 336, 337, 352, + 338, 353, 339, 354, 340, 355, 341, 356, 342, 357, 343, 358, + 344, 359, 345, 360, 346, 361, 347, 362, 348, 363, 349, 364, + 350, 365, 351, 366, 352, 352, 353, 368, 354, 369, 355, 370, + 356, 371, 357, 372, 358, 373, 359, 374, 360, 375, 361, 376, + 362, 377, 363, 378, 364, 379, 365, 380, 366, 381, 367, 382, + 368, 368, 369, 384, 370, 385, 371, 386, 372, 387, 373, 388, + 374, 389, 375, 390, 376, 391, 377, 392, 378, 393, 379, 394, + 380, 395, 381, 396, 382, 397, 383, 398, 384, 384, 385, 400, + 386, 401, 387, 402, 388, 403, 389, 404, 390, 405, 391, 406, + 392, 407, 393, 408, 394, 409, 395, 410, 396, 411, 397, 412, + 398, 413, 399, 414, 400, 400, 401, 416, 402, 417, 403, 418, + 404, 419, 405, 420, 406, 421, 407, 422, 408, 423, 409, 424, + 410, 425, 411, 426, 412, 427, 413, 428, 414, 429, 415, 430, + 416, 416, 417, 432, 418, 433, 419, 434, 420, 435, 421, 436, + 422, 437, 423, 438, 424, 439, 425, 440, 426, 441, 427, 442, + 428, 443, 429, 444, 430, 445, 431, 446, 432, 432, 433, 448, + 434, 449, 435, 450, 436, 451, 437, 452, 438, 453, 439, 454, + 440, 455, 441, 456, 442, 457, 443, 458, 444, 459, 445, 460, + 446, 461, 447, 462, 448, 448, 449, 464, 450, 465, 451, 466, + 452, 467, 453, 468, 454, 469, 455, 470, 456, 471, 457, 472, + 458, 473, 459, 474, 460, 475, 461, 476, 462, 477, 463, 478, + 464, 464, 465, 480, 466, 481, 467, 482, 468, 483, 469, 484, + 470, 485, 471, 486, 472, 487, 473, 488, 474, 489, 475, 490, + 476, 491, 477, 492, 478, 493, 479, 494, 480, 480, 481, 496, + 482, 497, 483, 498, 484, 499, 485, 500, 486, 501, 487, 502, + 488, 503, 489, 504, 490, 505, 491, 506, 492, 507, 493, 508, + 494, 509, 495, 510, + 0, 0 +}; + +DECLARE_ALIGNED(16, static const int16_t, + mrow_scan_32x16_neighbors[513 * 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, 224, 224, 225, 256, + 226, 257, 227, 258, 228, 259, 229, 260, 230, 261, 231, 262, + 232, 263, 233, 264, 234, 265, 235, 266, 236, 267, 237, 268, + 238, 269, 239, 270, 240, 271, 241, 272, 242, 273, 243, 274, + 244, 275, 245, 276, 246, 277, 247, 278, 248, 279, 249, 280, + 250, 281, 251, 282, 252, 283, 253, 284, 254, 285, 255, 286, + 256, 256, 257, 288, 258, 289, 259, 290, 260, 291, 261, 292, + 262, 293, 263, 294, 264, 295, 265, 296, 266, 297, 267, 298, + 268, 299, 269, 300, 270, 301, 271, 302, 272, 303, 273, 304, + 274, 305, 275, 306, 276, 307, 277, 308, 278, 309, 279, 310, + 280, 311, 281, 312, 282, 313, 283, 314, 284, 315, 285, 316, + 286, 317, 287, 318, 288, 288, 289, 320, 290, 321, 291, 322, + 292, 323, 293, 324, 294, 325, 295, 326, 296, 327, 297, 328, + 298, 329, 299, 330, 300, 331, 301, 332, 302, 333, 303, 334, + 304, 335, 305, 336, 306, 337, 307, 338, 308, 339, 309, 340, + 310, 341, 311, 342, 312, 343, 313, 344, 314, 345, 315, 346, + 316, 347, 317, 348, 318, 349, 319, 350, 320, 320, 321, 352, + 322, 353, 323, 354, 324, 355, 325, 356, 326, 357, 327, 358, + 328, 359, 329, 360, 330, 361, 331, 362, 332, 363, 333, 364, + 334, 365, 335, 366, 336, 367, 337, 368, 338, 369, 339, 370, + 340, 371, 341, 372, 342, 373, 343, 374, 344, 375, 345, 376, + 346, 377, 347, 378, 348, 379, 349, 380, 350, 381, 351, 382, + 352, 352, 353, 384, 354, 385, 355, 386, 356, 387, 357, 388, + 358, 389, 359, 390, 360, 391, 361, 392, 362, 393, 363, 394, + 364, 395, 365, 396, 366, 397, 367, 398, 368, 399, 369, 400, + 370, 401, 371, 402, 372, 403, 373, 404, 374, 405, 375, 406, + 376, 407, 377, 408, 378, 409, 379, 410, 380, 411, 381, 412, + 382, 413, 383, 414, 384, 384, 385, 416, 386, 417, 387, 418, + 388, 419, 389, 420, 390, 421, 391, 422, 392, 423, 393, 424, + 394, 425, 395, 426, 396, 427, 397, 428, 398, 429, 399, 430, + 400, 431, 401, 432, 402, 433, 403, 434, 404, 435, 405, 436, + 406, 437, 407, 438, 408, 439, 409, 440, 410, 441, 411, 442, + 412, 443, 413, 444, 414, 445, 415, 446, 416, 416, 417, 448, + 418, 449, 419, 450, 420, 451, 421, 452, 422, 453, 423, 454, + 424, 455, 425, 456, 426, 457, 427, 458, 428, 459, 429, 460, + 430, 461, 431, 462, 432, 463, 433, 464, 434, 465, 435, 466, + 436, 467, 437, 468, 438, 469, 439, 470, 440, 471, 441, 472, + 442, 473, 443, 474, 444, 475, 445, 476, 446, 477, 447, 478, + 448, 448, 449, 480, 450, 481, 451, 482, 452, 483, 453, 484, + 454, 485, 455, 486, 456, 487, 457, 488, 458, 489, 459, 490, + 460, 491, 461, 492, 462, 493, 463, 494, 464, 495, 465, 496, + 466, 497, 467, 498, 468, 499, 469, 500, 470, 501, 471, 502, + 472, 503, 473, 504, 474, 505, 475, 506, 476, 507, 477, 508, + 478, 509, 479, 510, + 0, 0 +}; + +#endif // CONFIG_EXT_TX + #if CONFIG_EXT_TX DECLARE_ALIGNED(16, static const int16_t, mcol_scan_16x16_neighbors[257 * MAX_NEIGHBORS]) = { @@ -2041,6 +3114,369 @@ DECLARE_ALIGNED(16, static const int16_t, vp10_default_iscan_8x8[64]) = { 25, 32, 39, 45, 50, 55, 59, 62, 33, 40, 46, 51, 54, 58, 61, 63, }; +#if CONFIG_EXT_TX +DECLARE_ALIGNED(16, static const int16_t, vp10_default_iscan_8x16[128]) = { + 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, 107, 67, 74, 81, 88, 95, 102, 108, 113, + 75, 82, 89, 96, 103, 109, 114, 118, 83, 90, 97, 104, + 110, 115, 119, 122, 91, 98, 105, 111, 116, 120, 123, 125, + 99, 106, 112, 117, 121, 124, 126, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_default_iscan_16x8[128]) = { + 0, 1, 3, 6, 10, 15, 21, 28, 36, 44, 52, 60, + 68, 76, 84, 92, 2, 4, 7, 11, 16, 22, 29, 37, + 45, 53, 61, 69, 77, 85, 93, 100, 5, 8, 12, 17, + 23, 30, 38, 46, 54, 62, 70, 78, 86, 94, 101, 107, + 9, 13, 18, 24, 31, 39, 47, 55, 63, 71, 79, 87, + 95, 102, 108, 113, 14, 19, 25, 32, 40, 48, 56, 64, + 72, 80, 88, 96, 103, 109, 114, 118, 20, 26, 33, 41, + 49, 57, 65, 73, 81, 89, 97, 104, 110, 115, 119, 122, + 27, 34, 42, 50, 58, 66, 74, 82, 90, 98, 105, 111, + 116, 120, 123, 125, 35, 43, 51, 59, 67, 75, 83, 91, + 99, 106, 112, 117, 121, 124, 126, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mcol_iscan_8x16[128]) = { + 0, 16, 32, 48, 64, 80, 96, 112, 1, 17, 33, 49, + 65, 81, 97, 113, 2, 18, 34, 50, 66, 82, 98, 114, + 3, 19, 35, 51, 67, 83, 99, 115, 4, 20, 36, 52, + 68, 84, 100, 116, 5, 21, 37, 53, 69, 85, 101, 117, + 6, 22, 38, 54, 70, 86, 102, 118, 7, 23, 39, 55, + 71, 87, 103, 119, 8, 24, 40, 56, 72, 88, 104, 120, + 9, 25, 41, 57, 73, 89, 105, 121, 10, 26, 42, 58, + 74, 90, 106, 122, 11, 27, 43, 59, 75, 91, 107, 123, + 12, 28, 44, 60, 76, 92, 108, 124, 13, 29, 45, 61, + 77, 93, 109, 125, 14, 30, 46, 62, 78, 94, 110, 126, + 15, 31, 47, 63, 79, 95, 111, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mcol_iscan_16x8[128]) = { + 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, + 96, 104, 112, 120, 1, 9, 17, 25, 33, 41, 49, 57, + 65, 73, 81, 89, 97, 105, 113, 121, 2, 10, 18, 26, + 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, 122, + 3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, + 99, 107, 115, 123, 4, 12, 20, 28, 36, 44, 52, 60, + 68, 76, 84, 92, 100, 108, 116, 124, 5, 13, 21, 29, + 37, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, + 6, 14, 22, 30, 38, 46, 54, 62, 70, 78, 86, 94, + 102, 110, 118, 126, 7, 15, 23, 31, 39, 47, 55, 63, + 71, 79, 87, 95, 103, 111, 119, 127, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mrow_iscan_8x16[128]) = { + 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, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mrow_iscan_16x8[128]) = { + 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, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_default_iscan_16x32[512]) = { + 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, + 78, 91, 105, 120, 2, 4, 7, 11, 16, 22, 29, 37, + 46, 56, 67, 79, 92, 106, 121, 136, 5, 8, 12, 17, + 23, 30, 38, 47, 57, 68, 80, 93, 107, 122, 137, 152, + 9, 13, 18, 24, 31, 39, 48, 58, 69, 81, 94, 108, + 123, 138, 153, 168, 14, 19, 25, 32, 40, 49, 59, 70, + 82, 95, 109, 124, 139, 154, 169, 184, 20, 26, 33, 41, + 50, 60, 71, 83, 96, 110, 125, 140, 155, 170, 185, 200, + 27, 34, 42, 51, 61, 72, 84, 97, 111, 126, 141, 156, + 171, 186, 201, 216, 35, 43, 52, 62, 73, 85, 98, 112, + 127, 142, 157, 172, 187, 202, 217, 232, 44, 53, 63, 74, + 86, 99, 113, 128, 143, 158, 173, 188, 203, 218, 233, 248, + 54, 64, 75, 87, 100, 114, 129, 144, 159, 174, 189, 204, + 219, 234, 249, 264, 65, 76, 88, 101, 115, 130, 145, 160, + 175, 190, 205, 220, 235, 250, 265, 280, 77, 89, 102, 116, + 131, 146, 161, 176, 191, 206, 221, 236, 251, 266, 281, 296, + 90, 103, 117, 132, 147, 162, 177, 192, 207, 222, 237, 252, + 267, 282, 297, 312, 104, 118, 133, 148, 163, 178, 193, 208, + 223, 238, 253, 268, 283, 298, 313, 328, 119, 134, 149, 164, + 179, 194, 209, 224, 239, 254, 269, 284, 299, 314, 329, 344, + 135, 150, 165, 180, 195, 210, 225, 240, 255, 270, 285, 300, + 315, 330, 345, 360, 151, 166, 181, 196, 211, 226, 241, 256, + 271, 286, 301, 316, 331, 346, 361, 376, 167, 182, 197, 212, + 227, 242, 257, 272, 287, 302, 317, 332, 347, 362, 377, 392, + 183, 198, 213, 228, 243, 258, 273, 288, 303, 318, 333, 348, + 363, 378, 393, 407, 199, 214, 229, 244, 259, 274, 289, 304, + 319, 334, 349, 364, 379, 394, 408, 421, 215, 230, 245, 260, + 275, 290, 305, 320, 335, 350, 365, 380, 395, 409, 422, 434, + 231, 246, 261, 276, 291, 306, 321, 336, 351, 366, 381, 396, + 410, 423, 435, 446, 247, 262, 277, 292, 307, 322, 337, 352, + 367, 382, 397, 411, 424, 436, 447, 457, 263, 278, 293, 308, + 323, 338, 353, 368, 383, 398, 412, 425, 437, 448, 458, 467, + 279, 294, 309, 324, 339, 354, 369, 384, 399, 413, 426, 438, + 449, 459, 468, 476, 295, 310, 325, 340, 355, 370, 385, 400, + 414, 427, 439, 450, 460, 469, 477, 484, 311, 326, 341, 356, + 371, 386, 401, 415, 428, 440, 451, 461, 470, 478, 485, 491, + 327, 342, 357, 372, 387, 402, 416, 429, 441, 452, 462, 471, + 479, 486, 492, 497, 343, 358, 373, 388, 403, 417, 430, 442, + 453, 463, 472, 480, 487, 493, 498, 502, 359, 374, 389, 404, + 418, 431, 443, 454, 464, 473, 481, 488, 494, 499, 503, 506, + 375, 390, 405, 419, 432, 444, 455, 465, 474, 482, 489, 495, + 500, 504, 507, 509, 391, 406, 420, 433, 445, 456, 466, 475, + 483, 490, 496, 501, 505, 508, 510, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_default_iscan_32x16[512]) = { + 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, + 78, 91, 105, 120, 136, 152, 168, 184, 200, 216, 232, 248, + 264, 280, 296, 312, 328, 344, 360, 376, 2, 4, 7, 11, + 16, 22, 29, 37, 46, 56, 67, 79, 92, 106, 121, 137, + 153, 169, 185, 201, 217, 233, 249, 265, 281, 297, 313, 329, + 345, 361, 377, 392, 5, 8, 12, 17, 23, 30, 38, 47, + 57, 68, 80, 93, 107, 122, 138, 154, 170, 186, 202, 218, + 234, 250, 266, 282, 298, 314, 330, 346, 362, 378, 393, 407, + 9, 13, 18, 24, 31, 39, 48, 58, 69, 81, 94, 108, + 123, 139, 155, 171, 187, 203, 219, 235, 251, 267, 283, 299, + 315, 331, 347, 363, 379, 394, 408, 421, 14, 19, 25, 32, + 40, 49, 59, 70, 82, 95, 109, 124, 140, 156, 172, 188, + 204, 220, 236, 252, 268, 284, 300, 316, 332, 348, 364, 380, + 395, 409, 422, 434, 20, 26, 33, 41, 50, 60, 71, 83, + 96, 110, 125, 141, 157, 173, 189, 205, 221, 237, 253, 269, + 285, 301, 317, 333, 349, 365, 381, 396, 410, 423, 435, 446, + 27, 34, 42, 51, 61, 72, 84, 97, 111, 126, 142, 158, + 174, 190, 206, 222, 238, 254, 270, 286, 302, 318, 334, 350, + 366, 382, 397, 411, 424, 436, 447, 457, 35, 43, 52, 62, + 73, 85, 98, 112, 127, 143, 159, 175, 191, 207, 223, 239, + 255, 271, 287, 303, 319, 335, 351, 367, 383, 398, 412, 425, + 437, 448, 458, 467, 44, 53, 63, 74, 86, 99, 113, 128, + 144, 160, 176, 192, 208, 224, 240, 256, 272, 288, 304, 320, + 336, 352, 368, 384, 399, 413, 426, 438, 449, 459, 468, 476, + 54, 64, 75, 87, 100, 114, 129, 145, 161, 177, 193, 209, + 225, 241, 257, 273, 289, 305, 321, 337, 353, 369, 385, 400, + 414, 427, 439, 450, 460, 469, 477, 484, 65, 76, 88, 101, + 115, 130, 146, 162, 178, 194, 210, 226, 242, 258, 274, 290, + 306, 322, 338, 354, 370, 386, 401, 415, 428, 440, 451, 461, + 470, 478, 485, 491, 77, 89, 102, 116, 131, 147, 163, 179, + 195, 211, 227, 243, 259, 275, 291, 307, 323, 339, 355, 371, + 387, 402, 416, 429, 441, 452, 462, 471, 479, 486, 492, 497, + 90, 103, 117, 132, 148, 164, 180, 196, 212, 228, 244, 260, + 276, 292, 308, 324, 340, 356, 372, 388, 403, 417, 430, 442, + 453, 463, 472, 480, 487, 493, 498, 502, 104, 118, 133, 149, + 165, 181, 197, 213, 229, 245, 261, 277, 293, 309, 325, 341, + 357, 373, 389, 404, 418, 431, 443, 454, 464, 473, 481, 488, + 494, 499, 503, 506, 119, 134, 150, 166, 182, 198, 214, 230, + 246, 262, 278, 294, 310, 326, 342, 358, 374, 390, 405, 419, + 432, 444, 455, 465, 474, 482, 489, 495, 500, 504, 507, 509, + 135, 151, 167, 183, 199, 215, 231, 247, 263, 279, 295, 311, + 327, 343, 359, 375, 391, 406, 420, 433, 445, 456, 466, 475, + 483, 490, 496, 501, 505, 508, 510, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mcol_iscan_16x32[512]) = { + 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, + 384, 416, 448, 480, 1, 33, 65, 97, 129, 161, 193, 225, + 257, 289, 321, 353, 385, 417, 449, 481, 2, 34, 66, 98, + 130, 162, 194, 226, 258, 290, 322, 354, 386, 418, 450, 482, + 3, 35, 67, 99, 131, 163, 195, 227, 259, 291, 323, 355, + 387, 419, 451, 483, 4, 36, 68, 100, 132, 164, 196, 228, + 260, 292, 324, 356, 388, 420, 452, 484, 5, 37, 69, 101, + 133, 165, 197, 229, 261, 293, 325, 357, 389, 421, 453, 485, + 6, 38, 70, 102, 134, 166, 198, 230, 262, 294, 326, 358, + 390, 422, 454, 486, 7, 39, 71, 103, 135, 167, 199, 231, + 263, 295, 327, 359, 391, 423, 455, 487, 8, 40, 72, 104, + 136, 168, 200, 232, 264, 296, 328, 360, 392, 424, 456, 488, + 9, 41, 73, 105, 137, 169, 201, 233, 265, 297, 329, 361, + 393, 425, 457, 489, 10, 42, 74, 106, 138, 170, 202, 234, + 266, 298, 330, 362, 394, 426, 458, 490, 11, 43, 75, 107, + 139, 171, 203, 235, 267, 299, 331, 363, 395, 427, 459, 491, + 12, 44, 76, 108, 140, 172, 204, 236, 268, 300, 332, 364, + 396, 428, 460, 492, 13, 45, 77, 109, 141, 173, 205, 237, + 269, 301, 333, 365, 397, 429, 461, 493, 14, 46, 78, 110, + 142, 174, 206, 238, 270, 302, 334, 366, 398, 430, 462, 494, + 15, 47, 79, 111, 143, 175, 207, 239, 271, 303, 335, 367, + 399, 431, 463, 495, 16, 48, 80, 112, 144, 176, 208, 240, + 272, 304, 336, 368, 400, 432, 464, 496, 17, 49, 81, 113, + 145, 177, 209, 241, 273, 305, 337, 369, 401, 433, 465, 497, + 18, 50, 82, 114, 146, 178, 210, 242, 274, 306, 338, 370, + 402, 434, 466, 498, 19, 51, 83, 115, 147, 179, 211, 243, + 275, 307, 339, 371, 403, 435, 467, 499, 20, 52, 84, 116, + 148, 180, 212, 244, 276, 308, 340, 372, 404, 436, 468, 500, + 21, 53, 85, 117, 149, 181, 213, 245, 277, 309, 341, 373, + 405, 437, 469, 501, 22, 54, 86, 118, 150, 182, 214, 246, + 278, 310, 342, 374, 406, 438, 470, 502, 23, 55, 87, 119, + 151, 183, 215, 247, 279, 311, 343, 375, 407, 439, 471, 503, + 24, 56, 88, 120, 152, 184, 216, 248, 280, 312, 344, 376, + 408, 440, 472, 504, 25, 57, 89, 121, 153, 185, 217, 249, + 281, 313, 345, 377, 409, 441, 473, 505, 26, 58, 90, 122, + 154, 186, 218, 250, 282, 314, 346, 378, 410, 442, 474, 506, + 27, 59, 91, 123, 155, 187, 219, 251, 283, 315, 347, 379, + 411, 443, 475, 507, 28, 60, 92, 124, 156, 188, 220, 252, + 284, 316, 348, 380, 412, 444, 476, 508, 29, 61, 93, 125, + 157, 189, 221, 253, 285, 317, 349, 381, 413, 445, 477, 509, + 30, 62, 94, 126, 158, 190, 222, 254, 286, 318, 350, 382, + 414, 446, 478, 510, 31, 63, 95, 127, 159, 191, 223, 255, + 287, 319, 351, 383, 415, 447, 479, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mcol_iscan_32x16[512]) = { + 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, + 192, 208, 224, 240, 256, 272, 288, 304, 320, 336, 352, 368, + 384, 400, 416, 432, 448, 464, 480, 496, 1, 17, 33, 49, + 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, + 257, 273, 289, 305, 321, 337, 353, 369, 385, 401, 417, 433, + 449, 465, 481, 497, 2, 18, 34, 50, 66, 82, 98, 114, + 130, 146, 162, 178, 194, 210, 226, 242, 258, 274, 290, 306, + 322, 338, 354, 370, 386, 402, 418, 434, 450, 466, 482, 498, + 3, 19, 35, 51, 67, 83, 99, 115, 131, 147, 163, 179, + 195, 211, 227, 243, 259, 275, 291, 307, 323, 339, 355, 371, + 387, 403, 419, 435, 451, 467, 483, 499, 4, 20, 36, 52, + 68, 84, 100, 116, 132, 148, 164, 180, 196, 212, 228, 244, + 260, 276, 292, 308, 324, 340, 356, 372, 388, 404, 420, 436, + 452, 468, 484, 500, 5, 21, 37, 53, 69, 85, 101, 117, + 133, 149, 165, 181, 197, 213, 229, 245, 261, 277, 293, 309, + 325, 341, 357, 373, 389, 405, 421, 437, 453, 469, 485, 501, + 6, 22, 38, 54, 70, 86, 102, 118, 134, 150, 166, 182, + 198, 214, 230, 246, 262, 278, 294, 310, 326, 342, 358, 374, + 390, 406, 422, 438, 454, 470, 486, 502, 7, 23, 39, 55, + 71, 87, 103, 119, 135, 151, 167, 183, 199, 215, 231, 247, + 263, 279, 295, 311, 327, 343, 359, 375, 391, 407, 423, 439, + 455, 471, 487, 503, 8, 24, 40, 56, 72, 88, 104, 120, + 136, 152, 168, 184, 200, 216, 232, 248, 264, 280, 296, 312, + 328, 344, 360, 376, 392, 408, 424, 440, 456, 472, 488, 504, + 9, 25, 41, 57, 73, 89, 105, 121, 137, 153, 169, 185, + 201, 217, 233, 249, 265, 281, 297, 313, 329, 345, 361, 377, + 393, 409, 425, 441, 457, 473, 489, 505, 10, 26, 42, 58, + 74, 90, 106, 122, 138, 154, 170, 186, 202, 218, 234, 250, + 266, 282, 298, 314, 330, 346, 362, 378, 394, 410, 426, 442, + 458, 474, 490, 506, 11, 27, 43, 59, 75, 91, 107, 123, + 139, 155, 171, 187, 203, 219, 235, 251, 267, 283, 299, 315, + 331, 347, 363, 379, 395, 411, 427, 443, 459, 475, 491, 507, + 12, 28, 44, 60, 76, 92, 108, 124, 140, 156, 172, 188, + 204, 220, 236, 252, 268, 284, 300, 316, 332, 348, 364, 380, + 396, 412, 428, 444, 460, 476, 492, 508, 13, 29, 45, 61, + 77, 93, 109, 125, 141, 157, 173, 189, 205, 221, 237, 253, + 269, 285, 301, 317, 333, 349, 365, 381, 397, 413, 429, 445, + 461, 477, 493, 509, 14, 30, 46, 62, 78, 94, 110, 126, + 142, 158, 174, 190, 206, 222, 238, 254, 270, 286, 302, 318, + 334, 350, 366, 382, 398, 414, 430, 446, 462, 478, 494, 510, + 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, + 207, 223, 239, 255, 271, 287, 303, 319, 335, 351, 367, 383, + 399, 415, 431, 447, 463, 479, 495, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mrow_iscan_16x32[512]) = { + 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, +}; + +DECLARE_ALIGNED(16, static const int16_t, vp10_mrow_iscan_32x16[512]) = { + 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, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, +}; + +#endif // CONFIG_EXT_TX + #if CONFIG_EXT_TX DECLARE_ALIGNED(16, static const int16_t, vp10_mcol_iscan_16x16[256]) = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, @@ -2733,129 +4169,212 @@ const scan_order vp10_intra_scan_orders[TX_SIZES][TX_TYPES] = { }; const scan_order vp10_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = { - { - // TX_4X4 - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors }, - { mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors }, - { mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors }, - { mcol_scan_4x4, vp10_mcol_iscan_4x4, mcol_scan_4x4_neighbors }, - { mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors }, - { mcol_scan_4x4, vp10_mcol_iscan_4x4, mcol_scan_4x4_neighbors }, - { mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors }, - { mcol_scan_4x4, vp10_mcol_iscan_4x4, mcol_scan_4x4_neighbors }, - }, - { - // TX_8X8 - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors }, - { mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors }, - { mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors }, - { mcol_scan_8x8, vp10_mcol_iscan_8x8, mcol_scan_8x8_neighbors }, - { mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors }, - { mcol_scan_8x8, vp10_mcol_iscan_8x8, mcol_scan_8x8_neighbors }, - { mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors }, - { mcol_scan_8x8, vp10_mcol_iscan_8x8, mcol_scan_8x8_neighbors }, - }, - { - // TX_16X16 - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { default_scan_16x16, vp10_default_iscan_16x16, - default_scan_16x16_neighbors }, - { mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors }, - { mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors }, - { mcol_scan_16x16, vp10_mcol_iscan_16x16, mcol_scan_16x16_neighbors }, - { mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors }, - { mcol_scan_16x16, vp10_mcol_iscan_16x16, mcol_scan_16x16_neighbors }, - { mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors }, - { mcol_scan_16x16, vp10_mcol_iscan_16x16, mcol_scan_16x16_neighbors }, - }, - { - // TX_32X32 - { default_scan_32x32, vp10_default_iscan_32x32, - default_scan_32x32_neighbors }, - { h2_scan_32x32, vp10_h2_iscan_32x32, h2_scan_32x32_neighbors }, - { v2_scan_32x32, vp10_v2_iscan_32x32, v2_scan_32x32_neighbors }, - { qtr_scan_32x32, vp10_qtr_iscan_32x32, qtr_scan_32x32_neighbors }, - { h2_scan_32x32, vp10_h2_iscan_32x32, h2_scan_32x32_neighbors }, - { v2_scan_32x32, vp10_v2_iscan_32x32, v2_scan_32x32_neighbors }, - { qtr_scan_32x32, vp10_qtr_iscan_32x32, qtr_scan_32x32_neighbors }, - { qtr_scan_32x32, vp10_qtr_iscan_32x32, qtr_scan_32x32_neighbors }, - { qtr_scan_32x32, vp10_qtr_iscan_32x32, qtr_scan_32x32_neighbors }, - { mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors }, - { mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors }, - { mcol_scan_32x32, vp10_mcol_iscan_32x32, mcol_scan_32x32_neighbors }, - { mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors }, - { mcol_scan_32x32, vp10_mcol_iscan_32x32, mcol_scan_32x32_neighbors }, - { mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors }, - { mcol_scan_32x32, vp10_mcol_iscan_32x32, mcol_scan_32x32_neighbors }, - }, - { - // TX_4X8 - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors }, - { mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors }, - { mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors }, - { mcol_scan_4x8, vp10_mcol_iscan_4x8, mcol_scan_4x8_neighbors }, - { mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors }, - { mcol_scan_4x8, vp10_mcol_iscan_4x8, mcol_scan_4x8_neighbors }, - { mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors }, - { mcol_scan_4x8, vp10_mcol_iscan_4x8, mcol_scan_4x8_neighbors }, - }, - { - // TX_8X4 - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors }, - { mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors }, - { mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors }, - { mcol_scan_8x4, vp10_mcol_iscan_8x4, mcol_scan_8x4_neighbors }, - { mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors }, - { mcol_scan_8x4, vp10_mcol_iscan_8x4, mcol_scan_8x4_neighbors }, - { mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors }, - { mcol_scan_8x4, vp10_mcol_iscan_8x4, mcol_scan_8x4_neighbors }, + { // TX_4X4 + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {default_scan_4x4, vp10_default_iscan_4x4, default_scan_4x4_neighbors}, + {mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors}, + {mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors}, + {mcol_scan_4x4, vp10_mcol_iscan_4x4, mcol_scan_4x4_neighbors}, + {mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors}, + {mcol_scan_4x4, vp10_mcol_iscan_4x4, mcol_scan_4x4_neighbors}, + {mrow_scan_4x4, vp10_mrow_iscan_4x4, mrow_scan_4x4_neighbors}, + {mcol_scan_4x4, vp10_mcol_iscan_4x4, mcol_scan_4x4_neighbors}, + }, { // TX_8X8 + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {default_scan_8x8, vp10_default_iscan_8x8, default_scan_8x8_neighbors}, + {mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors}, + {mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors}, + {mcol_scan_8x8, vp10_mcol_iscan_8x8, mcol_scan_8x8_neighbors}, + {mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors}, + {mcol_scan_8x8, vp10_mcol_iscan_8x8, mcol_scan_8x8_neighbors}, + {mrow_scan_8x8, vp10_mrow_iscan_8x8, mrow_scan_8x8_neighbors}, + {mcol_scan_8x8, vp10_mcol_iscan_8x8, mcol_scan_8x8_neighbors}, + }, { // TX_16X16 + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {default_scan_16x16, vp10_default_iscan_16x16, + default_scan_16x16_neighbors}, + {mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors}, + {mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors}, + {mcol_scan_16x16, vp10_mcol_iscan_16x16, mcol_scan_16x16_neighbors}, + {mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors}, + {mcol_scan_16x16, vp10_mcol_iscan_16x16, mcol_scan_16x16_neighbors}, + {mrow_scan_16x16, vp10_mrow_iscan_16x16, mrow_scan_16x16_neighbors}, + {mcol_scan_16x16, vp10_mcol_iscan_16x16, mcol_scan_16x16_neighbors}, + }, { // TX_32X32 + {default_scan_32x32, vp10_default_iscan_32x32, + default_scan_32x32_neighbors}, + {h2_scan_32x32, vp10_h2_iscan_32x32, + h2_scan_32x32_neighbors}, + {v2_scan_32x32, vp10_v2_iscan_32x32, + v2_scan_32x32_neighbors}, + {qtr_scan_32x32, vp10_qtr_iscan_32x32, + qtr_scan_32x32_neighbors}, + {h2_scan_32x32, vp10_h2_iscan_32x32, + h2_scan_32x32_neighbors}, + {v2_scan_32x32, vp10_v2_iscan_32x32, + v2_scan_32x32_neighbors}, + {qtr_scan_32x32, vp10_qtr_iscan_32x32, + qtr_scan_32x32_neighbors}, + {qtr_scan_32x32, vp10_qtr_iscan_32x32, + qtr_scan_32x32_neighbors}, + {qtr_scan_32x32, vp10_qtr_iscan_32x32, + qtr_scan_32x32_neighbors}, + {mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors}, + {mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors}, + {mcol_scan_32x32, vp10_mcol_iscan_32x32, mcol_scan_32x32_neighbors}, + {mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors}, + {mcol_scan_32x32, vp10_mcol_iscan_32x32, mcol_scan_32x32_neighbors}, + {mrow_scan_32x32, vp10_mrow_iscan_32x32, mrow_scan_32x32_neighbors}, + {mcol_scan_32x32, vp10_mcol_iscan_32x32, mcol_scan_32x32_neighbors}, + }, { // TX_4X8 + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {default_scan_4x8, vp10_default_iscan_4x8, default_scan_4x8_neighbors}, + {mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors}, + {mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors}, + {mcol_scan_4x8, vp10_mcol_iscan_4x8, mcol_scan_4x8_neighbors}, + {mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors}, + {mcol_scan_4x8, vp10_mcol_iscan_4x8, mcol_scan_4x8_neighbors}, + {mrow_scan_4x8, vp10_mrow_iscan_4x8, mrow_scan_4x8_neighbors}, + {mcol_scan_4x8, vp10_mcol_iscan_4x8, mcol_scan_4x8_neighbors}, + }, { // TX_8X4 + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {default_scan_8x4, vp10_default_iscan_8x4, default_scan_8x4_neighbors}, + {mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors}, + {mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors}, + {mcol_scan_8x4, vp10_mcol_iscan_8x4, mcol_scan_8x4_neighbors}, + {mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors}, + {mcol_scan_8x4, vp10_mcol_iscan_8x4, mcol_scan_8x4_neighbors}, + {mrow_scan_8x4, vp10_mrow_iscan_8x4, mrow_scan_8x4_neighbors}, + {mcol_scan_8x4, vp10_mcol_iscan_8x4, mcol_scan_8x4_neighbors}, + }, { // TX_8X16 + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {default_scan_8x16, vp10_default_iscan_8x16, default_scan_8x16_neighbors}, + {mrow_scan_8x16, vp10_mrow_iscan_8x16, mrow_scan_8x16_neighbors}, + {mrow_scan_8x16, vp10_mrow_iscan_8x16, mrow_scan_8x16_neighbors}, + {mcol_scan_8x16, vp10_mcol_iscan_8x16, mcol_scan_8x16_neighbors}, + {mrow_scan_8x16, vp10_mrow_iscan_8x16, mrow_scan_8x16_neighbors}, + {mcol_scan_8x16, vp10_mcol_iscan_8x16, mcol_scan_8x16_neighbors}, + {mrow_scan_8x16, vp10_mrow_iscan_8x16, mrow_scan_8x16_neighbors}, + {mcol_scan_8x16, vp10_mcol_iscan_8x16, mcol_scan_8x16_neighbors}, + }, { // TX_16X8 + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {default_scan_16x8, vp10_default_iscan_16x8, default_scan_16x8_neighbors}, + {mrow_scan_16x8, vp10_mrow_iscan_16x8, mrow_scan_16x8_neighbors}, + {mrow_scan_16x8, vp10_mrow_iscan_16x8, mrow_scan_16x8_neighbors}, + {mcol_scan_16x8, vp10_mcol_iscan_16x8, mcol_scan_16x8_neighbors}, + {mrow_scan_16x8, vp10_mrow_iscan_16x8, mrow_scan_16x8_neighbors}, + {mcol_scan_16x8, vp10_mcol_iscan_16x8, mcol_scan_16x8_neighbors}, + {mrow_scan_16x8, vp10_mrow_iscan_16x8, mrow_scan_16x8_neighbors}, + {mcol_scan_16x8, vp10_mcol_iscan_16x8, mcol_scan_16x8_neighbors}, + }, { // TX_16X32 + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {default_scan_16x32, vp10_default_iscan_16x32, + default_scan_16x32_neighbors}, + {mrow_scan_16x32, vp10_mrow_iscan_16x32, mrow_scan_16x32_neighbors}, + {mrow_scan_16x32, vp10_mrow_iscan_16x32, mrow_scan_16x32_neighbors}, + {mcol_scan_16x32, vp10_mcol_iscan_16x32, mcol_scan_16x32_neighbors}, + {mrow_scan_16x32, vp10_mrow_iscan_16x32, mrow_scan_16x32_neighbors}, + {mcol_scan_16x32, vp10_mcol_iscan_16x32, mcol_scan_16x32_neighbors}, + {mrow_scan_16x32, vp10_mrow_iscan_16x32, mrow_scan_16x32_neighbors}, + {mcol_scan_16x32, vp10_mcol_iscan_16x32, mcol_scan_16x32_neighbors}, + }, { // TX_32X16 + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {default_scan_32x16, vp10_default_iscan_32x16, + default_scan_32x16_neighbors}, + {mrow_scan_32x16, vp10_mrow_iscan_32x16, mrow_scan_32x16_neighbors}, + {mrow_scan_32x16, vp10_mrow_iscan_32x16, mrow_scan_32x16_neighbors}, + {mcol_scan_32x16, vp10_mcol_iscan_32x16, mcol_scan_32x16_neighbors}, + {mrow_scan_32x16, vp10_mrow_iscan_32x16, mrow_scan_32x16_neighbors}, + {mcol_scan_32x16, vp10_mcol_iscan_32x16, mcol_scan_32x16_neighbors}, + {mrow_scan_32x16, vp10_mrow_iscan_32x16, mrow_scan_32x16_neighbors}, + {mcol_scan_32x16, vp10_mcol_iscan_32x16, mcol_scan_32x16_neighbors}, } }; diff --git a/vp10/common/vp10_rtcd_defs.pl b/vp10/common/vp10_rtcd_defs.pl index b82b26349..a574b8892 100644 --- a/vp10/common/vp10_rtcd_defs.pl +++ b/vp10/common/vp10_rtcd_defs.pl @@ -60,11 +60,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht4x4_16_add/; + add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x4_32_add/; - add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; - specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht8x16_128_add/; + + add_proto qw/void vp10_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x8_128_add/; + + add_proto qw/void vp10_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x32_512_add/; + + add_proto qw/void vp10_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht32x16_512_add/; add_proto qw/void vp10_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x8_64_add/; @@ -126,11 +138,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht4x4_16_add sse2/; + add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x4_32_add/; - add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; - specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht8x16_128_add/; + + add_proto qw/void vp10_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x8_128_add/; + + add_proto qw/void vp10_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x32_512_add/; + + add_proto qw/void vp10_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht32x16_512_add/; add_proto qw/void vp10_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x8_64_add sse2/; @@ -195,11 +219,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht4x4_16_add/; + add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x4_32_add/; - add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; - specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht8x16_128_add/; + + add_proto qw/void vp10_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x8_128_add/; + + add_proto qw/void vp10_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x32_512_add/; + + add_proto qw/void vp10_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht32x16_512_add/; add_proto qw/void vp10_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x8_64_add/; @@ -237,11 +273,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht4x4_16_add sse2 neon dspr2/; + add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x4_32_add/; - add_proto qw/void vp10_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; - specialize qw/vp10_iht4x8_32_add/; + add_proto qw/void vp10_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht8x16_128_add/; + + add_proto qw/void vp10_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x8_128_add/; + + add_proto qw/void vp10_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht16x32_512_add/; + + add_proto qw/void vp10_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; + specialize qw/vp10_iht32x16_512_add/; add_proto qw/void vp10_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type"; specialize qw/vp10_iht8x8_64_add sse2 neon dspr2/; @@ -382,11 +430,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_highbd_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; specialize qw/vp10_highbd_iht4x4_16_add/; + add_proto qw/void vp10_highbd_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; + specialize qw/vp10_highbd_iht4x8_32_add/; + add_proto qw/void vp10_highbd_iht8x4_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; specialize qw/vp10_highbd_iht8x4_32_add/; - add_proto qw/void vp10_highbd_iht4x8_32_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; - specialize qw/vp10_highbd_iht4x8_32_add/; + add_proto qw/void vp10_highbd_iht8x16_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; + specialize qw/vp10_highbd_iht8x16_128_add/; + + add_proto qw/void vp10_highbd_iht16x8_128_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; + specialize qw/vp10_highbd_iht16x8_128_add/; + + add_proto qw/void vp10_highbd_iht16x32_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; + specialize qw/vp10_highbd_iht16x32_512_add/; + + add_proto qw/void vp10_highbd_iht32x16_512_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; + specialize qw/vp10_highbd_iht32x16_512_add/; add_proto qw/void vp10_highbd_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type, int bd"; specialize qw/vp10_highbd_iht8x8_64_add/; @@ -439,11 +499,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_fht4x4 sse2/; + add_proto qw/void vp10_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht4x8/; + add_proto qw/void vp10_fht8x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_fht8x4/; - add_proto qw/void vp10_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; - specialize qw/vp10_fht4x8/; + add_proto qw/void vp10_fht8x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht8x16/; + + add_proto qw/void vp10_fht16x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht16x8/; + + add_proto qw/void vp10_fht16x32/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht16x32/; + + add_proto qw/void vp10_fht32x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht32x16/; add_proto qw/void vp10_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_fht8x8 sse2/; @@ -460,11 +532,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_fht4x4 sse2/; + add_proto qw/void vp10_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht4x8/; + add_proto qw/void vp10_fht8x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_fht8x4/; - add_proto qw/void vp10_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; - specialize qw/vp10_fht4x8/; + add_proto qw/void vp10_fht8x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht8x16/; + + add_proto qw/void vp10_fht16x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht16x8/; + + add_proto qw/void vp10_fht16x32/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht16x32/; + + add_proto qw/void vp10_fht32x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_fht32x16/; add_proto qw/void vp10_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_fht8x8 sse2/; @@ -743,11 +827,23 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vp10_highbd_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_highbd_fht4x4 sse4_1/; + add_proto qw/void vp10_highbd_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_highbd_fht4x8/; + add_proto qw/void vp10_highbd_fht8x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_highbd_fht8x4/; - add_proto qw/void vp10_highbd_fht4x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; - specialize qw/vp10_highbd_fht4x8/; + add_proto qw/void vp10_highbd_fht8x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_highbd_fht8x16/; + + add_proto qw/void vp10_highbd_fht16x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_highbd_fht16x8/; + + add_proto qw/void vp10_highbd_fht16x32/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_highbd_fht16x32/; + + add_proto qw/void vp10_highbd_fht32x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; + specialize qw/vp10_highbd_fht32x16/; add_proto qw/void vp10_highbd_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type"; specialize qw/vp10_highbd_fht8x8/; diff --git a/vp10/encoder/dct.c b/vp10/encoder/dct.c index 022a77f58..243d0f57a 100644 --- a/vp10/encoder/dct.c +++ b/vp10/encoder/dct.c @@ -1251,6 +1251,82 @@ static const transform_2d FHT_8x4[] = { { fadst4, fidtx8 }, // V_FLIPADST { fidtx4, fadst8 }, // H_FLIPADST }; + +static const transform_2d FHT_8x16[] = { + { fdct16, fdct8 }, // DCT_DCT + { fadst16, fdct8 }, // ADST_DCT + { fdct16, fadst8 }, // DCT_ADST + { fadst16, fadst8 }, // ADST_ADST + { fadst16, fdct8 }, // FLIPADST_DCT + { fdct16, fadst8 }, // DCT_FLIPADST + { fadst16, fadst8 }, // FLIPADST_FLIPADST + { fadst16, fadst8 }, // ADST_FLIPADST + { fadst16, fadst8 }, // FLIPADST_ADST + { fidtx16, fidtx8 }, // IDTX + { fdct16, fidtx8 }, // V_DCT + { fidtx16, fdct8 }, // H_DCT + { fadst16, fidtx8 }, // V_ADST + { fidtx16, fadst8 }, // H_ADST + { fadst16, fidtx8 }, // V_FLIPADST + { fidtx16, fadst8 }, // H_FLIPADST +}; + +static const transform_2d FHT_16x8[] = { + { fdct8, fdct16 }, // DCT_DCT + { fadst8, fdct16 }, // ADST_DCT + { fdct8, fadst16 }, // DCT_ADST + { fadst8, fadst16 }, // ADST_ADST + { fadst8, fdct16 }, // FLIPADST_DCT + { fdct8, fadst16 }, // DCT_FLIPADST + { fadst8, fadst16 }, // FLIPADST_FLIPADST + { fadst8, fadst16 }, // ADST_FLIPADST + { fadst8, fadst16 }, // FLIPADST_ADST + { fidtx8, fidtx16 }, // IDTX + { fdct8, fidtx16 }, // V_DCT + { fidtx8, fdct16 }, // H_DCT + { fadst8, fidtx16 }, // V_ADST + { fidtx8, fadst16 }, // H_ADST + { fadst8, fidtx16 }, // V_FLIPADST + { fidtx8, fadst16 }, // H_FLIPADST +}; + +static const transform_2d FHT_16x32[] = { + { fdct32, fdct16 }, // DCT_DCT + { fhalfright32, fdct16 }, // ADST_DCT + { fdct32, fadst16 }, // DCT_ADST + { fhalfright32, fadst16 }, // ADST_ADST + { fhalfright32, fdct16 }, // FLIPADST_DCT + { fdct32, fadst16 }, // DCT_FLIPADST + { fhalfright32, fadst16 }, // FLIPADST_FLIPADST + { fhalfright32, fadst16 }, // ADST_FLIPADST + { fhalfright32, fadst16 }, // FLIPADST_ADST + { fidtx32, fidtx16 }, // IDTX + { fdct32, fidtx16 }, // V_DCT + { fidtx32, fdct16 }, // H_DCT + { fhalfright32, fidtx16 }, // V_ADST + { fidtx32, fadst16 }, // H_ADST + { fhalfright32, fidtx16 }, // V_FLIPADST + { fidtx32, fadst16 }, // H_FLIPADST +}; + +static const transform_2d FHT_32x16[] = { + { fdct16, fdct32 }, // DCT_DCT + { fadst16, fdct32 }, // ADST_DCT + { fdct16, fhalfright32 }, // DCT_ADST + { fadst16, fhalfright32 }, // ADST_ADST + { fadst16, fdct32 }, // FLIPADST_DCT + { fdct16, fhalfright32 }, // DCT_FLIPADST + { fadst16, fhalfright32 }, // FLIPADST_FLIPADST + { fadst16, fhalfright32 }, // ADST_FLIPADST + { fadst16, fhalfright32 }, // FLIPADST_ADST + { fidtx16, fidtx32 }, // IDTX + { fdct16, fidtx32 }, // V_DCT + { fidtx16, fdct32 }, // H_DCT + { fadst16, fidtx32 }, // V_ADST + { fidtx16, fhalfright32 }, // H_ADST + { fadst16, fidtx32 }, // V_FLIPADST + { fidtx16, fhalfright32 }, // H_FLIPADST +}; #endif // CONFIG_EXT_TX void vp10_fht4x4_c(const int16_t *input, tran_low_t *output, int stride, @@ -1299,10 +1375,12 @@ void vp10_fht4x8_c(const int16_t *input, tran_low_t *output, int stride, // Columns for (i = 0; i < n; ++i) { - for (j = 0; j < n2; ++j) temp_in[j] = input[j * stride + i] * 8; + for (j = 0; j < n2; ++j) + temp_in[j] = (tran_low_t)fdct_round_shift( + input[j * stride + i] * 8 * Sqrt2); ht.cols(temp_in, temp_out); for (j = 0; j < n2; ++j) - out[j * n + i] = (tran_low_t)fdct_round_shift(temp_out[j] * Sqrt2); + out[j * n + i] = temp_out[j]; } // Rows @@ -1327,10 +1405,12 @@ void vp10_fht8x4_c(const int16_t *input, tran_low_t *output, int stride, // Columns for (i = 0; i < n2; ++i) { - for (j = 0; j < n; ++j) temp_in[j] = input[j * stride + i] * 8; + for (j = 0; j < n; ++j) + temp_in[j] = (tran_low_t)fdct_round_shift( + input[j * stride + i] * 8 * Sqrt2); ht.cols(temp_in, temp_out); for (j = 0; j < n; ++j) - out[j * n2 + i] = (tran_low_t)fdct_round_shift(temp_out[j] * Sqrt2); + out[j * n2 + i] = temp_out[j]; } // Rows @@ -1341,6 +1421,137 @@ void vp10_fht8x4_c(const int16_t *input, tran_low_t *output, int stride, } // Note: overall scale factor of transform is 8 times unitary } + +void vp10_fht8x16_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + const int n = 8; + const int n2 = 16; + tran_low_t out[16 * 8]; + tran_low_t temp_in[16], temp_out[16]; + int i, j; + const transform_2d ht = FHT_8x16[tx_type]; + int16_t flipped_input[16 * 8]; + maybe_flip_input(&input, &stride, n2, n, flipped_input, tx_type); + + // Columns + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) + temp_in[j] = (tran_low_t)fdct_round_shift( + input[j * stride + i] * 4 * Sqrt2); + ht.cols(temp_in, temp_out); + for (j = 0; j < n2; ++j) + out[j * n + i] = temp_out[j]; + } + + // Rows + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) + temp_in[j] = out[j + i * n]; + ht.rows(temp_in, temp_out); + for (j = 0; j < n; ++j) + output[j + i * n] = (temp_out[j] + 1) >> 1; + } + // Note: overall scale factor of transform is 8 times unitary +} + +void vp10_fht16x8_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + const int n = 8; + const int n2 = 16; + tran_low_t out[16 * 8]; + tran_low_t temp_in[16], temp_out[16]; + int i, j; + const transform_2d ht = FHT_16x8[tx_type]; + int16_t flipped_input[16 * 8]; + maybe_flip_input(&input, &stride, n, n2, flipped_input, tx_type); + + // Columns + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) + temp_in[j] = (tran_low_t)fdct_round_shift( + input[j * stride + i] * 4 * Sqrt2); + ht.cols(temp_in, temp_out); + for (j = 0; j < n; ++j) + out[j * n2 + i] = temp_out[j]; + } + + // Rows + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) + temp_in[j] = out[j + i * n2]; + ht.rows(temp_in, temp_out); + for (j = 0; j < n2; ++j) + output[j + i * n2] = (temp_out[j] + 1) >> 1; + } + // Note: overall scale factor of transform is 8 times unitary +} + +void vp10_fht16x32_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + const int n = 16; + const int n2 = 32; + tran_low_t out[32 * 16]; + tran_low_t temp_in[32], temp_out[32]; + int i, j; + const transform_2d ht = FHT_16x32[tx_type]; + int16_t flipped_input[32 * 16]; + maybe_flip_input(&input, &stride, n2, n, flipped_input, tx_type); + + // Columns + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) + temp_in[j] = (tran_low_t)fdct_round_shift( + input[j * stride + i] * Sqrt2); + ht.cols(temp_in, temp_out); + for (j = 0; j < n2; ++j) + out[j * n + i] = temp_out[j]; + } + + // Rows + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) + temp_in[j] = out[j + i * n]; + ht.rows(temp_in, temp_out); + for (j = 0; j < n; ++j) + output[j + i * n] = + (tran_low_t)((temp_out[j] + 1 + (temp_out[j] < 0)) >> 2); + } + // Note: overall scale factor of transform is 4 times unitary +} + +void vp10_fht32x16_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + const int n = 16; + const int n2 = 32; + tran_low_t out[32 * 16]; + tran_low_t temp_in[32], temp_out[32]; + int i, j; + const transform_2d ht = FHT_32x16[tx_type]; + int16_t flipped_input[32 * 16]; + maybe_flip_input(&input, &stride, n, n2, flipped_input, tx_type); + + // Columns + for (i = 0; i < n2; ++i) { + for (j = 0; j < n; ++j) + temp_in[j] = (tran_low_t)fdct_round_shift( + input[j * stride + i] * Sqrt2); + ht.cols(temp_in, temp_out); + for (j = 0; j < n; ++j) + out[j * n2 + i] = temp_out[j]; + } + + // Rows + for (i = 0; i < n; ++i) { + for (j = 0; j < n2; ++j) + temp_in[j] = out[j + i * n2]; + ht.rows(temp_in, temp_out); + for (j = 0; j < n2; ++j) + output[j + i * n2] = + (tran_low_t)((temp_out[j] + 1 + (temp_out[j] < 0)) >> 2); + } + // Note: overall scale factor of transform is 4 times unitary +} + #endif // CONFIG_EXT_TX void vp10_fdct8x8_quant_c(const int16_t *input, int stride, @@ -1578,14 +1789,34 @@ void vp10_highbd_fht4x4_c(const int16_t *input, tran_low_t *output, int stride, } #if CONFIG_EXT_TX -void vp10_highbd_fht8x4_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { +void vp10_highbd_fht4x8_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + vp10_fht4x8_c(input, output, stride, tx_type); +} + +void vp10_highbd_fht8x4_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { vp10_fht8x4_c(input, output, stride, tx_type); } -void vp10_highbd_fht4x8_c(const int16_t *input, tran_low_t *output, int stride, - int tx_type) { - vp10_fht4x8_c(input, output, stride, tx_type); +void vp10_highbd_fht8x16_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + vp10_fht8x16_c(input, output, stride, tx_type); +} + +void vp10_highbd_fht16x8_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + vp10_fht16x8_c(input, output, stride, tx_type); +} + +void vp10_highbd_fht16x32_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + vp10_fht16x32_c(input, output, stride, tx_type); +} + +void vp10_highbd_fht32x16_c(const int16_t *input, tran_low_t *output, + int stride, int tx_type) { + vp10_fht32x16_c(input, output, stride, tx_type); } #endif // CONFIG_EXT_TX diff --git a/vp10/encoder/hybrid_fwd_txfm.c b/vp10/encoder/hybrid_fwd_txfm.c index f385262a8..72100cc1a 100644 --- a/vp10/encoder/hybrid_fwd_txfm.c +++ b/vp10/encoder/hybrid_fwd_txfm.c @@ -55,18 +55,46 @@ static void fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, } #if CONFIG_EXT_TX -static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, +static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, TX_TYPE tx_type, FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; - vp10_fht8x4(src_diff, coeff, diff_stride, tx_type); + (void) fwd_txfm_opt; + vp10_fht4x8(src_diff, coeff, diff_stride, tx_type); } -static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, +static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, TX_TYPE tx_type, FWD_TXFM_OPT fwd_txfm_opt) { - (void)fwd_txfm_opt; - vp10_fht4x8(src_diff, coeff, diff_stride, tx_type); + (void) fwd_txfm_opt; + vp10_fht8x4(src_diff, coeff, diff_stride, tx_type); +} + +static void fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt) { + (void) fwd_txfm_opt; + vp10_fht8x16(src_diff, coeff, diff_stride, tx_type); +} + +static void fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt) { + (void) fwd_txfm_opt; + vp10_fht16x8(src_diff, coeff, diff_stride, tx_type); +} + +static void fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt) { + (void) fwd_txfm_opt; + vp10_fht16x32(src_diff, coeff, diff_stride, tx_type); +} + +static void fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt) { + (void) fwd_txfm_opt; + vp10_fht32x16(src_diff, coeff, diff_stride, tx_type); } #endif // CONFIG_EXT_TX @@ -213,20 +241,52 @@ static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff, } #if CONFIG_EXT_TX -static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, +static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, TX_TYPE tx_type, FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; - (void)bd; - vp10_highbd_fht8x4(src_diff, coeff, diff_stride, tx_type); + (void) fwd_txfm_opt; + (void) bd; + vp10_highbd_fht4x8(src_diff, coeff, diff_stride, tx_type); } -static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff, +static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, TX_TYPE tx_type, FWD_TXFM_OPT fwd_txfm_opt, const int bd) { - (void)fwd_txfm_opt; - (void)bd; - vp10_highbd_fht4x8(src_diff, coeff, diff_stride, tx_type); + (void) fwd_txfm_opt; + (void) bd; + vp10_highbd_fht8x4(src_diff, coeff, diff_stride, tx_type); +} + +static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + (void) fwd_txfm_opt; + (void) bd; + vp10_highbd_fht8x16(src_diff, coeff, diff_stride, tx_type); +} + +static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + (void) fwd_txfm_opt; + (void) bd; + vp10_highbd_fht16x8(src_diff, coeff, diff_stride, tx_type); +} + +static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + (void) fwd_txfm_opt; + (void) bd; + vp10_highbd_fht16x32(src_diff, coeff, diff_stride, tx_type); +} + +static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff, + int diff_stride, TX_TYPE tx_type, + FWD_TXFM_OPT fwd_txfm_opt, const int bd) { + (void) fwd_txfm_opt; + (void) bd; + vp10_highbd_fht32x16(src_diff, coeff, diff_stride, tx_type); } #endif // CONFIG_EXT_TX @@ -361,6 +421,18 @@ void fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, int diff_stride, case TX_8X4: fwd_txfm_8x4(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); break; + case TX_8X16: + fwd_txfm_8x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + break; + case TX_16X8: + fwd_txfm_16x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + break; + case TX_16X32: + fwd_txfm_16x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + break; + case TX_32X16: + fwd_txfm_32x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt); + break; #endif // CONFIG_EXT_TX case TX_4X4: fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, lossless); @@ -400,11 +472,30 @@ void highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff, highbd_fwd_txfm_8x4(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt, bd); break; + case TX_8X16: + highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, tx_type, + fwd_txfm_opt, bd); + break; + case TX_16X8: + highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, tx_type, + fwd_txfm_opt, bd); + break; + case TX_16X32: + highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, tx_type, + fwd_txfm_opt, bd); + break; + case TX_32X16: + highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, tx_type, + fwd_txfm_opt, bd); + break; #endif // CONFIG_EXT_TX case TX_4X4: - highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, lossless, bd); + highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, + lossless, bd); + break; + default: + assert(0); break; - default: assert(0); break; } } #endif // CONFIG_VP9_HIGHBITDEPTH diff --git a/vp10/encoder/rd.c b/vp10/encoder/rd.c index c03a6ef5e..540894805 100644 --- a/vp10/encoder/rd.c +++ b/vp10/encoder/rd.c @@ -571,6 +571,24 @@ static void get_entropy_contexts_plane( memcpy(t_above, above, sizeof(ENTROPY_CONTEXT) * num_4x4_w); memcpy(t_left, left, sizeof(ENTROPY_CONTEXT) * num_4x4_h); break; + case TX_8X8: + for (i = 0; i < num_4x4_w; i += 2) + t_above[i] = !!*(const uint16_t *)&above[i]; + for (i = 0; i < num_4x4_h; i += 2) + t_left[i] = !!*(const uint16_t *)&left[i]; + break; + case TX_16X16: + for (i = 0; i < num_4x4_w; i += 4) + t_above[i] = !!*(const uint32_t *)&above[i]; + for (i = 0; i < num_4x4_h; i += 4) + t_left[i] = !!*(const uint32_t *)&left[i]; + break; + case TX_32X32: + for (i = 0; i < num_4x4_w; i += 8) + t_above[i] = !!*(const uint64_t *)&above[i]; + for (i = 0; i < num_4x4_h; i += 8) + t_left[i] = !!*(const uint64_t *)&left[i]; + break; #if CONFIG_EXT_TX case TX_4X8: memcpy(t_above, above, sizeof(ENTROPY_CONTEXT) * num_4x4_w); @@ -582,26 +600,34 @@ static void get_entropy_contexts_plane( t_above[i] = !!*(const uint16_t *)&above[i]; memcpy(t_left, left, sizeof(ENTROPY_CONTEXT) * num_4x4_h); break; -#endif // CONFIG_EXT_TX - case TX_8X8: + case TX_8X16: for (i = 0; i < num_4x4_w; i += 2) t_above[i] = !!*(const uint16_t *)&above[i]; + for (i = 0; i < num_4x4_h; i += 4) + t_left[i] = !!*(const uint32_t *)&left[i]; + break; + case TX_16X8: + for (i = 0; i < num_4x4_w; i += 4) + t_above[i] = !!*(const uint32_t *)&above[i]; for (i = 0; i < num_4x4_h; i += 2) t_left[i] = !!*(const uint16_t *)&left[i]; break; - case TX_16X16: + case TX_16X32: for (i = 0; i < num_4x4_w; i += 4) t_above[i] = !!*(const uint32_t *)&above[i]; - for (i = 0; i < num_4x4_h; i += 4) - t_left[i] = !!*(const uint32_t *)&left[i]; + for (i = 0; i < num_4x4_h; i += 8) + t_left[i] = !!*(const uint64_t *)&left[i]; break; - case TX_32X32: + case TX_32X16: for (i = 0; i < num_4x4_w; i += 8) t_above[i] = !!*(const uint64_t *)&above[i]; - for (i = 0; i < num_4x4_h; i += 8) - t_left[i] = !!*(const uint64_t *)&left[i]; + for (i = 0; i < num_4x4_h; i += 4) + t_left[i] = !!*(const uint32_t *)&left[i]; + break; +#endif // CONFIG_EXT_TX + default: + assert(0 && "Invalid transform size."); break; - default: assert(0 && "Invalid transform size."); break; } } diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index 5591d9a15..6fe544bfb 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -1107,6 +1107,22 @@ static uint64_t sum_squares_2d(const int16_t *diff, int diff_stride, sse = vpx_sum_squares_2d_i16(diff, diff_stride, 4) + vpx_sum_squares_2d_i16(diff + 4, diff_stride, 4); break; + case TX_8X16: + sse = vpx_sum_squares_2d_i16(diff, diff_stride, 8) + + vpx_sum_squares_2d_i16(diff + 8 * diff_stride, diff_stride, 8); + break; + case TX_16X8: + sse = vpx_sum_squares_2d_i16(diff, diff_stride, 8) + + vpx_sum_squares_2d_i16(diff + 8, diff_stride, 8); + break; + case TX_16X32: + sse = vpx_sum_squares_2d_i16(diff, diff_stride, 16) + + vpx_sum_squares_2d_i16(diff + 16 * diff_stride, diff_stride, 16); + break; + case TX_32X16: + sse = vpx_sum_squares_2d_i16(diff, diff_stride, 16) + + vpx_sum_squares_2d_i16(diff + 16, diff_stride, 16); + break; #endif // CONFIG_EXT_TX default: assert(tx_size < TX_SIZES); -- 2.50.0