Changeset 1279 in 3DVCSoftware for branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecEntropy.cpp
- Timestamp:
- 15 Jul 2015, 14:57:32 (9 years ago)
- Location:
- branches/HTM-14.1-update-dev1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1
-
branches/HTM-14.1-update-dev1/source/Lib/TLibDecoder/TDecEntropy.cpp
r1258 r1279 104 104 } 105 105 106 #if H_3D_ARP106 #if NH_3D_ARP 107 107 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 108 108 { … … 123 123 #endif 124 124 125 #if H_3D_IC125 #if NH_3D_IC 126 126 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 127 127 { 128 128 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 129 129 130 #if NH_3D_ARP 130 131 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) 132 #else 133 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 134 #endif 131 135 { 132 136 return; … … 234 238 UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); 235 239 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 236 #if H_3D_IV_MERGE 240 //#if H_3D_IV_MERGE 241 #if NH_3D_MLC 237 242 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 238 243 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 241 246 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 242 247 #endif 243 #if H_3D_SPIVMP248 #if NH_3D_SPIVMP 244 249 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 245 TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartition ()*2];246 UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition ()];247 #endif 248 #if H_3D_IV_MERGE250 TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 251 UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 252 #endif 253 #if NH_3D_IV_MERGE 249 254 pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx); 250 255 #endif … … 258 263 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 259 264 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 260 #if H_3D265 #if NH_3D 261 266 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) 262 267 { … … 290 295 291 296 ////// Parse CUs extension syntax 297 #if NH_3D_DBBP 292 298 decodeDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); 293 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 294 295 #if H_3D_ARP 299 #endif 300 //decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 301 302 #if NH_3D_ARP 296 303 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 297 304 #endif 298 #if H_3D_IC305 #if NH_3D_IC 299 306 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 300 307 #endif … … 306 313 { 307 314 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 308 #if H_3D_DBBP 315 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 316 if (bDebugPredEnabled) 317 { 318 std::cout << "Coded merge flag, CU absPartIdx: " << uiAbsPartIdx << " PU(" << uiPartIdx << ") absPartIdx: " << uiSubPartIdx; 319 std::cout << " merge index: " << (UInt)pcCU->getMergeIndex(uiSubPartIdx) << std::endl; 320 } 321 #endif 322 323 #if NH_3D_DBBP 309 324 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false ) 310 325 #else … … 312 327 #endif 313 328 { 314 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 315 if ( !isMerged ) 316 { 317 #if H_3D_VSP 329 if ( !hasMergedCandList ) 330 { 331 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 332 333 #if NH_3D_MLC 334 #if NH_3D_VSP 318 335 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 319 336 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 320 #if H_3D_SPIVMP 337 #endif 338 #if NH_3D_SPIVMP 321 339 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 322 340 #endif 323 341 pcSubCU->initAvailableFlags(); 324 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 342 #endif 343 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 344 #if NH_3D_MLC 325 345 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 326 #if H_3D_SPIVMP346 #if NH_3D_SPIVMP 327 347 , pcMvFieldSP, puhInterDirSP 328 348 #endif 329 349 , numValidMergeCand ); 330 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag 331 #if H_3D_SPIVMP 350 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 351 #if NH_3D_VSP 352 , vspFlag 353 #endif 354 #if NH_3D_SPIVMP 332 355 , bSPIVMPFlag 333 356 #endif 334 357 , numValidMergeCand ); 358 #if NH_3D_VSP 335 359 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 336 337 #else 338 #if H_3D 339 pcSubCU->initAvailableFlags(); 340 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 341 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 342 343 #else 344 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 345 #endif 346 #endif 347 isMerged = true; 348 } 349 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); 360 #endif 361 #endif 362 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. 363 hasMergedCandList = true; 364 } 350 365 } 351 366 else 352 367 { 353 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 354 #if H_3D_VSP368 #if NH_3D_MLC 369 #if NH_3D_VSP 355 370 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 356 371 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 357 #if H_3D_SPIVMP 372 #endif 373 #if NH_3D_SPIVMP 358 374 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 359 375 #endif 360 376 pcSubCU->initAvailableFlags(); 377 #endif 361 378 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 379 #if NH_3D_MLC 362 380 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 363 #if H_3D_SPIVMP381 #if NH_3D_SPIVMP 364 382 , pcMvFieldSP, puhInterDirSP 365 383 #endif 366 384 ,numValidMergeCand, uiMergeIndex ); 367 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag 368 #if H_3D_SPIVMP 385 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 386 #if NH_3D_VSP 387 , vspFlag 388 #endif 389 #if NH_3D_SPIVMP 369 390 , bSPIVMPFlag 370 391 #endif 371 392 ,numValidMergeCand ); 393 #if NH_3D_VSP 372 394 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 373 #else374 #if H_3D375 pcSubCU->initAvailableFlags();376 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );377 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );378 #else379 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );380 395 #endif 381 396 #endif … … 385 400 TComMv cTmpMv( 0, 0 ); 386 401 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) 387 { 402 { 388 403 if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 ) 389 404 { … … 392 407 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 393 408 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 394 #if H_3D_VSP395 #if H_3D_DBBP409 #if NH_3D_VSP 410 #if NH_3D_DBBP 396 411 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) ) 397 412 #else … … 412 427 } 413 428 } 414 #if H_3D_SPIVMP429 #if NH_3D_SPIVMP 415 430 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 416 431 if (bSPIVMPFlag[uiMergeIndex] != 0) … … 443 458 { 444 459 decodeMvsAMVP ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 460 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 461 if (bDebugPredEnabled) 462 { 463 std::cout << "refListIdx: " << uiRefListIdx << std::endl; 464 std::cout << "MVD horizontal: " << pcCU->getCUMvField(RefPicList(uiRefListIdx))->getMvd( uiAbsPartIdx ).getHor() << std::endl; 465 std::cout << "MVD vertical: " << pcCU->getCUMvField(RefPicList(uiRefListIdx))->getMvd( uiAbsPartIdx ).getVer() << std::endl; 466 std::cout << "MVPIdxPU: " << pcCU->getMVPIdx(RefPicList( uiRefListIdx ), uiSubPartIdx) << std::endl; 467 std::cout << "InterDir: " << (UInt)pcCU->getInterDir(uiSubPartIdx) << std::endl; 468 } 469 #endif 445 470 } 446 471 } … … 474 499 } 475 500 #endif 501 #if NH_3D_IC 502 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 503 #endif 476 504 477 505 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); … … 481 509 { 482 510 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 511 512 #if NH_3D_MLC 513 #if NH_3D_VSP 514 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 515 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 516 #endif 517 #if NH_3D_SPIVMP 518 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 519 #endif 520 pcSubCU->initAvailableFlags(); 521 #endif 483 522 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 523 #if NH_3D_MLC 524 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 525 #if NH_3D_SPIVMP 526 , pcMvFieldSP, puhInterDirSP 527 #endif 528 , numValidMergeCand ); 529 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 530 #if NH_3D_VSP 531 , vspFlag 532 #endif 533 #if NH_3D_SPIVMP 534 , bSPIVMPFlag 535 #endif 536 , numValidMergeCand ); 537 #if NH_3D_VSP 538 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 539 #endif 540 #endif 484 541 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. 485 542 hasMergedCandList = true; … … 489 546 { 490 547 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 548 549 #if NH_3D_MLC 550 #if NH_3D_VSP 551 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 552 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 553 #endif 554 #if NH_3D_SPIVMP 555 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 556 #endif 557 pcSubCU->initAvailableFlags(); 558 #endif 491 559 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 560 #if NH_3D_MLC 561 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 562 #if NH_3D_SPIVMP 563 , pcMvFieldSP, puhInterDirSP 564 #endif 565 ,numValidMergeCand, uiMergeIndex ); 566 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 567 #if NH_3D_VSP 568 , vspFlag 569 #endif 570 #if NH_3D_SPIVMP 571 , bSPIVMPFlag 572 #endif 573 ,numValidMergeCand ); 574 #if NH_3D_VSP 575 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 576 #endif 577 #endif 492 578 } 493 579 … … 503 589 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 504 590 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 505 506 } 507 } 591 #if NH_3D_VSP 592 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 ) 593 { 594 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) 595 { 596 UInt dummy; 597 Int vspSize; 598 Int width, height; 599 pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 ); 600 pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); 601 pcCU->setVSPFlag( uiSubPartIdx, vspSize ); 602 } 603 } 604 #endif 605 } 606 } 607 #if NH_3D_SPIVMP 608 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 609 if (bSPIVMPFlag[uiMergeIndex] != 0) 610 { 611 Int iWidth, iHeight; 612 UInt uiIdx; 613 pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true ); 614 615 UInt uiSPAddr; 616 617 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 618 619 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 620 621 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 622 { 623 pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 624 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 625 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 626 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 627 } 628 } 629 #endif 508 630 } 509 631 else … … 529 651 } 530 652 } 653 #if NH_3D_IC 654 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 655 #endif 531 656 } 532 657 … … 539 664 } 540 665 #endif 541 #if H_3D_SPIVMP666 #if NH_3D_SPIVMP 542 667 delete[] pcMvFieldSP; 543 668 delete[] puhInterDirSP; … … 607 732 } 608 733 609 #if H_3D734 #if NH_3D 610 735 Void TDecEntropy::decodeMVPIdxPU( TComDataCU* pcSubCU, UInt uiPartAddr, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList ) 611 736 { … … 1061 1186 } 1062 1187 #endif 1063 #if H_3D_DBBP1188 #if NH_3D_DBBP 1064 1189 Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1065 1190 {
Note: See TracChangeset for help on using the changeset viewer.