42 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
43 #include "../TLibCommon/Debug.h"
92 UInt uiMergeIndex = 0;
114 if( pcCU->
isIntra( uiAbsPartIdx ) )
161 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
162 if (bDebugPredEnabled)
169 printf(
"coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->
getIntraDir(
CHANNEL_TYPE_LUMA, uiAbsPartIdx));
193 uhInterDirNeighbours[ui] = 0;
195 Int numValidMergeCand = 0;
196 Bool hasMergedCandList =
false;
199 UInt numSpatialMergeCandidates = 0;
203 for (
UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
209 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
210 if (bDebugPredEnabled)
212 std::cout <<
"Coded merge flag, CU absPartIdx: " << uiAbsPartIdx <<
" PU(" << uiPartIdx <<
") absPartIdx: " << uiSubPartIdx;
213 std::cout <<
" merge index: " << (
UInt)pcCU->
getMergeIndex(uiSubPartIdx) << std::endl;
220 if ( !hasMergedCandList )
224 numSpatialMergeCandidates = 0;
225 pcSubCU->
getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates );
230 hasMergedCandList =
true;
236 numSpatialMergeCandidates = 0;
237 pcSubCU->
getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex );
239 pcSubCU->
getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
250 pcCU->
setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
253 for (
UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
268 for (
UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
275 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
276 if (bDebugPredEnabled)
278 std::cout <<
"refListIdx: " << uiRefListIdx << std::endl;
281 std::cout <<
"MVPIdxPU: " << pcCU->
getMVPIdx(
RefPicList( uiRefListIdx ), uiSubPartIdx) << std::endl;
282 std::cout <<
"InterDir: " << (
UInt)pcCU->
getInterDir(uiSubPartIdx) << std::endl;
325 Int iParseRefFrmIdx = pcCU->
getInterDir( uiAbsPartIdx ) & ( 1 << eRefList );
331 else if ( !iParseRefFrmIdx )
354 if ( pcCU->
getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ) )
371 iRefIdx = pcSubCUMvField->
getRefIdx(uiPartAddr);
374 if ( (pcSubCU->
getInterDir(uiPartAddr) & ( 1 << eRefList )) )
378 pcSubCU->
fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
390 cMv += pcSubCUMvField->
getMvd( uiPartAddr );
409 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
412 printf(
"x..codeTransform: offsetLuma=%d offsetChroma=%d absPartIdx=%d, uiDepth=%d\n width=%d, height=%d, uiTrIdx=%d, uiInnerQuadIdx=%d\n",
424 uiSubdiv = (uiLog2TrafoSize >quadtreeTULog2MinSizeInCU);
434 else if( uiLog2TrafoSize == quadtreeTULog2MinSizeInCU )
440 assert( uiLog2TrafoSize > quadtreeTULog2MinSizeInCU );
449 const Bool bFirstCbfOfCU = uiTrDepth == 0;
457 if( bFirstCbfOfCU || pcCU->
getCbf( uiAbsPartIdx, compID, uiTrDepth - 1 ) )
473 xDecodeTransform( bCodeDQP, isChromaQpAdjCoded, tuRecurseChild, quadtreeTULog2MinSizeInCU );
475 for(
UInt ch=0; ch<numValidComponent; ch++)
481 for(
UInt ch=0; ch<numValidComponent; ch++)
484 const UChar flag = uiYUVCbf[ch] << uiTrDepth;
486 for(
UInt ui = 0; ui < 4 * uiQPartNum; ++ui )
494 assert( uiDepth >= pcCU->
getDepth( uiAbsPartIdx ) );
522 Bool validCbf =
false;
523 Bool validChromaCbf =
false;
530 cbf[compID] = pcCU->
getCbf( uiAbsPartIdx, compID, uiTrIdx );
532 if (cbf[compID] != 0)
537 validChromaCbf =
true;
561 isChromaQpAdjCoded =
false;
573 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
576 printf(
"Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.
getRect(compID).
width, rTu.
getRect(compID).
height, 1);
591 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
594 printf(
"Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.
getRect(compID).
width, subTUIterator.
getRect(compID).
height, 1);
640 if( pcCU->
isIntra(uiAbsPartIdx) )
645 UInt uiQtRootCbf = 1;
662 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST
671 xDecodeTransform( bCodeDQP, isChromaQpAdjCoded, tuRecurse, quadtreeTULog2MinSizeInCU );
virtual Void parseTransformSubdivFlag(UInt &ruiSubdivFlag, UInt uiLog2TransformBlockSize)=0
UInt getQuadtreeTULog2MinSizeInCU(UInt uiIdx) const
sample adaptive offset class (header)
static const Int NOT_VALID
Void decodeRefFrmIdxPU(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList)
Void setMVPNumSubParts(Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Void decodeSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Int getMVPIdx(RefPicList eRefPicList, UInt uiIdx) const
Void decodeSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Int getRefIdx(Int iIdx) const
SChar * getPartitionSize()
virtual Void parseIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
prediction class (header)
virtual Void parseIntraDirChroma(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
virtual Void parseQtCbf(TComTU &rTu, const ComponentID compID, const Bool lowestLevel)=0
Void getInterMergeCandidates(UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField *pcMFieldNeighbours, UChar *puhInterDirNeighbours, Int &numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx=-1) const
Construct a list of merging candidates.
Void getMvPredAMVP(TComDataCU *pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, TComMv &rcMvPred)
static const Int MRG_MAX_NUM_CANDS
MERGE.
Void fillMvpCand(const UInt uiPartIdx, const UInt uiPartAddr, const RefPicList eRefPicList, const Int iRefIdx, AMVPInfo *pInfo) const
Void decodeMergeFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx)
Void setAllRefIdx(Int iRefIdx, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
class for motion vector with reference index
Bool getUseChromaQpAdj() const
Bool isLastColumnCTUInTile() const
UInt getNumPartitionsInCtu() const
Void decodeIntraDirModeLuma(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Void decodePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
virtual Void parseChromaQpAdjustment(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
UInt getPCMLog2MaxSize() const
Void decodePredInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU *pcSubCU)
UInt GetTransformDepthRel() const
Int getNumberValidComponents() const
virtual Void parseMergeIndex(TComDataCU *pcCU, UInt &ruiMergeIndex)=0
virtual Void parsePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
Void copyInterPredInfoFrom(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList)
TComMv const & getMvd(Int iIdx) const
UChar getCbf(UInt uiIdx, ComponentID eType) const
TDecConformanceCheck * m_pConformanceCheck
TDecEntropyIf * m_pcEntropyDecoderIf
Bool nextSection(const TComTU &parent)
Int getNumRefIdx(RefPicList e) const
entropy decoder pure class
UInt GetSectionNumber() const
Bool isInter(UInt uiPartIdx) const
Void setEntropyDecoder(TDecEntropyIf *p)
Void setInterDirSubParts(UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
virtual Void parseMVPIdx(Int &riMVPIdx)=0
UInt GetAbsPartIdxTU() const
class for motion information in one CU
entropy decoder class (header)
UInt getMaxTotalCUDepth() const
virtual Void parseDeltaQP(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
virtual Void parseCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
virtual Void parsePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
PartSize
supported partition shape
const UInt g_auiPUOffset[NUMBER_OF_PART_SIZES]
virtual Void parseSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
Void decodeMVPIdxPU(TComDataCU *pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList)
virtual Void parseSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
virtual Void parseRefFrmIdx(TComDataCU *pcCU, Int &riRefFrmIdx, RefPicList eRefList)=0
virtual Void parseIntraDirLumaAng(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)=0
UChar * getIntraDir(const ChannelType channelType) const
UInt getMaxNumMergeCand() const
Int iN
number of motion vector predictor candidates
symmetric motion partition, 2Nx2N
virtual Void parseQtRootCbf(UInt uiAbsPartIdx, UInt &uiQtRootCbf)=0
Void setAllMvField(TComMvField const &mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
Bool isIntra(UInt uiPartIdx) const
Void setPartSizeSubParts(PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth)
Void decodeIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
UInt getPCMLog2MinSize() const
Void decodeCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Bool ProcessingAllQuadrants(const ComponentID compID) const
Void decodeMvdPU(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList)
RefPicList
reference list index
UInt GetLog2LumaTrSize() const
UInt getCoefficientOffset(const ComponentID compID) const
#define DTRACE_CABAC_VL(x)
UInt getQuadtreeTULog2MinSize() const
const TComRectangle & getRect(const ComponentID compID) const
virtual Void parseMergeFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx)=0
const TComPPS * getPPS() const
Void decodeChromaQpAdjustment(TComDataCU *pcCU, UInt uiAbsPartIdx)
ChromaFormat getChromaFormat() const
TComPrediction * m_pcPrediction
Void decodeQP(TComDataCU *pcCU, UInt uiAbsPartIdx)
#define DTRACE_CABAC_T(x)
Bool ProcessComponentSection(const ComponentID compID) const
Void decodePUWise(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU *pcSubCU)
Void xDecodeTransform(Bool &bCodeDQP, Bool &isChromaQpAdjCoded, TComTU &rTu, const Int quadtreeTULog2MinSizeInCU)
Bool * getCUTransquantBypass()
Void setAllMvd(TComMv const &rcMvd, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
Void decodeCoeff(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &bCodeDQP, Bool &isChromaQpAdjCoded)
decode coefficients
Void setCbfSubParts(const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth)
TComCUMvField * getCUMvField(RefPicList e)
UInt getLog2ParallelMergeLevelMinus2() const
#define DTRACE_CABAC_V(x)
virtual Void parseInterDir(TComDataCU *pcCU, UInt &ruiInterDir, UInt uiAbsPartIdx)=0
basic motion vector class
UInt numSpatialMVPCandidates
UInt getQuadtreeTULog2MaxSize() const
Void decodeIntraDirModeChroma(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
UInt GetAbsPartIdxCU() const
virtual Void parseCrossComponentPrediction(class TComTU &rTu, ComponentID compID)=0
virtual Void parseCoeffNxN(class TComTU &rTu, ComponentID compID)=0
virtual Void parseMvd(TComDataCU *pcCU, UInt uiAbsPartAddr, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList)=0
Void setMergeIndexSubParts(UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Bool isBipredRestriction(UInt puIdx) const
Void decodeMergeIndex(TComDataCU *pcSubCU, UInt uiPartIdx, UInt uiPartAddr, UInt uiDepth)
symmetric motion partition, Nx N
Void setAllMv(TComMv const &rcMv, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
UInt getQuadtreeTUMaxDepthInter() const
Void setMVPIdxSubParts(Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Void decodePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Void decodeInterDirPU(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx)
UInt GetTransformDepthTotal() const
const TComSPS * getSPS() const
UInt GetTransformDepthTotalAdj(const ComponentID compID) const
Void setTrIdxSubParts(UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth)