source: SHVCSoftware/branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.h @ 54

Last change on this file since 54 was 54, checked in by seregin, 12 years ago

port simulcast

File size: 7.6 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-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     TDecTop.h
35    \brief    decoder class (header)
36*/
37
38#ifndef __TDECTOP__
39#define __TDECTOP__
40
41#include "TLibCommon/CommonDef.h"
42#include "TLibCommon/TComList.h"
43#include "TLibCommon/TComPicYuv.h"
44#include "TLibCommon/TComPic.h"
45#include "TLibCommon/TComTrQuant.h"
46#include "TLibCommon/SEI.h"
47
48#include "TDecGop.h"
49#include "TDecEntropy.h"
50#include "TDecSbac.h"
51#include "TDecCAVLC.h"
52#include "SEIread.h"
53
54struct InputNALUnit;
55
56//! \ingroup TLibDecoder
57//! \{
58
59// ====================================================================================================================
60// Class definition
61// ====================================================================================================================
62
63/// decoder class
64class TDecTop
65{
66private:
67  Int                     m_iMaxRefPicNum;
68 
69  Int                     m_pocCRA;            ///< POC number of the latest CRA picture
70  Bool                    m_prevRAPisBLA;      ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture
71  Int                     m_pocRandomAccess;   ///< POC number of the random access point (the first IDR or CRA picture)
72
73  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
74#if SVC_EXTENSION
75  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
76#else
77  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
78#endif
79
80#if REF_IDX_MFM
81  TComSPS*               m_pcSPS;
82  Bool                   m_bMFMEnabledFlag;
83#endif
84
85  TComSlice*              m_apcSlicePilot;
86 
87  SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices
88
89  // functional classes
90  TComPrediction          m_cPrediction;
91  TComTrQuant             m_cTrQuant;
92  TDecGop                 m_cGopDecoder;
93  TDecSlice               m_cSliceDecoder;
94  TDecCu                  m_cCuDecoder;
95  TDecEntropy             m_cEntropyDecoder;
96  TDecCavlc               m_cCavlcDecoder;
97  TDecSbac                m_cSbacDecoder;
98  TDecBinCABAC            m_cBinCABAC;
99  SEIReader               m_seiReader;
100  TComLoopFilter          m_cLoopFilter;
101  TComSampleAdaptiveOffset m_cSAO;
102
103  Bool isSkipPictureForBLA(Int& iPOCLastDisplay);
104  Bool isRandomAccessSkipPicture(Int& iSkipFrame,  Int& iPOCLastDisplay);
105  TComPic*                m_pcPic;
106  UInt                    m_uiSliceIdx;
107#if !SVC_EXTENSION
108  Int                     m_prevPOC;
109#endif
110  Bool                    m_bFirstSliceInPicture;
111#if !SVC_EXTENSION
112  Bool                    m_bFirstSliceInSequence;
113#endif
114
115#if SVC_EXTENSION
116  static UInt             m_prevPOC;        // POC of the previous slice
117  static UInt             m_uiPrevLayerId;  // LayerId of the previous slice
118  static Bool             m_bFirstSliceInSequence;
119  UInt                    m_layerId;     
120  UInt                    m_numLayer;
121  TDecTop**               m_ppcTDecTop;
122#if AVC_BASE
123  fstream*                m_pBLReconFile;
124  Int                     m_iBLSourceWidth;
125  Int                     m_iBLSourceHeight;
126#endif
127#endif
128#if AVC_SYNTAX || SYNTAX_OUTPUT
129  fstream*               m_pBLSyntaxFile;
130#endif
131#if REF_IDX_FRAMEWORK
132  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
133#endif
134
135public:
136  TDecTop();
137  virtual ~TDecTop();
138 
139  Void  create  ();
140  Void  destroy ();
141
142  void setDecodedPictureHashSEIEnabled(Int enabled) { m_cGopDecoder.setDecodedPictureHashSEIEnabled(enabled); }
143
144  Void  init();
145#if SVC_EXTENSION
146  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
147#else
148  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
149#endif
150 
151  Void  deletePicBuffer();
152
153  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
154
155#if SVC_EXTENSION
156  UInt      getLayerId            () { return m_layerId;              }
157  Void      setLayerId            (UInt layer) { m_layerId = layer; }
158  UInt      getNumLayer           () { return m_numLayer;             }
159  Void      setNumLayer           (UInt uiNum)   { m_numLayer = uiNum;  }
160  TComList<TComPic*>*      getListPic() { return &m_cListPic; }
161  Void                setLayerDec(TDecTop **p)    { m_ppcTDecTop = p; }
162  TDecTop*            getLayerDec(UInt layer)   { return m_ppcTDecTop[layer]; }
163#if AVC_BASE
164  Void      setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; }
165  fstream*  getBLReconFile() { return m_pBLReconFile; }
166  Void      setBLsize( Int iWidth, Int iHeight ) { m_iBLSourceWidth = iWidth; m_iBLSourceHeight = iHeight; }
167  Int       getBLWidth() { return  m_iBLSourceWidth; }
168  Int       getBLHeight() { return  m_iBLSourceHeight; }
169#endif
170#endif
171#if AVC_SYNTAX || SYNTAX_OUTPUT
172  Void      setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; }
173  fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; }
174#endif
175#if REF_IDX_FRAMEWORK
176  Void      xInitILRP(TComSPS *pcSPS);
177  Void      setILRPic(TComPic *pcPic);
178#endif
179#if REF_IDX_MFM
180  TComSPS*  getSPS()                       {return m_pcSPS;}
181  Void      setMFMEnabledFlag(Bool flag)   {m_bMFMEnabledFlag = flag;}
182  Bool      getMFMEnabledFlag()            {return m_bMFMEnabledFlag;}
183#endif
184
185protected:
186  Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
187  Void  xCreateLostPicture (Int iLostPOC);
188
189  Void      xActivateParameterSets();
190#if SVC_EXTENSION
191  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
192#else
193  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
194#endif
195  Void      xDecodeVPS();
196  Void      xDecodeSPS();
197  Void      xDecodePPS();
198  Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
199
200};// END CLASS DEFINITION TDecTop
201
202
203//! \}
204
205#endif // __TDECTOP__
206
Note: See TracBrowser for help on using the repository browser.