From: Dmitry Kovalev Date: Wed, 26 Feb 2014 22:13:23 +0000 (-0800) Subject: Replacing int_mv with MV and adding const qualifiers. X-Git-Tag: v1.4.0~2216^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc7b7a93aadb27a4c843bcff00da713ae0a6816c;p=libvpx Replacing int_mv with MV and adding const qualifiers. Change-Id: I89c37b739493c79044f8c70ae2424aa074eb56c8 --- diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index a9b51e0d4..fa5ef969a 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -510,10 +510,10 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, if (!frame_is_intra_only(cm)) { if (is_inter_block(mbmi)) { if (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV) { - int_mv best_mv[2]; + MV best_mv[2]; for (i = 0; i < 1 + has_second_ref(mbmi); ++i) - best_mv[i].as_int = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_int; - vp9_update_mv_count(cpi, x, best_mv); + best_mv[i] = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_mv; + vp9_update_mv_count(cm, xd, best_mv); } if (cm->interp_filter == SWITCHABLE) { @@ -1092,10 +1092,10 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx, if (!frame_is_intra_only(cm)) { if (is_inter_block(mbmi)) { if (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV) { - int_mv best_mv[2]; + MV best_mv[2]; for (i = 0; i < 1 + has_second_ref(mbmi); ++i) - best_mv[i].as_int = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_int; - vp9_update_mv_count(cpi, x, best_mv); + best_mv[i] = mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_mv; + vp9_update_mv_count(cm, xd, best_mv); } if (cm->interp_filter == SWITCHABLE) { diff --git a/vp9/encoder/vp9_encodemv.c b/vp9/encoder/vp9_encodemv.c index be6abc2a1..507969951 100644 --- a/vp9/encoder/vp9_encodemv.c +++ b/vp9/encoder/vp9_encodemv.c @@ -231,21 +231,22 @@ void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], usehp); } -static void inc_mvs(int_mv mv[2], int_mv ref[2], int is_compound, +static void inc_mvs(const int_mv mv[2], const MV ref[2], int is_compound, nmv_context_counts *counts) { int i; for (i = 0; i < 1 + is_compound; ++i) { - const MV diff = { mv[i].as_mv.row - ref[i].as_mv.row, - mv[i].as_mv.col - ref[i].as_mv.col }; + const MV diff = { mv[i].as_mv.row - ref[i].row, + mv[i].as_mv.col - ref[i].col }; vp9_inc_mv(&diff, counts); } } -void vp9_update_mv_count(VP9_COMP *cpi, MACROBLOCK *x, int_mv best_ref_mv[2]) { - MODE_INFO *mi = x->e_mbd.mi_8x8[0]; - MB_MODE_INFO *const mbmi = &mi->mbmi; +void vp9_update_mv_count(VP9_COMMON *cm, const MACROBLOCKD *xd, + const MV best_ref_mv[2]) { + const MODE_INFO *mi = xd->mi_8x8[0]; + const MB_MODE_INFO *const mbmi = &mi->mbmi; const int is_compound = has_second_ref(mbmi); - nmv_context_counts *counts = &cpi->common.counts.mv; + nmv_context_counts *counts = &cm->counts.mv; if (mbmi->sb_type < BLOCK_8X8) { const int num_4x4_w = num_4x4_blocks_wide_lookup[mbmi->sb_type]; diff --git a/vp9/encoder/vp9_encodemv.h b/vp9/encoder/vp9_encodemv.h index bb242b6dd..eb0e24f19 100644 --- a/vp9/encoder/vp9_encodemv.h +++ b/vp9/encoder/vp9_encodemv.h @@ -28,7 +28,8 @@ void vp9_encode_mv(VP9_COMP *cpi, vp9_writer* w, const MV* mv, const MV* ref, void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], const nmv_context* const mvctx, int usehp); -void vp9_update_mv_count(VP9_COMP *cpi, MACROBLOCK *x, int_mv best_ref_mv[2]); +void vp9_update_mv_count(VP9_COMMON *cm, const MACROBLOCKD *xd, + const MV best_ref_mv[2]); #ifdef __cplusplus } // extern "C"