HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TDecTop.h
Go to the documentation of this file.
1 /* The copyright in this software is being made available under the BSD
2  * License, included below. This software may be subject to other third party
3  * and contributor rights, including patent rights, and no such rights are
4  * granted under this license.
5  *
6  * Copyright (c) 2010-2017, ITU/ISO/IEC
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18  * be used to endorse or promote products derived from this software without
19  * specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31  * THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
38 #ifndef __TDECTOP__
39 #define __TDECTOP__
40 
41 #include "TLibCommon/CommonDef.h"
42 #include "TLibCommon/TComList.h"
43 #include "TLibCommon/TComPicYuv.h"
44 #include "TLibCommon/TComPic.h"
45 #include "TLibCommon/TComTrQuant.h"
47 #include "TLibCommon/SEI.h"
48 
49 #include "TDecGop.h"
50 #include "TDecEntropy.h"
51 #include "TDecSbac.h"
52 #include "TDecCAVLC.h"
53 #include "SEIread.h"
54 #include "TDecConformance.h"
55 
56 class InputNALUnit;
57 
60 
61 // ====================================================================================================================
62 // Class definition
63 // ====================================================================================================================
64 
66 class TDecTop
67 {
68 private:
70 
74 
75  TComList<TComPic*> m_cListPic; // Dynamic buffer
76  ParameterSetManager m_parameterSetManager; // storage for parameter sets
78 
80 
81  // functional classes
95 
96  Bool isSkipPictureForBLA(Int& iPOCLastDisplay);
97  Bool isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay);
109  Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic
110 #if O0043_BEST_EFFORT_DECODING
111  UInt m_forceDecodeBitDepth;
112 #endif
114 
116 
117 #if MCTS_ENC_CHECK
119 
120 #endif
121  std::list<InputNALUnit*> m_prefixSEINALUs;
122 public:
123  TDecTop();
124  virtual ~TDecTop();
125 
126  Void create ();
127  Void destroy ();
128 
130 #if MCTS_ENC_CHECK
132 
133 #endif
134  Void init();
135  Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
137 
138 
139  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
141 
147 #if O0043_BEST_EFFORT_DECODING
148  Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; }
149 #endif
150  Void setDecodedSEIMessageOutputStream(std::ostream *pOpStream) { m_pDecodedSEIOutputStream = pOpStream; }
152 
153 protected:
154  Void xGetNewPicBuffer (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
155  Void xCreateLostPicture (Int iLostPOC);
156 
158  Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
159  Void xDecodeVPS(const std::vector<UChar> &naluData);
160  Void xDecodeSPS(const std::vector<UChar> &naluData);
161  Void xDecodePPS(const std::vector<UChar> &naluData);
164 #if MCTS_ENC_CHECK
166 #endif
168 
169 };// END CLASS DEFINITION TDecTop
170 
171 
173 
174 #endif // __TDECTOP__
175 
Void executeLoopFilters(Int &poc, TComList< TComPic * > *&rpcListPic)
Definition: TDecTop.cpp:219
TDecTop()
Buffered up prefix SEI NAL Units.
Definition: TDecTop.cpp:45
Void setDecodedSEIMessageOutputStream(std::ostream *pOpStream)
Definition: TDecTop.h:150
SBAC decoder class (header)
TDecConformanceCheck m_conformanceCheck
Definition: TDecTop.h:94
Bool getFirstSliceInSequence()
Definition: TDecTop.h:145
Bool m_isNoOutputPriorPics
Definition: TDecTop.h:108
TDecCu m_cCuDecoder
Definition: TDecTop.h:86
prediction class (header)
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
Defines version information, constants and small in-line functions.
void Void
Definition: TypeDef.h:203
Bool m_warningMessageSkipPicture
Definition: TDecTop.h:115
Void xUpdatePreviousTid0POC(TComSlice *pSlice)
Definition: TDecTop.h:162
Int m_prevPOC
Definition: TDecTop.h:100
Void init()
Definition: TDecTop.cpp:129
TComSlice * m_apcSlicePilot
Definition: TDecTop.h:77
TDecSbac m_cSbacDecoder
Definition: TDecTop.h:89
TComPrediction m_cPrediction
Definition: TDecTop.h:82
Void xActivateParameterSets()
Definition: TDecTop.cpp:306
Bool getNoOutputPriorPicsFlag()
Definition: TDecTop.h:142
unsigned int UInt
Definition: TypeDef.h:212
Void setFirstSliceInSequence(bool val)
Definition: TDecTop.h:146
deblocking filter class
GOP decoder class (header)
Bool isSkipPictureForBLA(Int &iPOCLastDisplay)
Definition: TDecTop.cpp:932
CAVLC decoder class.
Definition: TDecCAVLC.h:56
picture class (header)
UInt getNumberOfChecksumErrorsDetected() const
Definition: TDecGop.h:102
SBAC decoder class.
Definition: TDecSbac.h:63
Void xAnalysePrefixSEImessages()
Definition: TDecTop.cpp:463
TDecCavlc m_cCavlcDecoder
Definition: TDecTop.h:88
Bool m_bFirstSliceInSequence
Definition: TDecTop.h:103
virtual ~TDecTop()
Definition: TDecTop.cpp:97
Int m_pocCRA
POC number of the latest CRA picture.
Definition: TDecTop.h:72
entropy decoder class (header)
Void xGetNewPicBuffer(const TComSPS &sps, const TComPPS &pps, TComPic *&rpcPic, const UInt temporalLayer)
Definition: TDecTop.cpp:164
CAVLC decoder class (header)
Int m_prevTid0POC
Definition: TDecTop.h:101
TComLoopFilter m_cLoopFilter
Definition: TDecTop.h:92
general list class (header)
Void setFirstSliceInPicture(bool val)
Definition: TDecTop.h:144
std::list< InputNALUnit * > m_prefixSEINALUs
Definition: TDecTop.h:121
bool Bool
Definition: TypeDef.h:204
Int m_iMaxRefPicNum
Definition: TDecTop.h:69
Bool isRandomAccessSkipPicture(Int &iSkipFrame, Int &iPOCLastDisplay)
Definition: TDecTop.cpp:956
CU decoder class.
Definition: TDecCu.h:57
TComList< TComPic * > m_cListPic
Definition: TDecTop.h:75
Int m_pocRandomAccess
POC number of the random access point (the first IDR or CRA picture)
Definition: TDecTop.h:73
PPS class.
Definition: TComSlice.h:1034
Void setDecodedPictureHashSEIEnabled(Int enabled)
Definition: TDecTop.h:129
Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay)
Definition: TDecTop.cpp:486
NalUnitType m_associatedIRAPType
NAL unit type of the associated IRAP picture.
Definition: TDecTop.h:71
Bool m_craNoRaslOutputFlag
Definition: TDecTop.h:109
Void deletePicBuffer()
Definition: TDecTop.cpp:142
Int m_lastPOCNoOutputPriorPics
Definition: TDecTop.h:107
Void xCreateLostPicture(Int iLostPOC)
Definition: TDecTop.cpp:261
Bool m_prevSliceSkipped
Definition: TDecTop.h:104
TComTrQuant m_cTrQuant
Definition: TDecTop.h:83
TDecEntropy m_cEntropyDecoder
Definition: TDecTop.h:87
Void setNoOutputPriorPicsFlag(Bool val)
Definition: TDecTop.h:143
picture YUV buffer class (header)
Bool m_tmctsCheckEnabled
Definition: TDecTop.h:118
entropy decoder class
Definition: TDecEntropy.h:117
TDecGop m_cGopDecoder
Definition: TDecTop.h:84
Int getPOC() const
Definition: TComSlice.h:1354
SEIReader m_seiReader
Definition: TDecTop.h:91
Void setTMctsCheckEnabled(Bool enabled)
Definition: TDecTop.h:131
TDecBinCABAC m_cBinCABAC
Definition: TDecTop.h:90
decoder class
Definition: TDecTop.h:66
UInt m_uiSliceIdx
Definition: TDecTop.h:99
ParameterSetManager m_parameterSetManager
Definition: TDecTop.h:76
Void destroy()
Definition: TDecTop.cpp:119
Bool m_bFirstSliceInPicture
Definition: TDecTop.h:102
Bool isReferenceNalu() const
Definition: TComSlice.h:1388
TComSampleAdaptiveOffset m_cSAO
Definition: TDecTop.h:93
SEIMessages m_SEIs
List of SEI messages that have been received before the first slice and between slices, excluding prefix SEIs...
Definition: TDecTop.h:79
std::ostream * m_pDecodedSEIOutputStream
Definition: TDecTop.h:113
GOP decoder class.
Definition: TDecGop.h:66
transform and quantization class
Definition: TComTrQuant.h:98
std::list< SEI * > SEIMessages
Definition: SEI.h:123
Void xDecodeSPS(const std::vector< UChar > &naluData)
Definition: TDecTop.cpp:761
Int m_skippedPOC
Definition: TDecTop.h:105
TDecSlice m_cSliceDecoder
Definition: TDecTop.h:85
int Int
Definition: TypeDef.h:211
Bool m_bFirstSliceInBitstream
Definition: TDecTop.h:106
NalUnitType
Definition: TypeDef.h:664
transform and quantization class (header)
Void xParsePrefixSEIsForUnknownVCLNal()
Definition: TDecTop.cpp:439
Void setDecodedPictureHashSEIEnabled(Int enabled)
Definition: TDecGop.h:101
Void xDecodeVPS(const std::vector< UChar > &naluData)
Definition: TDecTop.cpp:753
NalUnitType getNalUnitType() const
Definition: TComSlice.h:1391
slice header class
Definition: TComSlice.h:1225
UInt getTLayer() const
Definition: TComSlice.h:1453
Bool decode(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay)
Definition: TDecTop.cpp:778
Decoder conformance functions (header)
slice decoder class
Definition: TDecSlice.h:63
TComPic * m_pcPic
Definition: TDecTop.h:98
Void create()
Definition: TDecTop.cpp:112
Void checkNoOutputPriorPics(TComList< TComPic * > *rpcListPic)
Definition: TDecTop.cpp:242
reading funtionality for SEI messages
Void xParsePrefixSEImessages()
Definition: TDecTop.cpp:451
Void xDecodePPS(const std::vector< UChar > &naluData)
Definition: TDecTop.cpp:771
UInt getNumberOfChecksumErrorsDetected() const
Definition: TDecTop.h:151
SPS class.
Definition: TComSlice.h:740