Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
- Timestamp:
- 12 Apr 2018, 11:12:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.2-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
r1405 r1412 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 60 60 m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 61 61 } 62 #if NH_3D _DIS62 #if NH_3D 63 63 Void TDecEntropy::decodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 64 64 { … … 104 104 } 105 105 106 #if NH_3D _ARP106 #if NH_3D 107 107 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 108 108 { … … 121 121 } 122 122 } 123 #endif 124 125 #if NH_3D_IC 123 126 124 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 127 125 { 128 126 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 129 127 130 #if NH_3D_ARP131 128 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) 132 #else133 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )134 #endif135 129 { 136 130 return; … … 165 159 { 166 160 decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); 167 #if NH_3D _SDC_INTRA161 #if NH_3D 168 162 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 169 163 #endif … … 239 233 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 240 234 241 #if NH_3D_MLC 242 //#if H_3D_IV_MERGE 235 #if NH_3D 243 236 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 244 237 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 247 240 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 248 241 #endif 249 #if NH_3D _SPIVMP242 #if NH_3D 250 243 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 251 244 TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 252 245 UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 253 #endif254 #if NH_3D_IV_MERGE255 246 pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx); 256 247 #endif … … 262 253 Bool hasMergedCandList = false; 263 254 255 #if MCTS_ENC_CHECK 256 UInt numSpatialMergeCandidates = 0; 257 #endif 264 258 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 265 259 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); … … 296 290 297 291 ////// Parse CUs extension syntax 298 #if NH_3D_DBBP299 292 decodeDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); 300 #endif301 #if NH_3D_SDC_INTER302 293 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 303 #endif 304 #if NH_3D_ARP 305 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 306 #endif 307 #if NH_3D_IC 308 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 309 #endif 294 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 295 decodeICFlag ( pcCU, uiAbsPartIdx, uiDepth ); 310 296 311 297 ////// Decode motion vectors … … 323 309 #endif 324 310 325 #if NH_3D_DBBP326 311 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false ) 327 #else328 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )329 #endif330 312 { 331 313 if ( !hasMergedCandList ) 332 314 { 333 315 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 334 335 #if NH_3D_MLC336 #if NH_3D_VSP337 316 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 338 317 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 339 #endif340 #if NH_3D_SPIVMP341 318 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 342 #endif343 319 pcSubCU->initAvailableFlags(); 344 #endif 320 #if MCTS_ENC_CHECK 321 numSpatialMergeCandidates = 0; 322 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates ); 323 #else 345 324 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 346 #if NH_3D_MLC 347 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 348 #if NH_3D_SPIVMP 349 , pcMvFieldSP, puhInterDirSP 350 #endif 351 , numValidMergeCand ); 352 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 353 #if NH_3D_VSP 354 , vspFlag 355 #endif 356 #if NH_3D_SPIVMP 357 , bSPIVMPFlag 358 #endif 359 , numValidMergeCand ); 360 #if NH_3D_VSP 325 #endif 326 327 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, pcMvFieldSP, puhInterDirSP, numValidMergeCand ); 328 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, bSPIVMPFlag, numValidMergeCand ); 361 329 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 362 #endif363 #endif364 330 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. 365 331 hasMergedCandList = true; … … 368 334 else 369 335 { 370 #if NH_3D_MLC371 #if NH_3D_VSP372 336 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 373 337 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 374 #endif375 #if NH_3D_SPIVMP376 338 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 377 #endif378 339 pcSubCU->initAvailableFlags(); 379 #endif 340 #if MCTS_ENC_CHECK 341 numSpatialMergeCandidates = 0; 342 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex ); 343 #else 380 344 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 381 #if NH_3D_MLC 382 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 383 #if NH_3D_SPIVMP 384 , pcMvFieldSP, puhInterDirSP 385 #endif 386 ,numValidMergeCand, uiMergeIndex ); 387 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 388 #if NH_3D_VSP 389 , vspFlag 390 #endif 391 #if NH_3D_SPIVMP 392 , bSPIVMPFlag 393 #endif 394 ,numValidMergeCand ); 395 #if NH_3D_VSP 345 #endif 346 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, pcMvFieldSP, puhInterDirSP ,numValidMergeCand, uiMergeIndex ); 347 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours , vspFlag, bSPIVMPFlag ,numValidMergeCand ); 396 348 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 397 #endif398 #endif399 349 } 400 350 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); … … 409 359 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 410 360 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 411 #if NH_3D_VSP412 #if NH_3D_DBBP413 361 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) ) 414 #else415 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )416 #endif417 362 { 418 363 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) … … 426 371 } 427 372 } 428 #endif 429 } 430 } 431 #if NH_3D_SPIVMP 373 } 374 } 432 375 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 433 376 if (bSPIVMPFlag[uiMergeIndex] != 0) … … 451 394 } 452 395 } 453 #endif454 396 } 455 397 else … … 481 423 } 482 424 } 425 426 delete[] pcMvFieldSP; 427 delete[] puhInterDirSP; 428 483 429 #else 484 430 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) … … 501 447 } 502 448 #endif 503 #if NH_3D_IC504 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );505 #endif506 507 449 const UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 508 450 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) … … 512 454 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 513 455 514 #if NH_3D_MLC 515 #if NH_3D_VSP 516 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 517 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 518 #endif 519 #if NH_3D_SPIVMP 520 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 521 #endif 522 pcSubCU->initAvailableFlags(); 523 #endif 456 #if MCTS_ENC_CHECK 457 numSpatialMergeCandidates = 0; 458 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates ); 459 #else 524 460 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 525 #if NH_3D_MLC526 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours527 #if NH_3D_SPIVMP528 , pcMvFieldSP, puhInterDirSP529 #endif530 , numValidMergeCand );531 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours532 #if NH_3D_VSP533 , vspFlag534 #endif535 #if NH_3D_SPIVMP536 , bSPIVMPFlag537 #endif538 , numValidMergeCand );539 #if NH_3D_VSP540 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );541 #endif542 461 #endif 543 462 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. … … 547 466 else 548 467 { 549 550 #if NH_3D_MLC 551 #if NH_3D_VSP 552 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 553 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 554 #endif 555 #if NH_3D_SPIVMP 556 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 557 #endif 558 pcSubCU->initAvailableFlags(); 559 #endif 468 #if MCTS_ENC_CHECK 469 numSpatialMergeCandidates = 0; 470 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex ); 471 #else 472 560 473 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 561 #if NH_3D_MLC 562 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 563 #if NH_3D_SPIVMP 564 , pcMvFieldSP, puhInterDirSP 565 #endif 566 ,numValidMergeCand, uiMergeIndex ); 567 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 568 #if NH_3D_VSP 569 , vspFlag 570 #endif 571 #if NH_3D_SPIVMP 572 , bSPIVMPFlag 573 #endif 574 ,numValidMergeCand ); 575 #if NH_3D_VSP 576 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 577 #endif 578 #endif 579 } 580 474 #endif 475 } 476 #if MCTS_ENC_CHECK 477 if (m_pConformanceCheck->getTMctsCheck() && pcSubCU->isLastColumnCTUInTile() && (uiMergeIndex >= numSpatialMergeCandidates) ) 478 { 479 m_pConformanceCheck->flagTMctsError("Merge Index using non-spatial merge candidate (Merge)"); 480 } 481 482 #endif 581 483 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 582 484 … … 590 492 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 591 493 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 592 #if NH_3D_VSP 593 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 ) 594 { 595 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) 596 { 597 UInt dummy; 598 Int vspSize; 599 Int width, height; 600 pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 ); 601 pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); 602 pcCU->setVSPFlag( uiSubPartIdx, vspSize ); 603 } 604 } 605 #endif 606 } 607 } 608 #if NH_3D_SPIVMP 609 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 610 if (bSPIVMPFlag[uiMergeIndex] != 0) 611 { 612 Int iWidth, iHeight; 613 UInt uiIdx; 614 pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true ); 615 616 UInt uiSPAddr; 617 618 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 619 620 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 621 622 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 623 { 624 pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 625 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 626 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 627 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 628 } 629 } 630 #endif 494 } 495 } 631 496 } 632 497 else … … 652 517 } 653 518 } 654 #if NH_3D_IC655 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );656 #endif657 519 } 658 520 … … 664 526 } 665 527 } 666 #endif667 #if NH_3D_SPIVMP668 delete[] pcMvFieldSP;669 delete[] puhInterDirSP;670 528 #endif 671 529 return; … … 812 670 } 813 671 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); 672 #if MCTS_ENC_CHECK 673 if ((iRefIdx >= 0) && m_pConformanceCheck->getTMctsCheck() && pcSubCU->isLastColumnCTUInTile() && (iMVPIdx == pAMVPInfo->numSpatialMVPCandidates)) 674 { 675 m_pConformanceCheck->flagTMctsError("Merge Index using non-spatial merge candidate (AMVP)"); 676 } 677 #endif 678 814 679 pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); 815 680 pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); … … 1085 950 Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool& bCodeDQP, Bool& isChromaQpAdjCoded ) 1086 951 { 1087 #if NH_3D _SDC_INTRA952 #if NH_3D 1088 953 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) 1089 954 { … … 1092 957 assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 ); 1093 958 } 1094 #endif1095 #if NH_3D_SDC_INTER1096 959 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) 1097 960 { … … 1100 963 assert( pcCU->getSlice()->getIsDepth() ); 1101 964 } 1102 #endif1103 #if NH_3D1104 965 if( pcCU->getSlice()->getIsDepth() ) 1105 966 { 1106 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER1107 967 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 1108 968 { … … 1110 970 return; 1111 971 } 1112 #endif1113 #if NH_3D_DMM1114 972 if( pcCU->isIntra( uiAbsPartIdx ) ) 1115 973 { … … 1124 982 } 1125 983 } 1126 #endif1127 984 } 1128 985 #endif … … 1162 1019 } 1163 1020 1164 #if NH_3D _SDC_INTRA || NH_3D_SDC_INTER1021 #if NH_3D 1165 1022 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1166 1023 { … … 1186 1043 m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 1187 1044 } 1188 #endif 1189 #if NH_3D_DBBP 1045 1190 1046 Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1191 1047 {
Note: See TracChangeset for help on using the changeset viewer.