Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSbac.h
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncSbac.h
r1196 r1313 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-2015, ITU/ISO/IEC4 * granted under this license. 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 69 69 TEncSbac(); 70 70 virtual ~TEncSbac(); 71 71 72 72 Void init ( TEncBinIf* p ) { m_pcBinIf = p; } 73 73 Void uninit () { m_pcBinIf = 0; } 74 74 75 75 // Virtual list 76 Void resetEntropy ( );77 Void determineCabacInitIdx ();76 Void resetEntropy (const TComSlice *pSlice); 77 SliceType determineCabacInitIdx (const TComSlice *pSlice); 78 78 Void setBitstream ( TComBitIf* p ) { m_pcBitIf = p; m_pcBinIf->init( p ); } 79 Void setSlice ( TComSlice* p ) { m_pcSlice = p; } 80 // SBAC RD 81 Void resetCoeffCost () { m_uiCoeffCost = 0; } 82 UInt getCoeffCost () { return m_uiCoeffCost; } 83 84 Void load ( TEncSbac* pScr ); 85 Void loadIntraDirModeLuma ( TEncSbac* pScr ); 86 #if H_3D_DIM 87 Void loadIntraDepthMode ( TEncSbac* pScr ); 88 #endif 89 Void store ( TEncSbac* pDest ); 90 Void loadContexts ( TEncSbac* pScr ); 79 80 Void load ( const TEncSbac* pSrc ); 81 Void loadIntraDirMode ( const TEncSbac* pScr, const ChannelType chType ); 82 #if NH_3D_DMM 83 Void loadIntraDepthDmm ( const TEncSbac* pSrc ); 84 #endif 85 Void store ( TEncSbac* pDest ) const; 86 Void loadContexts ( const TEncSbac* pSrc ); 91 87 Void resetBits () { m_pcBinIf->resetBits(); m_pcBitIf->resetBits(); } 92 88 UInt getNumberOfWrittenBits () { return m_pcBinIf->getNumWrittenBits(); } 93 89 //--SBAC RD 94 90 95 Void codeVPS ( TComVPS* pcVPS ); 96 Void codeSPS ( TComSPS* pcSPS ); 97 Void codePPS ( TComPPS* pcPPS ); 98 Void codeSliceHeader ( TComSlice* pcSlice ); 99 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 100 Void codeTerminatingBit ( UInt uilsLast ); 101 Void codeSliceFinish (); 102 Void codeSaoMaxUvlc ( UInt code, UInt maxSymbol ); 103 Void codeSaoMerge ( UInt uiCode ); 104 Void codeSaoTypeIdx ( UInt uiCode); 105 Void codeSaoUflc ( UInt uiLength, UInt uiCode ); 106 Void codeSAOSign ( UInt uiCode); //<! code SAO offset sign 107 Void codeScalingList ( TComScalingList* /*scalingList*/ ){ assert (0); return;}; 108 109 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled); 110 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam 91 Void codeVPS ( const TComVPS* pcVPS ); 92 Void codeSPS ( const TComSPS* pcSPS ); 93 Void codePPS ( const TComPPS* pcPPS ); 94 Void codeSliceHeader ( TComSlice* pcSlice ); 95 Void codeTilesWPPEntryPoint ( TComSlice* pSlice ); 96 Void codeTerminatingBit ( UInt uilsLast ); 97 Void codeSliceFinish (); 98 Void codeSaoMaxUvlc ( UInt code, UInt maxSymbol ); 99 Void codeSaoMerge ( UInt uiCode ); 100 Void codeSaoTypeIdx ( UInt uiCode); 101 Void codeSaoUflc ( UInt uiLength, UInt uiCode ); 102 Void codeSAOSign ( UInt uiCode); //<! code SAO offset sign 103 104 Void codeSAOOffsetParam(ComponentID compIdx, SAOOffset& ctbParam, Bool sliceEnabled, const Int channelBitDepth); 105 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, const BitDepths &bitDepths 111 106 , Bool* sliceEnabled 112 107 , Bool leftMergeAvail … … 119 114 Void xWriteUnaryMaxSymbol ( UInt uiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol ); 120 115 Void xWriteEpExGolomb ( UInt uiSymbol, UInt uiCount ); 121 Void xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam ); 122 #if H_3D_DIM 123 Void xWriteExGolombLevel ( UInt uiSymbol, ContextModel& rcSCModel ); 124 Void xCodeDimDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); 125 #if H_3D_DIM_DMM 116 Void xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 117 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 118 Void xWriteExGolombLevelDdc( UInt uiSymbol ); 119 Void xCodeDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); 120 #endif 121 #if NH_3D_DMM 122 Void xCodeIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx ); 123 Void xCodeDmmData ( TComDataCU* pcCU, UInt absPartIdx ); 126 124 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 127 125 #endif 128 #endif 129 130 Void xCopyFrom ( TEncSbac* pSrc ); 131 Void xCopyContextsFrom ( TEncSbac* pSrc ); 132 133 Void codeDFFlag( UInt /*uiCode*/, const Char* /*pSymbolName*/ ) {printf("Not supported in codeDFFlag()\n"); assert(0); exit(1);}; 134 Void codeDFSvlc( Int /*iCode*/, const Char* /*pSymbolName*/ ) {printf("Not supported in codeDFSvlc()\n"); assert(0); exit(1);}; 126 127 128 Void xCopyFrom ( const TEncSbac* pSrc ); 129 Void xCopyContextsFrom ( const TEncSbac* pSrc ); 135 130 136 131 protected: 137 132 TComBitIf* m_pcBitIf; 138 TComSlice* m_pcSlice;139 133 TEncBinIf* m_pcBinIf; 140 //SBAC RD141 UInt m_uiCoeffCost;142 134 143 135 //--Adaptive loop filter 144 136 145 137 public: 146 138 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 147 139 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 148 #if H_3D140 #if NH_3D_DIS 149 141 Void codeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 150 142 #endif 151 143 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 152 144 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 153 #if H_3D_ARP145 #if NH_3D_ARP 154 146 Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 155 147 #endif 156 #if H_3D_IC148 #if NH_3D_IC 157 149 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 158 150 #endif 159 #if H_3D_INTER_SDC 160 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 151 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 152 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 153 #endif 154 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER 161 155 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 162 156 #endif 163 #if H_3D_DBBP157 #if NH_3D_DBBP 164 158 Void codeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 165 159 #endif 166 160 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 167 161 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 168 162 169 163 Void codePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 170 164 Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 171 165 Void codeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 172 166 Void codeTransformSubdivFlag ( UInt uiSymbol, UInt uiCtx ); 173 Void codeQtCbf ( TCom DataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth);167 Void codeQtCbf ( TComTU & rTu, const ComponentID compID, const Bool lowestLevel ); 174 168 Void codeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 175 Void codeQtCbfZero ( TCom DataCU* pcCU, TextType eType, UInt uiTrDepth);176 Void codeQtRootCbfZero ( TComDataCU* pcCU);169 Void codeQtCbfZero ( TComTU &rTu, const ChannelType chType ); 170 Void codeQtRootCbfZero ( ); 177 171 Void codeIntraDirLumaAng ( TComDataCU* pcCU, UInt absPartIdx, Bool isMultiple); 178 179 172 Void codeIntraDirChroma ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 180 181 #if H_3D_DIM182 Void codeIntraDepth ( TComDataCU* pcCU, UInt absPartIdx );183 Void codeIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx );184 #endif185 186 173 Void codeInterDir ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 187 174 Void codeRefFrmIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 188 175 Void codeMvd ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 189 176 177 Void codeCrossComponentPrediction( TComTU &rTu, ComponentID compID ); 178 190 179 Void codeDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 191 192 Void codeLastSignificantXY ( UInt uiPosX, UInt uiPosY, Int width, Int height, TextType eTType, UInt uiScanIdx ); 193 Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ); 194 void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType ); 180 Void codeChromaQpAdjustment ( TComDataCU* cu, UInt absPartIdx ); 181 182 Void codeLastSignificantXY ( UInt uiPosX, UInt uiPosY, Int width, Int height, ComponentID component, UInt uiScanIdx ); 183 Void codeCoeffNxN ( TComTU &rTu, TCoeff* pcCoef, const ComponentID compID ); 184 Void codeTransformSkipFlags ( TComTU &rTu, ComponentID component ); 195 185 196 186 // ------------------------------------------------------------------------------------------------------------------- 197 187 // for RD-optimizatioon 198 188 // ------------------------------------------------------------------------------------------------------------------- 199 200 Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType);189 190 Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType); 201 191 Void estCBFBit ( estBitsSbacStruct* pcEstBitsSbac ); 202 Void estSignificantCoeffGroupMapBit( estBitsSbacStruct* pcEstBitsSbac, TextType eTType ); 203 Void estSignificantMapBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType ); 204 Void estSignificantCoefficientsBit ( estBitsSbacStruct* pcEstBitsSbac, TextType eTType ); 205 206 Void updateContextTables ( SliceType eSliceType, Int iQp, Bool bExecuteFinish=true ); 207 Void updateContextTables ( SliceType eSliceType, Int iQp ) { this->updateContextTables( eSliceType, iQp, true); }; 208 192 Void estSignificantCoeffGroupMapBit( estBitsSbacStruct* pcEstBitsSbac, ChannelType chType ); 193 Void estSignificantMapBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType ); 194 Void estLastSignificantPositionBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType ); 195 Void estSignificantCoefficientsBit ( estBitsSbacStruct* pcEstBitsSbac, ChannelType chType ); 196 197 Void codeExplicitRdpcmMode ( TComTU &rTu, const ComponentID compID ); 198 199 209 200 TEncBinIf* getEncBinIf() { return m_pcBinIf; } 210 201 private: 211 UInt m_uiLastQp;212 213 202 ContextModel m_contextModels[MAX_NUM_CTX_MOD]; 214 203 Int m_numContextModels; 215 204 ContextModel3DBuffer m_cCUSplitFlagSCModel; 216 205 ContextModel3DBuffer m_cCUSkipFlagSCModel; 217 #if H_3D206 #if NH_3D_DIS 218 207 ContextModel3DBuffer m_cCUDISFlagSCModel; 219 208 ContextModel3DBuffer m_cCUDISTypeSCModel; … … 221 210 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 222 211 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 223 #if H_3D_ARP212 #if NH_3D_ARP 224 213 ContextModel3DBuffer m_cCUPUARPWSCModel; 225 214 #endif 226 #if H_3D_IC215 #if NH_3D_IC 227 216 ContextModel3DBuffer m_cCUICFlagSCModel; 228 217 #endif … … 238 227 ContextModel3DBuffer m_cCUTransSubdivFlagSCModel; 239 228 ContextModel3DBuffer m_cCUQtRootCbfSCModel; 240 229 241 230 ContextModel3DBuffer m_cCUSigCoeffGroupSCModel; 242 231 ContextModel3DBuffer m_cCUSigSCModel; … … 245 234 ContextModel3DBuffer m_cCUOneSCModel; 246 235 ContextModel3DBuffer m_cCUAbsSCModel; 247 236 248 237 ContextModel3DBuffer m_cMVPIdxSCModel; 249 238 250 239 ContextModel3DBuffer m_cSaoMergeSCModel; 251 240 ContextModel3DBuffer m_cSaoTypeIdxSCModel; 252 241 ContextModel3DBuffer m_cTransformSkipSCModel; 253 242 ContextModel3DBuffer m_CUTransquantBypassFlagSCModel; 254 255 #if H_3D_DIM 256 ContextModel3DBuffer m_cDepthIntraModeSCModel; 257 ContextModel3DBuffer m_cDdcFlagSCModel; 243 ContextModel3DBuffer m_explicitRdpcmFlagSCModel; 244 ContextModel3DBuffer m_explicitRdpcmDirSCModel; 245 ContextModel3DBuffer m_cCrossComponentPredictionSCModel; 246 247 ContextModel3DBuffer m_ChromaQpAdjFlagSCModel; 248 ContextModel3DBuffer m_ChromaQpAdjIdcSCModel; 249 250 #if NH_3D_DMM 251 ContextModel3DBuffer m_cNotDmmFlagSCModel; 252 ContextModel3DBuffer m_cDmmModeSCModel; 253 #endif 254 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 258 255 ContextModel3DBuffer m_cDdcDataSCModel; 259 ContextModel3DBuffer m_cAngleFlagSCModel; 260 #if H_3D_DIM_SDC 256 ContextModel3DBuffer m_cSDCFlagSCModel; 257 #endif 258 #if NH_3D_SDC_INTRA 261 259 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 262 260 ContextModel3DBuffer m_cSDCResidualSCModel; 263 #endif 264 #endif 265 #if H_3D_DIM_SDC 266 ContextModel3DBuffer m_cSDCFlagSCModel; 267 #endif 268 #if H_3D_DBBP 261 ContextModel3DBuffer m_cDdcFlagSCModel; 262 #endif 263 #if NH_3D_DBBP 269 264 ContextModel3DBuffer m_cDBBPFlagSCModel; 270 265 #endif 266 267 UInt m_golombRiceAdaptationStatistics[RExt__GOLOMB_RICE_ADAPTATION_STATISTICS_SETS]; 271 268 }; 272 269
Note: See TracChangeset for help on using the changeset viewer.