}
static INLINE int mi_width_log2(BLOCK_SIZE_TYPE sb_type) {
- int a = b_width_log2(sb_type) - 1;
- // align 4x4 block to mode_info
- if (a < 0)
- a = 0;
- assert(a >= 0);
- return a;
+ return mi_width_log2_lookup[sb_type];
}
static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) {
- int a = b_height_log2(sb_type) - 1;
- if (a < 0)
- a = 0;
- assert(a >= 0);
- return a;
+ return mi_height_log2_lookup[sb_type];
}
typedef struct {
{0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4};
const int b_height_log2_lookup[BLOCK_SIZE_TYPES] =
{0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4};
+// Log 2 conversion lookup tables for modeinfo width and height
+const int mi_width_log2_lookup[BLOCK_SIZE_TYPES] =
+ {0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3};
+const int mi_height_log2_lookup[BLOCK_SIZE_TYPES] =
+ {0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3};
extern const int b_width_log2_lookup[BLOCK_SIZE_TYPES];
extern const int b_height_log2_lookup[BLOCK_SIZE_TYPES];
+extern const int mi_width_log2_lookup[BLOCK_SIZE_TYPES];
+extern const int mi_height_log2_lookup[BLOCK_SIZE_TYPES];
#endif // VP9_COMMON_VP9_COMMON_DATA_H