<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 3, 2014 at 1:35 PM, 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 1415001734 -32400<br>
# Mon Nov 03 17:02:14 2014 +0900<br>
# Node ID ef411645295a51cf276e7830d9a98ffe50d85f63<br>
# Parent eebb372eec893efc50e66806fcc19b1c1bd89683<br>
cleanup CUData::m_skipFlag<br>
<br>
diff -r eebb372eec89 -r ef411645295a source/common/cudata.cpp<br>
--- a/source/common/cudata.cpp Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/common/cudata.cpp Mon Nov 03 17:02:14 2014 +0900<br>
@@ -230,13 +230,12 @@<br>
m_qp = (char*)charBuf; charBuf += m_numPartitions;<br>
m_log2CUSize = charBuf; charBuf += m_numPartitions;<br>
m_partSize = charBuf; charBuf += m_numPartitions;<br>
- m_predMode = charBuf; charBuf += m_numPartitions;<br>
m_lumaIntraDir = charBuf; charBuf += m_numPartitions;<br>
m_tqBypass = charBuf; charBuf += m_numPartitions;<br>
m_refIdx[0] = (char*)charBuf; charBuf += m_numPartitions;<br>
m_refIdx[1] = (char*)charBuf; charBuf += m_numPartitions;<br>
m_cuDepth = charBuf; charBuf += m_numPartitions;<br>
- m_skipFlag = charBuf; charBuf += m_numPartitions; /* the order up to here is important in initCTU() and initSubCU() */<br>
+ m_predMode = charBuf; charBuf += m_numPartitions; /* the order up to here is important in initCTU() and initSubCU() */<br>
m_mergeFlag = charBuf; charBuf += m_numPartitions;<br>
m_interDir = charBuf; charBuf += m_numPartitions;<br>
m_mvpIdx[0] = charBuf; charBuf += m_numPartitions;<br>
@@ -279,7 +278,6 @@<br>
m_partSet((uint8_t*)m_qp, (uint8_t)qp);<br>
m_partSet(m_log2CUSize, (uint8_t)g_maxLog2CUSize);<br>
m_partSet(m_partSize, (uint8_t)SIZE_NONE);<br>
- m_partSet(m_predMode, (uint8_t)MODE_NONE);<br>
m_partSet(m_lumaIntraDir, (uint8_t)DC_IDX);<br>
m_partSet(m_tqBypass, (uint8_t)frame.m_encData->m_param->bLossless);<br>
if (m_slice->m_sliceType != I_SLICE)<br>
@@ -291,7 +289,7 @@<br>
X265_CHECK(!(frame.m_encData->m_param->bLossless && !m_slice->m_pps->bTransquantBypassEnabled), "lossless enabled without TQbypass in PPS\n");<br>
<br>
/* initialize the remaining CU data in one memset */<br>
- memset(m_cuDepth, 0, (BytesPerPartition - 8) * m_numPartitions);<br>
+ memset(m_cuDepth, 0, (BytesPerPartition - 7) * m_numPartitions);<br>
<br>
uint32_t widthInCU = m_slice->m_sps->numCuInWidth;<br>
m_cuLeft = (m_cuAddr % widthInCU) ? m_encData->getPicCTU(m_cuAddr - 1) : NULL;<br>
@@ -319,7 +317,6 @@<br>
m_partSet((uint8_t*)m_qp, (uint8_t)ctu.m_qp[0]);<br>
m_partSet(m_log2CUSize, (uint8_t)cuGeom.log2CUSize);<br>
m_partSet(m_partSize, (uint8_t)SIZE_NONE);<br>
- m_partSet(m_predMode, (uint8_t)MODE_NONE);<br>
m_partSet(m_lumaIntraDir, (uint8_t)DC_IDX);<br>
m_partSet(m_tqBypass, (uint8_t)m_encData->m_param->bLossless);<br>
m_partSet((uint8_t*)m_refIdx[0], (uint8_t)REF_NOT_VALID);<br>
@@ -327,7 +324,7 @@<br>
m_partSet(m_cuDepth, (uint8_t)cuGeom.depth);<br>
<br>
/* initialize the remaining CU data in one memset */<br>
- memset(m_skipFlag, 0, (BytesPerPartition - 9) * m_numPartitions);<br>
+ memset(m_predMode, 0, (BytesPerPartition - 8) * m_numPartitions);<br>
}<br>
<br>
/* Copy the results of a sub-part (split) CU to the parent CU */<br>
@@ -340,13 +337,12 @@<br>
m_subPartCopy((uint8_t*)m_qp + offset, (uint8_t*)subCU.m_qp);<br>
m_subPartCopy(m_log2CUSize + offset, subCU.m_log2CUSize);<br>
m_subPartCopy(m_partSize + offset, subCU.m_partSize);<br>
- m_subPartCopy(m_predMode + offset, subCU.m_predMode);<br>
m_subPartCopy(m_lumaIntraDir + offset, subCU.m_lumaIntraDir);<br>
m_subPartCopy(m_tqBypass + offset, subCU.m_tqBypass);<br>
m_subPartCopy((uint8_t*)m_refIdx[0] + offset, (uint8_t*)subCU.m_refIdx[0]);<br>
m_subPartCopy((uint8_t*)m_refIdx[1] + offset, (uint8_t*)subCU.m_refIdx[1]);<br>
m_subPartCopy(m_cuDepth + offset, subCU.m_cuDepth);<br>
- m_subPartCopy(m_skipFlag + offset, subCU.m_skipFlag);<br>
+ m_subPartCopy(m_predMode + offset, subCU.m_predMode);<br>
m_subPartCopy(m_mergeFlag + offset, subCU.m_mergeFlag);<br>
m_subPartCopy(m_interDir + offset, subCU.m_interDir);<br>
m_subPartCopy(m_mvpIdx[0] + offset, subCU.m_mvpIdx[0]);<br>
@@ -410,7 +406,7 @@<br>
m_partSet(m_tqBypass, true);<br>
<br>
/* clear residual coding flags */<br>
- m_partSet(m_skipFlag, 0);<br>
+ m_partSet(m_predMode, cu.m_predMode[0] & (MODE_INTRA | MODE_INTER));<br>
m_partSet(m_tuDepth, 0);<br>
m_partSet(m_transformSkip[0], 0);<br>
m_partSet(m_transformSkip[1], 0);<br>
@@ -428,13 +424,12 @@<br>
m_partCopy((uint8_t*)ctu.m_qp + m_absIdxInCTU, (uint8_t*)m_qp);<br>
m_partCopy(ctu.m_log2CUSize + m_absIdxInCTU, m_log2CUSize);<br>
m_partCopy(ctu.m_partSize + m_absIdxInCTU, m_partSize);<br>
- m_partCopy(ctu.m_predMode + m_absIdxInCTU, m_predMode);<br>
m_partCopy(ctu.m_lumaIntraDir + m_absIdxInCTU, m_lumaIntraDir);<br>
m_partCopy(ctu.m_tqBypass + m_absIdxInCTU, m_tqBypass);<br>
m_partCopy((uint8_t*)ctu.m_refIdx[0] + m_absIdxInCTU, (uint8_t*)m_refIdx[0]);<br>
m_partCopy((uint8_t*)ctu.m_refIdx[1] + m_absIdxInCTU, (uint8_t*)m_refIdx[1]);<br>
m_partCopy(ctu.m_cuDepth + m_absIdxInCTU, m_cuDepth);<br>
- m_partCopy(ctu.m_skipFlag + m_absIdxInCTU, m_skipFlag);<br>
+ m_partCopy(ctu.m_predMode + m_absIdxInCTU, m_predMode);<br>
m_partCopy(ctu.m_mergeFlag + m_absIdxInCTU, m_mergeFlag);<br>
m_partCopy(ctu.m_interDir + m_absIdxInCTU, m_interDir);<br>
m_partCopy(ctu.m_mvpIdx[0] + m_absIdxInCTU, m_mvpIdx[0]);<br>
@@ -478,7 +473,6 @@<br>
m_partCopy((uint8_t*)m_qp, (uint8_t*)ctu.m_qp + m_absIdxInCTU);<br>
m_partCopy(m_log2CUSize, ctu.m_log2CUSize + m_absIdxInCTU);<br>
m_partCopy(m_partSize, ctu.m_partSize + m_absIdxInCTU);<br>
- m_partCopy(m_predMode, ctu.m_predMode + m_absIdxInCTU);<br>
m_partCopy(m_lumaIntraDir, ctu.m_lumaIntraDir + m_absIdxInCTU);<br>
m_partCopy(m_tqBypass, ctu.m_tqBypass + m_absIdxInCTU);<br>
m_partCopy((uint8_t*)m_refIdx[0], (uint8_t*)ctu.m_refIdx[0] + m_absIdxInCTU);<br>
@@ -496,7 +490,7 @@<br>
memcpy(m_mvd[1], ctu.m_mvd[1] + m_absIdxInCTU, m_numPartitions * sizeof(MV));<br>
<br>
/* clear residual coding flags */<br>
- m_partSet(m_skipFlag, 0);<br>
+ m_partSet(m_predMode, ctu.m_predMode[m_absIdxInCTU] & (MODE_INTRA | MODE_INTER));<br>
m_partSet(m_tuDepth, 0);<br>
m_partSet(m_transformSkip[0], 0);<br>
m_partSet(m_transformSkip[1], 0);<br>
@@ -515,7 +509,7 @@<br>
m_partCopy(ctu.m_transformSkip[0] + m_absIdxInCTU, m_transformSkip[0]);<br>
m_partCopy(ctu.m_transformSkip[1] + m_absIdxInCTU, m_transformSkip[1]);<br>
m_partCopy(ctu.m_transformSkip[2] + m_absIdxInCTU, m_transformSkip[2]);<br>
- m_partCopy(ctu.m_skipFlag + m_absIdxInCTU, m_skipFlag);<br>
+ m_partCopy(ctu.m_predMode + m_absIdxInCTU, m_predMode);<br>
m_partCopy(ctu.m_tuDepth + m_absIdxInCTU, m_tuDepth);<br>
m_partCopy(ctu.m_cbf[0] + m_absIdxInCTU, m_cbf[0]);<br>
m_partCopy(ctu.m_cbf[1] + m_absIdxInCTU, m_cbf[1]);<br>
@@ -1441,7 +1435,7 @@<br>
bool isAvailableA1 = cuLeft &&<br>
cuLeft->isDiffMER(xP - 1, yP + nPSH - 1, xP, yP) &&<br>
!(puIdx == 1 && (curPS == SIZE_Nx2N || curPS == SIZE_nLx2N || curPS == SIZE_nRx2N)) &&<br>
- !cuLeft->isIntra(leftPartIdx);<br>
+ cuLeft->isInter(leftPartIdx);<br>
if (isAvailableA1)<br>
{<br>
// get Inter Dir<br>
@@ -1465,7 +1459,7 @@<br>
bool isAvailableB1 = cuAbove &&<br>
cuAbove->isDiffMER(xP + nPSW - 1, yP - 1, xP, yP) &&<br>
!(puIdx == 1 && (curPS == SIZE_2NxN || curPS == SIZE_2NxnU || curPS == SIZE_2NxnD)) &&<br>
- !cuAbove->isIntra(abovePartIdx);<br>
+ cuAbove->isInter(abovePartIdx);<br>
if (isAvailableB1 && (!isAvailableA1 || !cuLeft->hasEqualMotion(leftPartIdx, *cuAbove, abovePartIdx)))<br>
{<br>
// get Inter Dir<br>
@@ -1486,7 +1480,7 @@<br>
const CUData* cuAboveRight = getPUAboveRight(aboveRightPartIdx, partIdxRT);<br>
bool isAvailableB0 = cuAboveRight &&<br>
cuAboveRight->isDiffMER(xP + nPSW, yP - 1, xP, yP) &&<br>
- !cuAboveRight->isIntra(aboveRightPartIdx);<br>
+ cuAboveRight->isInter(aboveRightPartIdx);<br>
if (isAvailableB0 && (!isAvailableB1 || !cuAbove->hasEqualMotion(abovePartIdx, *cuAboveRight, aboveRightPartIdx)))<br>
{<br>
// get Inter Dir<br>
@@ -1507,7 +1501,7 @@<br>
const CUData* cuLeftBottom = this->getPUBelowLeft(leftBottomPartIdx, partIdxLB);<br>
bool isAvailableA0 = cuLeftBottom &&<br>
cuLeftBottom->isDiffMER(xP - 1, yP + nPSH, xP, yP) &&<br>
- !cuLeftBottom->isIntra(leftBottomPartIdx);<br>
+ cuLeftBottom->isInter(leftBottomPartIdx);<br>
if (isAvailableA0 && (!isAvailableA1 || !cuLeft->hasEqualMotion(leftPartIdx, *cuLeftBottom, leftBottomPartIdx)))<br>
{<br>
// get Inter Dir<br>
@@ -1530,7 +1524,7 @@<br>
const CUData* cuAboveLeft = getPUAboveLeft(aboveLeftPartIdx, absPartAddr);<br>
bool isAvailableB2 = cuAboveLeft &&<br>
cuAboveLeft->isDiffMER(xP - 1, yP - 1, xP, yP) &&<br>
- !cuAboveLeft->isIntra(aboveLeftPartIdx);<br>
+ cuAboveLeft->isInter(aboveLeftPartIdx);<br>
if (isAvailableB2 && (!isAvailableA1 || !cuLeft->hasEqualMotion(leftPartIdx, *cuAboveLeft, aboveLeftPartIdx))<br>
&& (!isAvailableB1 || !cuAbove->hasEqualMotion(abovePartIdx, *cuAboveLeft, aboveLeftPartIdx)))<br>
{<br>
@@ -1966,26 +1960,18 @@<br>
<br>
bool CUData::getColMVP(MV& outMV, int& outRefIdx, int picList, int cuAddr, int partUnitIdx) const<br>
{<br>
- uint32_t absPartAddr = partUnitIdx & TMVP_UNIT_MASK;<br>
-<br>
- int colRefPicList;<br>
- int colPOC, colRefPOC, curPOC, curRefPOC;<br>
- MV colmv;<br>
-<br>
- // use coldir.<br>
Frame *colPic = m_slice->m_refPicList[m_slice->isInterB() ? 1 - m_slice->m_colFromL0Flag : 0][m_slice->m_colRefIdx];<br>
CUData *colCU = colPic->m_encData->getPicCTU(cuAddr);<br>
<br>
if (colCU->m_partSize[partUnitIdx] == SIZE_NONE)<br>
return false;<br>
<br>
- curPOC = m_slice->m_poc;<br>
- colPOC = colCU->m_slice->m_poc;<br>
+ uint32_t absPartAddr = partUnitIdx & TMVP_UNIT_MASK;<br>
<br>
if (colCU->isIntra(absPartAddr))<br>
return false;<br>
<br>
- colRefPicList = m_slice->m_bCheckLDC ? picList : m_slice->m_colFromL0Flag;<br>
+ int colRefPicList = m_slice->m_bCheckLDC ? picList : m_slice->m_colFromL0Flag;<br>
<br>
int colRefIdx = colCU->m_refIdx[colRefPicList][absPartAddr];<br>
<br>
@@ -1999,9 +1985,12 @@<br>
}<br>
<br>
// Scale the vector<br>
- colRefPOC = colCU->m_slice->m_refPOCList[colRefPicList][colRefIdx];<br>
- colmv = colCU->m_mv[colRefPicList][absPartAddr];<br>
- curRefPOC = m_slice->m_refPOCList[picList][outRefIdx];<br>
+ int colRefPOC = colCU->m_slice->m_refPOCList[colRefPicList][colRefIdx];<br>
+ int colPOC = colCU->m_slice->m_poc;<br>
+ MV colmv = colCU->m_mv[colRefPicList][absPartAddr];<br>
+<br>
+ int curRefPOC = m_slice->m_refPOCList[picList][outRefIdx];<br>
+ int curPOC = m_slice->m_poc;<br>
<br>
scaleMvByPOCDist(outMV, colmv, curPOC, curRefPOC, colPOC, colRefPOC);<br>
return true;<br>
diff -r eebb372eec89 -r ef411645295a source/common/cudata.h<br>
--- a/source/common/cudata.h Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/common/cudata.h Mon Nov 03 17:02:14 2014 +0900<br>
@@ -51,9 +51,10 @@<br>
<br>
enum PredMode<br>
{<br>
- MODE_INTER,<br>
- MODE_INTRA,<br>
- MODE_NONE = 15<br>
+ MODE_NONE = 0,<br>
+ MODE_INTER = (1 << 0),<br>
+ MODE_INTRA = (1 << 1),<br>
+ MODE_SKIP = (1 << 2) | MODE_INTER<br>
};<br>
<br>
// motion vector predictor direction used in AMVP<br>
@@ -129,12 +130,11 @@<br>
char* m_qp; // array of QP values<br>
uint8_t* m_log2CUSize; // array of cu log2Size TODO: seems redundant to depth<br>
uint8_t* m_partSize; // array of partition sizes<br>
- uint8_t* m_predMode; // array of prediction modes<br>
uint8_t* m_lumaIntraDir; // array of intra directions (luma)<br>
uint8_t* m_tqBypass; // array of CU lossless flags<br>
char* m_refIdx[2]; // array of motion reference indices per list<br>
uint8_t* m_cuDepth; // array of depths<br>
- uint8_t* m_skipFlag; // array of skip flags<br>
+ uint8_t* m_predMode; // array of prediction modes<br>
uint8_t* m_mergeFlag; // array of merge flags<br>
uint8_t* m_interDir; // array of inter directions<br>
uint8_t* m_mvpIdx[2]; // array of motion vector predictor candidates or merge candidate indices [0]<br>
@@ -142,7 +142,7 @@<br>
uint8_t* m_transformSkip[3]; // array of transform skipping flags per plane<br>
uint8_t* m_cbf[3]; // array of coded block flags (CBF) per plane<br>
uint8_t* m_chromaIntraDir; // array of intra directions (chroma)<br>
- enum { BytesPerPartition = 22 }; // combined sizeof() of all per-part data<br>
+ enum { BytesPerPartition = 21 }; // combined sizeof() of all per-part data<br>
<br>
coeff_t* m_trCoeff[3]; // transformed coefficient buffer per plane<br>
<br>
@@ -173,7 +173,6 @@<br>
void updatePic(uint32_t depth) const;<br>
<br>
void setPartSizeSubParts(PartSize size) { m_partSet(m_partSize, (uint8_t)size); }<br>
- void setSkipFlagSubParts(uint8_t skipFlag) { m_partSet(m_skipFlag, skipFlag); }<br>
void setPredModeSubParts(PredMode mode) { m_partSet(m_predMode, (uint8_t)mode); }<br>
void clearCbf() { m_partSet(m_cbf[0], 0); m_partSet(m_cbf[1], 0); m_partSet(m_cbf[2], 0); }<br>
<br>
@@ -204,7 +203,8 @@<br>
<br>
uint32_t getNumPartInter() const { return nbPartsTable[(int)m_partSize[0]]; }<br>
bool isIntra(uint32_t absPartIdx) const { return m_predMode[absPartIdx] == MODE_INTRA; }<br>
- bool isSkipped(uint32_t absPartIdx) const { return !!m_skipFlag[absPartIdx]; }<br>
+ bool isInter(uint32_t absPartIdx) const { return !!(m_predMode[absPartIdx] & MODE_INTER); }<br>
+ bool isSkipped(uint32_t absPartIdx) const { return m_predMode[absPartIdx] == MODE_SKIP; }<br>
bool isBipredRestriction() const { return m_log2CUSize[0] == 3 && m_partSize[0] != SIZE_2Nx2N; }<br>
<br>
void getPartIndexAndSize(uint32_t puIdx, uint32_t& absPartIdx, int& puWidth, int& puHeight) const;<br>
diff -r eebb372eec89 -r ef411645295a source/common/quant.cpp<br>
--- a/source/common/quant.cpp Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/common/quant.cpp Mon Nov 03 17:02:14 2014 +0900<br>
@@ -333,7 +333,6 @@<br>
<br>
bool isLuma = ttype == TEXT_LUMA;<br>
bool usePsy = m_psyRdoqScale && isLuma && !useTransformSkip;<br>
- bool isIntra = cu.m_predMode[absPartIdx] == MODE_INTRA;<br>
int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize; // Represents scaling through forward transform<br>
int trSize = 1 << log2TrSize;<br>
<br>
@@ -355,6 +354,7 @@<br>
}<br>
else<br>
{<br>
+ bool isIntra = cu.isIntra(absPartIdx);<br>
const uint32_t sizeIdx = log2TrSize - 2;<br>
int useDST = !sizeIdx && isLuma && isIntra;<br>
int index = DCT_4x4 + sizeIdx - useDST;<br>
diff -r eebb372eec89 -r ef411645295a source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/encoder/analysis.cpp Mon Nov 03 17:02:14 2014 +0900<br>
@@ -178,7 +178,7 @@<br>
if (!md.bestMode->distortion)<br>
/* already lossless */<br>
return;<br>
- else if (md.bestMode->cu.m_predMode[0] == MODE_INTRA)<br>
+ else if (md.bestMode->cu.isIntra(0))<br>
{<br>
md.pred[PRED_LOSSLESS].cu.initLosslessCU(md.bestMode->cu, cuGeom);<br>
PartSize size = (PartSize)md.pred[PRED_LOSSLESS].cu.m_partSize[0];<br>
@@ -695,7 +695,7 @@<br>
bool bNoSplit = false;<br>
if (md.bestMode)<br>
{<br>
- bNoSplit = !!md.bestMode->cu.isSkipped(0);<br>
+ bNoSplit = md.bestMode->cu.isSkipped(0);<br>
if (mightSplit && depth && depth >= minDepth && !bNoSplit && m_param->rdLevel <= 4)<br>
bNoSplit = recursionDepthCheck(parentCTU, cuGeom, *md.bestMode);<br>
}<br>
@@ -741,7 +741,7 @@<br>
checkBestMode(*splitPred, depth);<br>
}<br>
<br>
- if (!depth || md.bestMode->cu.m_predMode[0] != MODE_INTRA)<br>
+ if (!depth || md.bestMode->cu.isInter(0))<br>
{<br>
/* early-out statistics */<br>
FrameData& curEncData = const_cast<FrameData&>(*m_frame->m_encData);<br>
@@ -894,7 +894,7 @@<br>
/* prediction already generated for this CU, and if rd level<br>
* is not 0, it is already fully encoded */<br>
}<br>
- else if (md.bestMode->cu.m_predMode[0] == MODE_INTER)<br>
+ else if (md.bestMode->cu.isInter(0))<br>
{<br>
for (uint32_t puIdx = 0; puIdx < md.bestMode->cu.getNumPartInter(); puIdx++)<br>
{<br>
@@ -920,7 +920,7 @@<br>
{<br>
md.bestMode->reconYuv.copyFromYuv(md.bestMode->predYuv);<br>
if (cu.m_mergeFlag[0] && cu.m_partSize[0] == SIZE_2Nx2N)<br>
- cu.setSkipFlagSubParts(true);<br>
+ cu.setPredModeSubParts(MODE_SKIP);<br>
}<br>
}<br>
}<br>
@@ -957,7 +957,7 @@<br>
bool bNoSplit = false;<br>
if (md.bestMode)<br>
{<br>
- bNoSplit = !!md.bestMode->cu.isSkipped(0);<br>
+ bNoSplit = md.bestMode->cu.isSkipped(0);<br>
if (mightSplit && depth && depth >= minDepth && !bNoSplit)<br>
bNoSplit = recursionDepthCheck(parentCTU, cuGeom, *md.bestMode);<br>
}<br>
@@ -1014,7 +1014,7 @@<br>
md.bestMode = splitPred;<br>
}<br>
<br>
- if (!depth || md.bestMode->cu.m_predMode[0] != MODE_INTRA)<br>
+ if (!depth || md.bestMode->cu.isInter(0))<br>
{<br>
/* early-out statistics */<br>
FrameData& curEncData = const_cast<FrameData&>(*m_frame->m_encData);<br>
@@ -1334,7 +1334,7 @@<br>
tempPred->cu.m_refIdx[0][0] = (char)mvFieldNeighbours[i][0].refIdx;<br>
tempPred->cu.m_mv[1][0] = mvFieldNeighbours[i][1].mv;<br>
tempPred->cu.m_refIdx[1][0] = (char)mvFieldNeighbours[i][1].refIdx;<br>
- tempPred->cu.setSkipFlagSubParts(false); /* must be cleared between encode iterations */<br>
+ tempPred->cu.setPredModeSubParts(MODE_INTER); /* must be cleared between encode iterations */<br>
<br>
prepMotionCompensation(tempPred->cu, cuGeom, 0);<br>
motionCompensation(tempPred->predYuv, true, true);<br>
@@ -1367,7 +1367,7 @@<br>
tempPred->cu.m_refIdx[0][0] = (char)mvFieldNeighbours[i][0].refIdx;<br>
tempPred->cu.m_mv[1][0] = mvFieldNeighbours[i][1].mv;<br>
tempPred->cu.m_refIdx[1][0] = (char)mvFieldNeighbours[i][1].refIdx;<br>
- tempPred->cu.setSkipFlagSubParts(false);<br>
+ tempPred->cu.setPredModeSubParts(MODE_INTER);<br>
tempPred->predYuv.copyFromYuv(bestPred->predYuv);<br>
}<br>
<br>
@@ -1457,7 +1457,7 @@<br>
cu.copyFromPic(ctu, cuGeom);<br>
m_quant.setQPforQuant(cu);<br>
<br>
- if (cu.m_predMode[0] == MODE_INTRA)<br>
+ if (cu.isIntra(0))<br>
{<br>
uint32_t tuDepthRange[2];<br>
cu.getIntraTUQtDepthRange(tuDepthRange, 0);<br>
@@ -1467,9 +1467,9 @@<br>
getBestIntraModeChroma(*bestMode, cuGeom);<br>
residualQTIntraChroma(*bestMode, cuGeom, 0, 0);<br>
}<br>
- else if (cu.m_predMode[0] == MODE_INTER)<br>
+ else if (cu.isInter(0))<br>
{<br>
- X265_CHECK(!ctu.m_skipFlag[absPartIdx], "skip not expected prior to transform\n");<br>
+ X265_CHECK(!ctu.isSkipped(absPartIdx), "skip not expected prior to transform\n");<br>
<br>
/* Calculate residual for current CU part into depth sized resiYuv */<br>
<br>
@@ -1499,7 +1499,7 @@<br>
residualTransformQuantInter(*bestMode, cuGeom, 0, cuGeom.depth, tuDepthRange);<br>
<br>
if (cu.m_mergeFlag[0] && cu.m_partSize[0] == SIZE_2Nx2N && !cu.getQtRootCbf(0))<br>
- cu.setSkipFlagSubParts(true);<br>
+ cu.setPredModeSubParts(MODE_SKIP);<br>
<br>
PicYuv& reconPicYuv = *m_frame->m_reconPicYuv;<br>
if (cu.getQtRootCbf(0)) // TODO: split to each component<br>
diff -r eebb372eec89 -r ef411645295a source/encoder/entropy.cpp<br>
--- a/source/encoder/entropy.cpp Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/encoder/entropy.cpp Mon Nov 03 17:02:14 2014 +0900<br>
@@ -557,18 +557,17 @@<br>
codeCUTransquantBypassFlag(cu.m_tqBypass[absPartIdx]);<br>
<br>
if (!slice->isIntra())<br>
+ {<br>
codeSkipFlag(cu, absPartIdx);<br>
-<br>
- if (cu.isSkipped(absPartIdx))<br>
- {<br>
- codeMergeIndex(cu, absPartIdx);<br>
- finishCU(cu, absPartIdx, depth);<br>
- return;<br>
+ if (cu.isSkipped(absPartIdx))<br>
+ {<br>
+ codeMergeIndex(cu, absPartIdx);<br>
+ finishCU(cu, absPartIdx, depth);<br>
+ return;<br>
+ }<br>
+ codePredMode(cu.m_predMode[absPartIdx]);<br>
}<br>
<br>
- if (!slice->isIntra())<br>
- codePredMode(cu.m_predMode[absPartIdx]);<br>
-<br>
codePartSize(cu, absPartIdx, depth);<br>
<br>
// prediction Info ( Intra : direction mode, Inter : Mv, reference idx )<br>
@@ -648,11 +647,11 @@<br>
<br>
/* in each of these conditions, the subdiv flag is implied and not signaled,<br>
* so we have checks to make sure the implied value matches our intentions */<br>
- if (cu.m_predMode[absPartIdx] == MODE_INTRA && cu.m_partSize[absPartIdx] == SIZE_NxN && depth == cu.m_cuDepth[absPartIdx])<br>
+ if (cu.isIntra(absPartIdx) && cu.m_partSize[absPartIdx] == SIZE_NxN && depth == cu.m_cuDepth[absPartIdx])<br>
{<br>
X265_CHECK(subdiv, "intra NxN requires TU depth below CU depth\n");<br>
}<br>
- else if (cu.m_predMode[absPartIdx] == MODE_INTER && (cu.m_partSize[absPartIdx] != SIZE_2Nx2N) && depth == cu.m_cuDepth[absPartIdx] &&<br>
+ else if (cu.isInter(absPartIdx) && (cu.m_partSize[absPartIdx] != SIZE_2Nx2N) && depth == cu.m_cuDepth[absPartIdx] &&<br>
cu.m_slice->m_sps->quadtreeTUMaxDepthInter == 1)<br></blockquote><div><br></div><div>There may be a behaviour change here - for Asymmetric Merge blocks. <br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
{<br>
X265_CHECK(subdiv, "inter TU must be smaller than CU when not 2Nx2N part size: log2TrSize %d, depthRange[0] %d\n", log2TrSize, depthRange[0]);<br>
@@ -722,7 +721,7 @@<br>
}<br>
else<br>
{<br>
- if (cu.m_predMode[absPartIdx] != MODE_INTRA && depth == cu.m_cuDepth[absPartIdx] && !cu.getCbf(absPartIdx, TEXT_CHROMA_U, 0) && !cu.getCbf(absPartIdx, TEXT_CHROMA_V, 0))<br>
+ if (cu.isInter(absPartIdx) && depth == cu.m_cuDepth[absPartIdx] && !cu.getCbf(absPartIdx, TEXT_CHROMA_U, 0) && !cu.getCbf(absPartIdx, TEXT_CHROMA_V, 0))<br>
{<br>
X265_CHECK(cu.getCbf(absPartIdx, TEXT_LUMA, 0), "CBF should have been set\n");<br>
}<br>
@@ -1202,7 +1201,7 @@<br>
<br>
void Entropy::codePredMode(int predMode)<br>
{<br>
- encodeBin(predMode == MODE_INTER ? 0 : 1, m_contextState[OFF_PRED_MODE_CTX]);<br>
+ encodeBin(predMode == MODE_INTRA ? 1 : 0, m_contextState[OFF_PRED_MODE_CTX]);<br>
}<br>
<br>
void Entropy::codeCUTransquantBypassFlag(uint32_t symbol)<br>
diff -r eebb372eec89 -r ef411645295a source/encoder/frameencoder.cpp<br>
--- a/source/encoder/frameencoder.cpp Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/encoder/frameencoder.cpp Mon Nov 03 17:02:14 2014 +0900<br>
@@ -1011,7 +1011,7 @@<br>
log->cntSkipCu[depth]++;<br>
log->qTreeSkipCnt[depth]++;<br>
}<br>
- else if (ctu.m_predMode[absPartIdx] == MODE_INTER)<br>
+ else if (ctu.isInter(absPartIdx))<br>
{<br>
log->cntInter[depth]++;<br>
log->qTreeInterCnt[depth]++;<br>
@@ -1021,7 +1021,7 @@<br>
else<br>
log->cuInterDistribution[depth][AMP_ID]++;<br>
}<br>
- else if (ctu.m_predMode[absPartIdx] == MODE_INTRA)<br>
+ else if (ctu.isIntra(absPartIdx))<br>
{<br>
log->cntIntra[depth]++;<br>
log->qTreeIntraCnt[depth]++;<br>
diff -r eebb372eec89 -r ef411645295a source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Fri Oct 31 16:29:20 2014 -0500<br>
+++ b/source/encoder/search.cpp Mon Nov 03 17:02:14 2014 +0900<br>
@@ -2366,7 +2366,7 @@<br>
<br>
// No residual coding : SKIP mode<br>
<br>
- cu.setSkipFlagSubParts(true);<br>
+ cu.setPredModeSubParts(MODE_SKIP);<br>
cu.clearCbf();<br>
cu.setTUDepthSubParts(0, 0, depth);<br>
<br>
@@ -2466,7 +2466,7 @@<br>
uint32_t coeffBits, bits;<br>
if (cu.m_mergeFlag[0] && cu.m_partSize[0] == SIZE_2Nx2N && !cu.getQtRootCbf(0))<br>
{<br>
- cu.setSkipFlagSubParts(true);<br>
+ cu.setPredModeSubParts(MODE_SKIP);<br>
<br>
/* Merge/Skip */<br>
m_entropyCoder.resetBits();<br>
@@ -3233,7 +3233,7 @@<br>
void Search::encodeResidualQT(CUData& cu, uint32_t absPartIdx, const uint32_t depth, bool bSubdivAndCbf, TextType ttype, uint32_t depthRange[2])<br>
{<br>
X265_CHECK(cu.m_cuDepth[0] == cu.m_cuDepth[absPartIdx], "depth not matching\n");<br>
- X265_CHECK(cu.m_predMode[absPartIdx] != MODE_INTRA, "encodeResidualQT() with intra block\n");<br>
+ X265_CHECK(cu.isInter(absPartIdx), "encodeResidualQT() with intra block\n");<br>
<br>
const uint32_t curTuDepth = depth - cu.m_cuDepth[0];<br>
const uint32_t tuDepth = cu.m_tuDepth[absPartIdx];<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>