1 | |
---|
2 | |
---|
3 | /** \file TDecSbac.h |
---|
4 | \brief SBAC decoder class (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __TDECSBAC__ |
---|
8 | #define __TDECSBAC__ |
---|
9 | |
---|
10 | |
---|
11 | #if _MSC_VER > 1000 |
---|
12 | #pragma once |
---|
13 | #endif // _MSC_VER > 1000 |
---|
14 | |
---|
15 | |
---|
16 | #include "TDecEntropy.h" |
---|
17 | #include "TDecBinCoder.h" |
---|
18 | #include "../TLibCommon/ContextTables.h" |
---|
19 | #include "../TLibCommon/ContextModel.h" |
---|
20 | #include "../TLibCommon/ContextModel3DBuffer.h" |
---|
21 | |
---|
22 | // ==================================================================================================================== |
---|
23 | // Class definition |
---|
24 | // ==================================================================================================================== |
---|
25 | |
---|
26 | class SEImessages; |
---|
27 | |
---|
28 | /// SBAC decoder class |
---|
29 | class TDecSbac : public TDecEntropyIf |
---|
30 | { |
---|
31 | public: |
---|
32 | TDecSbac(); |
---|
33 | virtual ~TDecSbac(); |
---|
34 | |
---|
35 | Void init ( TDecBinIf* p ) { m_pcTDecBinIf = p; } |
---|
36 | Void uninit ( ) { m_pcTDecBinIf = 0; } |
---|
37 | |
---|
38 | Void resetEntropy ( TComSlice* pcSlice ); |
---|
39 | Void setBitstream ( TComBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } |
---|
40 | |
---|
41 | Void setAlfCtrl ( Bool bAlfCtrl ) { m_bAlfCtrl = bAlfCtrl; } |
---|
42 | Void setMaxAlfCtrlDepth ( UInt uiMaxAlfCtrlDepth ) { m_uiMaxAlfCtrlDepth = uiMaxAlfCtrlDepth; } |
---|
43 | |
---|
44 | Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) {} |
---|
45 | |
---|
46 | Void parseSPS ( TComSPS* pcSPS ) {} |
---|
47 | Void parsePPS ( TComPPS* pcPPS ) {} |
---|
48 | void parseSEI(SEImessages&) {} |
---|
49 | Void parseSliceHeader ( TComSlice*& rpcSlice ) {} |
---|
50 | Void parseTerminatingBit ( UInt& ruiBit ); |
---|
51 | Void parseMVPIdx ( TComDataCU* pcCU, Int& riMVPIdx, Int iMVPNum, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList ); |
---|
52 | |
---|
53 | Void parseAlfFlag ( UInt& ruiVal ); |
---|
54 | Void parseAlfUvlc ( UInt& ruiVal ); |
---|
55 | Void parseAlfSvlc ( Int& riVal ); |
---|
56 | Void parseAlfCtrlDepth ( UInt& ruiAlfCtrlDepth ); |
---|
57 | #if MTK_SAO |
---|
58 | Void parseAoFlag ( UInt& ruiVal ); |
---|
59 | Void parseAoUvlc ( UInt& ruiVal ); |
---|
60 | Void parseAoSvlc ( Int& riVal ); |
---|
61 | #endif |
---|
62 | private: |
---|
63 | Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); |
---|
64 | Void xReadUnaryMaxSymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol ); |
---|
65 | Void xReadEpExGolomb ( UInt& ruiSymbol, UInt uiCount ); |
---|
66 | #if E253 |
---|
67 | Void xReadGoRiceExGolomb ( UInt &ruiSymbol, UInt &ruiGoRiceParam ); |
---|
68 | #if HHI_DMM_INTRA |
---|
69 | Void xReadExGolombLevel ( UInt& ruiSymbol, ContextModel& rcSCModel ); |
---|
70 | #endif |
---|
71 | #else |
---|
72 | Void xReadExGolombLevel ( UInt& ruiSymbol, ContextModel& rcSCModel ); |
---|
73 | #endif |
---|
74 | |
---|
75 | #if MVD_CTX |
---|
76 | Void xReadMvd ( Int& riMvdComp, UInt uiAbsSumL, UInt uiAbsSumA, UInt uiCtx ); |
---|
77 | #else |
---|
78 | Void xReadMvd ( Int& riMvdComp, UInt uiAbsSum, UInt uiCtx ); |
---|
79 | #endif |
---|
80 | |
---|
81 | Void xReadExGolombMvd ( UInt& ruiSymbol, ContextModel* pcSCModel, UInt uiMaxBin ); |
---|
82 | |
---|
83 | #if HHI_DMM_INTRA |
---|
84 | Void xParseWedgeFullInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
85 | Void xParseWedgeFullDeltaInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
86 | Void xParseWedgePredDirInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
87 | Void xParseWedgePredDirDeltaInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
88 | Void xParseWedgePredTexDeltaInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
89 | Void xParseContourPredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
90 | #endif |
---|
91 | |
---|
92 | private: |
---|
93 | TComBitstream* m_pcBitstream; |
---|
94 | TDecBinIf* m_pcTDecBinIf; |
---|
95 | |
---|
96 | Bool m_bAlfCtrl; |
---|
97 | UInt m_uiMaxAlfCtrlDepth; |
---|
98 | |
---|
99 | public: |
---|
100 | Void parseAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
101 | #if TSB_ALF_HEADER |
---|
102 | Void parseAlfFlagNum ( UInt& ruiVal, UInt minValue, UInt depth ); |
---|
103 | Void parseAlfCtrlFlag ( UInt &ruiAlfCtrlFlag ); |
---|
104 | #endif |
---|
105 | |
---|
106 | Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
107 | Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
108 | #if MW_MVI_SIGNALLING_MODE == 0 |
---|
109 | Void parseMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
110 | #endif |
---|
111 | Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); |
---|
112 | Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
113 | Void parseMergeIndexMV ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
114 | Void parseResPredFlag ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
115 | Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
116 | Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
117 | |
---|
118 | Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
119 | |
---|
120 | Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
121 | |
---|
122 | Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
123 | Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList ); |
---|
124 | Void parseMvd ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ); |
---|
125 | |
---|
126 | Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); |
---|
127 | Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ); |
---|
128 | Void parseQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf ); |
---|
129 | |
---|
130 | Void parseDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
131 | |
---|
132 | Void parseCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ) {} |
---|
133 | Void parseBlockCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth, UInt uiQPartNum ) {} |
---|
134 | |
---|
135 | #if CAVLC_RQT_CBP |
---|
136 | Void parseCbfTrdiv ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiTrDepth, UInt uiDepth, UInt& uiSubdiv ) {} |
---|
137 | #endif |
---|
138 | |
---|
139 | #if PCP_SIGMAP_SIMPLE_LAST |
---|
140 | __inline Void parseLastSignificantXY( UInt& uiPosLastX, UInt& uiPosLastY, const UInt uiWidth, const TextType eTType, const UInt uiCTXIdx, const UInt uiScanIdx ); |
---|
141 | #endif |
---|
142 | Void parseCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ); |
---|
143 | Void parseViewIdx (Int &riViewIdx ); |
---|
144 | |
---|
145 | private: |
---|
146 | UInt m_uiLastDQpNonZero; |
---|
147 | UInt m_uiLastQp; |
---|
148 | |
---|
149 | ContextModel3DBuffer m_cCUSkipFlagSCModel; |
---|
150 | ContextModel3DBuffer m_cCUSplitFlagSCModel; |
---|
151 | #if MW_MVI_SIGNALLING_MODE == 0 |
---|
152 | ContextModel3DBuffer m_cCUMvInheritanceFlagSCModel; |
---|
153 | #endif |
---|
154 | ContextModel3DBuffer m_cCUMergeFlagExtSCModel; |
---|
155 | ContextModel3DBuffer m_cCUMergeIdxExtSCModel; |
---|
156 | ContextModel3DBuffer m_cCUMVMergeIdxExtSCModel; |
---|
157 | ContextModel3DBuffer m_cResPredFlagSCModel; |
---|
158 | ContextModel3DBuffer m_cCUAlfCtrlFlagSCModel; |
---|
159 | ContextModel3DBuffer m_cCUPartSizeSCModel; |
---|
160 | ContextModel3DBuffer m_cCUPredModeSCModel; |
---|
161 | |
---|
162 | ContextModel3DBuffer m_cCUIntraPredSCModel; |
---|
163 | #if ADD_PLANAR_MODE |
---|
164 | ContextModel3DBuffer m_cPlanarFlagSCModel; |
---|
165 | #endif |
---|
166 | ContextModel3DBuffer m_cCUChromaPredSCModel; |
---|
167 | ContextModel3DBuffer m_cCUInterDirSCModel; |
---|
168 | ContextModel3DBuffer m_cCURefPicSCModel; |
---|
169 | ContextModel3DBuffer m_cCUMvdSCModel; |
---|
170 | |
---|
171 | ContextModel3DBuffer m_cCUTransSubdivFlagSCModel; |
---|
172 | ContextModel3DBuffer m_cCUQtRootCbfSCModel; |
---|
173 | ContextModel3DBuffer m_cCUDeltaQpSCModel; |
---|
174 | |
---|
175 | ContextModel3DBuffer m_cCUQtCbfSCModel; |
---|
176 | |
---|
177 | ContextModel3DBuffer m_cCUSigSCModel; |
---|
178 | #if PCP_SIGMAP_SIMPLE_LAST |
---|
179 | ContextModel3DBuffer m_cCuCtxLastX; |
---|
180 | ContextModel3DBuffer m_cCuCtxLastY; |
---|
181 | #else |
---|
182 | ContextModel3DBuffer m_cCULastSCModel; |
---|
183 | #endif |
---|
184 | ContextModel3DBuffer m_cCUOneSCModel; |
---|
185 | ContextModel3DBuffer m_cCUAbsSCModel; |
---|
186 | |
---|
187 | ContextModel3DBuffer m_cMVPIdxSCModel; |
---|
188 | |
---|
189 | ContextModel3DBuffer m_cALFFlagSCModel; |
---|
190 | ContextModel3DBuffer m_cALFUvlcSCModel; |
---|
191 | ContextModel3DBuffer m_cALFSvlcSCModel; |
---|
192 | #if MTK_SAO |
---|
193 | ContextModel3DBuffer m_cAOFlagSCModel; |
---|
194 | ContextModel3DBuffer m_cAOUvlcSCModel; |
---|
195 | ContextModel3DBuffer m_cAOSvlcSCModel; |
---|
196 | #endif |
---|
197 | ContextModel3DBuffer m_cViewIdxSCModel; |
---|
198 | #if HHI_DMM_INTRA |
---|
199 | ContextModel3DBuffer m_cIntraDMMSCModel; |
---|
200 | ContextModel3DBuffer m_cIntraWedgeSCModel; |
---|
201 | #endif |
---|
202 | }; |
---|
203 | |
---|
204 | #endif // !defined(AFX_TDECSBAC_H__CFCAAA19_8110_47F4_9A16_810C4B5499D5__INCLUDED_) |
---|