Changeset 1279 in 3DVCSoftware for branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.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/TLibEncoder/TEncCu.cpp
r1258 r1279 68 68 m_ppcTempCU = new TComDataCU*[m_uhTotalDepth-1]; 69 69 70 #if H_3D_ARP70 #if NH_3D_ARP 71 71 m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1]; 72 72 #endif … … 79 79 m_ppcRecoYuvTemp = new TComYuv*[m_uhTotalDepth-1]; 80 80 m_ppcOrigYuv = new TComYuv*[m_uhTotalDepth-1]; 81 #if H_3D_DBBP81 #if NH_3D_DBBP 82 82 m_ppcOrigYuvDBBP = new TComYuv*[m_uhTotalDepth-1]; 83 83 #endif … … 92 92 m_ppcBestCU[i] = new TComDataCU; m_ppcBestCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 93 93 m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 94 #if H_3D_ARP95 m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );94 #if NH_3D_ARP 95 m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) ); 96 96 #endif 97 97 … … 105 105 106 106 m_ppcOrigYuv [i] = new TComYuv; m_ppcOrigYuv [i]->create(uiWidth, uiHeight, chromaFormat); 107 #if H_3D_DBBP108 m_ppcOrigYuvDBBP[i] = new TComYuv; m_ppcOrigYuvDBBP[i]->create(uiWidth, uiHeight );107 #if NH_3D_DBBP 108 m_ppcOrigYuvDBBP[i] = new TComYuv; m_ppcOrigYuvDBBP[i]->create(uiWidth, uiHeight, chromaFormat); 109 109 #endif 110 110 … … 146 146 m_ppcTempCU[i]->destroy(); delete m_ppcTempCU[i]; m_ppcTempCU[i] = NULL; 147 147 } 148 #if H_3D_ARP148 #if NH_3D_ARP 149 149 if(m_ppcWeightedTempCU[i]) 150 150 { … … 180 180 m_ppcOrigYuv[i]->destroy(); delete m_ppcOrigYuv[i]; m_ppcOrigYuv[i] = NULL; 181 181 } 182 #if H_3D_DBBP182 #if NH_3D_DBBP 183 183 if(m_ppcOrigYuvDBBP[i]) 184 184 { … … 198 198 } 199 199 200 #if H_3D_ARP200 #if NH_3D_ARP 201 201 if(m_ppcWeightedTempCU) 202 202 { … … 240 240 m_ppcOrigYuv = NULL; 241 241 } 242 #if H_3D_DBBP242 #if NH_3D_DBBP 243 243 if(m_ppcOrigYuvDBBP) 244 244 { … … 280 280 m_ppcTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() ); 281 281 282 #if NH_3D_ARP 283 m_ppcWeightedTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() ); 284 #endif 285 282 286 #if KWU_RC_MADPRED_E0227 283 287 m_LCUPredictionSAD = 0; … … 413 417 414 418 415 #if H_3D_QTLPC419 #if NH_3D_QTLPC 416 420 Bool bLimQtPredFalg = pcPic->getSlice(0)->getQtPredFlag(); 417 421 TComPic *pcTexture = rpcBestCU->getSlice()->getTexturePic(); … … 429 433 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getCtuRsAddr(), rpcBestCU->getZorderIdxInCtu() ); 430 434 431 #if H_3D_QTLPC435 #if NH_3D_QTLPC 432 436 Bool bTrySplit = true; 433 437 Bool bTrySplitDQP = true; … … 441 445 Bool earlyDetectionSkipMode = false; 442 446 443 #if H_3D_VSP447 #if NH_3D_NBDV 444 448 DisInfo DvInfo; 445 449 DvInfo.m_acNBDV.setZero(); 446 450 DvInfo.m_aVIdxCan = 0; 447 #if H_3D_NBDV_REF451 #if NH_3D_NBDV_REF 448 452 DvInfo.m_acDoNBDV.setZero(); 449 453 #endif … … 505 509 } 506 510 507 #if H_3D_IC511 #if NH_3D_IC 508 512 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth(); 509 513 bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC(); … … 529 533 } 530 534 531 #if H_3D_QTLPC535 #if NH_3D_QTLPC 532 536 bTrySplit = true; 533 537 #endif … … 547 551 548 552 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 549 #if H_3D_QTLPC553 #if NH_3D_QTLPC 550 554 //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU 551 555 #if H_3D_FCO … … 555 559 #endif 556 560 { 557 TComDataCU* pcTextureCU = pcTexture->getC U( rpcBestCU->getAddr() ); //Corresponding texture LCU558 UInt uiCUIdx = rpcBestCU->getZorderIdxInC U();561 TComDataCU* pcTextureCU = pcTexture->getCtu( rpcBestCU->getCtuRsAddr() ); //Corresponding texture LCU 562 UInt uiCUIdx = rpcBestCU->getZorderIdxInCtu(); 559 563 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partitioned than the texture. 560 564 if (pcTextureCU->getDepth(uiCUIdx) > uiDepth || pcTextureCU->getPartitionSize(uiCUIdx) == SIZE_NxN) //Texture was split. … … 584 588 #endif 585 589 586 #if H_3D_NBDV590 #if NH_3D_NBDV 587 591 if( rpcTempCU->getSlice()->getSliceType() != I_SLICE ) 588 592 { 589 #if H_3D_ARP && H_3D_IV_MERGE590 if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getIvMvPredFlag() )593 #if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP 594 if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getIvMvPredFlag() || rpcTempCU->getSlice()->getViewSynthesisPredFlag() ) 591 595 #else 592 #if H_3D_ARP 593 if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) ) 596 #if NH_3D_IV_MERGE && NH_3D_VSP 597 if( rpcTempCU->getSlice()->getIvMvPredFlag() || rpcTempCU->getSlice()->getViewSynthesisPredFlag() ) 598 #else 599 #if NH_3D_ARP && NH_3D_VSP 600 if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getViewSynthesisPredFlag() ) 601 #else 602 #if NH_3D_VSP 603 if( rpcTempCU->getSlice()->getViewSynthesisPredFlag() ) 604 #else 605 #if NH_3D_ARP 606 if( rpcTempCU->getSlice()->getIvResPredFlag() ) 594 607 #else 595 608 #if H_3D_IV_MERGE 596 609 if( rpcTempCU->getSlice()->getVPS()->getIvMvPredFlag(rpcTempCU->getSlice()->getLayerId()) ) 597 610 #else 611 #if NH_3D_DBBP 612 if( rpcTempCU->getSlice()->getDepthBasedBlkPartFlag() ) 613 #else 598 614 if (0) 615 #endif 616 #endif 617 #endif 618 #endif 599 619 #endif 600 620 #endif … … 602 622 { 603 623 PartSize ePartTemp = rpcTempCU->getPartitionSize(0); 604 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );605 #if H_3D_IV_MERGE624 rpcTempCU->setPartSizeSubParts(SIZE_2Nx2N, 0, uiDepth); 625 #if NH_3D_IV_MERGE 606 626 if (rpcTempCU->getSlice()->getIsDepth() ) 607 627 { … … 611 631 { 612 632 #endif 613 #if H_3D_NBDV_REF633 #if NH_3D_NBDV_REF 614 634 if( rpcTempCU->getSlice()->getDepthRefinementFlag() ) 615 635 { … … 621 641 rpcTempCU->getDisMvpCandNBDV(&DvInfo); 622 642 } 623 #if H_3D_IV_MERGE643 #if NH_3D_IV_MERGE 624 644 } 625 645 #endif … … 642 662 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) 643 663 { 644 #if H_3D_IC664 #if NH_3D_IC 645 665 for( UInt uiICId = 0; uiICId < ( bICEnabled ? 2 : 1 ); uiICId++ ) 646 666 { … … 650 670 if(m_pcEncCfg->getUseEarlySkipDetection()) 651 671 { 652 #if H_3D_IC672 #if NH_3D_IC 653 673 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 654 674 #endif … … 659 679 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );//by Competition for inter_2Nx2N 660 680 #endif 661 #if H_3D_VSP662 681 #if NH_3D_VSP || NH_3D_DBBP 682 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 663 683 #endif 664 684 } 665 685 // SKIP 666 #if H_3D_IC686 #if NH_3D_IC 667 687 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 668 688 #endif … … 673 693 674 694 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 675 #if H_3D_VSP676 695 #if NH_3D_VSP || NH_3D_DBBP 696 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 677 697 #endif 678 698 … … 680 700 { 681 701 // 2Nx2N, NxN 682 #if H_3D_IC702 #if NH_3D_IC 683 703 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 684 704 #endif … … 690 710 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 691 711 #endif 692 #if H_3D_VSP693 694 #endif 695 #if H_3D_DBBP712 #if NH_3D_VSP || NH_3D_DBBP 713 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 714 #endif 715 #if NH_3D_DBBP 696 716 if( rpcTempCU->getSlice()->getDepthBasedBlkPartFlag() && rpcTempCU->getSlice()->getDefaultRefViewIdxAvailableFlag() ) 697 717 { 698 718 xCheckRDCostInterDBBP( rpcBestCU, rpcTempCU, false ); 699 719 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 700 #if H_3D_VSP720 #if NH_3D_VSP || NH_3D_DBBP 701 721 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 702 722 #endif … … 709 729 } 710 730 } 711 #if H_3D_IC731 #if NH_3D_IC 712 732 } 713 733 #endif 714 734 } 715 #if H_3D_QTLPC735 #if NH_3D_QTLPC 716 736 if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg )) 717 737 { … … 768 788 { 769 789 if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() && doNotBlockPu 770 #if H_3D_QTLPC790 #if NH_3D_QTLPC 771 791 && bTrySplit 772 792 #endif … … 780 800 #endif 781 801 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 782 #if H_3D_VSP783 802 #if NH_3D_VSP || NH_3D_DBBP 803 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 784 804 #endif 785 805 … … 788 808 789 809 if(doNotBlockPu 790 #if H_3D_QTLPC810 #if NH_3D_QTLPC 791 811 && bTryNx2N 792 812 #endif … … 799 819 #endif 800 820 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 801 #if H_3D_VSP821 #if NH_3D_VSP || NH_3D_DBBP 802 822 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 803 823 #endif … … 809 829 } 810 830 if(doNotBlockPu 811 #if H_3D_QTLPC831 #if NH_3D_QTLPC 812 832 && bTry2NxN 813 833 #endif … … 822 842 823 843 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 824 #if H_3D_VSP844 #if NH_3D_VSP || NH_3D_DBBP 825 845 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 826 846 #endif … … 850 870 { 851 871 if(doNotBlockPu 852 #if H_3D_QTLPC872 #if NH_3D_QTLPC 853 873 && bTry2NxN 854 874 #endif … … 861 881 #endif 862 882 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 863 #if H_3D_VSP883 #if NH_3D_VSP || NH_3D_DBBP 864 884 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 865 885 #endif … … 870 890 } 871 891 if(doNotBlockPu 872 #if H_3D_QTLPC892 #if NH_3D_QTLPC 873 893 && bTry2NxN 874 894 #endif … … 882 902 883 903 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 884 #if H_3D_VSP904 #if NH_3D_VSP || NH_3D_DBBP 885 905 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 886 906 #endif … … 896 916 { 897 917 if(doNotBlockPu 898 #if H_3D_QTLPC918 #if NH_3D_QTLPC 899 919 && bTry2NxN 900 920 #endif … … 909 929 910 930 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 911 #if H_3D_VSP931 #if NH_3D_VSP || NH_3D_DBBP 912 932 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 913 933 #endif … … 918 938 } 919 939 if(doNotBlockPu 920 #if H_3D_QTLPC940 #if NH_3D_QTLPC 921 941 && bTry2NxN 922 942 #endif … … 929 949 #endif 930 950 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 931 #if H_3D_VSP951 #if NH_3D_VSP || NH_3D_DBBP 932 952 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 933 953 #endif … … 945 965 { 946 966 if(doNotBlockPu 947 #if H_3D_QTLPC967 #if NH_3D_QTLPC 948 968 && bTryNx2N 949 969 #endif … … 957 977 958 978 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 959 #if H_3D_VSP979 #if NH_3D_VSP || NH_3D_DBBP 960 980 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 961 981 #endif … … 966 986 } 967 987 if(doNotBlockPu 968 #if H_3D_QTLPC988 #if NH_3D_QTLPC 969 989 && bTryNx2N 970 990 #endif … … 977 997 #endif 978 998 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 979 #if H_3D_VSP999 #if NH_3D_VSP || NH_3D_DBBP 980 1000 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 981 1001 #endif … … 986 1006 { 987 1007 if(doNotBlockPu 988 #if H_3D_QTLPC1008 #if NH_3D_QTLPC 989 1009 && bTryNx2N 990 1010 #endif … … 997 1017 #endif 998 1018 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 999 #if H_3D_VSP1019 #if NH_3D_VSP || NH_3D_DBBP 1000 1020 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 1001 1021 #endif … … 1006 1026 } 1007 1027 if(doNotBlockPu 1008 #if H_3D_QTLPC1028 #if NH_3D_QTLPC 1009 1029 && bTryNx2N 1010 1030 #endif … … 1018 1038 #endif 1019 1039 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1020 #if H_3D_VSP1040 #if NH_3D_VSP || NH_3D_DBBP 1021 1041 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 1022 1042 #endif … … 1027 1047 1028 1048 #else 1029 #if H_3D_QTLPC1049 #if NH_3D_QTLPC 1030 1050 if (bTry2NxN) 1031 1051 { … … 1034 1054 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU ); 1035 1055 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1036 #if H_3D_VSP1037 1056 #if NH_3D_VSP || NH_3D_DBBP 1057 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 1038 1058 #endif 1039 1059 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD ); 1040 1060 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1041 #if H_3D_VSP1042 1043 #endif 1044 #if H_3D_QTLPC1061 #if NH_3D_VSP || NH_3D_DBBP 1062 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 1063 #endif 1064 #if NH_3D_QTLPC 1045 1065 } 1046 1066 if (bTryNx2N) … … 1049 1069 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N ); 1050 1070 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1051 #if H_3D_VSP1052 1071 #if NH_3D_VSP || NH_3D_DBBP 1072 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 1053 1073 #endif 1054 1074 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N ); 1055 1075 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1056 #if H_3D_VSP1057 1058 #endif 1059 #if H_3D_QTLPC1076 #if NH_3D_VSP || NH_3D_DBBP 1077 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 1078 #endif 1079 #if NH_3D_QTLPC 1060 1080 } 1061 1081 #endif … … 1113 1133 if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() ) 1114 1134 { 1115 #if H_3D_QTLPC //Try IntraNxN1135 #if NH_3D_QTLPC //Try IntraNxN 1116 1136 if(bTrySplit) 1117 1137 { … … 1129 1149 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 1130 1150 } 1131 #if H_3D_QTLPC1151 #if NH_3D_QTLPC 1132 1152 } 1133 1153 #endif … … 1245 1265 1246 1266 // further split 1247 #if H_3D_QTLPC 1248 if( bSubBranch && bTrySplitDQP && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) 1267 #if NH_3D_QTLPC 1268 1269 if( bSubBranch && bTrySplitDQP && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) 1249 1270 #else 1250 1271 if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) … … 1267 1288 DEBUG_STRING_NEW(sTempDebug) 1268 1289 1290 #if NH_3D_ARP 1291 m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice()); 1292 m_ppcWeightedTempCU[uhNextDepth]->setPic ( m_ppcWeightedTempCU[ uiDepth] ); 1293 #endif 1269 1294 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) 1270 1295 { … … 1572 1597 1573 1598 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx ); 1574 #if H_3D_ARP1599 #if NH_3D_ARP 1575 1600 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1576 1601 #endif 1577 #if H_3D_IC1602 #if NH_3D_IC 1578 1603 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1579 1604 #endif … … 1609 1634 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1610 1635 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1611 #if H_3D1636 #if NH_3D_DBBP 1612 1637 m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx ); 1613 1638 #endif … … 1615 1640 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx ); 1616 1641 #endif 1617 #if H_3D_ARP1642 #if NH_3D_ARP 1618 1643 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1619 1644 #endif 1620 #if H_3D_IC1645 #if NH_3D_IC 1621 1646 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1622 1647 #endif … … 1760 1785 { 1761 1786 assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE ); 1762 #if H_3D_IV_MERGE1787 #if NH_3D_MLC 1763 1788 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 1764 1789 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 1775 1800 } 1776 1801 UChar uhDepth = rpcTempCU->getDepth( 0 ); 1777 #if H_3D_IC1802 #if NH_3D_IC 1778 1803 Bool bICFlag = rpcTempCU->getICFlag( 0 ); 1779 1804 #endif … … 1789 1814 #endif 1790 1815 1791 #if H_3D_ARP1816 #if NH_3D_ARP 1792 1817 DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0); 1793 1818 #else … … 1795 1820 1796 1821 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to CTU level 1797 #if H_3D_VSP 1798 #if !H_3D_ARP 1822 1823 #if NH_3D_SPIVMP 1824 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 1825 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 1826 TComMvField* pcMvFieldSP; 1827 UChar* puhInterDirSP; 1828 pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 1829 puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 1830 #endif 1831 1832 #if NH_3D_VSP 1833 #if !NH_3D_ARP 1799 1834 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 1800 1835 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1801 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1802 rpcTempCU->m_bAvailableFlagA1 = 0; 1803 rpcTempCU->m_bAvailableFlagB1 = 0; 1804 rpcTempCU->m_bAvailableFlagB0 = 0; 1805 rpcTempCU->m_bAvailableFlagA0 = 0; 1806 rpcTempCU->m_bAvailableFlagB2 = 0; 1836 #if NH_3D_MLC 1837 rpcTempCU->initAvailableFlags(); 1838 #endif 1807 1839 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1808 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand ); 1809 #endif 1810 #else 1811 #if H_3D 1812 rpcTempCU->m_bAvailableFlagA1 = 0; 1813 rpcTempCU->m_bAvailableFlagB1 = 0; 1814 rpcTempCU->m_bAvailableFlagB0 = 0; 1815 rpcTempCU->m_bAvailableFlagA0 = 0; 1816 rpcTempCU->m_bAvailableFlagB2 = 0; 1817 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1818 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1819 #else 1840 #if NH_3D_MLC 1841 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 1842 #if NH_3D_SPIVMP 1843 , pcMvFieldSP, puhInterDirSP 1844 #endif 1845 , numValidMergeCand 1846 ); 1847 1848 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag 1849 #if NH_3D_SPIVMP 1850 , bSPIVMPFlag 1851 #endif 1852 , numValidMergeCand 1853 ); 1854 #endif 1855 #endif 1856 #else 1857 #if NH_3D_MLC 1858 rpcTempCU->initAvailableFlags(); 1859 #endif 1820 1860 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1821 #endif 1822 #endif 1823 #if H_3D_IV_MERGE 1861 #if NH_3D_MLC 1862 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 1863 #if H_3D_SPIVMP 1864 , pcMvFieldSP, puhInterDirSP 1865 #endif 1866 , numValidMergeCand 1867 ); 1868 #if NH_3D_MLC 1869 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours 1870 #if H_3D_SPIVMP 1871 , bSPIVMPFlag 1872 #endif 1873 , numValidMergeCand 1874 ); 1875 #endif 1876 #endif 1877 #endif 1878 1879 #if NH_3D_MLC 1824 1880 Int mergeCandBuffer[MRG_MAX_NUM_CANDS_MEM]; 1825 1881 #else 1826 1882 Int mergeCandBuffer[MRG_MAX_NUM_CANDS]; 1827 1883 #endif 1828 #if H_3D_ARP1829 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )1884 #if NH_3D_MLC 1885 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui ) 1830 1886 #else 1831 1887 for( UInt ui = 0; ui < numValidMergeCand; ++ui ) 1832 1888 #endif 1833 1834 1889 { 1835 1890 mergeCandBuffer[ui] = 0; … … 1849 1904 DEBUG_STRING_NEW(bestStr) 1850 1905 1851 #if H_3D_ARP1906 #if NH_3D_ARP 1852 1907 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 1908 #if NH_3D_IC 1853 1909 if( nARPWMax < 0 || bICFlag ) 1910 #else 1911 if( nARPWMax < 0 ) 1912 #endif 1854 1913 { 1855 1914 nARPWMax = 0; … … 1857 1916 for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- ) 1858 1917 { 1918 #if NH_3D_IV_MERGE 1859 1919 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) ); 1920 #else 1921 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS * sizeof(Int) ); 1922 #endif 1860 1923 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1861 1924 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1862 #if H_3D_IC1925 #if NH_3D_IC 1863 1926 rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth ); 1864 1927 #endif 1865 1928 rpcTempCU->getDvInfo(0) = cOrigDisInfo; 1866 rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, 0, uhDepth ); 1929 rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, uhDepth ); 1930 #if NH_3D_VSP 1867 1931 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 1868 1932 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1869 #if H_3D_SPIVMP 1870 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 1871 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 1872 TComMvField* pcMvFieldSP; 1873 UChar* puhInterDirSP; 1874 pcMvFieldSP = new TComMvField[rpcTempCU->getPic()->getPicSym()->getNumPartition()*2]; 1875 puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()]; 1876 #endif 1877 #if H_3D 1933 #endif 1934 #if NH_3D 1935 #if NH_3D_MLC 1878 1936 rpcTempCU->initAvailableFlags(); 1937 #endif 1879 1938 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1880 1939 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 1881 #if H_3D_SPIVMP1940 #if NH_3D_SPIVMP 1882 1941 , pcMvFieldSP, puhInterDirSP 1883 1942 #endif … … 1885 1944 ); 1886 1945 1887 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag 1888 #if H_3D_SPIVMP 1946 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours 1947 #if NH_3D_VSP 1948 , vspFlag 1949 #endif 1950 #if NH_3D_SPIVMP 1889 1951 , bSPIVMPFlag 1890 1952 #endif … … 1893 1955 1894 1956 #else 1895 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,numValidMergeCand );1957 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1896 1958 #endif 1897 1959 … … 1903 1965 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 1904 1966 { 1905 #if H_3D_IC1967 #if NH_3D_IC 1906 1968 if( rpcTempCU->getSlice()->getApplyIC() && rpcTempCU->getSlice()->getIcSkipParseFlag() ) 1907 1969 { … … 1920 1982 // set MC parameters 1921 1983 rpcTempCU->setPredModeSubParts( MODE_INTER, 0, uhDepth ); // interprets depth relative to CTU level 1922 #if H_3D_IC1984 #if NH_3D_IC 1923 1985 rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth ); 1924 #endif1925 #if H_3D_ARP1926 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );1927 1986 #endif 1928 1987 rpcTempCU->setCUTransquantBypassSubParts( bTransquantBypassFlag, 0, uhDepth ); … … 1931 1990 rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to CTU level 1932 1991 rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to CTU level 1933 #if H_3D_VSP 1992 #if NH_3D_ARP 1993 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 1994 #endif 1995 1996 #if NH_3D_VSP 1934 1997 rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth ); 1935 1998 #endif 1936 #if H_3D_SPIVMP1999 #if NH_3D_SPIVMP 1937 2000 rpcTempCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeCand], 0, 0, uhDepth); 1938 2001 if (bSPIVMPFlag[uiMergeCand]) … … 1953 2016 else 1954 2017 #endif 1955 #if H_3D_VSP1956 2018 { 2019 #if NH_3D_VSP 1957 2020 if ( vspFlag[uiMergeCand] ) 1958 2021 { … … 1984 2047 { 1985 2048 #endif 1986 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to CTU level1987 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level1988 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level1989 #if H_3D_VSP2049 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to CTU level 2050 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2051 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2052 #if NH_3D_VSP 1990 2053 } 2054 #endif 1991 2055 } 1992 #endif1993 2056 // do MC 1994 2057 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 2024 2087 rpcTempCU->setDISFlagSubParts( false, 0, uhDepth ); 2025 2088 #endif 2026 #if H_3D_VSP // possible bug fix2089 #if NH_3D_VSP 2027 2090 if( rpcTempCU->getSkipFlag(0) ) 2028 2091 { … … 2157 2220 } 2158 2221 DEBUG_STRING_APPEND(sDebug, bestStr) 2159 #if H_3D_SPIVMP 2222 #if NH_3D_ARP 2223 } 2224 #endif 2225 #if NH_3D_SPIVMP 2160 2226 delete[] pcMvFieldSP; 2161 2227 delete[] puhInterDirSP; 2162 2228 #endif 2163 #if H_3D_ARP2164 }2165 #endif2166 2167 2229 } 2168 2230 … … 2181 2243 2182 2244 // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 2183 #if H_3D 2245 #if H_3D || NH_3D_ARP 2184 2246 const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0); 2185 2247 #endif … … 2189 2251 #endif 2190 2252 UChar uhDepth = rpcTempCU->getDepth( 0 ); 2191 #if H_3D_ARP2253 #if NH_3D_ARP 2192 2254 Bool bFirstTime = true; 2193 2255 Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1; 2256 #if NH_3D_IC 2194 2257 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) ) 2258 #else 2259 if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N ) 2260 #endif 2195 2261 { 2196 2262 nARPWMax = 0; … … 2220 2286 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 2221 2287 rpcTempCU->setChromaQpAdjSubParts( rpcTempCU->getCUTransquantBypass(0) ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth ); 2222 #if H_3D_ARP2288 #if NH_3D_ARP 2223 2289 rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth ); 2224 2290 #endif 2225 #if H_3D_ARP2291 #if NH_3D_ARP 2226 2292 if( bFirstTime == false && nARPWMax ) 2227 2293 { … … 2246 2312 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 2247 2313 #endif 2248 #if H_3D_ARP2314 #if NH_3D_ARP 2249 2315 if( nARPWMax ) 2250 2316 { … … 2257 2323 if ( !rpcTempCU->getMergeAMP() ) 2258 2324 { 2259 #if H_3D_ARP2325 #if NH_3D_ARP 2260 2326 if( nARPWMax ) 2261 2327 { … … 2278 2344 2279 2345 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false DEBUG_STRING_PASS_INTO(sTest) ); 2280 #if H_3D_VSP // possible bug fix2281 2282 2283 2284 2346 #if NH_3D_VSP 2347 if( rpcTempCU->getQtRootCbf(0)==0 ) 2348 { 2349 rpcTempCU->setTrIdxSubParts(0, 0, uhDepth); 2350 } 2285 2351 #endif 2286 2352 #if NH_3D_VSO // M4 … … 2374 2440 } 2375 2441 #endif 2376 #if H_3D_ARP2442 #if NH_3D_ARP 2377 2443 } 2378 2444 #endif … … 2382 2448 } 2383 2449 2384 #if H_3D_DBBP2450 #if NH_3D_DBBP 2385 2451 Void TEncCu::xInvalidateOriginalSegments( TComYuv* pOrigYuv, TComYuv* pOrigYuvTemp, Bool* pMask, UInt uiValidSegment ) 2386 2452 { 2387 UInt uiWidth = pOrigYuv->getWidth ( 2388 UInt uiHeight = pOrigYuv->getHeight( 2389 Pel* piSrc = pOrigYuv->get LumaAddr();2390 UInt uiSrcStride = pOrigYuv->getStride( );2391 Pel* piDst = pOrigYuvTemp->get LumaAddr();2392 UInt uiDstStride = pOrigYuvTemp->getStride( );2453 UInt uiWidth = pOrigYuv->getWidth (COMPONENT_Y); 2454 UInt uiHeight = pOrigYuv->getHeight(COMPONENT_Y); 2455 Pel* piSrc = pOrigYuv->getAddr(COMPONENT_Y); 2456 UInt uiSrcStride = pOrigYuv->getStride(COMPONENT_Y); 2457 Pel* piDst = pOrigYuvTemp->getAddr(COMPONENT_Y); 2458 UInt uiDstStride = pOrigYuvTemp->getStride(COMPONENT_Y); 2393 2459 2394 2460 UInt uiMaskStride= MAX_CU_SIZE; … … 2415 2481 2416 2482 // now invalidate chroma 2417 Pel* piSrcU = pOrigYuv->get CbAddr();2418 Pel* piSrcV = pOrigYuv->get CrAddr();2419 UInt uiSrcStrideC = pOrigYuv->get CStride();2420 Pel* piDstU = pOrigYuvTemp->get CbAddr();2421 Pel* piDstV = pOrigYuvTemp->get CrAddr();2422 UInt uiDstStrideC = pOrigYuvTemp->get CStride();2483 Pel* piSrcU = pOrigYuv->getAddr(COMPONENT_Cb); 2484 Pel* piSrcV = pOrigYuv->getAddr(COMPONENT_Cr); 2485 UInt uiSrcStrideC = pOrigYuv->getStride(COMPONENT_Cb); 2486 Pel* piDstU = pOrigYuvTemp->getAddr(COMPONENT_Cb); 2487 Pel* piDstV = pOrigYuvTemp->getAddr(COMPONENT_Cr); 2488 UInt uiDstStrideC = pOrigYuvTemp->getStride(COMPONENT_Cb); 2423 2489 pMask = pMaskStart; 2424 2490 … … 2441 2507 } 2442 2508 } 2443 2509 #endif 2510 2511 #if NH_3D_DBBP 2444 2512 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) 2445 2513 { … … 2463 2531 AOF( uiWidth == uiHeight ); 2464 2532 2465 #if H_3D_DBBP 2466 // Is this correct here, was under the macro SEC_DBBP_DISALLOW_8x8_I0078, however the function is related to Single Depth Mode 2533 #if NH_3D_DBBP 2467 2534 if(uiWidth <= 8) 2468 2535 { … … 2515 2582 rpcTempCU->getDBBPTmpData()->eVirtualPartSize = eVirtualPartSize; 2516 2583 rpcTempCU->getDBBPTmpData()->uiVirtualPartIndex = uiSegment; 2517 m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, false,bUseMRG );2584 m_pcPredSearch->predInterSearch( rpcTempCU, m_ppcOrigYuvDBBP[uhDepth], apPredYuv[uiSegment], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], false, bUseMRG ); 2518 2585 m_pcRdCost->setUseMask(false); 2519 2586 … … 2524 2591 pDBBPTmpData->auhMergeIndex[uiSegment] = rpcTempCU->getMergeIndex(0); 2525 2592 2593 #if NH_3D_VSP 2526 2594 AOF( rpcTempCU->getSPIVMPFlag(0) == false ); 2527 2595 AOF( rpcTempCU->getVSPFlag(0) == 0 ); 2596 #endif 2528 2597 2529 2598 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ ) … … 2544 2613 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 2545 2614 2546 UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMax CUDepth() - uhDepth ) << 1 ) ) >> 4;2615 UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( rpcTempCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uhDepth ) << 1 ) ) >> 4; 2547 2616 for( UInt uiSegment = 0; uiSegment < 2; uiSegment++ ) 2548 2617 { … … 2570 2639 2571 2640 // reconstruct final prediction signal by combining both segments 2572 m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize); 2641 Int bitDepthY = rpcTempCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 2642 m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize, bitDepthY); 2573 2643 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false ); 2574 2644
Note: See TracChangeset for help on using the changeset viewer.