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

Deepthi Nandakumar deepthi at multicorewareinc.com
Tue Jun 23 13:01:05 CEST 2015


I'd like to put this patch on hold. We have a commandline that occasionally
produces a corrupted stack around this same array.

On Tue, Jun 23, 2015 at 3:13 PM, <gopu at multicorewareinc.com> wrote:

> # 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);
>          }
>      }
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20150623/7fd15737/attachment.html>


More information about the x265-devel mailing list