]> granicus.if.org Git - libvpx/commitdiff
Remove branch in inner loop of foreach_transformed_block_in_plane()
authorAlex Converse <aconverse@google.com>
Fri, 24 Jul 2015 17:32:09 +0000 (10:32 -0700)
committerAlex Converse <aconverse@google.com>
Fri, 24 Jul 2015 18:14:33 +0000 (11:14 -0700)
Change-Id: Ib14d09376a9ce4fa5f541264e5c335aceb71380a

vp9/common/vp9_blockd.c

index b2bb18188939942ea4154b0ae617c525d3a9e763..e8334fc8c52211f776bd230b2b381b9e9b0e9fe5 100644 (file)
@@ -59,16 +59,17 @@ void vp9_foreach_transformed_block_in_plane(
       xd->mb_to_right_edge >> (5 + pd->subsampling_x));
   const int max_blocks_high = num_4x4_h + (xd->mb_to_bottom_edge >= 0 ? 0 :
       xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
+  const int extra_step = ((num_4x4_w - max_blocks_wide) >> tx_size) * step;
 
   // Keep track of the row and column of the blocks we use so that we know
   // if we are in the unrestricted motion border.
   for (r = 0; r < max_blocks_high; r += (1 << tx_size)) {
-    for (c = 0; c < num_4x4_w; c += (1 << tx_size)) {
-      // Skip visiting the sub blocks that are wholly within the UMV.
-      if (c < max_blocks_wide)
-        visit(plane, i, plane_bsize, tx_size, arg);
+    // Skip visiting the sub blocks that are wholly within the UMV.
+    for (c = 0; c < max_blocks_wide; c += (1 << tx_size)) {
+      visit(plane, i, plane_bsize, tx_size, arg);
       i += step;
     }
+    i += extra_step;
   }
 }