Commit 6ea917ec authored by Debargha Mukherjee's avatar Debargha Mukherjee

Remove CONFIG_CB4X4 config flags

Since CB4X4 is adopted and without it the codec does not work,
it is better to remove it and simplify the code.

Change-Id: I51019312846928069727967e3b2bbb60f0fba80d
parent a3d4fe50
...@@ -25,13 +25,8 @@ int av1_get_MBs(int width, int height) { ...@@ -25,13 +25,8 @@ int av1_get_MBs(int width, int height) {
const int mi_cols = aligned_width >> MI_SIZE_LOG2; const int mi_cols = aligned_width >> MI_SIZE_LOG2;
const int mi_rows = aligned_height >> MI_SIZE_LOG2; const int mi_rows = aligned_height >> MI_SIZE_LOG2;
#if CONFIG_CB4X4
const int mb_cols = (mi_cols + 2) >> 2; const int mb_cols = (mi_cols + 2) >> 2;
const int mb_rows = (mi_rows + 2) >> 2; const int mb_rows = (mi_rows + 2) >> 2;
#else
const int mb_cols = (mi_cols + 1) >> 1;
const int mb_rows = (mi_rows + 1) >> 1;
#endif
return mb_rows * mb_cols; return mb_rows * mb_cols;
} }
...@@ -48,13 +43,8 @@ void av1_set_mb_mi(AV1_COMMON *cm, int width, int height) { ...@@ -48,13 +43,8 @@ void av1_set_mb_mi(AV1_COMMON *cm, int width, int height) {
cm->mi_rows = aligned_height >> MI_SIZE_LOG2; cm->mi_rows = aligned_height >> MI_SIZE_LOG2;
cm->mi_stride = calc_mi_size(cm->mi_cols); cm->mi_stride = calc_mi_size(cm->mi_cols);
#if CONFIG_CB4X4
cm->mb_cols = (cm->mi_cols + 2) >> 2; cm->mb_cols = (cm->mi_cols + 2) >> 2;
cm->mb_rows = (cm->mi_rows + 2) >> 2; cm->mb_rows = (cm->mi_rows + 2) >> 2;
#else
cm->mb_cols = (cm->mi_cols + 1) >> 1;
cm->mb_rows = (cm->mi_rows + 1) >> 1;
#endif
cm->MBs = cm->mb_rows * cm->mb_cols; cm->MBs = cm->mb_rows * cm->mb_cols;
} }
......
...@@ -2981,13 +2981,6 @@ static void set_lpf_parameters( ...@@ -2981,13 +2981,6 @@ static void set_lpf_parameters(
} }
} }
#if !CONFIG_CB4X4
// prepare internal edge parameters
if (curr_level && !curr_skipped) {
params->filter_length_internal = (TX_4X4 >= ts) ? (4) : (0);
}
#endif
// prepare common parameters // prepare common parameters
if (params->filter_length || params->filter_length_internal) { if (params->filter_length || params->filter_length_internal) {
const loop_filter_thresh *const limits = cm->lf_info.lfthr + level; const loop_filter_thresh *const limits = cm->lf_info.lfthr + level;
...@@ -3474,9 +3467,6 @@ void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, AV1_COMMON *cm, ...@@ -3474,9 +3467,6 @@ void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, AV1_COMMON *cm,
int mi_row, mi_col; int mi_row, mi_col;
int plane; int plane;
#if CONFIG_VAR_TX || CONFIG_EXT_PARTITION || CONFIG_EXT_PARTITION_TYPES || \
CONFIG_CB4X4
#if !CONFIG_PARALLEL_DEBLOCKING #if !CONFIG_PARALLEL_DEBLOCKING
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
for (int i = 0; i < MAX_MB_PLANE; ++i) for (int i = 0; i < MAX_MB_PLANE; ++i)
...@@ -3521,75 +3511,7 @@ void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, AV1_COMMON *cm, ...@@ -3521,75 +3511,7 @@ void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, AV1_COMMON *cm,
} }
} }
} }
#endif // CONFIG_PARALLEL_DEBLOCKING #endif // !CONFIG_PARALLEL_DEBLOCKING
#else // CONFIG_VAR_TX || CONFIG_EXT_PARTITION || CONFIG_EXT_PARTITION_TYPES
#if CONFIG_PARALLEL_DEBLOCKING
for (mi_row = start; mi_row < stop; mi_row += MAX_MIB_SIZE) {
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
av1_setup_dst_planes(planes, cm->sb_size, frame_buffer, mi_row, mi_col);
// filter all vertical edges in every 64x64 super block
for (plane = plane_start; plane < plane_end; plane += 1) {
av1_filter_block_plane_vert(cm, plane, &planes[plane], mi_row, mi_col);
}
}
}
for (mi_row = start; mi_row < stop; mi_row += MAX_MIB_SIZE) {
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
av1_setup_dst_planes(planes, cm->sb_size, frame_buffer, mi_row, mi_col);
// filter all horizontal edges in every 64x64 super block
for (plane = plane_start; plane < plane_end; plane += 1) {
av1_filter_block_plane_horz(cm, plane, &planes[plane], mi_row, mi_col);
}
}
}
#else // CONFIG_PARALLEL_DEBLOCKING
enum lf_path path;
LOOP_FILTER_MASK lfm;
if (y_only)
path = LF_PATH_444;
else if (planes[1].subsampling_y == 1 && planes[1].subsampling_x == 1)
path = LF_PATH_420;
else if (planes[1].subsampling_y == 0 && planes[1].subsampling_x == 0)
path = LF_PATH_444;
else
path = LF_PATH_SLOW;
for (mi_row = start; mi_row < stop; mi_row += MAX_MIB_SIZE) {
MODE_INFO **mi = cm->mi_grid_visible + mi_row * cm->mi_stride;
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MAX_MIB_SIZE) {
av1_setup_dst_planes(planes, cm->sb_size, frame_buffer, mi_row, mi_col);
// TODO(JBB): Make setup_mask work for non 420.
av1_setup_mask(cm, mi_row, mi_col, mi + mi_col, cm->mi_stride, &lfm);
av1_filter_block_plane_ss00_ver(cm, &planes[0], mi_row, &lfm);
av1_filter_block_plane_ss00_hor(cm, &planes[0], mi_row, &lfm);
for (plane = 1; plane < num_planes; ++plane) {
switch (path) {
case LF_PATH_420:
av1_filter_block_plane_ss11_ver(cm, &planes[plane], mi_row, &lfm);
av1_filter_block_plane_ss11_hor(cm, &planes[plane], mi_row, &lfm);
break;
case LF_PATH_444:
av1_filter_block_plane_ss00_ver(cm, &planes[plane], mi_row, &lfm);
av1_filter_block_plane_ss00_hor(cm, &planes[plane], mi_row, &lfm);
break;
case LF_PATH_SLOW:
av1_filter_block_plane_non420_ver(cm, &planes[plane], mi + mi_col,
mi_row, mi_col, plane);
av1_filter_block_plane_non420_hor(cm, &planes[plane], mi + mi_col,
mi_row, mi_col, plane);
break;
}
}
}
}
#endif // CONFIG_PARALLEL_DEBLOCKING
#endif // CONFIG_VAR_TX || CONFIG_EXT_PARTITION || CONFIG_EXT_PARTITION_TYPES
} }
void av1_loop_filter_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, void av1_loop_filter_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
......
...@@ -178,15 +178,10 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd, ...@@ -178,15 +178,10 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
int plane; int plane;
for (plane = 0; plane < MAX_MB_PLANE; ++plane) { for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
#if CONFIG_CB4X4
if (!is_chroma_reference(mi_row, mi_col, bsize, if (!is_chroma_reference(mi_row, mi_col, bsize,
xd->plane[plane].subsampling_x, xd->plane[plane].subsampling_x,
xd->plane[plane].subsampling_y)) xd->plane[plane].subsampling_y))
continue; continue;
#else
(void)mi_row;
(void)mi_col;
#endif
av1_foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg); av1_foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg);
} }
} }
...@@ -200,11 +195,7 @@ void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, ...@@ -200,11 +195,7 @@ void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
ENTROPY_CONTEXT *const l = pd->left_context + loff; ENTROPY_CONTEXT *const l = pd->left_context + loff;
const int txs_wide = tx_size_wide_unit[tx_size]; const int txs_wide = tx_size_wide_unit[tx_size];
const int txs_high = tx_size_high_unit[tx_size]; const int txs_high = tx_size_high_unit[tx_size];
#if CONFIG_CB4X4
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type; const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
#else
const BLOCK_SIZE bsize = AOMMAX(xd->mi[0]->mbmi.sb_type, BLOCK_8X8);
#endif
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd); const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
// above // above
...@@ -240,17 +231,11 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col, ...@@ -240,17 +231,11 @@ void av1_reset_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize) { BLOCK_SIZE bsize) {
int i; int i;
int nplanes; int nplanes;
#if CONFIG_CB4X4
int chroma_ref; int chroma_ref;
chroma_ref = chroma_ref =
is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x,
xd->plane[1].subsampling_y); xd->plane[1].subsampling_y);
nplanes = 1 + (MAX_MB_PLANE - 1) * chroma_ref; nplanes = 1 + (MAX_MB_PLANE - 1) * chroma_ref;
#else
(void)mi_row;
(void)mi_col;
nplanes = MAX_MB_PLANE;
#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_SUB8X8 #if CONFIG_CHROMA_SUB8X8
......
...@@ -478,12 +478,8 @@ static INLINE int is_intrabc_block(const MB_MODE_INFO *mbmi) { ...@@ -478,12 +478,8 @@ static INLINE int is_intrabc_block(const MB_MODE_INFO *mbmi) {
#endif #endif
static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) { static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) {
#if CONFIG_CB4X4
(void)block; (void)block;
return mi->mbmi.mode; return mi->mbmi.mode;
#else
return mi->mbmi.sb_type < BLOCK_8X8 ? mi->bmi[block].as_mode : mi->mbmi.mode;
#endif
} }
#if CONFIG_CFL #if CONFIG_CFL
...@@ -687,7 +683,6 @@ typedef struct cfl_ctx { ...@@ -687,7 +683,6 @@ typedef struct cfl_ctx {
// Whether the reconstructed luma pixels need to be stored // Whether the reconstructed luma pixels need to be stored
int store_y; int store_y;
#if CONFIG_CB4X4
int is_chroma_reference; int is_chroma_reference;
#if CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG #if CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
// The prediction used for sub8x8 blocks originates from multiple luma blocks, // The prediction used for sub8x8 blocks originates from multiple luma blocks,
...@@ -695,7 +690,6 @@ typedef struct cfl_ctx { ...@@ -695,7 +690,6 @@ typedef struct cfl_ctx {
// each luma block // each luma block
uint8_t sub8x8_val[CFL_SUB8X8_VAL_MI_SQUARE]; uint8_t sub8x8_val[CFL_SUB8X8_VAL_MI_SQUARE];
#endif // CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG #endif // CONFIG_CHROMA_SUB8X8 && CONFIG_DEBUG
#endif // CONFIG_CB4X4
} CFL_CTX; } CFL_CTX;
#endif // CONFIG_CFL #endif // CONFIG_CFL
...@@ -875,7 +869,7 @@ static INLINE int is_rect_tx(TX_SIZE tx_size) { return tx_size >= TX_SIZES; } ...@@ -875,7 +869,7 @@ static INLINE int is_rect_tx(TX_SIZE tx_size) { return tx_size >= TX_SIZES; }
#endif // CONFIG_RECT_TX #endif // CONFIG_RECT_TX
static INLINE int block_signals_txsize(BLOCK_SIZE bsize) { static INLINE int block_signals_txsize(BLOCK_SIZE bsize) {
#if CONFIG_CB4X4 && (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX #if (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX
return bsize > BLOCK_4X4; return bsize > BLOCK_4X4;
#else #else
return bsize >= BLOCK_8X8; return bsize >= BLOCK_8X8;
...@@ -975,12 +969,12 @@ static INLINE TxSetType get_ext_tx_set_type(TX_SIZE tx_size, BLOCK_SIZE bs, ...@@ -975,12 +969,12 @@ static INLINE TxSetType get_ext_tx_set_type(TX_SIZE tx_size, BLOCK_SIZE bs,
int is_inter, int use_reduced_set) { int is_inter, int use_reduced_set) {
const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size]; const TX_SIZE tx_size_sqr_up = txsize_sqr_up_map[tx_size];
const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size]; const TX_SIZE tx_size_sqr = txsize_sqr_map[tx_size];
#if CONFIG_CB4X4 && USE_TXTYPE_SEARCH_FOR_SUB8X8_IN_CB4X4 #if USE_TXTYPE_SEARCH_FOR_SUB8X8_IN_CB4X4
(void)bs; (void)bs;
if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY; if (tx_size_sqr_up > TX_32X32) return EXT_TX_SET_DCTONLY;
#else #else
if (tx_size_sqr_up > TX_32X32 || bs < BLOCK_8X8) return EXT_TX_SET_DCTONLY; if (tx_size_sqr_up > TX_32X32 || bs < BLOCK_8X8) return EXT_TX_SET_DCTONLY;
#endif #endif // USE_TXTYPE_SEARCH_FOR_SUB8X8_IN_CB4X4
if (use_reduced_set) if (use_reduced_set)
return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX; return is_inter ? EXT_TX_SET_DCT_IDTX : EXT_TX_SET_DTT4_IDTX;
#if CONFIG_MRC_TX #if CONFIG_MRC_TX
...@@ -1173,13 +1167,8 @@ static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode, ...@@ -1173,13 +1167,8 @@ static INLINE TX_SIZE tx_size_from_tx_mode(BLOCK_SIZE bsize, TX_MODE tx_mode,
#endif // (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX #endif // (CONFIG_VAR_TX || CONFIG_EXT_TX) && CONFIG_RECT_TX
(void)is_inter; (void)is_inter;
#if CONFIG_VAR_TX && CONFIG_RECT_TX #if CONFIG_VAR_TX && CONFIG_RECT_TX
#if CONFIG_CB4X4
if (bsize == BLOCK_4X4) if (bsize == BLOCK_4X4)
return AOMMIN(max_txsize_lookup[bsize], largest_tx_size); return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
#else
if (bsize < BLOCK_8X8)
return AOMMIN(max_txsize_lookup[bsize], largest_tx_size);
#endif
if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size) if (txsize_sqr_map[max_rect_tx_size] <= largest_tx_size)
return max_rect_tx_size; return max_rect_tx_size;
else else
...@@ -1297,38 +1286,23 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type, ...@@ -1297,38 +1286,23 @@ static INLINE TX_TYPE av1_get_tx_type(PLANE_TYPE plane_type,
if (xd->lossless[mbmi->segment_id] || txsize_sqr_map[tx_size] > TX_32X32 || if (xd->lossless[mbmi->segment_id] || txsize_sqr_map[tx_size] > TX_32X32 ||
(txsize_sqr_map[tx_size] >= TX_32X32 && !is_inter_block(mbmi))) (txsize_sqr_map[tx_size] >= TX_32X32 && !is_inter_block(mbmi)))
return DCT_DCT; return DCT_DCT;
if (mbmi->sb_type >= BLOCK_8X8 || CONFIG_CB4X4) { if (plane_type == PLANE_TYPE_Y) {
if (plane_type == PLANE_TYPE_Y) {
#if !ALLOW_INTRA_EXT_TX #if !ALLOW_INTRA_EXT_TX
if (is_inter_block(mbmi)) if (is_inter_block(mbmi))
#endif // ALLOW_INTRA_EXT_TX #endif // ALLOW_INTRA_EXT_TX
return mbmi->tx_type; return mbmi->tx_type;
} }
if (is_inter_block(mbmi)) { if (is_inter_block(mbmi)) {
// UV Inter only // UV Inter only
return (mbmi->tx_type == IDTX && txsize_sqr_map[tx_size] >= TX_32X32) return (mbmi->tx_type == IDTX && txsize_sqr_map[tx_size] >= TX_32X32)
? DCT_DCT ? DCT_DCT
: mbmi->tx_type; : mbmi->tx_type;
}
} }
#if CONFIG_CB4X4
(void)block; (void)block;
return intra_mode_to_tx_type_context[get_uv_mode(mbmi->uv_mode)]; return intra_mode_to_tx_type_context[get_uv_mode(mbmi->uv_mode)];
#else // CONFIG_CB4X4 #else // CONFIG_EXT_TX
// Sub8x8-Inter/Intra OR UV-Intra
if (is_inter_block(mbmi)) { // Sub8x8-Inter
return DCT_DCT;
} else { // Sub8x8 Intra OR UV-Intra
const int block_raster_idx =
av1_block_index_to_raster_order(tx_size, block);
return intra_mode_to_tx_type_context[plane_type == PLANE_TYPE_Y
? get_y_mode(mi, block_raster_idx)
: get_uv_mode(mbmi->uv_mode)];
}
#endif // CONFIG_CB4X4
#else // CONFIG_EXT_TX
(void)block; (void)block;
#if CONFIG_MRC_TX #if CONFIG_MRC_TX
if (mbmi->tx_type == MRC_DCT) { if (mbmi->tx_type == MRC_DCT) {
...@@ -1463,14 +1437,8 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) { ...@@ -1463,14 +1437,8 @@ static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) {
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi, static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi,
BLOCK_SIZE bsize, int subsampled) { BLOCK_SIZE bsize, int subsampled) {
#if CONFIG_CB4X4
(void)mbmi; (void)mbmi;
TX_SIZE max_txsize = max_txsize_rect_lookup[bsize]; TX_SIZE max_txsize = max_txsize_rect_lookup[bsize];
#else
TX_SIZE max_txsize = mbmi->sb_type < BLOCK_8X8
? max_txsize_rect_lookup[mbmi->sb_type]
: max_txsize_rect_lookup[bsize];
#endif // CONFIG_C4X4
#if CONFIG_EXT_PARTITION && CONFIG_TX64X64 #if CONFIG_EXT_PARTITION && CONFIG_TX64X64
// The decoder is designed so that it can process 64x64 luma pixels at a // The decoder is designed so that it can process 64x64 luma pixels at a
...@@ -1662,11 +1630,7 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) { ...@@ -1662,11 +1630,7 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) {
const MODE_INFO *mi = xd->mi[0]; const MODE_INFO *mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi; const MB_MODE_INFO *const mbmi = &mi->mbmi;
int ref; int ref;
#if CONFIG_CB4X4
const int unify_bsize = 1; const int unify_bsize = 1;
#else
const int unify_bsize = 0;
#endif
// First check if all modes are ZEROMV // First check if all modes are ZEROMV
if (mbmi->sb_type >= BLOCK_8X8 || unify_bsize) { if (mbmi->sb_type >= BLOCK_8X8 || unify_bsize) {
......
...@@ -61,7 +61,6 @@ static const uint8_t b_height_log2_lookup[BLOCK_SIZES_ALL] = { ...@@ -61,7 +61,6 @@ 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_CHROMA_SUB8X8 #if CONFIG_CHROMA_SUB8X8
0, 0, 0, 0,
0, 0,
...@@ -76,21 +75,8 @@ static const uint8_t mi_width_log2_lookup[BLOCK_SIZES_ALL] = { ...@@ -76,21 +75,8 @@ static const uint8_t mi_width_log2_lookup[BLOCK_SIZES_ALL] = {
2, 1, 2, 1,
3, 2, 3, 2,
4, IF_EXT_PARTITION(3, 5) 4, IF_EXT_PARTITION(3, 5)
#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, 1,
3, IF_EXT_PARTITION(2, 4)
#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_CHROMA_SUB8X8 #if CONFIG_CHROMA_SUB8X8
0, 0, 0, 0,
0, 0,
...@@ -105,44 +91,22 @@ static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = { ...@@ -105,44 +91,22 @@ static const uint8_t mi_height_log2_lookup[BLOCK_SIZES_ALL] = {
0, 3, 0, 3,
1, 4, 1, 4,
2, IF_EXT_PARTITION(5, 3) 2, IF_EXT_PARTITION(5, 3)
#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, 3,
1, IF_EXT_PARTITION(2, 4)
#endif
}; };
/* 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_CHROMA_SUB8X8 #if CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16,
IF_EXT_PARTITION(16, 32, 32) 1, 4, 2, 8, 4, 16, IF_EXT_PARTITION(8, 32) IF_EXT_PARTITION(16, 32, 32) 1, 4, 2, 8, 4, 16, IF_EXT_PARTITION(8, 32)
#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,
2, 8, IF_EXT_PARTITION(4, 16)
#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_CHROMA_SUB8X8 #if CONFIG_CHROMA_SUB8X8
1, 1, 1, 1, 1, 1,
#endif #endif
1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16,
IF_EXT_PARTITION(32, 16, 32) 4, 1, 8, 2, 16, 4, IF_EXT_PARTITION(32, 8) IF_EXT_PARTITION(32, 16, 32) 4, 1, 8, 2, 16, 4, IF_EXT_PARTITION(32, 8)
#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,
8, 2, IF_EXT_PARTITION(16, 4)
#endif
}; };
/* clang-format on */ /* clang-format on */
...@@ -748,7 +712,6 @@ static const TX_TYPE_1D htx_tab[TX_TYPES] = { ...@@ -748,7 +712,6 @@ static const TX_TYPE_1D htx_tab[TX_TYPES] = {
// block which may use a rectangular transform, in which case it is // block which may use a rectangular transform, in which case it is
// "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8 // "(max_txsize_lookup[bsize] + 1) - TX_8X8", invalid for bsize < 8X8
static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = { static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
#if CONFIG_CB4X4
#if CONFIG_CHROMA_SUB8X8 #if CONFIG_CHROMA_SUB8X8
// 2X2, 2X4, 4X2, // 2X2, 2X4, 4X2,
INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN,
...@@ -757,12 +720,6 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = { ...@@ -757,12 +720,6 @@ static const int32_t intra_tx_size_cat_lookup[BLOCK_SIZES_ALL] = {
INT32_MIN, INT32_MIN,
// 4X8, 8X4, 8X8, // 4X8, 8X4, 8X8,
TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_8X8 - TX_8X8, TX_8X8 - TX_8X8,
#else // CONFIG_CB4X4
// 4X4
INT32_MIN,
// 4X8, 8X4, 8X8
INT32_MIN, INT32_MIN, TX_8X8 - TX_8X8,
#endif // CONFIG_CB4X4
// 8X16, 16X8, 16X16 // 8X16, 16X8, 16X16
TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_16X16 - TX_8X8, TX_16X16 - TX_8X8,
// 16X32, 32X16, 32X32 // 16X32, 32X16, 32X32
...@@ -1098,15 +1055,11 @@ static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES_ALL][2][2] = { ...@@ -1098,15 +1055,11 @@ static const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES_ALL][2][2] = {
{ { BLOCK_4X4, BLOCK_4X2 }, { BLOCK_2X4, BLOCK_2X2 } }, { { BLOCK_4X4, BLOCK_4X2 }, { BLOCK_2X4, BLOCK_2X2 } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_2X4 } }, { { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_2X4 } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X2 } }, { { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X2 } },
#elif CONFIG_CB4X4 #else
{ { BLOCK_4X4, BLOCK_4X4 }, { BLOCK_4X4, BLOCK_4X4 } }, { { BLOCK_4X4, BLOCK_4X4 }, { BLOCK_4X4, BLOCK_4X4 } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_4X4 } }, { { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_4X4 } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X4 } }, { { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_4X4 } },
#else #endif // CONFIG_CHROMA_SUB8X8
{ { BLOCK_4X4, BLOCK_INVALID }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_4X8, BLOCK_4X4 }, { BLOCK_INVALID, BLOCK_INVALID } },
{ { BLOCK_8X4, BLOCK_INVALID }, { BLOCK_4X4, BLOCK_INVALID } },
#endif
{ { BLOCK_8X8, BLOCK_8X4 }, { BLOCK_4X8, BLOCK_4X4 } }, { { BLOCK_8X8, BLOCK_8X4 }, { BLOCK_4X8, BLOCK_4X4 } },
{ { BLOCK_8X16, BLOCK_8X8 }, { BLOCK_INVALID, BLOCK_4X8 } }, { { BLOCK_8X16, BLOCK_8X8 }, { BLOCK_INVALID, BLOCK_4X8 } },
{ { BLOCK_16X8, BLOCK_INVALID }, { BLOCK_8X8, BLOCK_8X4 } }, { { BLOCK_16X8, BLOCK_INVALID }, { BLOCK_8X8, BLOCK_8X4 } },
......
...@@ -45,11 +45,7 @@ extern "C" { ...@@ -45,11 +45,7 @@ extern "C" {
#define MIN_SB_SIZE_LOG2 6 #define MIN_SB_SIZE_LOG2 6
// Pixels per Mode Info (MI) unit // Pixels per Mode Info (MI) unit
#if CONFIG_CB4X4
#define MI_SIZE_LOG2 2 #define MI_SIZE_LOG2 2
#else
#define MI_SIZE_LOG2 3
#endif
#define MI_SIZE (1 << MI_SIZE_LOG2) #define MI_SIZE (1 << MI_SIZE_LOG2)
// MI-units per max superblock (MI Block - MIB) // MI-units per max superblock (MI Block - MIB)
......
...@@ -244,7 +244,7 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm, ...@@ -244,7 +244,7 @@ static INLINE int_mv gm_get_motion_vector(const WarpedMotionParams *gm,
int is_integer int is_integer
#endif #endif
) { ) {
const int unify_bsize = CONFIG_CB4X4; const int unify_bsize = 1;
int_mv res; int_mv res;
const int32_t *mat = gm->wmmat; const int32_t *mat = gm->wmmat;
int x, y, tx, ty; int x, y, tx, ty;
......
...@@ -65,11 +65,7 @@ static uint8_t add_ref_mv_candidate( ...@@ -65,11 +65,7 @@ static uint8_t add_ref_mv_candidate(
int subsampling_y) { int subsampling_y) {
int index = 0, ref; int index = 0, ref;
int newmv_count = 0; int newmv_count = 0;
#if CONFIG_CB4X4
const int unify_bsize = 1; const int unify_bsize = 1;
#else
const int unify_bsize = 0;
#endif
assert(weight % 2 == 0); assert(weight % 2 == 0);
#if !CONFIG_EXT_WARPED_MOTION #if !CONFIG_EXT_WARPED_MOTION
(void)bsize; (void)bsize;
...@@ -274,7 +270,6 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -274,7 +270,6 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int i; int i;
uint8_t newmv_count = 0; uint8_t newmv_count = 0;
int col_offset = 0; int col_offset = 0;
#if CONFIG_CB4X4
const int shift = 0; const int shift = 0;
// TODO(jingning): Revisit this part after cb4x4 is stable. // TODO(jingning): Revisit this part after cb4x4 is stable.
if (abs(row_offset) > 1) { if (abs(row_offset) > 1) {
...@@ -282,10 +277,6 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -282,10 +277,6 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (mi_col & 0x01 && xd->n8_w < n8_w_8) --col_offset; if (mi_col & 0x01 && xd->n8_w < n8_w_8) --col_offset;
} }
const int use_step_16 = (xd->n8_w >= 16); const int use_step_16 = (xd->n8_w >= 16);
#else
const int shift = 1;
const int use_step_16 = (xd->n8_w >= 8);
#endif
MODE_INFO **const candidate_mi0 = xd->mi + row_offset * xd->mi_stride; MODE_INFO **const candidate_mi0 = xd->mi + row_offset * xd->mi_stride;
for (i = 0; i < end_mi && *refmv_count < MAX_REF_MV_STACK_SIZE;) { for (i = 0; i < end_mi && *refmv_count < MAX_REF_MV_STACK_SIZE;) {
...@@ -350,17 +341,12 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -350,17 +341,12 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int i; int i;
uint8_t newmv_count = 0; uint8_t newmv_count = 0;
int row_offset = 0; int row_offset = 0;
#if CONFIG_CB4X4
const int shift = 0; const int shift = 0;
if (abs(col_offset) > 1) { if (abs(col_offset) > 1) {
row_offset = 1; row_offset = 1;
if (mi_row & 0x01 && xd->n8_h < n8_h_8) --row_offset; if (mi_row & 0x01 && xd->n8_h < n8_h_8) --row_offset;
} }
const int use_step_16 = (xd->n8_h >= 16); const int use_step_16 = (xd->n8_h >= 16);
#else
const int shift = 1;
const int use_step_16 = (xd->n8_h >= 8);
#endif
for (i = 0; i < end_mi && *refmv_count < MAX_REF_MV_STACK_SIZE;) { for (i = 0; i < end_mi && *refmv_count < MAX_REF_MV_STACK_SIZE;) {
const MODE_INFO *const candidate_mi = const MODE_INFO *const candidate_mi =
...@@ -751,10 +737,8 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -751,10 +737,8 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const TileInfo *const tile = &xd->tile; const TileInfo *const tile = &xd->tile;
int max_row_offset = 0, max_col_offset = 0; int max_row_offset = 0, max_col_offset = 0;
#if CONFIG_CB4X4
const int row_adj = (xd->n8_h < mi_size_high[BLOCK_8X8]) && (mi_row & 0x01); const int row_adj = (xd->n8_h < mi_size_high[BLOCK_8X8]) && (mi_row & 0x01);
const int col_adj = (xd->n8_w < mi_size_wide[BLOCK_8X8]) && (mi_col & 0x01); const int col_adj = (xd->n8_w < mi_size_wide[BLOCK_8X8]) && (mi_col & 0x01);
#endif
int processed_rows = 0; int processed_rows = 0;
int processed_cols = 0; int processed_cols = 0;
int row_offset, col_offset; int row_offset, col_offset;
...@@ -765,21 +749,13 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -765,21 +749,13 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
// Find valid maximum row/col offset. // Find valid maximum row/col offset.
if (xd->up_available) { if (xd->up_available) {
#if CONFIG_CB4X4
max_row_offset = -(MVREF_ROWS << 1) + row_adj; max_row_offset = -(MVREF_ROWS << 1) + row_adj;
#else
max_row_offset = -MVREF_ROWS;
#endif
max_row_offset = max_row_offset =
find_valid_row_offset(tile, mi_row, cm->mi_rows, cm, max_row_offset); find_valid_row_offset(tile, mi_row, cm->mi_rows, cm, max_row_offset);
} }