From a63e31e81e9d94587de41c57e843e3944902d7fe Mon Sep 17 00:00:00 2001 From: James Zern <jzern@google.com> Date: Fri, 28 Jun 2013 18:07:37 -0700 Subject: [PATCH] fix test compile error since: 92479d9 Make update_partition_context faster fixes: vp9/common/vp9_blockd.h:408:22: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing] char pcvalue[2] = {~(0xe << boffset), ~(0xf <<boffset)}; ^~~~~~~~~~~~~~~~~ Change-Id: Id5b00b9a72d00a2b314081a23879bd1fa3ce983b --- vp9/common/vp9_blockd.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 0f197e3306..1ef8fe2b1d 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -401,11 +401,13 @@ static int *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE_TYPE subsize) { static INLINE void update_partition_context(MACROBLOCKD *xd, BLOCK_SIZE_TYPE sb_type, BLOCK_SIZE_TYPE sb_size) { - int bsl = b_width_log2(sb_size), bs = (1 << bsl) / 2; - int bwl = b_width_log2(sb_type); - int bhl = b_height_log2(sb_type); - int boffset = b_width_log2(BLOCK_SIZE_SB64X64) - bsl; - char pcvalue[2] = {~(0xe << boffset), ~(0xf <<boffset)}; + const int bsl = b_width_log2(sb_size), bs = (1 << bsl) / 2; + const int bwl = b_width_log2(sb_type); + const int bhl = b_height_log2(sb_type); + const int boffset = b_width_log2(BLOCK_SIZE_SB64X64) - bsl; + const char pcval0 = ~(0xe << boffset); + const char pcval1 = ~(0xf << boffset); + const char pcvalue[2] = {pcval0, pcval1}; assert(MAX(bwl, bhl) <= bsl); -- GitLab