Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/Lib/TLibCommon/TComDataCU.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/TLibCommon/TComDataCU.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 * … … 55 55 56 56 m_skipFlag = NULL; 57 #if NH_3D _DIS57 #if NH_3D 58 58 m_bDISFlag = NULL; 59 59 m_ucDISType = NULL; … … 99 99 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 100 100 { 101 m_apcCUColocated[i] = NULL;102 101 m_apiMVPIdx[i] = NULL; 103 102 m_apiMVPNum[i] = NULL; 104 103 } 105 104 106 #if NH_3D _DMM105 #if NH_3D 107 106 for( Int i = 0; i < NUM_DMM; i++ ) 108 107 { … … 111 110 } 112 111 m_dmm1WedgeTabIdx = NULL; 113 #endif 114 #if NH_3D_SDC_INTRA 112 115 113 m_pbSDCFlag = NULL; 116 114 m_apSegmentDCOffset[0] = NULL; … … 120 118 m_bDecSubCu = false; 121 119 122 #if NH_3D _NBDV120 #if NH_3D 123 121 m_pDvInfo = NULL; 124 #endif125 #if NH_3D_VSP126 122 m_piVSPFlag = NULL; 127 #endif128 #if NH_3D_SPIVMP129 123 m_pbSPIVMPFlag = NULL; 130 #endif131 #if NH_3D_ARP132 124 m_puhARPW = NULL; 133 #endif134 #if NH_3D_IC135 125 m_pbICFlag = NULL; 136 #endif137 #if NH_3D_DBBP138 126 m_pbDBBPFlag = NULL; 139 127 #endif … … 167 155 m_ChromaQpAdj = new UChar[ uiNumPartition ]; 168 156 m_skipFlag = new Bool[ uiNumPartition ]; 169 #if NH_3D _DIS157 #if NH_3D 170 158 m_bDISFlag = new Bool[ uiNumPartition ]; 171 159 m_ucDISType = (UChar*)xMalloc(UChar, uiNumPartition); … … 178 166 m_pbMergeFlag = (Bool* )xMalloc(Bool, uiNumPartition); 179 167 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 180 #if NH_3D _VSP168 #if NH_3D 181 169 m_piVSPFlag = (SChar* )xMalloc(SChar, uiNumPartition); 182 #endif183 #if NH_3D_SPIVMP184 170 m_pbSPIVMPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 185 171 #endif … … 201 187 } 202 188 203 #if NH_3D _NBDV189 #if NH_3D 204 190 m_pDvInfo = (DisInfo* )xMalloc(DisInfo, uiNumPartition); 205 191 #endif … … 242 228 } 243 229 244 #if NH_3D _ARP230 #if NH_3D 245 231 m_puhARPW = (UChar* )xMalloc(UChar, uiNumPartition); 246 #endif247 #if NH_3D_IC248 232 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 249 #endif250 #if NH_3D_DMM251 233 for( Int i = 0; i < NUM_DMM; i++ ) 252 234 { … … 255 237 } 256 238 m_dmm1WedgeTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 257 #endif258 #if NH_3D_SDC_INTRA259 239 m_pbSDCFlag = (Bool*)xMalloc(Bool, uiNumPartition); 260 240 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 261 241 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 262 #endif263 #if NH_3D_DBBP264 242 m_pbDBBPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 265 243 #endif … … 280 258 m_pCtuAbove = NULL; 281 259 m_pCtuLeft = NULL; 282 283 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)284 {285 m_apcCUColocated[i] = NULL;286 }287 260 } 288 261 … … 319 292 } 320 293 321 #if NH_3D _DIS294 #if NH_3D 322 295 if ( m_bDISFlag ) { delete[] m_bDISFlag; m_bDISFlag = NULL; } 323 296 if ( m_ucDISType ) { xFree(m_ucDISType); m_ucDISType = NULL; } … … 360 333 } 361 334 362 #if NH_3D _VSP335 #if NH_3D 363 336 if ( m_piVSPFlag ) 364 337 { … … 366 339 m_piVSPFlag = NULL; 367 340 } 368 #endif369 #if NH_3D_SPIVMP370 341 if ( m_pbSPIVMPFlag ) { xFree(m_pbSPIVMPFlag); m_pbSPIVMPFlag = NULL; } 371 342 #endif … … 455 426 m_acCUMvField[rpl].destroy(); 456 427 } 457 #if NH_3D _NBDV428 #if NH_3D 458 429 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 459 #endif460 461 462 #if NH_3D_ARP463 430 if ( m_puhARPW ) { xFree(m_puhARPW); m_puhARPW = NULL; } 464 #endif465 #if NH_3D_IC466 431 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 467 #endif468 469 #if NH_3D_DMM470 432 for( Int i = 0; i < NUM_DMM; i++ ) 471 433 { … … 474 436 } 475 437 if ( m_dmm1WedgeTabIdx ) { xFree( m_dmm1WedgeTabIdx ); m_dmm1WedgeTabIdx = NULL; } 476 #endif477 #if NH_3D_SDC_INTRA478 438 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 479 439 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 480 440 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 481 #endif 482 #if NH_3D_DBBP 483 if ( m_pbDBBPFlag ) { xFree(m_pbDBBPFlag); m_pbDBBPFlag = NULL; } 441 if ( m_pbDBBPFlag ) { xFree(m_pbDBBPFlag); m_pbDBBPFlag = NULL; } 484 442 #endif 485 443 … … 493 451 m_pCtuAbove = NULL; 494 452 m_pCtuLeft = NULL; 495 496 497 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)498 {499 m_apcCUColocated[i] = NULL;500 }501 453 502 454 } … … 572 524 memset( m_skipFlag , false, m_uiNumPartition * sizeof( *m_skipFlag ) ); 573 525 574 #if NH_3D _DIS526 #if NH_3D 575 527 memset( m_bDISFlag , false, m_uiNumPartition * sizeof( *m_bDISFlag ) ); 576 528 memset( m_ucDISType , false, m_uiNumPartition * sizeof( *m_ucDISType ) ); … … 585 537 memset( m_puhHeight , maxCUHeight, m_uiNumPartition * sizeof( *m_puhHeight ) ); 586 538 587 #if NH_3D _IC539 #if NH_3D 588 540 memset( m_pbICFlag , false, m_uiNumPartition * sizeof( *m_pbICFlag ) ); 589 541 #endif … … 606 558 memset( m_puhMergeIndex , 0, m_uiNumPartition * sizeof( *m_puhMergeIndex ) ); 607 559 608 #if NH_3D _VSP560 #if NH_3D 609 561 memset( m_piVSPFlag , 0, m_uiNumPartition * sizeof( *m_piVSPFlag ) ); 610 #endif611 #if NH_3D_SPIVMP612 562 memset( m_pbSPIVMPFlag , 0, m_uiNumPartition * sizeof( *m_pbSPIVMPFlag ) ); 613 #endif614 #if NH_3D_SDC_INTRA615 563 memset( m_pbSDCFlag, false, m_uiNumPartition * sizeof( *m_pbSDCFlag ) ); 616 #endif617 #if NH_3D_DBBP618 564 memset( m_pbDBBPFlag , false, m_uiNumPartition * sizeof( *m_pbDBBPFlag )); 619 565 #endif … … 624 570 } 625 571 626 #if NH_3D _ARP572 #if NH_3D 627 573 memset( m_puhARPW , 0, m_uiNumPartition * sizeof( *m_puhARPW ) ); 628 #endif629 630 631 #if NH_3D_DMM632 574 for( Int i = 0; i < NUM_DMM; i++ ) 633 575 { … … 635 577 memset( m_dmmDeltaDC[i][1], 0, m_uiNumPartition * sizeof( *m_dmmDeltaDC[i][1] ) ); 636 578 } 637 memset( m_dmm1WedgeTabIdx, 0, m_uiNumPartition * sizeof( *m_dmm1WedgeTabIdx ) ); 638 #endif 639 #if NH_3D_SDC_INTRA 640 memset( m_pbSDCFlag, false, m_uiNumPartition * sizeof( *m_pbSDCFlag ) ); 579 memset( m_dmm1WedgeTabIdx, 0, m_uiNumPartition * sizeof( *m_dmm1WedgeTabIdx ) ); 580 memset( m_pbSDCFlag , false, m_uiNumPartition * sizeof( *m_pbSDCFlag ) ); 641 581 memset( m_apSegmentDCOffset[0], 0, m_uiNumPartition * sizeof( *m_apSegmentDCOffset[0] ) ); 642 582 memset( m_apSegmentDCOffset[1], 0, m_uiNumPartition * sizeof( *m_apSegmentDCOffset[1] ) ); … … 667 607 m_pCtuAboveRight = NULL; 668 608 669 670 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)671 {672 m_apcCUColocated[i] = NULL;673 }674 675 609 UInt frameWidthInCtus = pcPic->getFrameWidthInCtus(); 676 610 if ( m_ctuRsAddr % frameWidthInCtus ) … … 692 626 { 693 627 m_pCtuAboveRight = pcPic->getCtu( m_ctuRsAddr - frameWidthInCtus + 1 ); 694 }695 696 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)697 {698 const RefPicList rpl=RefPicList(i);699 if ( getSlice()->getNumRefIdx( rpl ) > 0 )700 {701 m_apcCUColocated[rpl] = getSlice()->getRefPic( rpl, 0)->getCtu( m_ctuRsAddr );702 }703 628 } 704 629 } … … 743 668 } 744 669 m_skipFlag[ui] = false; 745 #if NH_3D _DIS670 #if NH_3D 746 671 m_bDISFlag[ui] = false; 747 672 m_ucDISType[ui] = 0; … … 755 680 m_pbMergeFlag[ui] = 0; 756 681 m_puhMergeIndex[ui] = 0; 757 #if NH_3D _VSP682 #if NH_3D 758 683 m_piVSPFlag[ui] = 0; 759 #endif760 #if NH_3D_SPIVMP761 684 m_pbSPIVMPFlag[ui] = 0; 762 685 #endif … … 772 695 m_puhCbf[comp][ui] = 0; 773 696 } 774 #if NH_3D_ARP 775 m_puhARPW[ui] = 0; 776 #endif 777 #if NH_3D_IC 778 m_pbICFlag[ui] = false; 779 #endif 780 781 782 #if NH_3D_DMM 697 #if NH_3D 698 m_puhARPW[ui] = 0; 699 m_pbICFlag[ui] = false; 783 700 for( Int i = 0; i < NUM_DMM; i++ ) 784 701 { 785 m_dmmDeltaDC[i][0] [ui] = 0; 786 m_dmmDeltaDC[i][1] [ui] = 0; 787 } 788 m_dmm1WedgeTabIdx [ui] = 0; 789 #endif 790 #if NH_3D_SDC_INTRA 791 m_pbSDCFlag [ui] = false; 792 m_apSegmentDCOffset[0][ui] = 0; 793 m_apSegmentDCOffset[1][ui] = 0; 794 #endif 795 #if NH_3D_DBBP 796 m_pbDBBPFlag[ui] = false; 702 m_dmmDeltaDC[i][0] [ui] = 0; 703 m_dmmDeltaDC[i][1] [ui] = 0; 704 } 705 m_dmm1WedgeTabIdx [ui] = 0; 706 m_pbSDCFlag [ui] = false; 707 m_apSegmentDCOffset[0][ui] = 0; 708 m_apSegmentDCOffset[1][ui] = 0; 709 m_pbDBBPFlag [ui] = false; 797 710 #endif 798 711 } … … 849 762 memset( m_pbMergeFlag, 0, iSizeInBool ); 850 763 memset( m_puhMergeIndex, 0, iSizeInUchar ); 851 #if NH_3D _VSP764 #if NH_3D 852 765 memset( m_piVSPFlag, 0, sizeof( SChar ) * m_uiNumPartition ); 853 #endif854 #if NH_3D_SPIVMP855 766 memset( m_pbSPIVMPFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 856 767 #endif … … 876 787 memset( m_puhHeight, uhHeight, iSizeInUchar ); 877 788 memset( m_pbIPCMFlag, 0, iSizeInBool ); 878 #if NH_3D _ARP789 #if NH_3D 879 790 memset( m_puhARPW, 0, iSizeInUchar ); 880 #endif881 #if NH_3D_IC882 791 memset( m_pbICFlag, 0, iSizeInBool ); 883 #endif884 #if NH_3D_DMM885 792 for( Int i = 0; i < NUM_DMM; i++ ) 886 793 { … … 889 796 } 890 797 memset( m_dmm1WedgeTabIdx, 0, sizeof(UInt) * m_uiNumPartition ); 891 #endif892 #if NH_3D_SDC_INTRA893 798 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 894 799 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 895 800 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 896 #endif897 #if NH_3D_DBBP898 801 memset( m_pbDBBPFlag, 0, sizeof(Bool) * m_uiNumPartition ); 899 802 #endif … … 902 805 { 903 806 m_skipFlag[ui] = false; 904 #if NH_3D _DIS807 #if NH_3D 905 808 m_bDISFlag[ui] = false; 906 809 m_ucDISType[ui] = 0; … … 918 821 m_apiMVPNum[rpl][ui] = -1; 919 822 } 920 #if NH_3D_DIS 921 m_bDISFlag[ui] = pcCU->getDISFlag(uiPartOffset+ui); 922 m_ucDISType[ui] = pcCU->getDISType(uiPartOffset+ui); 923 #endif 924 #if NH_3D_VSP 925 m_piVSPFlag[ui] = pcCU->m_piVSPFlag[uiPartOffset+ui]; 926 m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui]; 927 #endif 928 #if NH_3D_SPIVMP 929 m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui]; 930 #endif 931 #if NH_3D_ARP 932 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 933 #endif 934 #if NH_3D_IC 935 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 936 #endif 937 #if NH_3D_DMM 938 for( Int i = 0; i < NUM_DMM; i++ ) 939 { 940 m_dmmDeltaDC[i][0] [ui] = pcCU->m_dmmDeltaDC[i][0] [uiPartOffset+ui]; 941 m_dmmDeltaDC[i][1] [ui] = pcCU->m_dmmDeltaDC[i][1] [uiPartOffset+ui]; 942 } 943 m_dmm1WedgeTabIdx [ui] = pcCU->m_dmm1WedgeTabIdx [uiPartOffset+ui]; 944 #endif 945 #if NH_3D_SDC_INTRA 823 #if NH_3D 824 m_bDISFlag [ui] = pcCU->getDISFlag(uiPartOffset+ui); 825 m_ucDISType [ui] = pcCU->getDISType(uiPartOffset+ui); 826 m_piVSPFlag [ui] = pcCU->m_piVSPFlag[uiPartOffset+ui]; 827 m_pDvInfo [ui] = pcCU->m_pDvInfo[uiPartOffset+ui]; 828 m_pbSPIVMPFlag[ui] = pcCU->m_pbSPIVMPFlag[uiPartOffset+ui]; 829 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 830 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 831 for( Int i = 0; i < NUM_DMM; i++ ) 832 { 833 m_dmmDeltaDC[i][0] [ui] = pcCU->m_dmmDeltaDC[i][0] [uiPartOffset+ui]; 834 m_dmmDeltaDC[i][1] [ui] = pcCU->m_dmmDeltaDC[i][1] [uiPartOffset+ui]; 835 } 836 m_dmm1WedgeTabIdx [ui] = pcCU->m_dmm1WedgeTabIdx [uiPartOffset+ui]; 946 837 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 947 838 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 948 839 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 949 #endif 950 #if NH_3D_DBBP 951 m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui]; 840 m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui]; 952 841 #endif 953 842 } … … 973 862 m_pCtuAboveLeft = pcCU->getCtuAboveLeft(); 974 863 m_pCtuAboveRight = pcCU->getCtuAboveRight(); 975 976 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)977 {978 m_apcCUColocated[i] = pcCU->getCUColocated(RefPicList(i));979 }980 864 } 981 865 … … 1009 893 1010 894 m_skipFlag=pcCU->getSkipFlag() + uiPart; 1011 #if NH_3D _DIS895 #if NH_3D 1012 896 m_bDISFlag = pcCU->getDISFlag() + uiPart; 1013 897 m_ucDISType = pcCU->getDISType() + uiPart; … … 1019 903 m_pePredMode=pcCU->getPredictionMode() + uiPart; 1020 904 m_CUTransquantBypass = pcCU->getCUTransquantBypass()+uiPart; 1021 #if NH_3D _NBDV905 #if NH_3D 1022 906 m_pDvInfo = pcCU->getDvInfo() + uiPart; 1023 907 #endif 1024 1025 908 m_pbMergeFlag = pcCU->getMergeFlag() + uiPart; 1026 909 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 1027 #if NH_3D _VSP910 #if NH_3D 1028 911 m_piVSPFlag = pcCU->getVSPFlag() + uiPart; 1029 #endif 1030 #if NH_3D_SPIVMP 1031 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiPart; 1032 #endif 1033 #if NH_3D_ARP 912 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiPart; 1034 913 m_puhARPW = pcCU->getARPW() + uiPart; 1035 #endif1036 #if NH_3D_IC1037 914 m_pbICFlag = pcCU->getICFlag() + uiPart; 1038 915 #endif … … 1053 930 m_explicitRdpcmMode[comp] = pcCU->getExplicitRdpcmMode(ComponentID(comp)) + uiPart; 1054 931 } 1055 #if NH_3D _DMM932 #if NH_3D 1056 933 for( Int i = 0; i < NUM_DMM; i++ ) 1057 934 { … … 1060 937 } 1061 938 m_dmm1WedgeTabIdx = pcCU->getDmm1WedgeTabIdx() + uiPart; 1062 #endif1063 #if NH_3D_SDC_INTRA1064 939 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1065 940 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1066 941 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1067 #endif1068 #if NH_3D_DBBP1069 942 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiPart; 1070 943 #endif … … 1084 957 { 1085 958 const RefPicList rpl=RefPicList(i); 1086 m_apcCUColocated[rpl] = pcCU->getCUColocated(rpl);1087 959 m_apiMVPIdx[rpl]=pcCU->getMVPIdx(rpl) + uiPart; 1088 960 m_apiMVPNum[rpl]=pcCU->getMVPNum(rpl) + uiPart; … … 1113 985 } 1114 986 1115 #if NH_3D _NBDV987 #if NH_3D 1116 988 Void TComDataCU::copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx) 1117 989 { … … 1121 993 1122 994 // Copy inter prediction info from the biggest CU 1123 #if NH_3D _NBDV995 #if NH_3D 1124 996 Void TComDataCU::copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList , Bool bNBDV ) 1125 997 #else … … 1141 1013 m_pCtuLeft = pcCU->getCtuLeft(); 1142 1014 1143 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)1144 {1145 m_apcCUColocated[i] = pcCU->getCUColocated(RefPicList(i));1146 }1147 1015 1148 1016 m_skipFlag = pcCU->getSkipFlag () + uiAbsPartIdx; 1149 #if NH_3D _DIS1017 #if NH_3D 1150 1018 m_bDISFlag = pcCU->getDISFlag () + uiAbsPartIdx; 1151 1019 m_ucDISType = pcCU->getDISType() + uiAbsPartIdx; … … 1153 1021 1154 1022 m_pePartSize = pcCU->getPartitionSize () + uiAbsPartIdx; 1155 #if NH_3D _NBDV1023 #if NH_3D 1156 1024 if(bNBDV == true) 1157 1025 { … … 1163 1031 { 1164 1032 #endif 1165 m_pePredMode = pcCU->getPredictionMode() + uiAbsPartIdx; 1166 m_ChromaQpAdj = pcCU->getChromaQpAdj() + uiAbsPartIdx; 1167 m_CUTransquantBypass = pcCU->getCUTransquantBypass() + uiAbsPartIdx; 1168 m_puhInterDir = pcCU->getInterDir () + uiAbsPartIdx; 1169 1170 m_puhDepth = pcCU->getDepth () + uiAbsPartIdx; 1171 m_puhWidth = pcCU->getWidth () + uiAbsPartIdx; 1172 m_puhHeight = pcCU->getHeight() + uiAbsPartIdx; 1173 1174 m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx; 1175 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1176 #if NH_3D_VSP 1177 m_piVSPFlag = pcCU->getVSPFlag() + uiAbsPartIdx; 1178 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1179 #endif 1180 #if NH_3D_SPIVMP 1181 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1182 #endif 1183 1184 m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx; 1185 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 1186 #if NH_3D_ARP 1187 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1188 #endif 1189 #if NH_3D_DBBP 1190 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiAbsPartIdx; 1191 #endif 1192 1193 m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx ); 1194 #if NH_3D_NBDV 1195 } 1196 #endif 1197 #if NH_3D_IC 1033 m_pePredMode = pcCU->getPredictionMode() + uiAbsPartIdx; 1034 m_ChromaQpAdj = pcCU->getChromaQpAdj() + uiAbsPartIdx; 1035 m_CUTransquantBypass = pcCU->getCUTransquantBypass() + uiAbsPartIdx; 1036 m_puhInterDir = pcCU->getInterDir () + uiAbsPartIdx; 1037 1038 m_puhDepth = pcCU->getDepth () + uiAbsPartIdx; 1039 m_puhWidth = pcCU->getWidth () + uiAbsPartIdx; 1040 m_puhHeight = pcCU->getHeight() + uiAbsPartIdx; 1041 1042 m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx; 1043 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1044 #if NH_3D 1045 m_piVSPFlag = pcCU->getVSPFlag() + uiAbsPartIdx; 1046 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1047 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1048 #endif 1049 m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx; 1050 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 1051 #if NH_3D 1052 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1053 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiAbsPartIdx; 1054 #endif 1055 1056 m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx ); 1057 #if NH_3D 1058 } 1198 1059 m_pbICFlag = pcCU->getICFlag() + uiAbsPartIdx; 1199 1060 #endif … … 1221 1082 Int sizeInChar = sizeof( SChar ) * uiNumPartition; 1222 1083 memcpy( m_skipFlag + uiOffset, pcCU->getSkipFlag(), sizeof( *m_skipFlag ) * uiNumPartition ); 1223 #if NH_3D _DIS1084 #if NH_3D 1224 1085 memcpy( m_bDISFlag + uiOffset, pcCU->getDISFlag(), sizeof( *m_bDISFlag ) * uiNumPartition ); 1225 1086 memcpy( m_ucDISType + uiOffset, pcCU->getDISType(), sizeof( *m_ucDISType ) * uiNumPartition); … … 1232 1093 memcpy( m_pbMergeFlag + uiOffset, pcCU->getMergeFlag(), iSizeInBool ); 1233 1094 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 1234 #if NH_3D _VSP1095 #if NH_3D 1235 1096 memcpy( m_piVSPFlag + uiOffset, pcCU->getVSPFlag(), sizeof( SChar ) * uiNumPartition ); 1236 1097 memcpy( m_pDvInfo + uiOffset, pcCU->getDvInfo(), sizeof( *m_pDvInfo ) * uiNumPartition ); 1237 #endif1238 #if NH_3D_SPIVMP || NH_3D_DBBP1239 1098 memcpy( m_pbSPIVMPFlag + uiOffset, pcCU->getSPIVMPFlag(), sizeof( Bool ) * uiNumPartition ); 1240 1099 #endif … … 1255 1114 memcpy( m_explicitRdpcmMode[comp] + uiOffset, pcCU->getExplicitRdpcmMode(ComponentID(comp)) , iSizeInUchar ); 1256 1115 } 1257 #if NH_3D _DMM1116 #if NH_3D 1258 1117 for( Int i = 0; i < NUM_DMM; i++ ) 1259 1118 { … … 1262 1121 } 1263 1122 memcpy( m_dmm1WedgeTabIdx + uiOffset, pcCU->getDmm1WedgeTabIdx(), sizeof(UInt) * uiNumPartition ); 1264 #endif1265 #if NH_3D_SDC_INTRA1266 1123 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), sizeof( *m_pbSDCFlag ) * uiNumPartition ); 1267 1124 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1268 1125 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1269 #endif1270 #if NH_3D_DBBP1271 1126 memcpy( m_pbDBBPFlag + uiOffset, pcCU->getDBBPFlag(), iSizeInBool ); 1272 #endif1273 #if NH_3D_ARP1274 1127 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1275 1128 #endif … … 1291 1144 memcpy( m_apiMVPIdx[rpl] + uiOffset, pcCU->getMVPIdx(rpl), iSizeInUchar ); 1292 1145 memcpy( m_apiMVPNum[rpl] + uiOffset, pcCU->getMVPNum(rpl), iSizeInUchar ); 1293 m_apcCUColocated[rpl] = pcCU->getCUColocated(rpl);1294 1146 } 1295 1147 … … 1314 1166 } 1315 1167 1316 #if NH_3D _IC1168 #if NH_3D 1317 1169 memcpy( m_pbICFlag + uiOffset, pcCU->getICFlag(), iSizeInBool ); 1318 1170 #endif … … 1338 1190 1339 1191 memcpy( pCtu->getSkipFlag() + m_absZIdxInCtu, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition ); 1340 #if NH_3D _DIS1192 #if NH_3D 1341 1193 memcpy( pCtu->getDISFlag() + m_absZIdxInCtu, m_bDISFlag, sizeof( *m_bDISFlag ) * m_uiNumPartition ); 1342 1194 memcpy( pCtu->getDISType() + m_absZIdxInCtu, m_ucDISType, sizeof( *m_ucDISType ) * m_uiNumPartition ); … … 1344 1196 1345 1197 memcpy( pCtu->getQP() + m_absZIdxInCtu, m_phQP, sizeInChar ); 1346 #if NH_3D _NBDV1198 #if NH_3D 1347 1199 memcpy( pCtu->getDvInfo() + m_absZIdxInCtu, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1348 1200 #endif … … 1354 1206 memcpy( pCtu->getMergeFlag() + m_absZIdxInCtu, m_pbMergeFlag, iSizeInBool ); 1355 1207 memcpy( pCtu->getMergeIndex() + m_absZIdxInCtu, m_puhMergeIndex, iSizeInUchar ); 1356 #if NH_3D _VSP1208 #if NH_3D 1357 1209 memcpy( pCtu->getVSPFlag() + m_absZIdxInCtu, m_piVSPFlag, sizeof( SChar ) * m_uiNumPartition ); 1358 #endif1359 #if NH_3D_DBBP1360 1210 memcpy( pCtu->getDvInfo() + m_absZIdxInCtu, m_pDvInfo, sizeof( *m_pDvInfo ) * m_uiNumPartition ); 1361 #endif1362 #if NH_3D_SPIVMP1363 1211 memcpy( pCtu->getSPIVMPFlag() + m_absZIdxInCtu, m_pbSPIVMPFlag, sizeof( Bool ) * m_uiNumPartition ); 1364 1212 #endif 1365 1213 1366 for (UInt ch=0; ch<numValidChan; ch++)1214 for (UInt ch=0; ch<numValidChan; ch++) 1367 1215 { 1368 1216 memcpy( pCtu->getIntraDir(ChannelType(ch)) + m_absZIdxInCtu, m_puhIntraDir[ch], iSizeInUchar); … … 1380 1228 } 1381 1229 1382 #if NH_3D _DMM1230 #if NH_3D 1383 1231 for( Int i = 0; i < NUM_DMM; i++ ) 1384 1232 { … … 1386 1234 memcpy( pCtu->getDmmDeltaDC( (DmmID)i, 1 ) + m_absZIdxInCtu, m_dmmDeltaDC[i][1], sizeof(Pel ) * m_uiNumPartition ); 1387 1235 } 1236 1388 1237 memcpy( pCtu->getDmm1WedgeTabIdx() + m_absZIdxInCtu, m_dmm1WedgeTabIdx, sizeof(UInt) * m_uiNumPartition ); 1389 #endif1390 #if NH_3D_SDC_INTRA1391 1238 memcpy( pCtu->getSDCFlag() + m_absZIdxInCtu, m_pbSDCFlag, sizeof(Bool) * m_uiNumPartition ); 1392 1239 memcpy( pCtu->getSDCSegmentDCOffset(0) + m_absZIdxInCtu, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1393 1240 memcpy( pCtu->getSDCSegmentDCOffset(1) + m_absZIdxInCtu, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1394 #endif1395 #if NH_3D_DBBP1396 1241 memcpy( pCtu->getDBBPFlag() + m_absZIdxInCtu, m_pbDBBPFlag, iSizeInBool ); 1397 #endif1398 #if NH_3D_ARP1399 1242 memcpy( pCtu->getARPW() + m_absZIdxInCtu, m_puhARPW, iSizeInUchar ); 1400 1243 #endif … … 1432 1275 } 1433 1276 1434 #if NH_3D _IC1277 #if NH_3D 1435 1278 memcpy( pCtu->getICFlag() + m_absZIdxInCtu, m_pbICFlag, sizeof( *m_pbICFlag ) * m_uiNumPartition ); 1436 1279 #endif 1437 1280 pCtu->getTotalBins() = m_uiTotalBins; 1438 1281 } 1439 #if H_3D_SPIVMP1440 memcpy( rpcCU->getSPIVMPFlag() + uiPartOffset, m_pbSPIVMPFlag, sizeof(Bool) * uiQNumPart );1441 #endif1442 1443 1444 1282 1445 1283 // -------------------------------------------------------------------------------------------------------------------- … … 1786 1624 Bool TComDataCU::isLosslessCoded(UInt absPartIdx) const 1787 1625 { 1788 return (getSlice()->getPPS()->getTransquantBypassEnable Flag() && getCUTransquantBypass (absPartIdx));1626 return (getSlice()->getPPS()->getTransquantBypassEnabledFlag() && getCUTransquantBypass (absPartIdx)); 1789 1627 } 1790 1628 … … 1842 1680 } 1843 1681 iLeftIntraDir = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX; 1844 #if NH_3D _DMM1682 #if NH_3D 1845 1683 mapDmmToIntraDir( iLeftIntraDir ); 1846 1684 #endif … … 1854 1692 } 1855 1693 iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX; 1856 #if NH_3D _DMM1694 #if NH_3D 1857 1695 mapDmmToIntraDir( iAboveIntraDir ); 1858 1696 #endif … … 1990 1828 return uiCtx; 1991 1829 } 1992 #if NH_3D _ARP1830 #if NH_3D 1993 1831 UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx ) 1994 1832 { … … 2001 1839 return uiCtx; 2002 1840 } 2003 #endif 2004 #if NH_3D_DBBP 1841 2005 1842 Pel* TComDataCU::getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride) 2006 1843 { … … 2016 1853 assert( !getSlice()->getIsDepth() ); 2017 1854 2018 #if H_3D_FCO2019 TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() );2020 2021 if( depthPic && depthPic->getPicYuvRec() != NULL && depthPic->getIsDepth() ) // depth first2022 {2023 depthPicYuv = depthPic->getPicYuvRec();2024 depthPicYuv->extendPicBorder();2025 2026 // get collocated depth block for current CU2027 uiDepthStride = depthPicYuv->getStride();2028 pDepthPels = depthPicYuv->getLumaAddr( getAddr(), uiAbsPartIdx );2029 }2030 else // texture first2031 #else2032 1855 { 2033 1856 DisInfo DvInfo = getDvInfo(uiAbsPartIdx); … … 2052 1875 2053 1876 Bool depthRefineFlag = false; 2054 #if NH_3D_NBDV_REF2055 1877 depthRefineFlag = m_pcSlice->getDepthRefinementFlag(); 2056 #endif // NH_3D_NBDV_REF2057 1878 2058 1879 TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV; … … 2067 1888 pDepthPels = depthPicYuv->getAddr(COMPONENT_Y) + depthPosX + depthPosY * uiDepthStride; 2068 1889 } 2069 #endif2070 1890 2071 1891 AOF( depthPicYuv != NULL ); … … 2075 1895 return pDepthPels; 2076 1896 } 2077 #endif 2078 2079 #if NH_3D_DBBP 1897 2080 1898 Void TComDataCU::setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2081 1899 { … … 2170 1988 } 2171 1989 2172 #if NH_3D _DIS1990 #if NH_3D 2173 1991 Void TComDataCU::setDISFlagSubParts( Bool bDIS, UInt uiAbsPartIdx, UInt uiDepth ) 2174 1992 { … … 2336 2154 } 2337 2155 2338 #if NH_3D _SDC_INTRA2156 #if NH_3D 2339 2157 Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt absPartIdx, UInt depth ) 2340 2158 { … … 2349 2167 UInt lumaPredMode = getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ); 2350 2168 if( lumaPredMode < NUM_INTRA_MODE ) { return true; } 2351 #if NH_3D_DMM2352 2169 if( isDmmMode( lumaPredMode ) ) { return true; } 2353 #endif2354 2170 } 2355 2171 return false; … … 2367 2183 } 2368 2184 2369 #if NH_3D _SPIVMP2185 #if NH_3D 2370 2186 Void TComDataCU::setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2371 2187 { 2372 2188 setSubPart<Bool>( bSPIVMPFlag, m_pbSPIVMPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2373 2189 } 2374 #endif 2375 2376 #if NH_3D_VSP 2190 2377 2191 Void TComDataCU::setVSPFlagSubParts( SChar iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2378 2192 { … … 2599 2413 2600 2414 // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx 2601 #if NH_3D _IC || NH_3D_VSP2415 #if NH_3D 2602 2416 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) const 2603 2417 { … … 2941 2755 ); 2942 2756 } 2943 #endif 2944 2945 #if NH_3D_VSP 2757 2946 2758 /** Add a VSP merging candidate 2947 2759 * \Inputs … … 2997 2809 predFlag[iRefListIdX] = 1; 2998 2810 mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i ); 2999 #if NH_3D_NBDV3000 2811 mvVSP[0+iRefListIdX].getMv().setIDVFlag (false); 3001 #endif3002 2812 } 3003 2813 } … … 3005 2815 3006 2816 dirVSP = (predFlag[0] | (predFlag[1] << 1)); 3007 m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true 3008 #if NH_3D_SPIVMP 3009 , false 3010 #endif 3011 ); 2817 m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true , false); 3012 2818 if ( mrgCandIdx == iCount ) 3013 2819 { … … 3019 2825 return false; 3020 2826 } 3021 #endif 3022 3023 #if NH_3D_IV_MERGE 2827 3024 2828 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ) 3025 2829 { … … 3052 2856 if(!bRemove) 3053 2857 { 3054 #if NH_3D_NBDV3055 2858 if(iLoop) // For IvMcShift candidate 3056 2859 { … … 3058 2861 tmpMV[1].getMv().setIDVFlag (false); 3059 2862 } 3060 #endif3061 2863 m_mergCands[MRG_IVSHIFT].setCand(tmpMV, tmpDir, false, false); 3062 2864 if( mrgCandIdx == iCount ) … … 3072 2874 } 3073 2875 3074 #endif3075 #if NH_3D_MLC3076 2876 /** Construct a extended list of merging candidates 3077 2877 * \param pcMvFieldNeighbours … … 3081 2881 * \param numValidMergeCand 3082 2882 */ 3083 Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 3084 #if NH_3D_VSP 3085 , Int* vspFlag 3086 #endif 3087 #if NH_3D_SPIVMP 3088 , Bool* pbSPIVMPFlag 3089 #endif 3090 , Int& numValidMergeCand 3091 ) 2883 Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag , Bool* pbSPIVMPFlag , Int& numValidMergeCand ) 3092 2884 { 3093 2885 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) … … 3095 2887 return; 3096 2888 } 3097 3098 2889 3099 2890 #if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC … … 3119 2910 extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID); 3120 2911 extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID); 3121 #if NH_3D_VSP3122 2912 vspFlag[ui] = 0; 3123 #endif3124 2913 } 3125 2914 … … 3129 2918 if (m_mergCands[i].m_bAvailable) 3130 2919 { 3131 m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt 3132 #if NH_3D_VSP 3133 , vspFlag 3134 #endif 3135 #if NH_3D_SPIVMP 3136 , pbSPIVMPFlag 3137 #endif 3138 ); 2920 m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt, vspFlag, pbSPIVMPFlag ); 3139 2921 iCount++; 3140 2922 if (iCount >= getSlice()->getMaxNumMergeCand()) … … 3229 3011 * \param numValidMergeCand 3230 3012 */ 3231 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 3232 #if NH_3D_SPIVMP 3233 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 3234 #endif 3235 , Int& numValidMergeCand, Int mrgCandIdx 3236 ) 3237 { 3238 #if NH_3D_IV_MERGE 3013 3014 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldSP, UChar* puhInterDirSP, Int& numValidMergeCand, Int mrgCandIdx ) 3015 { 3239 3016 TComMv cZeroMv; 3240 3017 TComMvField tmpMV[2]; 3241 #endif3242 3018 3243 3019 ////////////////////////////////// 3244 3020 //////// GET DISPARITIES //////// 3245 3021 ////////////////////////////////// 3246 #if NH_3D_IV_MERGE3247 3022 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 3248 3023 m_cDefaultDisInfo = cDisInfo; 3249 #elif NH_3D_VSP3250 // for xAddVspCand()3251 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);3252 #endif3253 3024 3254 3025 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) … … 3268 3039 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 3269 3040 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 3270 #if NH_3D_TEXT_MERGE3271 3041 Bool bMPIFlag = getSlice()->getMpiFlag(); 3272 3042 Int tmpDir; 3273 #endif3274 #if NH_3D_IV_MERGE || NH_3D_TEXT_MERGE3275 3043 Bool bIsDepth = getSlice()->getIsDepth(); 3276 #endif 3277 3278 #if NH_3D_IC 3044 3279 3045 Bool bICFlag = getICFlag(uiAbsPartIdx); 3280 #endif3281 #if NH_3D_ARP3282 3046 Bool bARPFlag = getARPW(uiAbsPartIdx) > 0; 3283 #endif3284 #if NH_3D_DBBP3285 3047 Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx); 3286 3048 assert(bDBBPFlag == getDBBPFlag(0)); 3287 #endif 3288 3289 #if NH_3D_NBDV 3049 3290 3050 for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 3291 3051 { … … 3293 3053 pcMFieldNeighbours[(i<<1)+1].getMv().setIDVFlag (false); 3294 3054 } 3295 #endif3296 3055 // init containers 3297 3056 for (Int i = 0; i<MRG_IVSHIFT+1; i++) … … 3310 3069 if (getAvailableFlagA1()) 3311 3070 { 3312 m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3313 #if NH_3D_VSP 3314 , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 3315 #if NH_3D_IC 3316 && !bICFlag 3317 #endif 3318 #if NH_3D_ARP 3319 && !bARPFlag 3320 #endif 3321 #if NH_3D_DBBP 3322 && !bDBBPFlag 3323 #endif 3324 ) 3325 #endif 3326 #if NH_3D_SPIVMP 3327 , false 3328 #endif 3329 ); 3071 m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 && !bICFlag && !bARPFlag&& !bDBBPFlag), false ); 3330 3072 m_numSpatialCands++; 3331 3073 } … … 3334 3076 if (getAvailableFlagB1()) 3335 3077 { 3336 m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3337 #if NH_3D_VSP 3338 , false 3339 #endif 3340 #if NH_3D_SPIVMP 3341 , false 3342 #endif 3343 ); 3078 m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false ); 3344 3079 m_numSpatialCands++; 3345 3080 } … … 3348 3083 if (getAvailableFlagB0()) 3349 3084 { 3350 m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3351 #if NH_3D_VSP 3352 , false 3353 #endif 3354 #if NH_3D_SPIVMP 3355 , false 3356 #endif 3357 ); 3085 m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false ); 3358 3086 m_numSpatialCands++; 3359 3087 } … … 3362 3090 if (getAvailableFlagA0()) 3363 3091 { 3364 m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3365 #if NH_3D_VSP 3366 , false 3367 #endif 3368 #if NH_3D_SPIVMP 3369 , false 3370 #endif 3371 ); 3092 m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false ); 3372 3093 m_numSpatialCands++; 3373 3094 } … … 3376 3097 if (getAvailableFlagB2()) 3377 3098 { 3378 m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3379 #if NH_3D_VSP 3380 , false 3381 #endif 3382 #if NH_3D_SPIVMP 3383 , false 3384 #endif 3385 ); 3099 m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands], false, false ); 3386 3100 m_numSpatialCands++; 3387 3101 } 3388 3102 3389 3390 #if NH_3D_TEXT_MERGE3391 3103 3392 3104 ///////////////////////////////////////////// … … 3404 3116 3405 3117 TComPic * pcTexPic = m_pcSlice->getTexturePic(); 3406 #if H_3D_FCO3407 if (pcTexPic && pcTexPic->getReconMark())3408 {3409 #endif3410 3118 TComPicYuv* pcTexRec = pcTexPic->getPicYuvRec (); 3411 3119 UInt uiPartAddr; … … 3439 3147 3440 3148 Int iTexPosX, iTexPosY; 3441 #if NH_3D_INTEGER_MV_DEPTH3442 3149 const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 3443 #endif 3150 3444 3151 Int iCenterPosX = iCurrPosX + ( ( iWidth / iPUWidth ) >> 1 ) * iPUWidth + ( iPUWidth >> 1 ); 3445 3152 Int iCenterPosY = iCurrPosY + ( ( iHeight / iPUHeight ) >> 1 ) * iPUHeight + (iPUHeight >> 1); … … 3474 3181 { 3475 3182 bSPIVMPFlag = true; 3476 #if NH_3D_INTEGER_MV_DEPTH3477 3183 TComMv cMv = cDefaultMvField.getMv() + cMvRounding; 3478 3184 cMv >>= 2; 3479 #else3480 TComMv cMv = cDefaultMvField.getMv();3481 #endif3482 3185 cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ; 3483 3186 break; … … 3516 3219 if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) ) 3517 3220 { 3518 #if NH_3D_INTEGER_MV_DEPTH3519 3221 TComMv cMv = cTexMvField.getMv() + cMvRounding; 3520 3222 cMv >>=2; 3521 #else3522 TComMv cMv = cTexMvField.getMv();3523 #endif3524 3223 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef); 3525 3224 } … … 3541 3240 } 3542 3241 } 3543 #if H_3D_FCO 3544 } 3545 #endif 3242 3546 3243 if( tmpDir != 0 ) 3547 3244 { … … 3568 3265 } 3569 3266 } 3570 #endif 3571 3572 #if NH_3D_IV_MERGE 3267 3573 3268 ///////////////////////////////////////////////////////////////// 3574 3269 //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC Candidates ///// … … 3588 3283 if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1) 3589 3284 { 3590 #if NH_3D_IC3591 3285 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag ); 3592 #else3593 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, false );3594 #endif3595 3286 } 3596 3287 … … 3648 3339 spiMvpFlag = true; 3649 3340 } 3650 #if NH_3D_DBBP3651 3341 spiMvpFlag &= !bDBBPFlag; 3652 #endif3653 3342 3654 3343 m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, spiMvpFlag); … … 3667 3356 return; 3668 3357 } 3669 #endif 3358 3670 3359 3671 3360 iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable; 3672 3361 3673 #if NH_3D_VSP3674 3362 ///////////////////////////////////////////////// 3675 3363 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// … … 3677 3365 if (iCount<getSlice()->getMaxNumMergeCand()) 3678 3366 { 3679 if ( 3680 (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) && 3681 #if NH_3D_IC 3682 !bICFlag && 3683 #endif 3684 #if NH_3D_ARP 3685 !bARPFlag && 3686 #endif 3687 #if NH_3D 3367 if ( ( !getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0) ) && 3368 !bICFlag && 3369 !bARPFlag && 3688 3370 (nPSW + nPSH > 12) && 3689 #endif 3690 #if NH_3D_DBBP 3691 !bDBBPFlag && 3692 #endif 3371 !bDBBPFlag && 3693 3372 xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) ) 3694 3373 { … … 3702 3381 } 3703 3382 } 3704 #endif3705 3383 3706 3384 iCount += m_mergCands[MRG_B0].m_bAvailable; 3707 3385 3708 #if NH_3D_IV_MERGE3709 3386 ///////////////////////////////////////////// 3710 3387 //////// INTER VIEW DISP COMP (IvDC) //////// … … 3740 3417 if(!bRemoveSpa) 3741 3418 { 3742 #if NH_3D_NBDV3743 3419 tmpMV[0].getMv().setIDVFlag (false); 3744 3420 tmpMV[1].getMv().setIDVFlag (false); 3745 #endif3746 3421 m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false); 3747 3422 … … 3757 3432 } 3758 3433 } 3759 #endif // H_3D_IV_MERGE 3434 3760 3435 3761 3436 iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable; 3762 3437 3763 #if NH_3D_IV_MERGE3764 3438 //////////////////////////////////////////////////// 3765 3439 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// … … 3777 3451 } 3778 3452 } 3779 #endif3780 3453 } 3781 3454 #endif 3782 3455 3783 3456 //! Construct a list of merging candidates 3784 #if NH_3D 3457 3458 3459 #if MCTS_ENC_CHECK 3460 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx ) 3461 #else 3785 3462 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3786 #else 3787 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) const 3463 #endif 3464 #if !NH_3D 3465 const 3788 3466 #endif 3789 3467 { 3790 3468 UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx; 3791 #if NH_3D _MLC3469 #if NH_3D 3792 3470 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ]; 3793 3471 #else … … 3823 3501 if ( isAvailableA1 ) 3824 3502 { 3825 #if NH_3D _MLC3503 #if NH_3D 3826 3504 m_bAvailableFlagA1 = 1; 3827 3505 #endif … … 3837 3515 if ( mrgCandIdx == iCount ) 3838 3516 { 3517 #if MCTS_ENC_CHECK 3518 numSpatialMergeCandidates = iCount + 1; 3519 #endif 3839 3520 return; 3840 3521 } … … 3845 3526 if (iCount == getSlice()->getMaxNumMergeCand()) 3846 3527 { 3528 #if MCTS_ENC_CHECK 3529 numSpatialMergeCandidates = iCount; 3530 #endif 3847 3531 return; 3848 3532 } … … 3858 3542 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 3859 3543 { 3860 #if NH_3D _MLC3544 #if NH_3D 3861 3545 m_bAvailableFlagB1 = 1; 3862 3546 #endif … … 3872 3556 if ( mrgCandIdx == iCount ) 3873 3557 { 3558 #if MCTS_ENC_CHECK 3559 numSpatialMergeCandidates = iCount + 1; 3560 #endif 3874 3561 return; 3875 3562 } … … 3879 3566 if (iCount == getSlice()->getMaxNumMergeCand()) 3880 3567 { 3568 #if MCTS_ENC_CHECK 3569 numSpatialMergeCandidates = iCount; 3570 #endif 3881 3571 return; 3882 3572 } … … 3892 3582 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 3893 3583 { 3894 #if NH_3D _MLC3584 #if NH_3D 3895 3585 m_bAvailableFlagB0 = 1; 3896 3586 #endif … … 3906 3596 if ( mrgCandIdx == iCount ) 3907 3597 { 3598 #if MCTS_ENC_CHECK 3599 numSpatialMergeCandidates = iCount + 1; 3600 #endif 3908 3601 return; 3909 3602 } … … 3913 3606 if (iCount == getSlice()->getMaxNumMergeCand()) 3914 3607 { 3608 #if MCTS_ENC_CHECK 3609 numSpatialMergeCandidates = iCount; 3610 #endif 3915 3611 return; 3916 3612 } … … 3926 3622 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 3927 3623 { 3928 #if NH_3D _MLC3624 #if NH_3D 3929 3625 m_bAvailableFlagA0 = 1; 3930 3626 #endif … … 3940 3636 if ( mrgCandIdx == iCount ) 3941 3637 { 3638 #if MCTS_ENC_CHECK 3639 numSpatialMergeCandidates = iCount + 1; 3640 #endif 3942 3641 return; 3943 3642 } … … 3947 3646 if (iCount == getSlice()->getMaxNumMergeCand()) 3948 3647 { 3648 #if MCTS_ENC_CHECK 3649 numSpatialMergeCandidates = iCount; 3650 #endif 3949 3651 return; 3950 3652 } … … 3963 3665 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) ) 3964 3666 { 3965 #if NH_3D _MLC3667 #if NH_3D 3966 3668 m_bAvailableFlagB2 = 1; 3967 3669 #endif … … 3977 3679 if ( mrgCandIdx == iCount ) 3978 3680 { 3681 #if MCTS_ENC_CHECK 3682 numSpatialMergeCandidates = iCount + 1; 3683 #endif 3979 3684 return; 3980 3685 } … … 3985 3690 if (iCount == getSlice()->getMaxNumMergeCand()) 3986 3691 { 3692 #if MCTS_ENC_CHECK 3693 numSpatialMergeCandidates = iCount; 3694 #endif 3987 3695 return; 3988 3696 } 3989 3697 3698 #if MCTS_ENC_CHECK 3699 numSpatialMergeCandidates = iCount; 3700 #endif 3990 3701 if ( getSlice()->getEnableTMVPFlag() ) 3991 3702 { … … 4047 3758 if ( getSlice()->isInterB() ) 4048 3759 { 4049 #if NH_3D _TMVP3760 #if NH_3D 4050 3761 iRefIdx = 0; 4051 3762 #endif … … 4066 3777 puhInterDirNeighbours[uiArrayAddr] = dir; 4067 3778 abCandIsInter[uiArrayAddr] = true; 4068 #if NH_3D _NBDV3779 #if NH_3D 4069 3780 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 4070 3781 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); … … 4087 3798 UInt uiCutoff = uiArrayAddr; 4088 3799 4089 #if NH_3D _MLC3800 #if NH_3D 4090 3801 if ( getSlice()->isInterB() && iCount<5) 4091 3802 #else … … 4257 3968 if (refIdx < 0) 4258 3969 { 3970 #if MCTS_ENC_CHECK 3971 pInfo->numSpatialMVPCandidates = 0; 3972 #endif 4259 3973 return; 4260 3974 } … … 4329 4043 } 4330 4044 4045 #if MCTS_ENC_CHECK 4046 pInfo->numSpatialMVPCandidates = pInfo->iN; 4047 #endif 4331 4048 if (pInfo->iN < AMVP_MAX_NUM_CANDS && getSlice()->getEnableTMVPFlag() ) 4332 4049 { … … 4334 4051 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 4335 4052 const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight(); 4336 #if NH_3D _TMVP4053 #if NH_3D 4337 4054 Int refIdx_Col = refIdx; 4338 4055 #else … … 4372 4089 } 4373 4090 } 4374 #if NH_3D _TMVP4091 #if NH_3D 4375 4092 if ( ctuRsAddr >= 0 && xGetColMVP( eRefPicList, ctuRsAddr, absPartAddr, cColMv, refIdx_Col , 0 ) ) 4376 4093 #else … … 4384 4101 UInt uiPartIdxCenter; 4385 4102 xDeriveCenterIdx( partIdx, uiPartIdxCenter ); 4386 #if NH_3D _TMVP4103 #if NH_3D 4387 4104 if (xGetColMVP( eRefPicList, getCtuRsAddr(), uiPartIdxCenter, cColMv, refIdx_Col , 0 )) 4388 4105 #else … … 4411 4128 UInt partAddr; 4412 4129 4413 #if NH_3D _DBBP4130 #if NH_3D 4414 4131 if( getDBBPFlag(0) ) 4415 4132 { … … 4431 4148 const TComSPS &sps=*(m_pcSlice->getSPS()); 4432 4149 Int iMvShift = 2; 4433 #if NH_3D _INTEGER_MV_DEPTH4150 #if NH_3D 4434 4151 if( getSlice()->getIsDepth() ) 4435 4152 iMvShift = 0; … … 4663 4380 } 4664 4381 4665 #if NH_3D _TMVP4382 #if NH_3D 4666 4383 Bool TComDataCU::xGetColMVP( const RefPicList eRefPicList, const Int ctuRsAddr, const Int partUnitIdx, TComMv& rcMv, Int& refIdx, Bool bMRG ) const 4667 4384 #else … … 4673 4390 // use coldir. 4674 4391 const TComPic * const pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 4392 #if REDUCED_ENCODER_MEMORY 4393 if (!pColPic->getPicSym()->hasDPBPerCtuData()) 4394 { 4395 return false; 4396 } 4397 const TComPicSym::DPBPerCtuData * const pColDpbCtu = &(pColPic->getPicSym()->getDPBPerCtuData(ctuRsAddr)); 4398 const TComSlice * const pColSlice = pColDpbCtu->getSlice(); 4399 if(pColDpbCtu->getPartitionSize(partUnitIdx)==NUMBER_OF_PART_SIZES) 4400 #else 4675 4401 const TComDataCU * const pColCtu = pColPic->getCtu( ctuRsAddr ); 4676 4402 if(pColCtu->getPic()==0 || pColCtu->getPartitionSize(partUnitIdx)==NUMBER_OF_PART_SIZES) 4403 #endif 4677 4404 { 4678 4405 return false; 4679 4406 } 4680 4407 4408 #if REDUCED_ENCODER_MEMORY 4409 if (!pColDpbCtu->isInter(absPartAddr)) 4410 #else 4681 4411 if (!pColCtu->isInter(absPartAddr)) 4412 #endif 4682 4413 { 4683 4414 return false; … … 4685 4416 4686 4417 RefPicList eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(getSlice()->getColFromL0Flag()); 4418 #if REDUCED_ENCODER_MEMORY 4419 Int iColRefIdx = pColDpbCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 4420 #else 4687 4421 Int iColRefIdx = pColCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 4422 #endif 4688 4423 4689 4424 if (iColRefIdx < 0 ) 4690 4425 { 4691 4426 eColRefPicList = RefPicList(1 - eColRefPicList); 4427 #if REDUCED_ENCODER_MEMORY 4428 iColRefIdx = pColDpbCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 4429 #else 4692 4430 iColRefIdx = pColCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 4431 #endif 4693 4432 4694 4433 if (iColRefIdx < 0 ) … … 4698 4437 } 4699 4438 4700 #if NH_3D _TMVP4439 #if NH_3D 4701 4440 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, refIdx)->getIsLongTerm(); 4702 4441 #else 4703 4442 const Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, refIdx)->getIsLongTerm(); 4704 4443 #endif 4444 #if REDUCED_ENCODER_MEMORY 4445 const Bool bIsColRefLongTerm = pColSlice->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx); 4446 #else 4705 4447 const Bool bIsColRefLongTerm = pColCtu->getSlice()->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx); 4706 4448 #endif 4707 4449 if ( bIsCurrRefLongTerm != bIsColRefLongTerm ) 4708 4450 { 4709 #if NH_3D _TMVP4451 #if NH_3D 4710 4452 Int iAlterRefIdx = m_pcSlice->getAlterRefIdx(eRefPicList); 4711 4453 if(bMRG && iAlterRefIdx > 0) … … 4719 4461 #endif 4720 4462 return false; 4721 #if NH_3D _TMVP4463 #if NH_3D 4722 4464 } 4723 4465 #endif 4724 4466 } 4725 4467 // Scale the vector. 4468 #if REDUCED_ENCODER_MEMORY 4469 const TComMv &cColMv = pColDpbCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr); 4470 #else 4726 4471 const TComMv &cColMv = pColCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr); 4727 4728 #if NH_3D_TMVP 4472 #endif 4473 4474 #if NH_3D 4729 4475 if ( bIsCurrRefLongTerm || bIsColRefLongTerm ) 4730 4476 #else … … 4732 4478 #endif 4733 4479 { 4734 #if NH_3D _TMVP4480 #if NH_3D 4735 4481 const Int iCurrViewId = m_pcSlice->getViewId (); 4736 4482 const Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, refIdx)->getViewId (); … … 4750 4496 #endif 4751 4497 rcMv = cColMv; 4752 #if NH_3D _TMVP4498 #if NH_3D 4753 4499 } 4754 4500 #endif … … 4757 4503 { 4758 4504 const Int currPOC = m_pcSlice->getPOC(); 4505 #if REDUCED_ENCODER_MEMORY 4506 const Int colPOC = pColSlice->getPOC(); 4507 const Int colRefPOC = pColSlice->getRefPOC(eColRefPicList, iColRefIdx); 4508 #else 4759 4509 const Int colPOC = pColCtu->getSlice()->getPOC(); 4760 4510 const Int colRefPOC = pColCtu->getSlice()->getRefPOC(eColRefPicList, iColRefIdx); 4511 #endif 4761 4512 const Int currRefPOC = m_pcSlice->getRefPic(eRefPicList, refIdx)->getPOC(); 4762 4513 const Int scale = xGetDistScaleFactor(currPOC, currRefPOC, colPOC, colRefPOC); … … 4811 4562 { 4812 4563 Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize; 4564 if (scaleFactor > 0) 4565 { 4566 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 4567 { 4568 m_acCUMvField[i].compress(m_pePredMode, scaleFactor); 4569 } 4570 } 4813 4571 #else 4814 4572 Void TComDataCU::compressMV() 4815 4573 { 4574 #if REDUCED_ENCODER_MEMORY 4575 const Int scaleFactor = std::max<Int>(1,4 * AMVP_DECIMATION_FACTOR / m_unitSize); 4576 TComPicSym &picSym=*(getPic()->getPicSym()); 4577 TComPicSym::DPBPerCtuData &dpbForCtu=picSym.getDPBPerCtuData(getCtuRsAddr()); 4578 4579 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 4580 { 4581 dpbForCtu.m_CUMvField[i].compress(dpbForCtu.m_pePredMode, m_pePredMode, scaleFactor,m_acCUMvField[i]); 4582 memcpy(dpbForCtu.m_pePartSize, m_pePartSize, sizeof(*m_pePartSize)*m_uiNumPartition); 4583 dpbForCtu.m_pSlice = getSlice(); 4584 } 4585 #else 4816 4586 Int scaleFactor = 4 * AMVP_DECIMATION_FACTOR / m_unitSize; 4817 #endif4818 4587 if (scaleFactor > 0) 4819 4588 { … … 4823 4592 } 4824 4593 } 4594 #endif 4595 #endif 4825 4596 } 4826 4597 #if NH_3D … … 4867 4638 4868 4639 UInt uiDirMode = getIntraDir(toChannelType(compID), uiAbsPartIdx); 4869 #if NH_3D _DMM4640 #if NH_3D 4870 4641 mapDmmToIntraDir( uiDirMode ); 4871 4642 #endif … … 4876 4647 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 4877 4648 uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU)); 4878 #if NH_3D _DMM4649 #if NH_3D 4879 4650 mapDmmToIntraDir( uiDirMode ); 4880 4651 #endif … … 4901 4672 } 4902 4673 } 4674 4675 #if MCTS_ENC_CHECK 4676 Bool TComDataCU::isLastColumnCTUInTile() const 4677 { 4678 UInt currentTileIdx = this->getPic()->getPicSym()->getTileIdxMap(this->getCtuRsAddr()); 4679 TComTile *pCurrentTile = m_pcPic->getPicSym()->getTComTile(currentTileIdx); 4680 UInt frameWidthInCtus = m_pcPic->getPicSym()->getFrameWidthInCtus(); 4681 UInt rightEdgeCTUPosInCurrentTile = pCurrentTile->getRightEdgePosInCtus(); 4682 UInt ctuXPosInCtus = this->getCtuRsAddr() % frameWidthInCtus; 4683 4684 return (rightEdgeCTUPosInCurrentTile == ctuXPosInCtus); 4685 } 4686 #endif 4903 4687 4904 4688 #if NH_3D_VSO … … 4910 4694 #endif 4911 4695 4912 #if NH_3D _IV_MERGE4696 #if NH_3D 4913 4697 Void TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 4914 4698 { … … 4928 4712 } 4929 4713 } 4930 #endif 4931 4932 #if NH_3D_DIS 4714 4933 4715 Bool TComDataCU::getNeighDepth ( UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index ) 4934 4716 { … … 4988 4770 return bDepAvail; 4989 4771 } 4990 #endif 4991 #if NH_3D_NBDV 4992 //Notes from QC: 4993 //TBD#1: DoNBDV related contributions are just partially integrated under the marco of NH_3D_NBDV_REF, remove this comment once DoNBDV and BVSP are done 4994 //TBD#2: set of DvMCP values need to be done as part of inter-view motion prediction process. Remove this comment once merge related integration is done 4995 //To be checked: Parallel Merge features for NBDV, related to DV_DERIVATION_PARALLEL_B0096 and LGE_IVMP_PARALLEL_MERGE_B0136 are not integrated. The need of these features due to the adoption of CU-based NBDV is not clear. We need confirmation on this, especially by proponents 4996 Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo 4997 #if NH_3D_NBDV_REF 4998 , Bool bDepthRefine 4999 #endif 5000 ) 4772 4773 Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo, Bool bDepthRefine ) 5001 4774 { 5002 4775 //// ******* Init variables ******* ///// … … 5018 4791 } 5019 4792 } 5020 #if NH_3D_NBDV_REF 4793 5021 4794 if( !m_pcSlice->getDepthRefinementFlag( ) ) 5022 4795 { 5023 4796 bDepthRefine = false; 5024 4797 } 5025 #endif 4798 5026 4799 // Get Positions 5027 4800 PartSize eCUMode = getPartitionSize( uiPartAddr ); … … 5068 4841 pDInfo->m_aVIdxCan = iTargetViewIdx; 5069 4842 5070 #if NH_3D_NBDV_REF5071 4843 TComPic* picDepth = NULL; 5072 #if H_3D_FCO5073 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() );5074 if ( picDepth->getPicYuvRec() != NULL )5075 {5076 cColMv.setZero();5077 }5078 else // Go back with virtual depth5079 {5080 picDepth = getSlice()->getIvPic( true, iTargetViewIdx );5081 }5082 5083 assert(picDepth != NULL);5084 #else5085 4844 picDepth = getSlice()->getIvPic( true, iTargetViewIdx ); 5086 #endif5087 4845 if (picDepth && bDepthRefine) 5088 4846 { … … 5090 4848 } 5091 4849 pDInfo->m_acDoNBDV = cColMv; 5092 #endif //NH_3D_NBDV_REF5093 4850 return; 5094 4851 } … … 5103 4860 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 5104 4861 bCheckMcpDv = true; 5105 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT 5106 #if NH_3D_NBDV_REF 5107 , bDepthRefine 5108 #endif 5109 ) ) 4862 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT, bDepthRefine ) ) 5110 4863 return; 5111 4864 … … 5115 4868 { 5116 4869 bCheckMcpDv = ( ( getCtuRsAddr() - pcTmpCU->getCtuRsAddr() ) == 0); 5117 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE 5118 #if NH_3D_NBDV_REF 5119 , bDepthRefine 5120 #endif 5121 ) ) 4870 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE , bDepthRefine ) ) 5122 4871 return; 5123 4872 } … … 5135 4884 pDInfo->m_acNBDV = cDispVec; 5136 4885 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 5137 #if NH_3D_NBDV_REF5138 #if H_3D_FCO5139 TComPic* picDepth = NULL;5140 5141 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() );5142 if ( picDepth->getPicYuvRec() != NULL )5143 {5144 cDispVec.setZero();5145 }5146 else // Go back with virtual depth5147 {5148 picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan );5149 }5150 5151 assert(picDepth != NULL);5152 #else5153 4886 TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); 5154 #endif5155 4887 5156 4888 if (picDepth && bDepthRefine) … … 5159 4891 } 5160 4892 pDInfo->m_acDoNBDV = cDispVec; 5161 #endif5162 4893 return; 5163 4894 } … … 5173 4904 pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx(); 5174 4905 5175 #if NH_3D_NBDV_REF5176 4906 TComPic* picDepth = NULL; 5177 #if H_3D_FCO5178 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() );5179 if ( picDepth->getPicYuvRec() != NULL )5180 {5181 defaultDV.setZero();5182 }5183 else // Go back with virtual depth5184 {5185 picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx());5186 }5187 5188 assert(picDepth != NULL);5189 #else5190 4907 picDepth = getSlice()->getIvPic( true, getSlice()->getDefaultRefViewIdx()); 5191 #endif5192 4908 if (picDepth && bDepthRefine) 5193 4909 { … … 5195 4911 } 5196 4912 pDInfo->m_acDoNBDV = defaultDV; 5197 #endif 5198 } 5199 } 5200 5201 #if NH_3D_NBDV_REF 4913 } 4914 } 4915 5202 4916 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iBlkWidth, Int iBlkHeight, Int* aiShiftLUT ) 5203 4917 { … … 5241 4955 } 5242 4956 } 5243 #endif //NH_3D_NBDV_REF 5244 5245 5246 Bool TComDataCU::xCheckSpatialNBDV( const TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paIDVInfo, UInt uiMvpDvPos 5247 #if NH_3D_NBDV_REF 5248 , Bool bDepthRefine 5249 #endif 5250 ) 4957 4958 4959 4960 Bool TComDataCU::xCheckSpatialNBDV( const TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paIDVInfo, UInt uiMvpDvPos, Bool bDepthRefine ) 5251 4961 { 5252 4962 if( pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) … … 5266 4976 pNbDvInfo->m_acNBDV = cMvPred; 5267 4977 pNbDvInfo->m_aVIdxCan = refViewIdx; 5268 #if NH_3D_NBDV_REF 4978 5269 4979 TComPic* picDepth = NULL; 5270 4980 assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); 5271 #if H_3D_FCO5272 picDepth = getSlice()->getIvPic(true, getSlice()->getViewIndex() );5273 if ( picDepth->getPicYuvRec() != NULL )5274 {5275 cMvPred.setZero();5276 }5277 else// Go back with virtual depth5278 {5279 picDepth = getSlice()->getIvPic (true, refViewIdx );5280 }5281 assert(picDepth != NULL);5282 #else5283 4981 picDepth = getSlice()->getIvPic (true, refViewIdx ); 5284 #endif5285 4982 UInt uiPartIdx = 0; //Notes from MTK: Please confirm that using 0 as partition index and partition address is correct for CU-level DoNBDV 5286 4983 UInt uiPartAddr = 0; //QC: confirmed … … 5291 4988 } 5292 4989 pNbDvInfo->m_acDoNBDV = cMvPred; 5293 #endif5294 4990 return true; 5295 4991 } … … 5355 5051 } 5356 5052 5357 5358 5053 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ) 5359 5054 { 5360 #if NH_3D_VSP // bug fix5361 5055 UInt uiCurrPartNumb = m_pcPic->getNumPartitionsInCtu() >> (uiDepth << 1); 5362 5056 assert(m_pcPic->getNumPartitionsInCtu() ==m_pcPic->getNumPartInCtuWidth()*m_pcPic->getNumPartInCtuHeight()); 5363 5057 5364 #else5365 UInt uiCurrPartNumb = m_pcPic->getNumPartInCtuWidth() >> (uiDepth << 1);5366 #endif5367 5058 for (UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 5368 5059 { … … 5370 5061 } 5371 5062 } 5372 #if NH_3D_VSP || NH_3D_DBBP 5063 5373 5064 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ) 5374 5065 { 5375 5066 setSubPartT<DisInfo>( cDvInfo, m_pDvInfo, uiAbsPartIdx, uiDepth, uiPUIdx ); 5376 5067 } 5377 #endif5378 5068 5379 5069 Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) … … 5449 5139 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 5450 5140 5451 Bool depthRefineFlag = false; 5452 #if NH_3D_NBDV_REF 5453 depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 5454 #endif // NH_3D_NBDV_REF 5141 Bool depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 5455 5142 5456 5143 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; … … 5506 5193 #endif 5507 5194 5508 #if NH_3D _SPIVMP5195 #if NH_3D 5509 5196 Void TComDataCU::getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight) 5510 5197 { … … 5555 5242 } 5556 5243 } 5557 #endif 5558 5559 #if NH_3D_IV_MERGE 5560 Bool 5561 TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth 5562 #if NH_3D_SPIVMP 5563 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 5564 #endif 5565 , Bool bICFlag 5566 ) 5244 5245 Bool TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth , TComMvField* pcMvFieldSP, UChar* puhInterDirSP, Bool bICFlag ) 5567 5246 { 5568 5247 TComSlice* pcSlice = getSlice (); … … 5581 5260 pcBaseRec->getTopLeftSamplePos( getCtuRsAddr(), getZorderIdxInCtu() + uiPartAddr, iCurrPosX, iCurrPosY ); 5582 5261 5583 #if !NH_3D_SPIVMP 5584 iCurrPosX += ( iWidth >> 1 ); 5585 iCurrPosY += ( iHeight >> 1 ); 5586 #endif 5587 5588 Bool depthRefineFlag = false; 5589 #if NH_3D_NBDV_REF 5590 depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 5591 #endif // NH_3D_NBDV_REF 5262 Bool depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 5592 5263 5593 5264 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; … … 5598 5269 5599 5270 Bool abPdmAvailable[8] = {false, false, false, false, false, false, false, false}; 5600 #if NH_3D_NBDV 5271 5601 5272 for( Int i = 0; i < 8; i++) 5602 5273 { 5603 5274 pacPdmMv[i].setIDVFlag (false); 5604 5275 } 5605 #endif5606 5276 5607 5277 if(!bICFlag) 5608 5278 { 5609 5610 #if NH_3D_SPIVMP5611 5279 //////////////////////////////// 5612 5280 //////////sub-PU IvMC/////////// … … 5614 5282 if(!m_pcSlice->getIsDepth()) 5615 5283 { 5616 #if NH_3D_DBBP5617 5284 if (!getDBBPFlag(0)) 5618 #else5619 if (1)5620 #endif5621 5285 { 5622 5286 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; … … 5678 5342 abPdmAvailable[ uiCurrRefListId ] = true; 5679 5343 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 5680 #if NH_3D_NBDV5681 #if NH_3D_IV_MERGE5682 5344 if( !bIsDepth ) 5683 5345 { 5684 #endif5685 5346 cMv.setIDVFlag (true); 5686 5347 cMv.setIDVHor (cDv.getHor()); 5687 5348 cMv.setIDVVer (cDv.getVer()); 5688 5349 cMv.setIDVVId (iViewIndex); 5689 #if NH_3D_IV_MERGE5690 5350 } 5691 #endif5692 #endif5693 5351 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 5694 5352 pacPdmMv [ uiCurrRefListId ] = cMv; … … 5778 5436 iCurrPosY += ( iHeight >> 1 ); 5779 5437 } 5780 #endif 5438 5781 5439 5782 5440 //////////////////////////////// … … 5784 5442 //////////////////////////////// 5785 5443 5786 #if NH_3D_SPIVMP5787 5444 if(m_pcSlice->getIsDepth()) 5788 5445 { … … 5790 5447 iCurrPosY += ( iHeight >> 1 ); 5791 5448 } 5792 #if NH_3D_DBBP 5449 5793 5450 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5794 #else5795 for(Int iLoopCan = ( m_pcSlice->getIsDepth() ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)5796 #endif5797 #else5798 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)5799 #endif5800 5451 { 5801 5452 // iLoopCan == 0 --> IvMC … … 5839 5490 abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true; 5840 5491 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 5841 #if NH_3D_NBDV5842 #if NH_3D_IV_MERGE5843 5492 if( !bIsDepth ) 5844 5493 { 5845 #endif5846 5494 cMv.setIDVFlag (true); 5847 5495 cMv.setIDVHor (cDv.getHor()); 5848 5496 cMv.setIDVVer (cDv.getVer()); 5849 5497 cMv.setIDVVId (iViewIndex); 5850 #if NH_3D_IV_MERGE5851 5498 } 5852 #endif5853 #endif5854 5499 paiPdmRefIdx [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx; 5855 5500 pacPdmMv [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv; … … 5864 5509 } 5865 5510 } 5866 #if NH_3D_SPIVMP5867 #if NH_3D_DBBP5868 5511 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5869 #else5870 for(Int iLoopCan = ( m_pcSlice->getIsDepth() ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)5871 #endif5872 #else5873 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)5874 #endif5875 5512 { 5876 5513 availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0); … … 5898 5535 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 5899 5536 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 5900 #if NH_3D_NBDV_REF5901 5537 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 5902 #endif5903 5538 cMv.setHor( cMv.getHor() + ioffsetDV ); 5904 #if NH_3D_IV_MERGE5905 5539 if( bIsDepth ) 5906 5540 { 5907 5541 cMv.setHor((cMv.getHor()+2)>>2); 5908 5542 } 5909 #endif5910 5543 cMv.setVer( 0 ); 5911 5544 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; … … 5922 5555 return false; 5923 5556 } 5924 #endif 5925 #if NH_3D_ARP 5557 5926 5558 Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ) 5927 5559 { 5928 5560 setSubPart<UChar>( w, m_puhARPW, uiAbsPartIdx, uiDepth, 0 ); 5929 5561 } 5930 #endif 5931 5932 #if NH_3D_IC 5562 5933 5563 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 5934 5564 { … … 5983 5613 return false; 5984 5614 } 5985 #endif 5986 #if NH_3D_DMM 5615 5987 5616 Void TComDataCU::setDmm1WedgeTabIdxSubParts( UInt tabIdx, UInt uiAbsPartIdx, UInt uiDepth ) 5988 5617 { … … 5990 5619 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm1WedgeTabIdx[uiAbsPartIdx+ui] = tabIdx; } 5991 5620 } 5992 #endif 5993 5994 #if NH_3D_VSP 5621 5995 5622 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize ) 5996 5623 { … … 5998 5625 Int depthRefViewIdx = pcCU->getDvInfo(partAddr).m_aVIdxCan; 5999 5626 6000 #if H_3D_FCO6001 TComPic* pRefPicBaseDepth = 0;6002 Bool bIsCurrDepthCoded = false;6003 pRefPicBaseDepth = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );6004 if ( pRefPicBaseDepth->getPicYuvRec() != NULL )6005 {6006 bIsCurrDepthCoded = true;6007 }6008 else6009 {6010 pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );6011 }6012 #else6013 5627 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 6014 #endif6015 5628 assert(pRefPicBaseDepth != NULL); 6016 5629 TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); … … 6032 5645 TComMv cDv = pcCU->getDvInfo(partAddr).m_acNBDV; 6033 5646 pcCU->clipMv(cDv); 6034 6035 #if H_3D_FCO6036 if ( bIsCurrDepthCoded )6037 {6038 cDv.setZero();6039 }6040 #endif6041 5647 6042 5648 // fetch virtual depth map & convert depth to motion vector, which are stored in the motion memory
Note: See TracChangeset for help on using the changeset viewer.