<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 17, 2014 at 1:57 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Satoshi Nakagawa <<a href="mailto:nakagawa424@oki.com">nakagawa424@oki.com</a>><br>
# Date 1392623778 -32400<br>
# Mon Feb 17 16:56:18 2014 +0900<br>
# Node ID 3bd3525dc31fa93819deca8cd377d531206d00b2<br>
# Parent ce96cdb390fe26aee6effa731e51303c1d9056b0<br>
cleanup unused variables<br></blockquote><div><br></div><div>Queued</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r ce96cdb390fe -r 3bd3525dc31f source/Lib/TLibCommon/TComDataCU.cpp<br>
--- a/source/Lib/TLibCommon/TComDataCU.cpp Sun Feb 16 22:47:32 2014 -0600<br>
+++ b/source/Lib/TLibCommon/TComDataCU.cpp Mon Feb 17 16:56:18 2014 +0900<br>
@@ -920,7 +920,7 @@<br>
return NULL;<br>
}<br>
<br>
-TComDataCU* TComDataCU::getPUBelowLeftAdi(uint32_t& blPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset, bool bEnforceSliceRestriction)<br>
+TComDataCU* TComDataCU::getPUBelowLeftAdi(uint32_t& blPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset)<br>
{<br>
uint32_t absPartIdxLB = g_zscanToRaster[curPartUnitIdx];<br>
uint32_t absZorderCUIdxLB = g_zscanToRaster[m_absIdxInLCU] + ((m_height[0] / m_pic->getMinCUHeight()) - 1) * m_pic->getNumPartInWidth();<br>
@@ -954,7 +954,7 @@<br>
return NULL;<br>
}<br>
blPartUnitIdx = g_rasterToZscan[absPartIdxLB + (1 + partUnitOffset) * numPartInCUWidth - 1];<br>
- if ((bEnforceSliceRestriction && (m_cuLeft == NULL || m_cuLeft->getSlice() == NULL)))<br>
+ if (m_cuLeft == NULL || m_cuLeft->getSlice() == NULL)<br>
{<br>
return NULL;<br>
}<br>
@@ -965,7 +965,7 @@<br>
return NULL;<br>
}<br>
<br>
-TComDataCU* TComDataCU::getPUAboveRightAdi(uint32_t& arPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset, bool bEnforceSliceRestriction)<br>
+TComDataCU* TComDataCU::getPUAboveRightAdi(uint32_t& arPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset)<br>
{<br>
uint32_t absPartIdxRT = g_zscanToRaster[curPartUnitIdx];<br>
uint32_t absZorderCUIdx = g_zscanToRaster[m_absIdxInLCU] + (m_width[0] / m_pic->getMinCUWidth()) - 1;<br>
@@ -999,7 +999,7 @@<br>
return NULL;<br>
}<br>
arPartUnitIdx = g_rasterToZscan[absPartIdxRT + m_pic->getNumPartInCU() - numPartInCUWidth + partUnitOffset];<br>
- if ((bEnforceSliceRestriction && (m_cuAbove == NULL || m_cuAbove->getSlice() == NULL)))<br>
+ if (m_cuAbove == NULL || m_cuAbove->getSlice() == NULL)<br>
{<br>
return NULL;<br>
}<br>
@@ -1013,8 +1013,8 @@<br>
}<br>
<br>
arPartUnitIdx = g_rasterToZscan[m_pic->getNumPartInCU() - numPartInCUWidth + partUnitOffset - 1];<br>
- if ((bEnforceSliceRestriction && (m_cuAboveRight == NULL || m_cuAboveRight->getSlice() == NULL ||<br>
- (m_cuAboveRight->getAddr()) > getAddr())))<br>
+ if ((m_cuAboveRight == NULL || m_cuAboveRight->getSlice() == NULL ||<br>
+ (m_cuAboveRight->getAddr()) > getAddr()))<br>
{<br>
return NULL;<br>
}<br>
@@ -2460,18 +2460,9 @@<br>
}<br>
}<br>
<br>
-bool TComDataCU::isBipredRestriction(uint32_t puIdx)<br>
+bool TComDataCU::isBipredRestriction()<br>
{<br>
- int width = 0;<br>
- int height = 0;<br>
- uint32_t partAddr;<br>
-<br>
- getPartIndexAndSize(puIdx, partAddr, width, height);<br>
- if (getWidth(0) == 8 && (width < 8 || height < 8))<br>
- {<br>
- return true;<br>
- }<br>
- return false;<br>
+ return getWidth(0) == 8 && getPartitionSize(0) != SIZE_2Nx2N;<br>
}<br>
<br>
void TComDataCU::clipMv(MV& outMV)<br>
@@ -2505,11 +2496,6 @@<br>
return cnt > 6 ? 6 : cnt;<br>
}<br>
<br>
-void TComDataCU::clearCbf(uint32_t idx, TextType ttype, uint32_t numParts)<br>
-{<br>
- ::memset(&m_cbf[ttype][idx], 0, sizeof(UChar) * numParts);<br>
-}<br>
-<br>
/** Set a I_PCM flag for all sub-partitions of a partition.<br>
* \param bIpcmFlag I_PCM flag<br>
* \param absPartIdx partition index<br>
diff -r ce96cdb390fe -r 3bd3525dc31f source/Lib/TLibCommon/TComDataCU.h<br>
--- a/source/Lib/TLibCommon/TComDataCU.h Sun Feb 16 22:47:32 2014 -0600<br>
+++ b/source/Lib/TLibCommon/TComDataCU.h Mon Feb 17 16:56:18 2014 +0900<br>
@@ -312,7 +312,6 @@<br>
<br>
void setCbf(uint32_t idx, TextType ttype, UChar uh) { m_cbf[ttype][idx] = uh; }<br>
<br>
- void clearCbf(uint32_t idx, TextType ttype, uint32_t numParts);<br>
UChar getQtRootCbf(uint32_t idx) { return getCbf(idx, TEXT_LUMA, 0) || getCbf(idx, TEXT_CHROMA_U, 0) || getCbf(idx, TEXT_CHROMA_V, 0); }<br>
<br>
void setCbfSubParts(uint32_t cbfY, uint32_t cbfU, uint32_t cbfV, uint32_t absPartIdx, uint32_t depth);<br>
@@ -426,8 +425,8 @@<br>
TComDataCU* getQpMinCuAbove(uint32_t& aPartUnitIdx, uint32_t currAbsIdxInLCU);<br>
char getRefQP(uint32_t uiCurrAbsIdxInLCU);<br>
<br>
- TComDataCU* getPUAboveRightAdi(uint32_t& arPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset = 1, bool bEnforceSliceRestriction = true);<br>
- TComDataCU* getPUBelowLeftAdi(uint32_t& blPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset = 1, bool bEnforceSliceRestriction = true);<br>
+ TComDataCU* getPUAboveRightAdi(uint32_t& arPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset = 1);<br>
+ TComDataCU* getPUBelowLeftAdi(uint32_t& blPartUnitIdx, uint32_t curPartUnitIdx, uint32_t partUnitOffset = 1);<br>
<br>
void deriveLeftRightTopIdx(uint32_t partIdx, uint32_t& partIdxLT, uint32_t& partIdxRT);<br>
void deriveLeftBottomIdx(uint32_t partIdx, uint32_t& partIdxLB);<br>
@@ -447,7 +446,7 @@<br>
bool isIntra(uint32_t partIdx) { return m_predModes[partIdx] == MODE_INTRA; }<br>
<br>
bool isSkipped(uint32_t partIdx); ///< SKIP (no residual)<br>
- bool isBipredRestriction(uint32_t puIdx);<br>
+ bool isBipredRestriction();<br>
<br>
// -------------------------------------------------------------------------------------------------------------------<br>
// member functions for symbol prediction (most probable / mode conversion)<br>
diff -r ce96cdb390fe -r 3bd3525dc31f source/Lib/TLibEncoder/TEncCu.cpp<br>
--- a/source/Lib/TLibEncoder/TEncCu.cpp Sun Feb 16 22:47:32 2014 -0600<br>
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Mon Feb 17 16:56:18 2014 +0900<br>
@@ -534,14 +534,10 @@<br>
// get Original YUV data from picture<br>
m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outBestCU->getAddr(), outBestCU->getZorderIdxInCU());<br>
<br>
- // variables for fast encoder decision<br>
- bool bTrySplit = true;<br>
-<br>
// variable for Early CU determination<br>
bool bSubBranch = true;<br>
<br>
// variable for Cbf fast mode PU decision<br>
- bool bTrySplitDQP = true;<br>
bool bBoundary = false;<br>
<br>
uint32_t lpelx = outBestCU->getCUPelX();<br>
@@ -563,13 +559,8 @@<br>
//We need to split; so dont try these modes<br>
if (!bSliceEnd && bInsidePicture)<br>
{<br>
- // variables for fast encoder decision<br>
- bTrySplit = true;<br>
-<br>
outTempCU->initEstData(depth, qp);<br>
<br>
- bTrySplitDQP = bTrySplit;<br>
-<br>
xCheckRDCostIntra(outBestCU, outTempCU, SIZE_2Nx2N);<br>
outTempCU->initEstData(depth, qp);<br>
<br>
@@ -600,7 +591,7 @@<br>
outTempCU->initEstData(depth, qp);<br>
<br>
// further split<br>
- if (bSubBranch && bTrySplitDQP && depth < g_maxCUDepth - g_addCUDepth)<br>
+ if (bSubBranch && depth < g_maxCUDepth - g_addCUDepth)<br>
{<br>
for (; partUnitIdx < 4; partUnitIdx++)<br>
{<br>
@@ -695,9 +686,6 @@<br>
// get Original YUV data from picture<br>
m_origYuv[depth]->copyFromPicYuv(pic->getPicYuvOrg(), outBestCU->getAddr(), outBestCU->getZorderIdxInCU());<br>
<br>
- // variables for fast encoder decision<br>
- bool bTrySplit = true;<br>
-<br>
// variable for Early CU determination<br>
bool bSubBranch = true;<br>
<br>
@@ -705,8 +693,6 @@<br>
bool doNotBlockPu = true;<br>
bool earlyDetectionSkipMode = false;<br>
<br>
- bool bTrySplitDQP = true;<br>
-<br>
bool bBoundary = false;<br>
uint32_t lpelx = outBestCU->getCUPelX();<br>
uint32_t rpelx = lpelx + outBestCU->getWidth(0) - 1;<br>
@@ -725,9 +711,6 @@<br>
// We need to split, so don't try these modes.<br>
if (!bSliceEnd && bInsidePicture)<br>
{<br>
- // variables for fast encoder decision<br>
- bTrySplit = true;<br>
-<br>
outTempCU->initEstData(depth, qp);<br>
<br>
// do inter modes, SKIP and 2Nx2N<br>
@@ -756,8 +739,6 @@<br>
}<br>
}<br>
<br>
- bTrySplitDQP = bTrySplit;<br>
-<br>
if (!earlyDetectionSkipMode)<br>
{<br>
outTempCU->initEstData(depth, qp);<br>
@@ -946,7 +927,7 @@<br>
outTempCU->initEstData(depth, qp);<br>
<br>
// further split<br>
- if (bSubBranch && bTrySplitDQP && depth < g_maxCUDepth - g_addCUDepth)<br>
+ if (bSubBranch && depth < g_maxCUDepth - g_addCUDepth)<br>
{<br>
UChar nextDepth = depth + 1;<br>
TComDataCU* subBestPartCU = m_bestCU[nextDepth];<br>
diff -r ce96cdb390fe -r 3bd3525dc31f source/Lib/TLibEncoder/TEncSearch.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Sun Feb 16 22:47:32 2014 -0600<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Mon Feb 17 16:56:18 2014 +0900<br>
@@ -2503,7 +2503,7 @@<br>
{<br>
cu->getInterMergeCandidates(absPartIdx, puIdx, mvFieldNeighbours, interDirNeighbours, numValidMergeCand);<br>
}<br>
- xRestrictBipredMergeCand(cu, puIdx, mvFieldNeighbours, interDirNeighbours, numValidMergeCand);<br>
+ xRestrictBipredMergeCand(cu, mvFieldNeighbours, interDirNeighbours, numValidMergeCand);<br>
<br>
outCost = MAX_UINT;<br>
for (uint32_t mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand)<br>
@@ -2543,9 +2543,9 @@<br>
* \param numValidMergeCand<br>
* \returns void<br>
*/<br>
-void TEncSearch::xRestrictBipredMergeCand(TComDataCU* cu, uint32_t puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, int numValidMergeCand)<br>
+void TEncSearch::xRestrictBipredMergeCand(TComDataCU* cu, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, int numValidMergeCand)<br>
{<br>
- if (cu->isBipredRestriction(puIdx))<br>
+ if (cu->isBipredRestriction())<br>
{<br>
for (uint32_t mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand)<br>
{<br>
@@ -2680,7 +2680,7 @@<br>
}<br>
<br>
// Bi-directional prediction<br>
- if ((cu->getSlice()->isInterB()) && (cu->isBipredRestriction(partIdx) == false))<br>
+ if ((cu->getSlice()->isInterB()) && (cu->isBipredRestriction() == false))<br>
{<br>
mvBidir[0] = mv[0];<br>
mvBidir[1] = mv[1];<br>
@@ -3146,21 +3146,6 @@<br>
int qp, qpBest = 0;<br>
uint64_t cost, bcost = MAX_INT64;<br>
<br>
- uint32_t trLevel = 0;<br>
- if ((cu->getWidth(0) > cu->getSlice()->getSPS()->getMaxTrSize()))<br>
- {<br>
- while (cu->getWidth(0) > (cu->getSlice()->getSPS()->getMaxTrSize() << trLevel))<br>
- {<br>
- trLevel++;<br>
- }<br>
- }<br>
- uint32_t maxTrLevel = 1 + trLevel;<br>
-<br>
- while ((width >> maxTrLevel) < (g_maxCUWidth >> g_maxCUDepth))<br>
- {<br>
- maxTrLevel--;<br>
- }<br>
-<br>
qp = bHighPass ? Clip3(-cu->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, (int)cu->getQP(0)) : cu->getQP(0);<br>
<br>
outResiYuv->subtract(fencYuv, predYuv, 0, width);<br>
@@ -3205,8 +3190,7 @@<br>
<br>
bits = xSymbolBitsInter(cu);<br>
<br>
- uint64_t exactCost = m_rdCost->calcRdCost(distortion, bits);<br>
- cost = exactCost;<br>
+ cost = m_rdCost->calcRdCost(distortion, bits);<br>
<br>
if (cost < bcost)<br>
{<br>
diff -r ce96cdb390fe -r 3bd3525dc31f source/Lib/TLibEncoder/TEncSearch.h<br>
--- a/source/Lib/TLibEncoder/TEncSearch.h Sun Feb 16 22:47:32 2014 -0600<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.h Mon Feb 17 16:56:18 2014 +0900<br>
@@ -249,7 +249,7 @@<br>
TComMvField* pacMvField, uint32_t& mergeIndex, uint32_t& outCost, uint32_t& outbits,<br>
TComMvField* mvFieldNeighbors, UChar* interDirNeighbors, int& numValidMergeCand);<br>
<br>
- void xRestrictBipredMergeCand(TComDataCU* cu, uint32_t puIdx, TComMvField* mvFieldNeighbours,<br>
+ void xRestrictBipredMergeCand(TComDataCU* cu, TComMvField* mvFieldNeighbours,<br>
UChar* interDirNeighbours, int numValidMergeCand);<br>
<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><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>