Commit c0241664 authored by Alex Converse's avatar Alex Converse

Resolve -Wshorten-64-to-32 in variance.

The subtrahend is small enough to fit into uint32_t.

Change-Id: Ic4d7128aaa665eaf6b25d562610ba8942c46137f
parent 4508eb31
......@@ -150,7 +150,7 @@ static void var_filter_block2d_bil_second_pass(const uint16_t *a, uint8_t *b,
uint32_t *sse) { \
int sum; \
variance(a, a_stride, b, b_stride, W, H, sse, &sum); \
return *sse - (((int64_t)sum * sum) / (W * H)); \
return *sse - (uint32_t)(((int64_t)sum * sum) / (W * H)); \
}
#define SUBPIX_VAR(W, H) \
......
......@@ -231,7 +231,7 @@ unsigned int vpx_variance32x32_sse2(const uint8_t *src, int src_stride,
int sum;
variance_sse2(src, src_stride, ref, ref_stride, 32, 32, sse, &sum,
vpx_get16x16var_sse2, 16);
return *sse - (((int64_t)sum * sum) >> 10);
return *sse - (unsigned int)(((int64_t)sum * sum) >> 10);
}
unsigned int vpx_variance32x16_sse2(const uint8_t *src, int src_stride,
......@@ -240,7 +240,7 @@ unsigned int vpx_variance32x16_sse2(const uint8_t *src, int src_stride,
int sum;
variance_sse2(src, src_stride, ref, ref_stride, 32, 16, sse, &sum,
vpx_get16x16var_sse2, 16);
return *sse - (((int64_t)sum * sum) >> 9);
return *sse - (unsigned int)(((int64_t)sum * sum) >> 9);
}
unsigned int vpx_variance16x32_sse2(const uint8_t *src, int src_stride,
......@@ -249,7 +249,7 @@ unsigned int vpx_variance16x32_sse2(const uint8_t *src, int src_stride,
int sum;
variance_sse2(src, src_stride, ref, ref_stride, 16, 32, sse, &sum,
vpx_get16x16var_sse2, 16);
return *sse - (((int64_t)sum * sum) >> 9);
return *sse - (unsigned int)(((int64_t)sum * sum) >> 9);
}
unsigned int vpx_variance64x64_sse2(const uint8_t *src, int src_stride,
......@@ -258,7 +258,7 @@ unsigned int vpx_variance64x64_sse2(const uint8_t *src, int src_stride,
int sum;
variance_sse2(src, src_stride, ref, ref_stride, 64, 64, sse, &sum,
vpx_get16x16var_sse2, 16);
return *sse - (((int64_t)sum * sum) >> 12);
return *sse - (unsigned int)(((int64_t)sum * sum) >> 12);
}
unsigned int vpx_variance64x32_sse2(const uint8_t *src, int src_stride,
......@@ -267,7 +267,7 @@ unsigned int vpx_variance64x32_sse2(const uint8_t *src, int src_stride,
int sum;
variance_sse2(src, src_stride, ref, ref_stride, 64, 32, sse, &sum,
vpx_get16x16var_sse2, 16);
return *sse - (((int64_t)sum * sum) >> 11);
return *sse - (unsigned int)(((int64_t)sum * sum) >> 11);
}
unsigned int vpx_variance32x64_sse2(const uint8_t *src, int src_stride,
......@@ -276,7 +276,7 @@ unsigned int vpx_variance32x64_sse2(const uint8_t *src, int src_stride,
int sum;
variance_sse2(src, src_stride, ref, ref_stride, 32, 64, sse, &sum,
vpx_get16x16var_sse2, 16);
return *sse - (((int64_t)sum * sum) >> 11);
return *sse - (unsigned int)(((int64_t)sum * sum) >> 11);
}
unsigned int vpx_mse8x8_sse2(const uint8_t *src, int src_stride,
......@@ -353,7 +353,7 @@ DECLS(ssse3, ssse3);
} \
} \
*sse_ptr = sse; \
return sse - (cast_prod(cast se * se) >> (wlog2 + hlog2)); \
return sse - (unsigned int)(cast_prod(cast se * se) >> (wlog2 + hlog2)); \
}
#define FNS(opt1, opt2) \
......@@ -424,7 +424,7 @@ DECLS(ssse3, ssse3);
} \
} \
*sseptr = sse; \
return sse - (cast_prod(cast se * se) >> (wlog2 + hlog2)); \
return sse - (unsigned int)(cast_prod(cast se * se) >> (wlog2 + hlog2)); \
}
#define FNS(opt1, opt2) \
......
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