Commit aa7ec14c authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Speeding up reading of intra block modes."

Showing with 42 additions and 42 deletions
...@@ -166,6 +166,7 @@ static void read_intra_frame_mode_info(VP9_COMMON *const cm, ...@@ -166,6 +166,7 @@ static void read_intra_frame_mode_info(VP9_COMMON *const cm,
const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride]; const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride];
const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL; const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
const BLOCK_SIZE bsize = mbmi->sb_type; const BLOCK_SIZE bsize = mbmi->sb_type;
int i;
mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r); mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r);
mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r); mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
...@@ -173,28 +174,28 @@ static void read_intra_frame_mode_info(VP9_COMMON *const cm, ...@@ -173,28 +174,28 @@ static void read_intra_frame_mode_info(VP9_COMMON *const cm,
mbmi->ref_frame[0] = INTRA_FRAME; mbmi->ref_frame[0] = INTRA_FRAME;
mbmi->ref_frame[1] = NONE; mbmi->ref_frame[1] = NONE;
if (bsize >= BLOCK_8X8) { switch (bsize) {
mbmi->mode = read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0)); case BLOCK_4X4:
} else { for (i = 0; i < 4; ++i)
// Only 4x4, 4x8, 8x4 blocks mi->bmi[i].as_mode =
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2 read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, i));
const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2 mbmi->mode = mi->bmi[3].as_mode;
int idx, idy; break;
case BLOCK_4X8:
for (idy = 0; idy < 2; idy += num_4x4_h) { mi->bmi[0].as_mode = mi->bmi[2].as_mode =
for (idx = 0; idx < 2; idx += num_4x4_w) { read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0));
const int block = idy * 2 + idx; mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode =
const MB_PREDICTION_MODE mode = read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 1));
read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, block)); break;
mi->bmi[block].as_mode = mode; case BLOCK_8X4:
if (num_4x4_h == 2) mi->bmi[0].as_mode = mi->bmi[1].as_mode =
mi->bmi[block + 2].as_mode = mode; read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0));
if (num_4x4_w == 2) mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode =
mi->bmi[block + 1].as_mode = mode; read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 2));
} break;
} default:
mbmi->mode = read_intra_mode(r,
mbmi->mode = mi->bmi[3].as_mode; get_y_mode_probs(mi, above_mi, left_mi, 0));
} }
mbmi->uv_mode = read_intra_mode(r, vp9_kf_uv_mode_prob[mbmi->mode]); mbmi->uv_mode = read_intra_mode(r, vp9_kf_uv_mode_prob[mbmi->mode]);
...@@ -324,30 +325,29 @@ static void read_intra_block_mode_info(VP9_COMMON *const cm, MODE_INFO *mi, ...@@ -324,30 +325,29 @@ static void read_intra_block_mode_info(VP9_COMMON *const cm, MODE_INFO *mi,
vp9_reader *r) { vp9_reader *r) {
MB_MODE_INFO *const mbmi = &mi->mbmi; MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mi->mbmi.sb_type; const BLOCK_SIZE bsize = mi->mbmi.sb_type;
int i;
mbmi->ref_frame[0] = INTRA_FRAME; mbmi->ref_frame[0] = INTRA_FRAME;
mbmi->ref_frame[1] = NONE; mbmi->ref_frame[1] = NONE;
if (bsize >= BLOCK_8X8) { switch (bsize) {
mbmi->mode = read_intra_mode_y(cm, r, size_group_lookup[bsize]); case BLOCK_4X4:
} else { for (i = 0; i < 4; ++i)
// Only 4x4, 4x8, 8x4 blocks mi->bmi[i].as_mode = read_intra_mode_y(cm, r, 0);
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2 mbmi->mode = mi->bmi[3].as_mode;
const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2 break;
int idx, idy; case BLOCK_4X8:
mi->bmi[0].as_mode = mi->bmi[2].as_mode = read_intra_mode_y(cm, r, 0);
for (idy = 0; idy < 2; idy += num_4x4_h) { mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode =
for (idx = 0; idx < 2; idx += num_4x4_w) { read_intra_mode_y(cm, r, 0);
const int ib = idy * 2 + idx; break;
const int b_mode = read_intra_mode_y(cm, r, 0); case BLOCK_8X4:
mi->bmi[ib].as_mode = b_mode; mi->bmi[0].as_mode = mi->bmi[1].as_mode = read_intra_mode_y(cm, r, 0);
if (num_4x4_h == 2) mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode =
mi->bmi[ib + 2].as_mode = b_mode; read_intra_mode_y(cm, r, 0);
if (num_4x4_w == 2) break;
mi->bmi[ib + 1].as_mode = b_mode; default:
} mbmi->mode = read_intra_mode_y(cm, r, size_group_lookup[bsize]);
}
mbmi->mode = mi->bmi[3].as_mode;
} }
mbmi->uv_mode = read_intra_mode_uv(cm, r, mbmi->mode); mbmi->uv_mode = read_intra_mode_uv(cm, r, mbmi->mode);
......
Supports Markdown
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