source: 3DVCSoftware/branches/HTM-14.0-MV-draft-3/source/Lib/TLibDecoder/TDecTop.h @ 1191

Last change on this file since 1191 was 1191, checked in by tech, 10 years ago

Removed 3D-HEVC.

  • Property svn:eol-style set to native
File size: 8.2 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-2015, 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#if H_MV
64class TAppDecTop;
65#endif
66/// decoder class
67class TDecTop
68{
69private:
70  Int                     m_iMaxRefPicNum;
71 
72  NalUnitType             m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture
73  Int                     m_pocCRA;            ///< POC number of the latest CRA picture
74  Int                     m_pocRandomAccess;   ///< POC number of the random access point (the first IDR or CRA picture)
75
76  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
77#if H_MV
78  Bool*                    m_layerInitilizedFlag; // initialization Layers
79  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
80  Int                      m_targetOptLayerSetIdx; 
81#else
82  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
83#endif
84  TComSlice*              m_apcSlicePilot;
85 
86  SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices
87
88  // functional classes
89  TComPrediction          m_cPrediction;
90  TComTrQuant             m_cTrQuant;
91  TDecGop                 m_cGopDecoder;
92  TDecSlice               m_cSliceDecoder;
93  TDecCu                  m_cCuDecoder;
94  TDecEntropy             m_cEntropyDecoder;
95  TDecCavlc               m_cCavlcDecoder;
96  TDecSbac                m_cSbacDecoder;
97  TDecBinCABAC            m_cBinCABAC;
98  SEIReader               m_seiReader;
99  TComLoopFilter          m_cLoopFilter;
100  TComSampleAdaptiveOffset m_cSAO;
101
102  Bool isSkipPictureForBLA(Int& iPOCLastDisplay);
103  Bool isRandomAccessSkipPicture(Int& iSkipFrame,  Int& iPOCLastDisplay);
104  TComPic*                m_pcPic;
105  UInt                    m_uiSliceIdx;
106  Int                     m_prevPOC;
107  Bool                    m_bFirstSliceInPicture;
108  Bool                    m_bFirstSliceInSequence;
109  Bool                    m_prevSliceSkipped;
110  Int                     m_skippedPOC;
111#if SETTING_NO_OUT_PIC_PRIOR 
112  Bool                    m_bFirstSliceInBitstream;
113  Int                     m_lastPOCNoOutputPriorPics;
114  Bool                    m_isNoOutputPriorPics;
115  Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
116#endif
117#if H_MV
118  Bool                    m_isLastNALWasEos;
119#endif
120
121#if H_MV
122  // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer 
123  Int                     m_layerId;
124  Int                     m_viewId;
125  TComPicLists*           m_ivPicLists;
126  std::vector<TComPic*>   m_refPicSetInterLayer0; 
127  std::vector<TComPic*>   m_refPicSetInterLayer1; 
128#endif
129
130public:
131  TDecTop();
132  virtual ~TDecTop();
133 
134  Void  create  ();
135  Void  destroy ();
136
137  void setDecodedPictureHashSEIEnabled(Int enabled) { m_cGopDecoder.setDecodedPictureHashSEIEnabled(enabled); }
138
139  Void  init();
140#if H_MV 
141  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag );
142  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
143#else 
144  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
145#endif
146 
147  Void  deletePicBuffer();
148#if H_MV
149  TComVPS* getActiveVPS() { return m_parameterSetManagerDecoder.getActiveVPS( ); }
150  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS( m_layerId ); }
151#else
152  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }
153#endif
154
155#if H_MV
156  Void endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic,  std::vector<Int>& targetDecLayerIdSet); 
157#else
158  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
159#endif
160 
161#if SETTING_NO_OUT_PIC_PRIOR 
162  Void  checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic);
163
164  Bool  getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; }
165  Void  setNoOutputPriorPicsFlag (bool val) { m_isNoOutputPriorPics = val; }
166#endif
167#if H_MV   
168  TComPic*                getPic                ( Int poc );
169  TComList<TComPic*>*     getListPic            ()               { return &m_cListPic;  } 
170  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
171  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
172  Void                    setTargetOptLayerSetIdx( Int targetOptLayerSetIdx ) { m_targetOptLayerSetIdx = targetOptLayerSetIdx; }   
173  TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
174  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
175  Void                    setLayerId            ( Int layer)     { m_layerId = layer;   }
176  Int                     getLayerId            ()               { return m_layerId;    }
177  Void                    setViewId             ( Int viewId  )  { m_viewId  = viewId;  }
178  Int                     getViewId             ()               { return m_viewId;     } 
179
180#endif
181protected:
182  Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
183  Void  xCreateLostPicture (Int iLostPOC);
184
185  Void      xActivateParameterSets();
186#if H_MV 
187  TComPic*  xGetPic( Int layerId, Int poc ); 
188  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 
189  Void      xResetPocInPicBuffer();
190  Void      xCeckNoClrasOutput();
191
192  Bool      xAllRefLayersInitilized();
193#else
194  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
195#endif
196  Void      xDecodeVPS();
197  Void      xDecodeSPS();
198  Void      xDecodePPS();
199  Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
200
201};// END CLASS DEFINITION TDecTop
202
203
204//! \}
205
206#endif // __TDECTOP__
207
Note: See TracBrowser for help on using the repository browser.