shithub: libvpx

Download patch

ref: 618b7c16ab9cfcd1090d719bee6b00af0d05c5ab
parent: 99f7cf4ce51a724e4df023f712cad5bd0ef6b0a9
author: Hui Su <huisu@google.com>
date: Tue Sep 18 05:41:14 EDT 2018

Remove the SECOND_LEVEL_CHECKS_BEST macro

This macro is used only once and makes the code relatively harder to
read and modify.

Change-Id: I8f0344a7050758ed9770ffca211b0237fe7d8b34

--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -263,27 +263,6 @@
     }                                                             \
   }
 
-// TODO(yunqingwang): SECOND_LEVEL_CHECKS_BEST was a rewrote of
-// SECOND_LEVEL_CHECKS, and SECOND_LEVEL_CHECKS should be rewritten
-// later in the same way.
-#define SECOND_LEVEL_CHECKS_BEST                \
-  {                                             \
-    unsigned int second;                        \
-    int br0 = br;                               \
-    int bc0 = bc;                               \
-    assert(tr == br || tc == bc);               \
-    if (tr == br && tc != bc) {                 \
-      kc = bc - tc;                             \
-    } else if (tr != br && tc == bc) {          \
-      kr = br - tr;                             \
-    }                                           \
-    CHECK_BETTER(second, br0 + kr, bc0);        \
-    CHECK_BETTER(second, br0, bc0 + kc);        \
-    if (br0 != br || bc0 != bc) {               \
-      CHECK_BETTER(second, br0 + kr, bc0 + kc); \
-    }                                           \
-  }
-
 #define SETUP_SUBPEL_SEARCH                                                 \
   const uint8_t *const z = x->plane[0].src.buf;                             \
   const int src_stride = x->plane[0].src.stride;                            \
@@ -755,7 +734,22 @@
       bc = tc;
     }
 
-    if (iters_per_step > 1 && best_idx != -1) SECOND_LEVEL_CHECKS_BEST;
+    if (iters_per_step > 1 && best_idx != -1) {
+      unsigned int second;
+      const int br0 = br;
+      const int bc0 = bc;
+      assert(tr == br || tc == bc);
+      if (tr == br && tc != bc) {
+        kc = bc - tc;
+      } else if (tr != br && tc == bc) {
+        kr = br - tr;
+      }
+      CHECK_BETTER(second, br0 + kr, bc0);
+      CHECK_BETTER(second, br0, bc0 + kc);
+      if (br0 != br || bc0 != bc) {
+        CHECK_BETTER(second, br0 + kr, bc0 + kc);
+      }
+    }
 
     tr = br;
     tc = bc;