HEVC Test Model (HM)  HM-16.3
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-2015, 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 
55 struct InputNALUnit;
56 
59 
60 // ====================================================================================================================
61 // Class definition
62 // ====================================================================================================================
63 
65 class TDecTop
66 {
67 private:
69 
73 
74  TComList<TComPic*> m_cListPic; // Dynamic buffer
75  ParameterSetManager m_parameterSetManager; // storage for parameter sets
77 
79 
80  // functional classes
93 
94  Bool isSkipPictureForBLA(Int& iPOCLastDisplay);
95  Bool isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay);
106  Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic
107 #if O0043_BEST_EFFORT_DECODING
108  UInt m_forceDecodeBitDepth;
109 #endif
111 
112 public:
113  TDecTop();
114  virtual ~TDecTop();
115 
116  Void create ();
117  Void destroy ();
118 
120 
121  Void init();
122  Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
124 
125 
126  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
128 
130  Void setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; }
131  Void setFirstSliceInPicture (bool val) { m_bFirstSliceInPicture = val; }
133  Void setFirstSliceInSequence (bool val) { m_bFirstSliceInSequence = val; }
134 #if O0043_BEST_EFFORT_DECODING
135  Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; }
136 #endif
137  Void setDecodedSEIMessageOutputStream(std::ostream *pOpStream) { m_pDecodedSEIOutputStream = pOpStream; }
138 
139 protected:
140  Void xGetNewPicBuffer (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
141  Void xCreateLostPicture (Int iLostPOC);
142 
144  Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
145  Void xDecodeVPS(const std::vector<UChar> *pNaluData);
146  Void xDecodeSPS(const std::vector<UChar> *pNaluData);
147  Void xDecodePPS(const std::vector<UChar> *pNaluData);
148  Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
149 
150 };// END CLASS DEFINITION TDecTop
151 
152 
154 
155 #endif // __TDECTOP__
156 
Void executeLoopFilters(Int &poc, TComList< TComPic * > *&rpcListPic)
Definition: TDecTop.cpp:179
TDecTop()
Definition: TDecTop.cpp:47
Void setDecodedSEIMessageOutputStream(std::ostream *pOpStream)
Definition: TDecTop.h:137
Void xDecodeSPS(const std::vector< UChar > *pNaluData)
Definition: TDecTop.cpp:644
SBAC decoder class (header)
Bool getFirstSliceInSequence()
Definition: TDecTop.h:132
Bool m_isNoOutputPriorPics
Definition: TDecTop.h:105
TDecCu m_cCuDecoder
Definition: TDecTop.h:85
prediction class (header)
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
Defines constants, macros and tool parameters.
void Void
Definition: TypeDef.h:285
Void xDecodeSEI(TComInputBitstream *bs, const NalUnitType nalUnitType)
Definition: TDecTop.cpp:661
Int m_prevPOC
Definition: TDecTop.h:98
Void init()
Definition: TDecTop.cpp:101
TComSlice * m_apcSlicePilot
Definition: TDecTop.h:76
TDecSbac m_cSbacDecoder
Definition: TDecTop.h:88
TComPrediction m_cPrediction
Definition: TDecTop.h:81
Void xActivateParameterSets()
Definition: TDecTop.cpp:265
Bool getNoOutputPriorPicsFlag()
Definition: TDecTop.h:129
unsigned int UInt
Definition: TypeDef.h:297
Void setFirstSliceInSequence(bool val)
Definition: TDecTop.h:133
deblocking filter class
GOP decoder class (header)
Bool isSkipPictureForBLA(Int &iPOCLastDisplay)
Definition: TDecTop.cpp:822
CAVLC decoder class.
Definition: TDecCAVLC.h:56
picture class (header)
SBAC decoder class.
Definition: TDecSbac.h:63
TDecCavlc m_cCavlcDecoder
Definition: TDecTop.h:87
Bool m_bFirstSliceInSequence
Definition: TDecTop.h:100
virtual ~TDecTop()
Definition: TDecTop.cpp:74
Int m_pocCRA
POC number of the latest CRA picture.
Definition: TDecTop.h:71
entropy decoder class (header)
Void xGetNewPicBuffer(const TComSPS &sps, const TComPPS &pps, TComPic *&rpcPic, const UInt temporalLayer)
Definition: TDecTop.cpp:132
CAVLC decoder class (header)
TComLoopFilter m_cLoopFilter
Definition: TDecTop.h:91
general list class (header)
Void setFirstSliceInPicture(bool val)
Definition: TDecTop.h:131
bool Bool
Definition: TypeDef.h:286
Int m_iMaxRefPicNum
Definition: TDecTop.h:68
Bool isRandomAccessSkipPicture(Int &iSkipFrame, Int &iPOCLastDisplay)
Definition: TDecTop.cpp:846
CU decoder class.
Definition: TDecCu.h:56
TComList< TComPic * > m_cListPic
Definition: TDecTop.h:74
Int m_pocRandomAccess
POC number of the random access point (the first IDR or CRA picture)
Definition: TDecTop.h:72
PPS class.
Definition: TComSlice.h:977
Void setDecodedPictureHashSEIEnabled(Int enabled)
Definition: TDecTop.h:119
Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay)
Definition: TDecTop.cpp:383
NalUnitType m_associatedIRAPType
NAL unit type of the associated IRAP picture.
Definition: TDecTop.h:70
Bool m_craNoRaslOutputFlag
Definition: TDecTop.h:106
Void xDecodeVPS(const std::vector< UChar > *pNaluData)
Definition: TDecTop.cpp:636
Void deletePicBuffer()
Definition: TDecTop.cpp:110
Int m_lastPOCNoOutputPriorPics
Definition: TDecTop.h:104
Void xCreateLostPicture(Int iLostPOC)
Definition: TDecTop.cpp:221
Bool m_prevSliceSkipped
Definition: TDecTop.h:101
TComTrQuant m_cTrQuant
Definition: TDecTop.h:82
TDecEntropy m_cEntropyDecoder
Definition: TDecTop.h:86
Void setNoOutputPriorPicsFlag(Bool val)
Definition: TDecTop.h:130
picture YUV buffer class (header)
entropy decoder class
Definition: TDecEntropy.h:116
TDecGop m_cGopDecoder
Definition: TDecTop.h:83
SEIReader m_seiReader
Definition: TDecTop.h:90
TDecBinCABAC m_cBinCABAC
Definition: TDecTop.h:89
decoder class
Definition: TDecTop.h:65
UInt m_uiSliceIdx
Definition: TDecTop.h:97
ParameterSetManager m_parameterSetManager
Definition: TDecTop.h:75
Void destroy()
Definition: TDecTop.cpp:91
Bool m_bFirstSliceInPicture
Definition: TDecTop.h:99
TComSampleAdaptiveOffset m_cSAO
Definition: TDecTop.h:92
SEIMessages m_SEIs
List of SEI messages that have been received before the first slice and between slices.
Definition: TDecTop.h:78
std::ostream * m_pDecodedSEIOutputStream
Definition: TDecTop.h:110
GOP decoder class.
Definition: TDecGop.h:66
transform and quantization class
Definition: TComTrQuant.h:98
std::list< SEI * > SEIMessages
Definition: SEI.h:479
Int m_skippedPOC
Definition: TDecTop.h:102
TDecSlice m_cSliceDecoder
Definition: TDecTop.h:84
int Int
Definition: TypeDef.h:296
Bool m_bFirstSliceInBitstream
Definition: TDecTop.h:103
Void xDecodePPS(const std::vector< UChar > *pNaluData)
Definition: TDecTop.cpp:654
NalUnitType
Definition: CommonDef.h:218
transform and quantization class (header)
Void setDecodedPictureHashSEIEnabled(Int enabled)
Definition: TDecGop.h:100
slice header class
Definition: TComSlice.h:1198
Bool decode(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay)
Definition: TDecTop.cpp:684
slice decoder class
Definition: TDecSlice.h:61
TComPic * m_pcPic
Definition: TDecTop.h:96
Void create()
Definition: TDecTop.cpp:84
Void checkNoOutputPriorPics(TComList< TComPic * > *rpcListPic)
Definition: TDecTop.cpp:202
reading funtionality for SEI messages
SPS class.
Definition: TComSlice.h:722