shithub: libvpx

Download patch

ref: a914ffad978a6961189d6ffccefac04ab1c679e9
parent: 99ef84c65a2b5760bec5d9300974946303090afb
parent: e372bfd5ac4d3d41f2bcfb9ea2776213751df374
author: James Zern <[email protected]>
date: Thu Sep 22 22:18:49 EDT 2016

Merge "variance_neon: sync variance*() w/c,sse2"

--- 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,