]> granicus.if.org Git - libvpx/commitdiff
Cast variance reference output
authorJohann <johannkoenig@google.com>
Mon, 1 Jun 2015 17:53:46 +0000 (10:53 -0700)
committerJohann <johannkoenig@google.com>
Mon, 1 Jun 2015 17:56:52 +0000 (10:56 -0700)
The larger internal variables are required for the intermediates
but RoundHighBitDepth brings them down to uint32_t/unsigned int.

Fixes type warnings in visual studio.

Change-Id: I48d35284d6cbde330ccdc1f46b6215a645d5eb00

test/variance_test.cc

index e45d90faeae9c6df10b65876dd1d2a63304e96cc..78657d9477b7551fdf8ac71f51a325b027a29cdd 100644 (file)
@@ -96,8 +96,8 @@ static unsigned int variance_ref(const uint8_t *src, const uint8_t *ref,
     }
   }
   RoundHighBitDepth(bit_depth, &se, &sse);
-  *sse_ptr = sse;
-  return sse - (((int64_t) se * se) >> (l2w + l2h));
+  *sse_ptr = (uint32_t) sse;
+  return (unsigned int) (sse - (((int64_t) se * se) >> (l2w + l2h)));
 }
 
 static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
@@ -142,8 +142,8 @@ static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
     }
   }
   RoundHighBitDepth(bit_depth, &se, &sse);
-  *sse_ptr = sse;
-  return sse - (((int64_t) se * se) >> (l2w + l2h));
+  *sse_ptr = (unsigned int) sse;
+  return (unsigned int) (sse - (((int64_t) se * se) >> (l2w + l2h)));
 }
 
 typedef unsigned int (*SumOfSquaresFunction)(const int16_t *src);
@@ -510,8 +510,8 @@ unsigned int subpel_avg_variance_ref(const uint8_t *ref,
     }
   }
   RoundHighBitDepth(bit_depth, &se, &sse);
-  *sse_ptr = sse;
-  return sse - (((int64_t) se * se) >> (l2w + l2h));
+  *sse_ptr = (unsigned int) sse;
+  return (unsigned int) (sse - (((int64_t) se * se) >> (l2w + l2h)));
 }
 
 template<typename SubpelVarianceFunctionType>