Commit acf0d56f authored by Guillaume Martres's avatar Guillaume Martres

Get rid of "this_mi", use "mi_8x8[0]" everywhere instead

The only case where they were intentionally pointing to different
structures was in mbgraph, and this didn't have the expected behavior
because both of these pointers are used interchangeably through the code

Change-Id: I979251782f90885fe962305bcc845bc05907f80c
parent 9a03154f
......@@ -196,7 +196,6 @@ typedef struct macroblockd {
struct scale_factors scale_factor[2];
MODE_INFO *last_mi;
MODE_INFO *this_mi;
int mode_info_stride;
MODE_INFO *mic_stream_ptr;
......@@ -311,7 +310,7 @@ extern const TX_TYPE mode2txfm_map[MB_MODE_COUNT];
static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
const MACROBLOCKD *xd, int ib) {
const MODE_INFO *const mi = xd->this_mi;
const MODE_INFO *const mi = xd->mi_8x8[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;
if (plane_type != PLANE_TYPE_Y_WITH_DC ||
......@@ -326,13 +325,13 @@ static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
static INLINE TX_TYPE get_tx_type_8x8(PLANE_TYPE plane_type,
const MACROBLOCKD *xd) {
return plane_type == PLANE_TYPE_Y_WITH_DC ?
mode2txfm_map[xd->this_mi->mbmi.mode] : DCT_DCT;
mode2txfm_map[xd->mi_8x8[0]->mbmi.mode] : DCT_DCT;
}
static INLINE TX_TYPE get_tx_type_16x16(PLANE_TYPE plane_type,
const MACROBLOCKD *xd) {
return plane_type == PLANE_TYPE_Y_WITH_DC ?
mode2txfm_map[xd->this_mi->mbmi.mode] : DCT_DCT;
mode2txfm_map[xd->mi_8x8[0]->mbmi.mode] : DCT_DCT;
}
static void setup_block_dptrs(MACROBLOCKD *xd, int ss_x, int ss_y) {
......@@ -381,7 +380,7 @@ static INLINE void foreach_transformed_block_in_plane(
const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
foreach_transformed_block_visitor visit, void *arg) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
const MB_MODE_INFO* mbmi = &xd->this_mi->mbmi;
const MB_MODE_INFO* mbmi = &xd->mi_8x8[0]->mbmi;
// block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
// transform size varies per plane, look it up in a common way.
......
......@@ -43,7 +43,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col) {
int_mv dst_list[MAX_MV_REF_CANDIDATES];
int_mv mv_list[MAX_MV_REF_CANDIDATES];
MODE_INFO *const mi = xd->this_mi;
MODE_INFO *const mi = xd->mi_8x8[0];
assert(ref_idx == 0 || ref_idx == 1);
assert(MAX_MV_REF_CANDIDATES == 2); // makes code here slightly easier
......
......@@ -389,7 +389,7 @@ unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) {
}
void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag) {
xd->this_mi->mbmi.seg_id_predicted = pred_flag;
xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag;
}
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
......
......@@ -49,7 +49,7 @@ static INLINE vp9_prob vp9_get_pred_prob_mbskip(const VP9_COMMON *cm,
}
static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
return xd->this_mi->mbmi.skip_coeff;
return xd->mi_8x8[0]->mbmi.skip_coeff;
}
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
......
......@@ -23,8 +23,8 @@
void vp9_setup_interp_filters(MACROBLOCKD *xd,
INTERPOLATIONFILTERTYPE mcomp_filter_type,
VP9_COMMON *cm) {
if (xd->mi_8x8 && xd->this_mi) {
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
if (xd->mi_8x8 && xd->mi_8x8[0]) {
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
set_scale_factors(xd, mbmi->ref_frame[0] - LAST_FRAME,
mbmi->ref_frame[1] - LAST_FRAME,
......@@ -120,7 +120,7 @@ static void build_inter_predictors(int plane, int block, BLOCK_SIZE bsize,
const int bh = plane_block_height(bsize, pd);
const int x = 4 * (block & ((1 << bwl) - 1));
const int y = 4 * (block >> bwl);
const MODE_INFO *mi = xd->this_mi;
const MODE_INFO *mi = xd->mi_8x8[0];
const int is_compound = has_second_ref(&mi->mbmi);
int ref;
......@@ -177,7 +177,7 @@ static INLINE void foreach_predicted_block_in_plane(
const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y;
if (xd->this_mi->mbmi.sb_type < BLOCK_8X8) {
if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) {
int i = 0, x, y;
assert(bsize == BLOCK_8X8);
for (y = 0; y < 1 << bhl; ++y)
......
......@@ -111,7 +111,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->this_mi->mbmi.sb_type;
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
int segment_id;
if (!seg->enabled)
......@@ -130,7 +130,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->this_mi->mbmi.sb_type;
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
int pred_segment_id, segment_id;
if (!seg->enabled)
......@@ -661,7 +661,7 @@ 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->this_mi;
MODE_INFO *mi = xd->mi_8x8[0];
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
const int bw = 1 << mi_width_log2(bsize);
const int bh = 1 << mi_height_log2(bsize);
......
......@@ -134,7 +134,7 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
MACROBLOCKD* const xd = arg;
struct macroblockd_plane *const pd = &xd->plane[plane];
MODE_INFO *const mi = xd->this_mi;
MODE_INFO *const mi = xd->mi_8x8[0];
const int raster_block = txfrm_block_to_raster_block(plane_bsize, tx_size,
block);
uint8_t* const dst = raster_block_offset_uint8(plane_bsize, raster_block,
......@@ -158,7 +158,7 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE bsize, vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
if (mbmi->skip_coeff) {
reset_skip_context(xd, bsize);
......@@ -187,9 +187,8 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE bsize,
xd->prev_mi_8x8 = cm->prev_mi_grid_visible + offset;
// we are using the mode info context stream here
xd->this_mi =
xd->mi_8x8[0] = xd->mic_stream_ptr;
xd->this_mi->mbmi.sb_type = bsize;
xd->mi_8x8[0]->mbmi.sb_type = bsize;
xd->mic_stream_ptr++;
// Special case: if prev_mi is NULL, the previous mode info context
......@@ -209,7 +208,7 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE bsize,
static void set_ref(VP9D_COMP *pbi, int i, int mi_row, int mi_col) {
VP9_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
const int ref = mbmi->ref_frame[i] - LAST_FRAME;
const YV12_BUFFER_CONFIG *cfg = &cm->yv12_fb[cm->active_ref_idx[ref]];
const struct scale_factors *sf = &cm->active_ref_scale[ref];
......@@ -240,7 +239,7 @@ static void decode_modes_b(VP9D_COMP *pbi, int mi_row, int mi_col,
bsize = BLOCK_8X8;
// Has to be called after set_offsets
mbmi = &xd->this_mi->mbmi;
mbmi = &xd->mi_8x8[0]->mbmi;
eobtotal = decode_tokens(pbi, bsize, r);
if (!is_inter_block(mbmi)) {
......
......@@ -91,7 +91,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
TX_SIZE tx_size, const int16_t *dq, int pt) {
const FRAME_CONTEXT *const fc = &cm->fc;
FRAME_COUNTS *const counts = &cm->counts;
const int ref = is_inter_block(&xd->this_mi->mbmi);
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
int band, c = 0;
const vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size][type][ref];
......@@ -218,7 +218,7 @@ static void decode_block(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCKD *xd = &arg->pbi->mb;
struct segmentation *seg = &arg->pbi->common.seg;
struct macroblockd_plane* pd = &xd->plane[plane];
const int segment_id = xd->this_mi->mbmi.segment_id;
const int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
const int seg_eob = get_tx_eob(seg, segment_id, tx_size);
int aoff, loff, eob, pt;
......
......@@ -396,7 +396,6 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
pbi->mb.mi_8x8 = cm->mi_grid_visible;
pbi->mb.mi_8x8[0] = cm->mi;
pbi->mb.this_mi = cm->mi;
cm->current_video_frame++;
}
......
......@@ -353,7 +353,7 @@ static void encode_ref_frame(VP9_COMP *cpi, vp9_writer *bc) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *mi = &xd->this_mi->mbmi;
MB_MODE_INFO *mi = &xd->mi_8x8[0]->mbmi;
const int segment_id = mi->segment_id;
int seg_ref_active = vp9_segfeature_active(&cm->seg, segment_id,
SEG_LVL_REF_FRAME);
......@@ -574,7 +574,6 @@ static void write_modes_b(VP9_COMP *cpi, MODE_INFO **mi_8x8, vp9_writer *bc,
if (xd->ab_index > 0)
return;
xd->this_mi = mi_8x8[0];
xd->mi_8x8 = mi_8x8;
set_mi_row_col(&cpi->common, xd,
......
......@@ -352,8 +352,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
MODE_INFO *mi = &ctx->mic;
MB_MODE_INFO * const mbmi = &xd->this_mi->mbmi;
MODE_INFO *mi_addr = xd->this_mi;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
MODE_INFO *mi_addr = xd->mi_8x8[0];
int mb_mode_index = ctx->best_mode_index;
const int mis = cm->mode_info_stride;
......@@ -497,9 +497,9 @@ static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col,
// cannot be used.
xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL;
xd->this_mi = xd->mi_8x8[0] = cm->mi + idx_str;
xd->mi_8x8[0] = cm->mi + idx_str;
mbmi = &xd->this_mi->mbmi;
mbmi = &xd->mi_8x8[0]->mbmi;
// Set up destination pointers
setup_dst_planes(xd, &cm->yv12_fb[dst_fb_idx], mi_row, mi_col);
......@@ -579,10 +579,10 @@ static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col,
}
set_offsets(cpi, mi_row, mi_col, bsize);
xd->this_mi->mbmi.sb_type = bsize;
xd->mi_8x8[0]->mbmi.sb_type = bsize;
// Set to zero to make sure we do not use the previous encoded frame stats
xd->this_mi->mbmi.skip_coeff = 0;
xd->mi_8x8[0]->mbmi.skip_coeff = 0;
x->source_variance = get_sby_perpixel_variance(cpi, x, bsize);
......@@ -594,7 +594,7 @@ static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col,
energy = vp9_block_energy(cpi, x, bsize);
}
xd->this_mi->mbmi.segment_id = vp9_vaq_segment_id(energy);
xd->mi_8x8[0]->mbmi.segment_id = vp9_vaq_segment_id(energy);
rdmult_ratio = vp9_vaq_rdmult_ratio(energy);
vp9_mb_init_quantizer(cpi, x);
}
......@@ -627,7 +627,7 @@ static void update_stats(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
MODE_INFO *mi = xd->this_mi;
MODE_INFO *mi = xd->mi_8x8[0];
MB_MODE_INFO *const mbmi = &mi->mbmi;
if (!frame_is_intra_only(cm)) {
......@@ -1866,8 +1866,8 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
setup_block_dptrs(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
xd->this_mi->mbmi.mode = DC_PRED;
xd->this_mi->mbmi.uv_mode = DC_PRED;
xd->mi_8x8[0]->mbmi.mode = DC_PRED;
xd->mi_8x8[0]->mbmi.uv_mode = DC_PRED;
vp9_zero(cpi->y_mode_count);
vp9_zero(cpi->y_uv_mode_count);
......@@ -1941,7 +1941,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
xd->mi_8x8 = cm->mi_grid_visible;
// required for vp9_frame_init_quantizer
xd->this_mi = xd->mi_8x8[0] = cm->mi;
xd->mi_8x8[0] = cm->mi;
xd->mic_stream_ptr = cm->mi;
xd->last_mi = cm->prev_mi;
......
......@@ -117,7 +117,7 @@ static void optimize_b(MACROBLOCK *mb,
TX_SIZE tx_size) {
MACROBLOCKD *const xd = &mb->e_mbd;
struct macroblockd_plane *pd = &xd->plane[plane];
const int ref = is_inter_block(&xd->this_mi->mbmi);
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
vp9_token_state tokens[1025][2];
unsigned best_index[1025][2];
const int16_t *coeff_ptr = BLOCK_OFFSET(mb->plane[plane].coeff, block);
......@@ -331,7 +331,7 @@ static void optimize_init_b(int plane, BLOCK_SIZE bsize,
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
const MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
const MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size;
vp9_get_entropy_contexts(tx_size, args->ctx->ta[plane], args->ctx->tl[plane],
......@@ -494,7 +494,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
struct encode_b_args* const args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
int16_t *coeff = BLOCK_OFFSET(p->coeff, block);
......@@ -596,7 +596,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
scan = get_scan_4x4(tx_type);
iscan = get_iscan_4x4(tx_type);
if (mbmi->sb_type < BLOCK_8X8 && plane == 0)
mode = xd->this_mi->bmi[block].as_mode;
mode = xd->mi_8x8[0]->bmi[block].as_mode;
else
mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
......
......@@ -358,7 +358,7 @@ static void zz_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
// Set up pointers for this macro block recon buffer
xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
switch (xd->this_mi->mbmi.sb_type) {
switch (xd->mi_8x8[0]->mbmi.sb_type) {
case BLOCK_8X8:
vp9_mse8x8(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
......@@ -397,7 +397,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
int n;
vp9_variance_fn_ptr_t v_fn_ptr =
cpi->fn_ptr[xd->this_mi->mbmi.sb_type];
cpi->fn_ptr[xd->mi_8x8[0]->mbmi.sb_type];
int new_mv_mode_penalty = 256;
int sr = 0;
......@@ -414,7 +414,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
further_steps -= sr;
// override the default variance function to use MSE
switch (xd->this_mi->mbmi.sb_type) {
switch (xd->mi_8x8[0]->mbmi.sb_type) {
case BLOCK_8X8:
v_fn_ptr.vf = vp9_mse8x8;
break;
......@@ -518,7 +518,6 @@ void vp9_first_pass(VP9_COMP *cpi) {
xd->mi_8x8 = cm->mi_grid_visible;
// required for vp9_frame_init_quantizer
xd->this_mi =
xd->mi_8x8[0] = cm->mi;
xd->mic_stream_ptr = cm->mi;
......@@ -565,26 +564,26 @@ void vp9_first_pass(VP9_COMP *cpi) {
if (mb_col * 2 + 1 < cm->mi_cols) {
if (mb_row * 2 + 1 < cm->mi_rows) {
xd->this_mi->mbmi.sb_type = BLOCK_16X16;
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_16X16;
} else {
xd->this_mi->mbmi.sb_type = BLOCK_16X8;
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_16X8;
}
} else {
if (mb_row * 2 + 1 < cm->mi_rows) {
xd->this_mi->mbmi.sb_type = BLOCK_8X16;
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_8X16;
} else {
xd->this_mi->mbmi.sb_type = BLOCK_8X8;
xd->mi_8x8[0]->mbmi.sb_type = BLOCK_8X8;
}
}
xd->this_mi->mbmi.ref_frame[0] = INTRA_FRAME;
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
set_mi_row_col(cm, xd,
mb_row << 1,
1 << mi_height_log2(xd->this_mi->mbmi.sb_type),
1 << mi_height_log2(xd->mi_8x8[0]->mbmi.sb_type),
mb_col << 1,
1 << mi_width_log2(xd->this_mi->mbmi.sb_type));
1 << mi_width_log2(xd->mi_8x8[0]->mbmi.sb_type));
if (cpi->sf.variance_adaptive_quantization) {
int energy = vp9_block_energy(cpi, x, xd->this_mi->mbmi.sb_type);
int energy = vp9_block_energy(cpi, x, xd->mi_8x8[0]->mbmi.sb_type);
error_weight = vp9_vaq_inv_q_ratio(energy);
}
......@@ -690,13 +689,13 @@ void vp9_first_pass(VP9_COMP *cpi) {
mv.as_mv.col *= 8;
this_error = motion_error;
vp9_set_mbmode_and_mvs(x, NEWMV, &mv);
xd->this_mi->mbmi.tx_size = TX_4X4;
xd->this_mi->mbmi.ref_frame[0] = LAST_FRAME;
xd->this_mi->mbmi.ref_frame[1] = NONE;
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
xd->mi_8x8[0]->mbmi.ref_frame[1] = NONE;
vp9_build_inter_predictors_sby(xd, mb_row << 1,
mb_col << 1,
xd->this_mi->mbmi.sb_type);
vp9_encode_sby(x, xd->this_mi->mbmi.sb_type);
xd->mi_8x8[0]->mbmi.sb_type);
vp9_encode_sby(x, xd->mi_8x8[0]->mbmi.sb_type);
sum_mvr += mv.as_mv.row;
sum_mvr_abs += abs(mv.as_mv.row);
sum_mvc += mv.as_mv.col;
......
......@@ -149,7 +149,7 @@ static int find_best_16x16_intra(VP9_COMP *cpi,
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
unsigned int err;
xd->this_mi->mbmi.mode = mode;
xd->mi_8x8[0]->mbmi.mode = mode;
vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode,
x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride);
......@@ -258,7 +258,7 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi,
xd->plane[0].dst.stride = buf->y_stride;
xd->plane[0].pre[0].stride = buf->y_stride;
xd->plane[1].dst.stride = buf->uv_stride;
xd->this_mi = &mi_local;
xd->mi_8x8[0] = &mi_local;
mi_local.mbmi.sb_type = BLOCK_16X16;
mi_local.mbmi.ref_frame[0] = LAST_FRAME;
mi_local.mbmi.ref_frame[1] = NONE;
......
......@@ -3496,7 +3496,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
cpi->mb.e_mbd.mi_8x8 = cm->mi_grid_visible;
cpi->mb.e_mbd.mi_8x8[0] = cm->mi;
cpi->mb.e_mbd.this_mi = cm->mi;
// Don't increment frame counters if this was an altref buffer
// update not a real frame
......
......@@ -275,7 +275,7 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *xd = &x->e_mbd;
int zbin_extra;
int segment_id = xd->this_mi->mbmi.segment_id;
int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
const int qindex = vp9_get_qindex(&cpi->common.seg, segment_id,
cpi->common.base_qindex);
......
This diff is collapsed.
......@@ -129,9 +129,8 @@ static void count_segs(VP9_COMP *cpi, MODE_INFO **mi_8x8,
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
return;
segment_id = mi_8x8[0]->mbmi.segment_id;
xd->mi_8x8 = mi_8x8;
xd->this_mi = mi_8x8[0];
segment_id = xd->mi_8x8[0]->mbmi.segment_id;
set_mi_row_col(cm, xd, mi_row, bh, mi_col, bw);
......
......@@ -108,7 +108,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCKD *xd = args->xd;
TOKENEXTRA **tp = args->tp;
struct macroblockd_plane *pd = &xd->plane[plane];
MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
int pt; /* near block/prev token context index */
int c = 0, rc = 0;
TOKENEXTRA *t = *tp; /* store tokens starting here */
......@@ -200,7 +200,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
TOKENEXTRA *t_backup = *t;
const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
......
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