<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 11, 2013 at 11:54 PM,  <span dir="ltr"><<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User praveentiwari<br>
# Date 1373604834 -19800<br>
# Node ID 319547ef3bb70172ff8189f771b0518467d9572e<br>
# Parent  a1b29fa01efbb58449452e2e8f7b6dedfcafcfa2<br>
Uncrustified TEncSearch.cpp file<br></blockquote><div><br></div><div>I disagree with uncrustify in a few spots, so I removed them from the patch and applied the rest.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

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