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-2013, 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 | |
---|
34 | /** \file TDecCAVLC.h |
---|
35 | \brief CAVLC decoder class (header) |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef __TDECCAVLC__ |
---|
39 | #define __TDECCAVLC__ |
---|
40 | |
---|
41 | #if _MSC_VER > 1000 |
---|
42 | #pragma once |
---|
43 | #endif // _MSC_VER > 1000 |
---|
44 | |
---|
45 | #include "TDecEntropy.h" |
---|
46 | #include "SyntaxElementParser.h" |
---|
47 | |
---|
48 | //! \ingroup TLibDecoder |
---|
49 | //! \{ |
---|
50 | |
---|
51 | // ==================================================================================================================== |
---|
52 | // Class definition |
---|
53 | // ==================================================================================================================== |
---|
54 | |
---|
55 | /// CAVLC decoder class |
---|
56 | class TDecCavlc : public SyntaxElementParser, public TDecEntropyIf |
---|
57 | { |
---|
58 | public: |
---|
59 | TDecCavlc(); |
---|
60 | virtual ~TDecCavlc(); |
---|
61 | |
---|
62 | protected: |
---|
63 | void parseShortTermRefPicSet (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx); |
---|
64 | |
---|
65 | #if H_3D |
---|
66 | Int** m_aaiTempScale; |
---|
67 | Int** m_aaiTempOffset; |
---|
68 | #endif |
---|
69 | public: |
---|
70 | |
---|
71 | /// rest entropy coder by intial QP and IDC in CABAC |
---|
72 | Void resetEntropy ( TComSlice* /*pcSlice*/ ) { assert(0); }; |
---|
73 | Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; } |
---|
74 | Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); |
---|
75 | Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ); |
---|
76 | Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); |
---|
77 | Void parseVPS ( TComVPS* pcVPS ); |
---|
78 | #if H_MV |
---|
79 | Void parseVPSExtension ( TComVPS* pcVPS ); |
---|
80 | #if H_MV_6_PS_REP_FORM_18_19_20 |
---|
81 | Void parseRepFormat ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat ); |
---|
82 | #else |
---|
83 | Void parseRepFormat ( TComRepFormat* pcRepFormat ); |
---|
84 | #endif |
---|
85 | Void parseVPSVUI ( TComVPS* pcVPS ); |
---|
86 | #if H_MV_6_PS_O0118_33 |
---|
87 | Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo ); |
---|
88 | #endif |
---|
89 | #if H_MV_6_HRD_O0217_13 |
---|
90 | Void parseDpbSize ( TComVPS* pcVPS ); |
---|
91 | #endif |
---|
92 | #if H_MV_6_HRD_O0164_15 |
---|
93 | Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS ); |
---|
94 | #endif |
---|
95 | #endif |
---|
96 | |
---|
97 | #if H_MV |
---|
98 | Void parseSPSExtension ( TComSPS* pcSPS ); |
---|
99 | #endif |
---|
100 | #if H_3D |
---|
101 | Void parseVPSExtension2 ( TComVPS* pcVPS ); |
---|
102 | Void parseSPSExtension2 ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); |
---|
103 | Void parseSPS ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag ); |
---|
104 | #else |
---|
105 | Void parseSPS ( TComSPS* pcSPS ); |
---|
106 | #endif |
---|
107 | |
---|
108 | #if DLT_DIFF_CODING_IN_PPS |
---|
109 | Void parsePPS ( TComPPS* pcPPS, TComVPS* pcVPS ); |
---|
110 | Void parsePPSExtension ( TComPPS* pcPPS, TComVPS* pcVPS ); |
---|
111 | #else |
---|
112 | Void parsePPS ( TComPPS* pcPPS); |
---|
113 | #endif |
---|
114 | |
---|
115 | Void parsePPS ( TComPPS* pcPPS); |
---|
116 | Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); |
---|
117 | Void parseSEI ( SEIMessages& ); |
---|
118 | Void parsePTL ( TComPTL *rpcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1 ); |
---|
119 | Void parseProfileTier (ProfileTierLevel *ptl); |
---|
120 | Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); |
---|
121 | Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager); |
---|
122 | Void parseTerminatingBit ( UInt& ruiBit ); |
---|
123 | |
---|
124 | Void parseMVPIdx ( Int& riMVPIdx ); |
---|
125 | |
---|
126 | Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
127 | Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
128 | Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); |
---|
129 | Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); |
---|
130 | #if H_3D_ARP |
---|
131 | Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
132 | #endif |
---|
133 | #if H_3D_IC |
---|
134 | Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
135 | #endif |
---|
136 | #if H_3D_INTER_SDC |
---|
137 | Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
138 | Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); |
---|
139 | #endif |
---|
140 | Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
141 | Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
142 | Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
143 | |
---|
144 | Void parseIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
145 | |
---|
146 | Void parseIntraDirChroma ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
147 | |
---|
148 | Void parseInterDir ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx ); |
---|
149 | Void parseRefFrmIdx ( TComDataCU* pcCU, Int& riRefFrmIdx, RefPicList eRefList ); |
---|
150 | Void parseMvd ( TComDataCU* pcCU, UInt uiAbsPartAddr,UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ); |
---|
151 | |
---|
152 | Void parseDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
153 | Void parseCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ); |
---|
154 | Void parseTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, UInt uiDepth, TextType eTType); |
---|
155 | |
---|
156 | Void parseIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); |
---|
157 | |
---|
158 | Void updateContextTables ( SliceType /*eSliceType*/, Int /*iQp*/ ) { return; } |
---|
159 | |
---|
160 | Void xParsePredWeightTable ( TComSlice* pcSlice ); |
---|
161 | Void parseScalingList ( TComScalingList* scalingList ); |
---|
162 | Void xDecodeScalingList ( TComScalingList *scalingList, UInt sizeId, UInt listId); |
---|
163 | protected: |
---|
164 | Bool xMoreRbspData(); |
---|
165 | }; |
---|
166 | |
---|
167 | //! \} |
---|
168 | |
---|
169 | #endif // !defined(AFX_TDECCAVLC_H__9732DD64_59B0_4A41_B29E_1A5B18821EAD__INCLUDED_) |
---|
170 | |
---|