Commit 47de4660 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry

cb4x4: Don't assume TX units are half MI_SIZE in has_bottom_left()

Currently the "transform units" used to measure transform sizes
in some parts of the code are based on the smallest defined
transform size.

cb4x4 currently defines a 2x2 transform size, even when chroma_2x2
is not enabled, which means that the scale of the transform units
was always double that of MODEINFO units.

Several areas of the code were hard-coding this assumption instead
of converting from one to the other using appropriate constants.

Change-Id: Iff437425f2c5abd02a82ff1c7c8002aefc2f75a6
parent 5e81643d
......@@ -518,9 +518,13 @@ static int has_bottom_left(BLOCK_SIZE bsize, int mi_row, int mi_col,
// and/or bottom-left superblocks. But only the left superblock is
// available, so check if all required pixels fall in that superblock.
if (blk_col_in_sb == 0) {
const int blk_start_row_off = blk_row_in_sb << (bh_in_mi_log2 + !ss_y);
const int blk_start_row_off = blk_row_in_sb
<< (bh_in_mi_log2 + MI_SIZE_LOG2 -
tx_size_wide_log2[0]) >>
ss_y;
const int row_off_in_sb = blk_start_row_off + row_off;
const int sb_height_unit = MAX_MIB_SIZE << !ss_y;
const int sb_height_unit =
MAX_MIB_SIZE << (MI_SIZE_LOG2 - tx_size_wide_log2[0]) >> ss_y;
return row_off_in_sb + bottom_left_count_unit < sb_height_unit;
}
......
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