]> granicus.if.org Git - libvpx/commitdiff
psnr.c: use int64_t for sum of differences
authorYaowu Xu <yaowu@google.com>
Tue, 28 Jun 2016 16:53:11 +0000 (09:53 -0700)
committerYaowu Xu <yaowu@google.com>
Tue, 28 Jun 2016 16:53:11 +0000 (09:53 -0700)
Since the values can be negative.

Change-Id: Idda69e9fb47bb34696aeb20170341a0191c5d85e

vpx_dsp/psnr.c

index 1655f116c09dd01a69fc62bfd50137f99dc52c98..5bf78627114ba36e0c2884d418fd5fb693157cc3 100644 (file)
@@ -51,7 +51,7 @@ static void encoder_variance(const uint8_t *a, int  a_stride,
 static void encoder_highbd_variance64(const uint8_t *a8, int  a_stride,
   const uint8_t *b8, int  b_stride,
   int w, int h, uint64_t *sse,
-  uint64_t *sum) {
+  int64_t *sum) {
   int i, j;
 
   uint16_t *a = CONVERT_TO_SHORTPTR(a8);
@@ -75,7 +75,7 @@ static void encoder_highbd_8_variance(const uint8_t *a8, int  a_stride,
   int w, int h,
   unsigned int *sse, int *sum) {
   uint64_t sse_long = 0;
-  uint64_t sum_long = 0;
+  int64_t sum_long = 0;
   encoder_highbd_variance64(a8, a_stride, b8, b_stride, w, h,
     &sse_long, &sum_long);
   *sse = (unsigned int)sse_long;