Commit 859931ed authored by James Zern's avatar James Zern

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

ported from libvpx:
e372bfd5a variance_neon: sync variance*() w/c,sse2

Change-Id: I63c5fce8e62c426d5cf5c10a66a113c119a43518
parent 521383ae
......@@ -76,7 +76,7 @@ unsigned int aom_variance8x8_neon(const uint8_t *a, int a_stride,
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 aom_variance16x16_neon(const uint8_t *a, int a_stride,
......@@ -84,7 +84,7 @@ unsigned int aom_variance16x16_neon(const uint8_t *a, int a_stride,
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 - (((unsigned int)((int64_t)sum * sum)) >> 8);
}
unsigned int aom_variance32x32_neon(const uint8_t *a, int a_stride,
......@@ -92,7 +92,7 @@ unsigned int aom_variance32x32_neon(const uint8_t *a, int a_stride,
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 aom_variance32x64_neon(const uint8_t *a, int a_stride,
......@@ -105,7 +105,7 @@ unsigned int aom_variance32x64_neon(const uint8_t *a, int a_stride,
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 aom_variance64x32_neon(const uint8_t *a, int a_stride,
......@@ -118,7 +118,7 @@ unsigned int aom_variance64x32_neon(const uint8_t *a, int a_stride,
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 aom_variance64x64_neon(const uint8_t *a, int a_stride,
......@@ -142,7 +142,7 @@ unsigned int aom_variance64x64_neon(const uint8_t *a, int a_stride,
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 aom_variance16x8_neon(const unsigned char *src_ptr,
......
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