From e1b6c42eed8d9526d62539afcb607925a91a2a1c Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Fri, 15 Nov 2013 08:00:43 -0800 Subject: [PATCH] partition plane context speed up Removes silly operations inside loop. Change-Id: I9eeab1e914e715a887f86cf1089de508e2364165 --- vp9/common/vp9_onyxc_int.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index a2af57acf..2333a61db 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -337,13 +337,12 @@ static INLINE int partition_plane_context( assert(bsl >= 0); assert(boffset >= 0); - for (i = 0; i < bs; i++) - above |= (above_ctx[i] & (1 << boffset)); - for (i = 0; i < bs; i++) - left |= (left_ctx[i] & (1 << boffset)); - - above = (above > 0); - left = (left > 0); + for (i = 0; i < bs; i++) { + above |= above_ctx[i]; + left |= left_ctx[i]; + } + above = (above & (1 << boffset)) > 0; + left = (left & (1 << boffset)) > 0; return (left * 2 + above) + bsl * PARTITION_PLOFFSET; } -- 2.50.1