if (!left_mi || is_inter_block(&left_mi->mbmi))
return DC_PRED;
- return left_mi->mbmi.sb_type < BLOCK_8X8 ? left_mi->bmi[b + 1].as_mode
- : left_mi->mbmi.mode;
+ return get_y_mode(left_mi, b + 1);
} else {
assert(b == 1 || b == 3);
return cur_mi->bmi[b - 1].as_mode;
if (!above_mi || is_inter_block(&above_mi->mbmi))
return DC_PRED;
- return above_mi->mbmi.sb_type < BLOCK_8X8 ? above_mi->bmi[b + 2].as_mode
- : above_mi->mbmi.mode;
+ return get_y_mode(above_mi, b + 2);
} else {
assert(b == 2 || b == 3);
return cur_mi->bmi[b - 2].as_mode;
b_mode_info bmi[4];
} MODE_INFO;
+static INLINE MB_PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) {
+ return mi->mbmi.sb_type < BLOCK_8X8 ? mi->bmi[block].as_mode
+ : mi->mbmi.mode;
+}
+
static INLINE int is_inter_block(const MB_MODE_INFO *mbmi) {
return mbmi->ref_frame[0] > INTRA_FRAME;
}
static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
const MACROBLOCKD *xd, int ib) {
const MODE_INFO *const mi = xd->mi_8x8[0];
- const MB_MODE_INFO *const mbmi = &mi->mbmi;
- if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(mbmi))
+ if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(&mi->mbmi))
return DCT_DCT;
- return mode2txfm_map[mbmi->sb_type < BLOCK_8X8 ? mi->bmi[ib].as_mode
- : mbmi->mode];
+ return mode2txfm_map[get_y_mode(mi, ib)];
}
static INLINE TX_TYPE get_tx_type_8x8(PLANE_TYPE plane_type,
static const INLINE scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
PLANE_TYPE type, int block_idx) {
const MODE_INFO *const mi = xd->mi_8x8[0];
- const MB_MODE_INFO *const mbmi = &mi->mbmi;
- if (is_inter_block(mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
+ if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
return &vp9_default_scan_orders[tx_size];
} else {
- const MB_PREDICTION_MODE mode =
- mbmi->sb_type < BLOCK_8X8 ? mi->bmi[block_idx].as_mode : mbmi->mode;
+ const MB_PREDICTION_MODE mode = get_y_mode(mi, block_idx);
return &vp9_scan_orders[tx_size][mode2txfm_map[mode]];
}
}
MACROBLOCKD *const xd = args->xd;
struct macroblockd_plane *const pd = &xd->plane[plane];
MODE_INFO *const mi = xd->mi_8x8[0];
- const MB_PREDICTION_MODE mode = (plane == 0)
- ? ((mi->mbmi.sb_type < BLOCK_8X8) ? mi->bmi[block].as_mode
- : mi->mbmi.mode)
- : mi->mbmi.uv_mode;
+ const MB_PREDICTION_MODE mode = (plane == 0) ? get_y_mode(mi, block)
+ : mi->mbmi.uv_mode;
int x, y;
uint8_t *dst;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
case TX_4X4:
tx_type = get_tx_type_4x4(pd->plane_type, xd, block);
scan_order = &vp9_scan_orders[TX_4X4][tx_type];
- if (mbmi->sb_type < BLOCK_8X8 && plane == 0)
- mode = xd->mi_8x8[0]->bmi[block].as_mode;
- else
- mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
-
+ mode = plane == 0 ? get_y_mode(xd->mi_8x8[0], block) : mbmi->uv_mode;
vp9_predict_intra_block(xd, block, bwl, TX_4X4, mode,
x->skip_encode ? src : dst,
x->skip_encode ? src_stride : dst_stride,