Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCAVLC.h
- Timestamp:
- 11 May 2012, 21:20:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r42 r56 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 5 * 6 * Copyright (c) 2010-201 1,ISO/IEC4 * granted under this license. 5 * 6 * Copyright (c) 2010-2012, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 15 15 * this list of conditions and the following disclaimer in the documentation 16 16 * and/or other materials provided with the distribution. 17 * * Neither the name of the I SO/IEC nor the names of its contributors may17 * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may 18 18 * be used to endorse or promote products derived from this software without 19 19 * specific prior written permission. … … 32 32 */ 33 33 34 35 36 34 /** \file TDecCAVLC.h 37 35 \brief CAVLC decoder class (header) … … 46 44 47 45 #include "TDecEntropy.h" 46 47 //! \ingroup TLibDecoder 48 //! \{ 48 49 49 50 // ==================================================================================================================== … … 61 62 62 63 protected: 63 Void xReadCode (UInt uiLength, UInt& ruiCode); 64 Void xReadUvlc (UInt& ruiVal); 65 Void xReadSvlc (Int& riVal); 66 Void xReadFlag (UInt& ruiCode); 67 Void xReadEpExGolomb ( UInt& ruiSymbol, UInt uiCount ); 68 Void xReadExGolombLevel ( UInt& ruiSymbol ); 69 Void xReadUnaryMaxSymbol ( UInt& ruiSymbol, UInt uiMaxSymbol ); 70 64 Void xReadCode (UInt uiLength, UInt& ruiCode); 65 Void xReadUvlc (UInt& ruiVal); 66 Void xReadSvlc (Int& riVal); 67 Void xReadFlag (UInt& ruiCode); 68 Void xReadEpExGolomb ( UInt& ruiSymbol, UInt uiCount ); 69 Void xReadExGolombLevel ( UInt& ruiSymbol ); 70 Void xReadUnaryMaxSymbol ( UInt& ruiSymbol, UInt uiMaxSymbol ); 71 #if ENC_DEC_TRACE 72 Void xReadCodeTr (UInt length, UInt& rValue, const Char *pSymbolName); 73 Void xReadUvlcTr ( UInt& rValue, const Char *pSymbolName); 74 Void xReadSvlcTr ( Int& rValue, const Char *pSymbolName); 75 Void xReadFlagTr ( UInt& rValue, const Char *pSymbolName); 76 #endif 77 78 Void xReadPCMAlignZero (); 79 71 80 UInt xGetBit (); 72 Int xReadVlc ( Int n ); 73 #if CAVLC_COEF_LRG_BLK 74 Void xParseCoeff ( TCoeff* scoeff, Int iTableNumber, Int blSize); 75 #else 76 Void xParseCoeff4x4 ( TCoeff* scoeff, Int iTableNumber ); 77 Void xParseCoeff8x8 ( TCoeff* scoeff, Int iTableNumber ); 78 #endif 79 #if QC_MOD_LCEC 80 Void xRunLevelIndInv (LastCoeffStruct *combo, Int maxrun, UInt lrg1Pos, UInt cn); 81 #if RUNLEVEL_TABLE_CUT 82 Void xRunLevelIndInterInv(LastCoeffStruct *combo, Int maxrun, UInt cn); 83 #endif 84 #endif 85 81 82 #if RPS_IN_SPS 83 void parseShortTermRefPicSet (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx); 84 #else 85 void parseShortTermRefPicSet (TComPPS* pcPPS, TComReferencePictureSet* pcRPS, Int idx); 86 #endif 86 87 private: 87 TComBitstream* m_pcBitstream; 88 UInt m_uiCoeffCost; 89 Bool m_bRunLengthCoding; 90 UInt m_uiRun; 91 Bool m_bAlfCtrl; 92 UInt m_uiMaxAlfCtrlDepth; 93 UInt m_uiLPTableD4[3][32]; 94 #if !CAVLC_COEF_LRG_BLK 95 UInt m_uiLPTableD8[10][128]; 96 #endif 97 UInt m_uiLastPosVlcIndex[10]; 98 99 #if LCEC_INTRA_MODE 100 #if MTK_DCM_MPM 101 UInt m_uiIntraModeTableD17[2][16]; 102 UInt m_uiIntraModeTableD34[2][33]; 103 #else 104 UInt m_uiIntraModeTableD17[16]; 105 UInt m_uiIntraModeTableD34[33]; 106 #endif 107 #endif 108 #if QC_LCEC_INTER_MODE 109 UInt m_uiSplitTableD[4][7]; 110 #endif 111 #if CAVLC_RQT_CBP 112 UInt m_uiCBP_YUV_TableD[4][8]; 113 UInt m_uiCBP_YS_TableD[2][4]; 114 UInt m_uiCBP_YCS_TableD[2][8]; 115 UInt m_uiCBP_4Y_TableD[2][15]; 116 UInt m_uiCBP_4Y_VlcIdx; 117 #else 118 UInt m_uiBlkCBPTableD[2][15]; 119 UInt m_uiCBPTableD[2][8]; 120 UInt m_uiCbpVlcIdx[2]; 121 UInt m_uiBlkCbpVlcIdx; 122 #endif 123 124 125 126 Int m_iRefFrame0[1000]; 127 Int m_iRefFrame1[1000]; 128 Bool m_bMVres0[1000]; 129 Bool m_bMVres1[1000]; 130 #if MS_LCEC_LOOKUP_TABLE_EXCEPTION 131 UInt m_uiMI1TableD[9]; 132 #else 133 UInt m_uiMI1TableD[8]; 134 #endif 135 UInt m_uiMI2TableD[15]; 136 UInt m_uiMITableVlcIdx; 137 138 #if CAVLC_COUNTER_ADAPT 139 #if CAVLC_RQT_CBP 140 UChar m_ucCBP_YUV_TableCounter[4][4]; 141 UChar m_ucCBP_4Y_TableCounter[2][2]; 142 UChar m_ucCBP_YS_TableCounter[2][3]; 143 UChar m_ucCBP_YCS_TableCounter[2][4]; 144 UChar m_ucCBP_YUV_TableCounterSum[4]; 145 UChar m_ucCBP_4Y_TableCounterSum[2]; 146 UChar m_ucCBP_YS_TableCounterSum[2]; 147 UChar m_ucCBP_YCS_TableCounterSum[2]; 148 #else 149 UChar m_ucCBFTableCounter [2][4]; 150 UChar m_ucBlkCBPTableCounter [2][2]; 151 UChar m_ucCBFTableCounterSum[2]; 152 UChar m_ucBlkCBPTableCounterSum[2]; 153 #endif 154 155 UChar m_ucMI1TableCounter[4]; 156 UChar m_ucSplitTableCounter[4][4]; 157 UChar m_ucSplitTableCounterSum[4]; 158 UChar m_ucMI1TableCounterSum; 159 #endif 160 88 TComInputBitstream* m_pcBitstream; 89 Int m_iSliceGranularity; //!< slice granularity 90 161 91 Int** m_aaiTempScale; 162 92 Int** m_aaiTempOffset; … … 165 95 166 96 public: 97 98 /// rest entropy coder by intial QP and IDC in CABAC 99 #if !CABAC_INIT_FLAG 100 Void resetEntropy (Int iQp, Int iID) { printf("Not supported yet\n"); assert(0); exit(1);} 167 101 Void resetEntropy ( TComSlice* pcSlice ); 168 Void setBitstream ( TComBitstream* p ) { m_pcBitstream = p; } 169 Void setAlfCtrl ( Bool bAlfCtrl ) { m_bAlfCtrl = bAlfCtrl; } 170 Void setMaxAlfCtrlDepth ( UInt uiMaxAlfCtrlDepth ) { m_uiMaxAlfCtrlDepth = uiMaxAlfCtrlDepth; } 171 102 #else 103 Void resetEntropy ( TComSlice* pcSlice ) { assert(0); }; 104 #endif 105 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; } 106 /// set slice granularity 107 Void setSliceGranularity(Int iSliceGranularity) {m_iSliceGranularity = iSliceGranularity;} 108 109 /// get slice granularity 110 Int getSliceGranularity() {return m_iSliceGranularity; } 172 111 Void parseTransformSubdivFlag( UInt& ruiSubdivFlag, UInt uiLog2TransformBlockSize ); 173 112 Void parseQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth ); 174 113 Void parseQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf ); 175 Void parseAlfFlag ( UInt& ruiVal ); 176 Void parseAlfUvlc ( UInt& ruiVal ); 177 Void parseAlfSvlc ( Int& riVal ); 178 #if MTK_SAO 179 Void parseAoFlag ( UInt& ruiVal ); 180 Void parseAoUvlc ( UInt& ruiVal ); 181 Void parseAoSvlc ( Int& riVal ); 182 #endif 183 184 #if BITSTREAM_EXTRACTION 185 Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, UInt& uiLayerId ); 186 #else 187 Void parseNalUnitHeader ( NalUnitType& eNalUnitType, UInt& TemporalId, Bool& bOutputFlag ); 188 #endif 189 190 114 115 #if HHI_MPI 116 Void parseSPS ( TComSPS* pcSPS, Bool bIsDepth ); 117 #else 191 118 Void parseSPS ( TComSPS* pcSPS ); 119 #endif 120 #if TILES_OR_ENTROPY_SYNC_IDC 121 Void parsePPS ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet); 122 #else 192 123 Void parsePPS ( TComPPS* pcPPS); 193 void parseSEI(SEImessages&); 194 Void parseSliceHeader ( TComSlice*& rpcSlice ); 124 #endif 125 Void parseSEI(SEImessages&); 126 Void parseAPS ( TComAPS* pAPS ); 127 #if LCU_SYNTAX_ALF 128 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet); 129 #else 130 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl ); 131 #endif 195 132 Void parseTerminatingBit ( UInt& ruiBit ); 196 133 197 Void parseMVPIdx ( TComDataCU* pcCU, Int& riMVPIdx, Int iMVPNum, UInt uiAbsPartIdx, UInt uiDepth, RefPicList eRefList ); 134 #if HHI_INTER_VIEW_MOTION_PRED 135 Void parseMVPIdx ( Int& riMVPIdx, Int iAMVPCands ); 136 #else 137 Void parseMVPIdx ( Int& riMVPIdx ); 138 #endif 198 139 199 140 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 200 141 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 201 142 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); 202 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI 203 Void parseMergeIndexMV ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); 204 #endif 143 #if HHI_INTER_VIEW_RESIDUAL_PRED 205 144 Void parseResPredFlag ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ); 145 #endif 206 146 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 207 147 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 217 157 218 158 Void parseDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 219 #if CAVLC_RQT_CBP220 Void parseCbfTrdiv ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiTrDepth, UInt uiDepth, UInt& uiSubdiv );221 UInt xGetFlagPattern ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiSubdiv );222 #endif223 Void parseCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth );224 Void parseBlockCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth, UInt uiDepth, UInt uiQPartNum );225 159 Void parseCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ); 226 160 227 Void parseAlfCtrlDepth ( UInt& ruiAlfCtrlDepth ); 228 Void parseAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 229 #if TSB_ALF_HEADER 230 Void parseAlfFlagNum ( UInt& ruiVal, UInt minValue, UInt depth ); 231 Void parseAlfCtrlFlag ( UInt &ruiAlfCtrlFlag ); 232 #endif 233 234 #ifdef WEIGHT_PRED 235 Void parseWeightPredTable ( TComSlice* pcSlice ); 236 #endif 237 238 Void parseViewIdx (Int& riViewIdx) ; 161 Void parseIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); 162 163 Void readTileMarker ( UInt& uiTileIdx, UInt uiBitsUsed ); 164 Void updateContextTables ( SliceType eSliceType, Int iQp ) { return; } 165 #if OL_FLUSH 166 Void decodeFlush() {}; 167 #endif 168 169 Void xParsePredWeightTable ( TComSlice* pcSlice ); 170 Void parseScalingList ( TComScalingList* scalingList ); 171 Void xDecodeScalingList ( TComScalingList *scalingList, UInt sizeId, UInt listId); 172 Void parseDFFlag ( UInt& ruiVal, const Char *pSymbolName ); 173 Void parseDFSvlc ( Int& riVal, const Char *pSymbolName ); 174 protected: 175 #if DBL_CONTROL 176 Void xParseDblParam ( TComAPS* aps ); 177 #endif 178 Void xParseSaoParam ( SAOParam* pSaoParam ); 179 #if SAO_UNIT_INTERLEAVING 180 Void xParseSaoOffset (SaoLcuParam* saoLcuParam); 181 Void xParseSaoUnit (Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool& repeatedRow ); 182 #else 183 Void xParseSaoSplitParam ( SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr ); 184 Void xParseSaoOffsetParam ( SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr ); 185 #endif 186 #if LCU_SYNTAX_ALF 187 Void xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool acrossSlice = true, Int numLCUInWidth= -1, Int numLCUInHeight= -1); 188 Void parseAlfParamSet(AlfParamSet* pAlfParamSet, Int firstLCUAddr, Bool alfAcrossSlice); 189 Void parseAlfFixedLengthRun(UInt& idx, UInt rx, UInt numLCUInWidth); 190 Void parseAlfStoredFilterIdx(UInt& idx, UInt numFilterSetsInBuffer); 191 #endif 192 Void xParseAlfParam ( ALFParam* pAlfParam ); 193 Void xParseAlfCuControlParam(AlfCUCtrlInfo& cAlfParam, Int iNumCUsInPic); 194 Int xGolombDecode ( Int k ); 195 Bool xMoreRbspData(); 239 196 }; 197 198 //! \} 199 240 200 #endif // !defined(AFX_TDECCAVLC_H__9732DD64_59B0_4A41_B29E_1A5B18821EAD__INCLUDED_) 241 201
Note: See TracChangeset for help on using the changeset viewer.