]> granicus.if.org Git - libvpx/commitdiff
Fix msvc compiler warnings
authorYaowu Xu <yaowu@google.com>
Wed, 3 Aug 2016 21:58:46 +0000 (14:58 -0700)
committerYaowu Xu <yaowu@google.com>
Thu, 4 Aug 2016 01:33:06 +0000 (18:33 -0700)
MSVC 2013 complained about using 32 shift where 64 bit shift should be
used.

Change-Id: I7a2b165d1a92d3c0a91dd4511b27aba7709b5e55

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_rdopt.c
vpx_ports/mem.h

index 3be7d67dcbcbbfbe4d64257c2def3b1b1e090462..6b352924a87dd6e83e6c4469cf238565c5bed307 100644 (file)
@@ -130,7 +130,7 @@ unsigned int vp9_high_get_sby_perpixel_variance(VP9_COMP *cpi,
                              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
 
index e2c2e200b278dcd9d754af6ce1949f32601466ad..a3ef5e5db5ef12432d43e15bc0d747d9220472a5 100644 (file)
@@ -685,7 +685,7 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
                                 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,
index 7e77c6ca9325773ec2b4a350033503218f68dce3..5fdb7277310ffdf9a941fc04cffa8f3cee788aa2 100644 (file)
@@ -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))