<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 11, 2013 at 1:37 AM, <span dir="ltr"><<a href="mailto:gopu@multicorewareinc.com" target="_blank">gopu@multicorewareinc.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 ggopu<br>
# Date 1373524666 -19800<br>
# Node ID aae6cfa2114929d0ebb59b1bd55c3231de664358<br>
# Parent 2245a4a8b34da61d4d572b40f10024a4f1013030<br>
TEncSlice : Removed Unused Functions, variables and Removed Hungarian Notations<br></blockquote><div><br></div><div style>I'm not going to push this one, please resolve the problems I've noted below and then resubmit a new patch from the current tip.</div>
<div> </div><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">
<br>
diff -r 2245a4a8b34d -r aae6cfa21149 source/Lib/TLibEncoder/TEncGOP.cpp<br>
--- a/source/Lib/TLibEncoder/TEncGOP.cpp Wed Jul 10 22:28:41 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncGOP.cpp Thu Jul 11 12:07:46 2013 +0530<br>
@@ -459,7 +459,6 @@<br>
}<br>
<br>
// Slice data initialization<br>
- sliceEncoder->setSliceIdx(0);<br>
slice = sliceEncoder->initEncSlice(pic, frameEncoder, gopSize <= 1, pocLast, pocCurr, gopIdx, &m_cSPS, &m_cPPS);<br>
slice->setLastIDR(m_iLastIDR);<br>
<br>
@@ -1088,7 +1087,6 @@<br>
}<br>
<br>
slice->setNextSlice(false);<br>
- sliceEncoder->setSliceIdx(0);<br>
<br>
// Reconstruction slice<br>
slice->setNextSlice(true);<br>
diff -r 2245a4a8b34d -r aae6cfa21149 source/Lib/TLibEncoder/TEncSlice.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSlice.cpp Wed Jul 10 22:28:41 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncSlice.cpp Thu Jul 11 12:07:46 2013 +0530<br>
@@ -59,21 +59,6 @@<br>
<br>
TEncSlice::~TEncSlice()<br>
{<br>
- for (std::vector<TEncSbac*>::iterator i = CTXMem.begin(); i != CTXMem.end(); i++)<br>
- {<br>
- delete (*i);<br>
- }<br>
-}<br>
-<br>
-Void TEncSlice::initCtxMem(UInt i)<br>
-{<br>
- for (std::vector<TEncSbac*>::iterator j = CTXMem.begin(); j != CTXMem.end(); j++)<br>
- {<br>
- delete (*j);<br>
- }<br>
-<br>
- CTXMem.clear();<br>
- CTXMem.resize(i);<br>
}<br>
<br></blockquote><div><br></div><div style>Yeah, good, I forgot to finish cleaning those up</div><div> </div><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">
Void TEncSlice::create(Int width, Int height, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth)<br>
@@ -105,8 +90,8 @@<br>
*/<br>
TComSlice* TEncSlice::initEncSlice(TComPic* pcPic, x265::FrameEncoder *pcEncodeFrame, Bool bForceISlice, Int pocLast, Int pocCurr, Int iGOPid, TComSPS* pSPS, TComPPS *pPPS)<br>
{<br>
- Double dQP;<br>
- Double dLambda;<br>
+ Double QP;<br>
+ Double Lambda;<br></blockquote><div><br></div><div style>lower case lambda. this is a rare function that actually has the same variable with two type, and so you must differentiate them in a way that doesn't use hungarian notation. Since the rest of the encoder deals with QP as an integer, it's best to change iQP to qp, and dQP to qpDouble.</div>
<div> </div><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">
TComSlice* pcSlice = pcPic->getSlice();<br>
pcSlice->setSPS(pSPS);<br>
@@ -148,10 +133,8 @@<br>
<br>
// slice type<br>
SliceType eSliceType;<br></blockquote><div><br></div><div style>eSliceType is hungarian, it should be sliceType. Why remove the white-space below?</div><div> </div><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">
-<br>
eSliceType = B_SLICE;<br>
eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || bForceISlice) ? I_SLICE : eSliceType;<br>
-<br>
pcSlice->setSliceType(eSliceType);<br>
<br>
// ------------------------------------------------------------------------------------------------------------------<br>
@@ -172,12 +155,12 @@<br>
// QP setting<br>
// ------------------------------------------------------------------------------------------------------------------<br>
<br>
- dQP = m_pcCfg->getQP();<br>
+ QP = m_pcCfg->getQP();<br>
if (eSliceType != I_SLICE)<br>
{<br>
- if (!((dQP == -pcSlice->getSPS()->getQpBDOffsetY()) && (pcSlice->getSPS()->getUseLossless())))<br>
+ if (!((QP == -pcSlice->getSPS()->getQpBDOffsetY()) && (pcSlice->getSPS()->getUseLossless())))<br>
{<br>
- dQP += m_pcCfg->getGOPEntry(iGOPid).m_QPOffset;<br>
+ QP += m_pcCfg->getGOPEntry(iGOPid).m_QPOffset;<br>
}<br>
}<br>
<br>
@@ -185,57 +168,41 @@<br>
Int* pdQPs = m_pcCfg->getdQPs();<br>
if (pdQPs)<br>
{<br>
- dQP += pdQPs[pcSlice->getPOC()];<br>
+ QP += pdQPs[pcSlice->getPOC()];<br>
}<br>
<br>
// ------------------------------------------------------------------------------------------------------------------<br>
// Lambda computation<br>
// ------------------------------------------------------------------------------------------------------------------<br>
<br>
- Int iQP;<br></blockquote><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">-<br>
- // compute lambda value<br>
Int NumberBFrames = (m_pcCfg->getGOPSize() - 1);<br>
Int SHIFT_QP = 12;<br>
+ Int iQP;<br>
Double dLambda_scale = 1.0 - Clip3(0.0, 0.5, 0.05 * (Double)NumberBFrames);<br>
#if FULL_NBIT<br>
Int bitdepth_luma_qp_scale = 6 * (g_bitDepth - 8);<br>
#else<br>
Int bitdepth_luma_qp_scale = 0;<br>
#endif<br>
- Double qp_temp = (Double)dQP + bitdepth_luma_qp_scale - SHIFT_QP;<br>
+ Double qp_temp = (Double)QP + bitdepth_luma_qp_scale - SHIFT_QP;<br>
#if FULL_NBIT<br>
Double qp_temp_orig = (Double)dQP - SHIFT_QP;<br>
#endif<br>
// Case #1: I or P-slices (key-frame)<br>
- Double dQPFactor = m_pcCfg->getGOPEntry(iGOPid).m_QPFactor;<br>
+ Double QPFactor = m_pcCfg->getGOPEntry(iGOPid).m_QPFactor;<br></blockquote><div><br></div><div style>qpFactor</div><div> </div><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">
if (eSliceType == I_SLICE)<br>
{<br>
- dQPFactor = 0.57 * dLambda_scale;<br>
+ QPFactor = 0.57 * dLambda_scale;<br></blockquote><div><br></div><div style>lambdaScale, qpFactor</div><div> </div><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">
}<br>
- dLambda = dQPFactor * pow(2.0, qp_temp / 3.0);<br>
+ Lambda = QPFactor * pow(2.0, qp_temp / 3.0);<br></blockquote><div><br></div><div><br></div><div style>The below was a very useful comment, because the code had a very unexpected side-effect. It is better to leave this in place.</div>
<div> </div><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">
-#if 0<br>
- // SJB - This logic causes the HM to use different lambdas for the same QP between the first<br>
- // and later GOPs because the cadence changes (the very first I frame is handled specially, throwing<br>
- // off the sequence).<br>
- if (depth > 0)<br>
- {<br>
-#if FULL_NBIT<br>
- dLambda *= Clip3(2.00, 4.00, (qp_temp_orig / 6.0)); // (j == B_SLICE && p_cur_frm->layer != 0 )<br>
-#else<br>
- dLambda *= Clip3(2.00, 4.00, (qp_temp / 6.0)); // (j == B_SLICE && p_cur_frm->layer != 0 )<br>
-#endif<br>
- }<br>
-#else<br>
- if (pcSlice->getSliceType() != I_SLICE) dLambda *= 1.55;<br>
-#endif<br>
+ if (pcSlice->getSliceType() != I_SLICE) Lambda *= 1.55;<br>
<br>
- iQP = max(-pSPS->getQpBDOffsetY(), min(MAX_QP, (Int)floor(dQP + 0.5)));<br>
+ iQP = max(-pSPS->getQpBDOffsetY(), min(MAX_QP, (Int)floor(QP + 0.5)));<br>
<br>
if (pcSlice->getSliceType() != I_SLICE)<br>
{<br>
- dLambda *= m_pcCfg->getLambdaModifier(m_pcCfg->getGOPEntry(iGOPid).m_temporalId);<br>
+ Lambda *= m_pcCfg->getLambdaModifier(m_pcCfg->getGOPEntry(iGOPid).m_temporalId);<br>
}<br>
<br>
// for RDO<br>
@@ -255,10 +222,10 @@<br>
pcEncodeFrame->setCrDistortionWeight(weight);<br>
<br>
// for RDOQ<br>
- pcEncodeFrame->setQPLambda(iQP, dLambda, dLambda / weight);<br>
+ pcEncodeFrame->setQPLambda(iQP, Lambda, Lambda / weight);<br>
<br>
// For SAO<br>
- pcSlice->setLambda(dLambda, dLambda / weight);<br>
+ pcSlice->setLambda(Lambda, Lambda / weight);<br>
<br>
#if HB_LAMBDA_FOR_LDC<br>
// restore original slice type<br>
@@ -269,8 +236,8 @@<br>
<br>
if (m_pcCfg->getUseRecalculateQPAccordingToLambda())<br>
{<br>
- dQP = xGetQPValueAccordingToLambda(dLambda);<br>
- iQP = max(-pSPS->getQpBDOffsetY(), min(MAX_QP, (Int)floor(dQP + 0.5)));<br></blockquote><div><br></div><div style>No magic numbers here. this is not an improvement. getUseRecalculateQPAccordingToLambda() should probably just get removed.</div>
<div> </div><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">
+ QP = 4.2005 * log(Lambda) + 13.7122;<br>
+ iQP = max(-pSPS->getQpBDOffsetY(), min(MAX_QP, (Int)floor(QP + 0.5)));<br>
}<br>
<br>
pcSlice->setSliceQp(iQP);<br>
@@ -314,16 +281,15 @@<br>
}<br>
<br>
pcSlice->setDepth(depth);<br>
-<br>
pcPic->setTLayer(m_pcCfg->getGOPEntry(iGOPid).m_temporalId);<br>
if (eSliceType == I_SLICE)<br>
{<br>
pcPic->setTLayer(0);<br>
}<br>
pcSlice->setTLayer(pcPic->getTLayer());<br>
-<br>
pcSlice->setMaxNumMergeCand(m_pcCfg->getMaxNumMergeCand());<br>
xStoreWPparam(pPPS->getUseWP(), pPPS->getWPBiPred());<br>
+<br>
return pcSlice;<br>
}<br>
<br>
@@ -364,21 +330,21 @@<br>
<br>
Void TEncSlice::setSearchRange(TComSlice* pcSlice, FrameEncoder *pcEncodeframe)<br>
{<br>
- Int iCurrPOC = pcSlice->getPOC();<br>
- Int iGOPSize = m_pcCfg->getGOPSize();<br>
- Int iOffset = (iGOPSize >> 1);<br>
- Int iMaxSR = m_pcCfg->getSearchRange();<br>
- Int iNumPredDir = pcSlice->isInterP() ? 1 : 2;<br>
+ Int CurrPOC = pcSlice->getPOC();<br>
+ Int GOPSize = m_pcCfg->getGOPSize();<br>
+ Int Offset = (GOPSize >> 1);<br>
+ Int MaxSR = m_pcCfg->getSearchRange();<br>
+ Int NumPredDir = pcSlice->isInterP() ? 1 : 2;<br></blockquote><div><br></div><div style>curPOC, gopSize, offset, maxSR, numPredDir</div><div><br></div><div style>variables must start with lower case letters. UpperCase is reserved for classes. I'm not going to comment on the rest of them in this patch.</div>
<div style> </div><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">
- for (Int iDir = 0; iDir <= iNumPredDir; iDir++)<br>
+ for (Int Dir = 0; Dir <= NumPredDir; Dir++)<br>
{<br>
- RefPicList e = (iDir ? REF_PIC_LIST_1 : REF_PIC_LIST_0);<br>
- for (Int iRefIdx = 0; iRefIdx < pcSlice->getNumRefIdx(e); iRefIdx++)<br>
+ RefPicList e = (Dir ? REF_PIC_LIST_1 : REF_PIC_LIST_0);<br>
+ for (Int RefIdx = 0; RefIdx < pcSlice->getNumRefIdx(e); RefIdx++)<br>
{<br>
- Int iRefPOC = pcSlice->getRefPic(e, iRefIdx)->getPOC();<br>
- Int iNewSR = Clip3(8, iMaxSR, (iMaxSR * ADAPT_SR_SCALE * abs(iCurrPOC - iRefPOC) + iOffset) / iGOPSize);<br>
+ Int RefPOC = pcSlice->getRefPic(e, RefIdx)->getPOC();<br>
+ Int NewSR = Clip3(8, MaxSR, (MaxSR * ADAPT_SR_SCALE * abs(CurrPOC - RefPOC) + Offset) / GOPSize);<br>
<br>
- pcEncodeframe->setAdaptiveSearchRange(iDir, iRefIdx, iNewSR);<br>
+ pcEncodeframe->setAdaptiveSearchRange(Dir, RefIdx, NewSR);<br>
}<br>
}<br>
}<br>
@@ -449,24 +415,15 @@<br>
{<br>
// TODO: fix this option<br>
assert(0);<br>
-#if 0<br>
- m_pcTrQuant->clearSliceARLCnt();<br>
- if (pcSlice->getSliceType() != I_SLICE)<br>
- {<br>
- Int qpBase = pcSlice->getSliceQpBase();<br>
- pcSlice->setSliceQp(qpBase + m_pcTrQuant->getQpDelta(qpBase));<br>
- }<br>
-#endif<br></blockquote><div><br></div><div style>This should be left in place until all of the HM's adaptive QP is removed</div><div> </div><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">
}<br>
-<br>
pcEncodeFrame->encode(pcPic, pcSlice);<br>
<br>
if (m_pcCfg->getWaveFrontsynchro())<br>
{<br>
pcSlice->setNextSlice(true);<br>
}<br>
+ xRestoreWPparam(pcSlice);<br>
<br>
- xRestoreWPparam(pcSlice);<br>
#if CU_STAT_LOGFILE<br>
if (pcSlice->getSliceType() == P_SLICE)<br>
{<br>
@@ -496,9 +453,9 @@<br>
Void TEncSlice::encodeSlice(TComPic* pcPic, TComOutputBitstream* pcSubstreams, FrameEncoder* pcEncodeFrame)<br>
{<br>
PPAScopeEvent(TEncSlice_encodeSlice);<br>
- UInt uiCUAddr;<br>
- UInt uiStartCUAddr;<br>
- UInt uiBoundingCUAddr;<br>
+ UInt CUAddr;<br>
+ UInt StartCUAddr;<br>
+ UInt BoundingCUAddr;<br>
TComSlice* pcSlice = pcPic->getSlice();<br>
<br>
// choose entropy coder<br>
@@ -509,8 +466,8 @@<br>
pcEncodeFrame->getCuEncoder(0)->setBitCounter(NULL);<br>
pcEntropyCoder->setEntropyCoder(pcSbacCoder, pcSlice);<br>
<br>
- uiStartCUAddr = 0;<br>
- uiBoundingCUAddr = pcSlice->getSliceCurEndCUAddr();<br>
+ StartCUAddr = 0;<br>
+ BoundingCUAddr = pcSlice->getSliceCurEndCUAddr();<br>
<br>
// Appropriate substream bitstream is switched later.<br>
// for every CU<br>
@@ -525,47 +482,45 @@<br>
g_bJustDoIt = g_bEncDecTraceDisable;<br>
#endif<br>
<br>
- const Bool bWaveFrontsynchro = m_pcCfg->getWaveFrontsynchro();<br>
- const UInt uiHeightInLCUs = pcPic->getPicSym()->getFrameHeightInCU();<br>
- const Int iNumSubstreams = (bWaveFrontsynchro ? uiHeightInLCUs : 1);<br>
+ const Bool WaveFrontsynchro = m_pcCfg->getWaveFrontsynchro();<br>
+ const UInt HeightInLCUs = pcPic->getPicSym()->getFrameHeightInCU();<br>
+ const Int NumSubstreams = (WaveFrontsynchro ? HeightInLCUs : 1);<br>
UInt uiBitsOriginallyInSubstreams = 0;<br>
<br>
- for (Int iSubstrmIdx = 0; iSubstrmIdx < iNumSubstreams; iSubstrmIdx++)<br>
+ for (Int iSubstrmIdx = 0; iSubstrmIdx < NumSubstreams; iSubstrmIdx++)<br>
{<br>
- pcEncodeFrame->getBufferSBac(iSubstrmIdx)->loadContexts(pcSbacCoder); //init. state<br>
+ pcEncodeFrame->getBufferSBac(iSubstrmIdx)->loadContexts(pcSbacCoder);<br>
uiBitsOriginallyInSubstreams += pcSubstreams[iSubstrmIdx].getNumberOfWrittenBits();<br>
}<br>
<br>
- UInt uiWidthInLCUs = pcPic->getPicSym()->getFrameWidthInCU();<br>
- UInt uiCol = 0, uiLin = 0, uiSubStrm = 0;<br>
- uiCUAddr = (uiStartCUAddr / pcPic->getNumPartInCU()); /* for tiles, uiStartCUAddr is NOT the real raster scan address, it is actually<br>
+ UInt WidthInLCUs = pcPic->getPicSym()->getFrameWidthInCU();<br>
+ UInt Col = 0, Lin = 0, SubStrm = 0;<br>
+ CUAddr = (StartCUAddr / pcPic->getNumPartInCU()); /* for tiles, uiStartCUAddr is NOT the real raster scan address, it is actually<br>
an encoding order index, so we need to convert the index (uiStartCUAddr)<br>
into the real raster scan address (uiCUAddr) via the CUOrderMap */<br>
- UInt uiEncCUOrder;<br>
- for (uiEncCUOrder = uiStartCUAddr / pcPic->getNumPartInCU();<br>
- uiEncCUOrder < (uiBoundingCUAddr + pcPic->getNumPartInCU() - 1) / pcPic->getNumPartInCU();<br>
- uiCUAddr = (++uiEncCUOrder))<br>
+ for (UInt EncCUOrder = StartCUAddr / pcPic->getNumPartInCU();<br>
+ EncCUOrder < (BoundingCUAddr + pcPic->getNumPartInCU() - 1) / pcPic->getNumPartInCU();<br>
+ CUAddr = (++EncCUOrder))<br>
{<br>
- //UInt uiSliceStartLCU = pcSlice->getSliceCurStartCUAddr();<br>
- uiCol = uiCUAddr % uiWidthInLCUs;<br>
- uiLin = uiCUAddr / uiWidthInLCUs;<br>
- uiSubStrm = uiLin % iNumSubstreams;<br>
+ Col = CUAddr % WidthInLCUs;<br>
+ Lin = CUAddr / WidthInLCUs;<br>
+ SubStrm = Lin % NumSubstreams;<br>
<br>
- pcEntropyCoder->setBitstream(&pcSubstreams[uiSubStrm]);<br>
+ pcEntropyCoder->setBitstream(&pcSubstreams[SubStrm]);<br>
<br>
// Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line.<br>
- if ((iNumSubstreams > 1) && (uiCol == 0) && bWaveFrontsynchro)<br>
+ if ((NumSubstreams > 1) && (Col == 0) && WaveFrontsynchro)<br>
{<br>
// We'll sync if the TR is available.<br>
- TComDataCU *pcCUUp = pcPic->getCU(uiCUAddr)->getCUAbove();<br>
- UInt uiWidthInCU = pcPic->getFrameWidthInCU();<br>
- UInt uiMaxParts = 1 << (pcSlice->getSPS()->getMaxCUDepth() << 1);<br>
+ TComDataCU *pcCUUp = pcPic->getCU(CUAddr)->getCUAbove();<br>
+ UInt WidthInCU = pcPic->getFrameWidthInCU();<br>
+ UInt MaxParts = 1 << (pcSlice->getSPS()->getMaxCUDepth() << 1);<br>
TComDataCU *pcCUTR = NULL;<br>
<br>
// CHECK_ME: here can br optimize a little, do it later<br>
- if (pcCUUp && ((uiCUAddr % uiWidthInCU + 1) < uiWidthInCU))<br>
+ if (pcCUUp && ((CUAddr % WidthInCU + 1) < WidthInCU))<br>
{<br>
- pcCUTR = pcPic->getCU(uiCUAddr - uiWidthInCU + 1);<br>
+ pcCUTR = pcPic->getCU(CUAddr - WidthInCU + 1);<br>
}<br>
if (true /*bEnforceSliceRestriction*/ && ((pcCUTR == NULL) || (pcCUTR->getSlice() == NULL)))<br>
{<br>
@@ -574,25 +529,25 @@<br>
else<br>
{<br>
// TR is available, we use it.<br>
- pcEncodeFrame->getSbacCoder(uiSubStrm)->loadContexts(pcEncodeFrame->getBufferSBac(uiLin - 1));<br>
+ pcEncodeFrame->getSbacCoder(SubStrm)->loadContexts(pcEncodeFrame->getBufferSBac(Lin - 1));<br>
}<br>
}<br>
- pcSbacCoder->load(pcEncodeFrame->getSbacCoder(uiSubStrm)); //this load is used to simplify the code (avoid to change all the call to m_pcSbacCoder)<br>
+ pcSbacCoder->load(pcEncodeFrame->getSbacCoder(SubStrm)); //this load is used to simplify the code (avoid to change all the call to m_pcSbacCoder)<br>
<br>
- TComDataCU* cu = pcPic->getCU(uiCUAddr);<br>
+ TComDataCU* cu = pcPic->getCU(CUAddr);<br>
if (pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag() || pcSlice->getSaoEnabledFlagChroma()))<br>
{<br>
SAOParam *saoParam = pcSlice->getPic()->getPicSym()->getSaoParam();<br>
- Int iNumCuInWidth = saoParam->numCuInWidth;<br>
- Int iCUAddrInSlice = uiCUAddr;<br>
- Int iCUAddrUpInSlice = iCUAddrInSlice - iNumCuInWidth;<br>
- Int rx = uiCUAddr % iNumCuInWidth;<br>
- Int ry = uiCUAddr / iNumCuInWidth;<br>
+ Int NumCuInWidth = saoParam->numCuInWidth;<br>
+ Int CUAddrInSlice = CUAddr;<br>
+ Int CUAddrUpInSlice = CUAddrInSlice - NumCuInWidth;<br>
+ Int rx = CUAddr % NumCuInWidth;<br>
+ Int ry = CUAddr / NumCuInWidth;<br>
Int allowMergeLeft = 1;<br>
Int allowMergeUp = 1;<br>
Int addr = cu->getAddr();<br>
- allowMergeLeft = (rx > 0) && (iCUAddrInSlice != 0);<br>
- allowMergeUp = (ry > 0) && (iCUAddrUpInSlice >= 0);<br>
+ allowMergeLeft = (rx > 0) && (CUAddrInSlice != 0);<br>
+ allowMergeUp = (ry > 0) && (CUAddrUpInSlice >= 0);<br>
if (saoParam->bSaoFlag[0] || saoParam->bSaoFlag[1])<br>
{<br>
Int mergeLeft = saoParam->saoLcuParam[0][addr].mergeLeftFlag;<br>
@@ -657,21 +612,18 @@<br>
#if ENC_DEC_TRACE<br>
g_bJustDoIt = g_bEncDecTraceDisable;<br>
#endif<br>
- pcEncodeFrame->getSbacCoder(uiSubStrm)->load(pcSbacCoder); //load back status of the entropy coder after encoding the LCU into relevant bitstream entropy coder<br>
+ pcEncodeFrame->getSbacCoder(SubStrm)->load(pcSbacCoder); //load back status of the entropy coder after encoding the LCU into relevant bitstream entropy coder<br>
<br>
// Store probabilities of second LCU in line into buffer<br>
- if ((iNumSubstreams > 1) && (uiCol == 1) && bWaveFrontsynchro)<br>
+ if ((NumSubstreams > 1) && (Col == 1) && WaveFrontsynchro)<br>
{<br>
- pcEncodeFrame->getBufferSBac(uiLin)->loadContexts(pcEncodeFrame->getSbacCoder(uiSubStrm));<br>
+ pcEncodeFrame->getBufferSBac(Lin)->loadContexts(pcEncodeFrame->getSbacCoder(SubStrm));<br>
}<br>
}<br>
<br>
if (m_pcCfg->getUseAdaptQpSelect())<br>
{<br>
assert(0);<br>
-#if 0<br>
- m_pcTrQuant->storeSliceQpNext(pcSlice);<br>
-#endif<br></blockquote><div><br></div><div style>Ditto here, leave it in place until getUseAdaptQpSelect() is removed entirely</div><div> </div><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">
}<br>
if (pcSlice->getPPS()->getCabacInitPresentFlag())<br>
{<br>
@@ -683,19 +635,17 @@<br>
* \param bEncodeSlice Identifies if the calling function is compressSlice() [false] or encodeSlice() [true]<br>
* \returns Updates uiStartCUAddr, uiBoundingCUAddr with appropriate LCU address<br>
*/<br>
-Void TEncSlice::xDetermineStartAndBoundingCUAddr(TComPic* rpcPic, Bool bEncodeSlice)<br>
+Void TEncSlice::xDetermineStartAndBoundingCUAddr(TComPic* rpcPic, Bool EncodeSlice)<br>
{<br>
TComSlice* pcSlice = rpcPic->getSlice();<br>
- UInt uiBoundingCUAddrSlice;<br>
-<br>
- UInt uiNumberOfCUsInFrame = rpcPic->getNumCUsInFrame();<br>
-<br>
- uiBoundingCUAddrSlice = uiNumberOfCUsInFrame * rpcPic->getNumPartInCU();<br>
+ UInt BoundingCUAddrSlice;<br>
+ UInt NumberOfCUsInFrame = rpcPic->getNumCUsInFrame();<br>
+ BoundingCUAddrSlice = NumberOfCUsInFrame * rpcPic->getNumPartInCU();<br>
<br>
// WPP: if a slice does not start at the beginning of a CTB row, it must end within the same CTB row<br>
- pcSlice->setSliceCurEndCUAddr(uiBoundingCUAddrSlice);<br>
+ pcSlice->setSliceCurEndCUAddr(BoundingCUAddrSlice);<br>
<br>
- if (!bEncodeSlice)<br>
+ if (!EncodeSlice)<br>
{<br>
// For fixed number of LCU within an entropy and reconstruction slice we already know whether we will encounter end of entropy and/or reconstruction slice<br>
// first. Set the flags accordingly.<br>
@@ -703,9 +653,4 @@<br>
}<br>
}<br>
<br>
-Double TEncSlice::xGetQPValueAccordingToLambda(Double lambda)<br>
-{<br>
- return 4.2005 * log(lambda) + 13.7122;<br>
-}<br>
-<br>
//! \}<br>
diff -r 2245a4a8b34d -r aae6cfa21149 source/Lib/TLibEncoder/TEncSlice.h<br>
--- a/source/Lib/TLibEncoder/TEncSlice.h Wed Jul 10 22:28:41 2013 -0500<br>
+++ b/source/Lib/TLibEncoder/TEncSlice.h Thu Jul 11 12:07:46 2013 +0530<br>
@@ -47,9 +47,6 @@<br>
#include "WeightPredAnalysis.h"<br>
#include "TEncRateCtrl.h"<br>
<br>
-//! \ingroup TLibEncoder<br>
-//! \{<br>
-<br>
class TEncTop;<br>
class TEncGOP;<br>
<br>
@@ -63,14 +60,10 @@<br>
class TEncSlice : public WeightPredAnalysis<br>
{<br>
private:<br>
-<br>
// encoder configuration<br>
TEncCfg* m_pcCfg; ///< encoder configuration class<br>
- UInt m_uiSliceIdx;<br>
- std::vector<TEncSbac*> CTXMem;<br>
<br>
public:<br>
-<br>
TEncSlice();<br>
virtual ~TEncSlice();<br>
<br>
@@ -80,29 +73,15 @@<br>
<br>
/// preparation of slice encoding (reference marking, QP and lambda)<br>
TComSlice *initEncSlice(TComPic* pcPic, x265::FrameEncoder *pcEncodeFrame, Bool bForceISlice, Int pocLast, Int pocCurr, Int iGOPid, TComSPS* pSPS, TComPPS *pPPS);<br>
-<br>
Void resetQP(TComPic* pic, x265::FrameEncoder *pcEncodeFrame, Int sliceQP, Double lambda);<br>
<br>
// compress and encode slice<br>
Void compressSlice(TComPic* pcPic, x265::FrameEncoder* pcEncodeFrame); ///< analysis stage of slice<br>
-<br>
Void encodeSlice(TComPic* rpcPic, TComOutputBitstream* pcSubstreams, x265::FrameEncoder* pcEncodeFrame);<br>
<br>
// misc. functions<br>
Void setSearchRange(TComSlice* pcSlice, x265::FrameEncoder *pcEncodeframe); ///< set ME range adaptively<br>
-<br>
Void xDetermineStartAndBoundingCUAddr(TComPic* rpcPic, Bool bEncodeSlice);<br>
-<br>
- UInt getSliceIdx() { return m_uiSliceIdx; }<br>
-<br>
- Void setSliceIdx(UInt i) { m_uiSliceIdx = i; }<br>
-<br>
- Void initCtxMem(UInt i);<br>
- Void setCtxMem(TEncSbac* sb, Int b) { CTXMem[b] = sb; }<br>
-<br>
-private:<br>
-<br>
- Double xGetQPValueAccordingToLambda(Double lambda);<br>
};<br>
<br>
//! \}<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>