Changeset 1274 in 3DVCSoftware for branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecCu.cpp
- Timestamp:
- 14 Jul 2015, 12:31:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev2/source/Lib/TLibDecoder/TDecCu.cpp
r1225 r1274 52 52 m_ppcYuvReco = NULL; 53 53 m_ppcCU = NULL; 54 #if H_3D_DBBP54 #if NH_3D_DBBP 55 55 m_ppcYuvRecoDBBP = NULL; 56 56 #endif … … 81 81 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; 82 82 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; 83 #if H_3D_DBBP83 #if NH_3D_DBBP 84 84 m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1]; 85 85 #endif … … 95 95 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 96 96 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 97 #if H_3D_DBBP98 m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight );97 #if NH_3D_DBBP 98 m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 99 99 #endif 100 100 } … … 119 119 m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; 120 120 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 121 #if H_3D_DBBP121 #if NH_3D_DBBP 122 122 m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL; 123 123 #endif … … 127 127 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 128 128 delete [] m_ppcCU ; m_ppcCU = NULL; 129 #if H_3D_DBBP129 #if NH_3D_DBBP 130 130 delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL; 131 131 #endif … … 152 152 setIsChromaQpAdjCoded(true); 153 153 } 154 154 155 155 // start from the top level CU 156 156 xDecodeCU( pCtu, 0, 0, isLastCtuOfSliceSegment); … … 163 163 Void TDecCu::decompressCtu( TComDataCU* pCtu ) 164 164 { 165 #if ! H_3D_IV_MERGE165 #if !NH_3D_IV_MERGE 166 166 xDecompressCU( pCtu, 0, 0 ); 167 167 #endif … … 283 283 pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP 284 284 } 285 #if H_3D_NBDV285 #if NH_3D_NBDV 286 286 DisInfo DvInfo; 287 287 DvInfo.m_acNBDV.setZero(); 288 288 DvInfo.m_aVIdxCan = 0; 289 #if H_3D_NBDV_REF289 #if NH_3D_NBDV_REF 290 290 DvInfo.m_acDoNBDV.setZero(); 291 291 #endif … … 293 293 if(!pcCU->getSlice()->isIntra()) 294 294 { 295 #if H_3D_ARP && H_3D_IV_MERGE296 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() )295 #if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP 296 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() ) 297 297 #else 298 #if NH_3D_IV_MERGE && NH_3D_VSP 299 if( pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() ) 300 #else 301 #if NH_3D_ARP && NH_3D_VSP 302 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() ) 303 #else 304 #if NH_3D_VSP 305 if( pcCU->getSlice()->getViewSynthesisPredFlag() ) 306 #else 298 307 #if H_3D_ARP 299 if( pcCU->getSlice()->get VPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) )308 if( pcCU->getSlice()->getIvResPredFlag( ) ) 300 309 #else 301 310 #if H_3D_IV_MERGE 302 311 if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) ) 303 312 #else 313 #if NH_3D_DBBP 314 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() ) 315 #else 304 316 if (0) 305 317 #endif 306 318 #endif 307 319 #endif 308 { 309 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true ); 310 m_ppcCU[uiDepth]->copyDVInfoFrom( pcCU, uiAbsPartIdx); 320 #endif 321 #endif 322 #endif 323 #endif 324 { 325 m_ppcCU[uiDepth]->copyInterPredInfoFrom(pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true); 326 m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx); 311 327 PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0); 312 328 UChar cWidTemp = m_ppcCU[uiDepth]->getWidth(0); 313 329 UChar cHeightTemp = m_ppcCU[uiDepth]->getHeight(0); 314 m_ppcCU[uiDepth]->setWidth ( 0, pcCU->getSlice()->getSPS()->getMaxCUWidth ()/(1<<uiDepth));315 m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth));316 m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth);317 #if H_3D_IV_MERGE330 m_ppcCU[uiDepth]->setWidth (0, pcCU->getSlice()->getSPS()->getMaxCUWidth () / (1 << uiDepth)); 331 m_ppcCU[uiDepth]->setHeight(0, pcCU->getSlice()->getSPS()->getMaxCUHeight() / (1 << uiDepth)); 332 m_ppcCU[uiDepth]->setPartSizeSubParts(SIZE_2Nx2N, 0, uiDepth); 333 #if NH_3D_IV_MERGE 318 334 if( pcCU->getSlice()->getIsDepth()) 319 335 { … … 323 339 { 324 340 #endif 325 #if H_3D_NBDV_REF341 #if NH_3D_NBDV_REF 326 342 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() ) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done. 327 343 { … … 333 349 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo); 334 350 } 335 #if H_3D_IV_MERGE351 #if NH_3D_IV_MERGE 336 352 } 337 353 #endif … … 346 362 } 347 363 #endif 348 349 364 pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth); 350 m_ppcCU[uiDepth]->setPartSizeSubParts( ePartTemp, 0, uiDepth);351 m_ppcCU[uiDepth]->setWidth ( 0, cWidTemp);352 m_ppcCU[uiDepth]->setHeight ( 0, cHeightTemp);365 m_ppcCU[uiDepth]->setPartSizeSubParts(ePartTemp, 0, uiDepth); 366 m_ppcCU[uiDepth]->setWidth(0, cWidTemp); 367 m_ppcCU[uiDepth]->setHeight(0, cHeightTemp); 353 368 } 354 369 } … … 381 396 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 382 397 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 383 #if H_3D_IV_MERGE398 #if NH_3D_IV_MERGE 384 399 m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx); 400 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 401 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 402 #else 403 #if NH_3D_MLC 385 404 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 386 405 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 389 408 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 390 409 #endif 410 #endif 391 411 Int numValidMergeCand = 0; 392 412 for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui ) … … 396 416 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth ); 397 417 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 398 #if H_3D_ARP418 #if NH_3D_ARP 399 419 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 400 420 #endif … … 403 423 #endif 404 424 405 #if H_3D_VSP 425 426 #if NH_3D_VSP 406 427 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 407 428 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 408 #if H_3D_SPIVMP 429 #endif 430 #if NH_3D_SPIVMP 409 431 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 410 432 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 411 433 TComMvField* pcMvFieldSP; 412 434 UChar* puhInterDirSP; 413 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition()*2]; 414 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 415 #endif 435 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 436 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 437 #endif 438 439 #if NH_3D_MLC 416 440 m_ppcCU[uiDepth]->initAvailableFlags(); 441 #endif 417 442 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 443 #if NH_3D_MLC 418 444 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 419 #if H_3D_SPIVMP445 #if NH_3D_SPIVMP 420 446 , pcMvFieldSP, puhInterDirSP 421 447 #endif 422 448 , numValidMergeCand, uiMergeIndex ); 423 449 424 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag 425 #if H_3D_SPIVMP 450 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 451 #if NH_3D_VSP 452 , vspFlag 453 #endif 454 #if NH_3D_SPIVMP 426 455 , bSPIVMPFlag 427 456 #endif 428 457 , numValidMergeCand ); 458 #endif 459 #if NH_3D_VSP 429 460 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 430 #else 431 #if H_3D 432 m_ppcCU[uiDepth]->initAvailableFlags(); 433 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 434 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 435 #else 436 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 437 #endif 438 #endif 461 #endif 462 439 463 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 440 464 … … 448 472 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 449 473 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 450 #if H_3D_VSP474 #if NH_3D_VSP 451 475 if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 ) 452 476 { … … 481 505 } 482 506 } 483 #if H_3D_SPIVMP507 #if NH_3D_SPIVMP 484 508 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 485 509 if (bSPIVMPFlag[uiMergeIndex]) … … 506 530 507 531 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 508 #if H_3D_IV_MERGE532 #if NH_3D_IV_MERGE 509 533 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 510 534 #endif … … 531 555 #endif 532 556 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 533 #if H_3D_IV_MERGE557 #if NH_3D_IV_MERGE 534 558 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 535 559 #endif … … 551 575 #endif 552 576 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 553 #if H_3D_IV_MERGE577 #if NH_3D_IV_MERGE 554 578 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 555 579 #endif … … 574 598 { 575 599 TComPic* pcPic = pCtu->getPic(); 576 #if ! H_3D_IV_MERGE600 #if !NH_3D_IV_MERGE 577 601 TComSlice * pcSlice = pCtu->getSlice(); 578 602 const TComSPS &sps=*(pcSlice->getSPS()); … … 617 641 { 618 642 case MODE_INTER: 619 #if H_3D_DBBP643 #if NH_3D_DBBP 620 644 if( m_ppcCU[uiDepth]->getDBBPFlag(0) ) 621 645 { … … 637 661 } 638 662 #endif 639 #if H_3D_DBBP663 #if NH_3D_DBBP 640 664 } 641 665 #endif … … 845 869 #endif 846 870 847 #if H_3D_DBBP871 #if NH_3D_DBBP 848 872 Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 849 873 { … … 851 875 AOF(!pcCU->getSlice()->isIntra()); 852 876 PartSize ePartSize = pcCU->getPartitionSize( 0 ); 877 878 Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 853 879 854 880 // get collocated depth block … … 871 897 872 898 // first, extract the two sets of motion parameters 873 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMax CUDepth() - uiDepth ) << 1 ) ) >> 4;899 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 874 900 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 875 901 { … … 877 903 878 904 pDBBPTmpData->auhInterDir[uiSegment] = pcCU->getInterDir(uiPartAddr); 905 assert( pDBBPTmpData->auhInterDir[uiSegment] == 1 || pDBBPTmpData->auhInterDir[uiSegment] == 2 ); // only uni-prediction allowed 879 906 880 907 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) … … 884 911 } 885 912 913 #if H_3D 886 914 AOF( pcCU->getARPW(uiPartAddr) == 0 ); 887 915 AOF( pcCU->getICFlag(uiPartAddr) == false ); 888 916 AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false ); 889 917 AOF( pcCU->getVSPFlag(uiPartAddr) == 0 ); 918 #endif 890 919 } 891 920 … … 927 956 928 957 // reconstruct final prediction signal by combining both segments 929 m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize );958 m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize, bitDepthY); 930 959 931 960 // inter recon 932 xDecodeInterTexture( pcCU, 0,uiDepth );961 xDecodeInterTexture( pcCU, uiDepth ); 933 962 934 963 // clip for only non-zero cbp case 935 if ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V) ) )936 { 937 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );964 if ( ( pcCU->getCbf( 0, COMPONENT_Y ) ) || ( pcCU->getCbf( 0, COMPONENT_Cb ) ) || ( pcCU->getCbf(0, COMPONENT_Cr ) ) ) 965 { 966 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() ); 938 967 } 939 968 else
Note: See TracChangeset for help on using the changeset viewer.