shithub: libvpx

Download patch

ref: 08d5cf226e8a2e6ece6f49276ffddedc91b04ae9
parent: 8191ed8b630b8a67770f2e1b17d6994578e520f5
parent: 742021f026fdb2ed72b8b7d1b90bcf30a4f589a3
author: Aℓex Converse <[email protected]>
date: Tue Jul 28 17:59:33 EDT 2015

Merge "Remove branch in inner loop of foreach_transformed_block_in_plane()"

--- a/vp9/common/vp9_blockd.c
+++ b/vp9/common/vp9_blockd.c
@@ -59,16 +59,17 @@
       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;
   }
 }