Commit 22508f88 authored by Hui Su's avatar Hui Su
Browse files

intrabc: allow delay to carry to previous SB rows

Very little impact on comression quality.

Change-Id: I3b0fbebe7c6e53f299a764aba49a22b931bb8bd0
parent fe8323c9
......@@ -462,7 +462,7 @@ static INLINE int av1_is_dv_valid(const MV dv, const TileInfo *const tile,
const int SCALE_PX_TO_MV = 8;
// Disallow subpixel for now
// SUBPEL_MASK is not the correct scale
if ((dv.row & (SCALE_PX_TO_MV - 1) || dv.col & (SCALE_PX_TO_MV - 1)))
if (((dv.row & (SCALE_PX_TO_MV - 1)) || (dv.col & (SCALE_PX_TO_MV - 1))))
return 0;
// Is the source top-left inside the current tile?
const int src_top_edge = mi_row * MI_SIZE * SCALE_PX_TO_MV + dv.row;
......@@ -483,22 +483,23 @@ static INLINE int av1_is_dv_valid(const MV dv, const TileInfo *const tile,
// constraints to facilitate HW decoder.
const int max_mib_size = 1 << mib_size_log2;
const int active_sb_row = mi_row >> mib_size_log2;
const int active_64_col = (mi_col * MI_SIZE) >> 6;
const int active_sb64_col = (mi_col * MI_SIZE) >> 6;
const int sb_size = max_mib_size * MI_SIZE;
const int src_sb_row = ((src_bottom_edge >> 3) - 1) / sb_size;
const int src_64_col = ((src_right_edge >> 3) - 1) >> 6;
const int src_sb64_col = ((src_right_edge >> 3) - 1) >> 6;
const int total_sb64_per_row =
((tile->mi_col_end - tile->mi_col_start - 1) >> 4) + 1;
const int active_sb64 = active_sb_row * total_sb64_per_row + active_sb64_col;
const int src_sb64 = src_sb_row * total_sb64_per_row + src_sb64_col;
if (src_sb64 >= active_sb64 - INTRABC_DELAY_SB64) return 0;
#if USE_WAVE_FRONT
const int gradient = 1 + INTRABC_DELAY_SB64 + (sb_size > 64);
const int wf_offset = gradient * (active_sb_row - src_sb_row);
if (src_sb_row > active_sb_row ||
src_64_col >= active_64_col - INTRABC_DELAY_SB64 + wf_offset)
return 0;
#else
if (src_sb_row > active_sb_row ||
(src_sb_row == active_sb_row &&
src_64_col >= active_64_col - INTRABC_DELAY_SB64))
src_sb64_col >= active_sb64_col - INTRABC_DELAY_SB64 + wf_offset)
return 0;
#endif
return 1;
}
#endif // CONFIG_INTRABC
......
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