[x265] [PATCH] Uncrustified TEncSearch.cpp file

Steve Borho steve at borho.org
Fri Jul 12 07:44:03 CEST 2013


On Thu, Jul 11, 2013 at 11:54 PM, <praveen at multicorewareinc.com> wrote:

> # HG changeset patch
> # User praveentiwari
> # Date 1373604834 -19800
> # Node ID 319547ef3bb70172ff8189f771b0518467d9572e
> # Parent  a1b29fa01efbb58449452e2e8f7b6dedfcafcfa2
> Uncrustified TEncSearch.cpp file
>

I disagree with uncrustify in a few spots, so I removed them from the patch
and applied the rest.


> diff -r a1b29fa01efb -r 319547ef3bb7 source/Lib/TLibEncoder/TEncSearch.cpp
> --- a/source/Lib/TLibEncoder/TEncSearch.cpp     Thu Jul 11 22:32:42 2013
> -0500
> +++ b/source/Lib/TLibEncoder/TEncSearch.cpp     Fri Jul 12 10:23:54 2013
> +0530
> @@ -104,6 +104,7 @@
>          m_qtTempCbf[i] = NULL;
>          m_qtTempTransformSkipFlag[i] = NULL;
>      }
> +
>      m_cfg = NULL;
>      m_rdCost  = NULL;
>      m_trQuant = NULL;
> @@ -156,6 +157,7 @@
>          delete[] m_sharedPredTransformSkip[i];
>          delete[] m_qtTempTransformSkipFlag[i];
>      }
> +
>      m_qtTempTransformSkipTComYuv.destroy();
>      m_tmpYuvPred.destroy();
>  }
> @@ -249,6 +251,7 @@
>  inline Void TEncSearch::xTZSearchHelp(TComPattern* patternKey,
> IntTZSearchStruct& data, Int searchX, Int searchY, UChar pointDir, UInt
> distance)
>  {
>      Pel* fref = data.fref + searchY * data.lumaStride + searchX;
> +
>      m_rdCost->setDistParam(patternKey, fref, data.lumaStride,
> m_distParam);
>
>      if (m_distParam.rows > 12)
> @@ -259,8 +262,8 @@
>
>      // distortion
>      m_distParam.bitDepth = g_bitDepthY;
> -    UInt cost = m_distParam.distFunc(&m_distParam) +
> -                m_bc.mvcost(MV(searchX, searchY) << m_mvCostScale);
> +    UInt cost = m_distParam.distFunc(&m_distParam) +
> +        m_bc.mvcost(MV(searchX, searchY) << m_mvCostScale);
>
>      if (cost < data.bcost)
>      {
> @@ -714,9 +717,12 @@
>      TCoeff* coeff = 0;
>      switch (ttype)
>      {
> -    case TEXT_LUMA:     coeff = m_qtTempCoeffY[qtLayer];  break;
> -    case TEXT_CHROMA_U: coeff = m_qtTempCoeffCb[qtLayer]; break;
> -    case TEXT_CHROMA_V: coeff = m_qtTempCoeffCr[qtLayer]; break;
> +    case TEXT_LUMA:     coeff = m_qtTempCoeffY[qtLayer];
> +        break;
> +    case TEXT_CHROMA_U: coeff = m_qtTempCoeffCb[qtLayer];
> +        break;
> +    case TEXT_CHROMA_V: coeff = m_qtTempCoeffCr[qtLayer];
> +        break;
>      default: assert(0);
>      }
>
> @@ -1708,7 +1714,7 @@
>              TCoeff* coeffDstV = m_qtTempCoeffCr[qtlayer] + (numCoeffIncC
> * absPartIdx);
>              TCoeff* coeffSrcV = m_qtTempTUCoeffCr;
>              ::memcpy(coeffDstV, coeffSrcV, sizeof(TCoeff) * numCoeffC);
> -
> +
>              Int* arlCoeffDstV = m_qtTempArlCoeffCr[qtlayer] +
> (numCoeffIncC * absPartIdx);
>              Int* arlCoeffSrcV = m_qtTempTUArlCoeffCr;
>              ::memcpy(arlCoeffDstV, arlCoeffSrcV, sizeof(Int) * numCoeffC);
> @@ -1979,7 +1985,7 @@
>
>          //--- get SAD ---
>          UInt uiSAD = sa8d((pixel*)fencU, stride, (pixel*)predU, stride) +
> -                     sa8d((pixel*)fencV, stride, (pixel*)predV, stride);
> +            sa8d((pixel*)fencV, stride, (pixel*)predV, stride);
>
>          //--- check ---
>          if (uiSAD < minSAD)
> @@ -2054,7 +2060,7 @@
>              candNum = 0;
>              UInt modeCosts[35];
>              Bool bFilter = (width <= 16);
> -            pixel *predSrc = (pixel*) m_predBuf;
> +            pixel *predSrc = (pixel*)m_predBuf;
>
>              // 1
>              primitives.intra_pred_dc((pixel*)predSrc + ADI_BUF_STRIDE +
> 1, ADI_BUF_STRIDE, (pixel*)pred, stride, width, bFilter);
> @@ -2325,6 +2331,7 @@
>      UInt minMode = 0;
>      UInt maxMode = NUM_CHROMA_MODE;
>      UInt modeList[NUM_CHROMA_MODE];
> +
>      cu->getAllowedChromaDir(0, modeList);
>
>      //----- check chroma modes -----
> @@ -3270,6 +3277,7 @@
>  Void TEncSearch::xCheckBestMVP(TComDataCU* cu, RefPicList picList, MV mv,
> MV& mvPred, Int& outMvpIdx, UInt& outBits, UInt& outCost)
>  {
>      AMVPInfo* amvpInfo = cu->getCUMvField(picList)->getAMVPInfo();
> +
>      assert(amvpInfo->m_mvCand[outMvpIdx] == mvPred);
>      if (amvpInfo->m_num < 2) return;
>
> @@ -3450,8 +3458,10 @@
>                  mv = mv;
>              }
>          }
> +
>          refY += stride;
>      }
> +
>      outcost = bcost - m_bc.mvcost(outmv << 2);
>  }
>
> @@ -3844,7 +3854,7 @@
>          m_trQuant->selectLambda(TEXT_LUMA);
>
>          absSumY = m_trQuant->transformNxN(cu,
> resiYuv->getLumaAddr(absTUPartIdx), resiYuv->width, coeffCurY,
> -                                            arlCoeffCurY, trWidth,
> trHeight, TEXT_LUMA, absPartIdx);
> +                                          arlCoeffCurY, trWidth,
> trHeight, TEXT_LUMA, absPartIdx);
>
>          cu->setCbfSubParts(absSumY ? setCbf : 0, TEXT_LUMA, absPartIdx,
> depth);
>
> @@ -3861,12 +3871,12 @@
>              m_trQuant->selectLambda(TEXT_CHROMA);
>
>              absSumU = m_trQuant->transformNxN(cu,
> resiYuv->getCbAddr(absTUPartIdxC), resiYuv->Cwidth, coeffCurU,
> -                                                arlCoeffCurU, trWidthC,
> trHeightC, TEXT_CHROMA_U, absPartIdx);
> +                                              arlCoeffCurU, trWidthC,
> trHeightC, TEXT_CHROMA_U, absPartIdx);
>
>              curChromaQpOffset =
> cu->getSlice()->getPPS()->getChromaCrQpOffset() +
> cu->getSlice()->getSliceQpDeltaCr();
>              m_trQuant->setQPforQuant(cu->getQP(0), TEXT_CHROMA,
> cu->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
>              absSumV = m_trQuant->transformNxN(cu,
> resiYuv->getCrAddr(absTUPartIdxC), resiYuv->Cwidth, coeffCurV,
> -                                                arlCoeffCurV, trWidthC,
> trHeightC, TEXT_CHROMA_V, absPartIdx);
> +                                              arlCoeffCurV, trWidthC,
> trHeightC, TEXT_CHROMA_V, absPartIdx);
>
>              cu->setCbfSubParts(absSumU ? setCbf : 0, TEXT_CHROMA_U,
> absPartIdx, cu->getDepth(0) + trModeC);
>              cu->setCbfSubParts(absSumV ? setCbf : 0, TEXT_CHROMA_V,
> absPartIdx, cu->getDepth(0) + trModeC);
> @@ -3986,7 +3996,7 @@
>                  assert(scalingListType < 6);
>
>  m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx),
> TEXT_CHROMA, REG_DCT, pcResiCurrU, m_qtTempTComYuv[qtlayer].Cwidth,
> coeffCurU, trWidthC, trHeightC, scalingListType);
>
> -                UInt dist =
> primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absTUPartIdxC),
> resiYuv->Cwidth,
> +                UInt dist =
> primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absTUPartIdxC),
> resiYuv->Cwidth,
>
> m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC),
>
> m_qtTempTComYuv[qtlayer].Cwidth);
>                  const UInt nonZeroDistU =
> m_rdCost->scaleChromaDistCb(dist);
> @@ -4054,7 +4064,7 @@
>                  assert(scalingListType < 6);
>
>  m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx),
> TEXT_CHROMA, REG_DCT, curResiV, m_qtTempTComYuv[qtlayer].Cwidth, coeffCurV,
> trWidthC, trHeightC, scalingListType);
>
> -                UInt dist =
> primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absTUPartIdxC),
> resiYuv->Cwidth,
> +                UInt dist =
> primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absTUPartIdxC),
> resiYuv->Cwidth,
>
> m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC),
>
> m_qtTempTComYuv[qtlayer].Cwidth);
>                  const UInt nonZeroDistV =
> m_rdCost->scaleChromaDistCr(dist);
> @@ -4147,7 +4157,7 @@
>
>              m_trQuant->selectLambda(TEXT_LUMA);
>              absSumTransformSkipY = m_trQuant->transformNxN(cu,
> resiYuv->getLumaAddr(absTUPartIdx), resiYuv->width, coeffCurY,
> -
> arlCoeffCurY, trWidth, trHeight, TEXT_LUMA, absPartIdx, true);
> +                                                           arlCoeffCurY,
> trWidth, trHeight, TEXT_LUMA, absPartIdx, true);
>              cu->setCbfSubParts(absSumTransformSkipY ? setCbf : 0,
> TEXT_LUMA, absPartIdx, depth);
>
>              if (absSumTransformSkipY != 0)
> @@ -4231,11 +4241,11 @@
>              m_trQuant->selectLambda(TEXT_CHROMA);
>
>              absSumTransformSkipU = m_trQuant->transformNxN(cu,
> resiYuv->getCbAddr(absTUPartIdxC), resiYuv->Cwidth, coeffCurU,
> -
> arlCoeffCurU, trWidthC, trHeightC, TEXT_CHROMA_U, absPartIdx, true);
> +                                                           arlCoeffCurU,
> trWidthC, trHeightC, TEXT_CHROMA_U, absPartIdx, true);
>              curChromaQpOffset =
> cu->getSlice()->getPPS()->getChromaCrQpOffset() +
> cu->getSlice()->getSliceQpDeltaCr();
>              m_trQuant->setQPforQuant(cu->getQP(0), TEXT_CHROMA,
> cu->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
>              absSumTransformSkipV = m_trQuant->transformNxN(cu,
> resiYuv->getCrAddr(absTUPartIdxC), resiYuv->Cwidth, coeffCurV,
> -
> arlCoeffCurV, trWidthC, trHeightC, TEXT_CHROMA_V, absPartIdx, true);
> +                                                           arlCoeffCurV,
> trWidthC, trHeightC, TEXT_CHROMA_V, absPartIdx, true);
>
>              cu->setCbfSubParts(absSumTransformSkipU ? setCbf : 0,
> TEXT_CHROMA_U, absPartIdx, cu->getDepth(0) + trModeC);
>              cu->setCbfSubParts(absSumTransformSkipV ? setCbf : 0,
> TEXT_CHROMA_V, absPartIdx, cu->getDepth(0) + trModeC);
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> http://mailman.videolan.org/listinfo/x265-devel
>



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


More information about the x265-devel mailing list