Commit 0c33b15f authored by Yaowu Xu's avatar Yaowu Xu

Convert to use int64_t to aovid int oout-of-range

BUG=aomedia:518

Change-Id: Ia88b50b084c6370073ac4916e00a019963cf0254
parent 773e3542
......@@ -2345,14 +2345,14 @@ int av1_full_pixel_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
/* checks if (r, c) has better score than previous best */
#define MVC(r, c) \
(mvcost \
? ((mvjcost[((r) != rr) * 2 + ((c) != rc)] + mvcost[0][((r)-rr)] + \
mvcost[1][((c)-rc)]) * \
error_per_bit + \
4096) >> \
13 \
: 0)
#define MVC(r, c) \
(unsigned int)(mvcost \
? ((mvjcost[((r) != rr) * 2 + ((c) != rc)] + \
mvcost[0][((r)-rr)] + (int64_t)mvcost[1][((c)-rc)]) * \
error_per_bit + \
4096) >> \
13 \
: 0)
#define CHECK_BETTER(v, r, c) \
if (c >= minc && c <= maxc && r >= minr && r <= maxr) { \
......@@ -2935,14 +2935,14 @@ int av1_masked_full_pixel_diamond(const AV1_COMP *cpi, MACROBLOCK *x,
vfp->osvf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), z, mask, &sse)
/* checks if (r, c) has better score than previous best */
#define MVC(r, c) \
(mvcost \
? ((mvjcost[((r) != rr) * 2 + ((c) != rc)] + mvcost[0][((r)-rr)] + \
mvcost[1][((c)-rc)]) * \
error_per_bit + \
4096) >> \
13 \
: 0)
#define MVC(r, c) \
(unsigned int)(mvcost \
? ((mvjcost[((r) != rr) * 2 + ((c) != rc)] + \
mvcost[0][((r)-rr)] + (int64_t)mvcost[1][((c)-rc)]) * \
error_per_bit + \
4096) >> \
13 \
: 0)
#define CHECK_BETTER(v, r, c) \
if (c >= minc && c <= maxc && r >= minr && r <= maxr) { \
......
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