From b7d5bb5e2a793ff99bdc1cbdf5477bd641d2f282 Mon Sep 17 00:00:00 2001 From: Harinarayanan K K Date: Tue, 30 Jun 2015 17:12:51 +0530 Subject: [PATCH] Fixed issue in cost computation for BIPRED ME BIPRED ME was discarding the halfpel motion vector components in cost computation. That is fixed now. Change-Id: If6c77096d701a258920b14134ff120fd1540f254 --- encoder/ih264e_me.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/encoder/ih264e_me.c b/encoder/ih264e_me.c index 3d12a1b..36182e4 100644 --- a/encoder/ih264e_me.c +++ b/encoder/ih264e_me.c @@ -1736,10 +1736,10 @@ void ih264e_evaluate_bipred(me_ctxt_t *ps_me_ctxt, INT_MAX, &i4_mb_distortion); /* compute cost */ - i4_mb_cost = ps_me_ctxt->pu1_mv_bits[( s_l0_mv.i2_mvy << 2 ) - ps_l0_pred_mv->i2_mvx]; - i4_mb_cost += ps_me_ctxt->pu1_mv_bits[( s_l0_mv.i2_mvy << 2 ) - ps_l0_pred_mv->i2_mvy]; - i4_mb_cost += ps_me_ctxt->pu1_mv_bits[( s_l1_mv.i2_mvx << 2 ) - ps_l1_pred_mv->i2_mvx]; - i4_mb_cost += ps_me_ctxt->pu1_mv_bits[( s_l1_mv.i2_mvy << 2 ) - ps_l1_pred_mv->i2_mvy]; + i4_mb_cost = ps_me_ctxt->pu1_mv_bits[ps_me_ctxt->as_mv_init_search[PRED_BI][i].i2_mvx - ps_l0_pred_mv->i2_mvx]; + i4_mb_cost += ps_me_ctxt->pu1_mv_bits[ps_me_ctxt->as_mv_init_search[PRED_BI][i].i2_mvy - ps_l0_pred_mv->i2_mvy]; + i4_mb_cost += ps_me_ctxt->pu1_mv_bits[ps_me_ctxt->as_mv_init_search[PRED_BI][i + 1].i2_mvx - ps_l1_pred_mv->i2_mvx]; + i4_mb_cost += ps_me_ctxt->pu1_mv_bits[ps_me_ctxt->as_mv_init_search[PRED_BI][i + 1].i2_mvy - ps_l1_pred_mv->i2_mvy]; i4_mb_cost -= (ps_me_ctxt->i4_skip_bias[BSLICE]) * (ps_me_ctxt->i4_skip_type == PRED_BI) * (i == 0);