[x265] [PATCH] motion: remove mvc's sad cost calc for lowres, already measured in slicetype

gopu at multicorewareinc.com gopu at multicorewareinc.com
Fri Jun 26 06:46:37 CEST 2015


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1435293989 -19800
#      Fri Jun 26 10:16:29 2015 +0530
# Node ID 09193c05af52b2024635037dbf9fa19d4b978e4b
# Parent  1e5c4d155ab85e8e8dd199bb3515801766ea9e88
motion: remove mvc's sad cost calc for lowres, already measured in slicetype

diff -r 1e5c4d155ab8 -r 09193c05af52 source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Thu Jun 25 13:42:29 2015 +0530
+++ b/source/encoder/motion.cpp	Fri Jun 26 10:16:29 2015 +0530
@@ -639,36 +639,18 @@
         }
     }
 
+    X265_CHECK(!(ref->isLowres && numCandidates), "lowres motion candidates\n")
     // measure SAD cost at each QPEL motion vector candidate
-    if (ref->isLowres)
+    for (int i = 0; i < numCandidates; i++)
     {
-        for (int i = 0; i < numCandidates; i++)
+        MV m = mvc[i].clipped(qmvmin, qmvmax);
+        if (m.notZero() && m != pmv && m != bestpre) // check already measured
         {
-            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);
+            if (cost < bprecost)
             {
-                int cost = ref->lowresQPelCost(fenc, blockOffset, m, sad) + mvcost(m);
-                if (cost < bprecost)
-                {
-                    bprecost = cost;
-                    bestpre = m;
-                }
-            }
-        }
-    }
-    else
-    {
-        for (int i = 0; i < numCandidates; i++)
-        {
-            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);
-                if (cost < bprecost)
-                {
-                    bprecost = cost;
-                    bestpre = m;
-                }
+                bprecost = cost;
+                bestpre = m;
             }
         }
     }


More information about the x265-devel mailing list