From: Geza Lore Date: Wed, 27 Apr 2016 12:37:29 +0000 (+0100) Subject: Fix compound mv costing for ref-mv. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=264d5c446eaaaa1d51028cb3f6b24098ec10efab;p=libvpx Fix compound mv costing for ref-mv. I believe this is necessary for computing the correct rate, when not doing joint_motion_search. Change-Id: I7634d6d7a5e6f0a6998edb4d577dd047d80df3c8 --- diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index a50ee5ad7..f2f829113 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -6387,10 +6387,16 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, joint_motion_search(cpi, x, bsize, frame_mv, mi_row, mi_col, NULL, single_newmv, &rate_mv, 0); } else { +#if CONFIG_REF_MV + vp10_set_mvcost(x, mbmi->ref_frame[0]); +#endif // CONFIG_REF_MV rate_mv = vp10_mv_bit_cost(&frame_mv[refs[0]].as_mv, &x->mbmi_ext->ref_mvs[refs[0]][0].as_mv, x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); +#if CONFIG_REF_MV + vp10_set_mvcost(x, mbmi->ref_frame[1]); +#endif // CONFIG_REF_MV rate_mv += vp10_mv_bit_cost(&frame_mv[refs[1]].as_mv, &x->mbmi_ext->ref_mvs[refs[1]][0].as_mv, x->nmvjointcost, x->mvcost, @@ -6417,9 +6423,15 @@ static int64_t handle_inter_mode(VP10_COMP *cpi, MACROBLOCK *x, mi_row, mi_col, single_newmv, &rate_mv, 0); } else { +#if CONFIG_REF_MV + vp10_set_mvcost(x, mbmi->ref_frame[0]); +#endif // CONFIG_REF_MV rate_mv = vp10_mv_bit_cost(&frame_mv[refs[0]].as_mv, &x->mbmi_ext->ref_mvs[refs[0]][0].as_mv, x->nmvjointcost, x->mvcost, MV_COST_WEIGHT); +#if CONFIG_REF_MV + vp10_set_mvcost(x, mbmi->ref_frame[1]); +#endif // CONFIG_REF_MV rate_mv += vp10_mv_bit_cost(&frame_mv[refs[1]].as_mv, &x->mbmi_ext->ref_mvs[refs[1]][0].as_mv, x->nmvjointcost, x->mvcost, MV_COST_WEIGHT);