]> granicus.if.org Git - libvpx/commitdiff
Optimize the read_partition.
authorhkuang <hkuang@google.com>
Fri, 1 May 2015 19:35:08 +0000 (12:35 -0700)
committerhkuang <hkuang@google.com>
Tue, 5 May 2015 22:51:04 +0000 (15:51 -0700)
Change-Id: I5a796425ce5706824a2fc17c6f24f983c5b9e43b

vp9/common/vp9_onyxc_int.h

index 8a97cbedcf23ba23692ee8a009209fcf8ccd3dc2..166da68cc452522e7cc8189581f82b4972533bd4 100644 (file)
@@ -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;
 }