Commit bcf62ea4 authored by Jingning Han's avatar Jingning Han

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
parent 5f7bc741
......@@ -42,15 +42,17 @@ static const uint8_t b_height_log2_lookup[BLOCK_SIZES] = {
// 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] = {
......
......@@ -700,7 +700,8 @@ static INLINE int partition_plane_context(const MACROBLOCKD *xd, int mi_row,
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]);
......
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