[x265] [PATCH] no-rdo: add no-residue candidate in merge2Nx2N

Steve Borho steve at borho.org
Tue Oct 29 07:29:00 CET 2013


On Tue, Oct 29, 2013 at 1:10 AM, <deepthidevaki at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Deepthi Devaki <deepthidevaki at multicorewareinc.com>
> # Date 1383026581 -19800
> # Node ID 8c38f0da2ae93bf19e780bf96be95bf201ed8f94
> # Parent  8846f5cf6d8d1b06496055a1bc756ed4dd3fa1c5
> no-rdo: add no-residue candidate in merge2Nx2N
>

Queued, but I have some comments

Our commit messages need to include a lot more detail about why this change
is a good idea.  Why does it help?


> diff -r 8846f5cf6d8d -r 8c38f0da2ae9 source/encoder/compress.cpp
> --- a/source/encoder/compress.cpp       Tue Oct 29 01:05:47 2013 -0500
> +++ b/source/encoder/compress.cpp       Tue Oct 29 11:33:01 2013 +0530
> @@ -245,6 +245,7 @@
>
>  outTempCU->setCUTransquantBypassSubParts(m_cfg->getCUTransquantBypassFlagValue(),
> 0, depth);
>      outTempCU->getInterMergeCandidates(0, 0, mvFieldNeighbours,
> interDirNeighbours, numValidMergeCand);
>
> +    int bestMergeCand = 0;
>      for (int mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand)
>      {
>          // set MC parameters, interprets depth relative to LCU level
> @@ -268,6 +269,7 @@
>
>          if (outTempCU->m_totalCost < outBestCU->m_totalCost)
>          {
> +            bestMergeCand = mergeCand;
>              TComDataCU* tmp = outTempCU;
>              outTempCU = outBestCU;
>              outBestCU = tmp;
> @@ -286,7 +288,44 @@
>      {
>          m_search->motionCompensation(outBestCU, bestPredYuv,
> REF_PIC_LIST_X, partIdx, false, true);
>      }
> -    m_search->encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth],
> bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth], yuvReconBest,
> false);
> +
> +    TComDataCU* tmp;
> +    TComYuv *yuv;
> +
> +    outTempCU->setPredModeSubParts(MODE_INTER, 0, depth);
> +
>  outTempCU->setCUTransquantBypassSubParts(m_cfg->getCUTransquantBypassFlagValue(),
> 0, depth);
> +    outTempCU->setPartSizeSubParts(SIZE_2Nx2N, 0, depth);
> +    outTempCU->setMergeFlagSubParts(true, 0, 0, depth);
> +    outTempCU->setMergeIndexSubParts(bestMergeCand, 0, 0, depth);
> +    outTempCU->setInterDirSubParts(interDirNeighbours[bestMergeCand], 0,
> 0, depth);
> +
>  outTempCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField(mvFieldNeighbours[0
> + 2 * bestMergeCand], SIZE_2Nx2N, 0, 0);
> +
>  outTempCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField(mvFieldNeighbours[1
> + 2 * bestMergeCand], SIZE_2Nx2N, 0, 0);
> +
> +    //No-residue mode
> +    m_search->encodeResAndCalcRdInterCU(outTempCU, m_origYuv[depth],
> bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth],
> m_tmpRecoYuv[depth], true);
> +
> +    tmp = outTempCU;
> +    outTempCU = outBestCU;
> +    outBestCU = tmp;
>

This file desperately needs a swap macro/template function.


> +
> +    yuv = yuvReconBest;
> +    yuvReconBest = m_tmpRecoYuv[depth];
> +    m_tmpRecoYuv[depth] = yuv;
> +
> +    //Encode with residue
>

nit: space after forward slashes


> +    m_search->encodeResAndCalcRdInterCU(outTempCU, m_origYuv[depth],
> bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth],
> m_tmpRecoYuv[depth], false);
> +
> +    if (outTempCU->m_totalCost < outBestCU->m_totalCost)    //Choose best
> from no-residue mode and residue mode
> +    {
> +        tmp = outTempCU;
> +        outTempCU = outBestCU;
> +        outBestCU = tmp;
> +
> +        yuv = yuvReconBest;
> +        yuvReconBest = m_tmpRecoYuv[depth];
> +        m_tmpRecoYuv[depth] = yuv;
> +    }
> +
>      if (m_cfg->param.bEnableEarlySkip)
>      {
>          if (outBestCU->getQtRootCbf(0) == 0)
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131029/9892cb5f/attachment.html>


More information about the x265-devel mailing list