]> granicus.if.org Git - libvpx/commitdiff
Fix partition coding of corner block
authorJingning Han <jingning@google.com>
Tue, 11 Jun 2013 02:54:06 +0000 (19:54 -0700)
committerJingning Han <jingning@google.com>
Tue, 11 Jun 2013 04:43:17 +0000 (21:43 -0700)
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

vp9/common/vp9_onyxc_int.h

index 121995093a1d52d193bbbfa2b91c25229321868c..f461bf3badda1e9c9a1c731082693cab09794350 100644 (file)
@@ -313,9 +313,7 @@ static int check_bsize_coverage(VP9_COMMON *cm, MACROBLOCKD *xd,
   int bsl = mi_width_log2(bsize), bs = 1 << bsl;
   int ms = bs / 2;
 
-  if ((mi_row + bs <= cm->mi_rows) && (mi_col + ms < cm->mi_cols))
-    return 0;
-  if ((mi_col + bs <= cm->mi_cols) && (mi_row + ms < cm->mi_rows))
+  if ((mi_row + ms < cm->mi_rows) && (mi_col + ms < cm->mi_cols))
     return 0;
 
   // 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,
   assert(bsize > BLOCK_SIZE_SB8X8);
 
   // 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;
-  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 -1;