Commit 08fd41cc authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Adding lookup table for size group.

Change-Id: Ia6144d77ebed66e0739b62e4d673e26a95aa9550
parent be00d397
......@@ -31,6 +31,11 @@ const int mi_height_log2_lookup[BLOCK_SIZE_TYPES] =
const int num_8x8_blocks_high_lookup[BLOCK_SIZE_TYPES] =
{1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8};
// MIN(3, MIN(b_width_log2(bsize), b_height_log2(bsize)))
const int size_group_lookup[BLOCK_SIZE_TYPES] =
{0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3};
const PARTITION_TYPE partition_lookup[][BLOCK_SIZE_TYPES] = {
{ // 4X4
// 4X4, 4X8,8X4,8X8,8X16,16X8,16X16,16X32,32X16,32X32,32X64,64X32,64X64
......
......@@ -21,8 +21,9 @@ extern const int num_8x8_blocks_wide_lookup[BLOCK_SIZE_TYPES];
extern const int num_8x8_blocks_high_lookup[BLOCK_SIZE_TYPES];
extern const int num_4x4_blocks_high_lookup[BLOCK_SIZE_TYPES];
extern const int num_4x4_blocks_wide_lookup[BLOCK_SIZE_TYPES];
extern const PARTITION_TYPE
partition_lookup[][BLOCK_SIZE_TYPES];
extern const int size_group_lookup[BLOCK_SIZE_TYPES];
extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZE_TYPES];
extern const BLOCK_SIZE_TYPE subsize_lookup[PARTITION_TYPES][BLOCK_SIZE_TYPES];
......
......@@ -385,15 +385,14 @@ static void read_intra_block_modes(VP9D_COMP *pbi, MODE_INFO *mi,
VP9_COMMON *const cm = &pbi->common;
MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE_TYPE bsize = mi->mbmi.sb_type;
const int bwl = b_width_log2(bsize), bhl = b_height_log2(bsize);
if (bsize >= BLOCK_SIZE_SB8X8) {
const int size_group = MIN(3, MIN(bwl, bhl));
const int size_group = size_group_lookup[bsize];
mbmi->mode = read_intra_mode(r, cm->fc.y_mode_prob[size_group]);
cm->counts.y_mode[size_group][mbmi->mode]++;
} else {
// Only 4x4, 4x8, 8x4 blocks
const int bw = 1 << bwl, bh = 1 << bhl;
const int bw = 1 << b_width_log2(bsize), bh = 1 << b_height_log2(bsize);
int idx, idy;
for (idy = 0; idy < 2; idy += bh) {
......
......@@ -443,9 +443,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
#endif
if (bsize >= BLOCK_SIZE_SB8X8) {
const int bwl = b_width_log2(bsize), bhl = b_height_log2(bsize);
const int bsl = MIN(bwl, bhl);
write_intra_mode(bc, mode, pc->fc.y_mode_prob[MIN(3, bsl)]);
write_intra_mode(bc, mode, pc->fc.y_mode_prob[size_group_lookup[bsize]]);
} else {
int idx, idy;
int num_4x4_blocks_wide = num_4x4_blocks_wide_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