Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncCavlc.h
- Timestamp:
- 1 Sep 2013, 22:47:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r443 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 45 45 #include "TLibCommon/CommonDef.h" 46 46 #include "TLibCommon/TComBitStream.h" 47 #include "TLibCommon/TComRom.h" 47 48 #include "TEncEntropy.h" 48 #include " TLibCommon/TComRom.h"49 #include "SyntaxElementWriter.h" 49 50 50 51 //! \ingroup TLibEncoder … … 58 59 59 60 /// CAVLC encoder class 60 class TEncCavlc : public TEncEntropyIf61 class TEncCavlc : public SyntaxElementWriter, public TEncEntropyIf 61 62 { 62 63 public: … … 65 66 66 67 protected: 67 TComBitIf* m_pcBitIf;68 68 TComSlice* m_pcSlice; 69 69 UInt m_uiCoeffCost; 70 Bool m_bAlfCtrl;71 UInt m_uiMaxAlfCtrlDepth;72 Int m_iSliceGranularity; //!< slice granularity73 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_TRACE79 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 #endif84 85 Void xWritePCMAlignZero ();86 Void xWriteEpExGolomb ( UInt uiSymbol, UInt uiCount );87 Void xWriteExGolombLevel ( UInt uiSymbol );88 Void xWriteUnaryMaxSymbol ( UInt uiSymbol, UInt uiMaxSymbol );89 70 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 ); 93 73 94 74 public: 95 75 96 76 Void resetEntropy (); 97 #if CABAC_INIT_FLAG98 77 Void determineCabacInitIdx () {}; 99 #endif100 78 101 79 Void setBitstream ( TComBitIf* p ) { m_pcBitIf = p; } 102 80 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;}107 81 Void resetBits () { m_pcBitIf->resetBits(); } 108 82 Void resetCoeffCost () { m_uiCoeffCost = 0; } 109 83 UInt getNumberOfWrittenBits() { return m_pcBitIf->getNumberOfWrittenBits(); } 110 84 UInt getCoeffCost () { return m_uiCoeffCost; } 111 112 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046113 85 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 ); 118 89 #else 119 90 Void codeSPS ( TComSPS* pcSPS ); 120 91 #endif 121 92 Void codePPS ( TComPPS* pcPPS ); 122 void codeSEI(const SEI&);123 93 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 ); 127 97 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 128 98 Void codeTerminatingBit ( UInt uilsLast ); 129 99 Void codeSliceFinish (); 130 Void codeFlush () {}131 Void encodeStart () {}132 100 133 #if H3D_IVMP134 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum );135 #else136 101 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 137 #endif138 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_D0091145 102 Void codeSAOSign ( UInt code ) { printf("Not supported\n"); assert (0); } 146 103 Void codeSaoMaxUvlc ( UInt code, UInt maxSymbol ){printf("Not supported\n"); assert (0);} … … 148 105 Void codeSaoTypeIdx ( UInt uiCode ){printf("Not supported\n"); assert (0);} 149 106 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 ); 159 122 #endif 160 123 161 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );162 #if LGE_ILLUCOMP_B0045163 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );164 #endif165 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );166 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx );167 #if H3D_IVRP168 Void codeResPredFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );169 #endif170 #if QC_ARP_D0177171 virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx );172 #endif173 Void codeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );174 175 Void codeApsExtensionFlag ();176 177 /// set slice granularity178 Void setSliceGranularity(Int iSliceGranularity) {m_iSliceGranularity = iSliceGranularity;}179 180 ///get slice granularity181 Int getSliceGranularity() {return m_iSliceGranularity; }182 183 Void codeAlfCtrlFlag ( UInt uiSymbol );184 124 Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ); 185 125 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 188 128 Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 189 129 190 Void codeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx , Int numIPCM, Bool firstIPCMFlag);130 Void codeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 191 131 192 132 Void codeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx ); 193 133 Void codeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); 194 134 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); 202 138 Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx ); 203 139 Void codeInterDir ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 208 144 209 145 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 211 148 Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); 212 149 … … 214 151 Void updateContextTables ( SliceType eSliceType, Int iQp, Bool bExecuteFinish=true ) { return; } 215 152 Void updateContextTables ( SliceType eSliceType, Int iQp ) { return; } 216 Void writeTileMarker ( UInt uiTileIdx, UInt uiBitsUsed );217 153 218 Void codeAPSInitInfo(TComAPS* pcAPS); //!< code APS flags before encoding SAO and ALF parameters219 Void codeFinish(Bool bEnd) { /*do nothing*/}220 154 Void codeScalingList ( TComScalingList* scalingList ); 221 155 Void xCodeScalingList ( TComScalingList* scalingList, UInt sizeId, UInt listId); 222 156 Void codeDFFlag ( UInt uiCode, const Char *pSymbolName ); 223 157 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); 224 225 #if RWTH_SDC_DLT_B0036226 #if !PKU_QC_DEPTH_INTRA_UNI_D0195227 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );228 #endif229 Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );230 #if !PKU_QC_DEPTH_INTRA_UNI_D0195231 Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx );232 #endif233 #endif234 158 235 159 };
Note: See TracChangeset for help on using the changeset viewer.