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

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] = {
// 00000000
// 00000000
static const uint64_t left_prediction_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2,
0x0000000000000001ULL, // BLOCK_2X4,
0x0000000000000001ULL, // BLOCK_4X2,
......@@ -122,7 +122,7 @@ static const uint64_t left_prediction_mask[BLOCK_SIZES] = {
// 64 bit mask to shift and set for each prediction size.
static const uint64_t above_prediction_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2
......@@ -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
// size in the 64x64 block.
static const uint64_t size_mask[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2
......@@ -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.
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_2X4,
0x0001, // BLOCK_4X2,
......@@ -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.
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_2X4
0x0001, // BLOCK_4X2
......@@ -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
static const uint16_t size_mask_uv[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2
......@@ -1425,8 +1425,12 @@ static void get_filter_level_and_masks_non420(
(blk_row * mi_size_high[BLOCK_8X8] << TX_UNIT_HIGH_LOG2) >> 1;
const int tx_col_idx =
(blk_col * mi_size_wide[BLOCK_8X8] << TX_UNIT_WIDE_LOG2) >> 1;
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE bsize =
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];
tx_size = (plane->plane_type == PLANE_TYPE_UV)
? 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;
static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = {
// mask for vertical edges filtering
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2 - 1, // BLOCK_2X2
2 - 1, // BLOCK_2X4
4 - 1, // BLOCK_4X2
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
4 - 1, // BLOCK_4X4
4 - 1, // BLOCK_4X8
8 - 1, // BLOCK_8X4
......@@ -1924,11 +1928,11 @@ static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES] = {
},
// mask for horizontal edges filtering
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2 - 1, // BLOCK_2X2
4 - 1, // BLOCK_2X4
2 - 1, // BLOCK_4X2
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
4 - 1, // BLOCK_4X4
8 - 1, // BLOCK_4X8
4 - 1, // BLOCK_8X4
......@@ -2043,8 +2047,12 @@ static TX_SIZE av1_get_transform_size(const MODE_INFO *const pCurr,
const int tx_col_idx =
(blk_col * mi_size_wide[BLOCK_8X8] << TX_UNIT_WIDE_LOG2) >> 1;
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE bsize =
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];
assert(mb_tx_size < TX_SIZES_ALL);
......
......@@ -128,7 +128,7 @@ void av1_foreach_transformed_block_in_plane(
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
// transform size varies per plane, look it up in a common way.
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 =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
......@@ -239,11 +239,11 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col,
#endif
for (i = 0; i < nplanes; i++) {
struct macroblockd_plane *const pd = &xd->plane[i];
#if CONFIG_CHROMA_2X2 || !CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#endif
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];
......
......@@ -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
static INLINE int is_rect_tx_allowed_bsize(BLOCK_SIZE bsize) {
static const char LUT[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, // BLOCK_2X2
0, // BLOCK_2X4
0, // BLOCK_4X2
......@@ -953,7 +953,7 @@ static INLINE int is_rect_tx_allowed(const MACROBLOCKD *xd,
#if CONFIG_RECT_TX_EXT
static INLINE int is_quarter_tx_allowed_bsize(BLOCK_SIZE bsize) {
static const char LUT_QTTX[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
0, // BLOCK_2X2
0, // BLOCK_2X4
0, // BLOCK_4X2
......
This diff is collapsed.
......@@ -1072,7 +1072,7 @@ static const aom_prob default_inter_singleref_comp_mode_probs
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255, 128 }, { 255, 128 }, { 255, 128 },
#endif
{ 208, 128 }, { 208, 128 }, { 208, 128 }, { 208, 128 }, { 208, 128 },
......@@ -1085,7 +1085,7 @@ static const aom_prob
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 216 },
......@@ -1097,7 +1097,7 @@ static const aom_prob
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES][COMPOUND_TYPES - 1] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 216 },
......@@ -1125,7 +1125,7 @@ static const aom_prob
};
static const aom_prob default_wedge_interintra_prob[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
208, 208, 208,
#endif
208, 208, 208, 208, 208, 208, 216, 216, 216, 224, 224, 224, 240,
......@@ -1143,7 +1143,7 @@ const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
};
static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 255 }, { 255 }, { 255 }, { 151 }, { 153 }, { 144 }, { 178 },
......@@ -1161,7 +1161,7 @@ const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255 }, { 255 }, { 255 },
#endif
{ 255 }, { 255 }, { 255 }, { 151 }, { 153 }, { 144 }, { 178 },
......@@ -1178,7 +1178,7 @@ const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
};
static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
{
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 255, 200 }, { 255, 200 }, { 255, 200 },
#endif
{ 255, 200 }, { 255, 200 }, { 255, 200 }, { 151, 200 }, { 153, 200 },
......@@ -1191,7 +1191,7 @@ static const aom_prob default_motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1] =
// Probability for the case that only 1 additional motion mode is allowed
static const aom_prob default_obmc_prob[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
255, 255, 255,
#endif
255, 255, 255, 151, 153, 144, 178, 165, 160, 207, 195, 168, 244,
......
......@@ -87,7 +87,7 @@ typedef enum BITSTREAM_PROFILE {
// type, so that we can save memory when they are used in structs/arrays.
typedef enum ATTRIBUTE_PACKED {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
BLOCK_2X2,
BLOCK_2X4,
BLOCK_4X2,
......
......@@ -160,11 +160,11 @@ static const wedge_code_type wedge_codebook_16_heqw[16] = {
};
const wedge_params_type wedge_params_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
......@@ -1829,7 +1829,7 @@ int skip_u4x4_pred_in_obmc(BLOCK_SIZE bsize, const struct macroblockd_plane *pd,
BLOCK_SIZE bsize_plane =
ss_size_lookup[bsize][pd->subsampling_x][pd->subsampling_y];
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
if (bsize_plane < BLOCK_4X4) return 1;
#endif
switch (bsize_plane) {
......@@ -2641,7 +2641,7 @@ static const int ii_weights1d[MAX_SB_SIZE] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
static int ii_size_scales[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
32, 32, 32,
#endif
32, 16, 16, 16, 8, 8, 8, 4,
......@@ -2655,7 +2655,7 @@ static const int ii_weights1d[MAX_SB_SIZE] = {
2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
static int ii_size_scales[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
16, 16, 16,
#endif
16, 8, 8, 8, 4, 4, 4,
......
......@@ -204,11 +204,11 @@ static INLINE int is_interinter_compound_used(COMPOUND_TYPE type,
BLOCK_SIZE sb_type) {
(void)sb_type;
switch (type) {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
case COMPOUND_AVERAGE: return sb_type >= BLOCK_4X4;
#else // CONFIG_CB4X4
#else // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
case COMPOUND_AVERAGE: return 1;
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
#if CONFIG_WEDGE
case COMPOUND_WEDGE: return wedge_params_lookup[sb_type].bits > 0;
#endif // CONFIG_WEDGE
......@@ -221,9 +221,9 @@ static INLINE int is_interinter_compound_used(COMPOUND_TYPE type,
static INLINE int is_any_masked_compound_used(BLOCK_SIZE sb_type) {
COMPOUND_TYPE comp_type;
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
if (sb_type < BLOCK_4X4) return 0;
#endif // CONFIG_CB4X4
#endif // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
for (comp_type = 0; comp_type < COMPOUND_TYPES; comp_type++) {
if (is_masked_compound_type(comp_type) &&
is_interinter_compound_used(comp_type, sb_type))
......
......@@ -301,13 +301,15 @@ static const uint16_t orders_4x4[1024] = {
/* clang-format off */
static const uint16_t *const orders[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_4x4, orders_4x4, orders_4x4,
#endif
// 4X4
orders_4x4,
// 4X8, 8X4, 8X8
orders_4x8, orders_8x4, orders_8x8,
#else
#else // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 4X4
orders_8x8,
// 4X8, 8X4, 8X8
......@@ -327,13 +329,15 @@ static const uint16_t *const orders[BLOCK_SIZES] = {
/* clang-format off */
static const uint16_t *const orders[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_8x8, orders_8x8, orders_8x8,
#endif
// 4X4
orders_8x8,
// 4X8, 8X4, 8X8
orders_8x16, orders_16x8, orders_16x16,
#else
#else // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 4X4
orders_16x16,
// 4X8, 8X4, 8X8
......@@ -388,7 +392,7 @@ static const uint16_t orders_verta_8x8[256] = {
#if CONFIG_EXT_PARTITION
/* clang-format off */
static const uint16_t *const orders_verta[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_4x4, orders_4x4, orders_4x4,
#endif
......@@ -410,13 +414,15 @@ static const uint16_t *const orders_verta[BLOCK_SIZES] = {
/* clang-format off */
static const uint16_t *const orders_verta[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_verta_8x8, orders_verta_8x8, orders_verta_8x8,
#endif
// 4X4
orders_verta_8x8,
// 4X8, 8X4, 8X8
orders_verta_8x8, orders_verta_8x8, orders_verta_16x16,
#else
#else // CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
// 4X4
orders_verta_16x16,
// 4X8, 8X4, 8X8
......@@ -2716,7 +2722,7 @@ void av1_predict_intra_block_facade(MACROBLOCKD *xd, int plane, int block_idx,
CFL_CTX *const cfl = xd->cfl;
if (plane != AOM_PLANE_Y && mbmi->uv_mode == DC_PRED) {
if (plane == AOM_PLANE_U && blk_col == 0 && blk_row == 0) {
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(mbmi->sb_type, pd));
#else
......
......@@ -533,13 +533,11 @@ static int av1_pvq_decode_helper2(AV1_COMMON *cm, MACROBLOCKD *const xd,
static int get_block_idx(const MACROBLOCKD *xd, int plane, int row, int col) {
const int bsize = xd->mi[0]->mbmi.sb_type;
const struct macroblockd_plane *pd = &xd->plane[plane];
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif // CONFIG_CHROMA_2X2
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
......@@ -2024,13 +2022,11 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
const TX_SIZE tx_size = get_tx_size(plane, xd);
const int stepr = tx_size_high_unit[tx_size];
const int stepc = tx_size_wide_unit[tx_size];
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif // CONFIG_CHROMA_2X2
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
......@@ -2104,16 +2100,14 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif // CONFIG_CHROMA_2X2
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
#endif
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
......
......@@ -218,13 +218,11 @@ uint8_t av1_read_coeffs_txb_facade(AV1_COMMON *cm, MACROBLOCKD *xd,
struct macroblockd_plane *pd = &xd->plane[plane];
const BLOCK_SIZE bsize = mbmi->sb_type;
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif // CONFIG_CHROMA_2X2
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else // CONFIG_CB4X4
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
......
......@@ -2754,13 +2754,11 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
#if CONFIG_VAR_TX
const struct macroblockd_plane *const pd = &xd->plane[plane];
BLOCK_SIZE bsize = mbmi->sb_type;
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(bsize, BLOCK_8X8), pd);
......
......@@ -2695,7 +2695,7 @@ static void rd_use_partition(AV1_COMP *cpi, ThreadData *td,
/* clang-format off */
static const BLOCK_SIZE min_partition_size[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
BLOCK_2X2, BLOCK_2X2, BLOCK_2X2, // 2x2, 2x4, 4x2
#endif
BLOCK_4X4, // 4x4
......@@ -2709,7 +2709,7 @@ static const BLOCK_SIZE min_partition_size[BLOCK_SIZES] = {
};
static const BLOCK_SIZE max_partition_size[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, // 2x2, 2x4, 4x2
#endif
BLOCK_8X8, // 4x4
......@@ -2724,7 +2724,7 @@ static const BLOCK_SIZE max_partition_size[BLOCK_SIZES] = {
// Next square block size less or equal than current block size.
static const BLOCK_SIZE next_square_size[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
BLOCK_2X2, BLOCK_2X2, BLOCK_2X2, // 2x2, 2x4, 4x2
#endif
BLOCK_4X4, // 4x4
......
......@@ -1606,13 +1606,13 @@ void av1_predict_intra_block_encoder_facade(MACROBLOCK *x,
#if CONFIG_DEBUG
// av1_predict_intra_block_facade does not pass plane_bsize, we need to validate
// that we will get the same value of plane_bsize on the other side.
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize_val =
AOMMAX(BLOCK_4X4, get_plane_block_size(mbmi->sb_type, &xd->plane[plane]));
#else
const BLOCK_SIZE plane_bsize_val =
get_plane_block_size(mbmi->sb_type, &xd->plane[plane]);
#endif // CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#endif // CONFIG_CHROMA_SUB8X8
assert(plane_bsize == plane_bsize_val);
#endif // CONFIG_DEBUG
av1_predict_intra_block_facade(xd, plane, block_idx, blk_col, blk_row,
......
......@@ -1408,7 +1408,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
aom_highbd_8_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits8,
aom_highbd_sad4x4x8_bits8, aom_highbd_sad4x4x4d_bits8)
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_8_variance2x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_8_variance4x2, NULL, NULL,
......@@ -1613,7 +1613,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
aom_highbd_10_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits10,
aom_highbd_sad4x4x8_bits10, aom_highbd_sad4x4x4d_bits10)
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_10_variance2x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_10_variance4x2, NULL, NULL,
......@@ -1820,7 +1820,7 @@ static void highbd_set_var_fns(AV1_COMP *const cpi) {
aom_highbd_12_sub_pixel_avg_variance4x4, aom_highbd_sad4x4x3_bits12,
aom_highbd_sad4x4x8_bits12, aom_highbd_sad4x4x4d_bits12)
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
HIGHBD_BFP(BLOCK_2X2, NULL, NULL, aom_highbd_12_variance2x2, NULL, NULL,
NULL, NULL, NULL)
HIGHBD_BFP(BLOCK_4X2, NULL, NULL, aom_highbd_12_variance4x2, NULL, NULL,
......@@ -2402,7 +2402,7 @@ AV1_COMP *av1_create_compressor(AV1EncoderConfig *oxcf,
aom_sub_pixel_variance4x4, aom_sub_pixel_avg_variance4x4, aom_sad4x4x3,
aom_sad4x4x8, aom_sad4x4x4d)
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
BFP(BLOCK_2X2, NULL, NULL, aom_variance2x2, NULL, NULL, NULL, NULL, NULL)
BFP(BLOCK_2X4, NULL, NULL, aom_variance2x4, NULL, NULL, NULL, NULL, NULL)
BFP(BLOCK_4X2, NULL, NULL, aom_variance4x2, NULL, NULL, NULL, NULL, NULL)
......
......@@ -184,13 +184,11 @@ void av1_write_coeffs_mb(const AV1_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE bsize = mbmi->sb_type;
struct macroblockd_plane *pd = &xd->plane[plane];
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif // CONFIG_CHROMA_2X2
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(bsize, BLOCK_8X8), pd);
......
......@@ -51,7 +51,7 @@
// This table is used to correct for block size.
// The factors here are << 2 (2 = x0.5, 32 = x8 etc).
static const uint8_t rd_thresh_block_size_factor[BLOCK_SIZES] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
2, 2, 2,
#endif
2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32,
......@@ -797,7 +797,7 @@ void av1_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
const struct macroblockd_plane *pd,
ENTROPY_CONTEXT t_above[2 * MAX_MIB_SIZE],
ENTROPY_CONTEXT t_left[2 * MAX_MIB_SIZE]) {
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
......
......@@ -1006,11 +1006,11 @@ static void model_rd_for_sb(const AV1_COMP *const cpi, BLOCK_SIZE bsize,
for (plane = plane_from; plane <= plane_to; ++plane) {
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE bs = AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
#endif // CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#endif // CONFIG_CHROMA_SUB8X8
unsigned int sse;
int rate;
......@@ -1272,13 +1272,11 @@ int av1_cost_coeffs(const AV1_COMP *const cpi, MACROBLOCK *x, int plane,
const MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
const struct macroblockd_plane *pd = &xd->plane[plane];
const BLOCK_SIZE bsize = mbmi->sb_type;
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#endif // CONFIG_CHROMA_2X2
#elif CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
#else // CONFIG_CB4X4
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
......
......@@ -666,7 +666,7 @@ void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
}
#endif
const struct macroblockd_plane *const pd = &xd->plane[plane];
#if CONFIG_CB4X4 && !CONFIG_CHROMA_2X2
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
......
......@@ -138,7 +138,7 @@ const map_entry refs_map[] = { ENUM(INTRA_FRAME), ENUM(LAST_FRAME),
LAST_ENUM };
const map_entry block_size_map[] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
ENUM(BLOCK_2X2), ENUM(BLOCK_2X4), ENUM(BLOCK_4X2),
#endif
ENUM(BLOCK_4X4), ENUM(BLOCK_4X8), ENUM(BLOCK_8X4),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment