source: 3DVCSoftware/branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.h @ 427

Last change on this file since 427 was 427, checked in by tech, 11 years ago

Merged HTM-6.2-dev1-LG

  • Property svn:eol-style set to native
File size: 8.9 KB
Line 
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-2012, 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
47//! \ingroup TLibDecoder
48//! \{
49
50// ====================================================================================================================
51// Class definition
52// ====================================================================================================================
53
54class SEImessages;
55
56/// CAVLC decoder class
57class TDecCavlc : public TDecEntropyIf
58{
59public:
60  TDecCavlc();
61  virtual ~TDecCavlc();
62 
63protected:
64  Void  xReadCode             (UInt   uiLength, UInt& ruiCode);
65  Void  xReadUvlc             (UInt&  ruiVal);
66  Void  xReadSvlc             (Int&   riVal);
67  Void  xReadFlag             (UInt&  ruiCode);
68  Void  xReadEpExGolomb       ( UInt& ruiSymbol, UInt uiCount );
69  Void  xReadExGolombLevel    ( UInt& ruiSymbol );
70  Void  xReadUnaryMaxSymbol   ( UInt& ruiSymbol, UInt uiMaxSymbol );
71#if ENC_DEC_TRACE
72  Void  xReadCodeTr           (UInt  length, UInt& rValue, const Char *pSymbolName);
73  Void  xReadUvlcTr           (              UInt& rValue, const Char *pSymbolName);
74  Void  xReadSvlcTr           (               Int& rValue, const Char *pSymbolName);
75  Void  xReadFlagTr           (              UInt& rValue, const Char *pSymbolName);
76#endif
77#if QC_MVHEVC_B0046
78  Void  xReadVPSAlignOne      ();
79#endif
80  Void  xReadPCMAlignZero     ();
81
82  UInt  xGetBit             ();
83 
84  void  parseShortTermRefPicSet            (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx);
85private:
86  TComInputBitstream*   m_pcBitstream;
87  Int           m_iSliceGranularity; //!< slice granularity
88 
89  Int**    m_aaiTempScale;
90  Int**    m_aaiTempOffset;
91  Int**    m_aaiTempPdmScaleNomDelta;
92  Int**    m_aaiTempPdmOffset;
93 
94public:
95
96  /// rest entropy coder by intial QP and IDC in CABAC
97#if !CABAC_INIT_FLAG
98  Void  resetEntropy        (Int  iQp, Int iID) { printf("Not supported yet\n"); assert(0); exit(1);}
99  Void  resetEntropy        ( TComSlice* pcSlice  );
100#else
101  Void  resetEntropy        ( TComSlice* pcSlice  )     { assert(0); };
102#endif
103  Void  setBitstream        ( TComInputBitstream* p )   { m_pcBitstream = p; }
104  /// set slice granularity
105  Void setSliceGranularity(Int iSliceGranularity)  {m_iSliceGranularity = iSliceGranularity;}
106
107  /// get slice granularity
108  Int  getSliceGranularity()                       {return m_iSliceGranularity;             }
109  Void  parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize );
110  Void  parseQtCbf          ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth );
111  Void  parseQtRootCbf      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf );
112
113#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
114  Void  parseVPS            ( TComVPS* pcVPS );
115#endif
116#if HHI_MPI || H3D_QTL
117  Void  parseSPS            ( TComSPS* pcSPS, Bool bIsDepth );
118#else
119  Void  parseSPS            ( TComSPS* pcSPS );
120#endif
121  Void  parsePPS            ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet);
122  Void  parseSEI(SEImessages&);
123  Void  parseAPS            ( TComAPS* pAPS );
124#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
125  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth);
126#else
127  Void  parseSliceHeader    ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet);
128#endif
129  Void  parseTerminatingBit ( UInt& ruiBit );
130 
131#if H3D_IVMP
132  Void  parseMVPIdx         ( Int& riMVPIdx, Int iAMVPCands );
133#else
134  Void  parseMVPIdx         ( Int& riMVPIdx );
135#endif
136 
137  Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
138#if LGE_ILLUCOMP_B0045
139  Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
140#endif
141  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
142  Void parseMergeIndex      ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
143#if H3D_IVRP
144  Void parseResPredFlag     ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
145#endif
146#if QC_ARP_D0177
147  Void parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx,UInt uiDepth );
148#endif
149  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
150  Void parsePartSize        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
151  Void parsePredMode        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
152 
153  Void parseIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
154 
155  Void parseIntraDirChroma  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
156 
157  Void parseInterDir        ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx, UInt uiDepth );
158  Void parseRefFrmIdx       ( TComDataCU* pcCU, Int& riRefFrmIdx,  UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList );
159  Void parseMvd             ( TComDataCU* pcCU, UInt uiAbsPartAddr,UInt uiPartIdx,    UInt uiDepth, RefPicList eRefList );
160 
161  Void parseDeltaQP         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
162  Void parseCoeffNxN        ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType );
163 
164  Void parseIPCMInfo        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth);
165
166  Void readTileMarker     ( UInt& uiTileIdx, UInt uiBitsUsed );
167  Void updateContextTables  ( SliceType eSliceType, Int iQp ) { return; }
168  Void decodeFlush() {};
169
170  Void xParsePredWeightTable ( TComSlice* pcSlice );
171  Void  parseScalingList               ( TComScalingList* scalingList );
172  Void xDecodeScalingList    ( TComScalingList *scalingList, UInt sizeId, UInt listId);
173  Void parseDFFlag         ( UInt& ruiVal, const Char *pSymbolName );
174  Void parseDFSvlc         ( Int&  riVal,  const Char *pSymbolName  );
175#if RWTH_SDC_DLT_B0036
176  Void parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
177  Void parseSDCPredMode    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
178  Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
179#endif
180protected:
181  Void  xParseDblParam       ( TComAPS* aps );
182#if !LGE_SAO_MIGRATION_D0091
183  Void  xParseSaoParam       ( SAOParam* pSaoParam );
184  Void  xParseSaoOffset      (SaoLcuParam* saoLcuParam);
185  Void  xParseSaoUnit        (Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool& repeatedRow );
186#endif
187  Void  xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool acrossSlice = true, Int numLCUInWidth= -1, Int numLCUInHeight= -1);
188  Void  parseAlfParamSet(AlfParamSet* pAlfParamSet, Int firstLCUAddr, Bool alfAcrossSlice);
189  Void  parseAlfFixedLengthRun(UInt& idx, UInt rx, UInt numLCUInWidth);
190  Void  parseAlfStoredFilterIdx(UInt& idx, UInt numFilterSetsInBuffer);
191  Void  xParseAlfParam       ( ALFParam* pAlfParam );
192  Void  xParseAlfCuControlParam(AlfCUCtrlInfo& cAlfParam, Int iNumCUsInPic);
193  Int   xGolombDecode        ( Int k );
194  Bool  xMoreRbspData();
195};
196
197//! \}
198
199#endif // !defined(AFX_TDECCAVLC_H__9732DD64_59B0_4A41_B29E_1A5B18821EAD__INCLUDED_)
200
Note: See TracBrowser for help on using the repository browser.