Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.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/TLibEncoder/TEncCavlc.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 *
     
    4545#include "TLibCommon/CommonDef.h"
    4646#include "TLibCommon/TComBitStream.h"
     47#include "TLibCommon/TComRom.h"
    4748#include "TEncEntropy.h"
    48 #include "TLibCommon/TComRom.h"
     49#include "SyntaxElementWriter.h"
    4950
    5051//! \ingroup TLibEncoder
     
    5859
    5960/// CAVLC encoder class
    60 class TEncCavlc : public TEncEntropyIf
     61class TEncCavlc : public SyntaxElementWriter, public TEncEntropyIf
    6162{
    6263public:
     
    6566 
    6667protected:
    67   TComBitIf*    m_pcBitIf;
    6868  TComSlice*    m_pcSlice;
    6969  UInt          m_uiCoeffCost;
    70   Bool          m_bAlfCtrl;
    71   UInt          m_uiMaxAlfCtrlDepth;
    72   Int           m_iSliceGranularity;  //!< slice granularity
    73  
    74   Void  xWriteCode            ( UInt uiCode, UInt uiLength );
    75   Void  xWriteUvlc            ( UInt uiCode );
    76   Void  xWriteSvlc            ( Int  iCode   );
    77   Void  xWriteFlag            ( UInt uiCode );
    78 #if ENC_DEC_TRACE
    79   Void  xWriteCodeTr          ( UInt value, UInt  length, const Char *pSymbolName);
    80   Void  xWriteUvlcTr          ( UInt value,               const Char *pSymbolName);
    81   Void  xWriteSvlcTr          ( Int  value,               const Char *pSymbolName);
    82   Void  xWriteFlagTr          ( UInt value,               const Char *pSymbolName);
    83 #endif
    84  
    85   Void  xWritePCMAlignZero    ();
    86   Void  xWriteEpExGolomb      ( UInt uiSymbol, UInt uiCount );
    87   Void  xWriteExGolombLevel    ( UInt uiSymbol );
    88   Void  xWriteUnaryMaxSymbol  ( UInt uiSymbol, UInt uiMaxSymbol );
    8970
    90   Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS );
    91  
    92   UInt  xConvertToUInt        ( Int iValue ) {  return ( iValue <= 0) ? -iValue<<1 : (iValue<<1)-1; }
     71  Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
     72  Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag );
    9373 
    9474public:
    9575 
    9676  Void  resetEntropy          ();
    97 #if CABAC_INIT_FLAG
    9877  Void  determineCabacInitIdx  () {};
    99 #endif
    10078
    10179  Void  setBitstream          ( TComBitIf* p )  { m_pcBitIf = p;  }
    10280  Void  setSlice              ( TComSlice* p )  { m_pcSlice = p;  }
    103   Bool getAlfCtrl() {return m_bAlfCtrl;}
    104   UInt getMaxAlfCtrlDepth() {return m_uiMaxAlfCtrlDepth;}
    105   Void setAlfCtrl(Bool bAlfCtrl) {m_bAlfCtrl = bAlfCtrl;}
    106   Void setMaxAlfCtrlDepth(UInt uiMaxAlfCtrlDepth) {m_uiMaxAlfCtrlDepth = uiMaxAlfCtrlDepth;}
    10781  Void  resetBits             ()                { m_pcBitIf->resetBits(); }
    10882  Void  resetCoeffCost        ()                { m_uiCoeffCost = 0;  }
    10983  UInt  getNumberOfWrittenBits()                { return  m_pcBitIf->getNumberOfWrittenBits();  }
    11084  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    111  
    112 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    11385  Void  codeVPS                 ( TComVPS* pcVPS );
    114 #endif
    115 
    116 #if HHI_MPI || H3D_QTL
    117   Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
     86  Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
     87#if H_3D
     88  Void  codeSPS                 ( TComSPS* pcSPS, Int viewIndex, Bool depthFlag );
    11889#else
    11990  Void  codeSPS                 ( TComSPS* pcSPS );
    12091#endif
    12192  Void  codePPS                 ( TComPPS* pcPPS );
    122   void codeSEI(const SEI&);
    12393  Void  codeSliceHeader         ( TComSlice* pcSlice );
    124 
    125   Void codeTileMarkerFlag(TComSlice* pcSlice);
    126 
     94  Void  codePTL                 ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);
     95  Void  codeProfileTier         ( ProfileTierLevel* ptl );
     96  Void  codeHrdParameters       ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    12797  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
    12898  Void  codeTerminatingBit      ( UInt uilsLast );
    12999  Void  codeSliceFinish         ();
    130   Void  codeFlush               () {}
    131   Void  encodeStart             () {}
    132100 
    133 #if H3D_IVMP
    134   Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum );
    135 #else
    136101  Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList );
    137 #endif
    138   Void codeAlfFlag       ( UInt uiCode );
    139   Void codeAlfUvlc       ( UInt uiCode );
    140   Void codeAlfSvlc       ( Int   iCode );
    141   Void codeAlfCtrlDepth();
    142   Void codeAPSAlflag(UInt uiCode);
    143   Void codeAlfFixedLengthIdx( UInt idx, UInt numFilterSetsInBuffer);
    144 #if LGE_SAO_MIGRATION_D0091
    145102  Void codeSAOSign       ( UInt code   ) { printf("Not supported\n"); assert (0); }
    146103  Void codeSaoMaxUvlc    ( UInt   code, UInt maxSymbol ){printf("Not supported\n"); assert (0);}
     
    148105  Void codeSaoTypeIdx    ( UInt uiCode ){printf("Not supported\n"); assert (0);}
    149106  Void codeSaoUflc       ( UInt uiLength, UInt   uiCode ){ assert(uiCode < 32); printf("Not supported\n"); assert (0);}
    150 #else
    151   Void codeSaoFlag       ( UInt uiCode );
    152   Void codeSaoUvlc       ( UInt uiCode );
    153   Void codeSaoSvlc       ( Int   iCode );
    154   Void codeSaoRun        ( UInt uiCode, UInt maxValue  );
    155   Void codeSaoMergeLeft  ( UInt uiCode, UInt compIdx ){;}
    156   Void codeSaoMergeUp    ( UInt uiCode ){;}
    157   Void codeSaoTypeIdx    ( UInt uiCode ){ xWriteUvlc(uiCode   );}
    158   Void codeSaoUflc       ( UInt uiCode ){ assert(uiCode < 32); xWriteCode(uiCode, 5);}
     107
     108  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
     109  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     110  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     111  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     112 
     113#if H_3D_ARP
     114  Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     115#endif
     116#if H_3D_IC
     117  Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     118#endif
     119#if LGE_INTER_SDC_E0156
     120  Void codeInterSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     121  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
    159122#endif
    160123
    161   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    162 #if LGE_ILLUCOMP_B0045
    163   Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    164 #endif
    165   Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    166   Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    167 #if H3D_IVRP
    168   Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    169 #endif
    170 #if QC_ARP_D0177
    171   virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    172 #endif
    173   Void codeAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    174 
    175   Void codeApsExtensionFlag ();
    176 
    177   /// set slice granularity
    178   Void setSliceGranularity(Int iSliceGranularity)  {m_iSliceGranularity = iSliceGranularity;}
    179 
    180   ///get slice granularity
    181   Int  getSliceGranularity()                       {return m_iSliceGranularity;             }
    182 
    183   Void codeAlfCtrlFlag   ( UInt uiSymbol );
    184124  Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode );
    185125  Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    188128  Void codePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    189129 
    190   Void codeIPCMInfo      ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int numIPCM, Bool firstIPCMFlag);
     130  Void codeIPCMInfo      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    191131
    192132  Void codeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx );
    193133  Void codeQtCbf         ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth );
    194134  Void codeQtRootCbf     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    195  
    196   Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx
    197 #if PKU_QC_DEPTH_INTRA_UNI_D0195
    198     , Bool bSdcRD = false
    199 #endif
    200     );
    201  
     135  Void codeQtCbfZero     ( TComDataCU* pcCU, TextType eType, UInt uiTrDepth );
     136  Void codeQtRootCbfZero ( TComDataCU* pcCU );
     137  Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt absPartIdx, Bool isMultiple);
    202138  Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx );
    203139  Void codeInterDir      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    208144 
    209145  Void codeCoeffNxN      ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType );
    210  
     146  Void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType );
     147
    211148  Void estBit               (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType);
    212149 
     
    214151  Void updateContextTables           ( SliceType eSliceType, Int iQp, Bool bExecuteFinish=true ) { return;   }
    215152  Void updateContextTables           ( SliceType eSliceType, Int iQp  )                          { return;   }
    216   Void writeTileMarker               ( UInt uiTileIdx, UInt uiBitsUsed );
    217153
    218   Void  codeAPSInitInfo(TComAPS* pcAPS);  //!< code APS flags before encoding SAO and ALF parameters
    219   Void  codeFinish(Bool bEnd) { /*do nothing*/}
    220154  Void codeScalingList  ( TComScalingList* scalingList );
    221155  Void xCodeScalingList ( TComScalingList* scalingList, UInt sizeId, UInt listId);
    222156  Void codeDFFlag       ( UInt uiCode, const Char *pSymbolName );
    223157  Void codeDFSvlc       ( Int   iCode, const Char *pSymbolName );
    224  
    225 #if RWTH_SDC_DLT_B0036
    226 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    227   Void codeSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    228 #endif
    229   Void codeSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
    230 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    231   Void codeSDCPredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    232 #endif
    233 #endif
    234158
    235159};
Note: See TracChangeset for help on using the changeset viewer.