From: Yaowu Xu Date: Wed, 3 Aug 2016 21:58:46 +0000 (-0700) Subject: Fix msvc compiler warnings X-Git-Tag: v1.6.1~351 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a79fa136228b349b202b9d5bae2b4f95d1ef517;p=libvpx Fix msvc compiler warnings MSVC 2013 complained about using 32 shift where 64 bit shift should be used. Change-Id: I7a2b165d1a92d3c0a91dd4511b27aba7709b5e55 --- diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 3be7d67dc..6b352924a 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -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 diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index e2c2e200b..a3ef5e5db 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -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, diff --git a/vpx_ports/mem.h b/vpx_ports/mem.h index 7e77c6ca9..5fdb72773 100644 --- 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))