diff options
author | hkuang <hkuang@google.com> | 2015-05-01 12:35:08 -0700 |
---|---|---|
committer | hkuang <hkuang@google.com> | 2015-05-05 15:51:04 -0700 |
commit | 4c1a8be29d51b9e3face742ff145995996a0da20 (patch) | |
tree | fe667cd5e5f6c60039934af450bb9a664c22881f /vp9/common/vp9_onyxc_int.h | |
parent | ccae5d99d24a74f60a07a48ef98149d893fb15aa (diff) | |
download | libvpx-4c1a8be29d51b9e3face742ff145995996a0da20.tar.gz |
Optimize the read_partition.
Change-Id: I5a796425ce5706824a2fc17c6f24f983c5b9e43b
Diffstat (limited to 'vp9/common/vp9_onyxc_int.h')
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 8a97cbedc..166da68cc 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -417,21 +417,12 @@ static INLINE int partition_plane_context(const MACROBLOCKD *xd, BLOCK_SIZE bsize) { const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col; const PARTITION_CONTEXT *left_ctx = xd->left_seg_context + (mi_row & MI_MASK); - const int bsl = mi_width_log2_lookup[bsize]; - const int bs = 1 << bsl; - int above = 0, left = 0, i; + int above = (*above_ctx >> bsl) & 1 , left = (*left_ctx >> bsl) & 1; assert(b_width_log2_lookup[bsize] == b_height_log2_lookup[bsize]); assert(bsl >= 0); - for (i = 0; i < bs; i++) { - above |= above_ctx[i]; - left |= left_ctx[i]; - } - above = (above & bs) > 0; - left = (left & bs) > 0; - return (left * 2 + above) + bsl * PARTITION_PLOFFSET; } |