Commit 9fa96234 authored by Hui Su's avatar Hui Su

Remove experimental flag of chroma_sub8x8

Change-Id: I32c5015bedef07f58413c679b4aaf30651a357b9
parent 6e6b6974
......@@ -385,11 +385,9 @@ static const uint64_t above_64x64_txform_mask[TX_SIZES] = {
// 00000000
// 00000000
static const uint64_t left_prediction_mask[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2,
0x0000000000000001ULL, // BLOCK_2X4,
0x0000000000000001ULL, // BLOCK_4X2,
#endif
0x0000000000000001ULL, // BLOCK_4X4,
0x0000000000000001ULL, // BLOCK_4X8,
0x0000000000000001ULL, // BLOCK_8X4,
......@@ -413,11 +411,9 @@ static const uint64_t left_prediction_mask[BLOCK_SIZES_ALL] = {
// 64 bit mask to shift and set for each prediction size.
static const uint64_t above_prediction_mask[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2
#endif
0x0000000000000001ULL, // BLOCK_4X4
0x0000000000000001ULL, // BLOCK_4X8
0x0000000000000001ULL, // BLOCK_8X4
......@@ -442,11 +438,9 @@ static const uint64_t above_prediction_mask[BLOCK_SIZES_ALL] = {
// each 8x8 block that would be in the top left most block of the given block
// size in the 64x64 block.
static const uint64_t size_mask[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0x0000000000000001ULL, // BLOCK_2X2
0x0000000000000001ULL, // BLOCK_2X4
0x0000000000000001ULL, // BLOCK_4X2
#endif
0x0000000000000001ULL, // BLOCK_4X4
0x0000000000000001ULL, // BLOCK_4X8
0x0000000000000001ULL, // BLOCK_8X4
......@@ -495,11 +489,9 @@ 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_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2,
0x0001, // BLOCK_2X4,
0x0001, // BLOCK_4X2,
#endif
0x0001, // BLOCK_4X4,
0x0001, // BLOCK_4X8,
0x0001, // BLOCK_8X4,
......@@ -523,11 +515,9 @@ static const uint16_t left_prediction_mask_uv[BLOCK_SIZES_ALL] = {
// 16 bit above mask to shift and set for uv each prediction size.
static const uint16_t above_prediction_mask_uv[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2
#endif
0x0001, // BLOCK_4X4
0x0001, // BLOCK_4X8
0x0001, // BLOCK_8X4
......@@ -551,11 +541,9 @@ static const uint16_t above_prediction_mask_uv[BLOCK_SIZES_ALL] = {
// 64 bit mask to shift and set for each uv prediction size
static const uint16_t size_mask_uv[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0x0001, // BLOCK_2X2
0x0001, // BLOCK_2X4
0x0001, // BLOCK_4X2
#endif
0x0001, // BLOCK_4X4
0x0001, // BLOCK_4X8
0x0001, // BLOCK_8X4
......@@ -2144,12 +2132,8 @@ 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_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]
......@@ -2628,11 +2612,9 @@ 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_ALL] = {
// mask for vertical edges filtering
{
#if CONFIG_CHROMA_SUB8X8
2 - 1, // BLOCK_2X2
2 - 1, // BLOCK_2X4
4 - 1, // BLOCK_4X2
#endif // CONFIG_CHROMA_SUB8X8
4 - 1, // BLOCK_4X4
4 - 1, // BLOCK_4X8
8 - 1, // BLOCK_8X4
......@@ -2664,11 +2646,9 @@ static const uint32_t av1_prediction_masks[NUM_EDGE_DIRS][BLOCK_SIZES_ALL] = {
},
// mask for horizontal edges filtering
{
#if CONFIG_CHROMA_SUB8X8
2 - 1, // BLOCK_2X2
4 - 1, // BLOCK_2X4
2 - 1, // BLOCK_4X2
#endif // CONFIG_CHROMA_SUB8X8
4 - 1, // BLOCK_4X4
8 - 1, // BLOCK_4X8
4 - 1, // BLOCK_8X4
......@@ -2779,13 +2759,8 @@ static TX_SIZE av1_get_transform_size(const MODE_INFO *const mi,
(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_SUB8X8
const BLOCK_SIZE bsize =
AOMMAX(BLOCK_4X4, ss_size_lookup[sb_type][scale_horz][scale_vert]);
#else
const BLOCK_SIZE bsize = ss_size_lookup[sb_type][scale_horz][scale_vert];
#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,12 +128,8 @@ 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 = av1_get_tx_size(plane, xd);
#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 uint8_t txw_unit = tx_size_wide_unit[tx_size];
const uint8_t txh_unit = tx_size_high_unit[tx_size];
const int step = txw_unit * txh_unit;
......@@ -235,12 +231,8 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col,
nplanes = 1 + (MAX_MB_PLANE - 1) * chroma_ref;
for (i = 0; i < nplanes; i++) {
struct macroblockd_plane *const pd = &xd->plane[i];
#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];
memset(pd->above_context, 0, sizeof(ENTROPY_CONTEXT) * txs_wide);
......
......@@ -31,12 +31,6 @@
extern "C" {
#endif
#if (CONFIG_CHROMA_SUB8X8)
#define SUB8X8_COMP_REF 0
#else
#define SUB8X8_COMP_REF 1
#endif
#define MAX_MB_PLANE 3
#if CONFIG_COMPOUND_SEGMENT
......@@ -72,11 +66,7 @@ typedef enum {
static INLINE int is_comp_ref_allowed(BLOCK_SIZE bsize) {
(void)bsize;
#if SUB8X8_COMP_REF
return 1;
#else
return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
#endif // SUB8X8_COMP_REF
}
static INLINE int is_inter_mode(PREDICTION_MODE mode) {
......@@ -611,11 +601,11 @@ typedef struct {
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_CFL
#if CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#if CONFIG_DEBUG
#define CFL_SUB8X8_VAL_MI_SIZE (4)
#define CFL_SUB8X8_VAL_MI_SQUARE \
(CFL_SUB8X8_VAL_MI_SIZE * CFL_SUB8X8_VAL_MI_SIZE)
#endif // CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#endif // CONFIG_DEBUG
typedef struct cfl_ctx {
// The CfL prediction buffer is used in two steps:
// 1. Stores Q3 reconstructed luma pixels
......@@ -644,12 +634,12 @@ typedef struct cfl_ctx {
int store_y;
int is_chroma_reference;
#if CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#if CONFIG_DEBUG
// The prediction used for sub8x8 blocks originates from multiple luma blocks,
// this array is used to validate that cfl_store() is called only once for
// each luma block
uint8_t sub8x8_val[CFL_SUB8X8_VAL_MI_SQUARE];
#endif // CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#endif // CONFIG_DEBUG
} CFL_CTX;
#endif // CONFIG_CFL
......@@ -671,10 +661,8 @@ typedef struct macroblockd {
int up_available;
int left_available;
#if CONFIG_CHROMA_SUB8X8
int chroma_up_available;
int chroma_left_available;
#endif
const aom_prob (*partition_probs)[PARTITION_TYPES - 1];
......@@ -1027,11 +1015,9 @@ static INLINE int is_lgt_allowed(PREDICTION_MODE mode, TX_SIZE tx_size) {
#if CONFIG_RECT_TX
static INLINE int is_rect_tx_allowed_bsize(BLOCK_SIZE bsize) {
static const char LUT[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0, // BLOCK_2X2
0, // BLOCK_2X4
0, // BLOCK_4X2
#endif
0, // BLOCK_4X4
1, // BLOCK_4X8
1, // BLOCK_8X4
......@@ -1076,11 +1062,9 @@ 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_ALL] = {
#if CONFIG_CHROMA_SUB8X8
0, // BLOCK_2X2
0, // BLOCK_2X4
0, // BLOCK_4X2
#endif
0, // BLOCK_4X4
0, // BLOCK_4X8
0, // BLOCK_8X4
......
......@@ -24,9 +24,9 @@ void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm) {
cfl->subsampling_y = cm->subsampling_y;
cfl->are_parameters_computed = 0;
cfl->store_y = 0;
#if CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#if CONFIG_DEBUG
cfl_clear_sub8x8_val(cfl);
#endif // CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#endif // CONFIG_DEBUG
}
// Due to frame boundary issues, it is possible that the total area covered by
......@@ -169,20 +169,16 @@ static void cfl_dc_pred(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize) {
int sum_u = 0;
int sum_v = 0;
// Match behavior of build_intra_predictors_high (reconintra.c) at superblock
// boundaries:
// base-1 base-1 base-1 .. base-1 base-1 base-1 base-1 base-1 base-1
// base+1 A B .. Y Z
// base+1 C D .. W X
// base+1 E F .. U V
// base+1 G H .. S T T T T T
// ..
// Match behavior of build_intra_predictors_high (reconintra.c) at superblock
// boundaries:
// base-1 base-1 base-1 .. base-1 base-1 base-1 base-1 base-1 base-1
// base+1 A B .. Y Z
// base+1 C D .. W X
// base+1 E F .. U V
// base+1 G H .. S T T T T T
// ..
#if CONFIG_CHROMA_SUB8X8
if (xd->chroma_up_available && xd->mb_to_right_edge >= 0) {
#else
if (xd->up_available && xd->mb_to_right_edge >= 0) {
#endif
sum_above_row(xd, width, &sum_u, &sum_v);
} else {
const int base = 128 << (xd->bd - 8);
......@@ -190,11 +186,7 @@ static void cfl_dc_pred(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize) {
sum_v = width * (base - 1);
}
#if CONFIG_CHROMA_SUB8X8
if (xd->chroma_left_available && xd->mb_to_bottom_edge >= 0) {
#else
if (xd->left_available && xd->mb_to_bottom_edge >= 0) {
#endif
sum_left_col(xd, height, &sum_u, &sum_v);
} else {
const int base = 128 << (xd->bd - 8);
......@@ -454,7 +446,6 @@ static INLINE void cfl_store(CFL_CTX *cfl, const uint8_t *input,
}
}
#if CONFIG_CHROMA_SUB8X8
// Adjust the row and column of blocks smaller than 8X8, as chroma-referenced
// and non-chroma-referenced blocks are stored together in the CfL buffer.
static INLINE void sub8x8_adjust_offset(const CFL_CTX *cfl, int *row_out,
......@@ -485,7 +476,6 @@ static INLINE void sub8x8_set_val(CFL_CTX *cfl, int row, int col, int val_high,
}
}
#endif // CONFIG_DEBUG
#endif // CONFIG_CHROMA_SUB8X8
void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
BLOCK_SIZE bsize) {
......@@ -494,8 +484,6 @@ void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
uint8_t *dst =
&pd->dst.buf[(row * pd->dst.stride + col) << tx_size_wide_log2[0]];
(void)bsize;
#if CONFIG_CHROMA_SUB8X8
if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
// Only dimensions of size 4 can have an odd offset.
assert(!((col & 1) && tx_size_wide[tx_size] != 4));
......@@ -506,7 +494,6 @@ void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
tx_size_wide_unit[tx_size]);
#endif // CONFIG_DEBUG
}
#endif
cfl_store(cfl, dst, pd->dst.stride, row, col, tx_size_wide[tx_size],
tx_size_high[tx_size], get_bitdepth_data_path_index(xd));
}
......@@ -516,7 +503,6 @@ void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) {
struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
int row = 0;
int col = 0;
#if CONFIG_CHROMA_SUB8X8
bsize = AOMMAX(BLOCK_4X4, bsize);
if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
sub8x8_adjust_offset(cfl, &row, &col);
......@@ -524,7 +510,6 @@ void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) {
sub8x8_set_val(cfl, row, col, mi_size_high[bsize], mi_size_wide[bsize]);
#endif // CONFIG_DEBUG
}
#endif // CONFIG_CHROMA_SUB8X8
const int width = max_intra_block_width(xd, bsize, AOM_PLANE_Y, tx_size);
const int height = max_intra_block_height(xd, bsize, AOM_PLANE_Y, tx_size);
cfl_store(cfl, pd->dst.buf, pd->dst.stride, row, col, width, height,
......@@ -538,7 +523,6 @@ void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
// Do not call cfl_compute_parameters multiple time on the same values.
assert(cfl->are_parameters_computed == 0);
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE plane_bsize = AOMMAX(
BLOCK_4X4, get_plane_block_size(mbmi->sb_type, &xd->plane[AOM_PLANE_U]));
#if CONFIG_DEBUG
......@@ -551,10 +535,6 @@ void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
cfl_clear_sub8x8_val(cfl);
}
#endif // CONFIG_DEBUG
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(mbmi->sb_type, &xd->plane[AOM_PLANE_U]);
#endif
// AOM_PLANE_U is used, but both planes will have the same sizes.
cfl->uv_width = max_intra_block_width(xd, plane_bsize, AOM_PLANE_U, tx_size);
cfl->uv_height =
......
This diff is collapsed.
This diff is collapsed.
......@@ -122,11 +122,9 @@ typedef enum BITSTREAM_PROFILE {
// type, so that we can save memory when they are used in structs/arrays.
typedef enum ATTRIBUTE_PACKED {
#if CONFIG_CHROMA_SUB8X8
BLOCK_2X2,
BLOCK_2X4,
BLOCK_4X2,
#endif
BLOCK_4X4,
BLOCK_4X8,
BLOCK_8X4,
......
......@@ -36,7 +36,6 @@ static INLINE void foreach_overlappable_nb_above(const AV1_COMMON *cm,
MODE_INFO **above_mi = prev_row_mi + above_mi_col;
mi_step = AOMMIN(mi_size_wide[above_mi[0]->mbmi.sb_type],
mi_size_wide[BLOCK_64X64]);
#if CONFIG_CHROMA_SUB8X8
// If we're considering a block with width 4, it should be treated as
// half of a pair of blocks with chroma information in the second. Move
// above_mi_col back to the start of the pair if needed, set above_mbmi
......@@ -47,7 +46,6 @@ static INLINE void foreach_overlappable_nb_above(const AV1_COMMON *cm,
above_mi = prev_row_mi + above_mi_col + 1;
mi_step = 2;
}
#endif // CONFIG_CHROMA_SUB8X8
MB_MODE_INFO *above_mbmi = &above_mi[0]->mbmi;
if (is_neighbor_overlappable(above_mbmi)) {
++nb_count;
......@@ -76,13 +74,11 @@ static INLINE void foreach_overlappable_nb_left(const AV1_COMMON *cm,
MODE_INFO **left_mi = prev_col_mi + left_mi_row * xd->mi_stride;
mi_step = AOMMIN(mi_size_high[left_mi[0]->mbmi.sb_type],
mi_size_high[BLOCK_64X64]);
#if CONFIG_CHROMA_SUB8X8
if (mi_step == 1) {
left_mi_row &= ~1;
left_mi = prev_col_mi + (left_mi_row + 1) * xd->mi_stride;
mi_step = 2;
}
#endif // CONFIG_CHROMA_SUB8X8
MB_MODE_INFO *left_mbmi = &left_mi[0]->mbmi;
if (is_neighbor_overlappable(left_mbmi)) {
++nb_count;
......
......@@ -674,11 +674,11 @@ static INLINE int frame_is_intra_only(const AV1_COMMON *const cm) {
}
#if CONFIG_CFL
#if CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#if CONFIG_DEBUG
static INLINE void cfl_clear_sub8x8_val(CFL_CTX *cfl) {
memset(cfl->sub8x8_val, 0, sizeof(cfl->sub8x8_val));
}
#endif // CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#endif // CONFIG_DEBUG
void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm);
#endif // CONFIG_CFL
......@@ -729,14 +729,12 @@ static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) {
int col_offset = mi_col;
for (i = 0; i < MAX_MB_PLANE; ++i) {
struct macroblockd_plane *const pd = &xd->plane[i];
#if CONFIG_CHROMA_SUB8X8
// Offset the buffer pointer
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
if (pd->subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
row_offset = mi_row - 1;
if (pd->subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
col_offset = mi_col - 1;
#endif
int above_idx = col_offset << (MI_SIZE_LOG2 - tx_size_wide_log2[0]);
int left_idx = (row_offset & MAX_MIB_MASK)
<< (MI_SIZE_LOG2 - tx_size_high_log2[0]);
......@@ -787,14 +785,12 @@ static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
#endif // CONFIG_DEPENDENT_HORZTILES
xd->left_available = (mi_col > tile->mi_col_start);
#if CONFIG_CHROMA_SUB8X8
xd->chroma_up_available = xd->up_available;
xd->chroma_left_available = xd->left_available;
if (xd->plane[1].subsampling_x && bw < mi_size_wide[BLOCK_8X8])
xd->chroma_left_available = (mi_col - 1) > tile->mi_col_start;
if (xd->plane[1].subsampling_y && bh < mi_size_high[BLOCK_8X8])
xd->chroma_up_available = (mi_row - 1) > tile->mi_row_start;
#endif
if (xd->up_available) {
xd->above_mi = xd->mi[-xd->mi_stride];
// above_mi may be NULL in encoder's first pass.
......@@ -876,22 +872,11 @@ static INLINE void update_partition_context(MACROBLOCKD *xd, int mi_row,
static INLINE int is_chroma_reference(int mi_row, int mi_col, BLOCK_SIZE bsize,
int subsampling_x, int subsampling_y) {
#if CONFIG_CHROMA_SUB8X8
const int bw = mi_size_wide[bsize];
const int bh = mi_size_high[bsize];
int ref_pos = ((mi_row & 0x01) || !(bh & 0x01) || !subsampling_y) &&
((mi_col & 0x01) || !(bw & 0x01) || !subsampling_x);
return ref_pos;
#else
int ref_pos = !(((mi_row & 0x01) && subsampling_y) ||
((mi_col & 0x01) && subsampling_x));
if (AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8) ref_pos = 1;
return ref_pos;
#endif
}
static INLINE BLOCK_SIZE scale_chroma_bsize(BLOCK_SIZE bsize, int subsampling_x,
......
......@@ -343,11 +343,9 @@ static const wedge_code_type wedge_codebook_16_heqw[16] = {
};
const wedge_params_type wedge_params_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
#endif // CONFIG_CHROMA_SUB8X8
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
......@@ -1140,7 +1138,6 @@ static INLINE void build_inter_predictors(
(void)block;
(void)cm;
#if CONFIG_CHROMA_SUB8X8
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
const int ss_x = pd->subsampling_x;
const int ss_y = pd->subsampling_y;
......@@ -1347,9 +1344,6 @@ static INLINE void build_inter_predictors(
for (ref = 0; ref < 2; ++ref) pd->pre[ref] = orig_pred_buf[ref];
return;
}
#else
(void)cm;
#endif // CONFIG_CHROMA_SUB8X8
{
struct buf_2d *const dst_buf = &pd->dst;
......@@ -1751,9 +1745,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_CHROMA_SUB8X8
if (bsize_plane < BLOCK_4X4) return 1;
#endif
switch (bsize_plane) {
#if DISABLE_CHROMA_U8X8_OBMC
case BLOCK_4X4:
......@@ -2503,9 +2495,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_ALL] = {
#if CONFIG_CHROMA_SUB8X8
32, 32, 32,
#endif
32, 16, 16, 16, 8, 8, 8, 4,
4, 4, 2, 2, 2, 1, 1, 1,
16, 16, 8, 8, 4, 4, 2, 2
......@@ -2518,9 +2508,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_ALL] = {
#if CONFIG_CHROMA_SUB8X8
16, 16, 16,
#endif
16, 8, 8, 8, 4, 4, 4,
2, 2, 2, 1, 1, 1,
8, 8, 4, 4, 2, 2,
......
......@@ -221,11 +221,7 @@ static INLINE int is_interinter_compound_used(COMPOUND_TYPE type,
BLOCK_SIZE sb_type) {
(void)sb_type;
switch (type) {
#if CONFIG_CHROMA_SUB8X8
case COMPOUND_AVERAGE: return sb_type >= BLOCK_4X4;
#else // CONFIG_CHROMA_SUB8X8
case COMPOUND_AVERAGE: return 1;
#endif // CONFIG_CHROMA_SUB8X8
#if CONFIG_WEDGE
case COMPOUND_WEDGE: return wedge_params_lookup[sb_type].bits > 0;
#endif // CONFIG_WEDGE
......@@ -239,9 +235,7 @@ 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_CHROMA_SUB8X8
if (sb_type < BLOCK_4X4) return 0;
#endif // 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))
......@@ -410,15 +404,11 @@ static INLINE void setup_pred_plane(struct buf_2d *dst, BLOCK_SIZE bsize,
int stride, int mi_row, int mi_col,
const struct scale_factors *scale,
int subsampling_x, int subsampling_y) {
#if CONFIG_CHROMA_SUB8X8
// Offset the buffer pointer
if (subsampling_y && (mi_row & 0x01) && (mi_size_high[bsize] == 1))
mi_row -= 1;
if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1))
mi_col -= 1;
#else
(void)bsize;
#endif
const int x = (MI_SIZE * mi_col) >> subsampling_x;
const int y = (MI_SIZE * mi_row) >> subsampling_y;
......
......@@ -367,10 +367,8 @@ static const uint16_t orders_4x4[1024] = {
#if CONFIG_EXT_PARTITION
/* clang-format off */
static const uint16_t *const orders[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_4x4, orders_4x4, orders_4x4,
#endif
// 4X4
orders_4x4,
// 4X8, 8X4, 8X8
......@@ -394,10 +392,8 @@ static const uint16_t *const orders[BLOCK_SIZES_ALL] = {
#else
/* clang-format off */
static const uint16_t *const orders[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_8x8, orders_8x8, orders_8x8,
#endif
// 4X4
orders_8x8,
// 4X8, 8X4, 8X8
......@@ -453,10 +449,8 @@ 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_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_4x4, orders_4x4, orders_4x4,
#endif
// 4X4
orders_verta_8x8,
// 4X8, 8X4, 8X8
......@@ -475,10 +469,8 @@ static const uint16_t *const orders_verta[BLOCK_SIZES] = {
#else
/* clang-format off */
static const uint16_t *const orders_verta[BLOCK_SIZES] = {
#if CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2
orders_verta_8x8, orders_verta_8x8, orders_verta_8x8,
#endif
// 4X4
orders_verta_8x8,
// 4X8, 8X4, 8X8
......@@ -2579,16 +2571,11 @@ static void predict_intra_block_helper(const AV1_COMMON *cm,
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];
#if CONFIG_CHROMA_SUB8X8
const int have_top = row_off || (pd->subsampling_y ? xd->chroma_up_available
: xd->up_available);
const int have_left =
col_off ||
(pd->subsampling_x ? xd->chroma_left_available : xd->left_available);
#else
const int have_top = row_off || xd->up_available;
const int have_left = col_off || xd->left_available;
#endif
const int x = col_off << tx_size_wide_log2[0];
const int y = row_off << tx_size_high_log2[0];
const int mi_row = -xd->mb_to_top_edge >> (3 + MI_SIZE_LOG2);
......@@ -2598,13 +2585,8 @@ static void predict_intra_block_helper(const AV1_COMMON *cm,
#if !INTRA_USES_RECT_TRANSFORMS
assert(txwpx == txhpx);
#endif // !INTRA_USES_RECT_TRANSFORMS
#if !CONFIG_CHROMA_SUB8X8
const int xr_chr_offset = (pd->subsampling_x && bsize < BLOCK_8X8) ? 2 : 0;
const int yd_chr_offset = (pd->subsampling_y && bsize < BLOCK_8X8) ? 2 : 0;
#else
const int xr_chr_offset = 0;
const int yd_chr_offset = 0;
#endif
// Distance between the right edge of this prediction block to
// the frame right edge
......
......@@ -257,12 +257,8 @@ static void inverse_transform_block(MACROBLOCKD *xd, int plane,
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_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 // CONFIG_CHROMA_SUB8X8
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const TX_SIZE tx_size = av1_get_tx_size(plane, xd);
const uint8_t txh_unit = tx_size_high_unit[tx_size];
......@@ -612,11 +608,11 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
set_offsets(cm, xd, bsize, mi_row, mi_col, bw, bh, x_mis, y_mis);
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
#if CONFIG_CFL && CONFIG_CHROMA_SUB8X8
#if CONFIG_CFL
CFL_CTX *const cfl = xd->cfl;
cfl->is_chroma_reference = is_chroma_reference(
mi_row, mi_col, bsize, cfl->subsampling_x, cfl->subsampling_y);
#endif // CONFIG_CFL && CONFIG_CHROMA_SUB8X8
#endif // CONFIG_CFL
if (cm->delta_q_present_flag) {
int i;
......@@ -769,12 +765,8 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
const TX_SIZE tx_size = av1_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_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 // CONFIG_CHROMA_SUB8X8
int row, col;
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
......@@ -864,12 +856,8 @@ 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_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 // CONFIG_CHROMA_SUB8X8
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
int row, col;
......@@ -915,7 +903,7 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
}
}
}
#if CONFIG_CFL && CONFIG_CHROMA_SUB8X8
#if CONFIG_CFL
if (mbmi->uv_mode != UV_CFL_PRED) {
#if CONFIG_DEBUG
if (cfl->is_chroma_reference) {
......@@ -926,7 +914,7 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
cfl_store_block(xd, mbmi->sb_type, mbmi->tx_size);
}
}
#endif // CONFIG_CFL && CONFIG_CHROMA_SUB8X8
#endif // CONFIG_CFL
#endif // CONFIG_COEF_INTERLEAVE
int reader_corrupted_flag = aom_reader_has_error(r);
......
......@@ -626,12 +626,8 @@ 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_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 // CONFIG_CHROMA_SUB8X8
TXB_CTX txb_ctx;
get_txb_ctx(plane_bsize, tx_size, plane, pd->above_context + col,
......
......@@ -2252,12 +2252,8 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
}
const struct macroblockd_plane *const pd = &xd->plane[plane];
BLOCK_SIZE bsize = mbmi->sb_type;
#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 // CONFIG_CHROMA_SUB8X8
const int num_4x4_w =
block_size_wide[plane_bsize] >> tx_size_wide_log2[0];
......
......@@ -2076,9 +2076,7 @@ static void rd_use_partition(AV1_COMP *cpi, ThreadData *td,
/* clang-format off */
static const BLOCK_SIZE min_partition_size[BLOCK_SIZES_ALL] = {
#if CONFIG_CHROMA_SUB8X8
BLOCK_2X2, BLOCK_2X2, BLOCK_2X2, // 2x2, 2x4, 4x2
#endif
BLOCK_4X4, // 4x4
BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, // 4x8, 8x4, 8x8
BLOCK_4X4, BLOCK_4X4, BLOCK_8X8, // 8x16, 16x8, 16x16
......@@ -2095,9 +2093,7 @@ static const BLOCK_SIZE min_partition_size[BLOCK_SIZES_ALL] = {