[x265] [PATCH] include skip mode in lowres frame cost estimation

sagar at multicorewareinc.com sagar at multicorewareinc.com
Mon Oct 5 15:29:55 CEST 2015


# HG changeset patch
# User Sagar Kotecha <sagar at multicorewareinc.com>
# Date 1444046451 -19800
#      Mon Oct 05 17:30:51 2015 +0530
# Node ID 8986245934895f0980128a571e982d8ee762cadb
# Parent  6e7761bdfe23addb862483f8407b388800de7d92
include skip mode in lowres frame cost estimation

diff -r 6e7761bdfe23 -r 898624593489 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Wed Sep 30 14:57:15 2015 +0530
+++ b/source/encoder/slicetype.cpp	Mon Oct 05 17:30:51 2015 +0530
@@ -2072,6 +2072,7 @@
     for (int i = 0; i < 1 + bBidir; i++)
     {
         int& fencCost = fenc->lowresMvCosts[i][listDist[i]][cuXY];
+        int skipCost = INT_MAX;
 
         if (!bDoSearch[i])
         {
@@ -2114,12 +2115,21 @@
                 pixel *src = fref->lowresMC(pelOffset, mvc[idx], subpelbuf, stride);
                 int cost = tld.me.bufSATD(src, stride);
                 COPY2_IF_LT(mvpcost, cost, mvp, mvc[idx]);
+                if (!mvp.notZero())
+                    skipCost = cost;
             }
         }
 
         /* ME will never return a cost larger than the cost @MVP, so we do not
          * have to check that ME cost is more than the estimated merge cost */
         fencCost = tld.me.motionEstimate(fref, mvmin, mvmax, mvp, 0, NULL, s_merange, *fencMV);
+
+        /* Except for mv0 case, everyting else is likely to have enough residual to not trigger the skip. */
+        if (!mvp.notZero() && skipCost < 64 && skipCost < fencCost)
+        {
+            fencCost = skipCost;
+            *fencMV = 0;
+        }
         COPY2_IF_LT(bcost, fencCost, listused, i + 1);
     }
 


More information about the x265-devel mailing list