51 , m_parameterSetManager()
52 , m_apcSlicePilot(
NULL)
69 , m_bFirstSliceInPicture(true)
70 , m_bFirstSliceInSequence(true)
71 , m_prevSliceSkipped(false)
73 , m_bFirstSliceInBitstream(true)
74 , m_lastPOCNoOutputPriorPics(-1)
75 , m_isNoOutputPriorPics(false)
76 , m_craNoRaslOutputFlag(false)
78 , m_forceDecodeBitDepth(8)
80 , m_pDecodedSEIOutputStream(
NULL)
81 , m_warningMessageSkipPicture(false)
83 , m_tmctsCheckEnabled(false)
90 g_hTrace = fopen(
"TraceDec.txt",
"wb" );
92 g_bJustDoIt = g_bEncDecTraceDisable;
100 if (g_hTrace != stdout)
147 for (
Int i = 0; i < iSize; i++ )
171 #if REDUCED_ENCODER_MEMORY
172 rpcPic->
create ( sps, pps,
false,
true);
174 rpcPic->
create ( sps, pps,
true);
182 Bool bBufferIsAvailable =
false;
186 rpcPic = *(iterPic++);
190 bBufferIsAvailable =
true;
199 bBufferIsAvailable =
true;
204 if ( !bBufferIsAvailable )
212 #if REDUCED_ENCODER_MEMORY
213 rpcPic->
create ( sps, pps,
false,
true);
215 rpcPic->
create ( sps, pps,
true);
251 while (iterPic != pcListPic->end())
253 TComPic* pcPicTmp = *(iterPic++);
263 printf(
"\ninserting lost poc : %d\n",iLostPoc);
269 Int closestPoc = 1000000;
272 TComPic * rpcPic = *(iterPic++);
281 TComPic *rpcPic = *(iterPic++);
321 printf (
"Parameter set activation failed!");
330 #if RExt__HIGH_BIT_DEPTH_SUPPORT==0
333 printf(
"High bit depth support must be enabled at compile-time in order to decode this bitstream\n");
364 Bool isField =
false;
365 Bool isTopField =
false;
371 if (pictureTimingSEIs.size()>0)
413 printf(
"Error - a new SPS has been decoded while processing a picture\n");
418 printf(
"Error - a new PPS has been decoded while processing a picture\n");
432 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end());
444 printf(
"Discarding Prefix SEI associated with unknown VCL NAL unit.\n");
468 for (SEIMessages::iterator it = mctsSEIs.begin(); it != mctsSEIs.end(); it++)
473 printf(
"cannot (yet) check Temporal constrained MCTS if each_tile_one_tile_set_flag is not enabled\n");
478 printf(
"MCTS check enabled!\n");
512 const UInt64 originalSymbolCount = g_nSymbolCounter;
607 printf (
"Warning, the first slice of a picture might have been lost!\n");
618 g_nSymbolCounter = originalSymbolCount;
678 for (
Int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++)
685 Bool bLowDelay =
true;
764 #if O0043_BEST_EFFORT_DECODING
765 sps->setForceDecodeBitDepth(m_forceDecodeBitDepth);
783 fprintf (stderr,
"Warning: found NAL unit with nuh_layer_id equal to %d. Ignoring.\n", nalu.
m_nuhLayerId);
816 printf (
"Note: received suffix SEI but no picture currently active.\n");
853 printf (
"Note: found NAL_UNIT_ACCESS_UNIT_DELIMITER\n");
865 printf (
"Note: found NAL_UNIT_FILLER_DATA with %u bytes payload.\n", size);
887 printf (
"Note: found reserved VCL NAL unit.\n");
898 printf (
"Note: found reserved NAL unit.\n");
916 printf (
"Note: found unspecified NAL unit.\n");
981 printf(
"\nWarning: this is not a valid random access point and the data is discarded until the first CRA picture");
Void setSliceSegmentCurEndCtuTsAddr(UInt ctuTsAddr)
Void setNoOutputPriorPicsFlag(Bool val)
Void executeLoopFilters(Int &poc, TComList< TComPic * > *&rpcListPic)
TDecTop()
Buffered up prefix SEI NAL Units.
Void parseAccessUnitDelimiter(TComInputBitstream *bs, UInt &picType)
Void create(UInt uiMaxCUDepth)
TDecConformanceCheck m_conformanceCheck
Void setSEIs(SEIMessages &seis)
Void init(TDecEntropy *pcEntropyDecoder, TDecSbac *pcSbacDecoder, TDecBinCABAC *pcBinCABAC, TDecCavlc *pcCavlcDecoder, TDecSlice *pcSliceDecoder, TComLoopFilter *pcLoopFilter, TComSampleAdaptiveOffset *pcSAO)
Bool m_isNoOutputPriorPics
Bool getPPSChangedFlag(Int ppsId) const
UInt getNumberOfCtusInFrame() const
picture class (symbol + YUV buffers)
Void setFlatScalingList(const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths)
Bool m_warningMessageSkipPicture
const TComPPSRExt & getPpsRangeExtension() const
Void xUpdatePreviousTid0POC(TComSlice *pSlice)
const TComSPSRExt & getSpsRangeExtension() const
reading functionality for NAL units
Void deleteSEIs(SEIMessages &seiList)
delete list of SEI messages (freeing the referenced objects)
SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
output a selection of SEI messages by payload type. Ownership stays in original message list...
TComSlice * m_apcSlicePilot
Void initCtu(TComPic *pcPic, UInt ctuRsAddr)
UInt getBitsForPOC() const
TComSlice * getSlice(Int i)
Void copySliceInfo(TComSlice *pcSliceSrc)
TComPrediction m_cPrediction
Void xActivateParameterSets()
TComSlice * getSlice(UInt i)
Bool getScalingListPresentFlag() const
NalUnitType m_nalUnitType
nal_unit_type
Void clearSPSChangedFlag(Int spsId)
Bool isReferenced() const
Void initTempBuff(ChromaFormat chromaFormatIDC)
Void clearPPSChangedFlag(Int ppsId)
Void setNalUnitType(NalUnitType e)
Void decompressSlice(TComInputBitstream *pcBitstream, TComPic *pcPic)
UInt getMaxCUHeight() const
Void create(const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction)
UInt getMaxDecPicBuffering(UInt tlayer) const
Bool getNoRaslOutputFlag() const
Bool isSkipPictureForBLA(Int &iPOCLastDisplay)
Void init(UInt uiMaxTrSize, Bool useRDOQ=false, Bool useRDOQTS=false, Bool useSelectiveRDOQ=false, Bool bEnc=false, Bool useTransformSkipFast=false, Bool bUseAdaptQpSelect=false)
Void setUseScalingList(Bool bUseScalingList)
get DeQuant Coefficent
Void setSliceCurStartCtuTsAddr(UInt ctuTsAddr)
Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC)
Bool getHandleCraAsBlaFlag() const
ChromaFormat getChromaFormatIdc() const
Void setTLayer(UInt uiTLayer)
Void setBitstream(TComInputBitstream *p)
Int getNumRefIdx(RefPicList e) const
Void filterPicture(TComPic *pcPic)
UInt getCtuRsToTsAddrMap(Int ctuRsAddr) const
UInt getMaxTrSize() const
SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
remove a selection of SEI messages by payload type from the original list and return them in a new li...
Void storePPS(TComPPS *pps, const std::vector< UChar > &naluData)
store picture parameter set and take ownership of it
Void setEntropyDecoder(TDecEntropyIf *p)
TComPicYuv * getPicYuvRec()
Void xAnalysePrefixSEImessages()
TDecCavlc m_cCavlcDecoder
#define O0043_BEST_EFFORT_DECODING
0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort d...
Bool m_bFirstSliceInSequence
Int m_pocCRA
POC number of the latest CRA picture.
UInt getMaxTotalCUDepth() const
Bool getDependentSliceSegmentFlag() const
Bool getSPSChangedFlag(Int spsId) const
Void xGetNewPicBuffer(const TComSPS &sps, const TComPPS &pps, TComPic *&rpcPic, const UInt temporalLayer)
Void create(Int picWidth, Int picHeight, ChromaFormat format, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth, UInt lumaBitShift, UInt chromaBitShift)
Void setNoRaslOutputFlag(Bool val)
Void storeVPS(TComVPS *vps, const std::vector< UChar > &naluData)
store sequence parameter set and take ownership of it
Void parseFillerData(TComInputBitstream *bs, UInt &fdSize)
TComLoopFilter m_cLoopFilter
Void setTemporalLayerNonReferenceFlag(Bool x)
std::list< InputNALUnit * > m_prefixSEINALUs
TComScalingList & getScalingList()
Void decodeSPS(TComSPS *pcSPS)
UInt getLog2SaoOffsetScale(ChannelType type) const
const TComReferencePictureSet * getRPS()
Bool isRandomAccessSkipPicture(Int &iSkipFrame, Int &iPOCLastDisplay)
TComList< TComPic * > m_cListPic
Int m_pocRandomAccess
POC number of the random access point (the first IDR or CRA picture)
Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay)
Void copyToPic(TComPicYuv *pcPicYuvDst) const
Void setRefPic(TComPic *p, RefPicList e, Int iRefIdx)
NalUnitType m_associatedIRAPType
NAL unit type of the associated IRAP picture.
Bool m_craNoRaslOutputFlag
static const Int MAX_INT
max. value of signed 32-bit integer
UInt getPicHeightInLumaSamples() const
Void setAssociatedIRAPType(NalUnitType associatedIRAPType)
Void storeSPS(TComSPS *sps, const std::vector< UChar > &naluData)
store sequence parameter set and take ownership of it
Void setRefPicList(TComList< TComPic * > &rcListPic, Bool checkNumPocTotalCurr=false)
Int m_lastPOCNoOutputPriorPics
Int getBitDepth(ChannelType type) const
Void parseSEImessage(TComInputBitstream *bs, SEIMessages &seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
Void setSliceCurEndCtuTsAddr(UInt ctuTsAddr)
static Void sortPicList(TComList< TComPic * > &rcListPic)
Void xCreateLostPicture(Int iLostPOC)
const BitDepths & getBitDepths() const
UInt getSliceSegmentCurStartCtuTsAddr() const
Int getMaxLog2TrDynamicRange(ChannelType channelType) const
Void pushBack(const C &rcT)
Bool getNoOutputPriorPicsFlag() const
const TComPPS * getPPS() const
UInt getPicWidthInLumaSamples() const
TDecEntropy m_cEntropyDecoder
Void decodeSliceHeader(TComSlice *pcSlice, ParameterSetManager *parameterSetManager, const Int prevTid0POC)
UInt m_nuhLayerId
nuh_layer_id
Bool getScalingListPresentFlag() const
Void checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int &pocCRA, NalUnitType &associatedIRAPType, TComList< TComPic * > &rcListPic)
Void destroy()
destroy internal buffers
Void setOutputMark(Bool b)
UInt getSliceCurStartCtuTsAddr() const
unsigned long long UInt64
Bool getScalingListFlag() const
const TComSPS * getActiveSPS() const
TComDataCU * getCtu(UInt ctuRsAddr)
ParameterSetManager m_parameterSetManager
Void decodePPS(TComPPS *pcPPS)
Bool m_bFirstSliceInPicture
Void init(TComPrediction *p, TDecConformanceCheck *pConformanceCheck)
TComPPS * getPPS(Int ppsId)
get pointer to existing picture parameter set
Void decodeVPS(TComVPS *pcVPS)
Void setReconMark(Bool b)
TComSampleAdaptiveOffset m_cSAO
SEIMessages m_SEIs
List of SEI messages that have been received before the first slice and between slices, excluding prefix SEIs...
std::ostream * m_pDecodedSEIOutputStream
#define MCTS_ENC_CHECK
Temporal MCTS encoder constraint and decoder checks. Also requires SEITMCTSTileConstraint to be enabl...
UInt getSliceSegmentCurEndCtuTsAddr() const
std::list< SEI * > SEIMessages
Void create(UInt uiMaxDepth, UInt uiMaxWidth, UInt uiMaxHeight, ChromaFormat chromaFormatIDC)
create internal buffers
Void xDecodeSPS(const std::vector< UChar > &naluData)
TDecSlice m_cSliceDecoder
TComScalingList & getScalingList()
Void setSliceSegmentCurStartCtuTsAddr(UInt ctuTsAddr)
Bool m_bFirstSliceInBitstream
Void applyReferencePictureSet(TComList< TComPic * > &rcListPic, const TComReferencePictureSet *RPSList)
TComSPS * getSPS(Int spsId)
get pointer to existing sequence parameter set
Bool getRapPicFlag() const
UInt getNumAllocatedSlice() const
Int checkThatAllRefPicsAreAvailable(TComList< TComPic * > &rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess=0, Bool bUseRecoveryPoint=false)
Bool getReconMark() const
Bool activatePPS(Int ppsId, Bool isIRAP)
Void setTLayerInfo(UInt uiTLayer)
Void xParsePrefixSEIsForUnknownVCLNal()
Void setBorderExtension(Bool b)
Void xDecodeVPS(const std::vector< UChar > &naluData)
Void init(TDecEntropy *pcEntropyDecoder, TDecCu *pcMbDecoder, TDecConformanceCheck *pDecConformanceCheck)
NalUnitType getNalUnitType() const
Void init(TDecEntropy *pcEntropyDecoder, TComTrQuant *pcTrQuant, TComPrediction *pcPrediction, TDecConformanceCheck *pConformanceCheck)
initialize access channels
Bool getOutputMark() const
UInt m_temporalId
temporal_id
Void setNumRefIdx(RefPicList e, Int i)
Void setScalingListDec(const TComScalingList &scalingList)
TComSlice * swapSliceObject(TComSlice *p, UInt i)
Bool decode(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay)
Void setPicOutputFlag(Bool b)
Void setDefaultScalingList()
Void checkNoOutputPriorPics(TComList< TComPic * > *rpcListPic)
Void setReferenced(Bool b)
TComPic * getRefPic(RefPicList e, Int iRefIdx)
Bool m_each_tile_one_tile_set_flag
Void xParsePrefixSEImessages()
UInt getSliceCurEndCtuTsAddr() const
Bool getExtendedPrecisionProcessingFlag() const
Void setCurrSliceIdx(UInt i)
Void xDecodePPS(const std::vector< UChar > &naluData)
UInt getMaxCUWidth() const
const TComSPS * getSPS() const