Commit 551f37d6 authored by Jingning Han's avatar Jingning Han
Browse files

Fix partition coding of corner block

This commit fixed the allowable partition types for bottom-right
corner blocks.

When a block has over half of its pixels as valid content in both
vertical and horizontal directions, allow all the four partition
types in the bit-stream. Otherwise, apply partition type constraints.

Change-Id: I2252e2de7125a8bfb1c824bf34299a13c81102e3
parent f18328cb
...@@ -313,9 +313,7 @@ static int check_bsize_coverage(VP9_COMMON *cm, MACROBLOCKD *xd, ...@@ -313,9 +313,7 @@ static int check_bsize_coverage(VP9_COMMON *cm, MACROBLOCKD *xd,
int bsl = mi_width_log2(bsize), bs = 1 << bsl; int bsl = mi_width_log2(bsize), bs = 1 << bsl;
int ms = bs / 2; int ms = bs / 2;
if ((mi_row + bs <= cm->mi_rows) && (mi_col + ms < cm->mi_cols)) if ((mi_row + ms < cm->mi_rows) && (mi_col + ms < cm->mi_cols))
return 0;
if ((mi_col + bs <= cm->mi_cols) && (mi_row + ms < cm->mi_rows))
return 0; return 0;
// frame width/height are multiples of 8, hence 8x8 block should always // frame width/height are multiples of 8, hence 8x8 block should always
...@@ -323,9 +321,11 @@ static int check_bsize_coverage(VP9_COMMON *cm, MACROBLOCKD *xd, ...@@ -323,9 +321,11 @@ static int check_bsize_coverage(VP9_COMMON *cm, MACROBLOCKD *xd,
assert(bsize > BLOCK_SIZE_SB8X8); assert(bsize > BLOCK_SIZE_SB8X8);
// return the node index in the prob tree for binary coding // return the node index in the prob tree for binary coding
if ((mi_col + bs <= cm->mi_cols) && (mi_row + ms >= cm->mi_rows)) // skip horizontal/none partition types
if ((mi_col + ms < cm->mi_cols) && (mi_row + ms >= cm->mi_rows))
return 1; return 1;
if ((mi_row + bs <= cm->mi_rows) && (mi_col + ms >= cm->mi_cols)) // skip vertical/none partition types
if ((mi_row + ms < cm->mi_rows) && (mi_col + ms >= cm->mi_cols))
return 2; return 2;
return -1; return -1;
......
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