Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
- Timestamp:
- 1 Sep 2013, 22:47:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
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 * … … 46 46 } 47 47 48 #include "TLibCommon/TComAdaptiveLoopFilter.h"49 48 #include "TLibCommon/TComSampleAdaptiveOffset.h" 50 49 … … 52 51 { 53 52 m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 53 } 54 55 Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 56 { 57 m_pcEntropyDecoderIf->parseCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); 54 58 } 55 59 … … 67 71 } 68 72 69 #if LGE_ILLUCOMP_B004570 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )71 {72 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );73 74 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0)75 #if !LGE_ILLUCOMP_DEPTH_C004676 || pcCU->getSlice()->getSPS()->isDepth()77 #endif78 )79 {80 return;81 }82 83 if(!pcCU->getSlice()->getApplyIC())84 return;85 86 #if LGE_ILLUCOMP_DEPTH_C004687 if(pcCU->isICFlagRequired(uiAbsPartIdx, uiDepth)) //This modification is not needed after integrating JCT3V-C013788 #else89 if(pcCU->isICFlagRequired(uiAbsPartIdx))90 #endif91 m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth );92 }93 #endif94 73 /** decode merge index 95 74 * \param pcCU … … 101 80 * \returns Void 102 81 */ 103 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours,UInt uiDepth )82 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth ) 104 83 { 105 84 UInt uiMergeIndex = 0; 106 m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex , uiAbsPartIdx, uiDepth);85 m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex ); 107 86 pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth ); 108 87 } 109 88 110 #if QC_ARP_D0177 111 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx ) 112 { 113 if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() ) 114 return; 115 assert( !pcCU->isIntra( uiAbsPartIdx ) ); 116 Bool bResPredAvailable = !pcCU->getSlice()->getARPStepNum() ? false: ((pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)) ? true: false); 117 if(!bResPredAvailable) 118 pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 89 #if H_3D_ARP 90 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 91 { 92 if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) ) 93 { 94 return; 95 } 96 97 if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 98 { 99 pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 100 } 119 101 else 102 { 120 103 m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth ); 121 } 122 #endif 104 } 105 } 106 #endif 107 108 #if H_3D_IC 109 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 110 { 111 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 112 113 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) ) 114 { 115 return; 116 } 117 118 if( !pcCU->getSlice()->getApplyIC() ) 119 return; 120 121 if( pcCU->isICFlagRequired( uiAbsPartIdx ) ) 122 m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); 123 } 124 #endif 125 123 126 Void TDecEntropy::decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 124 127 { … … 129 132 { 130 133 m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth ); 131 132 #if !PKU_QC_DEPTH_INTRA_UNI_D0195133 #if RWTH_SDC_DLT_B0036134 // if B-Slice, code SDC flag later135 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )136 {137 // decode SDC flag138 decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);139 }140 #endif141 #endif142 134 } 143 135 144 136 Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 145 137 { 146 #if !PKU_QC_DEPTH_INTRA_UNI_D0195147 #if RWTH_SDC_DLT_B0036148 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) )149 {150 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );151 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );152 return;153 }154 #endif155 #endif156 157 138 m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); 158 159 #if !PKU_QC_DEPTH_INTRA_UNI_D0195160 #if RWTH_SDC_DLT_B0036161 if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )162 {163 // decode SDC flag164 decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);165 166 if( pcCU->getSDCFlag(uiAbsPartIdx) )167 {168 // part size is also known for SDC intra169 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );170 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );171 }172 }173 #endif174 #endif175 139 } 176 140 177 141 Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) 178 142 { 179 #if !PKU_QC_DEPTH_INTRA_UNI_D0195180 #if RWTH_SDC_DLT_B0036181 if( pcCU->getSDCFlag(uiAbsPartIdx) )182 {183 decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth);184 return;185 }186 #endif187 #endif188 189 PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx );190 191 143 if( pcCU->isIntra( uiAbsPartIdx ) ) // If it is Intra mode, encode intra prediction mode. 192 144 { 193 if( eMode == SIZE_NxN ) // if it is NxN size, encode 4 intra directions. 194 { 195 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth(uiAbsPartIdx) << 1 ) ) >> 2; 196 // if it is NxN size, this size might be the smallest partition size. // if it is NxN size, this size might be the smallest partition size. 197 decodeIntraDirModeLuma( pcCU, uiAbsPartIdx, uiDepth+1 ); 198 decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset, uiDepth+1 ); 199 decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 ); 200 decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 ); 201 #if PKU_QC_DEPTH_INTRA_UNI_D0195 202 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 203 #endif 204 decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); 205 } 206 else // if it is not NxN size, encode 1 intra directions 207 { 208 decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); 209 #if PKU_QC_DEPTH_INTRA_UNI_D0195 210 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 211 #endif 212 decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); 213 } 145 decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); 146 #if H_3D_DIM_SDC 147 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 148 #endif 149 decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); 214 150 } 215 151 else // if it is Inter mode, encode motion vector and reference index 216 152 { 217 153 decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU ); 218 #if QC_ARP_D0177219 if( pcCU->getSlice()->getSPS()->getUseAdvRP() )220 {221 decodeARPW( pcCU , uiAbsPartIdx , uiDepth, pcSubCU, 0 );222 }223 #endif224 154 } 225 155 } … … 239 169 return; 240 170 } 241 242 #if RWTH_SDC_DLT_B0036 171 #if H_3D_DIM_SDC 243 172 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 244 173 { … … 273 202 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4; 274 203 275 #if CU_BASED_MRG_CAND_LIST 276 #if H3D_IVMP 204 #if H_3D_IV_MERGE 277 205 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 278 206 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 279 for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ui++ )280 207 #else 281 208 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists 282 209 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 283 for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 284 #endif 210 #endif 211 212 for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ ) 285 213 { 286 214 uhInterDirNeighbours[ui] = 0; 287 215 } 288 216 Int numValidMergeCand = 0; 289 bool isMerged = false; 290 #endif 217 Bool isMerged = false; 291 218 292 219 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 293 220 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 221 #if H_3D_IV_MERGE 222 pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx); 223 #endif 294 224 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) 295 225 { 296 #if !CU_BASED_MRG_CAND_LIST 297 #if H3D_IVMP 298 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 299 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 300 Int numValidMergeCand = 0; 301 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui ) 302 #else 303 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists 304 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 305 Int numValidMergeCand = 0; 306 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) 307 #endif 308 { 309 uhInterDirNeighbours[ui] = 0; 310 } 226 #if H_MV_ENC_DEC_TRAC 227 DTRACE_PU_S("=========== prediction_unit ===========\n") 228 // ToDo: 229 //DTRACE_PU("x0", uiLPelX) 230 //DTRACE_PU("x1", uiTPelY) 311 231 #endif 312 232 decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx ); 313 233 if ( pcCU->getMergeFlag( uiSubPartIdx ) ) 314 234 { 315 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth ); 316 #if CU_BASED_MRG_CAND_LIST 235 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 317 236 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 318 237 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) … … 321 240 if ( !isMerged ) 322 241 { 323 pcSubCU->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 242 #if H_3D_VSP 243 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 244 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 245 #if MTK_VSP_FIX_ALIGN_WD_E0172 246 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 247 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 248 #else 249 #if MTK_VSP_FIX_E0172 250 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 251 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 252 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir, numValidMergeCand ); 253 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 254 #else 255 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand ); 256 #endif 257 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172 258 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 259 #if MTK_VSP_FIX_ALIGN_WD_E0172 260 if(vspFlag[uiMergeIndex]) 261 { 262 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth); 263 } 264 #endif 265 #else 266 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 267 #endif 324 268 isMerged = true; 325 269 } … … 328 272 else 329 273 { 330 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 331 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 332 } 274 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); // Redundant line 275 #if H_3D_VSP 276 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 277 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 278 #if MTK_VSP_FIX_ALIGN_WD_E0172 279 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 280 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex ); 333 281 #else 334 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 335 #if MERL_VSP_C0152 336 #if LGE_VSP_INHERIT_D0092 337 Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM]; 338 for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++) 339 { 340 iVSPIndexTrue[i] = 0; 341 } 282 #if MTK_VSP_FIX_E0172 283 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 284 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 285 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir,numValidMergeCand, uiMergeIndex ); 286 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 342 287 #else 343 Int iVSPIndexTrue[3] = {-1, -1, -1}; 344 #endif 345 #if MERL_VSP_NBDV_RefVId_Fix_D0166 346 Int iVSPDirTrue[3] = {-1, -1, -1}; 347 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex ); 288 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex ); 289 #endif 290 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172 291 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 292 #if MTK_VSP_FIX_ALIGN_WD_E0172 293 if(vspFlag[uiMergeIndex]) 294 { 295 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth); 296 } 297 #endif 348 298 #else 349 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 350 #endif 351 #if HHI_MPI 352 if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used 353 { 354 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 355 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 356 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 357 { 358 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui ); 359 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 360 #if MERL_VSP_NBDV_RefVId_Fix_D0166 361 Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui ); 362 pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir); 363 #endif 364 } 365 } 366 else // MPI not used 367 #endif 368 #if MTK_D0156 369 if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() ) 370 { 371 pcCU->setVSPIndexSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth ); 372 } 373 else 374 #endif 375 { 376 Int iVSPIdx = 0; 377 #if LGE_VSP_INHERIT_D0092 378 if (iVSPIndexTrue[uiMergeIndex] == 1) 379 { 380 iVSPIdx = 1; 381 } 382 #else 383 Int numVspIdx; 384 numVspIdx = 3; 385 for (Int i = 0; i < numVspIdx; i++) 386 { 387 if (iVSPIndexTrue[i] == uiMergeIndex) 388 { 389 iVSPIdx = i+1; 390 break; 391 } 392 } 393 #endif 394 pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth ); // Initialize 395 #if MERL_VSP_NBDV_RefVId_Fix_D0166 396 pcCU->setVSPDirSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth ); // Initialize 397 #endif 398 #if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 399 if(iVSPIdx != 0) 400 { 401 Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0); 402 cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx); 403 } 404 #endif 405 } 406 407 #else 408 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 409 #endif 410 #endif 299 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 300 #endif 301 } 411 302 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 412 303 … … 420 311 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 421 312 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 422 423 313 } 424 314 } … … 437 327 } 438 328 } 329 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 330 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false)) 331 #else 332 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) 333 #endif 334 { 335 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); 336 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); 337 pcCU->setInterDirSubParts( 1, uiSubPartIdx, uiPartIdx, uiDepth); 338 } 439 339 } 440 340 return; … … 458 358 else 459 359 { 460 m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx , uiDepth);360 m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx ); 461 361 } 462 362 … … 466 366 Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) 467 367 { 468 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getInterDir( uiAbsPartIdx ) != 3) 469 { 470 if(eRefList == REF_PIC_LIST_1) 471 { 472 return; 473 } 474 475 Int iRefFrmIdx = 0; 476 Int iRefFrmIdxTemp; 477 UInt uiInterDir; 478 RefPicList eRefListTemp; 479 480 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 481 482 if ( pcCU->getSlice()->getNumRefIdx ( REF_PIC_LIST_C ) > 1 ) 483 { 484 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, REF_PIC_LIST_C ); 485 } 486 else 487 { 488 iRefFrmIdx=0; 489 } 490 uiInterDir = pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx) + 1; 491 iRefFrmIdxTemp = pcCU->getSlice()->getRefIdxFromIdxOfLC(iRefFrmIdx); 492 eRefListTemp = (RefPicList)pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx); 493 494 pcCU->getCUMvField( eRefListTemp )->setAllRefIdx( iRefFrmIdxTemp, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); 495 496 pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth ); 368 Int iRefFrmIdx = 0; 369 Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ); 370 371 if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) 372 { 373 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList ); 374 } 375 else if ( !iParseRefFrmIdx ) 376 { 377 iRefFrmIdx = NOT_VALID; 497 378 } 498 379 else 499 380 { 500 Int iRefFrmIdx = 0; 501 Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList ); 502 503 if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx ) 504 { 505 m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList ); 506 } 507 else if ( !iParseRefFrmIdx ) 508 { 509 iRefFrmIdx = NOT_VALID; 510 } 511 else 512 { 513 iRefFrmIdx = 0; 514 } 515 516 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 517 pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); 518 } 381 iRefFrmIdx = 0; 382 } 383 384 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 385 pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx ); 519 386 } 520 387 … … 549 416 cMv = cZeroMv; 550 417 551 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) ) 552 { 553 #if H3D_IVMP 554 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 555 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS; 556 #else 557 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 558 #endif 559 m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands ); 560 #else 418 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) ) 419 { 561 420 m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx ); 562 #endif 563 } 564 #if H3D_IVMP 565 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx); 566 #else 421 #if H_MV_ENC_DEC_TRAC 422 #if ENC_DEC_TRACE 423 if ( eRefList == REF_PIC_LIST_0 ) 424 { 425 DTRACE_PU("mvp_l0_flag", iMVPIdx) 426 } 427 else 428 { 429 DTRACE_PU("mvp_l1_flag", iMVPIdx) 430 } 431 #endif 432 #endif 433 } 567 434 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); 568 #endif569 435 pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); 570 436 pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); 571 437 if ( iRefIdx >= 0 ) 572 438 { 573 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx,cMv);439 m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv); 574 440 cMv += pcSubCUMvField->getMvd( uiPartAddr ); 575 441 } … … 579 445 } 580 446 581 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP)447 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP) 582 448 { 583 449 UInt uiSubdiv; … … 620 486 { 621 487 assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) ); 622 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth);488 m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize ); 623 489 } 624 490 625 491 const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx ); 626 627 if( uiLog2TrafoSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) 628 { 629 const Bool bFirstCbfOfCU = uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() || uiTrDepth == 0; 492 { 493 const Bool bFirstCbfOfCU = uiTrDepth == 0; 630 494 if( bFirstCbfOfCU ) 631 495 { … … 637 501 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) ) 638 502 { 639 if ( uiInnerQuadIdx == 3 && uiUCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) 640 { 641 uiUCbfFront3++; 642 pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); 643 //printf( " \nsave bits, U Cbf"); 644 } 645 else 646 { 647 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); 648 uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth ); 649 } 503 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth ); 650 504 } 651 505 if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) ) 652 506 { 653 if ( uiInnerQuadIdx == 3 && uiVCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) 654 { 655 uiVCbfFront3++; 656 pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); 657 //printf( " \nsave bits, V Cbf"); 658 } 659 else 660 { 661 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); 662 uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth ); 663 } 507 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth ); 664 508 } 665 509 } … … 668 512 pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth ); 669 513 pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth ); 670 if ( uiLog2TrafoSize == 2 )671 {672 uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );673 uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );674 }675 514 } 676 515 } … … 686 525 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 687 526 const UInt uiStartAbsPartIdx = uiAbsPartIdx; 688 UInt uiLumaTrMode, uiChromaTrMode;689 pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );690 527 UInt uiYCbf = 0; 691 528 UInt uiUCbf = 0; 692 529 UInt uiVCbf = 0; 693 530 694 UInt uiCurrentCbfY = 0;695 UInt uiCurrentCbfU = 0;696 UInt uiCurrentCbfV = 0;697 698 531 for( Int i = 0; i < 4; i++ ) 699 532 { 700 UInt nsAddr = 0; 701 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); 702 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); 703 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 704 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); 705 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); 533 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ); 534 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 ); 535 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 ); 536 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth+1 ); 706 537 uiAbsPartIdx += uiQPartNum; 707 538 offsetLuma += size; offsetChroma += (size>>2); 708 539 } 709 540 710 uiYCbfFront3 += uiCurrentCbfY;711 uiUCbfFront3 += uiCurrentCbfU;712 uiVCbfFront3 += uiCurrentCbfV;713 714 pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );715 541 for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui ) 716 542 { 717 pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << ui LumaTrMode;718 pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << ui ChromaTrMode;719 pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << ui ChromaTrMode;543 pcCU->getCbf( TEXT_LUMA )[uiStartAbsPartIdx + ui] |= uiYCbf << uiTrDepth; 544 pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiTrDepth; 545 pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiTrDepth; 720 546 } 721 547 } … … 725 551 pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth ); 726 552 553 #if !H_MV_ENC_DEC_TRAC 727 554 { 728 555 DTRACE_CABAC_VL( g_nSymbolCounter++ ); … … 735 562 DTRACE_CABAC_T( "\n" ); 736 563 } 564 #endif 737 565 738 UInt uiLumaTrMode, uiChromaTrMode;739 pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );740 if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )741 {742 pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );743 }744 566 pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 745 567 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 746 568 { 747 pcCU->setCbfSubParts( 1 << ui LumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );569 pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 748 570 } 749 571 else 750 572 { 751 const UInt uiLog2CUSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - pcCU->getDepth( uiAbsPartIdx ); 752 if ( pcCU->getPredictionMode( uiAbsPartIdx ) != MODE_INTRA && uiInnerQuadIdx == 3 && uiYCbfFront3 == 0 && uiUCbfFront3 == 0 && uiVCbfFront3 == 0 753 && ( uiLog2CUSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() + 1 || uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) ) 754 { 755 pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 756 //printf( " \nsave bits, Y Cbf"); 757 uiYCbfFront3++; 758 } 759 else 760 { 761 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth ); 762 uiYCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 763 } 764 } 573 m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth ); 574 } 575 576 765 577 // transform_unit begin 766 578 UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); … … 792 604 Int trWidth = width; 793 605 Int trHeight = height; 794 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );795 606 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); 796 607 } … … 799 610 Int trWidth = width >> 1; 800 611 Int trHeight = height >> 1; 801 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );802 612 if( cbfU ) 803 613 { … … 816 626 Int trWidth = width; 817 627 Int trHeight = height; 818 pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );819 628 if( cbfU ) 820 629 { … … 830 639 } 831 640 } 832 833 641 834 642 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) … … 854 662 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 855 663 UInt uiChromaOffset = uiLumaOffset>>2; 856 UInt temp = 0;857 UInt temp1 = 0;858 UInt temp2 = 0;859 664 860 #if RWTH_SDC_DLT_B0036861 if( pcCU->getSDC Available(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) )665 #if H_3D_DIM_SDC 666 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 862 667 { 863 668 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 866 671 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 867 672 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 868 #if !PKU_QC_DEPTH_INTRA_UNI_D0195869 decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);870 #endif871 673 return; 872 674 } 873 675 #endif 874 676 677 #if LGE_INTER_SDC_E0156 678 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 679 { 680 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 681 assert( !pcCU->isIntra( uiAbsPartIdx) ); 682 assert( pcCU->getSlice()->getIsDepth() ); 683 684 decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth ); 685 return; 686 } 687 #endif 688 875 689 if( pcCU->isIntra(uiAbsPartIdx) ) 876 690 { … … 879 693 { 880 694 UInt uiQtRootCbf = 1; 881 #if HHI_MPI882 if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&883 ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) )884 #else885 695 if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) ) 886 #endif 887 { 888 m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf ); 696 { 697 m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf ); 889 698 } 890 699 if ( !uiQtRootCbf ) … … 892 701 pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); 893 702 pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); 894 pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );895 703 return; 896 704 } 897 705 898 706 } 899 900 #if FIX_MPI_B0065 901 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ) 902 { 903 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 904 if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) 905 { 906 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 907 pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth ); 908 } 909 else 910 { 911 pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth ); 912 } 913 } 914 #endif 915 916 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); 917 918 #if FIX_MPI_B0065 919 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ) 920 { 921 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 922 } 923 #endif 924 } 925 926 #if RWTH_SDC_DLT_B0036 927 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 928 Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 929 { 930 assert( pcCU->getSlice()->getSPS()->isDepth() ); 931 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 932 933 m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth ); 934 } 935 936 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 937 { 938 assert( pcCU->getSlice()->getSPS()->isDepth() ); 939 940 m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth ); 941 } 942 #endif 943 Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 944 { 945 assert( pcCU->getSlice()->getSPS()->isDepth() ); 946 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 947 948 // number of segments depends on prediction mode for INTRA 949 UInt uiNumSegments = 2; 950 UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx ); 951 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) ) 952 uiNumSegments = 1; 953 707 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP ); 708 } 709 710 #if LGE_INTER_SDC_E0156 711 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 712 { 713 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth); 714 715 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 716 { 717 return; 718 } 719 720 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) ) 721 { 722 return; 723 } 724 725 m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 726 } 727 728 Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 729 { 730 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 731 { 732 return; 733 } 734 735 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 736 { 737 return; 738 } 739 740 UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ); 741 954 742 // decode residual data for each segment 955 743 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 956 m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg); 744 { 745 m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg ); 746 } 957 747 } 958 748 #endif
Note: See TracChangeset for help on using the changeset viewer.