Commit 2033ac49 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Converting int_mv to MV.

Change-Id: Id31c0e100d275bd3650eaf5e4b8fe5ce648dbfaf
parent 4ae8ac7b
......@@ -714,7 +714,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
mv.as_mv.row *= 8;
mv.as_mv.col *= 8;
this_error = motion_error;
vp9_set_mbmode_and_mvs(x, NEWMV, &mv);
vp9_set_mbmode_and_mvs(xd, NEWMV, &mv.as_mv);
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;
......
......@@ -23,7 +23,7 @@
static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
const MV *ref_mv,
int_mv *dst_mv,
MV *dst_mv,
int mb_row,
int mb_col) {
MACROBLOCK *const x = &cpi->mb;
......@@ -35,7 +35,7 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
const int tmp_col_max = x->mv_col_max;
const int tmp_row_min = x->mv_row_min;
const int tmp_row_max = x->mv_row_max;
int_mv ref_full;
MV ref_full;
// Further step/diamond searches as necessary
int step_param = cpi->sf.reduce_first_step_size +
......@@ -44,12 +44,12 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
vp9_set_mv_search_range(x, ref_mv);
ref_full.as_mv.col = ref_mv->col >> 3;
ref_full.as_mv.row = ref_mv->row >> 3;
ref_full.col = ref_mv->col >> 3;
ref_full.row = ref_mv->row >> 3;
/*cpi->sf.search_method == HEX*/
best_err = vp9_hex_search(x, &ref_full.as_mv, step_param, x->errorperbit,
0, &v_fn_ptr, 0, ref_mv, &dst_mv->as_mv);
best_err = vp9_hex_search(x, &ref_full, step_param, x->errorperbit,
0, &v_fn_ptr, 0, ref_mv, dst_mv);
// Try sub-pixel MC
// if (bestsme > error_thresh && bestsme < INT_MAX)
......@@ -57,15 +57,14 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
int distortion;
unsigned int sse;
best_err = cpi->find_fractional_mv_step(
x,
&dst_mv->as_mv, ref_mv,
x, dst_mv, ref_mv,
cpi->common.allow_high_precision_mv,
x->errorperbit, &v_fn_ptr,
0, cpi->sf.subpel_iters_per_step, NULL, NULL,
& distortion, &sse);
}
vp9_set_mbmode_and_mvs(x, NEWMV, dst_mv);
vp9_set_mbmode_and_mvs(xd, NEWMV, dst_mv);
vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16);
best_err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride,
......@@ -96,7 +95,7 @@ static int do_16x16_motion_search(VP9_COMP *cpi, const int_mv *ref_mv,
// Test last reference frame using the previous best mv as the
// starting point (best reference) for the search
tmp_err = do_16x16_motion_iteration(cpi, &ref_mv->as_mv, &tmp_mv,
tmp_err = do_16x16_motion_iteration(cpi, &ref_mv->as_mv, &tmp_mv.as_mv,
mb_row, mb_col);
if (tmp_err < err) {
err = tmp_err;
......@@ -110,7 +109,7 @@ static int do_16x16_motion_search(VP9_COMP *cpi, const int_mv *ref_mv,
int_mv zero_ref_mv, tmp_mv;
zero_ref_mv.as_int = 0;
tmp_err = do_16x16_motion_iteration(cpi, &zero_ref_mv.as_mv, &tmp_mv,
tmp_err = do_16x16_motion_iteration(cpi, &zero_ref_mv.as_mv, &tmp_mv.as_mv,
mb_row, mb_col);
if (tmp_err < err) {
dst_mv->as_int = tmp_mv.as_int;
......
......@@ -1418,9 +1418,10 @@ static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
}
}
void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) {
x->e_mbd.mi_8x8[0]->mbmi.mode = mb;
x->e_mbd.mi_8x8[0]->mbmi.mv[0].as_int = mv->as_int;
void vp9_set_mbmode_and_mvs(MACROBLOCKD *xd, MB_PREDICTION_MODE mode,
const MV *mv) {
xd->mi_8x8[0]->mbmi.mode = mode;
xd->mi_8x8[0]->mbmi.mv[0].as_mv = *mv;
}
static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
......
......@@ -60,8 +60,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
void vp9_init_me_luts();
void vp9_set_mbmode_and_mvs(MACROBLOCK *x,
MB_PREDICTION_MODE mb, int_mv *mv);
void vp9_set_mbmode_and_mvs(MACROBLOCKD *xd, MB_PREDICTION_MODE mode,
const MV *mv);
void vp9_get_entropy_contexts(TX_SIZE tx_size,
ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16],
......
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