diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c index d069eefb0df2e1d6aaa2d7c5aaebb0db1b023cd6..f6366eb586174b24b3e15cdb9ff6a1cefe27fb38 100644 --- a/av1/encoder/mcomp.c +++ b/av1/encoder/mcomp.c @@ -90,7 +90,8 @@ static INLINE int mv_cost(const MV *mv, const int *joint_cost, int av1_mv_bit_cost(const MV *mv, const MV *ref, const int *mvjcost, int *mvcost[2], int weight) { const MV diff = { mv->row - ref->row, mv->col - ref->col }; - return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) * weight, 7); + return (int)ROUND_POWER_OF_TWO( + (int64_t)mv_cost(&diff, mvjcost, mvcost) * weight, 7); } #define PIXEL_TRANSFORM_ERROR_SCALE 4 @@ -109,8 +110,8 @@ static int mv_err_cost(const MV *mv, const MV *ref, const int *mvjcost, static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref, int sad_per_bit) { const MV diff = { (mv->row - ref->row) * 8, (mv->col - ref->col) * 8 }; - return ROUND_POWER_OF_TWO( - (unsigned)mv_cost(&diff, x->nmvjointsadcost, x->mvsadcost) * sad_per_bit, + return (int)ROUND_POWER_OF_TWO( + (int64_t)mv_cost(&diff, x->nmvjointsadcost, x->mvsadcost) * sad_per_bit, AV1_PROB_COST_SHIFT); }