<div dir="ltr">Thanks, please replace with a macro NUM_CU_PARTITIONS<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 22, 2014 at 9:19 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"># HG changeset patch<br>
# User Santhoshini Sekar <<a href="mailto:santhoshini@multicorewareinc.com">santhoshini@multicorewareinc.com</a>><br>
# Date 1411357741 -19800<br>
# Mon Sep 22 09:19:01 2014 +0530<br>
# Node ID 2c228165459e8b8ea966811b6217c1ee0ed80095<br>
# Parent f70fd79cb3e1a0cb60b1c7ea5aac9a52922703c3<br>
remove getNumPartInCU() and replace it with constant value<br>
<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/Lib/TLibCommon/TComDataCU.cpp<br>
--- a/source/Lib/TLibCommon/TComDataCU.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComDataCU.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -320,7 +320,7 @@<br>
m_totalBits = 0;<br>
m_mvBits = 0;<br>
m_coeffBits = 0;<br>
- m_numPartitions = pic->getNumPartInCU();<br>
+ m_numPartitions = 256;<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 + 256 - 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 + 256 - 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[256 - 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 + 256 - 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[256 - 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 + 256 - 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[256 - 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(256);<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 = 256 >> (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 = 256 >> (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 = 256 >> (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 = 256 >> (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, 256 >> (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, 256 >> (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, 256 >> (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, 256 >> (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 = 256 >> (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 = 256 >> (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 = 256 >> (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 = (256 >> (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 = 256 >> (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 = 256 >> (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 = 256 >> (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 = 256 >> (depth << 1);<br>
<br>
memset(m_transformSkip[ttype] + absPartIdx, useTransformSkip, sizeof(uint8_t) * curPartNum);<br>
}<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/common/deblock.cpp<br>
--- a/source/common/deblock.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/common/deblock.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -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 = 256 >> (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 = 256 >> (depth << 1);<br>
const uint32_t qNumParts = curNumParts >> 2;<br>
<br>
for (uint32_t partIdx = 0; partIdx < 4; partIdx++, absZOrderIdx += qNumParts)<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/common/frame.h<br>
--- a/source/common/frame.h Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/common/frame.h Mon Sep 22 09:19:01 2014 +0530<br>
@@ -117,8 +117,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>
diff -r f70fd79cb3e1 -r 2c228165459e source/common/slice.cpp<br>
--- a/source/common/slice.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/common/slice.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -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) % 256;<br>
+ uint32_t externalAddress = (endCUAddr - 1) / 256;<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 == 256)<br>
{<br>
internalAddress = 0;<br>
externalAddress++;<br>
}<br>
<br>
- return externalAddress * m_pic->getNumPartInCU() + internalAddress;<br>
+ return externalAddress * 256 + internalAddress;<br>
}<br>
<br>
<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/encoder/analysis.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -2060,7 +2060,7 @@<br>
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 = (256 >> (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>
diff -r f70fd79cb3e1 -r 2c228165459e source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/encoder/encoder.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -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() * 256);<br>
}<br>
curEncoder->m_rce.encodeOrder = m_encodedFrameNum++;<br>
if (m_bframeDelay)<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/encoder/entropy.cpp<br>
--- a/source/encoder/entropy.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/encoder/entropy.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -501,7 +501,7 @@<br>
<br>
if (!cuUnsplitFlag)<br>
{<br>
- uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;<br>
+ uint32_t qNumParts = (256 >> (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>
@@ -518,7 +518,7 @@<br>
<br>
if (depth < cu->getDepth(absPartIdx) && depth < g_maxCUDepth)<br>
{<br>
- uint32_t qNumParts = (pic->getNumPartInCU() >> (depth << 1)) >> 2;<br>
+ uint32_t qNumParts = (256 >> (depth << 1)) >> 2;<br>
<br>
for (uint32_t partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++, absPartIdx += qNumParts)<br>
{<br>
@@ -580,7 +580,7 @@<br>
{<br>
// Encode slice finish<br>
bool bTerminateSlice = false;<br>
- if (cuAddr + (cu->m_pic->getNumPartInCU() >> (depth << 1)) == realEndAddress)<br>
+ if (cuAddr + (256 >> (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>
@@ -607,7 +607,7 @@<br>
<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 = 256 >> ((depth - 1) << 1);<br>
if ((absPartIdx & (partNum - 1)) == 0)<br>
{<br>
state.bakAbsPartIdx = absPartIdx;<br>
@@ -684,7 +684,7 @@<br>
trIdx++;<br>
++depth;<br>
absPartIdxStep >>= 2;<br>
- const uint32_t partNum = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ const uint32_t partNum = 256 >> (depth << 1);<br>
<br>
encodeTransform(cu, state, offsetLuma, offsetChroma, absPartIdx, absPartIdxStep, depth, log2TrSize, trIdx, bCodeDQP, depthRange);<br>
<br>
@@ -730,13 +730,13 @@<br>
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 = 256 >> ((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 = 256 >> ((depth - 1) << 1);<br>
<br>
for (uint32_t chromaId = TEXT_CHROMA_U; chromaId <= TEXT_CHROMA_V; chromaId++)<br>
{<br>
@@ -759,7 +759,7 @@<br>
{<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 = 256 >> (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>
@@ -791,7 +791,7 @@<br>
<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 = (256 >> (cu->getDepth(absPartIdx) << 1)) >> 2;<br>
codeIntraDirChroma(cu, absPartIdx + partOffset);<br>
codeIntraDirChroma(cu, absPartIdx + partOffset * 2);<br>
codeIntraDirChroma(cu, absPartIdx + partOffset * 3);<br>
@@ -860,7 +860,7 @@<br>
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 = 256 >> (depth << 1);<br>
CoeffCodeState state;<br>
encodeTransform(cu, state, lumaOffset, chromaOffset, absPartIdx, absPartIdxStep, depth, log2CUSize, 0, bCodeDQP, depthRange);<br>
}<br>
@@ -1291,7 +1291,7 @@<br>
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 = (256 >> (cu->getDepth(absPartIdx) << 1)) >> 2;<br>
<br>
for (j = 0; j < partNum; j++)<br>
{<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/encoder/frameencoder.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -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 + 256 - 1) / 256;<br>
const int numSubstreams = m_param->bEnableWavefront ? m_frame->getPicSym()->getFrameHeightInCU() : 1;<br>
<br>
SAOParam *saoParam = slice->m_pic->getPicSym()->m_saoParam;<br>
diff -r f70fd79cb3e1 -r 2c228165459e source/encoder/sao.cpp<br>
--- a/source/encoder/sao.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/encoder/sao.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -2458,7 +2458,7 @@<br>
if (cu->getDepth(absZOrderIdx) > depth)<br>
{<br>
Frame* pic = cu->m_pic;<br>
- uint32_t curNumParts = pic->getNumPartInCU() >> (depth << 1);<br>
+ uint32_t curNumParts = 256 >> (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>
diff -r f70fd79cb3e1 -r 2c228165459e source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Mon Sep 22 09:05:53 2014 +0530<br>
+++ b/source/encoder/search.cpp Mon Sep 22 09:19:01 2014 +0530<br>
@@ -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 = 256 >> ((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 = 256 >> ((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 = 256 >> ((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 = 256 >> (((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>
@@ -591,7 +591,7 @@<br>
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 = 256 >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
uint32_t splitCbfY = 0;<br>
uint32_t splitBits = 0;<br>
@@ -738,7 +738,7 @@<br>
{<br>
// code splitted block<br>
<br>
- uint32_t qPartsDiv = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t qPartsDiv = 256 >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
uint32_t splitCbfY = 0;<br>
<br>
@@ -774,7 +774,7 @@<br>
}<br>
else<br>
{<br>
- uint32_t numQPart = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t numQPart = 256 >> ((fullDepth + 1) << 1);<br>
for (uint32_t part = 0; part < 4; part++)<br>
xSetIntraResultQT(cu, trDepth + 1, absPartIdx + part * numQPart, reconYuv);<br>
}<br>
@@ -816,7 +816,7 @@<br>
trDepthC--;<br>
}<br>
<br>
- uint32_t partIdxesPerSubTU = (cu->m_pic->getNumPartInCU() >> ((depth + trDepthC) << 1)) >> 1;<br>
+ uint32_t partIdxesPerSubTU = (256 >> ((depth + trDepthC) << 1)) >> 1;<br>
<br>
// move the CBFs down a level and set the parent CBF<br>
uint8_t subTUCBF[2];<br>
@@ -859,7 +859,7 @@<br>
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 = 256 >> ((cu->getDepth(0) + trDepthC) << 1);<br>
bool bFirstQ = ((absPartIdx & (qpdiv - 1)) == 0);<br>
if (!bFirstQ)<br>
return outDist;<br>
@@ -889,7 +889,7 @@<br>
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 = 256 >> ((cu->getDepth(0) + trDepthC) << 1);<br>
TURecurse tuIterator(splitIntoSubTUs ? VERTICAL_SPLIT : DONT_SPLIT, curPartNum, absPartIdx);<br>
<br>
do<br>
@@ -1022,7 +1022,7 @@<br>
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 = 256 >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
for (uint32_t part = 0; part < 4; part++, absPartIdxSub += qPartsDiv)<br>
{<br>
@@ -1060,7 +1060,7 @@<br>
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 = 256 >> ((cu->getDepth(0) + trDepth) << 1);<br>
if (absPartIdx & (qpdiv - 1))<br>
return;<br>
}<br>
@@ -1083,7 +1083,7 @@<br>
}<br>
else<br>
{<br>
- uint32_t numQPart = cu->m_pic->getNumPartInCU() >> ((fullDepth + 1) << 1);<br>
+ uint32_t numQPart = 256 >> ((fullDepth + 1) << 1);<br>
for (uint32_t part = 0; part < 4; part++)<br>
xSetIntraResultChromaQT(cu, trDepth + 1, absPartIdx + part * numQPart, reconYuv);<br>
}<br>
@@ -1107,7 +1107,7 @@<br>
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 = 256 >> ((cu->getDepth(0) + trDepthC) << 1);<br>
bool bFirstQ = ((absPartIdx & (qpdiv - 1)) == 0);<br>
if (!bFirstQ)<br>
return;<br>
@@ -1120,7 +1120,7 @@<br>
<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 = 256 >> ((cu->getDepth(0) + trDepthC) << 1);<br>
TURecurse tuIterator(splitIntoSubTUs ? VERTICAL_SPLIT : DONT_SPLIT, curPartNum, absPartIdx);<br>
<br>
do<br>
@@ -1192,7 +1192,7 @@<br>
{<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 = 256 >> ((fullDepth + 1) << 1);<br>
uint32_t absPartIdxSub = absPartIdx;<br>
for (uint32_t part = 0; part < 4; part++, absPartIdxSub += qPartsDiv)<br>
{<br>
@@ -1498,7 +1498,7 @@<br>
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 = (256 >> (depth << 1));<br>
<br>
int part = partitionFromLog2Size(log2TrSize);<br>
<br>
@@ -2159,7 +2159,7 @@<br>
distortion = zeroDistortion;<br>
cu->m_psyEnergy = zeroPsyEnergyY;<br>
<br>
- const uint32_t qpartnum = cu->m_pic->getNumPartInCU() >> (depth << 1);<br>
+ const uint32_t qpartnum = 256 >> (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>
@@ -2296,12 +2296,12 @@<br>
{<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t qpdiv = 256 >> ((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 = 256 >> ((cu->getDepth(0) + trModeC) << 1);<br>
<br>
uint32_t coeffOffsetY = absPartIdx << LOG2_UNIT_SIZE * 2;<br>
uint32_t coeffOffsetC = coeffOffsetY >> (hChromaShift + vChromaShift);<br>
@@ -2376,7 +2376,7 @@<br>
// 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 = 256 >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
{<br>
residualTransformQuantInter(cu, absPartIdx + i * qPartNumSubdiv, fencYuv, resiYuv, depth + 1, depthRange, cuData);<br>
@@ -2430,7 +2430,7 @@<br>
{<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t qpdiv = 256 >> ((depth - 1) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
@@ -2452,7 +2452,7 @@<br>
<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 = 256 >> ((cu->getDepth(0) + trModeC) << 1);<br>
<br>
// code full block<br>
if (bCheckFull)<br>
@@ -3124,7 +3124,7 @@<br>
}<br>
}<br>
<br>
- const uint32_t qPartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);<br>
+ const uint32_t qPartNumSubdiv = 256 >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
{<br>
cu->m_psyEnergy = 0;<br>
@@ -3261,7 +3261,7 @@<br>
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 = 256 >> ((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>
@@ -3288,7 +3288,7 @@<br>
{<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((depth - 1) << 1);<br>
+ uint32_t qpdiv = 256 >> ((depth - 1) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
@@ -3314,7 +3314,7 @@<br>
}<br>
else<br>
{<br>
- uint32_t partIdxesPerSubTU = cu->m_pic->getNumPartInCU() >> (((cu->getDepth(absPartIdx) + trModeC) << 1) + 1);<br>
+ uint32_t partIdxesPerSubTU = 256 >> (((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>
@@ -3338,7 +3338,7 @@<br>
{<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 = 256 >> ((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>
@@ -3366,7 +3366,7 @@<br>
{<br>
log2TrSizeC++;<br>
trModeC--;<br>
- uint32_t qpdiv = cu->m_pic->getNumPartInCU() >> ((cu->getDepth(0) + trModeC) << 1);<br>
+ uint32_t qpdiv = 256 >> ((cu->getDepth(0) + trModeC) << 1);<br>
bCodeChroma = ((absPartIdx & (qpdiv - 1)) == 0);<br>
}<br>
<br>
@@ -3399,7 +3399,7 @@<br>
}<br>
else<br>
{<br>
- const uint32_t qPartNumSubdiv = cu->m_pic->getNumPartInCU() >> ((depth + 1) << 1);<br>
+ const uint32_t qPartNumSubdiv = 256 >> ((depth + 1) << 1);<br>
for (uint32_t i = 0; i < 4; ++i)<br>
xSetResidualQTData(cu, absPartIdx + i * qPartNumSubdiv, resiYuv, depth + 1, bSpatial);<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>