From: Jim Bankoski Date: Fri, 15 Nov 2013 16:00:43 +0000 (-0800) Subject: partition plane context speed up X-Git-Tag: v1.3.0~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1b6c42eed8d9526d62539afcb607925a91a2a1c;p=libvpx partition plane context speed up Removes silly operations inside loop. Change-Id: I9eeab1e914e715a887f86cf1089de508e2364165 --- 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; }