#if !CONFIG_EXT_INTER
if (filter_idx > 0) {
BEST_SEG_INFO* ref_bsi = bsi_buf;
- if (seg_mvs[i][mbmi->ref_frame[0]].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[0].as_int &&
- ref_bsi->rdstat[i][mode_idx].mvs[0].as_int != INVALID_MV)
- if (bsi->ref_mv[0]->as_int ==
- ref_bsi->rdstat[i][mode_idx].pred_mv[0].as_int)
- --run_mv_search;
-
- if (!has_second_rf) {
- --run_mv_search;
- } else {
+ SEG_RDSTAT *ref_rdstat = &ref_bsi->rdstat[i][mode_idx];
+
+ if (has_second_rf) {
+ if (seg_mvs[i][mbmi->ref_frame[0]].as_int ==
+ ref_rdstat->mvs[0].as_int &&
+ ref_rdstat->mvs[0].as_int != INVALID_MV)
+ if (bsi->ref_mv[0]->as_int == ref_rdstat->pred_mv[0].as_int)
+ --run_mv_search;
+
if (seg_mvs[i][mbmi->ref_frame[1]].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[1].as_int &&
- ref_bsi->rdstat[i][mode_idx].mvs[1].as_int != INVALID_MV)
- if (bsi->ref_mv[1]->as_int ==
- ref_bsi->rdstat[i][mode_idx].pred_mv[1].as_int)
+ ref_rdstat->mvs[1].as_int &&
+ ref_rdstat->mvs[1].as_int != INVALID_MV)
+ if (bsi->ref_mv[1]->as_int == ref_rdstat->pred_mv[1].as_int)
--run_mv_search;
+ } else {
+ if (bsi->ref_mv[0]->as_int == ref_rdstat->pred_mv[0].as_int &&
+ ref_rdstat->mvs[0].as_int != INVALID_MV) {
+ run_mv_search = 0;
+ seg_mvs[i][mbmi->ref_frame[0]].as_int =
+ ref_rdstat->mvs[0].as_int;
+ }
}
if (run_mv_search != 0 && filter_idx > 1) {
ref_bsi = bsi_buf + 1;
+ ref_rdstat = &ref_bsi->rdstat[i][mode_idx];
run_mv_search = 2;
- if (seg_mvs[i][mbmi->ref_frame[0]].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[0].as_int &&
- ref_bsi->rdstat[i][mode_idx].mvs[0].as_int != INVALID_MV)
- if (bsi->ref_mv[0]->as_int ==
- ref_bsi->rdstat[i][mode_idx].pred_mv[0].as_int)
- --run_mv_search;
+ if (has_second_rf) {
+ if (seg_mvs[i][mbmi->ref_frame[0]].as_int ==
+ ref_rdstat->mvs[0].as_int &&
+ ref_rdstat->mvs[0].as_int != INVALID_MV)
+ if (bsi->ref_mv[0]->as_int == ref_rdstat->pred_mv[0].as_int)
+ --run_mv_search;
- if (!has_second_rf) {
- --run_mv_search;
- } else {
if (seg_mvs[i][mbmi->ref_frame[1]].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[1].as_int &&
- ref_bsi->rdstat[i][mode_idx].mvs[1].as_int != INVALID_MV)
- if (bsi->ref_mv[1]->as_int ==
- ref_bsi->rdstat[i][mode_idx].pred_mv[1].as_int)
+ ref_rdstat->mvs[1].as_int &&
+ ref_rdstat->mvs[1].as_int != INVALID_MV)
+ if (bsi->ref_mv[1]->as_int == ref_rdstat->pred_mv[1].as_int)
--run_mv_search;
+ } else {
+ if (bsi->ref_mv[0]->as_int ==
+ ref_rdstat->pred_mv[0].as_int &&
+ ref_rdstat->mvs[0].as_int != INVALID_MV) {
+ run_mv_search = 0;
+ seg_mvs[i][mbmi->ref_frame[0]].as_int =
+ ref_rdstat->mvs[0].as_int;
+ }
}
}
}
}
#if CONFIG_REF_MV
- mvp_full.row = best_ref_mv->as_mv.row >> 3;
- mvp_full.col = best_ref_mv->as_mv.col >> 3;
+ mvp_full.row = bsi->ref_mv[0]->as_mv.row >> 3;
+ mvp_full.col = bsi->ref_mv[0]->as_mv.col >> 3;
#else
mvp_full.row = bsi->mvp.as_mv.row >> 3;
mvp_full.col = bsi->mvp.as_mv.col >> 3;