Commit 81ec2619 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Tim Terriberry
Browse files

cb4x4: Move sub-4X4 block sizes behind chroma flags.

cb4x4 itself should not require these sizes.

This simplifies compatibility with other experiments, since we can
first make them work with cb4x4 (which is now on by default), and
then worry about chroma_sub8x8 and chroma_2x2 (which is not) in
separate steps.

Encoder and decoder output should remain unchanged.

Change-Id: Iff2a5494cab3b7d96f881e8bd9cd4bf18c817cfa
parent 5c844690
...@@ -100,7 +100,7 @@ static const uint64_t above_64x64_txform_mask[TX_SIZES] = { ...@@ -100,7 +100,7 @@ static const uint64_t above_64x64_txform_mask[TX_SIZES] = {
// 00000000 // 00000000
// 00000000 // 00000000
static const uint64_t left_prediction_mask[BLOCK_SIZES] = { static const uint64_t left_prediction_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2, 0x0000000000000001ULL, // BLOCK_2X2,
0x0000000000000001ULL, // BLOCK_2X4, 0x0000000000000001ULL, // BLOCK_2X4,
0x0000000000000001ULL, // BLOCK_4X2, 0x0000000000000001ULL, // BLOCK_4X2,
...@@ -122,7 +122,7 @@ static const uint64_t left_prediction_mask[BLOCK_SIZES] = { ...@@ -122,7 +122,7 @@ static const uint64_t left_prediction_mask[BLOCK_SIZES] = {
// 64 bit mask to shift and set for each prediction size. // 64 bit mask to shift and set for each prediction size.
static const uint64_t above_prediction_mask[BLOCK_SIZES] = { static const uint64_t above_prediction_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2 0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4 0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2 0x0000000000000001ULL, // BLOCK_4X2
...@@ -145,7 +145,7 @@ static const uint64_t above_prediction_mask[BLOCK_SIZES] = { ...@@ -145,7 +145,7 @@ static const uint64_t above_prediction_mask[BLOCK_SIZES] = {
// each 8x8 block that would be in the left most block of the given block // each 8x8 block that would be in the left most block of the given block
// size in the 64x64 block. // size in the 64x64 block.
static const uint64_t size_mask[BLOCK_SIZES] = { static const uint64_t size_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2 0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4 0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2 0x0000000000000001ULL, // BLOCK_4X2
...@@ -198,7 +198,7 @@ static const uint16_t above_64x64_txform_mask_uv[TX_SIZES] = { ...@@ -198,7 +198,7 @@ static const uint16_t above_64x64_txform_mask_uv[TX_SIZES] = {
// 16 bit left mask to shift and set for each uv prediction size. // 16 bit left mask to shift and set for each uv prediction size.
static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = { static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2, 0x0001, // BLOCK_2X2,
0x0001, // BLOCK_2X4, 0x0001, // BLOCK_2X4,
0x0001, // BLOCK_4X2, 0x0001, // BLOCK_4X2,
...@@ -219,7 +219,7 @@ static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = { ...@@ -219,7 +219,7 @@ static const uint16_t left_prediction_mask_uv[BLOCK_SIZES] = {
}; };
// 16 bit above mask to shift and set for uv each prediction size. // 16 bit above mask to shift and set for uv each prediction size.
static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = { static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2 0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4 0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2 0x0001, // BLOCK_4X2
...@@ -241,7 +241,7 @@ static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = { ...@@ -241,7 +241,7 @@ static const uint16_t above_prediction_mask_uv[BLOCK_SIZES] = {
// 64 bit mask to shift and set for each uv prediction size // 64 bit mask to shift and set for each uv prediction size
static const uint16_t size_mask_uv[BLOCK_SIZES] = { static const uint16_t size_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2 0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4 0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2 0x0001, // BLOCK_4X2
...@@ -1425,8 +1425,12 @@ static void get_filter_level_and_masks_non420( ...@@ -1425,8 +1425,12 @@ static void get_filter_level_and_masks_non420(
(blk_row * mi_size_high[BLOCK_8X8] << TX_UNIT_HIGH_LOG2) >> 1; (blk_row * mi_size_high[BLOCK_8X8] << TX_UNIT_HIGH_LOG2) >> 1;
const int tx_col_idx = const int tx_col_idx =
(blk_col * mi_size_wide[BLOCK_8X8] << TX_UNIT_WIDE_LOG2) >> 1; (blk_col * mi_size_wide[BLOCK_8X8] << TX_UNIT_WIDE_LOG2) >> 1;
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE bsize = const BLOCK_SIZE bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(mbmi->sb_type, plane)); AOMMAX(BLOCK_4X4, get_plane_block_size(mbmi->sb_type, plane));
#else
const BLOCK_SIZE bsize = get_plane_block_size(mbmi->sb_type, plane);
#endif
const TX_SIZE mb_tx_size = mbmi->inter_tx_size[tx_row_idx][tx_col_idx]; const TX_SIZE mb_tx_size = mbmi->inter_tx_size[tx_row_idx][tx_col_idx];
tx_size = (plane->plane_type == PLANE_TYPE_UV) tx_size = (plane->plane_type == PLANE_TYPE_UV)
? uv_txsize_lookup[bsize][mb_tx_size][0][0] ? uv_txsize_lookup[bsize][mb_tx_size][0][0]
...@@ -1898,11 +1902,11 @@ typedef enum EDGE_DIR { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } EDGE_DIR; ...@@ -1898,11 +1902,11 @@ typedef enum EDGE_DIR { VERT_EDGE = 0, HORZ_EDGE = 1, NUM_EDGE_DIRS } EDGE_DIR;
static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = { static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = {
// mask for vertical edges filtering // mask for vertical edges filtering
{ {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2 - 1, // BLOCK_2X2 2 - 1, // BLOCK_2X2
2 - 1, // BLOCK_2X4 2 - 1, // BLOCK_2X4
4 - 1, // BLOCK_4X2 4 - 1, // BLOCK_4X2
#endif // CONFIG_CB4X4 #endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
4 - 1, // BLOCK_4X4 4 - 1, // BLOCK_4X4
4 - 1, // BLOCK_4X8 4 - 1, // BLOCK_4X8
8 - 1, // BLOCK_8X4 8 - 1, // BLOCK_8X4
...@@ -1924,11 +1928,11 @@ static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = { ...@@ -1924,11 +1928,11 @@ static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = {
}, },
// mask for horizontal edges filtering // mask for horizontal edges filtering
{ {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2 - 1, // BLOCK_2X2 2 - 1, // BLOCK_2X2
4 - 1, // BLOCK_2X4 4 - 1, // BLOCK_2X4
2 - 1, // BLOCK_4X2 2 - 1, // BLOCK_4X2
#endif // CONFIG_CB4X4 #endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
4 - 1, // BLOCK_4X4 4 - 1, // BLOCK_4X4
8 - 1, // BLOCK_4X8 8 - 1, // BLOCK_4X8
4 - 1, // BLOCK_8X4 4 - 1, // BLOCK_8X4
...@@ -2043,8 +2047,12 @@ static TX_SIZE av1_get_transform_size(const MODE_INFO *const pCurr, ...@@ -2043,8 +2047,12 @@ static TX_SIZE av1_get_transform_size(const MODE_INFO *const pCurr,
const int tx_col_idx = const int tx_col_idx =
(blk_col * mi_size_wide[BLOCK_8X8] << TX_UNIT_WIDE_LOG2) >> 1; (blk_col * mi_size_wide[BLOCK_8X8] << TX_UNIT_WIDE_LOG2) >> 1;
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE bsize = const BLOCK_SIZE bsize =
AOMMAX(BLOCK_4X4, ss_size_lookup[sb_type][scaleHorz][scaleVert]); AOMMAX(BLOCK_4X4, ss_size_lookup[sb_type][scaleHorz][scaleVert]);
#else
const BLOCK_SIZE bsize = ss_size_lookup[sb_type][scaleHorz][scaleVert];
#endif
const TX_SIZE mb_tx_size = mbmi->inter_tx_size[tx_row_idx][tx_col_idx]; const TX_SIZE mb_tx_size = mbmi->inter_tx_size[tx_row_idx][tx_col_idx];
assert(mb_tx_size < TX_SIZES_ALL); assert(mb_tx_size < TX_SIZES_ALL);
......
...@@ -128,7 +128,7 @@ void av1_foreach_transformed_block_in_plane( ...@@ -128,7 +128,7 @@ void av1_foreach_transformed_block_in_plane(
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8 // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
// transform size varies per plane, look it up in a common way. // transform size varies per plane, look it up in a common way.
const TX_SIZE tx_size = get_tx_size(plane, xd); const TX_SIZE tx_size = get_tx_size(plane, xd);
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2 #if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize = const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd)); AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else #else
...@@ -239,11 +239,11 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col, ...@@ -239,11 +239,11 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col,
#endif #endif
for (i = 0; i < nplanes; i++) { for (i = 0; i < nplanes; i++) {
struct macroblockd_plane *const pd = &xd->plane[i]; struct macroblockd_plane *const pd = &xd->plane[i];
#if CONFIG_CHROMA_2X2 || !CONFIG_CB4X4 #if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
const BLOCK_SIZE plane_bsize = const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd)); AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#endif #endif
const int txs_wide = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; const int txs_wide = block_size_wide[plane_bsize] >> tx_size_wide_log2[0];
const int txs_high = block_size_high[plane_bsize] >> tx_size_high_log2[0]; const int txs_high = block_size_high[plane_bsize] >> tx_size_high_log2[0];
......
...@@ -916,7 +916,7 @@ static INLINE int get_ext_tx_types(TX_SIZE tx_size, BLOCK_SIZE bs, int is_inter, ...@@ -916,7 +916,7 @@ static INLINE int get_ext_tx_types(TX_SIZE tx_size, BLOCK_SIZE bs, int is_inter,
#if CONFIG_RECT_TX #if CONFIG_RECT_TX
static INLINE int is_rect_tx_allowed_bsize(BLOCK_SIZE bsize) { static INLINE int is_rect_tx_allowed_bsize(BLOCK_SIZE bsize) {
static const char LUT[BLOCK_SIZES] = { static const char LUT[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, // BLOCK_2X2 0, // BLOCK_2X2
0, // BLOCK_2X4 0, // BLOCK_2X4
0, // BLOCK_4X2 0, // BLOCK_4X2
...@@ -953,7 +953,7 @@ static INLINE int is_rect_tx_allowed(const MACROBLOCKD *xd, ...@@ -953,7 +953,7 @@ static INLINE int is_rect_tx_allowed(const MACROBLOCKD *xd,
#if CONFIG_RECT_TX_EXT #if CONFIG_RECT_TX_EXT
static INLINE int is_quarter_tx_allowed_bsize(BLOCK_SIZE bsize) { static INLINE int is_quarter_tx_allowed_bsize(BLOCK_SIZE bsize) {
static const char LUT_QTTX[BLOCK_SIZES] = { static const char LUT_QTTX[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, // BLOCK_2X2 0, // BLOCK_2X2
0, // BLOCK_2X4 0, // BLOCK_2X4
0, // BLOCK_4X2 0, // BLOCK_4X2
......
...@@ -28,13 +28,13 @@ extern "C" { ...@@ -28,13 +28,13 @@ extern "C" {
// Log 2 conversion lookup tables for block width and height // Log 2 conversion lookup tables for block width and height
static const uint8_t b_width_log2_lookup[BLOCK_SIZES_ALL] = { static const uint8_t b_width_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 0, 0, 0, 0, 0,
#endif #endif
0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0, 2, 1, 3 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0, 2, 1, 3
}; };
static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = { static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 0, 0, 0, 0, 0,
#endif #endif
0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2, 0, 3, 1 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2, 0, 3, 1
...@@ -42,17 +42,21 @@ static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = { ...@@ -42,17 +42,21 @@ static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = {
// Log 2 conversion lookup tables for modeinfo width and height // Log 2 conversion lookup tables for modeinfo width and height
static const uint8_t mi_width_log2_lookup[BLOCK_SIZES_ALL] = { static const uint8_t mi_width_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CB4X4
0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0, #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 1, 3 0, 0, 0,
#else #endif
0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5) 0, 2, 1, 3
#else // CONFIG_CB4X4
0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, IF_EXT_PARTITION(3, 4, 4) 0, 1, 0, 2 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, IF_EXT_PARTITION(3, 4, 4) 0, 1, 0, 2
#endif #endif
}; };
static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = { static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CB4X4
0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2, #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 3, 1 0, 0, 0,
#else #endif
0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5) 2, 0, 3, 1
#else // CONFIG_CB4X4
0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, IF_EXT_PARTITION(4, 3, 4) 1, 0, 2, 0 0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, IF_EXT_PARTITION(4, 3, 4) 1, 0, 2, 0
#endif #endif
}; };
...@@ -60,17 +64,23 @@ static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = { ...@@ -60,17 +64,23 @@ static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = {
/* clang-format off */ /* clang-format off */
static const uint8_t mi_size_wide[BLOCK_SIZES_ALL] = { static const uint8_t mi_size_wide[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CB4X4
1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16,
IF_EXT_PARTITION(16, 32, 32) 1, 4, 2, 8 IF_EXT_PARTITION(16, 32, 32) 1, 4, 2, 8
#else #else // CONFIG_CB4X4
1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4
#endif #endif
}; };
static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = { static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CB4X4
1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1,
#endif
1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16,
IF_EXT_PARTITION(32, 16, 32) 4, 1, 8, 2 IF_EXT_PARTITION(32, 16, 32) 4, 1, 8, 2
#else #else // CONFIG_CB4X4
1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1
#endif #endif
}; };
...@@ -78,7 +88,7 @@ static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = { ...@@ -78,7 +88,7 @@ static const uint8_t mi_size_high[BLOCK_SIZES_ALL] = {
// Width/height lookup tables in units of various block sizes // Width/height lookup tables in units of various block sizes
static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = { static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 2, 4, 2, 2, 4,
#endif #endif
4, 4, 8, 8, 8, 16, 16, 4, 4, 8, 8, 8, 16, 16,
...@@ -87,7 +97,7 @@ static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = { ...@@ -87,7 +97,7 @@ static const uint8_t block_size_wide[BLOCK_SIZES_ALL] = {
}; };
static const uint8_t block_size_high[BLOCK_SIZES_ALL] = { static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 4, 2, 2, 4, 2,
#endif #endif
4, 8, 4, 8, 16, 8, 16, 4, 8, 4, 8, 16, 8, 16,
...@@ -96,39 +106,39 @@ static const uint8_t block_size_high[BLOCK_SIZES_ALL] = { ...@@ -96,39 +106,39 @@ static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
}; };
static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, IF_EXT_PARTITION(16, 32, 32) 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, IF_EXT_PARTITION(16, 32, 32) 1,
4, 2, 8 4, 2, 8
}; };
static const uint8_t num_4x4_blocks_high_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_4x4_blocks_high_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, IF_EXT_PARTITION(32, 16, 32) 4, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, IF_EXT_PARTITION(32, 16, 32) 4,
1, 8, 2 1, 8, 2
}; };
static const uint8_t num_8x8_blocks_wide_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_8x8_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, IF_EXT_PARTITION(8, 16, 16) 1, 2, 1, 4
}; };
static const uint8_t num_8x8_blocks_high_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_8x8_blocks_high_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, IF_EXT_PARTITION(16, 8, 16) 2, 1, 4, 1
}; };
static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_16x16_blocks_wide_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, IF_EXT_PARTITION(4, 8, 8) 1, 1, 1, 2 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, IF_EXT_PARTITION(4, 8, 8) 1, 1, 1, 2
}; };
static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, IF_EXT_PARTITION(8, 4, 8) 1, 1, 2, 1 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 4, 2, 4, IF_EXT_PARTITION(8, 4, 8) 1, 1, 2, 1
...@@ -136,14 +146,14 @@ static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = { ...@@ -136,14 +146,14 @@ static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES_ALL] = {
// AOMMIN(3, AOMMIN(b_width_log2(bsize), b_height_log2(bsize))) // AOMMIN(3, AOMMIN(b_width_log2(bsize), b_height_log2(bsize)))
static const uint8_t size_group_lookup[BLOCK_SIZES] = { static const uint8_t size_group_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, 0, 0, 0, 0, 0,
#endif #endif
0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, IF_EXT_PARTITION(3, 3, 3) 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, IF_EXT_PARTITION(3, 3, 3)
}; };
static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = { static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 3, 3, 2, 3, 3,
#endif #endif
4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, IF_EXT_PARTITION(13, 13, 14) 6, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, IF_EXT_PARTITION(13, 13, 14) 6,
...@@ -154,7 +164,7 @@ static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = { ...@@ -154,7 +164,7 @@ static const uint8_t num_pels_log2_lookup[BLOCK_SIZES_ALL] = {
static const PARTITION_TYPE static const PARTITION_TYPE
partition_lookup[MAX_SB_SIZE_LOG2 - 1][BLOCK_SIZES] = { partition_lookup[MAX_SB_SIZE_LOG2 - 1][BLOCK_SIZES] = {
{ // 4X4 -> { // 4X4 ->
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif #endif
...@@ -172,7 +182,7 @@ static const PARTITION_TYPE ...@@ -172,7 +182,7 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // 8X8 -> }, { // 8X8 ->
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif #endif
...@@ -191,7 +201,7 @@ static const PARTITION_TYPE ...@@ -191,7 +201,7 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // 16X16 -> }, { // 16X16 ->
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif #endif
...@@ -210,7 +220,7 @@ static const PARTITION_TYPE ...@@ -210,7 +220,7 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // 32X32 -> }, { // 32X32 ->
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif #endif
...@@ -229,7 +239,7 @@ static const PARTITION_TYPE ...@@ -229,7 +239,7 @@ static const PARTITION_TYPE
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // 64X64 -> }, { // 64X64 ->
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif #endif
...@@ -247,7 +257,7 @@ static const PARTITION_TYPE ...@@ -247,7 +257,7 @@ static const PARTITION_TYPE
// 64x128, 128x64, 128x128 // 64x128, 128x64, 128x128
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
}, { // 128x128 -> }, { // 128x128 ->
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID, PARTITION_INVALID,
#endif #endif
...@@ -274,7 +284,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = ...@@ -274,7 +284,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
#endif // CONFIG_EXT_PARTITION_TYPES #endif // CONFIG_EXT_PARTITION_TYPES
{ {
{ // PARTITION_NONE { // PARTITION_NONE
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
BLOCK_2X2, BLOCK_2X4, BLOCK_4X2, BLOCK_2X2, BLOCK_2X4, BLOCK_4X2,
#endif #endif
...@@ -293,7 +303,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = ...@@ -293,7 +303,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_64X128, BLOCK_128X64, BLOCK_128X128, BLOCK_64X128, BLOCK_128X64, BLOCK_128X128,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // PARTITION_HORZ }, { // PARTITION_HORZ
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
// 4X4 // 4X4
...@@ -315,7 +325,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = ...@@ -315,7 +325,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64, BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // PARTITION_VERT }, { // PARTITION_VERT
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
// 4X4 // 4X4
...@@ -337,7 +347,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = ...@@ -337,7 +347,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128, BLOCK_INVALID, BLOCK_INVALID, BLOCK_64X128,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // PARTITION_SPLIT }, { // PARTITION_SPLIT
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif #endif
...@@ -357,7 +367,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = ...@@ -357,7 +367,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
#if CONFIG_EXT_PARTITION_TYPES #if CONFIG_EXT_PARTITION_TYPES
}, { // PARTITION_HORZ_A }, { // PARTITION_HORZ_A
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID,
#endif #endif
...@@ -376,7 +386,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] = ...@@ -376,7 +386,7 @@ static const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES] =
BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64, BLOCK_INVALID, BLOCK_INVALID, BLOCK_128X64,
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
}, { // PARTITION_HORZ_B }, { // PARTITION_HORZ_B
#if CONFIG_CB4X4 #if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID, BLOCK_INVALID