int *skippable, int64_t *psse,
int mvthresh,
int_mv seg_mvs[4][MAX_REF_FRAMES],
+ BEST_SEG_INFO *bsi_buf,
+ int filter_idx,
int mi_row, int mi_col) {
int i;
- BEST_SEG_INFO bsi;
- MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
+ BEST_SEG_INFO *bsi = bsi_buf + filter_idx;
+ MACROBLOCKD *xd = &x->e_mbd;
+ MODE_INFO *mi = xd->mode_info_context;
+ MB_MODE_INFO *mbmi = &mi->mbmi;
+ int mode_idx;
- vpx_memset(&bsi, 0, sizeof(bsi));
+ vpx_memset(bsi, 0, sizeof(*bsi));
- bsi.segment_rd = best_rd;
- bsi.ref_mv = best_ref_mv;
- bsi.second_ref_mv = second_best_ref_mv;
- bsi.mvp.as_int = best_ref_mv->as_int;
- bsi.mvthresh = mvthresh;
+ bsi->segment_rd = best_rd;
+ bsi->ref_mv = best_ref_mv;
+ bsi->second_ref_mv = second_best_ref_mv;
+ bsi->mvp.as_int = best_ref_mv->as_int;
+ bsi->mvthresh = mvthresh;
for (i = 0; i < 4; i++)
- bsi.modes[i] = ZEROMV;
+ bsi->modes[i] = ZEROMV;
- rd_check_segment_txsize(cpi, x, &bsi, seg_mvs, mi_row, mi_col);
+ rd_check_segment_txsize(cpi, x, bsi_buf, filter_idx, seg_mvs, mi_row, mi_col);
+ if (bsi.segment_rd > best_rd)
+ return INT64_MAX;
/* set it to the best */
for (i = 0; i < 4; i++) {
- x->e_mbd.mode_info_context->bmi[i].as_mv[0].as_int = bsi.mvs[i].as_int;
+ mode_idx = inter_mode_offset(bsi->modes[i]);
+ mi->bmi[i].as_mv[0].as_int = bsi->rdstat[i][mode_idx].mvs[0].as_int;
if (mbmi->ref_frame[1] > 0)
- x->e_mbd.mode_info_context->bmi[i].as_mv[1].as_int =
- bsi.second_mvs[i].as_int;
- x->e_mbd.plane[0].eobs[i] = bsi.eobs[i];
- x->partition_info->bmi[i].mode = bsi.modes[i];
+ mi->bmi[i].as_mv[1].as_int = bsi->rdstat[i][mode_idx].mvs[1].as_int;
+ xd->plane[0].eobs[i] = bsi->rdstat[i][mode_idx].eobs;
+ x->partition_info->bmi[i].mode = bsi->modes[i];
}
/*