[x265] [PATCH] logical improvement

nvijay.anand at trispacetech.com nvijay.anand at trispacetech.com
Wed Aug 3 23:18:33 CEST 2016


# HG changeset patch
# User N Vijay Anand <nvijay.anand at trispacetech.com>
# Date 1470259010 -19800
#      Thu Aug 04 02:46:50 2016 +0530
# Node ID 6c41096a33dac4b1e714ffe4463ecfd08637e921
# Parent  72f16a34946f5f03da875c67a75124dfec1b4ecb
logical improvement

diff -r 72f16a34946f -r 6c41096a33da source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Sat Jul 30 09:48:59 2016 +0530
+++ b/source/encoder/motion.cpp	Thu Aug 04 02:46:50 2016 +0530
@@ -108,7 +108,7 @@
     {
         if((bCostStack[i] == bcost) && (bv == bStack[i]))
             break;
-        if((bCostStack[i] > bcost) && (bv != bStack[i]))
+        if((bCostStack[i] >= bcost) && (bv != bStack[i]))
         {
             for (int j=MAX_NUM_BESTVECTORS-1; j>i; j--)
             {
@@ -657,8 +657,8 @@
 
     /* re-measure full pel rounded MVP with SAD as search start point */
     MV bmv = pmv.roundToFPel();
-    MV bmvStack[4] = {bmv, bmv, bmv, bmv};
-    int bmvCostStack[4] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};
+    MV bmvStack[MAX_NUM_BESTVECTORS] = {bmv, bmv, bmv, bmv};
+    int bmvCostStack[MAX_NUM_BESTVECTORS] = {bprecost, 0x7fffffff, 0x7fffffff, 0x7fffffff};
     int bcost = bprecost;
     if (pmv.isSubpel())
     {
@@ -934,7 +934,7 @@
     do \
     {  \
         COPY2_IF_LT(bcost, costs[k], dir, x * 16 + (y & 15)); \
-        PushToBMVStack(bmvStack, bmv+MV(x*i,y*i), bmvCostStack, costs[k]); \
+        PushToBMVStack(bmvStack, omv+MV(x*i,y*i), bmvCostStack, costs[k]); \
     } while (0)
 
                 SADS(0, +0, -4, +0, +4, -2, -3, +2, -3);
@@ -1160,7 +1160,7 @@
     else
     {
         bmv = bmv.toQPel(); // promote search bmv to qpel
-        for (int i=0; i<4; i++)
+        for (int i=0; i<MAX_NUM_BESTVECTORS; i++)
         {
           bmvStack[i] = bmvStack[i].toQPel();
         }
@@ -1224,6 +1224,7 @@
         for (int nBmv=0; nBmv<MAX_NUM_BESTVECTORS; nBmv++)
         {
           bmv =  bmvStack[nBmv];
+          bcost = bmvCostStack[nBmv];
 
           if (wl.hpel_satd)
           {
@@ -1287,6 +1288,7 @@
 
     x265_emms();
     outQMv = bmv;
+
     return bcost;
 }
 


More information about the x265-devel mailing list