[x265] [PATCH] motion: skip the ME search if any of MVC sad cost is zero

gopu at multicorewareinc.com gopu at multicorewareinc.com
Fri Jun 26 07:27:49 CEST 2015


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1435296461 -19800
#      Fri Jun 26 10:57:41 2015 +0530
# Node ID 6d7b0c5585cc6498ef40ddcf4a0d3c241892d5bf
# Parent  09193c05af52b2024635037dbf9fa19d4b978e4b
motion: skip the ME search if any of MVC sad cost is zero

diff -r 09193c05af52 -r 6d7b0c5585cc source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Fri Jun 26 10:16:29 2015 +0530
+++ b/source/encoder/motion.cpp	Fri Jun 26 10:57:41 2015 +0530
@@ -646,7 +646,15 @@
         MV m = mvc[i].clipped(qmvmin, qmvmax);
         if (m.notZero() && m != pmv && m != bestpre) // check already measured
         {
-            int cost = subpelCompare(ref, m, sad) + mvcost(m);
+            int cost = subpelCompare(ref, m, sad);
+            // skip ME Search if any of MVC sad cost is zero
+            if (!cost)
+            {
+                outQMv = m;
+                return mvcost(m);
+            }
+            else
+                cost += mvcost(m);
             if (cost < bprecost)
             {
                 bprecost = cost;


More information about the x265-devel mailing list