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


Ignore:
Timestamp:
1 Sep 2013, 22:47:26 (12 years ago)
Author:
tech
Message:

Merged DEV-2.0-dev0@604.

File:
1 edited

Legend:

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

    r443 r608  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2012, ITU/ISO/IEC
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4444#include "TLibCommon/TComPic.h"
    4545#include "TLibCommon/TComTrQuant.h"
    46 #include "TLibCommon/TComDepthMapGenerator.h"
    4746#include "TLibCommon/SEI.h"
    4847
     
    5150#include "TDecSbac.h"
    5251#include "TDecCAVLC.h"
     52#include "SEIread.h"
    5353
    5454struct InputNALUnit;
     
    5656//! \ingroup TLibDecoder
    5757//! \{
    58 
    59 #define APS_RESERVED_BUFFER_SIZE 2 //!< must be equal to or larger than 2 to handle bitstream parsing
    6058
    6159// ====================================================================================================================
     
    6361// ====================================================================================================================
    6462
     63#if H_MV
    6564class TAppDecTop;
    66 
     65#endif
     66#if H_3D
    6767class CamParsCollector
    6868{
     
    7575  Void  setSlice    ( TComSlice* pcSlice );
    7676
    77   Bool  isInitialized() const { return m_bInitialized; }
    78 
    79 #if MERL_VSP_C0152
     77  Bool  isInitialized() const     { return m_bInitialized; }
    8078  Int**** getBaseViewShiftLUTI()  { return m_aiBaseViewShiftLUT;   }
    81 #endif
     79
    8280private:
    8381  Bool  xIsComplete ();
     
    9088  Int**   m_aaiCodedOffset;
    9189  Int**   m_aaiCodedScale;
    92   Int*    m_aiViewOrderIndex;
    93 #if QC_MVHEVC_B0046
    94   Int*    m_aiViewId;
    95 #endif
    96   Int*    m_aiViewReceived;
     90  Int*    m_aiViewId; 
     91
     92  Bool*   m_bViewReceived;
    9793  UInt    m_uiCamParsCodedPrecision;
    9894  Bool    m_bCamParsVaryOverTime;
    99   Int     m_iLastViewId;
     95  Int     m_iLastViewIndex;
    10096  Int     m_iLastPOC;
    101   UInt    m_uiMaxViewId;
    102 
    103 #if MERL_VSP_C0152
     97  UInt    m_uiMaxViewIndex;
     98
     99
    104100  UInt    m_uiBitDepthForLUT;
    105101  UInt    m_iLog2Precision;
    106102  UInt    m_uiInputBitDepth;
     103
    107104  // look-up tables
    108105  Double****   m_adBaseViewShiftLUT;       ///< Disparity LUT
     
    113110  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize1, UInt uiSize2 );
    114111  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize );
    115 #endif
    116 
    117 };
    118 
    119 #if MERL_VSP_C0152
     112
     113};
     114
    120115template <class T>
    121116Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 )
     
    174169};
    175170
    176 #endif
    177 
     171#endif //H_3D
    178172/// decoder class
    179173class TDecTop
    180174{
    181175private:
    182   Int                     m_iGopSize;
    183   Bool                    m_bGopSizeSet;
    184   int                     m_iMaxRefPicNum;
    185  
    186   Bool                    m_bRefreshPending;    ///< refresh pending flag
     176  Int                     m_iMaxRefPicNum;
     177 
    187178  Int                     m_pocCRA;            ///< POC number of the latest CRA picture
     179  Bool                    m_prevRAPisBLA;      ///< true if the previous RAP (CRA/CRANT/BLA/BLANT/IDR) picture is a BLA/BLANT picture
    188180  Int                     m_pocRandomAccess;   ///< POC number of the random access point (the first IDR or CRA picture)
    189181
    190   UInt                    m_uiValidPS;
    191182  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
     183#if H_MV
     184  static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     185#else
    192186  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
    193   TComRPSList             m_RPSList;
     187#endif
    194188  TComSlice*              m_apcSlicePilot;
    195189 
    196   SEImessages *m_SEIs; ///< "all" SEI messages.  If not NULL, we own the object.
     190  SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices
    197191
    198192  // functional classes
     
    206200  TDecSbac                m_cSbacDecoder;
    207201  TDecBinCABAC            m_cBinCABAC;
     202  SEIReader               m_seiReader;
    208203  TComLoopFilter          m_cLoopFilter;
    209   TComAdaptiveLoopFilter  m_cAdaptiveLoopFilter;
    210204  TComSampleAdaptiveOffset m_cSAO;
    211205
    212 #if DEPTH_MAP_GENERATION
    213   TComDepthMapGenerator   m_cDepthMapGenerator;
    214 #endif
    215 #if H3D_IVRP & !QC_ARP_D0177
    216   TComResidualGenerator   m_cResidualGenerator;
    217 #endif
    218 
     206  Bool isSkipPictureForBLA(Int& iPOCLastDisplay);
    219207  Bool isRandomAccessSkipPicture(Int& iSkipFrame,  Int& iPOCLastDisplay);
    220208  TComPic*                m_pcPic;
    221209  UInt                    m_uiSliceIdx;
    222   UInt                    m_uiLastSliceIdx;
    223210  Int                     m_prevPOC;
    224211  Bool                    m_bFirstSliceInPicture;
    225212  Bool                    m_bFirstSliceInSequence;
    226 
     213#if H_MV
     214  // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer 
     215  Int                     m_layerId;
    227216  Int                     m_viewId;
     217  TComPicLists*           m_ivPicLists;
     218  std::vector<TComPic*>   m_refPicSetInterLayer;
     219#if H_3D
     220  Int                     m_viewIndex;
    228221  Bool                    m_isDepth;
    229   TAppDecTop*             m_tAppDecTop;
    230222  CamParsCollector*       m_pcCamParsCollector;
    231   NalUnitType             m_nalUnitTypeBaseView; 
     223#endif
     224#endif
    232225
    233226public:
     
    238231  Void  destroy ();
    239232
    240   void setPictureDigestEnabled(bool enabled) { m_cGopDecoder.setPictureDigestEnabled(enabled); }
    241  
    242   Void  init( TAppDecTop* pcTAppDecTop, Bool bFirstInstance );
     233  void setDecodedPictureHashSEIEnabled(Int enabled) { m_cGopDecoder.setDecodedPictureHashSEIEnabled(enabled); }
     234
     235  Void  init();
     236#if H_MV 
     237  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );
     238#else 
    243239  Bool  decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay);
     240#endif
    244241 
    245242  Void  deletePicBuffer();
    246 #if QC_MVHEVC_B0046
    247   Void      xCopySPS( TComSPS* pSPSV0);
    248   Void      xCopyPPS( TComPPS* pPPSV0);
    249   Void      xCopyVPS( TComVPS* pVPSV0);
    250 #endif
    251 #if H3D_IVRP
    252   Void      deleteExtraPicBuffers   ( Int iPoc );
    253 #endif
    254   Void  compressMotion       ( Int iPoc );
    255 
    256   Void executeDeblockAndAlf(UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, Int& iSkipFrame,  Int& iPOCLastDisplay);
    257 
    258   Void setViewId(Int viewId)      { m_viewId = viewId;}
    259   Int  getViewId()                { return m_viewId  ;}
    260   Void setIsDepth( Bool isDepth ) { m_isDepth = isDepth; }
    261 
    262 #if DEPTH_MAP_GENERATION
    263   TComDepthMapGenerator*  getDepthMapGenerator  () { return &m_cDepthMapGenerator; }
    264 #endif
    265 
    266   Void setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; }
    267 
    268   TComList<TComPic*>* getListPic()                              { return &m_cListPic; }
    269   Void                setTAppDecTop( TAppDecTop* pcTAppDecTop ) { m_tAppDecTop = pcTAppDecTop; }
    270   TAppDecTop*         getTAppDecTop()                           { return  m_tAppDecTop; }
    271   NalUnitType         getNalUnitTypeBaseView()                  { return m_nalUnitTypeBaseView; }
    272 #if QC_MVHEVC_B0046
    273   bool                m_bFirstNal; //used to copy SPS, PPS, VPS
    274   ParameterSetManagerDecoder* xGetParaSetDec ()        {return  &m_parameterSetManagerDecoder;}
    275 #endif
    276 
     243
     244#if H_MV
     245  Void endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic,  std::vector<Int>& targetDecLayerIdSet); 
     246#else
     247  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
     248#endif
     249 
     250#if H_MV   
     251  TComPic*                getPic                ( Int poc );
     252  TComList<TComPic*>*     getListPic            ()               { return &m_cListPic;  } 
     253  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
     254 
     255  Int                     getCurrPoc            ()               { return m_apcSlicePilot->getPOC(); }
     256  Void                    setLayerId            ( Int layer)     { m_layerId = layer;   }
     257  Int                     getLayerId            ()               { return m_layerId;    }
     258  Void                    setViewId             ( Int viewId  )  { m_viewId  = viewId;  }
     259  Int                     getViewId             ()               { return m_viewId;     } 
     260#if H_3D   
     261  Void                    setViewIndex          ( Int viewIndex  )  { m_viewIndex  = viewIndex;  }
     262  Int                     getViewIndex          ()               { return m_viewIndex;     } 
     263  Void                    setIsDepth            ( Bool isDepth ) { m_isDepth = isDepth; }
     264  Bool                    getIsDepth            ()               { return m_isDepth;    }
     265  Void                    setCamParsCollector( CamParsCollector* pcCamParsCollector ) { m_pcCamParsCollector = pcCamParsCollector; }
     266#endif
     267#endif
    277268protected:
    278269  Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
    279   Void  xUpdateGopSize    (TComSlice* pcSlice);
    280270  Void  xCreateLostPicture (Int iLostPOC);
    281271
    282   Void      decodeAPS( TComAPS* cAPS) { m_cEntropyDecoder.decodeAPS(cAPS); };
    283272  Void      xActivateParameterSets();
     273#if H_MV 
     274  TComPic*  xGetPic( Int layerId, Int poc );
     275  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 
     276#else
    284277  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
    285 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     278#endif
    286279  Void      xDecodeVPS();
    287 #endif
    288280  Void      xDecodeSPS();
    289281  Void      xDecodePPS();
    290   Void      xDecodeAPS();
    291   Void      xDecodeSEI();
    292 
    293   Void      allocAPS (TComAPS* pAPS); //!< memory allocation for APS
     282  Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
     283
    294284};// END CLASS DEFINITION TDecTop
    295285
Note: See TracChangeset for help on using the changeset viewer.