ref: e372bfd5ac4d3d41f2bcfb9ea2776213751df374
parent: fcf281b6a148ea80d2fe84cc0b0b59b22e9a08f8
author: James Zern <jzern@google.com>
date: Wed Sep 21 14:04:45 EDT 2016
variance_neon: sync variance*() w/c,sse2 removes some unnecessary casts and adds a few explicit uint32 ones for larger sizes to quiet -Wshorten-64-to-32 warnings Change-Id: I63c5fce8e62c426d5cf5c10a66a113c119a43518
--- a/vpx_dsp/arm/variance_neon.c
+++ b/vpx_dsp/arm/variance_neon.c
@@ -75,7 +75,7 @@
unsigned int *sse) {
int sum;
variance_neon_w8(a, a_stride, b, b_stride, 8, 8, sse, &sum);
- return *sse - (((int64_t)sum * sum) >> 6); // >> 6 = / 8 * 8
+ return *sse - ((sum * sum) >> 6);
}
unsigned int vpx_variance16x16_neon(const uint8_t *a, int a_stride,
@@ -83,7 +83,7 @@
unsigned int *sse) {
int sum;
variance_neon_w8(a, a_stride, b, b_stride, 16, 16, sse, &sum);
- return *sse - (((int64_t)sum * sum) >> 8); // >> 8 = / 16 * 16
+ return *sse - (((uint32_t)((int64_t)sum * sum)) >> 8);
}
unsigned int vpx_variance32x32_neon(const uint8_t *a, int a_stride,
@@ -91,7 +91,7 @@
unsigned int *sse) {
int sum;
variance_neon_w8(a, a_stride, b, b_stride, 32, 32, sse, &sum);
- return *sse - (((int64_t)sum * sum) >> 10); // >> 10 = / 32 * 32
+ return *sse - (unsigned int)(((int64_t)sum * sum) >> 10);
}
unsigned int vpx_variance32x64_neon(const uint8_t *a, int a_stride,
@@ -104,7 +104,7 @@
32, 32, &sse2, &sum2);
*sse = sse1 + sse2;
sum1 += sum2;
- return *sse - (((int64_t)sum1 * sum1) >> 11); // >> 11 = / 32 * 64
+ return *sse - (unsigned int)(((int64_t)sum1 * sum1) >> 11);
}
unsigned int vpx_variance64x32_neon(const uint8_t *a, int a_stride,
@@ -117,7 +117,7 @@
64, 16, &sse2, &sum2);
*sse = sse1 + sse2;
sum1 += sum2;
- return *sse - (((int64_t)sum1 * sum1) >> 11); // >> 11 = / 32 * 64
+ return *sse - (unsigned int)(((int64_t)sum1 * sum1) >> 11);
}
unsigned int vpx_variance64x64_neon(const uint8_t *a, int a_stride,
@@ -141,7 +141,7 @@
b_stride, 64, 16, &sse2, &sum2);
*sse = sse1 + sse2;
sum1 += sum2;
- return *sse - (((int64_t)sum1 * sum1) >> 12); // >> 12 = / 64 * 64
+ return *sse - (unsigned int)(((int64_t)sum1 * sum1) >> 12);
}
unsigned int vpx_variance16x8_neon(const unsigned char *src_ptr,