1 | |
---|
2 | |
---|
3 | /** \file TDecTop.h |
---|
4 | \brief decoder class (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __TDECTOP__ |
---|
8 | #define __TDECTOP__ |
---|
9 | |
---|
10 | #include "../TLibCommon/CommonDef.h" |
---|
11 | #include "../TLibCommon/TComList.h" |
---|
12 | #include "../TLibCommon/TComPicYuv.h" |
---|
13 | #include "../TLibCommon/TComPic.h" |
---|
14 | #include "../TLibCommon/TComTrQuant.h" |
---|
15 | #include "../TLibCommon/TComDepthMapGenerator.h" |
---|
16 | #include "../TLibCommon/TComResidualGenerator.h" |
---|
17 | #include "../TLibCommon/SEI.h" |
---|
18 | |
---|
19 | #include "TDecGop.h" |
---|
20 | #include "TDecEntropy.h" |
---|
21 | #include "TDecSbac.h" |
---|
22 | #include "TDecCAVLC.h" |
---|
23 | |
---|
24 | // ==================================================================================================================== |
---|
25 | // Class definition |
---|
26 | // ==================================================================================================================== |
---|
27 | |
---|
28 | class TAppDecTop ; |
---|
29 | |
---|
30 | |
---|
31 | class CamParsCollector |
---|
32 | { |
---|
33 | public: |
---|
34 | CamParsCollector (); |
---|
35 | ~CamParsCollector (); |
---|
36 | |
---|
37 | Void init ( FILE* pCodedScaleOffsetFile ); |
---|
38 | Void uninit (); |
---|
39 | Void setSlice ( TComSlice* pcSlice ); |
---|
40 | |
---|
41 | private: |
---|
42 | Bool xIsComplete (); |
---|
43 | Void xOutput ( Int iPOC ); |
---|
44 | |
---|
45 | private: |
---|
46 | Bool m_bInitialized; |
---|
47 | FILE* m_pCodedScaleOffsetFile; |
---|
48 | |
---|
49 | Int** m_aaiCodedOffset; |
---|
50 | Int** m_aaiCodedScale; |
---|
51 | Int* m_aiViewOrderIndex; |
---|
52 | Int* m_aiViewReceived; |
---|
53 | UInt m_uiCamParsCodedPrecision; |
---|
54 | Bool m_bCamParsVaryOverTime; |
---|
55 | Int m_iLastViewId; |
---|
56 | Int m_iLastPOC; |
---|
57 | UInt m_uiMaxViewId; |
---|
58 | }; |
---|
59 | |
---|
60 | |
---|
61 | /// decoder class |
---|
62 | class TDecTop |
---|
63 | { |
---|
64 | private: |
---|
65 | Int m_iGopSize; |
---|
66 | Bool m_bGopSizeSet; |
---|
67 | int m_iMaxRefPicNum; |
---|
68 | |
---|
69 | #if DCM_DECODING_REFRESH |
---|
70 | Bool m_bRefreshPending; ///< refresh pending flag |
---|
71 | UInt m_uiPOCCDR; ///< temporal reference of the CDR picture |
---|
72 | #if DCM_SKIP_DECODING_FRAMES |
---|
73 | UInt m_uiPOCRA; ///< temporal reference of the random access point |
---|
74 | #endif |
---|
75 | #endif |
---|
76 | |
---|
77 | UInt m_uiValidPS; |
---|
78 | TComList<TComPic*> m_cListPic; // Dynamic buffer |
---|
79 | TComSPS m_cSPS; |
---|
80 | TComPPS m_cPPS; |
---|
81 | TComSlice* m_apcSlicePilot; |
---|
82 | |
---|
83 | SEImessages *m_SEIs; ///< "all" SEI messages. If not NULL, we own the object. |
---|
84 | |
---|
85 | // functional classes |
---|
86 | TComPrediction m_cPrediction; |
---|
87 | TComTrQuant m_cTrQuant; |
---|
88 | TDecGop m_cGopDecoder; |
---|
89 | TDecSlice m_cSliceDecoder; |
---|
90 | TDecCu m_cCuDecoder; |
---|
91 | TDecEntropy m_cEntropyDecoder; |
---|
92 | TDecCavlc m_cCavlcDecoder; |
---|
93 | TDecSbac m_cSbacDecoder; |
---|
94 | TDecBinCABAC m_cBinCABAC; |
---|
95 | TComLoopFilter m_cLoopFilter; |
---|
96 | TComAdaptiveLoopFilter m_cAdaptiveLoopFilter; |
---|
97 | #if MTK_SAO |
---|
98 | TComSampleAdaptiveOffset m_cSAO; |
---|
99 | #endif |
---|
100 | TComDepthMapGenerator m_cDepthMapGenerator; |
---|
101 | TComResidualGenerator m_cResidualGenerator; |
---|
102 | |
---|
103 | Bool m_bIsDepth; |
---|
104 | Int m_iViewIdx; |
---|
105 | TAppDecTop* m_pcTAppDecTop; |
---|
106 | CamParsCollector* m_pcCamParsCollector; |
---|
107 | |
---|
108 | #if DCM_SKIP_DECODING_FRAMES |
---|
109 | Bool isRandomAccessSkipPicture(Int& iSkipFrame, Int& iPOCLastDisplay); |
---|
110 | #endif |
---|
111 | TComPic* m_pcPic; |
---|
112 | UInt m_uiSliceIdx; |
---|
113 | UInt m_uiLastSliceIdx; |
---|
114 | UInt m_uiPrevPOC; |
---|
115 | Bool m_bFirstSliceInPicture; |
---|
116 | Bool m_bFirstSliceInSequence; |
---|
117 | |
---|
118 | public: |
---|
119 | TDecTop(); |
---|
120 | virtual ~TDecTop(); |
---|
121 | |
---|
122 | Void create (); |
---|
123 | Void destroy (); |
---|
124 | |
---|
125 | void setPictureDigestEnabled(bool enabled) { m_cGopDecoder.setPictureDigestEnabled(enabled); } |
---|
126 | |
---|
127 | Void init( TAppDecTop* pcTAppDecTop, Bool bFirstInstance = true ); |
---|
128 | #if DCM_SKIP_DECODING_FRAMES |
---|
129 | Bool decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay); |
---|
130 | #else |
---|
131 | Void decode ( Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS ); |
---|
132 | #endif |
---|
133 | |
---|
134 | TComSPS *getSPS() { return (m_uiValidPS & 1) ? &m_cSPS : NULL; } |
---|
135 | |
---|
136 | Void deletePicBuffer(); |
---|
137 | |
---|
138 | Void deleteExtraPicBuffers( Int iPoc ); |
---|
139 | #if AMVP_BUFFERCOMPRESS |
---|
140 | Void compressMotion ( Int iPoc ); |
---|
141 | #endif |
---|
142 | |
---|
143 | Void setViewIdx(Int i) { m_iViewIdx = i ;} |
---|
144 | Int getViewIdx() { return m_iViewIdx ; } |
---|
145 | |
---|
146 | Void setToDepth(Bool b) { m_bIsDepth = b ;} |
---|
147 | Bool getIsDepth() { return m_bIsDepth ;} |
---|
148 | |
---|
149 | Void setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; } |
---|
150 | |
---|
151 | // SB |
---|
152 | TComList<TComPic*>* getListPic () { return &m_cListPic; } |
---|
153 | TAppDecTop* getDecTop ( ){ return m_pcTAppDecTop ;}; |
---|
154 | |
---|
155 | Void setSPS (TComSPS cSPS ); |
---|
156 | |
---|
157 | UInt getCodedPictureBufferSize() { return m_cSPS.getCodedPictureBufferSize() ; } |
---|
158 | |
---|
159 | Void executeDeblockAndAlf(Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, Int& iSkipFrame, Int& iPOCLastDisplay); |
---|
160 | |
---|
161 | protected: |
---|
162 | Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); |
---|
163 | |
---|
164 | };// END CLASS DEFINITION TDecTop |
---|
165 | |
---|
166 | |
---|
167 | #endif // __TDECTOP__ |
---|
168 | |
---|