[x265] [PATCH] estimateCUCost : best cost between inter and intra, and calculated the rowsatd

gopu at multicorewareinc.com gopu at multicorewareinc.com
Wed Aug 14 08:21:41 CEST 2013


# HG changeset patch
# User ggopu
# Date 1376461292 -19800
# Node ID bc21438114a63558abff32278ba54bddca234e65
# Parent  a2026f0e1556e129d7c86d951b9d3e694a43fac6
estimateCUCost : best cost between inter and intra, and calculated the rowsatd

diff -r a2026f0e1556 -r bc21438114a6 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Tue Aug 13 22:10:41 2013 -0500
+++ b/source/encoder/slicetype.cpp	Wed Aug 14 11:51:32 2013 +0530
@@ -193,10 +193,10 @@
         // TODO: add bidir
     }
 
+    int bcost = me.COST_MAX, cost;
     if (!fenc->bIntraCalculated)
     {
         Int nLog2SizeMinus2 = g_convertToBit[cu_size]; // partition size
-        int bcost = me.COST_MAX, cost;
 
         fenc->bIntraCalculated = true;
 
@@ -236,7 +236,28 @@
         }
         fenc->lowresMvCosts[0][0][cu_xy] = bcost;
     }
-
+    
+    if (!b_bidir)
+    {
+        int icost = *fenc_costs[0];
+        if(*fenc_costs[1] < icost)
+            icost = *fenc_costs[1]; 
+        
+        int b_intra = icost < bcost;
+        if (b_intra)
+        {
+            bcost = icost;
+        }
+        fenc->intraMbs[b - p0] += b_intra;
+    }
+    
+    if (p0 != p1)
+    {
+        int bcost_aq = bcost;
+        fenc->rowSatds[b - p0][p1 - b][cuy] += bcost_aq;
+        fenc->costEst[b - p0][p1 - b] += bcost;
+    }
+    
     return 0;
 }
 


More information about the x265-devel mailing list