<div dir="ltr">Not sure what the objective here is. Regardless of param->maxCUSize, we are always creating and managing data structures for the largest size (64). Ultrafast performance will reduce. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 22, 2014 at 10:11 AM, <span dir="ltr"><<a href="mailto:santhoshini@multicorewareinc.com" target="_blank">santhoshini@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""># HG changeset patch<br>
# User Santhoshini Sekar <<a href="mailto:santhoshini@multicorewareinc.com">santhoshini@multicorewareinc.com</a>><br>
</span># Date 1411360621 -19800<br>
# Mon Sep 22 10:07:01 2014 +0530<br>
# Node ID 37343a4ceced834aa89316c5307a6353fb546337<br>
# Parent 817abe294c8b3e60f88093841d208fbb96bf8403<br>
<span class="">remove getNumPartInCU() and replace it with macro<br>
<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/Lib/TLibCommon/TComDataCU.cpp<br>
--- a/source/Lib/TLibCommon/TComDataCU.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComDataCU.cpp Mon Sep 22 10:07:01 2014 +0530<br>
<div><div class="h5">@@ -320,7 +320,7 @@<br>
m_totalBits = 0;<br>
m_mvBits = 0;<br>
m_coeffBits = 0;<br>
- m_numPartitions = pic->getNumPartInCU();<br>
+ m_numPartitions = NUM_CU_PARTITIONS;<br>
char* qp = pic->getCU(getAddr())->getQP();<br>
m_baseQp = pic->getCU(getAddr())->m_baseQp;<br>
for (int i = 0; i < 4; i++)<br>
@@ -772,7 +772,7 @@<br>
if (planarAtLCUBoundary)<br>
return NULL;<br>
<br>
- aPartUnitIdx = g_rasterToZscan[absPartIdx + m_pic->getNumPartInCU() - numPartInCUSize];<br>
+ aPartUnitIdx = g_rasterToZscan[absPartIdx + NUM_CU_PARTITIONS - numPartInCUSize];<br>
return m_cuAbove;<br>
}<br>
<br>
@@ -797,7 +797,7 @@<br>
return this;<br>
}<br>
}<br>
- alPartUnitIdx = g_rasterToZscan[absPartIdx + m_pic->getNumPartInCU() - numPartInCUSize - 1];<br>
+ alPartUnitIdx = g_rasterToZscan[absPartIdx + NUM_CU_PARTITIONS - numPartInCUSize - 1];<br>
return m_cuAbove;<br>
}<br>
<br>
@@ -807,7 +807,7 @@<br>
return m_cuLeft;<br>
}<br>
<br>
- alPartUnitIdx = g_rasterToZscan[m_pic->getNumPartInCU() - 1];<br>
+ alPartUnitIdx = g_rasterToZscan[NUM_CU_PARTITIONS - 1];<br>
return m_cuAboveLeft;<br>
}<br>
<br>
@@ -839,7 +839,7 @@<br>
}<br>
return NULL;<br>
}<br>
- arPartUnitIdx = g_rasterToZscan[absPartIdxRT + m_pic->getNumPartInCU() - numPartInCUSize + 1];<br>
+ arPartUnitIdx = g_rasterToZscan[absPartIdxRT + NUM_CU_PARTITIONS - numPartInCUSize + 1];<br>
return m_cuAbove;<br>
}<br>
<br>
@@ -848,7 +848,7 @@<br>
return NULL;<br>
}<br>
<br>
- arPartUnitIdx = g_rasterToZscan[m_pic->getNumPartInCU() - numPartInCUSize];<br>
+ arPartUnitIdx = g_rasterToZscan[NUM_CU_PARTITIONS - numPartInCUSize];<br>
return m_cuAboveRight;<br>
}<br>
<br>
@@ -960,7 +960,7 @@<br>
}<br>
return NULL;<br>
}<br>
- arPartUnitIdx = g_rasterToZscan[absPartIdxRT + m_pic->getNumPartInCU() - numPartInCUSize + partUnitOffset];<br>
+ arPartUnitIdx = g_rasterToZscan[absPartIdxRT + NUM_CU_PARTITIONS - numPartInCUSize + partUnitOffset];<br>
if (m_cuAbove == NULL || m_cuAbove->m_slice == NULL)<br>
{<br>
return NULL;<br>
@@ -973,7 +973,7 @@<br>
return NULL;<br>
}<br>
<br>
- arPartUnitIdx = g_rasterToZscan[m_pic->getNumPartInCU() - numPartInCUSize + partUnitOffset - 1];<br>
+ arPartUnitIdx = g_rasterToZscan[NUM_CU_PARTITIONS - numPartInCUSize + partUnitOffset - 1];<br>
if ((m_cuAboveRight == NULL || m_cuAboveRight->m_slice == NULL ||<br>
(m_cuAboveRight->getAddr()) > getAddr()))<br>
{<br>
@@ -1074,7 +1074,7 @@<br>
else if (getAddr() > 0 && !(m_slice->m_pps->bEntropyCodingSyncEnabled &&<br>
getAddr() % m_pic->getFrameWidthInCU() == 0))<br>
{<br>
- return m_pic->getCU(getAddr() - 1)->getLastCodedQP(m_pic->getNumPartInCU());<br>
+ return m_pic->getCU(getAddr() - 1)->getLastCodedQP(NUM_CU_PARTITIONS);<br>
}<br>
else<br>
{<br>
@@ -1214,7 +1214,7 @@<br>
<br>
void TComDataCU::clearCbf(uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_cbf[0] + absPartIdx, 0, sizeof(uint8_t) * curPartNum);<br>
memset(m_cbf[1] + absPartIdx, 0, sizeof(uint8_t) * curPartNum);<br>
@@ -1223,7 +1223,7 @@<br>
<br>
void TComDataCU::setCbfSubParts(uint32_t cbf, TextType ttype, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_cbf[ttype] + absPartIdx, cbf, sizeof(uint8_t) * curPartNum);<br>
}<br>
@@ -1236,14 +1236,14 @@<br>
void TComDataCU::setDepthSubParts(uint32_t depth)<br>
{<br>
/*All 4x4 partitions in current CU have the CU depth saved*/<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_depth, depth, sizeof(uint8_t) * curPartNum);<br>
}<br>
<br>
bool TComDataCU::isFirstAbsZorderIdxInDepth(uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
return ((m_absIdxInLCU + absPartIdx) & (curPartNum - 1)) == 0;<br>
}<br>
@@ -1251,29 +1251,29 @@<br>
void TComDataCU::setPartSizeSubParts(PartSize mode, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
X265_CHECK(sizeof(*m_partSizes) == 1, "size check failure\n");<br>
- memset(m_partSizes + absPartIdx, mode, m_pic->getNumPartInCU() >> (depth << 1));<br>
+ memset(m_partSizes + absPartIdx, mode, NUM_CU_PARTITIONS >> (depth << 1));<br>
}<br>
<br>
void TComDataCU::setCUTransquantBypassSubParts(bool flag, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- memset(m_cuTransquantBypass + absPartIdx, flag, m_pic->getNumPartInCU() >> (depth << 1));<br>
+ memset(m_cuTransquantBypass + absPartIdx, flag, NUM_CU_PARTITIONS >> (depth << 1));<br>
}<br>
<br>
void TComDataCU::setSkipFlagSubParts(bool skip, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
X265_CHECK(sizeof(*m_skipFlag) == 1, "size check failure\n");<br>
- memset(m_skipFlag + absPartIdx, skip, m_pic->getNumPartInCU() >> (depth << 1));<br>
+ memset(m_skipFlag + absPartIdx, skip, NUM_CU_PARTITIONS >> (depth << 1));<br>
}<br>
<br>
void TComDataCU::setPredModeSubParts(PredMode eMode, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
X265_CHECK(sizeof(*m_predModes) == 1, "size check failure\n");<br>
- memset(m_predModes + absPartIdx, eMode, m_pic->getNumPartInCU() >> (depth << 1));<br>
+ memset(m_predModes + absPartIdx, eMode, NUM_CU_PARTITIONS >> (depth << 1));<br>
}<br>
<br>
void TComDataCU::setQPSubCUs(int qp, TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool &foundNonZeroCbf)<br>
{<br>
- uint32_t curPartNumb = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNumb = NUM_CU_PARTITIONS >> (depth << 1);<br>
uint32_t curPartNumQ = curPartNumb >> 2;<br>
<br>
if (!foundNonZeroCbf)<br>
@@ -1301,7 +1301,7 @@<br>
<br>
void TComDataCU::setQPSubParts(int qp, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
for (uint32_t scuIdx = absPartIdx; scuIdx < absPartIdx + curPartNum; scuIdx++)<br>
{<br>
@@ -1311,7 +1311,7 @@<br>
<br>
void TComDataCU::setLumaIntraDirSubParts(uint32_t dir, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_lumaIntraDir + absPartIdx, dir, sizeof(uint8_t) * curPartNum);<br>
}<br>
@@ -1321,7 +1321,7 @@<br>
{<br>
X265_CHECK(sizeof(T) == 1, "size check failure\n"); // Using memset() works only for types of size 1<br>
<br>
- uint32_t curPartNumQ = (m_pic->getNumPartInCU() >> (2 * cuDepth)) >> 2;<br>
+ uint32_t curPartNumQ = (NUM_CU_PARTITIONS >> (2 * cuDepth)) >> 2;<br>
switch (m_partSizes[cuAddr])<br>
{<br>
case SIZE_2Nx2N:<br>
@@ -1416,7 +1416,7 @@<br>
<br>
void TComDataCU::setChromIntraDirSubParts(uint32_t dir, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_chromaIntraDir + absPartIdx, dir, sizeof(uint8_t) * curPartNum);<br>
}<br>
@@ -1428,14 +1428,14 @@<br>
<br>
void TComDataCU::setTrIdxSubParts(uint32_t trIdx, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_trIdx + absPartIdx, trIdx, sizeof(uint8_t) * curPartNum);<br>
}<br>
<br>
void TComDataCU::setTransformSkipSubParts(uint32_t useTransformSkipY, uint32_t useTransformSkipU, uint32_t useTransformSkipV, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_transformSkip[0] + absPartIdx, useTransformSkipY, sizeof(uint8_t) * curPartNum);<br>
memset(m_transformSkip[1] + absPartIdx, useTransformSkipU, sizeof(uint8_t) * curPartNum);<br>
@@ -1444,7 +1444,7 @@<br>
<br>
void TComDataCU::setTransformSkipSubParts(uint32_t useTransformSkip, TextType ttype, uint32_t absPartIdx, uint32_t depth)<br>
{<br>
- uint32_t curPartNum = m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
memset(m_transformSkip[ttype] + absPartIdx, useTransformSkip, sizeof(uint8_t) * curPartNum);<br>
}<br>
</div></div>diff -r 817abe294c8b -r 37343a4ceced source/common/deblock.cpp<br>
--- a/source/common/deblock.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/common/deblock.cpp Mon Sep 22 10:07:01 2014 +0530<br>
<span class="">@@ -48,7 +48,7 @@<br>
return;<br>
<br>
Frame* pic = cu->m_pic;<br>
- uint32_t curNumParts = pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curNumParts = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
if (cu->getDepth(absZOrderIdx) > depth)<br>
{<br>
@@ -119,7 +119,7 @@<br>
{<br>
if (cu->getTransformIdx(absZOrderIdx) + cu->getDepth(absZOrderIdx) > (uint8_t)depth)<br>
{<br>
- const uint32_t curNumParts = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ const uint32_t curNumParts = NUM_CU_PARTITIONS >> (depth << 1);<br>
const uint32_t qNumParts = curNumParts >> 2;<br>
<br>
for (uint32_t partIdx = 0; partIdx < 4; partIdx++, absZOrderIdx += qNumParts)<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/common/frame.h<br>
--- a/source/common/frame.h Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/common/frame.h Mon Sep 22 10:07:01 2014 +0530<br>
<span class="">@@ -23,6 +23,7 @@<br>
<br>
#ifndef X265_FRAME_H<br>
#define X265_FRAME_H<br>
+#define NUM_CU_PARTITIONS 256<br>
<br>
#include "common.h"<br>
#include "TLibCommon/TComPicSym.h"<br>
@@ -117,8 +118,6 @@<br>
<br>
uint32_t getNumPartInCUSize() const { return m_picSym->getNumPartInCUSize(); }<br>
<br>
- uint32_t getNumPartInCU() const { return m_picSym->getNumPartition(); }<br>
-<br>
uint32_t getFrameWidthInCU() const { return m_picSym->getFrameWidthInCU(); }<br>
<br>
uint32_t getFrameHeightInCU() const { return m_picSym->getFrameHeightInCU(); }<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/common/slice.cpp<br>
--- a/source/common/slice.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/common/slice.cpp Mon Sep 22 10:07:01 2014 +0530<br>
<span class="">@@ -182,8 +182,8 @@<br>
uint32_t Slice::realEndAddress(uint32_t endCUAddr)<br>
{<br>
// Calculate end address<br>
- uint32_t internalAddress = (endCUAddr - 1) % m_pic->getNumPartInCU();<br>
- uint32_t externalAddress = (endCUAddr - 1) / m_pic->getNumPartInCU();<br>
+ uint32_t internalAddress = (endCUAddr - 1) % NUM_CU_PARTITIONS;<br>
+ uint32_t externalAddress = (endCUAddr - 1) / NUM_CU_PARTITIONS;<br>
uint32_t xmax = m_sps->picWidthInLumaSamples - (externalAddress % m_pic->getFrameWidthInCU()) * g_maxCUSize;<br>
uint32_t ymax = m_sps->picHeightInLumaSamples - (externalAddress / m_pic->getFrameWidthInCU()) * g_maxCUSize;<br>
<br>
@@ -191,13 +191,13 @@<br>
internalAddress--;<br>
<br>
internalAddress++;<br>
- if (internalAddress == m_pic->getNumPartInCU())<br>
+ if (internalAddress == NUM_CU_PARTITIONS)<br>
{<br>
internalAddress = 0;<br>
externalAddress++;<br>
}<br>
<br>
- return externalAddress * m_pic->getNumPartInCU() + internalAddress;<br>
+ return externalAddress * NUM_CU_PARTITIONS + internalAddress;<br>
}<br>
<br>
<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/encoder/analysis.cpp Mon Sep 22 10:07:01 2014 +0530<br>
@@ -2066,7 +2066,7 @@<br>
<span class=""> Slice* slice = cu->m_slice;<br>
uint32_t nextDepth = depth + 1;<br>
TComDataCU* subTempPartCU = m_tempCU[nextDepth];<br>
- uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;<br>
+ uint32_t qNumParts = (NUM_CU_PARTITIONS >> (depth << 1)) >> 2;<br>
uint32_t xmax = slice->m_sps->picWidthInLumaSamples - lcu->getCUPelX();<br>
uint32_t ymax = slice->m_sps->picHeightInLumaSamples - lcu->getCUPelY(); for (uint32_t partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++, absPartIdx += qNumParts)<br>
{<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/encoder/encoder.cpp Mon Sep 22 10:07:01 2014 +0530<br>
<span class="">@@ -458,7 +458,7 @@<br>
slice->m_sps = &m_sps;<br>
slice->m_pps = &m_pps;<br>
slice->m_maxNumMergeCand = m_param->maxNumMergeCand;<br>
- slice->m_endCUAddr = slice->realEndAddress(fenc->getNumCUsInFrame() * fenc->getNumPartInCU());<br>
+ slice->m_endCUAddr = slice->realEndAddress(fenc->getNumCUsInFrame() * NUM_CU_PARTITIONS);<br>
}<br>
curEncoder->m_rce.encodeOrder = m_encodedFrameNum++;<br>
if (m_bframeDelay)<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/encoder/entropy.cpp<br>
--- a/source/encoder/entropy.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/encoder/entropy.cpp Mon Sep 22 10:07:01 2014 +0530<br>
@@ -490,7 +490,6 @@<br>
/* encode a CU block recursively */<br>
void Entropy::encodeCU(TComDataCU* cu, uint32_t absPartIdx, uint32_t depth, bool& bEncodeDQP, CU* cuData)<br>
{<br>
- Frame* pic = cu->m_pic;<br>
<span class=""> Slice* slice = cu->m_slice;<br>
<br>
</span> if (depth <= slice->m_pps->maxCuDQPDepth && slice->m_pps->bUseDQP)<br>
@@ -501,7 +500,7 @@<br>
<span class=""><br>
if (!cuUnsplitFlag)<br>
{<br>
- uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;<br>
+ uint32_t qNumParts = (NUM_CU_PARTITIONS >> (depth << 1)) >> 2;<br>
for (uint32_t partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++, absPartIdx += qNumParts)<br>
{<br>
CU *childCU = cu->m_CULocalData + cuData->childIdx + partUnitIdx;<br>
</span>@@ -518,7 +517,7 @@<br>
<span class=""><br>
if (depth < cu->getDepth(absPartIdx) && depth < g_maxCUDepth)<br>
{<br>
- uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;<br>
+ uint32_t qNumParts = (NUM_CU_PARTITIONS >> (depth << 1)) >> 2;<br>
<br>
for (uint32_t partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++, absPartIdx += qNumParts)<br>
{<br>
</span>@@ -580,7 +579,7 @@<br>
<span class=""> {<br>
// Encode slice finish<br>
bool bTerminateSlice = false;<br>
- if (cuAddr + (cu->m_pic->getNumPartInCU() >> (depth << 1)) == realEndAddress)<br>
+ if (cuAddr + (NUM_CU_PARTITIONS >> (depth << 1)) == realEndAddress)<br>
bTerminateSlice = true;<br>
<br>
// The 1-terminating bit is added to all streams, so don't add it here when it's 1.<br>
</span>@@ -607,7 +606,7 @@<br>
<span class=""><br>
if ((log2TrSize == 2) && !(cu->getChromaFormat() == X265_CSP_I444))<br>
{<br>
- uint32_t partNum = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t partNum = NUM_CU_PARTITIONS >> ((depth - 1) << 1);<br>
if ((absPartIdx & (partNum - 1)) == 0)<br>
{<br>
state.bakAbsPartIdx = absPartIdx;<br>
</span>@@ -684,7 +683,7 @@<br>
<span class=""> trIdx++;<br>
++depth;<br>
absPartIdxStep >>= 2;<br>
- const uint32_t partNum = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ const uint32_t partNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
<br>
encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP, depthRange);<br>
<br>
</span>@@ -730,13 +729,13 @@<br>
<span class=""> int chFmt = cu->getChromaFormat();<br>
if ((log2TrSize == 2) && !(chFmt == X265_CSP_I444))<br>
{<br>
- uint32_t partNum = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t partNum = NUM_CU_PARTITIONS >> ((depth - 1) << 1);<br>
if ((absPartIdx & (partNum - 1)) == (partNum - 1))<br>
{<br>
const uint32_t log2TrSizeC = 2;<br>
const bool splitIntoSubTUs = (chFmt == X265_CSP_I422);<br>
<br>
- uint32_t curPartNum = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> ((depth - 1) << 1);<br>
<br>
for (uint32_t chromaId = TEXT_CHROMA_U; chromaId <= TEXT_CHROMA_V; chromaId++)<br>
{<br>
</span>@@ -759,7 +758,7 @@<br>
<span class=""> {<br>
uint32_t log2TrSizeC = log2TrSize - hChromaShift;<br>
const bool splitIntoSubTUs = (chFmt == X265_CSP_I422);<br>
- uint32_t curPartNum = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> (depth << 1);<br>
for (uint32_t chromaId = TEXT_CHROMA_U; chromaId <= TEXT_CHROMA_V; chromaId++)<br>
{<br>
TURecurse tuIterator(splitIntoSubTUs ? VERTICAL_SPLIT : DONT_SPLIT, curPartNum, absPartIdx);<br>
</span>@@ -791,7 +790,7 @@<br>
<span class=""><br>
if ((chFmt == X265_CSP_I444) && (cu->getPartitionSize(absPartIdx) == SIZE_NxN))<br>
{<br>
- uint32_t partOffset = (cu->m_pic->getNumPartInCU() >> (cu->getDepth(absPartIdx) << 1)) >> 2;<br>
+ uint32_t partOffset = (NUM_CU_PARTITIONS >> (cu->getDepth(absPartIdx) << 1)) >> 2;<br>
codeIntraDirChroma(cu, absPartIdx + partOffset);<br>
codeIntraDirChroma(cu, absPartIdx + partOffset * 2);<br>
codeIntraDirChroma(cu, absPartIdx + partOffset * 3);<br>
</span>@@ -860,7 +859,7 @@<br>
<span class=""> uint32_t log2CUSize = cu->getLog2CUSize(absPartIdx);<br>
uint32_t lumaOffset = absPartIdx << LOG2_UNIT_SIZE * 2;<br>
uint32_t chromaOffset = lumaOffset >> (cu->getHorzChromaShift() + cu->getVertChromaShift());<br>
- uint32_t absPartIdxStep = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t absPartIdxStep = NUM_CU_PARTITIONS >> (depth << 1);<br>
CoeffCodeState state;<br>
encodeTransform(cu, state, lumaOffset, chromaOffset, absPartIdx, absPartIdxStep, depth, log2CUSize, 0, bCodeDQP, depthRange);<br>
}<br>
</span>@@ -1291,7 +1290,7 @@<br>
<span class=""> int predIdx[4];<br>
PartSize mode = cu->getPartitionSize(absPartIdx);<br>
uint32_t partNum = isMultiple ? (mode == SIZE_NxN ? 4 : 1) : 1;<br>
- uint32_t partOffset = (cu->m_pic->getNumPartInCU() >> (cu->getDepth(absPartIdx) << 1)) >> 2;<br>
+ uint32_t partOffset = (NUM_CU_PARTITIONS >> (cu->getDepth(absPartIdx) << 1)) >> 2;<br>
<br>
for (j = 0; j < partNum; j++)<br>
{<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/encoder/frameencoder.cpp Mon Sep 22 10:07:01 2014 +0530<br>
<span class="">@@ -422,7 +422,7 @@<br>
{<br>
Slice* slice = m_frame->m_picSym->m_slice;<br>
const uint32_t widthInLCUs = m_frame->getPicSym()->getFrameWidthInCU();<br>
- const uint32_t lastCUAddr = (slice->m_endCUAddr + m_frame->getNumPartInCU() - 1) / m_frame->getNumPartInCU();<br>
+ const uint32_t lastCUAddr = (slice->m_endCUAddr + NUM_CU_PARTITIONS - 1) / NUM_CU_PARTITIONS;<br>
const int numSubstreams = m_param->bEnableWavefront ? m_frame->getPicSym()->getFrameHeightInCU() : 1;<br>
<br>
SAOParam *saoParam = slice->m_pic->getPicSym()->m_saoParam;<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/encoder/sao.cpp<br>
--- a/source/encoder/sao.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/encoder/sao.cpp Mon Sep 22 10:07:01 2014 +0530<br>
@@ -2457,8 +2457,7 @@<br>
// go to sub-CU<br>
if (cu->getDepth(absZOrderIdx) > depth)<br>
{<br>
- Frame* pic = cu->m_pic;<br>
<span class="">- uint32_t curNumParts = pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curNumParts = NUM_CU_PARTITIONS >> (depth << 1);<br>
uint32_t qNumParts = curNumParts >> 2;<br>
uint32_t xmax = cu->m_slice->m_sps->picWidthInLumaSamples - cu->getCUPelX();<br>
uint32_t ymax = cu->m_slice->m_sps->picHeightInLumaSamples - cu->getCUPelY();<br>
</span>diff -r 817abe294c8b -r 37343a4ceced source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Sun Sep 21 23:18:49 2014 +0530<br>
+++ b/source/encoder/search.cpp Mon Sep 22 10:07:01 2014 +0530<br>
<div><div class="h5">@@ -136,7 +136,7 @@<br>
width >>= 1;<br>
height >>= 1;<br>
<br>
- uint32_t qtPartNum = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qtPartNum = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
for (uint32_t part = 0; part < 4; part++)<br>
xEncSubdivCbfQTChroma(cu, trDepth + 1, absPartIdx + part * qtPartNum, absPartIdxStep, width, height);<br>
}<br>
@@ -152,7 +152,7 @@<br>
<br>
if (trMode > trDepth)<br>
{<br>
- uint32_t qtPartNum = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qtPartNum = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
for (uint32_t part = 0; part < 4; part++)<br>
xEncCoeffQTChroma(cu, trDepth + 1, absPartIdx + part * qtPartNum, ttype);<br>
<br>
@@ -170,7 +170,7 @@<br>
X265_CHECK(trDepth > 0, "transform size too small\n");<br>
trDepthC--;<br>
log2TrSizeC++;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trDepthC) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trDepthC) << 1);<br>
bool bFirstQ = ((absPartIdx & (qpdiv - 1)) == 0);<br>
if (!bFirstQ)<br>
return;<br>
@@ -190,7 +190,7 @@<br>
uint32_t coeffOffset = absPartIdx << (LOG2_UNIT_SIZE * 2 - 1);<br>
coeff_t* coeff = m_qtTempCoeff[ttype][qtLayer] + coeffOffset;<br>
uint32_t subTUSize = 1 << (log2TrSizeC * 2);<br>
- uint32_t partIdxesPerSubTU = cu->m_pic->getNumPartInCU() >> (((cu->getDepth(absPartIdx) + trDepthC) << 1) + 1);<br>
+ uint32_t partIdxesPerSubTU = NUM_CU_PARTITIONS >> (((cu->getDepth(absPartIdx) + trDepthC) << 1) + 1);<br>
if (cu->getCbf(absPartIdx, ttype, trDepth + 1))<br>
m_entropyCoder->codeCoeffNxN(cu, coeff, absPartIdx, log2TrSizeC, ttype);<br>
if (cu->getCbf(absPartIdx + partIdxesPerSubTU, ttype, trDepth + 1))<br>
</div></div>@@ -592,7 +592,7 @@<br>
<span class=""> uint64_t splitCost = 0;<br>
uint32_t splitDistY = 0;<br>
uint32_t splitPsyEnergyY = 0;<br>
- uint32_t qPartsDiv = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qPartsDiv = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
uint32_t splitCbfY = 0;<br>
uint32_t splitBits = 0;<br>
</span>@@ -739,7 +739,7 @@<br>
<span class=""> {<br>
// code splitted block<br>
<br>
- uint32_t qPartsDiv = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qPartsDiv = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
uint32_t splitCbfY = 0;<br>
<br>
</span>@@ -775,7 +775,7 @@<br>
<span class=""> }<br>
else<br>
{<br>
- uint32_t numQPart = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t numQPart = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
for (uint32_t part = 0; part < 4; part++)<br>
xSetIntraResultQT(cu, trDepth + 1, absPartIdx + part * numQPart, reconYuv);<br>
}<br>
</span>@@ -817,7 +817,7 @@<br>
<span class=""> trDepthC--;<br>
}<br>
<br>
- uint32_t partIdxesPerSubTU = (cu->m_pic->getNumPartInCU() >> ((depth + trDepthC) << 1)) >> 1;<br>
+ uint32_t partIdxesPerSubTU = (NUM_CU_PARTITIONS >> ((depth + trDepthC) << 1)) >> 1;<br>
<br>
// move the CBFs down a level and set the parent CBF<br>
uint8_t subTUCBF[2];<br>
</span>@@ -860,7 +860,7 @@<br>
<span class=""> X265_CHECK(trDepth > 0, "invalid trDepth\n");<br>
trDepthC--;<br>
log2TrSizeC++;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trDepthC) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trDepthC) << 1);<br>
bool bFirstQ = ((absPartIdx & (qpdiv - 1)) == 0);<br>
if (!bFirstQ)<br>
return outDist;<br>
</span>@@ -890,7 +890,7 @@<br>
<span class=""> uint32_t singlePsyEnergy = 0;<br>
for (uint32_t chromaId = TEXT_CHROMA_U; chromaId <= TEXT_CHROMA_V; chromaId++)<br>
{<br>
- uint32_t curPartNum = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trDepthC) << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trDepthC) << 1);<br>
TURecurse tuIterator(splitIntoSubTUs ? VERTICAL_SPLIT : DONT_SPLIT, curPartNum, absPartIdx);<br>
<br>
do<br>
</span>@@ -1023,7 +1023,7 @@<br>
<span class=""> uint32_t splitCbfU = 0;<br>
uint32_t splitCbfV = 0;<br>
uint32_t splitPsyEnergy = 0;<br>
- uint32_t qPartsDiv = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qPartsDiv = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
for (uint32_t part = 0; part < 4; part++, absPartIdxSub += qPartsDiv)<br>
{<br>
</span>@@ -1061,7 +1061,7 @@<br>
<span class=""> X265_CHECK(trDepth > 0, "invalid trDepth\n");<br>
trDepth--;<br>
log2TrSizeC++;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trDepth) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trDepth) << 1);<br>
if (absPartIdx & (qpdiv - 1))<br>
return;<br>
}<br>
</span>@@ -1084,7 +1084,7 @@<br>
<span class=""> }<br>
else<br>
{<br>
- uint32_t numQPart = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t numQPart = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
for (uint32_t part = 0; part < 4; part++)<br>
xSetIntraResultChromaQT(cu, trDepth + 1, absPartIdx + part * numQPart, reconYuv);<br>
}<br>
</span>@@ -1108,7 +1108,7 @@<br>
<span class=""> X265_CHECK(trDepth > 0, "invalid trDepth\n");<br>
trDepthC--;<br>
log2TrSizeC++;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trDepthC) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trDepthC) << 1);<br>
bool bFirstQ = ((absPartIdx & (qpdiv - 1)) == 0);<br>
if (!bFirstQ)<br>
return;<br>
</span>@@ -1121,7 +1121,7 @@<br>
<span class=""><br>
for (uint32_t chromaId = TEXT_CHROMA_U; chromaId <= TEXT_CHROMA_V; chromaId++)<br>
{<br>
- uint32_t curPartNum = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trDepthC) << 1);<br>
+ uint32_t curPartNum = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trDepthC) << 1);<br>
TURecurse tuIterator(splitIntoSubTUs ? VERTICAL_SPLIT : DONT_SPLIT, curPartNum, absPartIdx);<br>
<br>
do<br>
</span>@@ -1193,7 +1193,7 @@<br>
<span class=""> {<br>
uint32_t splitCbfU = 0;<br>
uint32_t splitCbfV = 0;<br>
- uint32_t qPartsDiv = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qPartsDiv = NUM_CU_PARTITIONS >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
for (uint32_t part = 0; part < 4; part++, absPartIdxSub += qPartsDiv)<br>
{<br>
</span>@@ -1499,7 +1499,7 @@<br>
<span class=""> uint32_t depth = cu->getDepth(0);<br>
uint32_t initTrDepth = (cu->getPartitionSize(0) != SIZE_2Nx2N) && (cu->getChromaFormat() == X265_CSP_I444 ? 1 : 0);<br>
uint32_t log2TrSize = cu->getLog2CUSize(0) - initTrDepth;<br>
- uint32_t absPartIdx = (cu->m_pic->getNumPartInCU() >> (depth << 1));<br>
+ uint32_t absPartIdx = (NUM_CU_PARTITIONS >> (depth << 1));<br>
<br>
int part = partitionFromLog2Size(log2TrSize);<br>
<br>
</span>@@ -2160,7 +2160,7 @@<br>
<span class=""> distortion = zeroDistortion;<br>
cu->m_psyEnergy = zeroPsyEnergyY;<br>
<br>
- const uint32_t qpartnum = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ const uint32_t qpartnum = NUM_CU_PARTITIONS >> (depth << 1);<br>
::memset(cu->getTransformIdx(), 0, qpartnum * sizeof(uint8_t));<br>
::memset(cu->getCbf(TEXT_LUMA), 0, qpartnum * sizeof(uint8_t));<br>
::memset(cu->getCbf(TEXT_CHROMA_U), 0, qpartnum * sizeof(uint8_t));<br>
</span>@@ -2297,12 +2297,12 @@<br>
<span class=""> {<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((depth - 1) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
const bool splitIntoSubTUs = (m_csp == X265_CSP_I422);<br>
- uint32_t absPartIdxStep = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trModeC) << 1);<br>
+ uint32_t absPartIdxStep = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trModeC) << 1);<br>
<br>
uint32_t coeffOffsetY = absPartIdx << LOG2_UNIT_SIZE * 2;<br>
uint32_t coeffOffsetC = coeffOffsetY >> (hChromaShift + vChromaShift);<br>
</span>@@ -2377,7 +2377,7 @@<br>
<span class=""> // code sub-blocks<br>
if (bCheckSplit && !bCheckFull)<br>
{<br>
- const uint32_t qPartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);<br>
+ const uint32_t qPartNumSubdiv = NUM_CU_PARTITIONS >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
</span> residualTransformQuantInter(cu, absPartIdx + i * qPartNumSubdiv, fencYuv, resiYuv, depth + 1, depthRange);<br>
<br>
@@ -2429,7 +2429,7 @@<br>
<span class=""> {<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((depth - 1) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
</span>@@ -2451,7 +2451,7 @@<br>
<span class=""><br>
uint32_t trSize = 1 << log2TrSize;<br>
const bool splitIntoSubTUs = (m_csp == X265_CSP_I422);<br>
- uint32_t absPartIdxStep = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trModeC) << 1);<br>
+ uint32_t absPartIdxStep = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trModeC) << 1);<br>
<br>
// code full block<br>
if (bCheckFull)<br>
</span>@@ -3123,7 +3123,7 @@<br>
<span class=""> }<br>
}<br>
<br>
- const uint32_t qPartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);<br>
+ const uint32_t qPartNumSubdiv = NUM_CU_PARTITIONS >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
{<br>
cu->m_psyEnergy = 0;<br>
</span>@@ -3260,7 +3260,7 @@<br>
<span class=""> const bool bFirstCbfOfCU = curTrMode == 0;<br>
if (bFirstCbfOfCU || mCodeAll)<br>
{<br>
- uint32_t absPartIdxStep = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + curTrMode) << 1);<br>
+ uint32_t absPartIdxStep = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + curTrMode) << 1);<br>
if (bFirstCbfOfCU || cu->getCbf(absPartIdx, TEXT_CHROMA_U, curTrMode - 1))<br>
m_entropyCoder->codeQtCbf(cu, absPartIdx, absPartIdxStep, trWidthC, trHeightC, TEXT_CHROMA_U, curTrMode, !bSubdiv);<br>
if (bFirstCbfOfCU || cu->getCbf(absPartIdx, TEXT_CHROMA_V, curTrMode - 1))<br>
</span>@@ -3287,7 +3287,7 @@<br>
<span class=""> {<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((depth - 1) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
</span>@@ -3313,7 +3313,7 @@<br>
<span class=""> }<br>
else<br>
{<br>
- uint32_t partIdxesPerSubTU = cu->m_pic->getNumPartInCU() >> (((cu->getDepth(absPartIdx) + trModeC) << 1) + 1);<br>
+ uint32_t partIdxesPerSubTU = NUM_CU_PARTITIONS >> (((cu->getDepth(absPartIdx) + trModeC) << 1) + 1);<br>
uint32_t subTUSize = 1 << (log2TrSizeC * 2);<br>
if (ttype == TEXT_CHROMA_U && cu->getCbf(absPartIdx, TEXT_CHROMA_U, trMode))<br>
{<br>
</span>@@ -3337,7 +3337,7 @@<br>
<span class=""> {<br>
if (bSubdivAndCbf || cu->getCbf(absPartIdx, ttype, curTrMode))<br>
{<br>
- const uint32_t qpartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);<br>
+ const uint32_t qpartNumSubdiv = NUM_CU_PARTITIONS >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
xEncodeResidualQT(cu, absPartIdx + i * qpartNumSubdiv, depth + 1, bSubdivAndCbf, ttype, depthRange);<br>
}<br>
</span>@@ -3365,7 +3365,7 @@<br>
<span class=""> {<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trModeC) << 1);<br>
+ uint32_t qpdiv = NUM_CU_PARTITIONS >> ((cu->getDepth(0) + trModeC) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
</span>@@ -3398,7 +3398,7 @@<br>
<span class="im HOEnZb"> }<br>
else<br>
{<br>
- const uint32_t qPartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);<br>
+ const uint32_t qPartNumSubdiv = NUM_CU_PARTITIONS >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
xSetResidualQTData(cu, absPartIdx + i * qPartNumSubdiv, resiYuv, depth + 1, bSpatial);<br>
}<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br></div>