Commit 3da18d60 authored by Jingning Han's avatar Jingning Han

Account for sub8x8 chroma intra boundary condition

Properly account for the intra boundary condition for sub8x8
chroma components in the modified chroma-2x2 framework. This fixes
a rare enc/dec mismatch issue when chroma-sub8x8 is turned on.

Change-Id: I058a2fb855a491bf604277f4c82169c1b55424fa
parent b9c652a7
......@@ -585,6 +585,10 @@ 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];
......
......@@ -640,6 +640,14 @@ 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.
......
......@@ -2184,8 +2184,16 @@ static void predict_square_intra_block(const MACROBLOCKD *xd, int wpx, int hpx,
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_CB4X4 && 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);
......
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