Commit 03013c53 authored by Yaowu Xu's avatar Yaowu Xu

Revert "Upgrade to int64_t to avoid out-of-range"

This reverts commit 9395b34e, because it
did not have any effect in eliminate ubsan warnings as intended.

Change-Id: I9221385217f062a0356fe0c68643b12751048f69
parent 5fb95f7d
......@@ -90,8 +90,7 @@ 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 (int)ROUND_POWER_OF_TWO(
(int64_t)mv_cost(&diff, mvjcost, mvcost) * weight, 7);
return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) * weight, 7);
......@@ -110,8 +109,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 (int)ROUND_POWER_OF_TWO(
(int64_t)mv_cost(&diff, x->nmvjointsadcost, x->mvsadcost) * sad_per_bit,
(unsigned)mv_cost(&diff, x->nmvjointsadcost, x->mvsadcost) * sad_per_bit,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment