[x265] [PATCH] Select the best among the tradition MVP and the Scaled MV as MVP

Pooja Venkatesan pooja at multicorewareinc.com
Wed Jun 12 07:53:14 CEST 2019


Please ignore this patch. Will be sharing an improved version soon.

Thanks.
Pooja.

On Thu, May 30, 2019 at 2:42 PM <pooja at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Pooja Venkatesan <pooja at multicorewareinc.com>
> # Date 1559024172 -19800
> #      Tue May 28 11:46:12 2019 +0530
> # Node ID 4d5ea449955a12f4704f7eef8ee9da30d674819b
> # Parent  a46ded2c14116af1cafacdc1fb98be43259dc7d6
> Select the best among the tradition MVP and the Scaled MV as MVP
> from analysis-save encode in load mode for refine-inter levels.
>
> diff -r a46ded2c1411 -r 4d5ea449955a source/encoder/analysis.cpp
> --- a/source/encoder/analysis.cpp       Tue May 28 14:01:54 2019 +0800
> +++ b/source/encoder/analysis.cpp       Tue May 28 11:46:12 2019 +0530
> @@ -2488,10 +2488,14 @@
>                              MV mvp;
>
>                              int numMvc =
> mode.cu.getPMV(mode.interNeighbours, list, ref, mode.amvpCand[list][ref],
> mvc);
> -                            if (m_param->interRefine != 1)
> -                                mvp =
> mode.amvpCand[list][ref][mode.cu.m_mvpIdx[list][pu.puAbsPartIdx]];
> -                            else
> -                                mvp = interDataCTU->mv[list][cuIdx +
> part].word;
> +                            mvp =
> mode.amvpCand[list][ref][mode.cu.m_mvpIdx[list][pu.puAbsPartIdx]];
> +                            if(m_param->interRefine == 1)
> +                            {
> +
> mode.amvpCand[list][ref][!(mode.cu.m_mvpIdx[list][pu.puAbsPartIdx])] =
> interDataCTU->mv[list][cuIdx + part].word;
> +                                int mvpIdx = selectMVP(mode.cu, pu,
> mode.amvpCand[list][ref], list, ref);
> +                                if (mvpIdx !=
> mode.cu.m_mvpIdx[list][pu.puAbsPartIdx])
> +                                    mvp = interDataCTU->mv[list][cuIdx +
> part].word;
> +                            }
>                              if (m_param->mvRefine || m_param->interRefine
> == 1)
>                              {
>                                  MV outmv;
> diff -r a46ded2c1411 -r 4d5ea449955a source/encoder/search.cpp
> --- a/source/encoder/search.cpp Tue May 28 14:01:54 2019 +0800
> +++ b/source/encoder/search.cpp Tue May 28 11:46:12 2019 +0530
> @@ -2196,7 +2196,7 @@
>          bestME[1].cost = MAX_UINT;
>
>          getBlkBits((PartSize)cu.m_partSize[0], slice->isInterP(), puIdx,
> lastMode, m_listSelBits);
> -        bool bDoUnidir = true;
> +        bool bDoUnidir = true, bDoPme =
> m_param->bDistributeMotionEstimation;
>
>          cu.getNeighbourMV(puIdx, pu.puAbsPartIdx,
> interMode.interNeighbours);
>          /* Uni-directional prediction */
> @@ -2225,8 +2225,18 @@
>                  MV mvmin, mvmax, outmv, mvp;
>                  if (useAsMVP)
>                  {
> -                    mvp = interDataCTU->mv[list][cuIdx + puIdx].word;
> -                    mvpIdx = interDataCTU->mvpIdx[list][cuIdx + puIdx];
> +                    interMode.amvpCand[list][ref][!mvpIdx] =
> interDataCTU->mv[list][cuIdx + puIdx].word;
> +                    int mvpIdx0 = selectMVP(interMode.cu, pu,
> interMode.amvpCand[list][ref], list, ref);
> +                    if (mvpIdx != mvpIdx0)
> +                    {
> +                        mvp = interDataCTU->mv[list][cuIdx + puIdx].word;
> +                        mvpIdx = interDataCTU->mvpIdx[list][cuIdx +
> puIdx];
> +                    }
> +                    else
> +                    {
> +                        useAsMVP = false;
> +                        break;
> +                    }
>                  }
>                  else
>                      mvp = amvp[mvpIdx];
> @@ -2277,10 +2287,10 @@
>                      bestME[list].mvCost  = mvCost;
>                      bestME[list].ref = ref;
>                  }
> -                bDoUnidir = false;
> -            }
> +                bDoUnidir = bDoPme = false;
> +            }
>          }
> -        else if (m_param->bDistributeMotionEstimation)
> +        if (bDoPme)
>          {
>              PME pme(*this, interMode, cuGeom, pu, puIdx);
>              pme.m_jobTotal = 0;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190612/c6fa7315/attachment.html>


More information about the x265-devel mailing list