66 m_pcEntropyDecoder = pcEntropyDecoder;
67 m_pcTrQuant = pcTrQuant;
68 m_pcPrediction = pcPrediction;
70 m_pConformanceCheck = pConformanceCheck;
90 UInt uiNumPartitions = 1<<( ( m_uiMaxDepth - ui - 1 )<<1 );
91 UInt uiWidth = uiMaxWidth >> ui;
92 UInt uiHeight = uiMaxHeight >> ui;
104 m_ppcCU [ui] =
new TComDataCU;
m_ppcCU [ui]->
create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight,
true, uiMaxWidth >> (m_uiMaxDepth - 1) );
155 xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment);
174 UInt uiIsLastCtuOfSliceSegment;
182 uiIsLastCtuOfSliceSegment=0;
185 return uiIsLastCtuOfSliceSegment>0;
197 UInt uiQNumParts = uiCurNumParts>>2;
200 Bool bBoundary =
false;
202 UInt uiRPelX = uiLPelX + (maxCuWidth>>uiDepth) - 1;
204 UInt uiBPelY = uiTPelY + (maxCuHeight>>uiDepth) - 1;
216 UInt uiIdx = uiAbsPartIdx;
228 for (
UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
235 xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment );
242 uiIdx += uiQNumParts;
248 UInt uiQPSrcPartIdx = uiAbsPartIdx;
284 Int numValidMergeCand = 0;
287 uhInterDirNeighbours[ui] = 0;
292 UInt numSpatialMergeCandidates = 0;
293 m_ppcCU[uiDepth]->
getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex );
304 for (
UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
314 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
327 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
341 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );
365 Bool bBoundary =
false;
378 UInt uiNextDepth = uiDepth + 1;
380 UInt uiIdx = uiAbsPartIdx;
381 for (
UInt uiPartIdx = 0; uiPartIdx < 4; uiPartIdx++ )
391 uiIdx += uiQNumParts;
401 switch(
m_ppcCU[uiDepth]->getPredictionMode(0) )
416 if (DebugOptionList::DebugString_Structure.getInt()&DebugStringGetPredModeMask(predMode))
419 std::ostream &ss(std::cout);
421 ss <<
"###: " << (predMode==
MODE_INTRA?
"Intra ":
"Inter ") << partSizeToString[eSize] <<
" CU at " <<
m_ppcCU[uiDepth]->getCUPelX() <<
", " <<
m_ppcCU[uiDepth]->
getCUPelY() <<
" width=" <<
UInt(
m_ppcCU[uiDepth]->getWidth(0)) << std::endl;
425 if (
m_ppcCU[uiDepth]->isLosslessCoded(0) && (
m_ppcCU[uiDepth]->getIPCMFlag(0) ==
false))
446 const Int debugPredModeMask=DebugStringGetPredModeMask(
MODE_INTER);
447 if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask)
457 if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask)
473 if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask)
504 Pel* piPred = pcPredYuv->
getAddr( compID, uiAbsPartIdx );
507 if (uiWidth != uiHeight)
518 xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse);
535 std::ostream &ss(std::cout);
551 Pel* piResi = pcResiYuv->
getAddr( compID, uiAbsPartIdx );
554 const QpParam cQP(*pcCU, compID);
559 const Int debugPredModeMask=DebugStringGetPredModeMask(
MODE_INTRA);
560 std::string *psDebug=(DebugOptionList::DebugString_InvTran.getInt()&debugPredModeMask) ? &sDebug : 0;
569 for (
UInt y = 0; y < uiHeight; y++)
571 for (
UInt x = 0; x < uiWidth; x++)
573 piResi[(y * uiStride) + x] = 0;
594 Pel* pReco = pcRecoYuv->
getAddr( compID, uiAbsPartIdx );
602 if (bDebugPred || bDebugResi || bDebugReco)
604 ss <<
"###: " <<
"CompID: " << compID <<
" pred mode (ch/fin): " << uiChPredMode <<
"/" << uiChFinalMode <<
" absPartIdx: " << rTu.
GetAbsPartIdxTU() << std::endl;
609 #if O0043_BEST_EFFORT_DECODING
610 const Int bitDepthDelta = sps.getStreamBitDepth(
toChannelType(compID)) - clipbd;
613 if( useCrossComponentPrediction )
615 TComTrQuant::crossComponentPrediction( rTu, compID, pResiLuma, piResi, piResi, uiWidth, uiHeight, strideLuma, uiStride, uiStride,
true );
618 for(
UInt uiY = 0; uiY < uiHeight; uiY++ )
621 if (bDebugPred || bDebugResi || bDebugReco)
629 for(
UInt uiX = 0; uiX < uiWidth; uiX++ )
631 ss << pPred[ uiX ] <<
", ";
640 for(
UInt uiX = 0; uiX < uiWidth; uiX++ )
645 ss << pResi[ uiX ] <<
", ";
648 #if O0043_BEST_EFFORT_DECODING
649 pReco [ uiX ] =
ClipBD( rightShiftEvenRounding<Pel>(pPred[ uiX ] + pResi[ uiX ], bitDepthDelta), clipbd );
651 pReco [ uiX ] =
ClipBD( pPred[ uiX ] + pResi[ uiX ], clipbd );
653 pRecIPred[ uiX ] = pReco[ uiX ];
659 for(
UInt uiX = 0; uiX < uiWidth; uiX++ )
661 ss << pReco[ uiX ] <<
", ";
665 if (bDebugPred || bDebugResi || bDebugReco)
673 pRecIPred += uiRecIPredStride;
699 }
while (tuRecurseWithPU.
nextSection(tuRecurseCU));
726 if( uiTrMode == uiTrDepth )
746 xIntraRecQT( pcRecoYuv, pcPredYuv, pcResiYuv, chType, tuRecurseChild );
794 for(
UInt uiY = 0; uiY < uiHeight; uiY++ )
796 for(
UInt uiX = 0; uiX < uiWidth; uiX++ )
798 piReco[uiX] = (piPCM[uiX] << uiPcmLeftShiftBit);
799 piPicReco[uiX] = piReco[uiX];
803 piPicReco += uiPicStride;
824 xDecodePCMTexture( pcCU, 0, pPCMChannel, pRecChannel, stride, width, height, compID );
839 for (
UInt componentIndex = 0; componentIndex < numValidComp; componentIndex++)
851 for (
Int line = 0; line < height; line++)
853 for (
Int column = 0; column < width; column++)
855 destination[column] = source[column];
858 source += sourceStride;
859 destination += width;
Void xIntraRecQT(TComYuv *pcRecoYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, const ChannelType chType, TComTU &rTu)
Void xFinishDecodeCU(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &isLastCtuOfSliceSegment)
Void setMVPNumSubParts(Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Void destroy()
Destroy YUV buffer.
Void decodeSplitFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
UInt m_uiMaxDepth
max. number of depth
Void decodeCtu(TComDataCU *pCtu, Bool &isLastCtuOfSliceSegment)
decode Ctu information
Void decodeSkipFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
SChar * getPartitionSize()
Void xFillPCMBuffer(TComDataCU *pCU, UInt depth)
prediction class (header)
TComTrQuant * m_pcTrQuant
picture class (symbol + YUV buffers)
Void getInterMergeCandidates(UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField *pcMFieldNeighbours, UChar *puhInterDirNeighbours, Int &numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx=-1) const
Construct a list of merging candidates.
const TComPPS & getPPS() const
const TComPPSRExt & getPpsRangeExtension() const
Int getStride(const ComponentID id) const
static const Int DM_CHROMA_IDX
chroma mode index for derived from luma intra mode
static const Int MRG_MAX_NUM_CANDS
MERGE.
const TComSPSRExt & getSpsRangeExtension() const
SChar * getCrossComponentPredictionAlpha(ComponentID compID)
static Void crossComponentPrediction(TComTU &rTu, const ComponentID compID, const Pel *piResiL, const Pel *piResiC, Pel *piResiT, const Int width, const Int height, const Int strideL, const Int strideC, const Int strideT, const Bool reverse)
UChar * getTransformIdx()
UChar getQtRootCbf(UInt uiIdx) const
class for motion vector with reference index
Bool getUseChromaQpAdj() const
ChromaFormat GetChromaFormat() const
Bool isLastColumnCTUInTile() const
Void motionCompensation(TComDataCU *pcCU, TComYuv *pcYuvPred, RefPicList eRefPicList=REF_PIC_LIST_X, Int iPartIdx=-1)
Void xReconInter(TComDataCU *pcCU, UInt uiDepth)
SChar * getPredictionMode()
UInt getNumPartitionsInCtu() const
Void decodePredMode(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
static Bool filteringIntraReferenceSamples(const ComponentID compID, UInt uiDirMode, UInt uiTuChWidth, UInt uiTuChHeight, const ChromaFormat chFmt, const Bool intraReferenceSmoothingDisabled)
Void xIntraRecBlk(TComYuv *pcRecoYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, const ComponentID component, TComTU &rTu)
UInt getMaxCUHeight() const
Void decodePredInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU *pcSubCU)
UInt getStride(const ComponentID id) const
Void copyToPicYuv(TComPicYuv *pcPicYuvDst, const UInt ctuRsAddr, const UInt uiAbsZorderIdx, const UInt uiPartDepth=0, const UInt uiPartIdx=0) const
UInt GetTransformDepthRel() const
Int getNumberValidComponents() const
Void xReconPCM(TComDataCU *pcCU, UInt uiDepth)
T ClipBD(const T x, const Int bitDepth)
Void copyInterPredInfoFrom(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList)
Void xDecompressCU(TComDataCU *pCtu, UInt uiAbsPartIdx, UInt uiDepth)
UChar getCbf(UInt uiIdx, ComponentID eType) const
Bool nextSection(const TComTU &parent)
Void setIsChromaQpAdjCoded(Bool b)
Bool getTransquantBypassEnabledFlag() const
Int getNumRefIdx(RefPicList e) const
UInt getDiffCuChromaQpOffsetDepth() const
UInt getZorderIdxInCtu() const
Void setInterDirSubParts(UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
TComPicYuv * getPicYuvRec()
UInt GetAbsPartIdxTU() const
Void setOutsideCUPart(UInt uiAbsPartIdx, UInt uiDepth)
UInt getMaxTotalCUDepth() const
Void setChromaQpAdjSubParts(UChar val, Int absPartIdx, Int depth)
PartSize
supported partition shape
TComDataCU ** m_ppcCU
CU data array.
UChar * getIntraDir(const ChannelType channelType) const
Bool checkTMctsMvp(TComDataCU *pcCU, Int partIdx=-1)
CU decoder class (header)
UInt getMaxNumMergeCand() const
symmetric motion partition, 2Nx2N
Void predIntraAng(const ComponentID compID, UInt uiDirMode, Pel *piOrg, UInt uiOrgStride, Pel *piPred, UInt uiStride, TComTU &rTu, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM=false)
Bool isIntra(UInt uiPartIdx) const
Void setAllMvField(TComMvField const &mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
UInt getComponentScaleX(const ComponentID id) const
Void initRasterToPelXY(UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth)
Void decodeIPCMInfo(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Void xCopyToPic(TComDataCU *pcCU, TComPic *pcPic, UInt uiZorderIdx, UInt uiDepth)
Void xDecodePCMTexture(TComDataCU *pcCU, const UInt uiPartIdx, const Pel *piPCM, Pel *piReco, const UInt uiStride, const UInt uiWidth, const UInt uiHeight, const ComponentID compID)
UInt getPicHeightInLumaSamples() const
Void addClip(const TComYuv *pcYuvSrc0, const TComYuv *pcYuvSrc1, const UInt uiTrUnitIdx, const UInt uiPartSize, const BitDepths &clipBitDepths)
Void xDecodeInterTexture(TComDataCU *pcCU, UInt uiDepth)
UInt getComponentScaleY(const ComponentID id) const
Void create(const UInt iWidth, const UInt iHeight, const ChromaFormat chromaFormatIDC)
Create YUV buffer.
Void xReconIntraQT(TComDataCU *pcCU, UInt uiDepth)
Void decodeCUTransquantBypassFlag(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
Void initRasterToZscan(UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth)
Bool m_IsChromaQpAdjCoded
Int getBitDepth(ChannelType type) const
Int TCoeff
transform coefficient
Pel * getAddr(const ComponentID id)
RefPicList
reference list index
Void xDecodeCU(TComDataCU *const pcCU, const UInt uiAbsPartIdx, const UInt uiDepth, Bool &isLastCtuOfSliceSegment)
decode CU block recursively
UInt getMaxCuDQPDepth() const
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
UInt getCoefficientOffset(const ComponentID compID) const
const TComRectangle & getRect(const ComponentID compID) const
const BitDepths & getBitDepths() const
Bool isSkipped(UInt uiPartIdx) const
returns true, if the partiton is skipped
UInt g_auiZscanToRaster[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
const TComPPS * getPPS() const
UInt getPicWidthInLumaSamples() const
Void setQPSubParts(Int qp, UInt uiAbsPartIdx, UInt uiDepth)
Void copySubCU(TComDataCU *pcCU, UInt uiPartUnitIdx)
#define DEBUG_STRING_PASS_INTO(name)
TComPrediction * m_pcPrediction
ChromaFormat getChromaFormat() const
Bool getIntraSmoothingDisabledFlag() const
Void destroy()
destroy internal buffers
Bool ProcessComponentSection(const ComponentID compID) const
SChar getCodedChromaQpAdj() const
const TComSPS & getSPS() const
Void invTransformNxN(TComTU &rTu, const ComponentID compID, Pel *pcResidual, const UInt uiStride, TCoeff *pcCoeff, const QpParam &cQP)
Int getLog2DiffMaxMinCodingBlockSize() const
Bool getIsChromaQpAdjCoded()
TDecConformanceCheck * m_pConformanceCheck
Void setAllMvd(TComMv const &rcMvd, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0)
Void create(ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize, TCoeff *pParentARLBuffer=0)
TDecEntropy * m_pcEntropyDecoder
const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]
Void decodeCoeff(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool &bCodeDQP, Bool &isChromaQpAdjCoded)
decode coefficients
TComYuv ** m_ppcYuvReco
array of prediction & reconstruction buffer
transform and quantization class
Pel * getAddr(const ComponentID ch)
Void initZscanToRaster(Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt *&rpuiCurrIdx)
Void create(UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight, ChromaFormat chromaFormatIDC)
create internal buffers
TComCUMvField * getCUMvField(RefPicList e)
TCoeff * getCoeff(ComponentID component)
Bool isLastSubCUOfCtu(const UInt absPartIdx) const
basic motion vector class
UInt getPCMBitDepth(ChannelType type) const
Void initIntraPatternChType(TComTU &rTu, const ComponentID compID, const Bool bFilterRefSamples)
set parameters from CU data for accessing intra data
PredMode
supported prediction type
Void decompressCtu(TComDataCU *pCtu)
reconstruct Ctu information
SChar getRefQP(UInt uiCurrAbsIdxInCtu) const
Void decodeMergeIndex(TComDataCU *pcSubCU, UInt uiPartIdx, UInt uiPartAddr, UInt uiDepth)
Void invRecurTransformNxN(const ComponentID compID, TComYuv *pResidual, TComTU &rTu)
Pel * getPCMSample(ComponentID component)
Void decodeTerminatingBit(UInt &ruiIsLast)
UInt g_auiRasterToPelX[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Void setMVPIdxSubParts(Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Bool xDecodeSliceEnd(TComDataCU *pcCU, UInt uiAbsPartIdx)
decode end-of-slice flag
Void init(TDecEntropy *pcEntropyDecoder, TComTrQuant *pcTrQuant, TComPrediction *pcPrediction, TDecConformanceCheck *pConformanceCheck)
initialize access channels
Void decodePartSize(TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth)
TComYuv ** m_ppcYuvResi
array of residual buffer
Void copyPartToPartYuv(TComYuv *pcYuvDst, const UInt uiPartIdx, const UInt uiWidth, const UInt uiHeight) const
Void clear()
clear YUV buffer
#define DEBUG_STRING_OUTPUT(os, name)
#define DEBUG_STRING_NEW(name)
Void printBlockToStream(std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth)
#define DEBUG_STRING_CHANNEL_CONDITION(compID)
UInt g_auiRasterToPelY[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
UInt getMaxCUWidth() const
const TComSPS * getSPS() const