[x265] [PATCH] search: remove the AMVP candidates from the motion candidate list

gopu at multicorewareinc.com gopu at multicorewareinc.com
Tue Jun 23 11:43:11 CEST 2015


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1435051224 -19800
#      Tue Jun 23 14:50:24 2015 +0530
# Node ID 49a44529ef7ca4810e341f4b8a9a7b7f693ae818
# Parent  dfdf378a3968a15a1465a3aa3098e507fb4f10e5
search: remove the AMVP candidates from the motion candidate list

diff -r dfdf378a3968 -r 49a44529ef7c source/common/cudata.cpp
--- a/source/common/cudata.cpp	Mon Jun 22 17:44:14 2015 -0500
+++ b/source/common/cudata.cpp	Tue Jun 23 14:50:24 2015 +0530
@@ -1657,44 +1657,80 @@
     validIndirect[MD_ABOVE_LEFT]  = getIndirectPMV(indirectMV[MD_ABOVE_LEFT], neighbours + MD_ABOVE_LEFT, picList, refIdx);
 
     int num = 0;
+    int numMvc = 0;
+
     // Left predictor search
-    if (validDirect[MD_BELOW_LEFT])
-        amvpCand[num++] = directMV[MD_BELOW_LEFT];
+    if (validDirect[MD_BELOW_LEFT])
+    {
+        amvpCand[num++] = directMV[MD_BELOW_LEFT];
+        pmv[numMvc] = directMV[MD_LEFT];         numMvc += validDirect[MD_LEFT];
+        pmv[numMvc] = indirectMV[MD_BELOW_LEFT]; numMvc += validIndirect[MD_BELOW_LEFT];
+        pmv[numMvc] = indirectMV[MD_LEFT];       numMvc += validIndirect[MD_LEFT];
+    }
     else if (validDirect[MD_LEFT])
-        amvpCand[num++] = directMV[MD_LEFT];
+    {
+        amvpCand[num++] = directMV[MD_LEFT];
+        pmv[numMvc] = directMV[MD_BELOW_LEFT];   numMvc += validDirect[MD_BELOW_LEFT];
+        pmv[numMvc] = indirectMV[MD_BELOW_LEFT]; numMvc += validIndirect[MD_BELOW_LEFT];
+        pmv[numMvc] = indirectMV[MD_LEFT];       numMvc += validIndirect[MD_LEFT];
+    }
     else if (validIndirect[MD_BELOW_LEFT])
+    {
         amvpCand[num++] = indirectMV[MD_BELOW_LEFT];
+        pmv[numMvc] = directMV[MD_BELOW_LEFT];   numMvc += validDirect[MD_BELOW_LEFT];
+        pmv[numMvc] = directMV[MD_LEFT];         numMvc += validDirect[MD_LEFT];
+        pmv[numMvc] = indirectMV[MD_LEFT];       numMvc += validIndirect[MD_LEFT];
+    }
     else if (validIndirect[MD_LEFT])
+    {
         amvpCand[num++] = indirectMV[MD_LEFT];
+        pmv[numMvc] = directMV[MD_BELOW_LEFT];   numMvc += validDirect[MD_BELOW_LEFT];
+        pmv[numMvc] = directMV[MD_LEFT];         numMvc += validDirect[MD_LEFT];
+        pmv[numMvc] = indirectMV[MD_BELOW_LEFT]; numMvc += validIndirect[MD_BELOW_LEFT];
+    }
 
     bool bAddedSmvp = num > 0;
 
-    // Above predictor search
+    // Above pridictor search
     if (validDirect[MD_ABOVE_RIGHT])
+    {
         amvpCand[num++] = directMV[MD_ABOVE_RIGHT];
+        pmv[numMvc] = directMV[MD_ABOVE];        numMvc += validDirect[MD_ABOVE];
+        pmv[numMvc] = directMV[MD_ABOVE_LEFT];   numMvc += validDirect[MD_ABOVE_LEFT];
+    }
     else if (validDirect[MD_ABOVE])
+    {
         amvpCand[num++] = directMV[MD_ABOVE];
+        pmv[numMvc] = directMV[MD_ABOVE_RIGHT];  numMvc += validDirect[MD_ABOVE_RIGHT];
+        pmv[numMvc] = directMV[MD_ABOVE_LEFT];   numMvc += validDirect[MD_ABOVE_LEFT];
+    }
     else if (validDirect[MD_ABOVE_LEFT])
+    {
         amvpCand[num++] = directMV[MD_ABOVE_LEFT];
+        pmv[numMvc] = directMV[MD_ABOVE_RIGHT];  numMvc += validDirect[MD_ABOVE_RIGHT];
+        pmv[numMvc] = directMV[MD_ABOVE];        numMvc += validDirect[MD_ABOVE];
+    }
 
     if (!bAddedSmvp)
     {
         if (validIndirect[MD_ABOVE_RIGHT])
+        {
             amvpCand[num++] = indirectMV[MD_ABOVE_RIGHT];
-        else if (validIndirect[MD_ABOVE])
+            pmv[numMvc] = indirectMV[MD_ABOVE];        numMvc += validIndirect[MD_ABOVE];
+            pmv[numMvc] = indirectMV[MD_ABOVE_LEFT];   numMvc += validIndirect[MD_ABOVE_LEFT];
+        }
+        else if (validDirect[MD_ABOVE])
+        {
             amvpCand[num++] = indirectMV[MD_ABOVE];
-        else if (validIndirect[MD_ABOVE_LEFT])
+            pmv[numMvc] = indirectMV[MD_ABOVE_RIGHT];  numMvc += validIndirect[MD_ABOVE_RIGHT];
+            pmv[numMvc] = indirectMV[MD_ABOVE_LEFT];   numMvc += validIndirect[MD_ABOVE_LEFT];
+        }
+        else if (validDirect[MD_ABOVE_LEFT])
+        {
             amvpCand[num++] = indirectMV[MD_ABOVE_LEFT];
-    }
-
-    int numMvc = 0;
-    for (int dir = MD_LEFT; dir <= MD_ABOVE_LEFT; dir++)
-    {
-        if (validDirect[dir] && directMV[dir].notZero())
-            pmv[numMvc++] = directMV[dir];
-
-        if (validIndirect[dir] && indirectMV[dir].notZero())
-            pmv[numMvc++] = indirectMV[dir];
+            pmv[numMvc] = indirectMV[MD_ABOVE_RIGHT];  numMvc += validIndirect[MD_ABOVE_RIGHT];
+            pmv[numMvc] = indirectMV[MD_ABOVE];   numMvc += validIndirect[MD_ABOVE];
+        }
     }
 
     if (num == 2)
@@ -1718,7 +1754,7 @@
             int curRefPOC = m_slice->m_refPOCList[picList][refIdx];
             int curPOC = m_slice->m_poc;
 
-            pmv[numMvc++] = amvpCand[num++] = scaleMvByPOCDist(neighbours[MD_COLLOCATED].mv[picList], curPOC, curRefPOC, colPOC, colRefPOC);
+            amvpCand[num++] = scaleMvByPOCDist(neighbours[MD_COLLOCATED].mv[picList], curPOC, curRefPOC, colPOC, colRefPOC);
         }
     }
 


More information about the x265-devel mailing list