Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecEntropy.h


Ignore:
Timestamp:
11 May 2012, 21:20:17 (12 years ago)
Author:
hschwarz
Message:

updated trunk (move to HM6.1)

File:
1 edited

Legend:

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

    r42 r56  
    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.
    5  *
    6  * Copyright (c) 2010-2011, ISO/IEC
     4 * granted under this license. 
     5 *
     6 * Copyright (c) 2010-2012, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    1515 *    this list of conditions and the following disclaimer in the documentation
    1616 *    and/or other materials provided with the distribution.
    17  *  * Neither the name of the ISO/IEC nor the names of its contributors may
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    1818 *    be used to endorse or promote products derived from this software without
    1919 *    specific prior written permission.
     
    3232 */
    3333
    34 
    35 
    3634/** \file     TDecEntropy.h
    3735    \brief    entropy decoder class (header)
     
    4745#include "../TLibCommon/TComPrediction.h"
    4846#include "../TLibCommon/TComAdaptiveLoopFilter.h"
     47#include "../TLibCommon/TComSampleAdaptiveOffset.h"
    4948
    5049class TDecSbac;
    5150class TDecCavlc;
    5251class SEImessages;
     52class ParameterSetManagerDecoder;
     53
     54//! \ingroup TLibDecoder
     55//! \{
    5356
    5457// ====================================================================================================================
     
    6164public:
    6265  //  Virtual list for SBAC/CAVLC
    63   virtual Void setAlfCtrl(Bool bAlfCtrl)  = 0;
    64   virtual Void setMaxAlfCtrlDepth(UInt uiMaxAlfCtrlDepth)  = 0;
    65 
    66   virtual Void  resetEntropy          (TComSlice* pcSlice)                = 0;
    67   virtual Void  setBitstream          ( TComBitstream* p )  = 0;
    68 
    69 #if BITSTREAM_EXTRACTION
    70   virtual Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId )  = 0;
    71 #else
    72   virtual Void  parseNalUnitHeader    ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag )  = 0;
    73 #endif
    74 
     66  virtual Void  resetEntropy          ( TComSlice* pcSlice )     = 0;
     67  virtual Void  setBitstream          ( TComInputBitstream* p )  = 0;
     68
     69#if OL_FLUSH
     70  virtual Void  decodeFlush()                                                                      = 0;
     71#endif
     72
     73#if HHI_MPI
     74  virtual Void  parseSPS                  ( TComSPS* pcSPS, Bool bIsDepth )                       = 0;
     75#else
    7576  virtual Void  parseSPS                  ( TComSPS* pcSPS )                                      = 0;
     77#endif
     78#if TILES_OR_ENTROPY_SYNC_IDC 
     79  virtual Void  parsePPS                  ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet )                                      = 0;
     80#else
    7681  virtual Void  parsePPS                  ( TComPPS* pcPPS )                                      = 0;
     82#endif
     83  virtual Void  parseAPS                  ( TComAPS* pAPS  )                                      = 0;
    7784  virtual void parseSEI(SEImessages&) = 0;
    78   virtual Void  parseSliceHeader          ( TComSlice*& rpcSlice )                                = 0;
     85
     86#if LCU_SYNTAX_ALF
     87  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet)       = 0;
     88#else
     89  virtual Void parseSliceHeader          ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl )                                = 0;
     90#endif
     91
    7992  virtual Void  parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
    80 
    81   virtual Void parseMVPIdx      ( TComDataCU* pcCU, Int& riMVPIdx, Int iMVPNum, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList ) = 0;
    82 
     93 
     94#if HHI_INTER_VIEW_MOTION_PRED
     95  virtual Void parseMVPIdx        ( Int& riMVPIdx, Int iNumAMVPCands ) = 0;
     96#else
     97  virtual Void parseMVPIdx        ( Int& riMVPIdx ) = 0;
     98#endif
     99 
    83100public:
    84101  virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    86103  virtual Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0;
    87104  virtual Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     105#if HHI_INTER_VIEW_RESIDUAL_PRED
    88106  virtual Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     107#endif
    89108  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    90109  virtual Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    91 
     110 
    92111  virtual Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    93 
     112 
    94113  virtual Void parseIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    95 
     114 
    96115  virtual Void parseInterDir      ( TComDataCU* pcCU, UInt& ruiInterDir, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    97116  virtual Void parseRefFrmIdx     ( TComDataCU* pcCU, Int& riRefFrmIdx, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList ) = 0;
    98117  virtual Void parseMvd           ( TComDataCU* pcCU, UInt uiAbsPartAddr, UInt uiPartIdx, UInt uiDepth, RefPicList eRefList ) = 0;
    99 
     118 
    100119  virtual Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ) = 0;
    101120  virtual Void parseQtCbf         ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ) = 0;
    102121  virtual Void parseQtRootCbf     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf ) = 0;
    103 
     122 
    104123  virtual Void parseDeltaQP       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    105 
    106   virtual Void parseCbf           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ) = 0;
    107   virtual Void parseBlockCbf      ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth, UInt uiQPartNum ) = 0;
    108 #if CAVLC_RQT_CBP
    109   virtual Void parseCbfTrdiv      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiTrDepth, UInt uiDepth, UInt& uiSubdiv ) = 0;
    110 #endif
     124 
     125  virtual Void parseIPCMInfo     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth) = 0;
    111126
    112127  virtual Void parseCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0;
    113128
    114   virtual Void parseAlfFlag       ( UInt& ruiVal           ) = 0;
    115   virtual Void parseAlfUvlc       ( UInt& ruiVal           ) = 0;
    116   virtual Void parseAlfSvlc       ( Int&  riVal            ) = 0;
    117   virtual Void parseAlfCtrlDepth  ( UInt& ruiAlfCtrlDepth  ) = 0;
    118   virtual Void parseAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    119 #if TSB_ALF_HEADER
    120   virtual Void parseAlfFlagNum    ( UInt& ruiVal, UInt minValue, UInt depth ) = 0;
    121   virtual Void parseAlfCtrlFlag   ( UInt &ruiAlfCtrlFlag ) = 0;
    122 #endif
    123 
    124 #if MTK_SAO
    125   virtual Void parseAoFlag       ( UInt& ruiVal           ) = 0;
    126   virtual Void parseAoUvlc       ( UInt& ruiVal           ) = 0;
    127   virtual Void parseAoSvlc       ( Int&  riVal            ) = 0;
    128 #endif
    129   virtual Void parseViewIdx       ( Int& riViewIdx ) = 0;
     129  /// set slice granularity
     130  virtual Void setSliceGranularity(Int iSliceGranularity) = 0;
     131
     132  /// get slice granularity
     133  virtual Int  getSliceGranularity()                      = 0;
     134
     135  virtual Void readTileMarker   ( UInt& uiTileIdx, UInt uiBitsUsed ) = 0;
     136  virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
     137 
    130138  virtual ~TDecEntropyIf() {}
    131139};
     
    137145  TDecEntropyIf*  m_pcEntropyDecoderIf;
    138146  TComPrediction* m_pcPrediction;
    139 
     147  UInt    m_uiBakAbsPartIdx;
     148  UInt    m_uiBakChromaOffset;
     149#if UNIFIED_TRANSFORM_TREE
     150  UInt    m_bakAbsPartIdxCU;
     151#endif
     152 
    140153public:
    141154  Void init (TComPrediction* p) {m_pcPrediction = p;}
    142   Void decodeMVPIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList, TComDataCU* pcSubCU );
    143155  Void decodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU );
    144156  Void decodeInterDirPU   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx );
     
    146158  Void decodeMvdPU        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList );
    147159  Void decodeMVPIdxPU     ( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList );
    148 
     160 
    149161  Void    setEntropyDecoder           ( TDecEntropyIf* p );
    150   Void    setBitstream                ( TComBitstream* p )      { m_pcEntropyDecoderIf->setBitstream(p);                    }
     162  Void    setBitstream                ( TComInputBitstream* p ) { m_pcEntropyDecoderIf->setBitstream(p);                    }
    151163  Void    resetEntropy                ( TComSlice* p)           { m_pcEntropyDecoderIf->resetEntropy(p);                    }
    152164
    153 #if BITSTREAM_EXTRACTION
    154   Void    decodeNalUnitHeader         ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId )
    155                                                                 { m_pcEntropyDecoderIf->parseNalUnitHeader( eNalUnitType, TemporalId, uiLayerId ); }
    156 #else
    157   Void    decodeNalUnitHeader         ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag )
    158                                                                 { m_pcEntropyDecoderIf->parseNalUnitHeader(eNalUnitType, TemporalId, bOutputFlag ); }
    159 #endif
    160 
     165#if HHI_MPI
     166  Void    decodeSPS                   ( TComSPS* pcSPS, Bool bIsDepth ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, bIsDepth); }
     167#else
    161168  Void    decodeSPS                   ( TComSPS* pcSPS     )    { m_pcEntropyDecoderIf->parseSPS(pcSPS);                    }
     169#endif
     170#if TILES_OR_ENTROPY_SYNC_IDC
     171  Void    decodePPS                   ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet    )    { m_pcEntropyDecoderIf->parsePPS(pcPPS, parameterSet);                    }
     172#else
    162173  Void    decodePPS                   ( TComPPS* pcPPS     )    { m_pcEntropyDecoderIf->parsePPS(pcPPS);                    }
     174#endif
     175  Void    decodeAPS                   ( TComAPS* pAPS      )    { m_pcEntropyDecoderIf->parseAPS(pAPS);}
    163176  void decodeSEI(SEImessages& seis) { m_pcEntropyDecoderIf->parseSEI(seis); }
    164   Void    decodeSliceHeader           ( TComSlice*& rpcSlice )  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice);         }
     177
     178#if LCU_SYNTAX_ALF
     179  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet)  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl, alfParamSet);         }
     180#else
     181  Void    decodeSliceHeader           ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl )  { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl);         }
     182#endif
     183
    165184  Void    decodeTerminatingBit        ( UInt& ruiIsLast )       { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast);     }
    166 
    167   // Adaptive Loop filter
    168   Void decodeAlfParam(ALFParam* pAlfParam);
    169   //--Adaptive Loop filter
    170 
     185 
    171186  TDecEntropyIf* getEntropyDecoder() { return m_pcEntropyDecoderIf; }
    172 
     187 
    173188public:
    174189  Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    179194  Void decodeResPredFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
    180195#endif
    181   Void decodeAlfCtrlFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    182 #if TSB_ALF_HEADER
    183   Void decodeAlfCtrlParam      ( ALFParam *pAlfParam );
    184 #endif
    185 
    186196  Void decodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    187197  Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     198 
     199  Void decodeIPCMInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    188200
    189201  Void decodePredInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU );
    190 
     202 
    191203  Void decodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    192204  Void decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    193   Void decodeInterDir          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    194   Void decodeRefFrmIdx         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList );
    195   Void decodeMvd               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList );
    196   Void decodeRefViewIdx        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList );
    197   //
     205 
     206#if !UNIFIED_TRANSFORM_TREE
    198207  Void decodeTransformIdx      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     208#endif
     209#if UNIFIED_TRANSFORM_TREE
     210  Void decodeQP                ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     211#else
    199212  Void decodeQP                ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    200 
    201   Void decodeViewidx           ( Int& riViewIdx );
    202 
    203 
     213#endif
     214 
     215  Void readTileMarker         ( UInt& uiTileIdx, UInt uiBitsUsed )  {  m_pcEntropyDecoderIf->readTileMarker( uiTileIdx, uiBitsUsed ); }
     216  Void updateContextTables    ( SliceType eSliceType, Int iQp ) { m_pcEntropyDecoderIf->updateContextTables( eSliceType, iQp ); }
     217 
     218 
    204219private:
    205   Void xDecodeTransformSubdiv  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 );
    206 
    207   Void xDecodeCoeff            ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, TextType eType );
    208 public:
    209   Void decodeCoeff             ( TComDataCU* pcCU                 , UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight );
    210 
     220#if UNIFIED_TRANSFORM_TREE
     221  Void xDecodeTransform        ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP );
     222#else
     223  Void xDecodeTransformSubdiv  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 );
     224 
     225  Void xDecodeCoeff            ( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP );
     226#endif //UNIFIED_TRANSFORM_TREE
     227
     228public:
     229  Void decodeCoeff             ( TComDataCU* pcCU                 , UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP );
     230 
    211231  // ALF-related
    212   Void decodeAux(ALFParam* pAlfParam);
    213   Void decodeFilt(ALFParam* pAlfParam);
    214   Void readFilterCodingParams(ALFParam* pAlfParam);
    215   Void readFilterCoeffs(ALFParam* pAlfParam);
    216   Void decodeFilterCoeff (ALFParam* pAlfParam);
    217   Int golombDecode(Int k);
    218 
    219 #if MTK_SAO
    220   Void decodeQAOOnePart(SAOParam* pQaoParam, Int part_idx);
    221   Void decodeQuadTreeSplitFlag(SAOParam* pQaoParam, Int part_idx);
    222   Void decodeSaoParam(SAOParam* pQaoParam) ;
     232
     233  /// set slice granularity
     234  Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyDecoderIf->setSliceGranularity(iSliceGranularity);}
     235
     236#if SAO_UNIT_INTERLEAVING
     237  Void decodeSaoParam         (SAOParam* saoParam);
     238  void decodeSaoLcu(Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool &repeatedRow );
     239  Void decodeSaoOneLcu(SaoLcuParam* saoLcuParam);
     240#endif
     241
     242#if OL_FLUSH
     243  Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); }
    223244#endif
    224245
    225246};// END CLASS DEFINITION TDecEntropy
    226247
     248//! \}
    227249
    228250#endif // __TDECENTROPY__
Note: See TracChangeset for help on using the changeset viewer.