Make mi_width/height_log2_lookup table support 4x4 mode_info unit
Change the table content to support 4x4 mode_info unit. Refactor
partition_plane_context() to reflect the fact that the minimum
partition block size is 8x8.
Change-Id: Id26fcfba8d74efdb9ae316c9d066cd65358dd7e6
diff --git a/av1/common/common_data.h b/av1/common/common_data.h
index 0de9a71..27cc933 100644
--- a/av1/common/common_data.h
+++ b/av1/common/common_data.h
@@ -42,15 +42,17 @@
// Log 2 conversion lookup tables for modeinfo width and height
static const uint8_t mi_width_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
- 0, 0, 0,
-#endif
+ 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, IF_EXT_PARTITION(4, 5, 5)
+#else
0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, IF_EXT_PARTITION(3, 4, 4)
+#endif
};
static const uint8_t mi_height_log2_lookup[BLOCK_SIZES] = {
#if CONFIG_CB4X4
- 0, 0, 0,
-#endif
+ 0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, IF_EXT_PARTITION(5, 4, 5)
+#else
0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, IF_EXT_PARTITION(4, 3, 4)
+#endif
};
static const uint8_t mi_size_wide[BLOCK_SIZES] = {
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 9c533b7..2c9505c 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -700,7 +700,8 @@
const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col;
const PARTITION_CONTEXT *left_ctx =
xd->left_seg_context + (mi_row & MAX_MIB_MASK);
- const int bsl = mi_width_log2_lookup[bsize];
+ // Minimum partition point is 8x8. Offset the bsl accordingly.
+ const int bsl = mi_width_log2_lookup[bsize] - mi_width_log2_lookup[BLOCK_8X8];
int above = (*above_ctx >> bsl) & 1, left = (*left_ctx >> bsl) & 1;
assert(b_width_log2_lookup[bsize] == b_height_log2_lookup[bsize]);