shithub: libvpx

Download patch

ref: 7a79fa136228b349b202b9d5bae2b4f95d1ef517
parent: b51d127c8238ccb570dc2683dd5d9154173d90ab
author: Yaowu Xu <yaowu@google.com>
date: Wed Aug 3 10:58:46 EDT 2016

Fix msvc compiler warnings

MSVC 2013 complained about using 32 shift where 64 bit shift should be
used.

Change-Id: I7a2b165d1a92d3c0a91dd4511b27aba7709b5e55

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -130,7 +130,7 @@
                              CONVERT_TO_BYTEPTR(VP9_HIGH_VAR_OFFS_8), 0, &sse);
       break;
   }
-  return ROUND_POWER_OF_TWO((int64_t)var, num_pels_log2_lookup[bs]);
+  return ROUND64_POWER_OF_TWO((int64_t)var, num_pels_log2_lookup[bs]);
 }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -685,7 +685,7 @@
                                 plane_bsize, tx_bsize);
 #if CONFIG_VP9_HIGHBITDEPTH
       if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) && (xd->bd > 8))
-        sse = ROUND_POWER_OF_TWO(sse, (xd->bd - 8) * 2);
+        sse = ROUND64_POWER_OF_TWO(sse, (xd->bd - 8) * 2);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
       sse = sse * 16;
       tmp = pixel_sse(args->cpi, xd, pd, src, src_stride, dst, dst_stride,
--- a/vpx_ports/mem.h
+++ b/vpx_ports/mem.h
@@ -39,6 +39,7 @@
 
 /* Shift down with rounding */
 #define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n)-1))) >> (n))
+#define ROUND64_POWER_OF_TWO(value, n) (((value) + (1ULL << ((n)-1))) >> (n))
 
 #define ALIGN_POWER_OF_TWO(value, n) \
   (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))