Commit feb925fe authored by Urvang Joshi's avatar Urvang Joshi

Enable rectangular transforms for Intra also.

These are under EXT_TX + RECT_TX experiment combo.

Results
=======

Derf Set:
--------
All Intra frames: 1.8% avg improvement (and 1.78% BD-rate improvement)
Video: 0.230% avg improvement (and 0.262% BD-rate improvement)

Objective-1-fast set
--------------------
Video: 0.52 PSNR improvement

Change-Id: I1893465929858e38419f327752dc61c19b96b997
parent 60a055bd
......@@ -688,7 +688,7 @@ static INLINE int is_rect_tx_allowed_bsize(BLOCK_SIZE bsize) {
static INLINE int is_rect_tx_allowed(const MACROBLOCKD *xd,
const MB_MODE_INFO *mbmi) {
return is_inter_block(mbmi) && is_rect_tx_allowed_bsize(mbmi->sb_type) &&
return is_rect_tx_allowed_bsize(mbmi->sb_type) &&
!xd->lossless[mbmi->segment_id];
}
......@@ -699,40 +699,33 @@ static INLINE int is_rect_tx(TX_SIZE tx_size) { return tx_size >= TX_SIZES; }
static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode,
int is_inter) {
const TX_SIZE largest_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
#if CONFIG_VAR_TX || (CONFIG_EXT_TX && CONFIG_RECT_TX)
const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bsize];
#else
const TX_SIZE max_tx_size = max_txsize_lookup[bsize];
#endif // CONFIG_VAR_TX || (CONFIG_EXT_TX && CONFIG_RECT_TX)
(void)is_inter;
#if CONFIG_VAR_TX
const TX_SIZE max_tx_size = max_txsize_rect_lookup[bsize];
#if CONFIG_CB4X4
if (!is_inter || bsize == BLOCK_4X4)
if (bsize == BLOCK_4X4)
return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
#else
if (!is_inter || bsize < BLOCK_8X8)
if (bsize < BLOCK_8X8)
return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
#endif
if (txsize_sqr_map[max_tx_size] <= largest_tx_size)
return max_tx_size;
if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size)
return max_rect_tx_size;
else
return largest_tx_size;
#else
const TX_SIZE max_tx_size = max_txsize_lookup[bsize];
#endif
#if CONFIG_EXT_TX && CONFIG_RECT_TX
if (!is_inter) {
return AOMMIN(max_tx_size, largest_tx_size);
#elif CONFIG_EXT_TX && CONFIG_RECT_TX
if (txsize_sqr_up_map[max_rect_tx_size] <= largest_tx_size) {
return max_rect_tx_size;
} else {
const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bsize];
if (txsize_sqr_up_map[max_rect_tx_size] <= largest_tx_size) {
return max_rect_tx_size;
} else {
return largest_tx_size;
}
return largest_tx_size;
}
#else
(void)is_inter;
return AOMMIN(max_tx_size, largest_tx_size);
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
#endif // CONFIG_VAR_TX
}
#if CONFIG_FILTER_INTRA
......
......@@ -487,7 +487,10 @@ static const TX_SIZE max_txsize_rect_lookup[BLOCK_SIZES] = {
#endif // CONFIG_TX64X64
};
// Same as "max_txsize_lookup[bsize] - TX_8X8", invalid for bsize < 8X8
#if CONFIG_EXT_TX && CONFIG_RECT_TX
// Same as "max_txsize_lookup[bsize] - TX_8X8", except for rectangular
// block which may use a rectangular transform, in which case it is
// "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8
static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
......@@ -498,9 +501,9 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
// 4X8, 8X4, 8X8
INT32_MIN, INT32_MIN, TX_8X8 - TX_8X8,
// 8X16, 16X8, 16X16
TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_16X16 - TX_8X8,
TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_16X16 - TX_8X8,
// 16X32, 32X16, 32X32
TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_32X32 - TX_8X8,
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8, TX_32X32 - TX_8X8,
// 32X64, 64X32,
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8,
#if CONFIG_TX64X64
......@@ -519,12 +522,9 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_TX64X64
};
#if CONFIG_EXT_TX && CONFIG_RECT_TX
// Same as "max_txsize_lookup[bsize] - TX_8X8", except for rectangular
// block which may use a rectangular transform, in which case it is
// "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8
static const int32_t inter_tx_size_cat_lookup[BLOCK_SIZES] = {
#else
// Same as "max_txsize_lookup[bsize] - TX_8X8", invalid for bsize < 8X8
static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
// 2X2, 2X4, 4X2,
INT32_MIN, INT32_MIN, INT32_MIN,
......@@ -532,11 +532,11 @@ static const int32_t inter_tx_size_cat_lookup[BLOCK_SIZES] = {
// 4X4
INT32_MIN,
// 4X8, 8X4, 8X8
INT32_MIN, INT32_MIN, TX_8X8 - TX_8X8,
INT32_MIN, INT32_MIN, TX_8X8 - TX_8X8,
// 8X16, 16X8, 16X16
TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_16X16 - TX_8X8,
TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_16X16 - TX_8X8,
// 16X32, 32X16, 32X32
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8, TX_32X32 - TX_8X8,
TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_32X32 - TX_8X8,
// 32X64, 64X32,
TX_32X32 - TX_8X8, TX_32X32 - TX_8X8,
#if CONFIG_TX64X64
......@@ -555,10 +555,10 @@ static const int32_t inter_tx_size_cat_lookup[BLOCK_SIZES] = {
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_TX64X64
};
#else
#define inter_tx_size_cat_lookup intra_tx_size_cat_lookup
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
#define inter_tx_size_cat_lookup intra_tx_size_cat_lookup
/* clang-format on */
static const TX_SIZE sub_tx_size_map[TX_SIZES_ALL] = {
......
......@@ -3534,6 +3534,9 @@ static void adapt_coef_probs(AV1_COMMON *cm, TX_SIZE tx_size,
(const unsigned int(*)[REF_TYPES][COEF_BANDS]
[COEFF_CONTEXTS])cm->counts.eob_branch[tx_size];
int i, j, k, l, m;
#if CONFIG_RECT_TX
assert(!is_rect_tx(tx_size));
#endif // CONFIG_RECT_TX
for (i = 0; i < PLANE_TYPES; ++i)
for (j = 0; j < REF_TYPES; ++j)
......
......@@ -2526,6 +2526,7 @@ static void combine_interintra_highbd(
}
#endif // CONFIG_AOM_HIGHBITDEPTH
// TODO(urvang/davidbarker): Refactor with av1_predict_intra_block().
static void build_intra_predictors_for_interintra(MACROBLOCKD *xd, uint8_t *ref,
int ref_stride, uint8_t *dst,
int dst_stride,
......
......@@ -1387,6 +1387,8 @@ static void build_intra_predictors_high(
filter_intra_mode_info->filter_intra_mode[plane != 0];
#endif // CONFIG_FILTER_INTRA
int base = 128 << (xd->bd - 8);
assert(tx_size_wide[tx_size] == tx_size_high[tx_size]);
// 127 127 127 .. 127 127 127 127 127 127
// 129 A B .. Y Z
// 129 C D .. W X
......@@ -1552,6 +1554,7 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
const FILTER_INTRA_MODE filter_intra_mode =
filter_intra_mode_info->filter_intra_mode[plane != 0];
#endif // CONFIG_FILTER_INTRA
assert(tx_size_wide[tx_size] == tx_size_high[tx_size]);
// 127 127 127 .. 127 127 127 127 127 127
// 129 A B .. Y Z
......@@ -1687,11 +1690,11 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
}
}
void av1_predict_intra_block(const MACROBLOCKD *xd, int wpx, int hpx,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride, uint8_t *dst,
int dst_stride, int col_off, int row_off,
int plane) {
static void predict_square_intra_block(const MACROBLOCKD *xd, int wpx, int hpx,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride,
uint8_t *dst, int dst_stride,
int col_off, int row_off, int plane) {
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
const struct macroblockd_plane *const pd = &xd->plane[plane];
const int txw = tx_size_wide_unit[tx_size];
......@@ -1725,6 +1728,7 @@ void av1_predict_intra_block(const MACROBLOCKD *xd, int wpx, int hpx,
tx_size, row_off, col_off, pd->subsampling_x);
const int have_bottom = av1_has_bottom(bsize, mi_row, mi_col, yd > 0, tx_size,
row_off, col_off, pd->subsampling_y);
assert(txwpx == txhpx);
#if CONFIG_PALETTE
if (xd->mi[0]->mbmi.palette_mode_info.palette_size[plane != 0] > 0) {
......@@ -1782,6 +1786,142 @@ void av1_predict_intra_block(const MACROBLOCKD *xd, int wpx, int hpx,
plane);
}
void av1_predict_intra_block(const MACROBLOCKD *xd, int wpx, int hpx,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride, uint8_t *dst,
int dst_stride, int col_off, int row_off,
int plane) {
const int tx_width = tx_size_wide[tx_size];
const int tx_height = tx_size_high[tx_size];
if (tx_width == tx_height) {
predict_square_intra_block(xd, wpx, hpx, tx_size, mode, ref, ref_stride,
dst, dst_stride, col_off, row_off, plane);
} else {
#if CONFIG_EXT_TX && CONFIG_RECT_TX
#if CONFIG_AOM_HIGHBITDEPTH
uint16_t tmp16[MAX_SB_SIZE];
#endif
uint8_t tmp[MAX_SB_SIZE];
const TX_SIZE sub_tx_size = txsize_sqr_map[tx_size];
assert(sub_tx_size < TX_SIZES);
assert((tx_width == wpx && tx_height == hpx) ||
(tx_width == (wpx >> 1) && tx_height == hpx) ||
(tx_width == wpx && tx_height == (hpx >> 1)));
if (tx_width < tx_height) {
assert(tx_height == (tx_width << 1));
// Predict the top square sub-block.
predict_square_intra_block(xd, wpx, hpx, sub_tx_size, mode, ref,
ref_stride, dst, dst_stride, col_off, row_off,
plane);
{
const int half_tx_height = tx_height >> 1;
const int half_txh_unit = tx_size_high_unit[tx_size] >> 1;
// Cast away const to modify 'ref' temporarily; will be restored later.
uint8_t *src_2 = (uint8_t *)ref + half_tx_height * ref_stride;
uint8_t *dst_2 = dst + half_tx_height * dst_stride;
const int row_off_2 = row_off + half_txh_unit;
// Save the last row of top square sub-block as 'above' row for bottom
// square sub-block.
if (src_2 != dst_2 || ref_stride != dst_stride) {
#if CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
uint16_t *src_2_16 = CONVERT_TO_SHORTPTR(src_2);
uint16_t *dst_2_16 = CONVERT_TO_SHORTPTR(dst_2);
memcpy(tmp16, src_2_16 - ref_stride, tx_width * sizeof(*src_2_16));
memcpy(src_2_16 - ref_stride, dst_2_16 - dst_stride,
tx_width * sizeof(*src_2_16));
} else {
#endif // CONFIG_AOM_HIGHBITDEPTH
memcpy(tmp, src_2 - ref_stride, tx_width * sizeof(*src_2));
memcpy(src_2 - ref_stride, dst_2 - dst_stride,
tx_width * sizeof(*src_2));
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif // CONFIG_AOM_HIGHBITDEPTH
}
// Predict the bottom square sub-block.
predict_square_intra_block(xd, wpx, hpx, sub_tx_size, mode, src_2,
ref_stride, dst_2, dst_stride, col_off,
row_off_2, plane);
// Restore the last row of top square sub-block.
if (src_2 != dst_2 || ref_stride != dst_stride) {
#if CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
uint16_t *src_2_16 = CONVERT_TO_SHORTPTR(src_2);
memcpy(src_2_16 - ref_stride, tmp16, tx_width * sizeof(*src_2_16));
} else {
#endif // CONFIG_AOM_HIGHBITDEPTH
memcpy(src_2 - ref_stride, tmp, tx_width * sizeof(*src_2));
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif // CONFIG_AOM_HIGHBITDEPTH
}
}
} else { // tx_width > tx_height
assert(tx_width == (tx_height << 1));
// Predict the left square sub-block
predict_square_intra_block(xd, wpx, hpx, sub_tx_size, mode, ref,
ref_stride, dst, dst_stride, col_off, row_off,
plane);
{
int i;
const int half_tx_width = tx_width >> 1;
const int half_txw_unit = tx_size_wide_unit[tx_size] >> 1;
// Cast away const to modify 'ref' temporarily; will be restored later.
uint8_t *src_2 = (uint8_t *)ref + half_tx_width;
uint8_t *dst_2 = dst + half_tx_width;
const int col_off_2 = col_off + half_txw_unit;
// Save the last column of left square sub-block as 'left' column for
// right square sub-block.
if (src_2 != dst_2 || ref_stride != dst_stride) {
#if CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
uint16_t *src_2_16 = CONVERT_TO_SHORTPTR(src_2);
uint16_t *dst_2_16 = CONVERT_TO_SHORTPTR(dst_2);
for (i = 0; i < tx_height; ++i) {
tmp16[i] = src_2_16[i * ref_stride - 1];
src_2_16[i * ref_stride - 1] = dst_2_16[i * dst_stride - 1];
}
} else {
#endif // CONFIG_AOM_HIGHBITDEPTH
for (i = 0; i < tx_height; ++i) {
tmp[i] = src_2[i * ref_stride - 1];
src_2[i * ref_stride - 1] = dst_2[i * dst_stride - 1];
}
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif // CONFIG_AOM_HIGHBITDEPTH
}
// Predict the right square sub-block.
predict_square_intra_block(xd, wpx, hpx, sub_tx_size, mode, src_2,
ref_stride, dst_2, dst_stride, col_off_2,
row_off, plane);
// Restore the last column of left square sub-block.
if (src_2 != dst_2 || ref_stride != dst_stride) {
#if CONFIG_AOM_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
uint16_t *src_2_16 = CONVERT_TO_SHORTPTR(src_2);
for (i = 0; i < tx_height; ++i) {
src_2_16[i * ref_stride - 1] = tmp16[i];
}
} else {
#endif // CONFIG_AOM_HIGHBITDEPTH
for (i = 0; i < tx_height; ++i) {
src_2[i * ref_stride - 1] = tmp[i];
}
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif // CONFIG_AOM_HIGHBITDEPTH
}
}
}
#else
assert(0);
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
}
}
void av1_init_intra_predictors(void) {
once(av1_init_intra_predictors_internal);
}
......@@ -47,7 +47,6 @@ DECLARE_ALIGNED(16, static const int16_t, default_scan_4x8[32]) = {
17, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, mcol_scan_4x8[32]) = {
0, 4, 8, 12, 16, 20, 24, 28, 1, 5, 9, 13, 17, 21, 25, 29,
2, 6, 10, 14, 18, 22, 26, 30, 3, 7, 11, 15, 19, 23, 27, 31,
......@@ -57,14 +56,12 @@ DECLARE_ALIGNED(16, static const int16_t, mrow_scan_4x8[32]) = {
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,
};
#endif // CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, default_scan_8x4[32]) = {
0, 1, 8, 9, 2, 16, 10, 17, 18, 3, 24, 11, 25, 19, 26, 4,
12, 27, 20, 5, 28, 13, 21, 29, 6, 14, 22, 30, 7, 15, 23, 31,
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, mcol_scan_8x4[32]) = {
0, 8, 16, 24, 1, 9, 17, 25, 2, 10, 18, 26, 3, 11, 19, 27,
4, 12, 20, 28, 5, 13, 21, 29, 6, 14, 22, 30, 7, 15, 23, 31,
......@@ -74,7 +71,6 @@ DECLARE_ALIGNED(16, static const int16_t, mrow_scan_8x4[32]) = {
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,
};
#endif
DECLARE_ALIGNED(16, static const int16_t, default_scan_4x16[64]) = {
0, 1, 4, 2, 5, 8, 3, 6, 9, 12, 7, 10, 13, 16, 11, 14,
......@@ -306,7 +302,6 @@ DECLARE_ALIGNED(16, static const int16_t, default_scan_16x8[128]) = {
122, 63, 78, 93, 108, 123, 79, 94, 109, 124, 95, 110, 125, 111, 126, 127,
};
#if CONFIG_EXT_TX
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,
......@@ -352,7 +347,6 @@ DECLARE_ALIGNED(16, static const int16_t, mrow_scan_16x8[128]) = {
105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
};
#endif
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,
......@@ -430,7 +424,6 @@ DECLARE_ALIGNED(16, static const int16_t, default_scan_32x16[512]) = {
510, 511,
};
#if CONFIG_EXT_TX
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,
......@@ -579,7 +572,6 @@ DECLARE_ALIGNED(16, static const int16_t, mrow_scan_32x16[512]) = {
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,
......@@ -1548,7 +1540,6 @@ DECLARE_ALIGNED(16, static const int16_t,
24, 22, 25, 23, 26, 24, 24, 25, 28, 26, 29, 27, 30, 0, 0
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t,
mcol_scan_4x8_neighbors[33 * MAX_NEIGHBORS]) = {
0, 0, 0, 0, 4, 4, 8, 8, 12, 12, 16, 16, 20, 20, 24, 24, 0,
......@@ -1564,7 +1555,6 @@ DECLARE_ALIGNED(16, static const int16_t,
13, 16, 14, 17, 15, 18, 16, 16, 17, 20, 18, 21, 19, 22, 20, 20, 21,
24, 22, 25, 23, 26, 24, 24, 25, 28, 26, 29, 27, 30, 0, 0
};
#endif
DECLARE_ALIGNED(16, static const int16_t,
default_scan_8x4_neighbors[33 * MAX_NEIGHBORS]) = {
......@@ -1574,7 +1564,6 @@ DECLARE_ALIGNED(16, static const int16_t,
13, 14, 21, 22, 29, 6, 6, 7, 14, 15, 22, 23, 30, 0, 0
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t,
mcol_scan_8x4_neighbors[33 * MAX_NEIGHBORS]) = {
0, 0, 0, 0, 8, 8, 16, 16, 0, 0, 1, 8, 9, 16, 17, 24, 1,
......@@ -1590,7 +1579,6 @@ DECLARE_ALIGNED(16, static const int16_t,
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, 0, 0
};
#endif // CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t,
default_scan_4x16_neighbors[65 * MAX_NEIGHBORS]) = {
......@@ -1995,7 +1983,6 @@ DECLARE_ALIGNED(16, static const int16_t,
126, 0, 0
};
#if CONFIG_EXT_TX
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,
......@@ -2081,7 +2068,6 @@ DECLARE_ALIGNED(16, static const int16_t,
104, 119, 105, 120, 106, 121, 107, 122, 108, 123, 109, 124, 110, 125, 111,
126, 0, 0
};
#endif
DECLARE_ALIGNED(16, static const int16_t,
default_scan_16x32_neighbors[513 * MAX_NEIGHBORS]) = {
......@@ -2229,7 +2215,6 @@ DECLARE_ALIGNED(16, static const int16_t,
478, 509, 479, 510, 0, 0
};
#if CONFIG_EXT_TX
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,
......@@ -2521,7 +2506,6 @@ DECLARE_ALIGNED(16, static const int16_t,
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,
......@@ -4297,7 +4281,6 @@ DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_4x8[32]) = {
15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_4x8[32]) = {
0, 8, 16, 24, 1, 9, 17, 25, 2, 10, 18, 26, 3, 11, 19, 27,
4, 12, 20, 28, 5, 13, 21, 29, 6, 14, 22, 30, 7, 15, 23, 31,
......@@ -4307,14 +4290,12 @@ DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_4x8[32]) = {
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,
};
#endif
DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_8x4[32]) = {
0, 1, 4, 9, 15, 19, 24, 28, 2, 3, 6, 11, 16, 21, 25, 29,
5, 7, 8, 13, 18, 22, 26, 30, 10, 12, 14, 17, 20, 23, 27, 31,
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_8x4[32]) = {
0, 4, 8, 12, 16, 20, 24, 28, 1, 5, 9, 13, 17, 21, 25, 29,
2, 6, 10, 14, 18, 22, 26, 30, 3, 7, 11, 15, 19, 23, 27, 31,
......@@ -4324,7 +4305,6 @@ DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_8x4[32]) = {
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,
};
#endif // CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_4x16[64]) = {
0, 1, 3, 6, 2, 4, 7, 10, 5, 8, 11, 14, 9, 12, 15, 18,
......@@ -4554,7 +4534,6 @@ DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_16x8[128]) = {
35, 43, 51, 59, 67, 75, 83, 91, 99, 106, 112, 117, 121, 124, 126, 127,
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, av1_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,
......@@ -4600,7 +4579,6 @@ DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_16x8[128]) = {
105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
};
#endif
DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_16x32[512]) = {
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105,
......@@ -4678,7 +4656,6 @@ DECLARE_ALIGNED(16, static const int16_t, av1_default_iscan_32x16[512]) = {
510, 511,
};
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, av1_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,
......@@ -4828,8 +4805,6 @@ DECLARE_ALIGNED(16, static const int16_t, av1_mrow_iscan_32x16[512]) = {
510, 511,
};
#endif // CONFIG_EXT_TX
#if CONFIG_EXT_TX
DECLARE_ALIGNED(16, static const int16_t, av1_mcol_iscan_16x16[256]) = {
0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240,
......@@ -5756,7 +5731,7 @@ const SCAN_ORDER av1_default_scan_orders[TX_SIZES] = {
#endif // CONFIG_TX64X64
};
const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
const SCAN_ORDER av1_intra_scan_orders[TX_SIZES_ALL][TX_TYPES] = {
#if CONFIG_CB4X4
{
// TX_2X2
......@@ -5909,8 +5884,162 @@ const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
{ default_scan_64x64, av1_default_iscan_64x64,
default_scan_64x64_neighbors },
#endif // CONFIG_EXT_TX
}
},
#endif // CONFIG_TX64X64
{
// TX_4X8
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
{ mrow_scan_4x8, av1_mrow_iscan_4x8, mrow_scan_4x8_neighbors },
{ mcol_scan_4x8, av1_mcol_iscan_4x8, mcol_scan_4x8_neighbors },
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
#if CONFIG_EXT_TX
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
{ default_scan_4x8, av1_default_iscan_4x8, default_scan_4x8_neighbors },
{ mrow_scan_4x8, av1_mrow_iscan_4x8, mrow_scan_4x8_neighbors },
{ mrow_scan_4x8, av1_mrow_iscan_4x8, mrow_scan_4x8_neighbors },
{ mcol_scan_4x8, av1_mcol_iscan_4x8, mcol_scan_4x8_neighbors },
{ mrow_scan_4x8, av1_mrow_iscan_4x8, mrow_scan_4x8_neighbors },
{ mcol_scan_4x8, av1_mcol_iscan_4x8, mcol_scan_4x8_neighbors },
{ mrow_scan_4x8, av1_mrow_iscan_4x8, mrow_scan_4x8_neighbors },
{ mcol_scan_4x8, av1_mcol_iscan_4x8, mcol_scan_4x8_neighbors },
#endif // CONFIG_EXT_TX
},
{
// TX_8X4
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
{ mrow_scan_8x4, av1_mrow_iscan_8x4, mrow_scan_8x4_neighbors },
{ mcol_scan_8x4, av1_mcol_iscan_8x4, mcol_scan_8x4_neighbors },
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
#if CONFIG_EXT_TX
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
{ default_scan_8x4, av1_default_iscan_8x4, default_scan_8x4_neighbors },
{ mrow_scan_8x4, av1_mrow_iscan_8x4, mrow_scan_8x4_neighbors },
{ mrow_scan_8x4, av1_mrow_iscan_8x4, mrow_scan_8x4_neighbors },
{ mcol_scan_8x4, av1_mcol_iscan_8x4, mcol_scan_8x4_neighbors },
{ mrow_scan_8x4, av1_mrow_iscan_8x4, mrow_scan_8x4_neighbors },
{ mcol_scan_8x4, av1_mcol_iscan_8x4, mcol_scan_8x4_neighbors },
{ mrow_scan_8x4, av1_mrow_iscan_8x4, mrow_scan_8x4_neighbors },
{ mcol_scan_8x4, av1_mcol_iscan_8x4, mcol_scan_8x4_neighbors },
#endif // CONFIG_EXT_TX
},
{
// TX_8X16
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
{ mrow_scan_8x16, av1_mrow_iscan_8x16, mrow_scan_8x16_neighbors },
{ mcol_scan_8x16, av1_mcol_iscan_8x16, mcol_scan_8x16_neighbors },
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
#if CONFIG_EXT_TX
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
{ default_scan_8x16, av1_default_iscan_8x16,
default_scan_8x16_neighbors },
{ mrow_scan_8x16, av1_mrow_iscan_8x16, mrow_scan_8x16_neighbors },
{ mrow_scan_8x16, av1_mrow_iscan_8x16, mrow_scan_8x16_neighbors },
{ mcol_scan_8x16, av1_mcol_iscan_8x16, mcol_scan_8x16_neighbors },
{ mrow_scan_8x16, av1_mrow_iscan_8x16, mrow_scan_8x16_neighbors },
{ mcol_scan_8x16, av1_mcol_iscan_8x16, mcol_scan_8x16_neighbors },
{ mrow_scan_8x16, av1_mrow_iscan_8x16, mrow_scan_8x16_neighbors },
{ mcol_scan_8x16, av1_mcol_iscan_8x16, mcol_scan_8x16_neighbors },
#endif // CONFIG_EXT_TX
},
{
// TX_16X8
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
{ mrow_scan_16x8, av1_mrow_iscan_16x8, mrow_scan_16x8_neighbors },
{ mcol_scan_16x8, av1_mcol_iscan_16x8, mcol_scan_16x8_neighbors },
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
#if CONFIG_EXT_TX
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
{ default_scan_16x8, av1_default_iscan_16x8,
default_scan_16x8_neighbors },
{ mrow_scan_16x8, av1_mrow_iscan_16x8, mrow_scan_16x8_neighbors },
{ mrow_scan_16x8, av1_mrow_iscan_16x8, mrow_scan_16x8_neighbors },
{ mcol_scan_16x8, av1_mcol_iscan_16x8, mcol_scan_16x8_neighbors },
{ mrow_scan_16x8, av1_mrow_iscan_16x8, mrow_scan_16x8_neighbors },
{ mcol_scan_16x8, av1_mcol_iscan_16x8, mcol_scan_16x8_neighbors },
{ mrow_scan_16x8, av1_mrow_iscan_16x8, mrow_scan_16x8_neighbors },
{ mcol_scan_16x8, av1_mcol_iscan_16x8, mcol_scan_16x8_neighbors },
#endif // CONFIG_EXT_TX
},
{
// TX_16X32
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
{ mrow_scan_16x32, av1_mrow_iscan_16x32, mrow_scan_16x32_neighbors },
{ mcol_scan_16x32, av1_mcol_iscan_16x32, mcol_scan_16x32_neighbors },
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
#if CONFIG_EXT_TX
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
{ default_scan_16x32, av1_default_iscan_16x32,
default_scan_16x32_neighbors },
{ mrow_scan_16x32, av1_mrow_iscan_16x32, mrow_scan_16x32_neighbors },
{ mrow_scan_16x32, av1_mrow_iscan_16x32, mrow_scan_16x32_neighbors },
{ mcol_scan_16x32, av1_mcol_iscan_16x32, mcol_scan_16x32_neighbors },
{ mrow_scan_16x32, av1_mrow_iscan_16x32, mrow_scan_16x32_neighbors },
{ mcol_scan_16x32, av1_mcol_iscan_16x32, mcol_scan_16x32_neighbors },
{ mrow_scan_16x32, av1_mrow_iscan_16x32, mrow_scan_16x32_neighbors },
{ mcol_scan_16x32, av1_mcol_iscan_16x32, mcol_scan_16x32_neighbors },
#endif // CONFIG_EXT_TX
},