Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecTop.h


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r1196 r1313  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4444#include "TLibCommon/TComPic.h"
    4545#include "TLibCommon/TComTrQuant.h"
     46#include "TLibCommon/TComPrediction.h"
    4647#include "TLibCommon/SEI.h"
    4748
     
    5253#include "SEIread.h"
    5354
    54 struct InputNALUnit;
     55class InputNALUnit;
    5556
    5657//! \ingroup TLibDecoder
     
    6162// ====================================================================================================================
    6263
    63 #if H_MV
     64#if NH_MV
    6465class TAppDecTop;
    6566#endif
    66 #if H_3D
     67#if NH_3D
    6768class CamParsCollector
    6869{
     
    7172  ~CamParsCollector ();
    7273
    73   Void  init        ( FILE* pCodedScaleOffsetFile, TComVPS* vps );
     74  Void  init        ( const TComVPS* vps );
     75  Void  setCodeScaleOffsetFile( FILE* pCodedScaleOffsetFile ) { m_pCodedScaleOffsetFile = pCodedScaleOffsetFile; };     
    7476
    7577  Void  uninit      ();
    76   Void  setSlice    ( TComSlice* pcSlice );
     78  Void setSlice ( const TComSlice* pcSlice );
    7779
    7880  Bool  isInitialized() const     { return m_bInitialized; }
    7981  Int**** getBaseViewShiftLUTI()  { return m_aiBaseViewShiftLUT;   }
    8082
    81 #if H_3D_IV_MERGE
     83#if !NH_3D_FIX_TICKET_101
     84#if NH_3D_IV_MERGE
    8285  Void  copyCamParamForSlice( TComSlice* pcSlice );
    8386#endif
    84 
     87#endif
    8588
    8689private:
     
    9598  Int**   m_aaiCodedScale;
    9699 
    97   TComVPS* m_vps;
     100  const TComVPS* m_vps;
    98101  Int**    m_receivedIdc;
    99102  Int      m_lastPoc;
     
    105108  UInt    m_uiBitDepthForLUT;
    106109  UInt    m_iLog2Precision;
    107   UInt    m_uiInputBitDepth;
     110  // UInt    m_uiInputBitDepth;
    108111
    109112  // look-up tables
     
    174177};
    175178
    176 #endif //H_3D
     179#endif //NH_3D
    177180/// decoder class
    178181class TDecTop
     
    180183private:
    181184  Int                     m_iMaxRefPicNum;
    182  
     185
    183186  NalUnitType             m_associatedIRAPType; ///< NAL unit type of the associated IRAP picture
    184187  Int                     m_pocCRA;            ///< POC number of the latest CRA picture
     
    186189
    187190  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
    188 #if H_MV
     191#if NH_MV
    189192  Bool*                    m_layerInitilizedFlag; // initialization Layers
    190   static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
    191   Int                      m_targetOptLayerSetIdx;
     193  static ParameterSetManager m_parameterSetManager;  // storage for parameter sets
     194  Int                      m_targetOlsIdx;
    192195#else
    193   ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     196  ParameterSetManager     m_parameterSetManager;  // storage for parameter sets
    194197#endif
    195198  TComSlice*              m_apcSlicePilot;
    196  
    197   SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices
     199
     200  SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices, excluding prefix SEIs...
    198201
    199202  // functional classes
     
    212215
    213216  Bool isSkipPictureForBLA(Int& iPOCLastDisplay);
     217#if NH_MV
     218  Bool isRandomAccessSkipPicture(Int& iSkipFrame,  Int& iPOCLastDisplay, const TComVPS* vps);
     219#else
    214220  Bool isRandomAccessSkipPicture(Int& iSkipFrame,  Int& iPOCLastDisplay);
     221#endif
    215222  TComPic*                m_pcPic;
    216223  UInt                    m_uiSliceIdx;
    217224  Int                     m_prevPOC;
     225  Int                     m_prevTid0POC;
    218226  Bool                    m_bFirstSliceInPicture;
    219227  Bool                    m_bFirstSliceInSequence;
    220228  Bool                    m_prevSliceSkipped;
    221229  Int                     m_skippedPOC;
    222 #if SETTING_NO_OUT_PIC_PRIOR 
    223230  Bool                    m_bFirstSliceInBitstream;
    224231  Int                     m_lastPOCNoOutputPriorPics;
    225232  Bool                    m_isNoOutputPriorPics;
    226233  Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
    227 #endif
    228 #if H_MV
     234#if O0043_BEST_EFFORT_DECODING
     235  UInt                    m_forceDecodeBitDepth;
     236#endif
     237  std::ostream           *m_pDecodedSEIOutputStream;
     238
     239  Bool                    m_warningMessageSkipPicture;
     240#if NH_MV
    229241  Bool                    m_isLastNALWasEos;
    230242#endif
    231243
    232 #if H_MV
    233   // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer 
     244#if NH_MV
     245  // For NH_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer 
    234246  Int                     m_layerId;
    235247  Int                     m_viewId;
     
    237249  std::vector<TComPic*>   m_refPicSetInterLayer0;
    238250  std::vector<TComPic*>   m_refPicSetInterLayer1;
    239 #if H_3D
     251#if NH_3D
    240252  Int                     m_viewIndex;
    241253  Bool                    m_isDepth;
     
    245257#endif
    246258
     259  std::list<InputNALUnit*> m_prefixSEINALUs; /// Buffered up prefix SEI NAL Units.
    247260public:
    248261  TDecTop();
    249262  virtual ~TDecTop();
    250  
     263
    251264  Void  create  ();
    252265  Void  destroy ();
    253266
    254   void setDecodedPictureHashSEIEnabled(Int enabled) { m_cGopDecoder.setDecodedPictureHashSEIEnabled(enabled); }
     267  Void setDecodedPictureHashSEIEnabled(Int enabled) { m_cGopDecoder.setDecodedPictureHashSEIEnabled(enabled); }
    255268
    256269  Void  init();
    257 #if H_MV 
     270#if NH_MV 
    258271  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag );
    259272  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
     
    261274  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
    262275#endif
    263  
    264276  Void  deletePicBuffer();
    265 #if H_MV
    266   TComVPS* getActiveVPS() { return m_parameterSetManagerDecoder.getActiveVPS( ); }
    267   TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS( m_layerId ); }
    268 #else
    269   TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }
    270 #endif
    271 
    272 #if H_MV
     277
     278#if NH_MV
     279  const TComVPS* getActiveVPS() { return m_parameterSetManager.getActiveVPS( ); }
     280  const TComSPS* getActiveSPS() { return m_parameterSetManager.getActiveSPS( m_layerId ); }
     281#endif
     282
     283#if NH_MV
    273284  Void endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic,  std::vector<Int>& targetDecLayerIdSet); 
    274 #else
    275   Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
    276 #endif
    277  
    278 #if SETTING_NO_OUT_PIC_PRIOR 
    279   Void  checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic);
     285#else 
     286  Void  executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
     287#endif
     288  Void  checkNoOutputPriorPics (TComList<TComPic*>* rpcListPic);
    280289
    281290  Bool  getNoOutputPriorPicsFlag () { return m_isNoOutputPriorPics; }
    282   Void  setNoOutputPriorPicsFlag (bool val) { m_isNoOutputPriorPics = val; }
    283 #endif
    284 #if H_MV   
     291  Void  setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; }
     292  Void  setFirstSliceInPicture (bool val)  { m_bFirstSliceInPicture = val; }
     293  Bool  getFirstSliceInSequence ()         { return m_bFirstSliceInSequence; }
     294  Void  setFirstSliceInSequence (bool val) { m_bFirstSliceInSequence = val; }
     295#if O0043_BEST_EFFORT_DECODING
     296  Void  setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; }
     297#endif
     298  Void  setDecodedSEIMessageOutputStream(std::ostream *pOpStream) { m_pDecodedSEIOutputStream = pOpStream; }
     299  UInt  getNumberOfChecksumErrorsDetected() const { return m_cGopDecoder.getNumberOfChecksumErrorsDetected(); }
     300#if NH_MV   
    285301  TComPic*                getPic                ( Int poc );
    286302  TComList<TComPic*>*     getListPic            ()               { return &m_cListPic;  } 
    287303  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    288304  Void                    setLayerInitilizedFlags( Bool* val )    { m_layerInitilizedFlag = val; }
    289   Void                    setTargetOptLayerSetIdx( Int targetOptLayerSetIdx ) { m_targetOptLayerSetIdx = targetOptLayerSetIdx; }   
    290   TComVPS*                getPrefetchedVPS      ()               { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present.
     305  Void                    setTargetOlsIdx       ( Int targetOlsIdx ) { m_targetOlsIdx = targetOlsIdx; }   
     306  Int                     getTargetOlsIdx       ( )                  { return m_targetOlsIdx; }   
    291307  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
    292308  Void                    setLayerId            ( Int layer)     { m_layerId = layer;   }
     
    294310  Void                    setViewId             ( Int viewId  )  { m_viewId  = viewId;  }
    295311  Int                     getViewId             ()               { return m_viewId;     } 
    296 #if H_3D   
     312  Void                    initFromActiveVps     ( const TComVPS* vps );
     313#if NH_3D   
    297314  Void                    setViewIndex          ( Int viewIndex  )  { m_viewIndex  = viewIndex;  }
    298315  Int                     getViewIndex          ()               { return m_viewIndex;     } 
     
    301318  Void                    setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; }
    302319
    303   Void                    setProfileIdc();
     320
    304321  Bool                    decProcAnnexI()           { assert( m_profileIdc != -1 ); return ( m_profileIdc == 8); }   
    305322#endif
    306323#endif
     324
    307325protected:
    308   Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
     326  Void  xGetNewPicBuffer  (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
    309327  Void  xCreateLostPicture (Int iLostPOC);
    310328
    311329  Void      xActivateParameterSets();
    312 #if H_MV 
     330#if NH_MV 
    313331  TComPic*  xGetPic( Int layerId, Int poc );
    314332  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 
     
    316334  Void      xCeckNoClrasOutput();
    317335
    318   Bool      xAllRefLayersInitilized();
     336  Bool      xAllRefLayersInitilized( const TComVPS* vps );
    319337#else
    320338  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
    321339#endif
    322   Void      xDecodeVPS();
    323   Void      xDecodeSPS();
    324   Void      xDecodePPS();
    325   Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
     340  Void      xDecodeVPS(const std::vector<UChar> &naluData);
     341  Void      xDecodeSPS(const std::vector<UChar> &naluData);
     342  Void      xDecodePPS(const std::vector<UChar> &naluData);
     343  Void      xUpdatePreviousTid0POC( TComSlice *pSlice ) { if ((pSlice->getTLayer()==0) && (pSlice->isReferenceNalu() && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) { m_prevTid0POC=pSlice->getPOC(); } }
     344
     345  Void      xParsePrefixSEImessages();
     346  Void      xParsePrefixSEIsForUnknownVCLNal();
    326347
    327348};// END CLASS DEFINITION TDecTop
Note: See TracChangeset for help on using the changeset viewer.