ref: 518a934f43bbbd16a32746f9f935b70d77987d5d
parent: fc43938d5e1c965052e623758b03c75444fa3c9f
parent: 2033ac49b4170284ffbb807e2bf461d87b2c45a0
author: Dmitry Kovalev <[email protected]>
date: Tue Jan 14 09:11:49 EST 2014
Merge "Converting int_mv to MV."
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -714,7 +714,7 @@
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;
--- a/vp9/encoder/vp9_mbgraph.c
+++ b/vp9/encoder/vp9_mbgraph.c
@@ -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 @@
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 @@
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,8 +57,7 @@
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,
@@ -65,7 +64,7 @@
& 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 @@
// 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 @@
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;
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1418,9 +1418,10 @@
}
}
-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,
--- a/vp9/encoder/vp9_rdopt.h
+++ b/vp9/encoder/vp9_rdopt.h
@@ -60,8 +60,8 @@
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],