Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.h
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComDataCU.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. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 37 37 */ 38 38 39 #ifndef _TCOMDATACU_ 40 #define _TCOMDATACU_ 41 42 #include <assert.h> 39 #ifndef __TCOMDATACU__ 40 #define __TCOMDATACU__ 41 42 #include <algorithm> 43 #include <vector> 43 44 44 45 // Include files … … 49 50 #include "TComPattern.h" 50 51 51 #if H_3D_ARP52 #include "TComYuv.h"53 #endif54 55 #include <algorithm>56 #include <vector>57 58 52 //! \ingroup TLibCommon 59 53 //! \{ 60 54 61 62 #if H_3D_DBBP 55 class TComTU; // forward declaration 56 57 static const UInt NUM_MOST_PROBABLE_MODES=3; 58 59 #if NH_3D_DBBP 63 60 typedef struct _DBBPTmpData 64 61 { … … 75 72 #endif 76 73 74 77 75 // ==================================================================================================================== 78 76 // Class definition … … 83 81 { 84 82 private: 85 83 86 84 // ------------------------------------------------------------------------------------------------------------------- 87 85 // class pointers 88 86 // ------------------------------------------------------------------------------------------------------------------- 89 87 90 88 TComPic* m_pcPic; ///< picture class pointer 91 89 TComSlice* m_pcSlice; ///< slice header pointer 92 TComPattern* m_pcPattern; ///< neighbour access class pointer 93 90 94 91 // ------------------------------------------------------------------------------------------------------------------- 95 92 // CU description 96 93 // ------------------------------------------------------------------------------------------------------------------- 97 98 UInt m_ uiCUAddr; ///< CU address in a slice99 UInt m_ uiAbsIdxInLCU; ///< absolute address in a CU. It's Z scan order94 95 UInt m_ctuRsAddr; ///< CTU (also known as LCU) address in a slice (Raster-scan address, as opposed to tile-scan/encoding order). 96 UInt m_absZIdxInCtu; ///< absolute address in a CTU. It's Z scan order 100 97 UInt m_uiCUPelX; ///< CU position in a pixel (X) 101 98 UInt m_uiCUPelY; ///< CU position in a pixel (Y) … … 105 102 UChar* m_puhDepth; ///< array of depths 106 103 Int m_unitSize; ///< size of a "minimum partition" 107 104 108 105 // ------------------------------------------------------------------------------------------------------------------- 109 106 // CU data 110 107 // ------------------------------------------------------------------------------------------------------------------- 111 Bool* m_skipFlag; ///< array of skip flags 112 #if H_3D 113 Bool* m_bDISFlag; 114 UInt* m_uiDISType; 115 #endif 116 Char* m_pePartSize; ///< array of partition sizes 117 Char* m_pePredMode; ///< array of prediction modes 118 Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags 119 Char* m_phQP; ///< array of QP values 120 UChar* m_puhTrIdx; ///< array of transform indices 121 UChar* m_puhTransformSkip[3];///< array of transform skipping flags 122 UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) 123 TComCUMvField m_acCUMvField[2]; ///< array of motion vectors 124 TCoeff* m_pcTrCoeffY; ///< transformed coefficient buffer (Y) 125 TCoeff* m_pcTrCoeffCb; ///< transformed coefficient buffer (Cb) 126 TCoeff* m_pcTrCoeffCr; ///< transformed coefficient buffer (Cr) 108 109 Bool* m_skipFlag; ///< array of skip flags 110 #if NH_3D_DIS 111 Bool* m_bDISFlag; 112 UChar* m_ucDISType; 113 #endif 114 Char* m_pePartSize; ///< array of partition sizes 115 Char* m_pePredMode; ///< array of prediction modes 116 Char* m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values 117 Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags 118 Char* m_phQP; ///< array of QP values 119 UChar* m_ChromaQpAdj; ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 120 UInt m_codedChromaQpAdj; 121 UChar* m_puhTrIdx; ///< array of transform indices 122 UChar* m_puhTransformSkip[MAX_NUM_COMPONENT];///< array of transform skipping flags 123 UChar* m_puhCbf[MAX_NUM_COMPONENT]; ///< array of coded block flags (CBF) 124 TComCUMvField m_acCUMvField[NUM_REF_PIC_LIST_01]; ///< array of motion vectors. 125 TCoeff* m_pcTrCoeff[MAX_NUM_COMPONENT]; ///< array of transform coefficient buffers (0->Y, 1->Cb, 2->Cr) 127 126 #if ADAPTIVE_QP_SELECTION 128 Int* m_pcArlCoeffY; ///< ARL coefficient buffer (Y) 129 Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) 130 Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) 131 Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d 132 133 static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) 134 static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) 135 static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) 136 #endif 137 138 Pel* m_pcIPCMSampleY; ///< PCM sample buffer (Y) 139 Pel* m_pcIPCMSampleCb; ///< PCM sample buffer (Cb) 140 Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) 127 TCoeff* m_pcArlCoeff[MAX_NUM_COMPONENT]; // ARL coefficient buffer (0->Y, 1->Cb, 2->Cr) 128 Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d 129 #endif 130 131 Pel* m_pcIPCMSample[MAX_NUM_COMPONENT]; ///< PCM sample buffer (0->Y, 1->Cb, 2->Cr) 141 132 142 133 // ------------------------------------------------------------------------------------------------------------------- 143 134 // neighbour access variables 144 135 // ------------------------------------------------------------------------------------------------------------------- 145 146 TComDataCU* m_p cCUAboveLeft; ///< pointer of above-left CU147 TComDataCU* m_p cCUAboveRight; ///< pointer of above-right CU148 TComDataCU* m_p cCUAbove; ///< pointer of above CU149 TComDataCU* m_p cCULeft; ///< pointer of left CU150 TComDataCU* m_apcCUColocated[ 2]; ///< pointer of temporally colocated CU's for both directions136 137 TComDataCU* m_pCtuAboveLeft; ///< pointer of above-left CTU. 138 TComDataCU* m_pCtuAboveRight; ///< pointer of above-right CTU. 139 TComDataCU* m_pCtuAbove; ///< pointer of above CTU. 140 TComDataCU* m_pCtuLeft; ///< pointer of left CTU 141 TComDataCU* m_apcCUColocated[NUM_REF_PIC_LIST_01]; ///< pointer of temporally colocated CU's for both directions 151 142 TComMvField m_cMvFieldA; ///< motion vector of position A 152 143 TComMvField m_cMvFieldB; ///< motion vector of position B 153 144 TComMvField m_cMvFieldC; ///< motion vector of position C 154 145 TComMv m_cMvPred; ///< motion vector predictor 155 146 156 147 // ------------------------------------------------------------------------------------------------------------------- 157 148 // coding tool information 158 149 // ------------------------------------------------------------------------------------------------------------------- 159 150 160 151 Bool* m_pbMergeFlag; ///< array of merge flags 161 152 UChar* m_puhMergeIndex; ///< array of merge candidate indices … … 163 154 Bool m_bIsMergeAMP; 164 155 #endif 165 UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) 166 UChar* m_puhChromaIntraDir; ///< array of intra directions (chroma) 156 UChar* m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]; // 0-> Luma, 1-> Chroma 167 157 UChar* m_puhInterDir; ///< array of inter directions 168 Char* m_apiMVPIdx[ 2]; ///< array of motion vector predictor candidates169 Char* m_apiMVPNum[ 2]; ///< array of number of possible motion vectors predictors158 Char* m_apiMVPIdx[NUM_REF_PIC_LIST_01]; ///< array of motion vector predictor candidates 159 Char* m_apiMVPNum[NUM_REF_PIC_LIST_01]; ///< array of number of possible motion vectors predictors 170 160 Bool* m_pbIPCMFlag; ///< array of intra_pcm flags 171 #if H_3D_NBDV161 #if NH_3D_NBDV 172 162 DisInfo* m_pDvInfo; 173 163 #endif 174 #if H_3D_VSP164 #if NH_3D_VSP 175 165 Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not ///< 0: non-VSP; 1: VSP 176 166 #endif 177 #if H_3D_SPIVMP167 #if NH_3D_SPIVMP 178 168 Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP 179 169 #endif 180 #if H_3D_ARP170 #if NH_3D_ARP 181 171 UChar* m_puhARPW; 182 172 #endif 183 #if H_3D_IC173 #if NH_3D_IC 184 174 Bool* m_pbICFlag; ///< array of IC flags 185 175 #endif 186 #if H_3D_DIM 187 Pel* m_dimDeltaDC[DIM_NUM_TYPE][2]; 188 #if H_3D_DIM_DMM 189 UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 190 #endif 191 #if H_3D_DIM_SDC 176 #if NH_3D_DMM 177 Pel* m_dmmDeltaDC[NUM_DMM][2]; 178 UInt* m_dmm1WedgeTabIdx; 179 #endif 180 #if NH_3D_SDC_INTRA 192 181 Bool* m_pbSDCFlag; 193 182 Pel* m_apSegmentDCOffset[2]; 194 Pel m_apDmmPredictor[2]; 195 #endif 196 #endif 197 #if H_3D_DBBP 183 #endif 184 #if NH_3D_DBBP 198 185 Bool* m_pbDBBPFlag; ///< array of DBBP flags 199 186 DbbpTmpData m_sDBBPTmpData; 200 187 #endif 201 #if H_3D188 #if NH_3D_MLC 202 189 Bool m_bAvailableFlagA1; ///< A1 available flag 203 190 Bool m_bAvailableFlagB1; ///< B1 available flag … … 206 193 Bool m_bAvailableFlagB2; ///< B2 available flag 207 194 #endif 195 196 208 197 // ------------------------------------------------------------------------------------------------------------------- 209 198 // misc. variables 210 199 // ------------------------------------------------------------------------------------------------------------------- 211 200 212 201 Bool m_bDecSubCu; ///< indicates decoder-mode 213 202 Double m_dTotalCost; ///< sum of partition RD costs 214 #if H_3D_VSO203 #if NH_3D_VSO 215 204 Dist m_uiTotalDistortion; ///< sum of partition distortion 216 205 #else 217 UIntm_uiTotalDistortion; ///< sum of partition distortion206 Distortion m_uiTotalDistortion; ///< sum of partition distortion 218 207 #endif 219 208 UInt m_uiTotalBits; ///< sum of partition bits 220 UInt m_uiTotalBins; ///< sum of partition bins 221 UInt* m_sliceStartCU; ///< Start CU address of current slice 222 UInt* m_sliceSegmentStartCU; ///< Start CU address of current slice 209 UInt m_uiTotalBins; ///< sum of partition bins 223 210 Char m_codedQP; 224 #if H_3D225 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing226 #endif 227 #if H_3D_IV_MERGE 228 TComMotionCand m_mergCands[MRG_IVSHIFT+1]; 229 Int m_baseListidc; 230 #endif 211 #if NH_3D_MLC 212 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing 213 TComMotionCand m_mergCands[MRG_IVSHIFT+1]; ///< Motion candidates for merge mode 214 Int m_numSpatialCands; 215 #endif 216 217 UChar* m_explicitRdpcmMode[MAX_NUM_COMPONENT]; ///< Stores the explicit RDPCM mode for all TUs belonging to this CU 231 218 232 219 protected: 233 220 234 221 /// add possible motion vector predictor candidates 235 222 Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 236 223 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 237 #if H_3D_VSP224 #if NH_3D_VSP 238 225 Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount); 239 226 #endif 240 #if H_3D_IV_MERGE227 #if NH_3D_IV_MERGE 241 228 Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ); 242 229 #endif 243 230 244 231 Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); 245 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx246 #if H_3D_TMVP232 Bool xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 233 #if NH_3D_TMVP 247 234 , Bool bMRG = true 248 235 #endif 249 ); 250 251 /// compute required bits to encode MVD (used in AMVP) 252 UInt xGetMvdBits ( TComMv cMvd ); 253 UInt xGetComponentBits ( Int iVal ); 254 236 ); 237 238 255 239 /// compute scaling factor from POC difference 256 #if ! H_3D_ARP240 #if !NH_3D_ARP 257 241 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 258 242 #endif … … 260 244 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 261 245 262 #if H_3D_VSP246 #if NH_3D_VSP 263 247 Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); 264 248 #endif … … 267 251 TComDataCU(); 268 252 virtual ~TComDataCU(); 269 253 270 254 // ------------------------------------------------------------------------------------------------------------------- 271 255 // create / destroy / initialize / copy 272 256 // ------------------------------------------------------------------------------------------------------------------- 273 #if H_3D_ARP 257 #if NH_3D_ARP 258 /// compute scaling factor from POC difference 274 259 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 275 260 #endif 276 Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize261 Void create ( ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize 277 262 #if ADAPTIVE_QP_SELECTION 278 , Bool bGlobalRMARLBuffer = false279 #endif 263 , TCoeff *pParentARLBuffer = 0 264 #endif 280 265 ); 281 266 Void destroy (); 282 283 Void initC U ( TComPic* pcPic, UInt uiCUAddr );284 Void initEstData ( UInt uiDepth, Int qp,Bool bTransquantBypass );267 268 Void initCtu ( TComPic* pcPic, UInt ctuRsAddr ); 269 Void initEstData ( const UInt uiDepth, const Int qp, const Bool bTransquantBypass ); 285 270 Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); 286 271 Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); 287 #if H_3D_NBDV 288 Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); 289 #endif 290 Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); 291 Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 292 #if H_3D_NBDV 272 #if NH_3D_NBDV 273 Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); 274 #endif 275 276 Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx ); 277 Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 278 #if NH_3D_NBDV 293 279 , Bool bNBDV = false 294 280 #endif 295 281 ); 296 282 Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); 297 283 298 284 Void copyToPic ( UChar uiDepth ); 299 Void copyToPic ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth ); 300 285 301 286 // ------------------------------------------------------------------------------------------------------------------- 302 287 // member functions for CU description 303 288 // ------------------------------------------------------------------------------------------------------------------- 304 305 TComPic* getPic () { return m_pcPic; } 306 TComSlice* getSlice () { return m_pcSlice; } 307 #if H_3D_DISABLE_CHROMA 308 Void setSlice ( TComSlice* pcSlice) { m_pcSlice = pcSlice; } 309 #endif 310 UInt& getAddr () { return m_uiCUAddr; } 311 UInt& getZorderIdxInCU () { return m_uiAbsIdxInLCU; } 312 UInt getSCUAddr (); 313 UInt getCUPelX () { return m_uiCUPelX; } 314 UInt getCUPelY () { return m_uiCUPelY; } 315 TComPattern* getPattern () { return m_pcPattern; } 316 289 290 TComPic* getPic () { return m_pcPic; } 291 const TComPic* getPic () const { return m_pcPic; } 292 TComSlice* getSlice () { return m_pcSlice; } 293 const TComSlice* getSlice () const { return m_pcSlice; } 294 UInt& getCtuRsAddr () { return m_ctuRsAddr; } 295 UInt getCtuRsAddr () const { return m_ctuRsAddr; } 296 UInt getZorderIdxInCtu () const { return m_absZIdxInCtu; } 297 UInt getCUPelX () const { return m_uiCUPelX; } 298 UInt getCUPelY () const { return m_uiCUPelY; } 299 317 300 UChar* getDepth () { return m_puhDepth; } 318 UChar getDepth ( UInt uiIdx ) 301 UChar getDepth ( UInt uiIdx ) const { return m_puhDepth[uiIdx]; } 319 302 Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } 320 303 321 304 Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); 322 #if H_3D 323 Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ); 324 #endif 325 305 #if NH_3D_VSO 306 Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ) const; 307 #endif 308 309 #if NH_3D_ARP 310 Void setSlice ( TComSlice* pcSlice) { m_pcSlice = pcSlice; } 311 Void setPic ( TComDataCU* pcCU ) { m_pcPic = pcCU->getPic(); } 312 #endif 326 313 // ------------------------------------------------------------------------------------------------------------------- 327 314 // member functions for CU data 328 315 // ------------------------------------------------------------------------------------------------------------------- 329 316 330 317 Char* getPartitionSize () { return m_pePartSize; } 331 318 PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } … … 333 320 Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); 334 321 Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); 322 323 #if NH_3D_DBBP 324 Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); 325 #endif 335 326 336 #if H_3D_DBBP 337 Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); 338 #endif 339 340 Bool* getSkipFlag () { return m_skipFlag; } 341 Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } 342 Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } 343 Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); 344 #if H_3D 327 Bool* getSkipFlag () { return m_skipFlag; } 328 Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } 329 Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } 330 Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); 331 #if NH_3D_DIS 345 332 Bool* getDISFlag () { return m_bDISFlag; } 346 333 Bool getDISFlag ( UInt idx) { return m_bDISFlag[idx]; } 347 334 Void setDISFlag ( UInt idx, Bool bDIS) { m_bDISFlag[idx] = bDIS; } 348 Void setDISFlagSubParts ( Bool bDIS, UInt absPartIdx, UInt depth );349 350 U Int* getDISType () { return m_uiDISType; }351 U Int getDISType ( UInt idx) { return m_uiDISType[idx]; }352 Void getDISType ( UInt idx, U Int uiDISType) { m_uiDISType[idx] = uiDISType; }353 Void setDISTypeSubParts ( U Int uiDISType, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth );335 Void setDISFlagSubParts ( Bool bDIS, UInt uiAbsPartIdx, UInt uiDepth ); 336 337 UChar* getDISType () { return m_ucDISType; } 338 UChar getDISType ( UInt idx) { return m_ucDISType[idx]; } 339 Void getDISType ( UInt idx, UChar ucDISType) { m_ucDISType[idx] = ucDISType; } 340 Void setDISTypeSubParts ( UChar ucDISType, UInt uiAbsPartIdx, UInt uiDepth ); 354 341 #endif 355 342 Char* getPredictionMode () { return m_pePredMode; } 356 343 PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } 357 Bool* getCUTransquantBypass () { return m_CUTransquantBypass; }358 Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; }359 344 Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } 360 345 Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); 361 362 #if H_3D_DBBP346 347 #if NH_3D_DBBP 363 348 Bool* getDBBPFlag () { return m_pbDBBPFlag; } 364 349 Bool getDBBPFlag ( UInt uiIdx ) { return m_pbDBBPFlag[uiIdx]; } … … 367 352 DbbpTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; } 368 353 #endif 369 354 355 Char* getCrossComponentPredictionAlpha( ComponentID compID ) { return m_crossComponentPredictionAlpha[compID]; } 356 Char getCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx]; } 357 358 Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } 359 Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } 360 370 361 UChar* getWidth () { return m_puhWidth; } 371 362 UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } 372 363 Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } 373 364 374 365 UChar* getHeight () { return m_puhHeight; } 375 366 UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } 376 367 Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } 377 368 378 369 Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); 379 370 380 371 Char* getQP () { return m_phQP; } 381 Char getQP ( UInt uiIdx ) 372 Char getQP ( UInt uiIdx ) const { return m_phQP[uiIdx]; } 382 373 Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } 383 374 Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); 384 375 Int getLastValidPartIdx ( Int iAbsPartIdx ); 385 376 Char getLastCodedQP ( UInt uiAbsPartIdx ); 386 Void setQPSubCUs ( Int qp, TComDataCU* pcCU,UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf );377 Void setQPSubCUs ( Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); 387 378 Void setCodedQP ( Char qp ) { m_codedQP = qp; } 388 379 Char getCodedQP () { return m_codedQP; } 389 380 390 Bool isLosslessCoded(UInt absPartIdx); 391 381 UChar* getChromaQpAdj () { return m_ChromaQpAdj; } ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 382 UChar getChromaQpAdj (Int idx) const { return m_ChromaQpAdj[idx]; } ///< When value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 383 Void setChromaQpAdj (Int idx, UChar val) { m_ChromaQpAdj[idx] = val; } ///< When val = 0, cu_chroma_qp_offset_flag=0; when val>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=val-1 384 Void setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth ); 385 Void setCodedChromaQpAdj ( Char qp ) { m_codedChromaQpAdj = qp; } 386 Char getCodedChromaQpAdj () { return m_codedChromaQpAdj; } 387 388 Bool isLosslessCoded ( UInt absPartIdx ); 389 392 390 UChar* getTransformIdx () { return m_puhTrIdx; } 393 391 UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } 394 392 Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); 395 393 396 UChar* getTransformSkip ( TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]];} 397 UChar getTransformSkip ( UInt uiIdx,TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]][uiIdx];} 398 Void setTransformSkipSubParts ( UInt useTransformSkip, TextType eType, UInt uiAbsPartIdx, UInt uiDepth); 399 Void setTransformSkipSubParts ( UInt useTransformSkipY, UInt useTransformSkipU, UInt useTransformSkipV, UInt uiAbsPartIdx, UInt uiDepth ); 400 401 UInt getQuadtreeTULog2MinSizeInCU( UInt absPartIdx ); 402 394 UChar* getTransformSkip ( ComponentID compID ) { return m_puhTransformSkip[compID];} 395 UChar getTransformSkip ( UInt uiIdx, ComponentID compID) { return m_puhTransformSkip[compID][uiIdx];} 396 Void setTransformSkipSubParts ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth); 397 Void setTransformSkipSubParts ( const UInt useTransformSkip[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth ); 398 399 UChar* getExplicitRdpcmMode ( ComponentID component ) { return m_explicitRdpcmMode[component]; } 400 UChar getExplicitRdpcmMode ( ComponentID component, UInt partIdx ) {return m_explicitRdpcmMode[component][partIdx]; } 401 Void setExplicitRdpcmModePartRange ( UInt rdpcmMode, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 402 403 Bool isRDPCMEnabled ( UInt uiAbsPartIdx ) { return getSlice()->getSPS()->getSpsRangeExtension().getRdpcmEnabledFlag(isIntra(uiAbsPartIdx) ? RDPCM_SIGNAL_IMPLICIT : RDPCM_SIGNAL_EXPLICIT); } 404 405 Void setCrossComponentPredictionAlphaPartRange ( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 406 Void setTransformSkipPartRange ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 407 408 UInt getQuadtreeTULog2MinSizeInCU( UInt uiIdx ); 409 403 410 TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } 404 405 TCoeff*& getCoeffY () { return m_pcTrCoeffY; } 406 TCoeff*& getCoeffCb () { return m_pcTrCoeffCb; } 407 TCoeff*& getCoeffCr () { return m_pcTrCoeffCr; } 411 412 TCoeff* getCoeff (ComponentID component) { return m_pcTrCoeff[component]; } 413 408 414 #if ADAPTIVE_QP_SELECTION 409 Int*& getArlCoeffY () { return m_pcArlCoeffY; } 410 Int*& getArlCoeffCb () { return m_pcArlCoeffCb; } 411 Int*& getArlCoeffCr () { return m_pcArlCoeffCr; } 412 #endif 413 414 Pel*& getPCMSampleY () { return m_pcIPCMSampleY; } 415 Pel*& getPCMSampleCb () { return m_pcIPCMSampleCb; } 416 Pel*& getPCMSampleCr () { return m_pcIPCMSampleCr; } 417 418 UChar getCbf ( UInt uiIdx, TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx]; } 419 UChar* getCbf ( TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]]; } 420 421 UChar getCbf ( UInt uiIdx, TextType eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } 422 Void setCbf ( UInt uiIdx, TextType eType, UChar uh ) { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh; } 423 424 Void clearCbf ( UInt uiIdx, TextType eType, UInt uiNumParts ); 425 UChar getQtRootCbf ( UInt uiIdx ) { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); } 426 427 Void setCbfSubParts ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth ); 428 Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth ); 429 Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 430 415 TCoeff* getArlCoeff ( ComponentID component ) { return m_pcArlCoeff[component]; } 416 #endif 417 Pel* getPCMSample ( ComponentID component ) { return m_pcIPCMSample[component]; } 418 419 UChar getCbf ( UInt uiIdx, ComponentID eType ) { return m_puhCbf[eType][uiIdx]; } 420 UChar* getCbf ( ComponentID eType ) { return m_puhCbf[eType]; } 421 UChar getCbf ( UInt uiIdx, ComponentID eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } 422 Void setCbf ( UInt uiIdx, ComponentID eType, UChar uh ) { m_puhCbf[eType][uiIdx] = uh; } 423 Void clearCbf ( UInt uiIdx, ComponentID eType, UInt uiNumParts ); 424 UChar getQtRootCbf ( UInt uiIdx ); 425 426 Void setCbfSubParts ( const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth ); 427 Void setCbfSubParts ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth ); 428 Void setCbfSubParts ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 429 430 Void setCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 431 Void bitwiseOrCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 432 431 433 // ------------------------------------------------------------------------------------------------------------------- 432 434 // member functions for coding tool information 433 435 // ------------------------------------------------------------------------------------------------------------------- 434 436 435 437 Bool* getMergeFlag () { return m_pbMergeFlag; } 436 438 Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } … … 443 445 Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 444 446 template <typename T> 445 Void setSubPart ( T bParameter, T* pbBase LCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );446 #if H_3D_VSP 447 Void setSubPart ( T bParameter, T* pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 448 #if H_3D_VSP || NH_3D_DBBP 447 449 template<typename T> 448 450 Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 449 451 #endif 452 450 453 #if AMP_MRG 451 454 Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } … … 453 456 #endif 454 457 455 UChar* getLumaIntraDir () { return m_puhLumaIntraDir; } 456 UChar getLumaIntraDir ( UInt uiIdx ) { return m_puhLumaIntraDir[uiIdx]; } 457 Void setLumaIntraDir ( UInt uiIdx, UChar uh ) { m_puhLumaIntraDir[uiIdx] = uh; } 458 Void setLumaIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); 459 460 UChar* getChromaIntraDir () { return m_puhChromaIntraDir; } 461 UChar getChromaIntraDir ( UInt uiIdx ) { return m_puhChromaIntraDir[uiIdx]; } 462 Void setChromaIntraDir ( UInt uiIdx, UChar uh ) { m_puhChromaIntraDir[uiIdx] = uh; } 463 Void setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); 464 458 UChar* getIntraDir ( const ChannelType channelType ) const { return m_puhIntraDir[channelType]; } 459 UChar getIntraDir ( const ChannelType channelType, const UInt uiIdx ) const { return m_puhIntraDir[channelType][uiIdx]; } 460 461 Void setIntraDirSubParts ( const ChannelType channelType, 462 const UInt uiDir, 463 const UInt uiAbsPartIdx, 464 const UInt uiDepth ); 465 465 466 UChar* getInterDir () { return m_puhInterDir; } 466 467 UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } … … 471 472 Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } 472 473 Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); 473 #if H_3D_NBDV474 #if NH_3D_NBDV 474 475 Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); 476 #if H_3D_VSP || NH_3D_DBBP 475 477 Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); 478 #endif 476 479 DisInfo* getDvInfo () { return m_pDvInfo; } 477 480 DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } 478 481 #endif 479 #if H_3D_NBDV482 #if NH_3D_NBDV 480 483 Void xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb ); 481 484 Bool xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, 482 485 UInt uiMvpDvPos 483 #if H_3D_NBDV_REF486 #if NH_3D_NBDV_REF 484 487 , Bool bDepthRefine = false 485 488 #endif … … 487 490 Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 488 491 Void getDisMvpCandNBDV ( DisInfo* pDInfo 489 #if H_3D_NBDV_REF492 #if NH_3D_NBDV_REF 490 493 , Bool bDepthRefine = false 491 494 #endif 492 495 ); 493 496 494 #if H_3D497 #if NH_3D_IV_MERGE 495 498 Void getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); 496 Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); 497 498 Bool getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index); 499 #endif 500 #if H_3D_NBDV_REF 499 #endif 500 501 #if NH_3D_NBDV_REF 501 502 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); 502 503 Void estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred ); 503 #endif //H_3D_NBDV_REF 504 #endif 505 #if H_3D_FAST_TEXTURE_ENCODING 504 #endif //NH_3D_NBDV_REF 505 #endif 506 #if NH_3D_DIS 507 Bool getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index); 508 #endif 509 #if NH_3D_FAST_TEXTURE_ENCODING 506 510 Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); 507 511 #endif 508 #if H_3D_SPIVMP512 #if NH_3D_SPIVMP 509 513 Void getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight); 510 514 Void getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ); 511 515 Void setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ); 512 516 #endif 513 #if H_3D_IV_MERGE517 #if NH_3D_IV_MERGE 514 518 Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth 515 519 516 #if H_3D_SPIVMP520 #if NH_3D_SPIVMP 517 521 , TComMvField* pcMFieldSP, UChar* puhInterDirSP 518 522 #endif … … 520 524 ); 521 525 #endif 522 #if H_3D_ARP526 #if NH_3D_ARP 523 527 UChar* getARPW () { return m_puhARPW; } 524 528 UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } 525 529 Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } 526 530 Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); 527 Double getARPWFactor ( UInt uiIdx ); 528 #endif 529 #if H_3D_IC 531 #endif 532 #if NH_3D_IC 530 533 Bool* getICFlag () { return m_pbICFlag; } 531 534 Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } … … 534 537 Bool isICFlagRequired ( UInt uiAbsPartIdx ); 535 538 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 539 #elif NH_3D_VSP 540 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 536 541 #else 537 542 // ------------------------------------------------------------------------------------------------------------------- 538 543 // member functions for accessing partition information 539 544 // ------------------------------------------------------------------------------------------------------------------- 540 541 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); 542 #endif 543 UChar getNumPartitions ();545 546 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx 547 #endif 548 UChar getNumPartitions ( const UInt uiAbsPartIdx = 0 ); 544 549 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); 545 550 546 #if H_3D_DIM 547 Pel* getDimDeltaDC ( UInt dimType, UInt segId ) { return m_dimDeltaDC[dimType][segId]; } 548 Pel getDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx ) { return m_dimDeltaDC[dimType][segId][uiIdx]; } 549 Void setDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val; } 550 #if H_3D_DIM_DMM 551 UInt* getDmmWedgeTabIdx ( UInt dmmType ) { return m_dmmWedgeTabIdx[dmmType]; } 552 UInt getDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx ) { return m_dmmWedgeTabIdx[dmmType][uiIdx]; } 553 Void setDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; } 554 Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); 555 556 #endif 557 #if H_3D_DIM_SDC 551 #if NH_3D_DMM 552 Pel* getDmmDeltaDC ( DmmID dmmType, UInt segId ) { return m_dmmDeltaDC[dmmType][segId]; } 553 Pel getDmmDeltaDC ( DmmID dmmType, UInt segId, UInt uiIdx ) { return m_dmmDeltaDC[dmmType][segId][uiIdx]; } 554 Void setDmmDeltaDC ( DmmID dmmType, UInt segId, UInt uiIdx, Pel val ) { m_dmmDeltaDC[dmmType][segId][uiIdx] = val; } 555 556 UInt* getDmm1WedgeTabIdx () { return m_dmm1WedgeTabIdx; } 557 UInt getDmm1WedgeTabIdx ( UInt uiIdx ) { return m_dmm1WedgeTabIdx[uiIdx]; } 558 Void setDmm1WedgeTabIdx ( UInt uiIdx, UInt tabIdx ) { m_dmm1WedgeTabIdx[uiIdx] = tabIdx; } 559 Void setDmm1WedgeTabIdxSubParts ( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth ); 560 #endif 561 #if NH_3D_SDC_INTRA 558 562 Bool* getSDCFlag () { return m_pbSDCFlag; } 559 563 Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } … … 565 569 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 566 570 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 567 Void setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; }568 Pel getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; }569 UInt getCtxSDCFlag ( UInt uiAbsPartIdx );570 #endif571 571 #endif 572 572 … … 574 574 // member functions for motion vector 575 575 // ------------------------------------------------------------------------------------------------------------------- 576 576 577 577 Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); 578 578 579 579 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); 580 580 Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); 581 581 Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); 582 582 583 Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } 583 584 Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } … … 587 588 Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } 588 589 Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } 589 590 590 591 Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 591 592 Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 592 593 593 594 Void clipMv ( TComMv& rcMv ); 594 #if H_MV595 #if NH_MV 595 596 Void checkMvVertRest (TComMv& rcMv, RefPicList eRefPicList, int iRefIdx ); 596 597 #endif … … 598 599 Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } 599 600 Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } 600 #if H_3D601 #if NH_3D 601 602 Void compressMV ( Int scale ); 602 603 #else … … 606 607 // utility functions for neighbouring information 607 608 // ------------------------------------------------------------------------------------------------------------------- 608 609 TComDataCU* getC ULeft () { return m_pcCULeft; }610 TComDataCU* getC UAbove () { return m_pcCUAbove; }611 TComDataCU* getC UAboveLeft () { return m_pcCUAboveLeft; }612 TComDataCU* getC UAboveRight () { return m_pcCUAboveRight; }609 610 TComDataCU* getCtuLeft () { return m_pCtuLeft; } 611 TComDataCU* getCtuAbove () { return m_pCtuAbove; } 612 TComDataCU* getCtuAboveLeft () { return m_pCtuAboveLeft; } 613 TComDataCU* getCtuAboveRight () { return m_pCtuAboveRight; } 613 614 TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } 614 615 616 TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, 617 UInt uiCurrPartUnitIdx, 618 Bool bEnforceSliceRestriction=true, 615 Bool CUIsFromSameSlice ( const TComDataCU *pCU /* Can be NULL */) const { return ( pCU!=NULL && pCU->getSlice()->getSliceCurStartCtuTsAddr() == getSlice()->getSliceCurStartCtuTsAddr() ); } 616 Bool CUIsFromSameTile ( const TComDataCU *pCU /* Can be NULL */) const; 617 Bool CUIsFromSameSliceAndTile ( const TComDataCU *pCU /* Can be NULL */) const; 618 Bool CUIsFromSameSliceTileAndWavefrontRow( const TComDataCU *pCU /* Can be NULL */) const; 619 Bool isLastSubCUOfCtu(const UInt absPartIdx); 620 621 622 TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, 623 UInt uiCurrPartUnitIdx, 624 Bool bEnforceSliceRestriction=true, 619 625 Bool bEnforceTileRestriction=true ); 620 626 TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, 621 UInt uiCurrPartUnitIdx, 622 Bool bEnforceSliceRestriction=true, 623 Bool planarAt LCUBoundary = false,627 UInt uiCurrPartUnitIdx, 628 Bool bEnforceSliceRestriction=true, 629 Bool planarAtCTUBoundary = false, 624 630 Bool bEnforceTileRestriction=true ); 625 631 TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); 626 TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); 627 TComDataCU* get PUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true);628 629 TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU);630 TComDataCU* getQpMinCuAbove ( UInt& aPartUnitIdx , UInt currAbsIdxInLCU ); 631 Char getRefQP ( UInt uiCurrAbsIdxInLCU );632 633 TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );634 TComDataCU* getPUBelowLeft Adi( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );635 632 633 TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu ); 634 TComDataCU* getQpMinCuAbove ( UInt& uiAPartUnitIdx , UInt uiCurrAbsIdxInCtu ); 635 Char getRefQP ( UInt uiCurrAbsIdxInCtu ); 636 637 /// returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU, at a horizontal offset (to the right) of uiPartUnitOffset (in parts) 638 TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); 639 /// returns CU and part index of the PU left of the lefthand column of the current uiCurrPartUnitIdx of the CU, at a vertical offset (below) of uiPartUnitOffset (in parts) 640 TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); 641 636 642 Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); 637 643 Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); 638 639 Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); 640 Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); 641 644 642 645 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 643 644 #if H_3D 645 Bool getAvailableFlagA1() { return m_bAvailableFlagA1;} 646 Bool getAvailableFlagB1() { return m_bAvailableFlagB1;} 647 Bool getAvailableFlagB0() { return m_bAvailableFlagB0;} 648 Bool getAvailableFlagA0() { return m_bAvailableFlagA0;} 649 Bool getAvailableFlagB2() { return m_bAvailableFlagB2;} 646 #if NH_3D_FIX_PRUNING 647 Bool hasEqualMotion ( Int dirA, const TComMvField* mvFieldA, Int dirB, const TComMvField* mvFieldB ); 648 #endif 649 #if NH_3D_MLC 650 Bool getAvailableFlagA1() { return m_bAvailableFlagA1; } 651 Bool getAvailableFlagB1() { return m_bAvailableFlagB1; } 652 Bool getAvailableFlagB0() { return m_bAvailableFlagB0; } 653 Bool getAvailableFlagA0() { return m_bAvailableFlagA0; } 654 Bool getAvailableFlagB2() { return m_bAvailableFlagB2; } 650 655 Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } 651 656 Void buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 652 #if H_3D_VSP657 #if NH_3D_VSP 653 658 , Int* vspFlag 654 659 #endif 655 #if H_3D_SPIVMP660 #if NH_3D_SPIVMP 656 661 , Bool* pbSPIVMPFlag 657 662 #endif 658 663 , Int& numValidMergeCand 659 664 ); 660 Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); 661 Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 662 #else 663 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 664 #endif 665 #if H_3D_SPIVMP 666 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 667 #endif 668 , Int& numValidMergeCand, Int mrgCandIdx = -1 669 ); 670 671 #if H_3D_VSP 672 #if H_3D_SPIVMP 665 Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 666 #if NH_3D_SPIVMP 667 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 668 #endif 669 , Int& numValidMergeCand, Int mrgCandIdx = -1 ); 670 #endif 671 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); 672 673 #if NH_3D_VSP 674 #if NH_3D_SPIVMP 673 675 Bool* getSPIVMPFlag () { return m_pbSPIVMPFlag; } 674 676 Bool getSPIVMPFlag ( UInt uiIdx ) { return m_pbSPIVMPFlag[uiIdx]; } … … 685 687 Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); 686 688 Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); 687 688 689 689 690 // ------------------------------------------------------------------------------------------------------------------- 690 691 // member functions for modes 691 692 // ------------------------------------------------------------------------------------------------------------------- 692 693 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 694 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 693 694 Bool isIntra ( UInt uiPartIdx ) const { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 695 Bool isInter ( UInt uiPartIdx ) const { return m_pePredMode[ uiPartIdx ] == MODE_INTER; } 696 Bool isSkipped ( UInt uiPartIdx ); ///< returns true, if the partiton is skipped 695 697 Bool isBipredRestriction( UInt puIdx ); 696 698 697 #if H_3D_IC698 Bool isIC ( UInt uiPartIdx );699 #endif700 701 699 // ------------------------------------------------------------------------------------------------------------------- 702 700 // member functions for symbol prediction (most probable / mode conversion) 703 701 // ------------------------------------------------------------------------------------------------------------------- 704 702 705 703 UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); 706 704 707 705 Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); 708 Int getIntraDirLumaPredictor ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );709 706 Void getIntraDirPredictor ( UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int* piMode = NULL ); 707 710 708 // ------------------------------------------------------------------------------------------------------------------- 711 709 // member functions for SBAC context 712 710 // ------------------------------------------------------------------------------------------------------------------- 713 711 714 712 UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); 715 UInt getCtxQtCbf ( T extType eType, UInt uiTrDepth);713 UInt getCtxQtCbf ( TComTU &rTu, const ChannelType chType ); 716 714 717 715 UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); 718 716 UInt getCtxInterDir ( UInt uiAbsPartIdx ); 719 720 #if H_3D_ARP 717 #if NH_3D_ARP 721 718 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 722 719 #endif 723 UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } 724 UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } 725 UInt& getTotalBins () { return m_uiTotalBins; } 720 721 UInt& getTotalBins () { return m_uiTotalBins; } 726 722 // ------------------------------------------------------------------------------------------------------------------- 727 723 // member functions for RD cost storage 728 724 // ------------------------------------------------------------------------------------------------------------------- 729 725 730 726 Double& getTotalCost() { return m_dTotalCost; } 731 #if H_3D_VSO727 #if NH_3D_VSO 732 728 Dist& getTotalDistortion() { return m_uiTotalDistortion; } 733 729 #else 734 UInt&getTotalDistortion() { return m_uiTotalDistortion; }730 Distortion& getTotalDistortion() { return m_uiTotalDistortion; } 735 731 #endif 736 732 UInt& getTotalBits() { return m_uiTotalBits; } 737 733 UInt& getTotalNumPart() { return m_uiNumPartition; } 738 734 739 UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); 740 741 742 #if H_3D_DIM 743 Bool isDMM1UpscaleMode ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; }; 744 UInt getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth = uiWidth; } return uiBaseWidth; } 745 #endif 746 735 UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ; 747 736 }; 748 737 … … 760 749 return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; 761 750 } 762 751 763 752 /** Check whether 2 addresses point to the same row 764 753 * \param addrA First address in raster scan order … … 772 761 return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; 773 762 } 774 763 775 764 /** Check whether 2 addresses point to the same row or column 776 765 * \param addrA First address in raster scan order … … 783 772 return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); 784 773 } 785 774 786 775 /** Check whether one address points to the first column 787 776 * \param addr Address in raster scan order … … 794 783 return ( addr & ( numUnitsPerRow - 1 ) ) == 0; 795 784 } 796 785 797 786 /** Check whether one address points to the first row 798 787 * \param addr Address in raster scan order … … 805 794 return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; 806 795 } 807 796 808 797 /** Check whether one address points to a column whose index is smaller than a given value 809 798 * \param addr Address in raster scan order … … 817 806 return ( addr & ( numUnitsPerRow - 1 ) ) < val; 818 807 } 819 808 820 809 /** Check whether one address points to a row whose index is smaller than a given value 821 810 * \param addr Address in raster scan order … … 829 818 return addr < val * numUnitsPerRow; 830 819 } 831 } ;820 } 832 821 833 822 //! \}
Note: See TracChangeset for help on using the changeset viewer.