<div dir="ltr">all zeropel changes are ok.<div>but </div><div>g_convertToBit[trSize] and log2TrSize - 2 return same value. so I dont think these change is required</div><div><br></div><div>Regards</div><div>Sumalatha</div>
<div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 11, 2014 at 10:03 AM, Satoshi Nakagawa <span dir="ltr"><<a href="mailto:nakagawa424@oki.com" target="_blank">nakagawa424@oki.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User Satoshi Nakagawa <<a href="mailto:nakagawa424@oki.com">nakagawa424@oki.com</a>><br>
# Date 1405052989 -32400<br>
# Fri Jul 11 13:29:49 2014 +0900<br>
# Node ID 18a6ee92620f1f7266dfbeff3b9010aae356d796<br>
# Parent e3e077965c39a56a24e09189652e1de3c5a0e3ea<br>
zero stride for zeroPel[]<br>
<br>
diff -r e3e077965c39 -r 18a6ee92620f source/Lib/TLibEncoder/TEncSearch.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 19:29:46 2014 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Fri Jul 11 13:29:49 2014 +0900<br>
@@ -47,7 +47,7 @@<br>
<br>
using namespace x265;<br>
<br>
-ALIGN_VAR_32(const pixel, RDCost::zeroPel[MAX_CU_SIZE * MAX_CU_SIZE]) = { 0 };<br>
+ALIGN_VAR_32(const pixel, RDCost::zeroPel[MAX_CU_SIZE]) = { 0 };<br>
<br>
TEncSearch::TEncSearch()<br>
{<br>
@@ -2404,7 +2404,7 @@<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>
+ (pixel*)RDCost::zeroPel, 0); // need to check whether zero distortion is similar to psyenergy of fenc<br>
zeroCost = m_rdCost->calcPsyRdCost(zeroDistortion, zeroResiBits, zeroPsyEnergyY);<br>
}<br>
else<br>
@@ -2813,13 +2813,13 @@<br>
}<br>
<br>
int partSize = partitionFromSize(trSize);<br>
- uint32_t distY = primitives.sse_sp[partSize](resiYuv->getLumaAddr(absPartIdx), resiYuv->m_width, (pixel*)RDCost::zeroPel, trSize);<br>
+ uint32_t distY = primitives.sse_sp[partSize](resiYuv->getLumaAddr(absPartIdx), resiYuv->m_width, (pixel*)RDCost::zeroPel, 0);<br>
uint32_t psyEnergyY = 0;<br>
if (m_rdCost->psyRdEnabled())<br>
{<br>
- int size = g_convertToBit[trSize];<br>
+ int size = log2TrSize - 2;<br>
psyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),<br>
- (pixel*)RDCost::zeroPel, trSize); // need to check whether zero distortion is similar to psyenergy of fenc<br>
+ (pixel*)RDCost::zeroPel, 0); // need to check whether zero distortion is similar to psyenergy of fenc<br>
}<br>
int16_t *curResiY = m_qtTempShortYuv[qtLayer].getLumaAddr(absPartIdx);<br>
X265_CHECK(m_qtTempShortYuv[qtLayer].m_width == MAX_CU_SIZE, "width not full CU\n");<br>
@@ -2845,7 +2845,7 @@<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>
+ int size = log2TrSize - 2;<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>
@@ -2922,12 +2922,10 @@<br>
int16_t *curResiU = m_qtTempShortYuv[qtLayer].getCbAddr(absPartIdxC);<br>
int16_t *curResiV = m_qtTempShortYuv[qtLayer].getCrAddr(absPartIdxC);<br>
<br>
- distU = m_rdCost->scaleChromaDistCb(primitives.sse_sp[partSizeC](resiYuv->getCbAddr(absPartIdxC), resiYuv->m_cwidth, (pixel*)RDCost::zeroPel, trSizeC));<br>
-<br>
+ distU = m_rdCost->scaleChromaDistCb(primitives.sse_sp[partSizeC](resiYuv->getCbAddr(absPartIdxC), resiYuv->m_cwidth, (pixel*)RDCost::zeroPel, 0));<br>
if (outZeroDist)<br>
- {<br>
*outZeroDist += distU;<br>
- }<br>
+<br>
if (numSigU[tuIterator.section])<br>
{<br>
int curChromaQpOffset = cu->getSlice()->getPPS()->getChromaCbQpOffset() + cu->getSlice()->getSliceQpDeltaCb();<br>
@@ -2938,7 +2936,6 @@<br>
curResiU, strideResiC);<br>
const uint32_t nonZeroDistU = m_rdCost->scaleChromaDistCb(dist);<br>
uint32_t nonZeroPsyEnergyU = 0;<br>
-<br>
if (m_rdCost->psyRdEnabled())<br>
{<br>
pixel* pred = predYuv->getCbAddr(absPartIdxC);<br>
@@ -2948,7 +2945,7 @@<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>
+ int size = log2TrSizeC - 2;<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>
@@ -3007,7 +3004,7 @@<br>
if (!numSigU[tuIterator.section])<br>
primitives.blockfill_s[sizeIdxC](curResiU, strideResiC, 0);<br>
<br>
- distV = m_rdCost->scaleChromaDistCr(primitives.sse_sp[partSizeC](resiYuv->getCrAddr(absPartIdxC), resiYuv->m_cwidth, (pixel*)RDCost::zeroPel, trSizeC));<br>
+ distV = m_rdCost->scaleChromaDistCr(primitives.sse_sp[partSizeC](resiYuv->getCrAddr(absPartIdxC), resiYuv->m_cwidth, (pixel*)RDCost::zeroPel, 0));<br>
if (outZeroDist)<br>
*outZeroDist += distV;<br>
<br>
@@ -3021,7 +3018,6 @@<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>
pixel* pred = predYuv->getCrAddr(absPartIdxC);<br>
@@ -3031,7 +3027,7 @@<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>
+ int size = log2TrSizeC - 2;<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>
@@ -3139,7 +3135,7 @@<br>
uint32_t stride = fencYuv->getStride();<br>
//===== reconstruction =====<br>
primitives.luma_add_ps[partSize](reconIPred, reconIPredStride, pred, tsResiY, stride, trSize);<br>
- int size = g_convertToBit[trSize];<br>
+ int size = log2TrSize - 2;<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, nonZeroPsyEnergyY);<br>
@@ -3232,7 +3228,7 @@<br>
uint32_t stride = fencYuv->getCStride();<br>
//===== reconstruction =====<br>
primitives.luma_add_ps[partSizeC](reconIPred, reconIPredStride, pred, tsResiU, stride, trSizeC);<br>
- int size = g_convertToBit[trSizeC];<br>
+ int size = log2TrSizeC - 2;<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.section], nonZeroPsyEnergyU);<br>
@@ -3275,7 +3271,7 @@<br>
uint32_t stride = fencYuv->getCStride();<br>
//===== reconstruction =====<br>
primitives.luma_add_ps[partSizeC](reconIPred, reconIPredStride, pred, tsResiV, stride, trSizeC);<br>
- int size = g_convertToBit[trSizeC];<br>
+ int size = log2TrSizeC - 2;<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.section], nonZeroPsyEnergyV);<br>
diff -r e3e077965c39 -r 18a6ee92620f source/encoder/rdcost.h<br>
--- a/source/encoder/rdcost.h Thu Jul 10 19:29:46 2014 -0500<br>
+++ b/source/encoder/rdcost.h Fri Jul 11 13:29:49 2014 +0900<br>
@@ -45,7 +45,7 @@<br>
<br>
public:<br>
<br>
- static const pixel zeroPel[MAX_CU_SIZE * MAX_CU_SIZE];<br>
+ static const pixel zeroPel[MAX_CU_SIZE];<br>
<br>
void setLambda(double lambda2, double lambda)<br>
{<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>
</blockquote></div><br></div></div></div>