source: 3DVCSoftware/trunk/source/Lib/TLibDecoder/TDecSbac.h @ 42

Last change on this file since 42 was 42, checked in by tech, 12 years ago

Nokia (Flexible Coding Order)
Ericsson ( High Level Syntax )
changes

  • Property svn:eol-style set to native
File size: 10.1 KB
RevLine 
[5]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-2011, 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 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 */
[2]33
34
[5]35
[2]36/** \file     TDecSbac.h
37    \brief    SBAC decoder class (header)
38*/
39
40#ifndef __TDECSBAC__
41#define __TDECSBAC__
42
43
44#if _MSC_VER > 1000
45#pragma once
46#endif // _MSC_VER > 1000
47
48
49#include "TDecEntropy.h"
50#include "TDecBinCoder.h"
51#include "../TLibCommon/ContextTables.h"
52#include "../TLibCommon/ContextModel.h"
53#include "../TLibCommon/ContextModel3DBuffer.h"
54
55// ====================================================================================================================
56// Class definition
57// ====================================================================================================================
58
59class SEImessages;
60
61/// SBAC decoder class
62class TDecSbac : public TDecEntropyIf
63{
64public:
65  TDecSbac();
66  virtual ~TDecSbac();
67 
68  Void  init                      ( TDecBinIf* p )    { m_pcTDecBinIf = p; }
69  Void  uninit                    (              )    { m_pcTDecBinIf = 0; }
70 
71  Void  resetEntropy              ( TComSlice* pcSlice     );
72  Void  setBitstream              ( TComBitstream* p       ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); }
73 
74  Void  setAlfCtrl                ( Bool bAlfCtrl          ) { m_bAlfCtrl = bAlfCtrl;                   }
75  Void  setMaxAlfCtrlDepth        ( UInt uiMaxAlfCtrlDepth ) { m_uiMaxAlfCtrlDepth = uiMaxAlfCtrlDepth; }
76 
[42]77#if BITSTREAM_EXTRACTION
78  Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ) {}
79#else
[2]80  Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ) {}
[42]81#endif
[2]82 
83  Void  parseSPS                  ( TComSPS* pcSPS         ) {}
84  Void  parsePPS                  ( TComPPS* pcPPS         ) {}
85  void parseSEI(SEImessages&) {}
86  Void  parseSliceHeader          ( TComSlice*& rpcSlice   ) {}
87  Void  parseTerminatingBit       ( UInt& ruiBit );
88  Void  parseMVPIdx               ( TComDataCU* pcCU, Int& riMVPIdx, Int iMVPNum, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList );
89 
90  Void  parseAlfFlag              ( UInt& ruiVal           );
91  Void  parseAlfUvlc              ( UInt& ruiVal           );
92  Void  parseAlfSvlc              ( Int&  riVal            );
93  Void  parseAlfCtrlDepth         ( UInt& ruiAlfCtrlDepth  );
94#if MTK_SAO
95  Void  parseAoFlag              ( UInt& ruiVal           );
96  Void  parseAoUvlc              ( UInt& ruiVal           );
97  Void  parseAoSvlc              ( Int&  riVal            );
98#endif
99private:
100  Void  xReadUnarySymbol    ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset );
101  Void  xReadUnaryMaxSymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol );
102  Void  xReadEpExGolomb     ( UInt& ruiSymbol, UInt uiCount );
103#if E253
104  Void  xReadGoRiceExGolomb ( UInt &ruiSymbol, UInt &ruiGoRiceParam );
[5]105#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
[2]106  Void  xReadExGolombLevel  ( UInt& ruiSymbol, ContextModel& rcSCModel  );
107#endif
108#else
109  Void  xReadExGolombLevel  ( UInt& ruiSymbol, ContextModel& rcSCModel  );
110#endif
111 
112#if MVD_CTX
113  Void  xReadMvd            ( Int& riMvdComp, UInt uiAbsSumL, UInt uiAbsSumA, UInt uiCtx );
114#else
115  Void  xReadMvd            ( Int& riMvdComp, UInt uiAbsSum, UInt uiCtx );
116#endif
117
118  Void  xReadExGolombMvd    ( UInt& ruiSymbol, ContextModel* pcSCModel, UInt uiMaxBin );
119 
[5]120#if HHI_DMM_WEDGE_INTRA
[2]121  Void xParseWedgeFullInfo  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
122  Void xParseWedgeFullDeltaInfo     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
[5]123
[2]124  Void xParseWedgePredDirInfo       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
125  Void xParseWedgePredDirDeltaInfo  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
[5]126#endif
127#if HHI_DMM_PRED_TEX
[2]128  Void xParseWedgePredTexDeltaInfo  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
129  Void xParseContourPredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
130#endif
131 
132private:
133  TComBitstream*    m_pcBitstream;
134  TDecBinIf*        m_pcTDecBinIf;
135 
136  Bool m_bAlfCtrl;
137  UInt m_uiMaxAlfCtrlDepth;
138 
139public:
140  Void parseAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
141#if TSB_ALF_HEADER
142  Void parseAlfFlagNum    ( UInt& ruiVal, UInt minValue, UInt depth );
143  Void parseAlfCtrlFlag   ( UInt &ruiAlfCtrlFlag );
144#endif
145 
146  Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
147  Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
148  Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
149  Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
[5]150#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
[2]151  Void parseMergeIndexMV  ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
[5]152#endif
[2]153  Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
154  Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
155  Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
156 
157  Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
158 
159  Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
160 
161  Void parseInterDir      ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx, UInt uiDepth );
162  Void parseRefFrmIdx     ( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList );
163  Void parseMvd           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList );
164 
165  Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize );
166  Void parseQtCbf         ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth );
167  Void parseQtRootCbf     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf );
168 
169  Void parseDeltaQP       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
170 
171  Void parseCbf           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ) {}
172  Void parseBlockCbf      ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth, UInt uiQPartNum ) {}
173 
174#if CAVLC_RQT_CBP
175  Void parseCbfTrdiv      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiTrDepth, UInt uiDepth, UInt& uiSubdiv ) {}
176#endif
177
178#if PCP_SIGMAP_SIMPLE_LAST
179  __inline Void parseLastSignificantXY( UInt& uiPosLastX, UInt& uiPosLastY, const UInt uiWidth, const TextType eTType, const UInt uiCTXIdx, const UInt uiScanIdx );
180#endif
181  Void parseCoeffNxN      ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType );
182  Void parseViewIdx       (Int &riViewIdx );
183 
184private:
185  UInt m_uiLastDQpNonZero;
186  UInt m_uiLastQp;
187 
188  ContextModel3DBuffer m_cCUSkipFlagSCModel;
189  ContextModel3DBuffer m_cCUSplitFlagSCModel;
190  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
191  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
192  ContextModel3DBuffer m_cCUMVMergeIdxExtSCModel;
193  ContextModel3DBuffer m_cResPredFlagSCModel;
194  ContextModel3DBuffer m_cCUAlfCtrlFlagSCModel;
195  ContextModel3DBuffer m_cCUPartSizeSCModel;
196  ContextModel3DBuffer m_cCUPredModeSCModel;
197 
198  ContextModel3DBuffer m_cCUIntraPredSCModel;
199#if ADD_PLANAR_MODE
200  ContextModel3DBuffer m_cPlanarFlagSCModel;
201#endif
202  ContextModel3DBuffer m_cCUChromaPredSCModel;
203  ContextModel3DBuffer m_cCUInterDirSCModel;
204  ContextModel3DBuffer m_cCURefPicSCModel;
205  ContextModel3DBuffer m_cCUMvdSCModel;
206 
207  ContextModel3DBuffer m_cCUTransSubdivFlagSCModel;
208  ContextModel3DBuffer m_cCUQtRootCbfSCModel;
209  ContextModel3DBuffer m_cCUDeltaQpSCModel;
210 
211  ContextModel3DBuffer m_cCUQtCbfSCModel;
212 
213  ContextModel3DBuffer m_cCUSigSCModel;
214#if PCP_SIGMAP_SIMPLE_LAST
215  ContextModel3DBuffer m_cCuCtxLastX;
216  ContextModel3DBuffer m_cCuCtxLastY;
217#else 
218  ContextModel3DBuffer m_cCULastSCModel;
219#endif
220  ContextModel3DBuffer m_cCUOneSCModel;
221  ContextModel3DBuffer m_cCUAbsSCModel;
222 
223  ContextModel3DBuffer m_cMVPIdxSCModel;
224 
225  ContextModel3DBuffer m_cALFFlagSCModel;
226  ContextModel3DBuffer m_cALFUvlcSCModel;
227  ContextModel3DBuffer m_cALFSvlcSCModel;
228#if MTK_SAO
229  ContextModel3DBuffer m_cAOFlagSCModel;
230  ContextModel3DBuffer m_cAOUvlcSCModel;
231  ContextModel3DBuffer m_cAOSvlcSCModel;
232#endif
233  ContextModel3DBuffer m_cViewIdxSCModel;
[5]234#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
[2]235  ContextModel3DBuffer m_cIntraDMMSCModel;
236  ContextModel3DBuffer m_cIntraWedgeSCModel;
237#endif
238};
239
240#endif // !defined(AFX_TDECSBAC_H__CFCAAA19_8110_47F4_9A16_810C4B5499D5__INCLUDED_)
Note: See TracBrowser for help on using the repository browser.