diff options
Diffstat (limited to 'vp9/decoder/vp9_decodemv.c')
-rw-r--r-- | vp9/decoder/vp9_decodemv.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 7f23dc190..84a29b17a 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -95,7 +95,7 @@ static int read_intra_segment_id(VP9D_COMP *pbi, int mi_row, int mi_col, vp9_reader *r) { MACROBLOCKD *const xd = &pbi->mb; struct segmentation *const seg = &pbi->common.seg; - const BLOCK_SIZE bsize = xd->mode_info_context->mbmi.sb_type; + const BLOCK_SIZE bsize = xd->this_mi->mbmi.sb_type; int segment_id; if (!seg->enabled) @@ -114,7 +114,7 @@ static int read_inter_segment_id(VP9D_COMP *pbi, int mi_row, int mi_col, VP9_COMMON *const cm = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; struct segmentation *const seg = &cm->seg; - const BLOCK_SIZE bsize = xd->mode_info_context->mbmi.sb_type; + const BLOCK_SIZE bsize = xd->this_mi->mbmi.sb_type; int pred_segment_id, segment_id; if (!seg->enabled) @@ -128,7 +128,7 @@ static int read_inter_segment_id(VP9D_COMP *pbi, int mi_row, int mi_col, if (seg->temporal_update) { const vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd); const int pred_flag = vp9_read(r, pred_prob); - vp9_set_pred_flag_seg_id(cm, bsize, mi_row, mi_col, pred_flag); + vp9_set_pred_flag_seg_id(xd, pred_flag); segment_id = pred_flag ? pred_segment_id : read_segment_id(r, seg); } else { @@ -156,7 +156,8 @@ static void read_intra_frame_mode_info(VP9D_COMP *pbi, MODE_INFO *m, MACROBLOCKD *const xd = &pbi->mb; MB_MODE_INFO *const mbmi = &m->mbmi; const BLOCK_SIZE bsize = mbmi->sb_type; - const int mis = cm->mode_info_stride; + const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride]; + const MODE_INFO *left_mi = xd->mi_8x8[-1]; mbmi->segment_id = read_intra_segment_id(pbi, mi_row, mi_col, r); mbmi->skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r); @@ -165,9 +166,9 @@ static void read_intra_frame_mode_info(VP9D_COMP *pbi, MODE_INFO *m, mbmi->ref_frame[1] = NONE; if (bsize >= BLOCK_8X8) { - const MB_PREDICTION_MODE A = above_block_mode(m, 0, mis); + const MB_PREDICTION_MODE A = above_block_mode(m, above_mi, 0); const MB_PREDICTION_MODE L = xd->left_available ? - left_block_mode(m, 0) : DC_PRED; + left_block_mode(m, left_mi, 0) : DC_PRED; mbmi->mode = read_intra_mode(r, vp9_kf_y_mode_prob[A][L]); } else { // Only 4x4, 4x8, 8x4 blocks @@ -178,9 +179,9 @@ static void read_intra_frame_mode_info(VP9D_COMP *pbi, MODE_INFO *m, for (idy = 0; idy < 2; idy += num_4x4_h) { for (idx = 0; idx < 2; idx += num_4x4_w) { const int ib = idy * 2 + idx; - const MB_PREDICTION_MODE A = above_block_mode(m, ib, mis); + const MB_PREDICTION_MODE A = above_block_mode(m, above_mi, ib); const MB_PREDICTION_MODE L = (xd->left_available || idx) ? - left_block_mode(m, ib) : DC_PRED; + left_block_mode(m, left_mi, ib) : DC_PRED; const MB_PREDICTION_MODE b_mode = read_intra_mode(r, vp9_kf_y_mode_prob[A][L]); m->bmi[ib].as_mode = b_mode; @@ -453,8 +454,8 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi, ref0 = mbmi->ref_frame[0]; is_compound = has_second_ref(mbmi); - vp9_find_mv_refs(cm, xd, mi, xd->prev_mode_info_context, - ref0, mbmi->ref_mvs[ref0], mi_row, mi_col); + vp9_find_mv_refs(cm, xd, mi, xd->last_mi, ref0, mbmi->ref_mvs[ref0], + mi_row, mi_col); inter_mode_ctx = mbmi->mode_context[ref0]; @@ -474,7 +475,7 @@ static void read_inter_block_mode_info(VP9D_COMP *pbi, MODE_INFO *mi, if (is_compound) { const MV_REFERENCE_FRAME ref1 = mbmi->ref_frame[1]; - vp9_find_mv_refs(cm, xd, mi, xd->prev_mode_info_context, + vp9_find_mv_refs(cm, xd, mi, xd->last_mi, ref1, mbmi->ref_mvs[ref1], mi_row, mi_col); if (bsize < BLOCK_8X8 || mbmi->mode != ZEROMV) { @@ -669,20 +670,21 @@ void vp9_prepare_read_mode_info(VP9D_COMP* pbi, vp9_reader *r) { void vp9_read_mode_info(VP9D_COMP* pbi, int mi_row, int mi_col, vp9_reader *r) { VP9_COMMON *const cm = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; - MODE_INFO *mi = xd->mode_info_context; + MODE_INFO *mi = xd->this_mi; const BLOCK_SIZE bsize = mi->mbmi.sb_type; const int bw = 1 << mi_width_log2(bsize); const int bh = 1 << mi_height_log2(bsize); const int y_mis = MIN(bh, cm->mi_rows - mi_row); const int x_mis = MIN(bw, cm->mi_cols - mi_col); - int x, y; + int x, y, z; if (cm->frame_type == KEY_FRAME || cm->intra_only) read_intra_frame_mode_info(pbi, mi, mi_row, mi_col, r); else read_inter_frame_mode_info(pbi, mi, mi_row, mi_col, r); - for (y = 0; y < y_mis; y++) - for (x = !y; x < x_mis; x++) - mi[y * cm->mode_info_stride + x] = *mi; + for (y = 0, z = 0; y < y_mis; y++, z += cm->mode_info_stride) + for (x = !y; x < x_mis; x++) { + xd->mi_8x8[z + x] = mi; + } } |