Commit c20dc8eb authored by Jingning Han's avatar Jingning Han

Sync sub8x8 chroma component decoding process

Process sub8x8 chroma component decoding in the unit of 4x4 block.

Change-Id: I02e149f6076cdb5942b8a0a0b9ac2d833b1a7e49
parent f71d5617
......@@ -584,6 +584,9 @@ static INLINE void set_plane_n4(MACROBLOCKD *const xd, int bw, int bh) {
xd->plane[i].width = (bw * MI_SIZE) >> xd->plane[i].subsampling_x;
xd->plane[i].height = (bh * MI_SIZE) >> xd->plane[i].subsampling_y;
xd->plane[i].width = AOMMAX(xd->plane[i].width, 4);
xd->plane[i].height = AOMMAX(xd->plane[i].height, 4);
}
}
......
......@@ -1085,6 +1085,11 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
const int bw = pd->width;
const int bh = pd->height;
#if CONFIG_CB4X4
if (bsize < BLOCK_8X8 && plane && !is_chroma_reference(mi_row, mi_col))
continue;
#endif
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8 && !unify_bsize) {
const PARTITION_TYPE bp = bsize - xd->mi[0]->mbmi.sb_type;
const int have_vsplit = bp != PARTITION_HORZ;
......
......@@ -1659,7 +1659,8 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
const int stepr = tx_size_high_unit[tx_size];
const int stepc = tx_size_wide_unit[tx_size];
#if CONFIG_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
......@@ -1668,6 +1669,11 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane);
const int max_blocks_high = max_block_high(xd, plane_bsize, plane);
#if CONFIG_CB4X4
if (bsize < BLOCK_8X8 && plane && !is_chroma_reference(mi_row, mi_col))
continue;
#endif
for (row = 0; row < max_blocks_high; row += stepr)
for (col = 0; col < max_blocks_wide; col += stepc)
predict_and_reconstruct_intra_block(cm, xd, r, mbmi, plane, row, col,
......@@ -1738,7 +1744,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_CB4X4
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const BLOCK_SIZE plane_bsize =
AOMMAX(BLOCK_4X4, get_plane_block_size(bsize, pd));
#else
const BLOCK_SIZE plane_bsize =
get_plane_block_size(AOMMAX(BLOCK_8X8, bsize), pd);
......@@ -1746,6 +1753,12 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
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;
#if CONFIG_CB4X4
if (bsize < BLOCK_8X8 && plane && !is_chroma_reference(mi_row, mi_col))
continue;
#endif
#if CONFIG_VAR_TX
const TX_SIZE max_tx_size = max_txsize_rect_lookup[plane_bsize];
const int bh_var_tx = tx_size_high_unit[max_tx_size];
......
......@@ -2151,6 +2151,15 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
assert(*tok < tok_end);
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
MB_MODE_INFO *mbmi = &m->mbmi;
#if CONFIG_CB4X4
if (mbmi->sb_type < BLOCK_8X8 && plane &&
!is_chroma_reference(mi_row, mi_col)) {
(*tok)++;
continue;
}
#endif
#if CONFIG_VAR_TX
const struct macroblockd_plane *const pd = &xd->plane[plane];
BLOCK_SIZE bsize = mbmi->sb_type;
......
......@@ -816,6 +816,16 @@ void av1_tokenize_sb(const AV1_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
td->counts->skip[ctx][0] += skip_inc;
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
#if CONFIG_CB4X4
if (bsize < BLOCK_8X8 && plane && !is_chroma_reference(mi_row, mi_col)) {
(*t)->token = EOSB_TOKEN;
(*t)++;
continue;
}
#else
(void)mi_row;
(void)mi_col;
#endif
av1_foreach_transformed_block_in_plane(xd, bsize, plane, tokenize_b,
&arg);
(*t)->token = EOSB_TOKEN;
......
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