summaryrefslogtreecommitdiff
path: root/vpx_dsp
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2016-07-28 09:48:50 -0700
committerAlex Converse <aconverse@google.com>2016-07-28 10:16:31 -0700
commitc0241664aac3a1805db9bd8e09e071ac326531e0 (patch)
tree9100ff25458883f683b4046726ae29be2df18fff /vpx_dsp
parent4508eb3123bd9b65a099715ea143680d268ad2ff (diff)
downloadlibvpx-c0241664aac3a1805db9bd8e09e071ac326531e0.tar.gz
Resolve -Wshorten-64-to-32 in variance.
The subtrahend is small enough to fit into uint32_t. Change-Id: Ic4d7128aaa665eaf6b25d562610ba8942c46137f
Diffstat (limited to 'vpx_dsp')
-rw-r--r--vpx_dsp/variance.c2
-rw-r--r--vpx_dsp/x86/variance_sse2.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/vpx_dsp/variance.c b/vpx_dsp/variance.c
index de22a63a5..c1dac02d3 100644
--- a/vpx_dsp/variance.c
+++ b/vpx_dsp/variance.c
@@ -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) \
diff --git a/vpx_dsp/x86/variance_sse2.c b/vpx_dsp/x86/variance_sse2.c
index 93457ce70..1161da491 100644
--- a/vpx_dsp/x86/variance_sse2.c
+++ b/vpx_dsp/x86/variance_sse2.c
@@ -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) \