<div dir="ltr">ok will do it</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 12, 2014 at 11:02 AM, Steve Borho <span dir="ltr"><<a href="mailto:steve@borho.org" target="_blank">steve@borho.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, Jun 11, 2014 at 6:13 AM, <<a href="mailto:sumalatha@multicorewareinc.com">sumalatha@multicorewareinc.com</a>> wrote:<br>
> # HG changeset patch<br>
> # User Sumalatha Polureddy<<a href="mailto:sumalatha@multicorewareinc.com">sumalatha@multicorewareinc.com</a>><br>
> # Date 1402483864 -19800<br>
> # Node ID a407bf9959c957d8a3c355594a060abab8a182fc<br>
> # Parent dbe573edb3459f57ab058318e4227f6b19045c2d<br>
> psyrd: bug fix in use of psyrdcost for PU/TU decision in inter<br>
<br>
</div>please fold these two patches together and re-submit<br>
<div><div class="h5"><br>
> diff -r dbe573edb345 -r a407bf9959c9 source/Lib/TLibEncoder/TEncSearch.cpp<br>
> --- a/source/Lib/TLibEncoder/TEncSearch.cpp Tue Jun 10 17:47:15 2014 +0530<br>
> +++ b/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jun 11 16:21:04 2014 +0530<br>
> @@ -2777,7 +2777,18 @@<br>
> m_entropyCoder->resetBits();<br>
> m_entropyCoder->encodeQtRootCbfZero(cu);<br>
> uint32_t zeroResiBits = m_entropyCoder->getNumberOfWrittenBits();<br>
> - uint64_t zeroCost = m_rdCost->calcRdCost(zeroDistortion, zeroResiBits);<br>
> + uint64_t zeroCost = 0;<br>
> + uint32_t zeroPsyEnergyY = 0;<br>
> + if (m_rdCost->psyRdEnabled())<br>
> + {<br>
> + int size = g_convertToBit[cuSize];<br>
> + zeroPsyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(), fencYuv->getStride(),<br>
> + (pixel*)RDCost::zeroPel, MAX_CU_SIZE); // need to check whether zero distortion is similar to psyenergy of fenc<br>
> + zeroCost = m_rdCost->calcPsyRdCost(zeroDistortion, zeroResiBits, zeroPsyEnergyY);<br>
> + }<br>
> + else<br>
> + zeroCost = m_rdCost->calcRdCost(zeroDistortion, zeroResiBits);<br>
> +<br>
> if (cu->isLosslessCoded(0))<br>
> {<br>
> zeroCost = cost + 1;<br>
> @@ -2785,6 +2796,7 @@<br>
> if (zeroCost < cost)<br>
> {<br>
> distortion = zeroDistortion;<br>
> + cu->m_psyEnergy = zeroPsyEnergyY;<br>
><br>
> const uint32_t qpartnum = cu->getPic()->getNumPartInCU() >> (depth << 1);<br>
> ::memset(cu->getTransformIdx(), 0, qpartnum * sizeof(uint8_t));<br>
> @@ -2807,7 +2819,10 @@<br>
><br>
> bits = xSymbolBitsInter(cu);<br>
><br>
> - cost = m_rdCost->calcRdCost(distortion, bits);<br>
> + if (m_rdCost->psyRdEnabled())<br>
> + cost = m_rdCost->calcPsyRdCost(distortion, bits, cu->m_psyEnergy);<br>
> + else<br>
> + cost = m_rdCost->calcRdCost(distortion, bits);<br>
><br>
> if (cost < bestCost)<br>
> {<br>
> @@ -3258,6 +3273,7 @@<br>
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiY, strideResiY, coeffCurY, trSize, scalingListType, false, lastPos[TEXT_LUMA][0]); //this is for inter mode only<br>
><br>
> const uint32_t nonZeroDistY = primitives.sse_ss[partSize](resiYuv->getLumaAddr(absPartIdx), resiYuv->m_width, curResiY, strideResiY);<br>
> + uint32_t nonZeroPsyEnergyY = 0;<br>
> if (m_rdCost->psyRdEnabled())<br>
> {<br>
> pixel* pred = predYuv->getLumaAddr(absPartIdx);<br>
> @@ -3267,22 +3283,20 @@<br>
> uint32_t stride = fencYuv->getStride();<br>
> //===== reconstruction =====<br>
> primitives.luma_add_ps[partSize](reconIPred, reconIPredStride, pred, curResiY, stride, strideResiY);<br>
> + int size = g_convertToBit[trSize];<br>
> + nonZeroPsyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),<br>
> + cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getStride());<br>
> }<br>
> if (cu->isLosslessCoded(0))<br>
> {<br>
> distY = nonZeroDistY;<br>
> + psyEnergyY = nonZeroPsyEnergyY;<br>
> }<br>
> else<br>
> {<br>
> uint64_t singleCostY = 0;<br>
> if (m_rdCost->psyRdEnabled())<br>
> - {<br>
> - int size = g_convertToBit[trSize];<br>
> - uint32_t zorder = cu->getZorderIdxInCU() + absPartIdx;<br>
> - psyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),<br>
> - cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getStride());<br>
> - singleCostY = m_rdCost->calcPsyRdCost(nonZeroDistY, singleBitsComp[TEXT_LUMA][0], psyEnergyY);<br>
> - }<br>
> + singleCostY = m_rdCost->calcPsyRdCost(nonZeroDistY, singleBitsComp[TEXT_LUMA][0], nonZeroPsyEnergyY);<br>
> else<br>
> singleCostY = m_rdCost->calcRdCost(nonZeroDistY, singleBitsComp[TEXT_LUMA][0]);<br>
> m_entropyCoder->resetBits();<br>
> @@ -3307,6 +3321,7 @@<br>
> else<br>
> {<br>
> distY = nonZeroDistY;<br>
> + psyEnergyY = nonZeroPsyEnergyY;<br>
> if (checkTransformSkipY)<br>
> {<br>
> minCost[TEXT_LUMA][0] = singleCostY;<br>
> @@ -3370,6 +3385,7 @@<br>
> uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absPartIdxC), resiYuv->m_cwidth,<br>
> curResiU, strideResiC);<br>
> const uint32_t nonZeroDistU = m_rdCost->scaleChromaDistCb(dist);<br>
> + uint32_t nonZeroPsyEnergyU = 0;<br>
> if (m_rdCost->psyRdEnabled())<br>
> {<br>
> pixel* pred = predYuv->getCbAddr(absPartIdxC);<br>
> @@ -3379,21 +3395,21 @@<br>
> uint32_t stride = fencYuv->getCStride();<br>
> //===== reconstruction =====<br>
> primitives.luma_add_ps[partSizeC](reconIPred, reconIPredStride, pred, curResiU, stride, strideResiC);<br>
> + int size = g_convertToBit[trSizeC];<br>
> + nonZeroPsyEnergyU = m_rdCost->psyCost(size, fencYuv->getCbAddr(absPartIdxC), fencYuv->getCStride(),<br>
> + cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());<br>
> }<br>
> if (cu->isLosslessCoded(0))<br>
> {<br>
> distU = nonZeroDistU;<br>
> + psyEnergyU = nonZeroPsyEnergyU;<br>
> }<br>
> else<br>
> {<br>
> uint64_t singleCostU = 0;<br>
> if (m_rdCost->psyRdEnabled())<br>
> {<br>
> - int size = g_convertToBit[trSizeC];<br>
> - uint32_t zorder = cu->getZorderIdxInCU() + absPartIdxC;<br>
> - psyEnergyU = m_rdCost->psyCost(size, fencYuv->getCbAddr(absPartIdxC), fencYuv->getCStride(),<br>
> - cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());<br>
> - singleCostU = m_rdCost->calcPsyRdCost(nonZeroDistU, singleBitsComp[TEXT_CHROMA_U][0], psyEnergyU);<br>
> + singleCostU = m_rdCost->calcPsyRdCost(nonZeroDistU, singleBitsComp[TEXT_CHROMA_U][0], nonZeroPsyEnergyU);<br>
> }<br>
> else<br>
> singleCostU = m_rdCost->calcRdCost(nonZeroDistU, singleBitsComp[TEXT_CHROMA_U][0]);<br>
> @@ -3419,6 +3435,7 @@<br>
> else<br>
> {<br>
> distU = nonZeroDistU;<br>
> + psyEnergyU = nonZeroPsyEnergyU;<br>
> if (checkTransformSkipUV)<br>
> {<br>
> minCost[TEXT_CHROMA_U][tuIterator.m_section] = singleCostU;<br>
> @@ -3462,6 +3479,7 @@<br>
> uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absPartIdxC), resiYuv->m_cwidth,<br>
> curResiV, strideResiC);<br>
> const uint32_t nonZeroDistV = m_rdCost->scaleChromaDistCr(dist);<br>
> + uint32_t nonZeroPsyEnergyV = 0;<br>
><br>
> if (m_rdCost->psyRdEnabled())<br>
> {<br>
> @@ -3472,21 +3490,21 @@<br>
> uint32_t stride = fencYuv->getCStride();<br>
> //===== reconstruction =====<br>
> primitives.luma_add_ps[partSizeC](reconIPred, reconIPredStride, pred, curResiV, stride, strideResiC);<br>
> + int size = g_convertToBit[trSizeC];<br>
> + nonZeroPsyEnergyV = m_rdCost->psyCost(size, fencYuv->getCrAddr(absPartIdxC), fencYuv->getCStride(),<br>
> + cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());<br>
> }<br>
> if (cu->isLosslessCoded(0))<br>
> {<br>
> distV = nonZeroDistV;<br>
> + psyEnergyV = nonZeroPsyEnergyV;<br>
> }<br>
> else<br>
> {<br>
> uint64_t singleCostV = 0;<br>
> if (m_rdCost->psyRdEnabled())<br>
> {<br>
> - int size = g_convertToBit[trSizeC];<br>
> - uint32_t zorder = cu->getZorderIdxInCU() + absPartIdxC;<br>
> - psyEnergyV = m_rdCost->psyCost(size, fencYuv->getCrAddr(absPartIdxC), fencYuv->getCStride(),<br>
> - cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());<br>
> - singleCostV = m_rdCost->calcPsyRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section], psyEnergyV);<br>
> + singleCostV = m_rdCost->calcPsyRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section], nonZeroPsyEnergyV);<br>
> }<br>
> else<br>
> singleCostV = m_rdCost->calcRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section]);<br>
> @@ -3512,6 +3530,7 @@<br>
> else<br>
> {<br>
> distV = nonZeroDistV;<br>
> + psyEnergyV = nonZeroPsyEnergyV;<br>
> if (checkTransformSkipUV)<br>
> {<br>
> minCost[TEXT_CHROMA_V][tuIterator.m_section] = singleCostV;<br>
> @@ -3548,6 +3567,7 @@<br>
> if (checkTransformSkipY)<br>
> {<br>
> uint32_t nonZeroDistY = 0, absSumTransformSkipY;<br>
> + uint32_t nonZeroPsyEnergyY = 0;<br>
> uint64_t singleCostY = MAX_INT64;<br>
><br>
> coeff_t bestCoeffY[MAX_TS_SIZE * MAX_TS_SIZE];<br>
> @@ -3599,9 +3619,9 @@<br>
> //===== reconstruction =====<br>
> primitives.luma_add_ps[partSize](reconIPred, reconIPredStride, pred, curResiY, stride, strideResiY);<br>
> int size = g_convertToBit[trSize];<br>
> - psyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),<br>
> + nonZeroPsyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),<br>
> cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getStride());<br>
> - singleCostY = m_rdCost->calcPsyRdCost(nonZeroDistY, skipSingleBitsY, psyEnergyY);<br>
> + singleCostY = m_rdCost->calcPsyRdCost(nonZeroDistY, skipSingleBitsY, nonZeroPsyEnergyY);<br>
> }<br>
> else<br>
> singleCostY = m_rdCost->calcRdCost(nonZeroDistY, skipSingleBitsY);<br>
> @@ -3616,7 +3636,7 @@<br>
> else<br>
> {<br>
> singleDistComp[TEXT_LUMA][0] = nonZeroDistY;<br>
> - singlePsyEnergyComp[TEXT_LUMA][0] = psyEnergyY;<br>
> + singlePsyEnergyComp[TEXT_LUMA][0] = nonZeroPsyEnergyY;<br>
> absSum[TEXT_LUMA][0] = absSumTransformSkipY;<br>
> bestTransformMode[TEXT_LUMA][0] = 1;<br>
> }<br>
> @@ -3627,6 +3647,7 @@<br>
> if (bCodeChroma && checkTransformSkipUV)<br>
> {<br>
> uint32_t nonZeroDistU = 0, nonZeroDistV = 0, absSumTransformSkipU, absSumTransformSkipV;<br>
> + uint32_t nonZeroPsyEnergyU = 0, nonZeroPsyEnergyV = 0;<br>
> uint64_t singleCostU = MAX_INT64;<br>
> uint64_t singleCostV = MAX_INT64;<br>
><br>
> @@ -3704,9 +3725,9 @@<br>
> //===== reconstruction =====<br>
> primitives.luma_add_ps[partSizeC](reconIPred, reconIPredStride, pred, curResiU, stride, strideResiC);<br>
> int size = g_convertToBit[trSizeC];<br>
> - psyEnergyU = m_rdCost->psyCost(size, fencYuv->getCbAddr(absPartIdxC), fencYuv->getCStride(),<br>
> + nonZeroPsyEnergyU = m_rdCost->psyCost(size, fencYuv->getCbAddr(absPartIdxC), fencYuv->getCStride(),<br>
> cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());<br>
> - singleCostU = m_rdCost->calcPsyRdCost(nonZeroDistU, singleBitsComp[TEXT_CHROMA_U][tuIterator.m_section], psyEnergyU);<br>
> + singleCostU = m_rdCost->calcPsyRdCost(nonZeroDistU, singleBitsComp[TEXT_CHROMA_U][tuIterator.m_section], nonZeroPsyEnergyU);<br>
> }<br>
> else<br>
> singleCostU = m_rdCost->calcRdCost(nonZeroDistU, singleBitsComp[TEXT_CHROMA_U][tuIterator.m_section]);<br>
> @@ -3722,7 +3743,7 @@<br>
> else<br>
> {<br>
> singleDistComp[TEXT_CHROMA_U][tuIterator.m_section] = nonZeroDistU;<br>
> - singlePsyEnergyComp[TEXT_CHROMA_U][tuIterator.m_section] = psyEnergyU;<br>
> + singlePsyEnergyComp[TEXT_CHROMA_U][tuIterator.m_section] = nonZeroPsyEnergyU;<br>
> absSum[TEXT_CHROMA_U][tuIterator.m_section] = absSumTransformSkipU;<br>
> bestTransformMode[TEXT_CHROMA_U][tuIterator.m_section] = 1;<br>
> }<br>
> @@ -3743,7 +3764,6 @@<br>
> uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absPartIdxC), resiYuv->m_cwidth,<br>
> curResiV, strideResiC);<br>
> nonZeroDistV = m_rdCost->scaleChromaDistCr(dist);<br>
> - singleCostV = m_rdCost->calcRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section]);<br>
> if (m_rdCost->psyRdEnabled())<br>
> {<br>
> pixel* pred = predYuv->getCrAddr(absPartIdxC);<br>
> @@ -3754,9 +3774,9 @@<br>
> //===== reconstruction =====<br>
> primitives.luma_add_ps[partSizeC](reconIPred, reconIPredStride, pred, curResiV, stride, strideResiC);<br>
> int size = g_convertToBit[trSizeC];<br>
> - psyEnergyV = m_rdCost->psyCost(size, fencYuv->getCrAddr(absPartIdxC), fencYuv->getCStride(),<br>
> + nonZeroPsyEnergyV = m_rdCost->psyCost(size, fencYuv->getCrAddr(absPartIdxC), fencYuv->getCStride(),<br>
> cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());<br>
> - singleCostV = m_rdCost->calcPsyRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section], psyEnergyV);<br>
> + singleCostV = m_rdCost->calcPsyRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section], nonZeroPsyEnergyV);<br>
> }<br>
> else<br>
> singleCostV = m_rdCost->calcRdCost(nonZeroDistV, singleBitsComp[TEXT_CHROMA_V][tuIterator.m_section]);<br>
> @@ -3771,7 +3791,7 @@<br>
> else<br>
> {<br>
> singleDistComp[TEXT_CHROMA_V][tuIterator.m_section] = nonZeroDistV;<br>
> - singlePsyEnergyComp[TEXT_CHROMA_V][tuIterator.m_section] = psyEnergyV;<br>
> + singlePsyEnergyComp[TEXT_CHROMA_V][tuIterator.m_section] = nonZeroPsyEnergyV;<br>
> absSum[TEXT_CHROMA_V][tuIterator.m_section] = absSumTransformSkipV;<br>
> bestTransformMode[TEXT_CHROMA_V][tuIterator.m_section] = 1;<br>
> }<br>
</div></div>> _______________________________________________<br>
> x265-devel mailing list<br>
> <a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
> <a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Steve Borho<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</font></span></blockquote></div><br></div>