Changeset 1279 in 3DVCSoftware for branches/HTM-14.1-update-dev1/source/Lib/TLibCommon
- Timestamp:
- 15 Jul 2015, 14:57:32 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1
-
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/CommonDef.h
r1200 r1279 363 363 #endif 364 364 365 #if H_3D_IV_MERGE365 #if NH_3D_MLC || NH_3D_ARP 366 366 #define MRG_MAX_NUM_CANDS_MEM (MRG_MAX_NUM_CANDS+1) // one extra for inter-view motion prediction 367 367 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/ContextTables.h
r1258 r1279 162 162 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 163 163 164 #if H_3D_ARP164 #if NH_3D_ARP 165 165 #define NUM_ARPW_CTX 3 ///< number of context models for weighting factor index used by advanced residual prediction 166 166 #endif 167 167 168 #if H_3D_IC168 #if NH_3D_IC 169 169 #define NUM_IC_FLAG_CTX 1 ///< number of context models for illumination compensation flag 170 170 #endif … … 186 186 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (SDC only) 187 187 #endif 188 #if H_3D_DBBP188 #if NH_3D_DBBP 189 189 #define DBBP_NUM_FLAG_CTX 1 190 190 #endif … … 540 540 //! \} 541 541 542 #if H_3D_ARP542 #if NH_3D_ARP 543 543 static const UChar 544 544 INIT_ARPW[3][NUM_ARPW_CTX] = … … 550 550 551 551 #endif 552 #if H_3D_IC552 #if NH_3D_IC 553 553 static const UChar 554 554 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = … … 616 616 }; 617 617 #endif 618 #if H_3D_DBBP618 #if NH_3D_DBBP 619 619 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] = 620 620 { -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComCodingStatistics.h
r1239 r1279 81 81 STATS__CABAC_BITS__ESCAPE_BITS, 82 82 83 #if NH_3D_DBBP 84 STATS__CABAC_BITS__DBBP_FLAG, 85 #endif 86 #if NH_3D_ARP 87 STATS__CABAC_BITS__ARP_FLAG, 88 #endif 83 89 STATS__CABAC_BITS__SAO, 84 90 STATS__CABAC_TRM_BITS, … … 93 99 STATS__CABAC_BITS__ALIGNED_ESCAPE_BITS, 94 100 101 #if NH_3D_IC 102 STATS__CABAC_BITS__3D_IC, 103 #endif 95 104 #if NH_3D_DMM || NH_3D_SDC_INTRA || H_3D_INTER_SDC 96 105 STATS__CABAC_BITS__DELTADC_SIGN_EP, … … 147 156 "CABAC_BITS__SIGN_BIT", 148 157 "CABAC_BITS__ESCAPE_BITS", 158 #if NH_3D_DBBP 159 "CABAC_BITS__DBBP_FLAG", 160 #endif 149 161 "CABAC_BITS__SAO", 150 162 "CABAC_TRM_BITS", … … 158 170 "CABAC_BITS__ALIGNED_SIGN_BIT", 159 171 "CABAC_BITS__ALIGNED_ESCAPE_BITS" 172 173 #if NH_3D_IC 174 "CABAC_BITS__3D_IC" 175 #endif 160 176 #if NH_3D_DMM || NH_3D_SDC_INTRA || H_3D_INTER_SDC 161 177 ,"STATS__CABAC_BITS__DELTADC_SIGN_EP" -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.cpp
r1258 r1279 120 120 m_bDecSubCu = false; 121 121 122 #if H_3D_NBDV122 #if NH_3D_NBDV 123 123 m_pDvInfo = NULL; 124 124 #endif 125 #if H_3D_VSP125 #if NH_3D_VSP 126 126 m_piVSPFlag = NULL; 127 127 #endif 128 #if H_3D_SPIVMP128 #if NH_3D_SPIVMP 129 129 m_pbSPIVMPFlag = NULL; 130 130 #endif 131 #if H_3D_ARP131 #if NH_3D_ARP 132 132 m_puhARPW = NULL; 133 133 #endif 134 #if H_3D_IC134 #if NH_3D_IC 135 135 m_pbICFlag = NULL; 136 136 #endif 137 137 #if H_3D_INTER_SDC 138 138 #endif 139 #if H_3D_DBBP139 #if NH_3D_DBBP 140 140 m_pbDBBPFlag = NULL; 141 141 #endif … … 180 180 m_pbMergeFlag = (Bool* )xMalloc(Bool, uiNumPartition); 181 181 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 182 #if H_3D_VSP182 #if NH_3D_VSP 183 183 m_piVSPFlag = (Char* )xMalloc(Char, uiNumPartition); 184 184 #endif 185 #if H_3D_SPIVMP185 #if NH_3D_SPIVMP 186 186 m_pbSPIVMPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 187 187 #endif … … 203 203 } 204 204 205 #if H_3D_NBDV205 #if NH_3D_NBDV 206 206 m_pDvInfo = (DisInfo* )xMalloc(DisInfo, uiNumPartition); 207 207 #endif … … 244 244 } 245 245 246 #if H_3D_ARP247 m_puhARPW = new UChar[ uiNumPartition];248 #endif 249 #if H_3D_IC246 #if NH_3D_ARP 247 m_puhARPW = (UChar* )xMalloc(UChar, uiNumPartition); 248 #endif 249 #if NH_3D_IC 250 250 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 251 251 #endif … … 263 263 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 264 264 #endif 265 #if H_3D_DBBP265 #if NH_3D_DBBP 266 266 m_pbDBBPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 267 267 #endif … … 362 362 } 363 363 364 #if H_3D_VSP 365 if ( m_piVSPFlag ) { xFree(m_piVSPFlag); m_piVSPFlag = NULL; } 366 #endif 367 #if H_3D_SPIVMP 364 #if NH_3D_VSP 365 if ( m_piVSPFlag ) 366 { 367 xFree(m_piVSPFlag); 368 m_piVSPFlag = NULL; 369 } 370 #endif 371 #if NH_3D_SPIVMP 368 372 if ( m_pbSPIVMPFlag ) { xFree(m_pbSPIVMPFlag); m_pbSPIVMPFlag = NULL; } 369 373 #endif … … 453 457 m_acCUMvField[rpl].destroy(); 454 458 } 455 #if H_3D_NBDV459 #if NH_3D_NBDV 456 460 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 457 461 #endif 458 462 459 463 460 #if H_3D_ARP461 if ( m_puhARPW ) { delete[] m_puhARPW;m_puhARPW = NULL; }462 #endif 463 #if H_3D_IC464 #if NH_3D_ARP 465 if ( m_puhARPW ) { xFree(m_puhARPW); m_puhARPW = NULL; } 466 #endif 467 #if NH_3D_IC 464 468 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 465 469 #endif … … 478 482 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 479 483 #endif 480 #if H_3D_DBBP484 #if NH_3D_DBBP 481 485 if ( m_pbDBBPFlag ) { xFree(m_pbDBBPFlag); m_pbDBBPFlag = NULL; } 482 486 #endif … … 583 587 memset( m_puhHeight , maxCUHeight, m_uiNumPartition * sizeof( *m_puhHeight ) ); 584 588 585 #if H_3D_ARP 586 m_puhARPW [ui] = pcFrom->getARPW( ui ); 587 #endif 588 #if H_3D_IC 589 m_pbICFlag[ui] = pcFrom->m_pbICFlag[ui]; 590 #endif 591 589 #if NH_3D_IC 590 memset( m_pbICFlag , false, m_uiNumPartition * sizeof( *m_pbICFlag ) ); 591 #endif 592 592 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 593 593 { … … 608 608 memset( m_puhMergeIndex , 0, m_uiNumPartition * sizeof( *m_puhMergeIndex ) ); 609 609 610 #if H_3D_VSP611 m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui];612 #endif 613 #if H_3D_SPIVMP614 m_pbSPIVMPFlag[ui] = pcFrom->m_pbSPIVMPFlag[ui];610 #if NH_3D_VSP 611 memset( m_piVSPFlag , 0, m_uiNumPartition * sizeof( *m_piVSPFlag ) ); 612 #endif 613 #if NH_3D_SPIVMP 614 memset( m_pbSPIVMPFlag , 0, m_uiNumPartition * sizeof( *m_pbSPIVMPFlag ) ); 615 615 #endif 616 616 #if NH_3D_SDC_INTRA 617 617 memset( m_pbSDCFlag, false, m_uiNumPartition * sizeof( *m_pbSDCFlag ) ); 618 618 #endif 619 #if H_3D_DBBP 620 m_pbDBBPFlag[ui] = pcFrom->m_pbDBBPFlag[ui]; 621 #endif 622 #if H_3D_VSP 623 memset( m_piVSPFlag + firstElement, 0, numElements * sizeof( *m_piVSPFlag ) ); 624 #endif 625 #if H_3D_SPIVMP 626 memset( m_pbSPIVMPFlag + firstElement, 0, numElements * sizeof( *m_pbSPIVMPFlag ) ); 619 #if NH_3D_DBBP 620 memset( m_pbDBBPFlag , false, m_uiNumPartition * sizeof( *m_pbDBBPFlag )); 627 621 #endif 628 622 … … 632 626 } 633 627 634 #if H_3D_ARP 635 memset( m_puhARPW + firstElement, 0, numElements * sizeof( UChar ) ); 636 #endif 637 #if H_3D_IC 638 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) ); 639 #endif 640 628 #if NH_3D_ARP 629 memset( m_puhARPW , 0, m_uiNumPartition * sizeof( *m_puhARPW ) ); 630 #endif 641 631 642 632 … … 653 643 memset( m_apSegmentDCOffset[0], 0, m_uiNumPartition * sizeof( *m_apSegmentDCOffset[0] ) ); 654 644 memset( m_apSegmentDCOffset[1], 0, m_uiNumPartition * sizeof( *m_apSegmentDCOffset[1] ) ); 655 #endif656 #if H_3D_DBBP657 memset( m_pbDBBPFlag + firstElement, false, numElements * sizeof( *m_pbDBBPFlag ) );658 645 #endif 659 646 … … 770 757 m_pbMergeFlag[ui] = 0; 771 758 m_puhMergeIndex[ui] = 0; 772 #if H_3D_VSP773 m_piVSPFlag[ui]= 0;774 #endif 775 #if H_3D_SPIVMP776 759 #if NH_3D_VSP 760 m_piVSPFlag[ui] = 0; 761 #endif 762 #if NH_3D_SPIVMP 763 m_pbSPIVMPFlag[ui] = 0; 777 764 #endif 778 765 … … 787 774 m_puhCbf[comp][ui] = 0; 788 775 } 789 #if H_3D_ARP776 #if NH_3D_ARP 790 777 m_puhARPW[ui] = 0; 791 778 #endif 792 #if H_3D_IC779 #if NH_3D_IC 793 780 m_pbICFlag[ui] = false; 794 781 #endif … … 808 795 m_apSegmentDCOffset[1][ui] = 0; 809 796 #endif 810 #if H_3D_DBBP797 #if NH_3D_DBBP 811 798 m_pbDBBPFlag[ui] = false; 812 799 #endif … … 864 851 memset( m_pbMergeFlag, 0, iSizeInBool ); 865 852 memset( m_puhMergeIndex, 0, iSizeInUchar ); 866 #if H_3D_VSP853 #if NH_3D_VSP 867 854 memset( m_piVSPFlag, 0, sizeof( Char ) * m_uiNumPartition ); 868 855 #endif 869 #if H_3D_SPIVMP856 #if NH_3D_SPIVMP 870 857 memset( m_pbSPIVMPFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 871 858 #endif … … 886 873 memset( m_explicitRdpcmMode[comp], NUMBER_OF_RDPCM_MODES, iSizeInUchar ); 887 874 } 888 #if H_3D_ARP889 memset( m_puhARPW, 0, iSizeInUchar );890 #endif891 875 892 876 memset( m_puhDepth, uiDepth, iSizeInUchar ); … … 894 878 memset( m_puhHeight, uhHeight, iSizeInUchar ); 895 879 memset( m_pbIPCMFlag, 0, iSizeInBool ); 896 #if H_3D_IC 880 #if NH_3D_ARP 881 memset( m_puhARPW, 0, iSizeInUchar ); 882 #endif 883 #if NH_3D_IC 897 884 memset( m_pbICFlag, 0, iSizeInBool ); 898 885 #endif … … 910 897 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 911 898 #endif 912 #if H_3D_DBBP913 memset( m_pbDBBPFlag, 0, iSizeInBool);899 #if NH_3D_DBBP 900 memset( m_pbDBBPFlag, 0, sizeof(Bool) * m_uiNumPartition ); 914 901 #endif 915 902 … … 937 924 m_ucDISType[ui] = pcCU->getDISType(uiPartOffset+ui); 938 925 #endif 939 #if H_3D_VSP940 m_piVSPFlag[ui]=pcCU->m_piVSPFlag[uiPartOffset+ui];941 942 #endif 943 #if H_3D_SPIVMP944 945 #endif 946 #if H_3D_ARP926 #if NH_3D_VSP 927 m_piVSPFlag[ui] = pcCU->m_piVSPFlag[uiPartOffset+ui]; 928 m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui]; 929 #endif 930 #if NH_3D_SPIVMP 931 m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui]; 932 #endif 933 #if NH_3D_ARP 947 934 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 948 935 #endif 949 #if H_3D_IC936 #if NH_3D_IC 950 937 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 951 938 #endif … … 963 950 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 964 951 #endif 965 #if H_3D_DBBP952 #if NH_3D_DBBP 966 953 m_pbDBBPFlag[ui]=pcCU->m_pbDBBPFlag[uiPartOffset+ui]; 967 954 #endif … … 1034 1021 m_pePredMode=pcCU->getPredictionMode() + uiPart; 1035 1022 m_CUTransquantBypass = pcCU->getCUTransquantBypass()+uiPart; 1036 #if H_3D_NBDV1023 #if NH_3D_NBDV 1037 1024 m_pDvInfo = pcCU->getDvInfo() + uiPart; 1038 1025 #endif … … 1040 1027 m_pbMergeFlag = pcCU->getMergeFlag() + uiPart; 1041 1028 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 1042 #if H_3D_VSP1029 #if NH_3D_VSP 1043 1030 m_piVSPFlag = pcCU->getVSPFlag() + uiPart; 1044 1031 #endif 1045 #if H_3D_SPIVMP1032 #if NH_3D_SPIVMP 1046 1033 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiPart; 1047 1034 #endif 1048 #if H_3D_ARP1035 #if NH_3D_ARP 1049 1036 m_puhARPW = pcCU->getARPW() + uiPart; 1050 1037 #endif 1051 #if H_3D_IC1038 #if NH_3D_IC 1052 1039 m_pbICFlag = pcCU->getICFlag() + uiPart; 1053 1040 #endif … … 1081 1068 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1082 1069 #endif 1083 #if H_3D_DBBP1070 #if NH_3D_DBBP 1084 1071 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiPart; 1085 1072 #endif … … 1128 1115 } 1129 1116 1130 #if H_3D_NBDV1117 #if NH_3D_NBDV 1131 1118 Void TComDataCU::copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx) 1132 1119 { … … 1137 1124 // Copy inter prediction info from the biggest CU 1138 1125 Void TComDataCU::copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 1139 #if H_3D_NBDV1126 #if NH_3D_NBDV 1140 1127 , Bool bNBDV 1141 1128 #endif … … 1168 1155 1169 1156 m_pePartSize = pcCU->getPartitionSize () + uiAbsPartIdx; 1170 #if H_3D_NBDV1157 #if NH_3D_NBDV 1171 1158 if(bNBDV == true) 1172 1159 { … … 1189 1176 m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx; 1190 1177 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1191 #if H_3D_VSP1178 #if NH_3D_VSP 1192 1179 m_piVSPFlag = pcCU->getVSPFlag() + uiAbsPartIdx; 1193 1180 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1194 1181 #endif 1195 #if H_3D_SPIVMP1182 #if NH_3D_SPIVMP 1196 1183 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1197 1184 #endif … … 1199 1186 m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx; 1200 1187 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; 1201 #if H_3D_ARP1188 #if NH_3D_ARP 1202 1189 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1203 1190 #endif 1204 #if H_3D_DBBP1191 #if NH_3D_DBBP 1205 1192 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiAbsPartIdx; 1206 1193 #endif 1207 1194 1208 1195 m_acCUMvField[ eRefPicList ].linkToWithOffset( pcCU->getCUMvField(eRefPicList), uiAbsPartIdx ); 1209 #if H_3D_NBDV1210 } 1211 #endif 1212 #if H_3D_IC1196 #if NH_3D_NBDV 1197 } 1198 #endif 1199 #if NH_3D_IC 1213 1200 m_pbICFlag = pcCU->getICFlag() + uiAbsPartIdx; 1214 1201 #endif … … 1247 1234 memcpy( m_pbMergeFlag + uiOffset, pcCU->getMergeFlag(), iSizeInBool ); 1248 1235 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 1249 #if H_3D_VSP1236 #if NH_3D_VSP 1250 1237 memcpy( m_piVSPFlag + uiOffset, pcCU->getVSPFlag(), sizeof( Char ) * uiNumPartition ); 1251 1238 memcpy( m_pDvInfo + uiOffset, pcCU->getDvInfo(), sizeof( *m_pDvInfo ) * uiNumPartition ); 1252 1239 #endif 1253 #if H_3D_SPIVMP1240 #if NH_3D_SPIVMP || NH_3D_DBBP 1254 1241 memcpy( m_pbSPIVMPFlag + uiOffset, pcCU->getSPIVMPFlag(), sizeof( Bool ) * uiNumPartition ); 1255 1242 #endif … … 1283 1270 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1284 1271 #endif 1285 #if H_3D_DBBP1272 #if NH_3D_DBBP 1286 1273 memcpy( m_pbDBBPFlag + uiOffset, pcCU->getDBBPFlag(), iSizeInBool ); 1274 #endif 1275 #if NH_3D_ARP 1276 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1287 1277 #endif 1288 1278 … … 1326 1316 } 1327 1317 1328 #if H_3D_ARP 1329 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1330 #endif 1331 #if H_3D_IC 1318 #if NH_3D_IC 1332 1319 memcpy( m_pbICFlag + uiOffset, pcCU->getICFlag(), iSizeInBool ); 1333 1320 #endif … … 1359 1346 1360 1347 memcpy( pCtu->getQP() + m_absZIdxInCtu, m_phQP, sizeInChar ); 1361 #if H_3D_NBDV1362 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof(* m_pDvInfo)* m_uiNumPartition );1348 #if NH_3D_NBDV 1349 memcpy( pCtu->getDvInfo() + m_absZIdxInCtu, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1363 1350 #endif 1364 1351 … … 1369 1356 memcpy( pCtu->getMergeFlag() + m_absZIdxInCtu, m_pbMergeFlag, iSizeInBool ); 1370 1357 memcpy( pCtu->getMergeIndex() + m_absZIdxInCtu, m_puhMergeIndex, iSizeInUchar ); 1371 #if H_3D_VSP 1372 memcpy( rpcCU->getVSPFlag() + m_uiAbsIdxInLCU, m_piVSPFlag, sizeof( Char ) * m_uiNumPartition ); 1373 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof( *m_pDvInfo ) * m_uiNumPartition ); 1374 #endif 1375 #if H_3D_SPIVMP 1376 memcpy( rpcCU->getSPIVMPFlag() + m_uiAbsIdxInLCU, m_pbSPIVMPFlag, sizeof( Bool ) * m_uiNumPartition ); 1358 #if NH_3D_VSP 1359 memcpy( pCtu->getVSPFlag() + m_absZIdxInCtu, m_piVSPFlag, sizeof( Char ) * m_uiNumPartition ); 1360 #endif 1361 #if NH_3D_DBBP 1362 memcpy( pCtu->getDvInfo() + m_absZIdxInCtu, m_pDvInfo, sizeof( *m_pDvInfo ) * m_uiNumPartition ); 1363 #endif 1364 #if NH_3D_SPIVMP 1365 memcpy( pCtu->getSPIVMPFlag() + m_absZIdxInCtu, m_pbSPIVMPFlag, sizeof( Bool ) * m_uiNumPartition ); 1377 1366 #endif 1378 1367 … … 1406 1395 memcpy( pCtu->getSDCSegmentDCOffset(1) + m_absZIdxInCtu, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1407 1396 #endif 1408 #if H_3D_DBBP 1409 memcpy( rpcCU->getDBBPFlag() + m_uiAbsIdxInLCU, m_pbDBBPFlag, iSizeInBool ); 1397 #if NH_3D_DBBP 1398 memcpy( pCtu->getDBBPFlag() + m_absZIdxInCtu, m_pbDBBPFlag, iSizeInBool ); 1399 #endif 1400 #if NH_3D_ARP 1401 memcpy( pCtu->getARPW() + m_absZIdxInCtu, m_puhARPW, iSizeInUchar ); 1410 1402 #endif 1411 1403 … … 1442 1434 } 1443 1435 1444 #if H_3D_ARP 1445 memcpy( rpcCU->getARPW() + m_uiAbsIdxInLCU, m_puhARPW, iSizeInUchar ); 1446 #endif 1447 #if H_3D_IC 1448 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool ); 1449 #endif 1450 1436 #if NH_3D_IC 1437 memcpy( pCtu->getICFlag() + m_absZIdxInCtu, m_pbICFlag, sizeof( *m_pbICFlag ) * m_uiNumPartition ); 1438 #endif 1451 1439 pCtu->getTotalBins() = m_uiTotalBins; 1452 1440 } 1453 #if H_3D_VSP1454 memcpy( rpcCU->getVSPFlag() + uiPartOffset, m_piVSPFlag, sizeof(Char) * uiQNumPart );1455 #endif1456 1441 #if H_3D_SPIVMP 1457 1442 memcpy( rpcCU->getSPIVMPFlag() + uiPartOffset, m_pbSPIVMPFlag, sizeof(Bool) * uiQNumPart ); 1458 #endif1459 #if H_3D_DBBP1460 memcpy( rpcCU->getDBBPFlag() + uiPartOffset, m_pbDBBPFlag, iSizeInBool );1461 #endif1462 #if H_3D_ARP1463 memcpy( rpcCU->getARPW() + uiPartOffset, m_puhARPW, iSizeInUchar );1464 #endif1465 #if H_3D_IC1466 memcpy( rpcCU->getICFlag() + uiPartOffset, m_pbICFlag, iSizeInBool );1467 1443 #endif 1468 1444 … … 2017 1993 return uiCtx; 2018 1994 } 2019 #if H_3D_ARP1995 #if NH_3D_ARP 2020 1996 UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx ) 2021 1997 { … … 2024 2000 UInt uiCtx = 0; 2025 2001 2026 pcTempCU = getPULeft( uiTempPartIdx, m_ uiAbsIdxInLCU+ uiAbsPartIdx );2002 pcTempCU = getPULeft( uiTempPartIdx, m_absZIdxInCtu + uiAbsPartIdx ); 2027 2003 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 2028 2004 return uiCtx; 2029 2005 } 2030 2006 #endif 2031 #if H_3D_DBBP2007 #if NH_3D_DBBP 2032 2008 Pel* TComDataCU::getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride) 2033 2009 { 2010 const TComSPS* sps = getSlice()->getSPS(); 2011 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 2012 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 2013 2034 2014 // get coded and reconstructed depth view 2035 2015 TComPicYuv* depthPicYuv = NULL; … … 2037 2017 2038 2018 // DBBP is a texture coding tool 2039 if( getSlice()->getIsDepth() ) 2040 { 2041 return NULL; 2042 } 2019 assert( !getSlice()->getIsDepth() ); 2020 2043 2021 #if H_3D_FCO 2044 2022 TComPic* depthPic = getSlice()->getIvPic(true, getSlice()->getViewIndex() ); … … 2067 2045 depthPicYuv = baseDepthPic->getPicYuvRec(); 2068 2046 depthPicYuv->extendPicBorder(); 2069 uiDepthStride = depthPicYuv->getStride( );2047 uiDepthStride = depthPicYuv->getStride(COMPONENT_Y); 2070 2048 2071 Int iBlkX = ( get Addr() % baseDepthPic->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ getZorderIdxInCU()+uiAbsPartIdx ] ];2072 Int iBlkY = ( get Addr() / baseDepthPic->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ getZorderIdxInCU()+uiAbsPartIdx ] ];2049 Int iBlkX = ( getCtuRsAddr() % baseDepthPic->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ getZorderIdxInCtu()+uiAbsPartIdx ] ]; 2050 Int iBlkY = ( getCtuRsAddr() / baseDepthPic->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ getZorderIdxInCtu()+uiAbsPartIdx ] ]; 2073 2051 2074 Int iPictureWidth = depthPicYuv->getWidth( );2075 Int iPictureHeight = depthPicYuv->getHeight( );2052 Int iPictureWidth = depthPicYuv->getWidth(COMPONENT_Y); 2053 Int iPictureHeight = depthPicYuv->getHeight(COMPONENT_Y); 2076 2054 2077 2055 2078 2056 Bool depthRefineFlag = false; 2079 #if H_3D_NBDV_REF2080 depthRefineFlag = m_pcSlice->getDepthRefinementFlag( 2081 #endif // H_3D_NBDV_REF2057 #if NH_3D_NBDV_REF 2058 depthRefineFlag = m_pcSlice->getDepthRefinementFlag(); 2059 #endif // NH_3D_NBDV_REF 2082 2060 2083 2061 TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV; … … 2090 2068 Int depthPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((cDv.getVer()+2)>>2)); 2091 2069 2092 pDepthPels = depthPicYuv->get LumaAddr() + depthPosX + depthPosY * uiDepthStride;2070 pDepthPels = depthPicYuv->getAddr(COMPONENT_Y) + depthPosX + depthPosY * uiDepthStride; 2093 2071 } 2094 2072 #endif … … 2102 2080 #endif 2103 2081 2104 #if H_3D_DBBP2082 #if NH_3D_DBBP 2105 2083 Void TComDataCU::setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2106 2084 { … … 2392 2370 } 2393 2371 2394 #if H_3D_SPIVMP2372 #if NH_3D_SPIVMP 2395 2373 Void TComDataCU::setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2396 2374 { … … 2399 2377 #endif 2400 2378 2401 #if H_3D_VSP2379 #if NH_3D_VSP 2402 2380 Void TComDataCU::setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2403 2381 { 2404 2382 setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2405 2383 } 2406 #if H_3D_VSP2407 2384 template<typename T> 2408 2385 Void TComDataCU::setSubPartT( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ) 2409 2386 { 2410 UInt uiCurrPartNumQ = (m_pcPic->getNumPart InCU() >> (2 * uiCUDepth)) >> 2;2387 UInt uiCurrPartNumQ = (m_pcPic->getNumPartitionsInCtu() >> (2 * uiCUDepth)) >> 2; 2411 2388 switch ( m_pePartSize[ uiCUAddr ] ) 2412 2389 { … … 2540 2517 } 2541 2518 #endif 2542 #endif2543 2519 2544 2520 Void TComDataCU::setInterDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) … … 2626 2602 2627 2603 // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx 2628 #if H_3D_IC2604 #if NH_3D_IC || NH_3D_VSP 2629 2605 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2630 2606 { … … 2960 2936 } 2961 2937 2962 #if H_3D_VSP 2963 2938 #if NH_3D_VSP 2964 2939 /** Add a VSP merging candidate 2965 2940 * \Inputs … … 3015 2990 predFlag[iRefListIdX] = 1; 3016 2991 mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i ); 3017 #if H_3D_NBDV2992 #if NH_3D_NBDV 3018 2993 mvVSP[0+iRefListIdX].getMv().setIDVFlag (false); 3019 2994 #endif … … 3023 2998 3024 2999 dirVSP = (predFlag[0] | (predFlag[1] << 1)); 3025 m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true, false); 3000 m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true 3001 #if NH_3D_SPIVMP 3002 , false 3003 #endif 3004 ); 3026 3005 if ( mrgCandIdx == iCount ) 3027 3006 { … … 3033 3012 return false; 3034 3013 } 3035 3036 #endif 3037 3038 #if H_3D_IV_MERGE 3014 #endif 3015 3016 #if NH_3D_IV_MERGE 3039 3017 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ) 3040 3018 { … … 3067 3045 if(!bRemove) 3068 3046 { 3069 #if H_3D_NBDV3047 #if NH_3D_NBDV 3070 3048 if(iLoop) // For IvMcShift candidate 3071 3049 { … … 3088 3066 3089 3067 #endif 3090 #if H_3D 3068 #if NH_3D_MLC 3069 /** Construct a extended list of merging candidates 3070 * \param pcMvFieldNeighbours 3071 * \param puhInterDirNeighbours 3072 * \param vspFlag 3073 * \param pbSPIVMPFlag 3074 * \param numValidMergeCand 3075 */ 3091 3076 Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 3092 #if H_3D_VSP3077 #if NH_3D_VSP 3093 3078 , Int* vspFlag 3094 3079 #endif 3095 #if H_3D_SPIVMP3080 #if NH_3D_SPIVMP 3096 3081 , Bool* pbSPIVMPFlag 3097 3082 #endif … … 3099 3084 ) 3100 3085 { 3101 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) // for only dependent texture3086 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) 3102 3087 { 3103 3088 return; … … 3115 3100 extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID); 3116 3101 extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID); 3102 #if NH_3D_VSP 3117 3103 vspFlag[ui] = 0; 3118 } 3119 3120 // add candidates to temporal list 3121 // insert MPI ... IvShift candidate 3104 #endif 3105 } 3106 3107 // insert MPI ... IvShift candidate to extMergeCandList 3122 3108 for (Int i=0; i<=MRG_IVSHIFT; i++) 3123 3109 { 3124 3110 if (m_mergCands[i].m_bAvailable) 3125 3111 { 3126 m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt, vspFlag, pbSPIVMPFlag); 3112 m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt 3113 #if NH_3D_VSP 3114 , vspFlag 3115 #endif 3116 #if NH_3D_SPIVMP 3117 , pbSPIVMPFlag 3118 #endif 3119 ); 3127 3120 iCount++; 3128 3121 if (iCount >= getSlice()->getMaxNumMergeCand()) … … 3131 3124 } 3132 3125 3133 // insert remaining base candidates 3134 while (iCount < getSlice()->getMaxNumMergeCand() && m_baseListidc < getSlice()->getMaxNumMergeCand()) 3135 { 3136 uhInterDirNeighboursExt[iCount] = puhInterDirNeighbours[m_baseListidc]; 3137 extMergeCandList[iCount<<1].setMvField(pcMvFieldNeighbours[m_baseListidc<<1].getMv(), pcMvFieldNeighbours[m_baseListidc<<1].getRefIdx()); 3126 Int iCountBase = m_numSpatialCands; 3127 // insert remaining base candidates to extMergeCandList 3128 while (iCount < getSlice()->getMaxNumMergeCand() && iCountBase < getSlice()->getMaxNumMergeCand()) 3129 { 3130 uhInterDirNeighboursExt[iCount] = puhInterDirNeighbours[iCountBase]; 3131 extMergeCandList[iCount<<1].setMvField(pcMvFieldNeighbours[iCountBase<<1].getMv(), pcMvFieldNeighbours[iCountBase<<1].getRefIdx()); 3138 3132 if ( getSlice()->isInterB() ) 3139 3133 { 3140 extMergeCandList[(iCount<<1)+1].setMvField(pcMvFieldNeighbours[( m_baseListidc<<1)+1].getMv(), pcMvFieldNeighbours[(m_baseListidc<<1)+1].getRefIdx());3141 } 3142 m_baseListidc++;3134 extMergeCandList[(iCount<<1)+1].setMvField(pcMvFieldNeighbours[(iCountBase<<1)+1].getMv(), pcMvFieldNeighbours[(iCountBase<<1)+1].getRefIdx()); 3135 } 3136 iCountBase++; 3143 3137 iCount++; 3144 3138 } … … 3162 3156 } 3163 3157 3164 /** Constructs a list of merging candidates 3158 3159 3160 /** Derive 3D merge candidates 3165 3161 * \param uiAbsPartIdx 3166 3162 * \param uiPUIdx 3167 * \param uiDepth3168 3163 * \param pcMvFieldNeighbours 3164 * \param puhInterDirNeighbours 3165 * \param pcMvFieldSP 3169 3166 * \param puhInterDirNeighbours 3170 3167 * \param numValidMergeCand 3171 3168 */ 3172 // HM 12.0 based merge candidate list construction 3173 3174 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3175 { 3176 3177 UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx; 3178 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ]; 3169 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 3170 #if NH_3D_SPIVMP 3171 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 3172 #endif 3173 , Int& numValidMergeCand, Int mrgCandIdx 3174 ) 3175 { 3176 #if NH_3D_IV_MERGE 3179 3177 TComMv cZeroMv; 3180 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 3181 { 3182 abCandIsInter[ui] = false; 3183 pcMvFieldNeighbours[ ( ui << 1 ) ].setMvField(cZeroMv, NOT_VALID); 3184 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID); 3178 TComMvField tmpMV[2]; 3179 #endif 3180 3181 ////////////////////////////////// 3182 //////// GET DISPARITIES //////// 3183 ////////////////////////////////// 3184 #if NH_3D_IV_MERGE 3185 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 3186 m_cDefaultDisInfo = cDisInfo; 3187 #elif NH_3D_VSP 3188 // for xAddVspCand() 3189 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 3190 #endif 3191 3192 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) 3193 { 3194 return; 3185 3195 } 3186 3196 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 3197 ////////////////////////////////// 3198 //////// DERIVE LOCATIONS //////// 3199 ////////////////////////////////// 3187 3200 // compute the location of the current PU 3188 3201 Int xP, yP, nPSW, nPSH; … … 3190 3203 3191 3204 Int iCount = 0; 3192 3193 3205 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 3194 PartSize cCurPS = getPartitionSize( uiAbsPartIdx );3195 3206 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 3196 3207 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 3197 3198 //left 3199 UInt uiLeftPartIdx = 0; 3200 TComDataCU* pcCULeft = 0; 3201 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 3202 Bool isAvailableA1 = pcCULeft && 3203 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 3204 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 3205 !pcCULeft->isIntra( uiLeftPartIdx ) ; 3206 if ( isAvailableA1 ) 3207 { 3208 m_bAvailableFlagA1 = 1; 3209 abCandIsInter[iCount] = true; 3210 // get Inter Dir 3211 puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx ); 3212 // get Mv from Left 3213 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3214 if ( getSlice()->isInterB() ) 3215 { 3216 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3217 } 3218 3219 iCount ++; 3220 } 3221 3222 // early termination 3223 if (iCount == getSlice()->getMaxNumMergeCand()) 3224 { 3225 return; 3226 } 3227 // above 3228 UInt uiAbovePartIdx = 0; 3229 TComDataCU* pcCUAbove = 0; 3230 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 3231 Bool isAvailableB1 = pcCUAbove && 3232 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 3233 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 3234 !pcCUAbove->isIntra( uiAbovePartIdx ); 3235 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 3236 { 3237 m_bAvailableFlagB1 = 1; 3238 abCandIsInter[iCount] = true; 3239 // get Inter Dir 3240 puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx ); 3241 // get Mv from Left 3242 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3243 if ( getSlice()->isInterB() ) 3244 { 3245 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3246 } 3247 if ( mrgCandIdx == iCount ) 3248 { 3249 return; 3250 } 3251 iCount ++; 3252 } 3253 // early termination 3254 if (iCount == getSlice()->getMaxNumMergeCand()) 3255 { 3256 return; 3257 } 3258 3259 // above right 3260 UInt uiAboveRightPartIdx = 0; 3261 TComDataCU* pcCUAboveRight = 0; 3262 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 3263 Bool isAvailableB0 = pcCUAboveRight && 3264 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 3265 !pcCUAboveRight->isIntra( uiAboveRightPartIdx ); 3266 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 3267 { 3268 m_bAvailableFlagB0 = 1; 3269 abCandIsInter[iCount] = true; 3270 // get Inter Dir 3271 puhInterDirNeighbours[iCount] = pcCUAboveRight->getInterDir( uiAboveRightPartIdx ); 3272 // get Mv from Left 3273 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3274 if ( getSlice()->isInterB() ) 3275 { 3276 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3277 } 3278 if ( mrgCandIdx == iCount ) 3279 { 3280 return; 3281 } 3282 iCount ++; 3283 } 3284 // early termination 3285 if (iCount == getSlice()->getMaxNumMergeCand()) 3286 { 3287 return; 3288 } 3289 3290 //left bottom 3291 UInt uiLeftBottomPartIdx = 0; 3292 TComDataCU* pcCULeftBottom = 0; 3293 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 3294 Bool isAvailableA0 = pcCULeftBottom && 3295 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 3296 !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ; 3297 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 3298 { 3299 m_bAvailableFlagA0 = 1; 3300 abCandIsInter[iCount] = true; 3301 // get Inter Dir 3302 puhInterDirNeighbours[iCount] = pcCULeftBottom->getInterDir( uiLeftBottomPartIdx ); 3303 // get Mv from Left 3304 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3305 if ( getSlice()->isInterB() ) 3306 { 3307 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3308 } 3309 if ( mrgCandIdx == iCount ) 3310 { 3311 return; 3312 } 3313 iCount ++; 3314 } 3315 // early termination 3316 if (iCount == getSlice()->getMaxNumMergeCand()) 3317 { 3318 return; 3319 } 3320 // above left 3321 if( iCount < 4 ) 3322 { 3323 UInt uiAboveLeftPartIdx = 0; 3324 TComDataCU* pcCUAboveLeft = 0; 3325 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 3326 Bool isAvailableB2 = pcCUAboveLeft && 3327 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 3328 !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ); 3329 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 3330 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) ) 3331 { 3332 m_bAvailableFlagB2 = 1; 3333 abCandIsInter[iCount] = true; 3334 // get Inter Dir 3335 puhInterDirNeighbours[iCount] = pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx ); 3336 // get Mv from Left 3337 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3338 if ( getSlice()->isInterB() ) 3339 { 3340 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3341 } 3342 if ( mrgCandIdx == iCount ) 3343 { 3344 return; 3345 } 3346 iCount ++; 3347 } 3348 } 3349 // early termination 3350 if (iCount == getSlice()->getMaxNumMergeCand()) 3351 { 3352 return; 3353 } 3354 if ( getSlice()->getEnableTMVPFlag()) 3355 { 3356 //>> MTK colocated-RightBottom 3357 UInt uiPartIdxRB; 3358 3359 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 3360 3361 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 3362 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 3363 3364 TComMv cColMv; 3365 Int iRefIdx; 3366 Int uiLCUIdx = -1; 3367 3368 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 3369 { 3370 } 3371 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 3372 { 3373 } 3374 else 3375 { 3376 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 3377 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 3378 { 3379 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 3380 uiLCUIdx = getAddr(); 3381 } 3382 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 3383 { 3384 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 3385 } 3386 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 3387 { 3388 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 3389 uiLCUIdx = getAddr() + 1; 3390 } 3391 else //is the right bottom corner of LCU 3392 { 3393 uiAbsPartAddr = 0; 3394 } 3395 } 3396 3397 iRefIdx = 0; 3398 Bool bExistMV = false; 3399 UInt uiPartIdxCenter; 3400 UInt uiCurLCUIdx = getAddr(); 3401 Int dir = 0; 3402 UInt uiArrayAddr = iCount; 3403 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 3404 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx ); 3405 if( bExistMV == false ) 3406 { 3407 bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx ); 3408 } 3409 if( bExistMV ) 3410 { 3411 dir |= 1; 3412 pcMvFieldNeighbours[ 2 * uiArrayAddr ].setMvField( cColMv, iRefIdx ); 3413 } 3414 3415 if ( getSlice()->isInterB() ) 3416 { 3417 #if H_3D_TMVP 3418 iRefIdx = 0; 3419 #endif 3420 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 3421 if( bExistMV == false ) 3422 { 3423 bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx ); 3424 } 3425 if( bExistMV ) 3426 { 3427 dir |= 2; 3428 pcMvFieldNeighbours[ 2 * uiArrayAddr + 1 ].setMvField( cColMv, iRefIdx ); 3429 } 3430 } 3431 3432 if (dir != 0) 3433 { 3434 puhInterDirNeighbours[uiArrayAddr] = dir; 3435 abCandIsInter[uiArrayAddr] = true; 3436 #if H_3D_NBDV 3437 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 3438 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 3439 #endif 3440 if ( mrgCandIdx == iCount ) 3441 { 3442 return; 3443 } 3444 iCount++; 3445 } 3446 } 3447 // early termination 3448 if (iCount == getSlice()->getMaxNumMergeCand()) 3449 { 3450 return; 3451 } 3452 UInt uiArrayAddr = iCount; 3453 UInt uiCutoff = uiArrayAddr; 3454 3455 if ( getSlice()->isInterB() && iCount<5) // JCT3V-F0129 by Qualcomm 3456 { 3457 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 3458 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 3459 3460 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 3461 { 3462 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 3463 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 3464 { 3465 abCandIsInter[uiArrayAddr] = true; 3466 puhInterDirNeighbours[uiArrayAddr] = 3; 3467 3468 // get Mv from cand[i] and cand[j] 3469 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx()); 3470 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(j<<1)+1].getMv(), pcMvFieldNeighbours[(j<<1)+1].getRefIdx()); 3471 3472 Int iRefPOCL0 = m_pcSlice->getRefPOC( REF_PIC_LIST_0, pcMvFieldNeighbours[(uiArrayAddr<<1)].getRefIdx() ); 3473 Int iRefPOCL1 = m_pcSlice->getRefPOC( REF_PIC_LIST_1, pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getRefIdx() ); 3474 if (iRefPOCL0 == iRefPOCL1 && pcMvFieldNeighbours[(uiArrayAddr<<1)].getMv() == pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv()) 3475 { 3476 abCandIsInter[uiArrayAddr] = false; 3477 } 3478 else 3479 { 3480 uiArrayAddr++; 3481 } 3482 } 3483 } 3484 } 3485 // early termination 3486 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 3487 { 3488 return; 3489 } 3490 3491 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0); 3492 Int r = 0; 3493 Int refcnt = 0; 3494 while (uiArrayAddr < getSlice()->getMaxNumMergeCand()) 3495 { 3496 abCandIsInter[uiArrayAddr] = true; 3497 puhInterDirNeighbours[uiArrayAddr] = 1; 3498 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField( TComMv(0, 0), r); 3499 3500 if ( getSlice()->isInterB() ) 3501 { 3502 puhInterDirNeighbours[uiArrayAddr] = 3; 3503 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r); 3504 } 3505 uiArrayAddr++; 3506 if ( refcnt == iNumRefIdx - 1 ) 3507 { 3508 r = 0; 3509 } 3510 else 3511 { 3512 ++r; 3513 ++refcnt; 3514 } 3515 } 3516 3517 numValidMergeCand = uiArrayAddr; 3518 } 3519 3520 3521 3522 /** Constructs a list of merging candidates 3523 * \param uiAbsPartIdx 3524 * \param uiPUIdx 3525 * \param uiDepth 3526 * \param pcMvFieldNeighbours 3527 * \param puhInterDirNeighbours 3528 * \param numValidMergeCand 3529 */ 3530 #if H_3D 3531 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 3532 #else 3533 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 3534 #endif 3535 #if H_3D_SPIVMP 3536 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 3537 #endif 3538 , Int& numValidMergeCand, Int mrgCandIdx 3539 ) 3540 { 3541 #if H_3D_IV_MERGE 3542 //////////////////////////// 3543 //////// INIT LISTS //////// 3544 //////////////////////////// 3545 TComMv cZeroMv; 3546 #else 3547 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 3548 #endif 3549 #if H_3D 3550 TComMvField tmpMV[2]; 3551 UChar tmpDir; 3552 3553 3554 ////////////////////////////////// 3555 //////// GET DISPARITIES //////// 3556 ////////////////////////////////// 3557 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 3558 m_cDefaultDisInfo = cDisInfo; 3559 3560 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) // current slice is not both dependent view or depth 3561 { 3562 return; 3563 } 3564 #else 3565 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 3566 { 3567 abCandIsInter[ui] = false; 3568 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 3569 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 3570 } 3571 #endif 3572 3573 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 3574 #if H_3D 3575 ////////////////////////////////// 3576 //////// DERIVE LOCATIONS //////// 3577 ////////////////////////////////// 3578 #endif 3579 // compute the location of the current PU 3580 Int xP, yP, nPSW, nPSH; 3581 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 3582 3583 Int iCount = 0; 3584 3585 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 3586 #if !H_3D 3587 PartSize cCurPS = getPartitionSize( uiAbsPartIdx ); 3588 #endif 3589 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 3590 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 3591 #if H_3D 3208 #if NH_3D_TEXT_MERGE 3592 3209 Bool bMPIFlag = getSlice()->getMpiFlag(); 3210 Int tmpDir; 3211 #endif 3212 #if NH_3D_IV_MERGE || NH_3D_TEXT_MERGE 3593 3213 Bool bIsDepth = getSlice()->getIsDepth(); 3594 #endif 3595 3596 #if H_3D_IC3214 #endif 3215 3216 #if NH_3D_IC 3597 3217 Bool bICFlag = getICFlag(uiAbsPartIdx); 3598 3218 #endif 3599 #if H_3D_ARP3219 #if NH_3D_ARP 3600 3220 Bool bARPFlag = getARPW(uiAbsPartIdx) > 0; 3601 3221 #endif 3602 #if H_3D_DBBP3222 #if NH_3D_DBBP 3603 3223 Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx); 3604 3224 assert(bDBBPFlag == getDBBPFlag(0)); 3605 3225 #endif 3606 3226 3607 #if H_3D 3608 #if H_3D_NBDV 3227 #if NH_3D_NBDV 3609 3228 for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 3610 3229 { 3611 pcMvFieldNeighbours[i<<1 ].getMv().setIDVFlag (false); 3612 pcMvFieldNeighbours[(i<<1)+1].getMv().setIDVFlag (false); 3613 } 3614 #endif 3615 // Clean version for MCL construction align with WD 3616 // init mergCands list 3230 pcMFieldNeighbours[i<<1 ].getMv().setIDVFlag (false); 3231 pcMFieldNeighbours[(i<<1)+1].getMv().setIDVFlag (false); 3232 } 3233 #endif 3234 // init containers 3617 3235 for (Int i = 0; i<MRG_IVSHIFT+1; i++) 3618 {3619 3236 m_mergCands[i].init(); 3620 } 3621 3622 m_baseListidc = 0; 3623 3237 3238 m_numSpatialCands = 0; 3239 3240 ////////////////////////////////// 3241 ///////// GET VSP FLAGS ////////// 3242 ////////////////////////////////// 3624 3243 //left 3625 3244 UInt uiLeftPartIdx = 0; … … 3629 3248 if (getAvailableFlagA1()) 3630 3249 { 3631 m_mergCands[MRG_A1].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3632 #if H_3D_VSP3250 m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3251 #if NH_3D_VSP 3633 3252 , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 3634 #if H_3D_IC3253 #if NH_3D_IC 3635 3254 && !bICFlag 3636 3255 #endif 3637 #if H_3D_ARP3256 #if NH_3D_ARP 3638 3257 && !bARPFlag 3639 3258 #endif 3640 #if H_3D_DBBP3259 #if NH_3D_DBBP 3641 3260 && !bDBBPFlag 3642 3261 #endif 3643 3262 ) 3644 3263 #endif 3264 #if NH_3D_SPIVMP 3645 3265 , false 3266 #endif 3646 3267 ); 3647 m_ baseListidc++;3268 m_numSpatialCands++; 3648 3269 } 3649 3270 3650 3271 // above 3651 3652 3272 if (getAvailableFlagB1()) 3653 3273 { 3654 m_mergCands[MRG_B1].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3655 #if H_3D_VSP3274 m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3275 #if NH_3D_VSP 3656 3276 , false 3657 3277 #endif 3278 #if NH_3D_SPIVMP 3658 3279 , false 3280 #endif 3659 3281 ); 3660 m_ baseListidc++;3282 m_numSpatialCands++; 3661 3283 } 3662 3284 3663 3285 // above right 3664 3665 3286 if (getAvailableFlagB0()) 3666 3287 { 3667 m_mergCands[MRG_B0].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3668 #if H_3D_VSP3669 , 3670 false 3671 # endif3288 m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3289 #if NH_3D_VSP 3290 , false 3291 #endif 3292 #if NH_3D_SPIVMP 3672 3293 , false 3294 #endif 3673 3295 ); 3674 m_ baseListidc++;3296 m_numSpatialCands++; 3675 3297 } 3676 3298 3677 3299 // left bottom 3678 3679 3300 if (getAvailableFlagA0()) 3680 3301 { 3681 m_mergCands[MRG_A0].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3682 #if H_3D_VSP3302 m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3303 #if NH_3D_VSP 3683 3304 , false 3684 3305 #endif 3306 #if NH_3D_SPIVMP 3685 3307 , false 3308 #endif 3686 3309 ); 3687 m_ baseListidc++;3310 m_numSpatialCands++; 3688 3311 } 3689 3312 3690 3313 // above left 3691 3692 3314 if (getAvailableFlagB2()) 3693 3315 { 3694 m_mergCands[MRG_B2].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3695 #if H_3D_VSP3316 m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3317 #if NH_3D_VSP 3696 3318 , false 3697 3319 #endif 3320 #if NH_3D_SPIVMP 3698 3321 , false 3322 #endif 3699 3323 ); 3700 m_baseListidc++; 3701 } 3702 3703 #endif 3704 3705 3706 #if H_3D_IV_MERGE 3324 m_numSpatialCands++; 3325 } 3326 3327 3328 #if NH_3D_TEXT_MERGE 3707 3329 3708 3330 ///////////////////////////////////////////// … … 3730 3352 3731 3353 this->getPartIndexAndSize( uiPUIdx, uiPartAddr, iWidth, iHeight ); 3732 pcTexRec->getTopLeftSamplePos( this->get Addr(), this->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );3354 pcTexRec->getTopLeftSamplePos( this->getCtuRsAddr(), this->getZorderIdxInCtu() + uiPartAddr, iCurrPosX, iCurrPosY ); 3733 3355 3734 3356 Int iPUWidth, iPUHeight, iNumPart, iNumPartLine; … … 3755 3377 3756 3378 Int iTexPosX, iTexPosY; 3379 #if NH_3D_INTEGER_MV_DEPTH 3757 3380 const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 3758 3381 #endif 3759 3382 Int iCenterPosX = iCurrPosX + ( ( iWidth / iPUWidth ) >> 1 ) * iPUWidth + ( iPUWidth >> 1 ); 3760 3383 Int iCenterPosY = iCurrPosY + ( ( iHeight / iPUHeight ) >> 1 ) * iPUHeight + (iPUHeight >> 1); … … 3770 3393 3771 3394 pcTexRec->getCUAddrAndPartIdx( iCenterPosX , iCenterPosY , iTexCenterCUAddr, iTexCenterAbsPartIdx ); 3772 TComDataCU* pcDefaultCU = pcTexPic->getC U( iTexCenterCUAddr );3395 TComDataCU* pcDefaultCU = pcTexPic->getCtu( iTexCenterCUAddr ); 3773 3396 3774 3397 if( pcDefaultCU->getPredictionMode( iTexCenterAbsPartIdx ) != MODE_INTRA ) … … 3789 3412 { 3790 3413 bSPIVMPFlag = true; 3414 #if NH_3D_INTEGER_MV_DEPTH 3791 3415 TComMv cMv = cDefaultMvField.getMv() + cMvRounding; 3792 3416 cMv >>= 2; 3417 #else 3418 TComMv cMv = cDefaultMvField.getMv(); 3419 #endif 3793 3420 cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ; 3794 3421 break; … … 3815 3442 iTexPosY = i + iOffsetY; 3816 3443 pcTexRec->getCUAddrAndPartIdx( iTexPosX, iTexPosY, iTexCUAddr, iTexAbsPartIdx ); 3817 pcTexCU = pcTexPic->getC U( iTexCUAddr );3444 pcTexCU = pcTexPic->getCtu( iTexCUAddr ); 3818 3445 3819 3446 if( pcTexCU && !pcTexCU->isIntra(iTexAbsPartIdx) ) … … 3827 3454 if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) ) 3828 3455 { 3456 #if NH_3D_INTEGER_MV_DEPTH 3829 3457 TComMv cMv = cTexMvField.getMv() + cMvRounding; 3830 3458 cMv >>=2; 3459 #else 3460 TComMv cMv = cTexMvField.getMv(); 3461 #endif 3831 3462 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef); 3832 3463 } … … 3847 3478 } 3848 3479 } 3849 #if H_3D 3850 } 3851 #endif 3480 } 3852 3481 #if H_3D_FCO 3853 3482 } … … 3877 3506 } 3878 3507 } 3508 #endif 3509 3510 #if NH_3D_IV_MERGE 3879 3511 ///////////////////////////////////////////////////////////////// 3880 3512 //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC Candidates ///// … … 3894 3526 if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1) 3895 3527 { 3528 #if NH_3D_IC 3896 3529 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag ); 3530 #else 3531 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, false ); 3532 #endif 3897 3533 } 3898 3534 … … 3950 3586 spiMvpFlag = true; 3951 3587 } 3952 #if H_3D_DBBP3588 #if NH_3D_DBBP 3953 3589 spiMvpFlag &= !bDBBPFlag; 3954 3590 #endif … … 3971 3607 #endif 3972 3608 3609 iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable; 3610 3611 #if NH_3D_VSP 3612 ///////////////////////////////////////////////// 3613 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// 3614 ///////////////////////////////////////////////// 3615 if (iCount<getSlice()->getMaxNumMergeCand()) 3616 { 3617 if ( 3618 (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) && 3619 #if NH_3D_IC 3620 !bICFlag && 3621 #endif 3622 #if NH_3D_ARP 3623 !bARPFlag && 3624 #endif 3973 3625 #if H_3D 3974 iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable; 3626 (nPSW + nPSH > 12) && 3627 #endif 3628 #if NH_3D_DBBP 3629 !bDBBPFlag && 3630 #endif 3631 xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) ) 3632 { 3633 return; 3634 } 3635 3636 // early termination 3637 if (iCount == getSlice()->getMaxNumMergeCand()) 3638 { 3639 return; 3640 } 3641 } 3642 #endif 3643 3644 iCount += m_mergCands[MRG_B0].m_bAvailable; 3645 3646 #if NH_3D_IV_MERGE 3647 ///////////////////////////////////////////// 3648 //////// INTER VIEW DISP COMP (IvDC) //////// 3649 ///////////////////////////////////////////// 3650 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 3651 { 3652 assert(iCount < getSlice()->getMaxNumMergeCand()); 3653 3654 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 3655 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 3656 if( ( ivCandDir[1] & 1 ) == 1 ) 3657 { 3658 tmpMV[0].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] ); 3659 } 3660 if( ( ivCandDir[1] & 2 ) == 2 ) 3661 { 3662 tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 3663 } 3664 3665 Bool bRemoveSpa = false; //pruning to A1, B1 3666 for(Int i = 0; i < 2; i ++) 3667 { 3668 if ( !m_mergCands[MRG_A1+i].m_bAvailable ) 3669 { 3670 continue; 3671 } 3672 if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1]) 3673 { 3674 bRemoveSpa = true; 3675 break; 3676 } 3677 } 3678 if(!bRemoveSpa) 3679 { 3680 #if NH_3D_NBDV 3681 tmpMV[0].getMv().setIDVFlag (false); 3682 tmpMV[1].getMv().setIDVFlag (false); 3683 #endif 3684 m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false); 3685 3686 if ( mrgCandIdx == iCount ) 3687 return; 3688 iCount ++; 3689 3690 // early termination 3691 if (iCount == getSlice()->getMaxNumMergeCand()) 3692 { 3693 return; 3694 } 3695 } 3696 } 3697 #endif // H_3D_IV_MERGE 3698 3699 iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable; 3700 3701 #if NH_3D_IV_MERGE 3702 //////////////////////////////////////////////////// 3703 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 3704 //////////////////////////////////////////////////// 3705 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 3706 { 3707 if(xAddIvMRGCand( mrgCandIdx, iCount, ivCandDir, ivCandMv, ivCandRefIdx ) ) 3708 { 3709 return; 3710 } 3711 //early termination 3712 if (iCount == getSlice()->getMaxNumMergeCand()) 3713 { 3714 return; 3715 } 3716 } 3717 #endif 3718 } 3719 #endif 3720 3721 //! Construct a list of merging candidates 3722 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3723 { 3724 UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx; 3725 #if NH_3D_MLC 3726 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ]; 3975 3727 #else 3728 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 3729 #endif 3730 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 3731 { 3732 abCandIsInter[ui] = false; 3733 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 3734 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 3735 } 3736 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 3737 // compute the location of the current PU 3738 Int xP, yP, nPSW, nPSH; 3739 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 3740 3741 Int iCount = 0; 3742 3743 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 3744 PartSize cCurPS = getPartitionSize( uiAbsPartIdx ); 3745 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 3746 deriveLeftBottomIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 3747 3976 3748 //left 3977 3749 UInt uiLeftPartIdx = 0; 3978 3750 TComDataCU* pcCULeft = 0; 3979 3751 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 3752 3980 3753 Bool isAvailableA1 = pcCULeft && 3981 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 3982 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 3983 !pcCULeft->isIntra( uiLeftPartIdx ) ; 3754 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 3755 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 3756 pcCULeft->isInter( uiLeftPartIdx ) ; 3757 3984 3758 if ( isAvailableA1 ) 3985 3759 { 3760 #if NH_3D_MLC 3761 m_bAvailableFlagA1 = 1; 3762 #endif 3986 3763 abCandIsInter[iCount] = true; 3987 3764 // get Inter Dir … … 3993 3770 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3994 3771 } 3995 3996 3772 if ( mrgCandIdx == iCount ) 3997 3773 { … … 4002 3778 4003 3779 // early termination 4004 if (iCount == getSlice()->getMaxNumMergeCand()) 3780 if (iCount == getSlice()->getMaxNumMergeCand()) 4005 3781 { 4006 3782 return; 4007 3783 } 4008 4009 3784 // above 4010 3785 UInt uiAbovePartIdx = 0; 4011 3786 TComDataCU* pcCUAbove = 0; 4012 3787 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 3788 4013 3789 Bool isAvailableB1 = pcCUAbove && 4014 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 4015 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 4016 !pcCUAbove->isIntra( uiAbovePartIdx ); 3790 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 3791 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 3792 pcCUAbove->isInter( uiAbovePartIdx ); 3793 4017 3794 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 4018 3795 { 3796 #if NH_3D_MLC 3797 m_bAvailableFlagB1 = 1; 3798 #endif 4019 3799 abCandIsInter[iCount] = true; 4020 3800 // get Inter Dir … … 4026 3806 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4027 3807 } 4028 4029 3808 if ( mrgCandIdx == iCount ) 4030 3809 { … … 4034 3813 } 4035 3814 // early termination 4036 if (iCount == getSlice()->getMaxNumMergeCand()) 3815 if (iCount == getSlice()->getMaxNumMergeCand()) 4037 3816 { 4038 3817 return; … … 4043 3822 TComDataCU* pcCUAboveRight = 0; 4044 3823 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 3824 4045 3825 Bool isAvailableB0 = pcCUAboveRight && 4046 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 4047 !pcCUAboveRight->isIntra( uiAboveRightPartIdx ); 3826 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 3827 pcCUAboveRight->isInter( uiAboveRightPartIdx ); 3828 4048 3829 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4049 3830 { 3831 #if NH_3D_MLC 3832 m_bAvailableFlagB0 = 1; 3833 #endif 4050 3834 abCandIsInter[iCount] = true; 4051 3835 // get Inter Dir … … 4057 3841 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4058 3842 } 4059 4060 3843 if ( mrgCandIdx == iCount ) 4061 3844 { … … 4065 3848 } 4066 3849 // early termination 4067 if (iCount == getSlice()->getMaxNumMergeCand()) 3850 if (iCount == getSlice()->getMaxNumMergeCand()) 4068 3851 { 4069 3852 return; 4070 3853 } 4071 #endif 4072 4073 4074 #if H_3D_VSP 4075 ///////////////////////////////////////////////// 4076 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// 4077 ///////////////////////////////////////////////// 4078 if (iCount<getSlice()->getMaxNumMergeCand()) 4079 { 4080 if ( 4081 (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) && 4082 #if H_3D_IC 4083 !bICFlag && 4084 #endif 4085 #if H_3D_ARP 4086 !bARPFlag && 4087 #endif 4088 #if H_3D 4089 (nPSW + nPSH > 12) && 4090 #endif 4091 #if H_3D_DBBP 4092 !bDBBPFlag && 4093 #endif 4094 xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) ) 4095 { 4096 return; 4097 } 4098 4099 // early termination 4100 if (iCount == getSlice()->getMaxNumMergeCand()) 4101 { 4102 return; 4103 } 4104 #endif 4105 #if H_3D_VSP 4106 } 4107 #endif 4108 4109 #if H_3D 4110 iCount += m_mergCands[MRG_B0].m_bAvailable; 4111 #endif 4112 4113 4114 #if H_3D_IV_MERGE 4115 ///////////////////////////////////////////// 4116 //////// INTER VIEW DISP COMP (IvDC) //////// 4117 ///////////////////////////////////////////// 4118 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 4119 { 4120 assert(iCount < getSlice()->getMaxNumMergeCand()); 4121 4122 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4123 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4124 if( ( ivCandDir[1] & 1 ) == 1 ) 4125 { 4126 tmpMV[0].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] ); 4127 } 4128 if( ( ivCandDir[1] & 2 ) == 2 ) 4129 { 4130 tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 4131 } 4132 4133 Bool bRemoveSpa = false; //pruning to A1, B1 4134 for(Int i = 0; i < 2; i ++) 4135 { 4136 if ( !m_mergCands[MRG_A1+i].m_bAvailable ) 4137 { 4138 continue; 4139 } 4140 if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1]) 4141 { 4142 bRemoveSpa = true; 4143 break; 4144 } 4145 } 4146 if(!bRemoveSpa) 4147 { 4148 #if H_3D_NBDV 4149 tmpMV[0].getMv().setIDVFlag (false); 4150 tmpMV[1].getMv().setIDVFlag (false); 4151 #endif 4152 m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false); 4153 4154 if ( mrgCandIdx == iCount ) 4155 return; 4156 iCount ++; 4157 4158 // early termination 4159 if (iCount == getSlice()->getMaxNumMergeCand()) 4160 { 4161 return; 4162 } 4163 } 4164 } 4165 #endif // H_3D_IV_MERGE 4166 4167 4168 #if H_3D 4169 iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable; 4170 #else 3854 4171 3855 //left bottom 4172 3856 UInt uiLeftBottomPartIdx = 0; 4173 3857 TComDataCU* pcCULeftBottom = 0; 4174 3858 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 3859 4175 3860 Bool isAvailableA0 = pcCULeftBottom && 4176 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 4177 !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ; 3861 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 3862 pcCULeftBottom->isInter( uiLeftBottomPartIdx ) ; 3863 4178 3864 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4179 3865 { 3866 #if NH_3D_MLC 3867 m_bAvailableFlagA0 = 1; 3868 #endif 4180 3869 abCandIsInter[iCount] = true; 4181 3870 // get Inter Dir … … 4194 3883 } 4195 3884 // early termination 4196 if (iCount == getSlice()->getMaxNumMergeCand()) 3885 if (iCount == getSlice()->getMaxNumMergeCand()) 4197 3886 { 4198 3887 return; 4199 3888 } 4200 3889 4201 // above left 3890 // above left 4202 3891 if( iCount < 4 ) 4203 3892 { … … 4205 3894 TComDataCU* pcCUAboveLeft = 0; 4206 3895 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 3896 4207 3897 Bool isAvailableB2 = pcCUAboveLeft && 4208 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 4209 !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ); 3898 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 3899 pcCUAboveLeft->isInter( uiAboveLeftPartIdx ); 3900 4210 3901 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4211 3902 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) ) 4212 3903 { 3904 #if NH_3D_MLC 3905 m_bAvailableFlagB2 = 1; 3906 #endif 4213 3907 abCandIsInter[iCount] = true; 4214 3908 // get Inter Dir … … 4228 3922 } 4229 3923 // early termination 4230 if (iCount == getSlice()->getMaxNumMergeCand()) 3924 if (iCount == getSlice()->getMaxNumMergeCand()) 4231 3925 { 4232 3926 return; 4233 3927 } 4234 #endif 4235 4236 4237 #if H_3D_IV_MERGE 4238 //////////////////////////////////////////////////// 4239 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 4240 //////////////////////////////////////////////////// 4241 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 4242 { 4243 if(xAddIvMRGCand( mrgCandIdx, iCount, ivCandDir, ivCandMv, ivCandRefIdx ) ) 4244 { 4245 return; 4246 } 4247 //early termination 4248 if (iCount == getSlice()->getMaxNumMergeCand()) 4249 { 4250 return; 4251 } 4252 } 4253 #endif 4254 #if !H_3D 4255 if ( getSlice()->getEnableTMVPFlag()) 3928 3929 if ( getSlice()->getEnableTMVPFlag() ) 4256 3930 { 4257 3931 //>> MTK colocated-RightBottom 4258 3932 UInt uiPartIdxRB; 4259 3933 4260 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 3934 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 4261 3935 4262 3936 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 4263 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 3937 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 3938 const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight(); 4264 3939 4265 3940 TComMv cColMv; 4266 3941 Int iRefIdx; 4267 Int uiLCUIdx = -1; 4268 4269 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 4270 { 4271 } 4272 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 4273 { 4274 } 4275 else 4276 { 4277 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 4278 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 4279 { 4280 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 4281 uiLCUIdx = getAddr(); 4282 } 4283 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 4284 { 4285 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 4286 } 4287 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 3942 Int ctuRsAddr = -1; 3943 3944 if ( ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () ) // image boundary check 3945 && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 3946 { 3947 if ( ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) && // is not at the last column of CTU 3948 ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) ) // is not at the last row of CTU 3949 { 3950 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + numPartInCtuWidth + 1 ]; 3951 ctuRsAddr = getCtuRsAddr(); 3952 } 3953 else if ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) // is not at the last column of CTU But is last row of CTU 3954 { 3955 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + numPartInCtuWidth + 1) % m_pcPic->getNumPartitionsInCtu() ]; 3956 } 3957 else if ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) // is not at the last row of CTU But is last column of CTU 4288 3958 { 4289 3959 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 4290 uiLCUIdx = getAddr() + 1;4291 } 4292 else //is the right bottom corner of LCU3960 ctuRsAddr = getCtuRsAddr() + 1; 3961 } 3962 else //is the right bottom corner of CTU 4293 3963 { 4294 3964 uiAbsPartAddr = 0; 4295 3965 } 4296 3966 } 4297 4298 3967 4299 3968 iRefIdx = 0; 3969 4300 3970 Bool bExistMV = false; 4301 3971 UInt uiPartIdxCenter; 4302 UInt uiCurLCUIdx = getAddr();4303 3972 Int dir = 0; 4304 3973 UInt uiArrayAddr = iCount; 4305 3974 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4306 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx );3975 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_0, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx ); 4307 3976 if( bExistMV == false ) 4308 3977 { 4309 bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter,cColMv, iRefIdx );3978 bExistMV = xGetColMVP( REF_PIC_LIST_0, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4310 3979 } 4311 3980 if( bExistMV ) … … 4317 3986 if ( getSlice()->isInterB() ) 4318 3987 { 4319 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 3988 #if NH_3D_TMVP 3989 iRefIdx = 0; 3990 #endif 3991 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_1, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx); 4320 3992 if( bExistMV == false ) 4321 3993 { 4322 bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx );3994 bExistMV = xGetColMVP( REF_PIC_LIST_1, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4323 3995 } 4324 3996 if( bExistMV ) … … 4328 4000 } 4329 4001 } 4330 4002 4331 4003 if (dir != 0) 4332 4004 { 4333 4005 puhInterDirNeighbours[uiArrayAddr] = dir; 4334 4006 abCandIsInter[uiArrayAddr] = true; 4007 #if NH_3D_NBDV 4008 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 4009 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 4010 #endif 4011 4335 4012 if ( mrgCandIdx == iCount ) 4336 4013 { … … 4340 4017 } 4341 4018 } 4342 // early termination 4343 if (iCount == getSlice()->getMaxNumMergeCand()) 4019 // early termination 4020 if (iCount == getSlice()->getMaxNumMergeCand()) 4344 4021 { 4345 4022 return; 4346 4023 } 4024 4347 4025 UInt uiArrayAddr = iCount; 4348 4026 UInt uiCutoff = uiArrayAddr; 4349 4350 if ( getSlice()->isInterB()) 4351 { 4352 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 4353 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 4027 4028 #if NH_3D_MLC 4029 if ( getSlice()->isInterB() && iCount<5) 4030 #else 4031 if ( getSlice()->isInterB() ) 4032 #endif 4033 { 4034 static const UInt NUM_PRIORITY_LIST=12; 4035 static const UInt uiPriorityList0[NUM_PRIORITY_LIST] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 4036 static const UInt uiPriorityList1[NUM_PRIORITY_LIST] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 4354 4037 4355 4038 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 4356 4039 { 4357 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 4040 assert(idx<NUM_PRIORITY_LIST); 4041 Int i = uiPriorityList0[idx]; 4042 Int j = uiPriorityList1[idx]; 4358 4043 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 4359 4044 { … … 4379 4064 } 4380 4065 // early termination 4381 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 4066 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 4382 4067 { 4383 4068 return; 4384 4069 } 4070 4385 4071 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0); 4072 4386 4073 Int r = 0; 4387 4074 Int refcnt = 0; … … 4398 4085 } 4399 4086 uiArrayAddr++; 4087 4400 4088 if ( refcnt == iNumRefIdx - 1 ) 4401 4089 { … … 4408 4096 } 4409 4097 } 4410 4411 4098 numValidMergeCand = uiArrayAddr; 4412 #endif 4413 } 4414 #else 4415 4416 //! Construct a list of merging candidates 4417 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 4418 { 4419 UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx; 4420 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 4421 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 4422 { 4423 abCandIsInter[ui] = false; 4424 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 4425 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 4426 } 4427 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 4428 // compute the location of the current PU 4429 Int xP, yP, nPSW, nPSH; 4430 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 4431 4432 Int iCount = 0; 4433 4434 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4435 PartSize cCurPS = getPartitionSize( uiAbsPartIdx ); 4436 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 4437 deriveLeftBottomIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 4438 4439 //left 4440 UInt uiLeftPartIdx = 0; 4441 TComDataCU* pcCULeft = 0; 4442 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 4443 4444 Bool isAvailableA1 = pcCULeft && 4445 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 4446 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 4447 pcCULeft->isInter( uiLeftPartIdx ) ; 4448 4449 if ( isAvailableA1 ) 4450 { 4451 abCandIsInter[iCount] = true; 4452 // get Inter Dir 4453 puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx ); 4454 // get Mv from Left 4455 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4456 if ( getSlice()->isInterB() ) 4457 { 4458 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4459 } 4460 if ( mrgCandIdx == iCount ) 4461 { 4462 return; 4463 } 4464 iCount ++; 4465 } 4466 4467 // early termination 4468 if (iCount == getSlice()->getMaxNumMergeCand()) 4469 { 4470 return; 4471 } 4472 // above 4473 UInt uiAbovePartIdx = 0; 4474 TComDataCU* pcCUAbove = 0; 4475 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 4476 4477 Bool isAvailableB1 = pcCUAbove && 4478 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 4479 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 4480 pcCUAbove->isInter( uiAbovePartIdx ); 4481 4482 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 4483 { 4484 abCandIsInter[iCount] = true; 4485 // get Inter Dir 4486 puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx ); 4487 // get Mv from Left 4488 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4489 if ( getSlice()->isInterB() ) 4490 { 4491 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4492 } 4493 if ( mrgCandIdx == iCount ) 4494 { 4495 return; 4496 } 4497 iCount ++; 4498 } 4499 // early termination 4500 if (iCount == getSlice()->getMaxNumMergeCand()) 4501 { 4502 return; 4503 } 4504 4505 // above right 4506 UInt uiAboveRightPartIdx = 0; 4507 TComDataCU* pcCUAboveRight = 0; 4508 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 4509 4510 Bool isAvailableB0 = pcCUAboveRight && 4511 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 4512 pcCUAboveRight->isInter( uiAboveRightPartIdx ); 4513 4514 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4515 { 4516 abCandIsInter[iCount] = true; 4517 // get Inter Dir 4518 puhInterDirNeighbours[iCount] = pcCUAboveRight->getInterDir( uiAboveRightPartIdx ); 4519 // get Mv from Left 4520 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4521 if ( getSlice()->isInterB() ) 4522 { 4523 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4524 } 4525 if ( mrgCandIdx == iCount ) 4526 { 4527 return; 4528 } 4529 iCount ++; 4530 } 4531 // early termination 4532 if (iCount == getSlice()->getMaxNumMergeCand()) 4533 { 4534 return; 4535 } 4536 4537 //left bottom 4538 UInt uiLeftBottomPartIdx = 0; 4539 TComDataCU* pcCULeftBottom = 0; 4540 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 4541 4542 Bool isAvailableA0 = pcCULeftBottom && 4543 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 4544 pcCULeftBottom->isInter( uiLeftBottomPartIdx ) ; 4545 4546 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4547 { 4548 abCandIsInter[iCount] = true; 4549 // get Inter Dir 4550 puhInterDirNeighbours[iCount] = pcCULeftBottom->getInterDir( uiLeftBottomPartIdx ); 4551 // get Mv from Left 4552 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4553 if ( getSlice()->isInterB() ) 4554 { 4555 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4556 } 4557 if ( mrgCandIdx == iCount ) 4558 { 4559 return; 4560 } 4561 iCount ++; 4562 } 4563 // early termination 4564 if (iCount == getSlice()->getMaxNumMergeCand()) 4565 { 4566 return; 4567 } 4568 4569 // above left 4570 if( iCount < 4 ) 4571 { 4572 UInt uiAboveLeftPartIdx = 0; 4573 TComDataCU* pcCUAboveLeft = 0; 4574 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 4575 4576 Bool isAvailableB2 = pcCUAboveLeft && 4577 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 4578 pcCUAboveLeft->isInter( uiAboveLeftPartIdx ); 4579 4580 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4581 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) ) 4582 { 4583 abCandIsInter[iCount] = true; 4584 // get Inter Dir 4585 puhInterDirNeighbours[iCount] = pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx ); 4586 // get Mv from Left 4587 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4588 if ( getSlice()->isInterB() ) 4589 { 4590 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4591 } 4592 if ( mrgCandIdx == iCount ) 4593 { 4594 return; 4595 } 4596 iCount ++; 4597 } 4598 } 4599 // early termination 4600 if (iCount == getSlice()->getMaxNumMergeCand()) 4601 { 4602 return; 4603 } 4604 4605 if ( getSlice()->getEnableTMVPFlag() ) 4606 { 4607 //>> MTK colocated-RightBottom 4608 UInt uiPartIdxRB; 4609 4610 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 4611 4612 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 4613 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 4614 const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight(); 4615 4616 TComMv cColMv; 4617 Int iRefIdx; 4618 Int ctuRsAddr = -1; 4619 4620 if ( ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () ) // image boundary check 4621 && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 4622 { 4623 if ( ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) && // is not at the last column of CTU 4624 ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) ) // is not at the last row of CTU 4625 { 4626 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + numPartInCtuWidth + 1 ]; 4627 ctuRsAddr = getCtuRsAddr(); 4628 } 4629 else if ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) // is not at the last column of CTU But is last row of CTU 4630 { 4631 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + numPartInCtuWidth + 1) % m_pcPic->getNumPartitionsInCtu() ]; 4632 } 4633 else if ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) // is not at the last row of CTU But is last column of CTU 4634 { 4635 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 4636 ctuRsAddr = getCtuRsAddr() + 1; 4637 } 4638 else //is the right bottom corner of CTU 4639 { 4640 uiAbsPartAddr = 0; 4641 } 4642 } 4643 4644 iRefIdx = 0; 4645 4646 Bool bExistMV = false; 4647 UInt uiPartIdxCenter; 4648 Int dir = 0; 4649 UInt uiArrayAddr = iCount; 4650 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4651 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_0, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx ); 4652 if( bExistMV == false ) 4653 { 4654 bExistMV = xGetColMVP( REF_PIC_LIST_0, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4655 } 4656 if( bExistMV ) 4657 { 4658 dir |= 1; 4659 pcMvFieldNeighbours[ 2 * uiArrayAddr ].setMvField( cColMv, iRefIdx ); 4660 } 4661 4662 if ( getSlice()->isInterB() ) 4663 { 4664 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_1, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx); 4665 if( bExistMV == false ) 4666 { 4667 bExistMV = xGetColMVP( REF_PIC_LIST_1, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4668 } 4669 if( bExistMV ) 4670 { 4671 dir |= 2; 4672 pcMvFieldNeighbours[ 2 * uiArrayAddr + 1 ].setMvField( cColMv, iRefIdx ); 4673 } 4674 } 4675 4676 if (dir != 0) 4677 { 4678 puhInterDirNeighbours[uiArrayAddr] = dir; 4679 abCandIsInter[uiArrayAddr] = true; 4680 4681 if ( mrgCandIdx == iCount ) 4682 { 4683 return; 4684 } 4685 iCount++; 4686 } 4687 } 4688 // early termination 4689 if (iCount == getSlice()->getMaxNumMergeCand()) 4690 { 4691 return; 4692 } 4693 4694 UInt uiArrayAddr = iCount; 4695 UInt uiCutoff = uiArrayAddr; 4696 4697 if ( getSlice()->isInterB() ) 4698 { 4699 static const UInt NUM_PRIORITY_LIST=12; 4700 static const UInt uiPriorityList0[NUM_PRIORITY_LIST] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 4701 static const UInt uiPriorityList1[NUM_PRIORITY_LIST] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 4702 4703 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 4704 { 4705 assert(idx<NUM_PRIORITY_LIST); 4706 Int i = uiPriorityList0[idx]; 4707 Int j = uiPriorityList1[idx]; 4708 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 4709 { 4710 abCandIsInter[uiArrayAddr] = true; 4711 puhInterDirNeighbours[uiArrayAddr] = 3; 4712 4713 // get Mv from cand[i] and cand[j] 4714 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx()); 4715 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(j<<1)+1].getMv(), pcMvFieldNeighbours[(j<<1)+1].getRefIdx()); 4716 4717 Int iRefPOCL0 = m_pcSlice->getRefPOC( REF_PIC_LIST_0, pcMvFieldNeighbours[(uiArrayAddr<<1)].getRefIdx() ); 4718 Int iRefPOCL1 = m_pcSlice->getRefPOC( REF_PIC_LIST_1, pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getRefIdx() ); 4719 if (iRefPOCL0 == iRefPOCL1 && pcMvFieldNeighbours[(uiArrayAddr<<1)].getMv() == pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv()) 4720 { 4721 abCandIsInter[uiArrayAddr] = false; 4722 } 4723 else 4724 { 4725 uiArrayAddr++; 4726 } 4727 } 4728 } 4729 } 4730 // early termination 4731 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 4732 { 4733 return; 4734 } 4735 4736 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0); 4737 4738 Int r = 0; 4739 Int refcnt = 0; 4740 while (uiArrayAddr < getSlice()->getMaxNumMergeCand()) 4741 { 4742 abCandIsInter[uiArrayAddr] = true; 4743 puhInterDirNeighbours[uiArrayAddr] = 1; 4744 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField( TComMv(0, 0), r); 4745 4746 if ( getSlice()->isInterB() ) 4747 { 4748 puhInterDirNeighbours[uiArrayAddr] = 3; 4749 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r); 4750 } 4751 uiArrayAddr++; 4752 4753 if ( refcnt == iNumRefIdx - 1 ) 4754 { 4755 r = 0; 4756 } 4757 else 4758 { 4759 ++r; 4760 ++refcnt; 4761 } 4762 } 4763 numValidMergeCand = uiArrayAddr; 4764 } 4765 #endif 4099 } 4766 4100 4767 4101 /** Check whether the current PU and a spatial neighboring PU are in a same ME region. … … 4978 4312 } 4979 4313 if ( ctuRsAddr >= 0 && xGetColMVP( eRefPicList, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx_Col 4980 #if H_3D_TMVP4314 #if NH_3D_TMVP 4981 4315 , 0 4982 4316 #endif … … 4990 4324 xDeriveCenterIdx( uiPartIdx, uiPartIdxCenter ); 4991 4325 if (xGetColMVP( eRefPicList, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx_Col 4992 #if H_3D_TMVP4326 #if NH_3D_TMVP 4993 4327 , 0 4994 4328 #endif … … 5021 4355 UInt partAddr; 5022 4356 5023 #if H_3D_DBBP4357 #if NH_3D_DBBP 5024 4358 if( getDBBPFlag(0) ) 5025 4359 { … … 5041 4375 const TComSPS &sps=*(m_pcSlice->getSPS()); 5042 4376 Int iMvShift = 2; 5043 #if H_3D_IC4377 #if NH_3D_INTEGER_MV_DEPTH 5044 4378 if( getSlice()->getIsDepth() ) 5045 4379 iMvShift = 0; … … 5114 4448 return ( getSkipFlag( uiPartIdx ) ); 5115 4449 } 5116 5117 #if H_3D_IC5118 Bool TComDataCU::isIC( UInt uiPartIdx )5119 {5120 if ( m_pcSlice->isIntra () )5121 {5122 return false;5123 }5124 return ( ( getSkipFlag(uiPartIdx) || getPredictionMode(uiPartIdx) == MODE_INTER) && getICFlag( uiPartIdx ) && isICFlagRequired( uiPartIdx ) );5125 }5126 #endif5127 4450 5128 4451 // ==================================================================================================================== … … 5342 4665 5343 4666 Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 5344 #if H_3D_TMVP4667 #if NH_3D_TMVP 5345 4668 , Bool bMRG 5346 4669 #endif … … 5394 4717 if ( bIsCurrRefLongTerm != bIsColRefLongTerm ) 5395 4718 { 5396 #if H_3D_TMVP4719 #if NH_3D_TMVP 5397 4720 Int iAlterRefIdx = m_pcSlice->getAlterRefIdx(eRefPicList); 5398 4721 if(bMRG && iAlterRefIdx > 0) … … 5407 4730 #endif 5408 4731 return false; 5409 #if H_3D_TMVP4732 #if NH_3D_TMVP 5410 4733 } 5411 4734 #endif … … 5414 4737 if ( bIsCurrRefLongTerm || bIsColRefLongTerm ) 5415 4738 { 5416 #if H_3D_TMVP4739 #if NH_3D_TMVP 5417 4740 Int iCurrViewId = m_pcSlice->getViewId (); 5418 4741 Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId (); 5419 Int iColViewId = pColC U->getSlice()->getViewId();5420 Int iColRefViewId = pColC U->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId();4742 Int iColViewId = pColCtu->getSlice()->getViewId(); 4743 Int iColRefViewId = pColCtu->getSlice()->getRefPic( eColRefPicList, pColCtu->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId(); 5421 4744 iScale = 4096; 5422 4745 if ( iCurrRefViewId != iCurrViewId && iColViewId != iColRefViewId ) … … 5432 4755 #endif 5433 4756 rcMv = cColMv; 5434 #if H_3D_TMVP4757 #if NH_3D_TMVP 5435 4758 } 5436 4759 #endif … … 5575 4898 #endif 5576 4899 5577 #if H_3D_IV_MERGE4900 #if NH_3D_IV_MERGE 5578 4901 Void TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 5579 4902 { … … 5585 4908 Int iViewIdx = getSlice()->getDefaultRefViewIdx(); 5586 4909 pDisp->m_aVIdxCan = iViewIdx; 5587 Int iDisp = getSlice()->getDepthToDisparityB( iViewIdx )[ (Int64) (1 << ( getSlice()->getSPS()->getBitDepth Y() - 1 )) ];4910 Int iDisp = getSlice()->getDepthToDisparityB( iViewIdx )[ (Int64) (1 << ( getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 1 )) ]; 5588 4911 5589 4912 cMv.setHor(iDisp); … … 5654 4977 } 5655 4978 #endif 5656 #if H_3D_NBDV4979 #if NH_3D_NBDV 5657 4980 //Notes from QC: 5658 //TBD#1: DoNBDV related contributions are just partially integrated under the marco of H_3D_NBDV_REF, remove this comment once DoNBDV and BVSP are done4981 //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 5659 4982 //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 5660 4983 //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 5661 4984 Void TComDataCU::getDisMvpCandNBDV( DisInfo* pDInfo 5662 #if H_3D_NBDV_REF4985 #if NH_3D_NBDV_REF 5663 4986 , Bool bDepthRefine 5664 4987 #endif … … 5683 5006 } 5684 5007 } 5685 #if H_3D_NBDV_REF5008 #if NH_3D_NBDV_REF 5686 5009 if( !m_pcSlice->getDepthRefinementFlag( ) ) 5687 5010 { … … 5706 5029 ///*** Derive center position *** 5707 5030 UInt uiPartIdxCenter; 5708 Int uiLCUIdx = getAddr();5031 Int uiLCUIdx = getCtuRsAddr(); 5709 5032 xDeriveCenterIdx(uiPartIdx, uiPartIdxCenter ); 5710 5033 … … 5733 5056 pDInfo->m_aVIdxCan = iTargetViewIdx; 5734 5057 5735 #if H_3D_NBDV_REF5058 #if NH_3D_NBDV_REF 5736 5059 TComPic* picDepth = NULL; 5737 5060 #if H_3D_FCO_VSP_DONBDV_E0163 … … 5755 5078 } 5756 5079 pDInfo->m_acDoNBDV = cColMv; 5757 #endif // H_3D_NBDV_REF5080 #endif //NH_3D_NBDV_REF 5758 5081 return; 5759 5082 } … … 5769 5092 bCheckMcpDv = true; 5770 5093 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT 5771 #if H_3D_NBDV_REF5094 #if NH_3D_NBDV_REF 5772 5095 , bDepthRefine 5773 5096 #endif … … 5779 5102 if(pcTmpCU != NULL ) 5780 5103 { 5781 bCheckMcpDv = ( ( get Addr() - pcTmpCU->getAddr() ) == 0);5104 bCheckMcpDv = ( ( getCtuRsAddr() - pcTmpCU->getCtuRsAddr() ) == 0); 5782 5105 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_ABOVE 5783 #if H_3D_NBDV_REF5106 #if NH_3D_NBDV_REF 5784 5107 , bDepthRefine 5785 5108 #endif … … 5800 5123 pDInfo->m_acNBDV = cDispVec; 5801 5124 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 5802 #if H_3D_NBDV_REF5125 #if NH_3D_NBDV_REF 5803 5126 #if H_3D_FCO_VSP_DONBDV_E0163 5804 5127 TComPic* picDepth = NULL; … … 5838 5161 pDInfo->m_aVIdxCan = getSlice()->getDefaultRefViewIdx(); 5839 5162 5840 #if H_3D_NBDV_REF5163 #if NH_3D_NBDV_REF 5841 5164 TComPic* picDepth = NULL; 5842 5165 #if H_3D_FCO_VSP_DONBDV_E0163 … … 5864 5187 } 5865 5188 5866 #if H_3D_NBDV_REF5189 #if NH_3D_NBDV_REF 5867 5190 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iBlkWidth, Int iBlkHeight, Int* aiShiftLUT ) 5868 5191 { 5869 Int iPictureWidth = pcBaseViewDepthPicYuv->getWidth( );5870 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight( );5871 5192 Int iPictureWidth = pcBaseViewDepthPicYuv->getWidth(COMPONENT_Y); 5193 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(COMPONENT_Y); 5194 5872 5195 Int depthStartPosX = Clip3(0, iPictureWidth - 1, iBlkX + ((mv->getHor()+2)>>2)); 5873 5196 Int depthStartPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((mv->getVer()+2)>>2)); … … 5875 5198 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5876 5199 5877 Pel* depthTL = pcBaseViewDepthPicYuv->get LumaAddr();5878 Int depStride = pcBaseViewDepthPicYuv->getStride( );5200 Pel* depthTL = pcBaseViewDepthPicYuv->getAddr(COMPONENT_Y); 5201 Int depStride = pcBaseViewDepthPicYuv->getStride(COMPONENT_Y); 5879 5202 5880 5203 Pel maxDepthVal = 0; … … 5891 5214 if (picDepth) 5892 5215 { 5893 UInt uiAbsPartAddrCurrCU = m_ uiAbsIdxInLCU+ uiPartAddr;5216 UInt uiAbsPartAddrCurrCU = m_absZIdxInCtu + uiPartAddr; 5894 5217 Int iWidth, iHeight; 5895 5218 getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); // The modified value of uiPartAddr won't be used any more 5896 5219 5897 5220 TComPicYuv* pcBaseViewDepthPicYuv = picDepth->getPicYuvRec(); 5898 Int iBlkX = ( getAddr() % picDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5899 Int iBlkY = ( getAddr() / picDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5221 const TComSPS &sps =*(getSlice()->getSPS()); 5222 Int iBlkX = ( getCtuRsAddr() % picDepth->getFrameWidthInCtus() ) * sps.getMaxCUWidth() + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5223 Int iBlkY = ( getCtuRsAddr() / picDepth->getFrameWidthInCtus() ) * sps.getMaxCUHeight() + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5900 5224 5901 5225 Int* aiShiftLUT = getSlice()->getDepthToDisparityB(refViewIdx ); … … 5905 5229 } 5906 5230 } 5907 #endif // H_3D_NBDV_REF5231 #endif //NH_3D_NBDV_REF 5908 5232 5909 5233 5910 5234 Bool TComDataCU::xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paIDVInfo, UInt uiMvpDvPos 5911 #if H_3D_NBDV_REF5235 #if NH_3D_NBDV_REF 5912 5236 , Bool bDepthRefine 5913 5237 #endif … … 5930 5254 pNbDvInfo->m_acNBDV = cMvPred; 5931 5255 pNbDvInfo->m_aVIdxCan = refViewIdx; 5932 #if H_3D_NBDV_REF5256 #if NH_3D_NBDV_REF 5933 5257 TComPic* picDepth = NULL; 5934 5258 assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC()); … … 5976 5300 { 5977 5301 UInt uiPartIdx = 0; 5978 UInt uiNumPartInCUWidth = m_pcPic->getNumPartIn Width();5979 Int uiLCUIdx = get Addr();5302 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInCtuWidth(); 5303 Int uiLCUIdx = getCtuRsAddr(); 5980 5304 5981 5305 UInt uiPartIdxRB; … … 5983 5307 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5984 5308 5985 if (( m_pcPic->getC U(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )5309 if (( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 5986 5310 { 5987 5311 riLCUIdxRBNb = -1; 5988 5312 riPartIdxRBNb = -1; 5989 5313 } 5990 else if(( m_pcPic->getC U(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )5314 else if(( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 5991 5315 { 5992 5316 riLCUIdxRBNb = -1; … … 5996 5320 { 5997 5321 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5998 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartIn Height() - 1 ) ) // is not at the last row of LCU5322 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInCtuHeight() - 1 ) ) // is not at the last row of LCU 5999 5323 { 6000 5324 riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; … … 6006 5330 riLCUIdxRBNb = -1; 6007 5331 } 6008 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartIn Height() - 1 ) // is not at the last row of LCU But is last column of LCU5332 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInCtuHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 6009 5333 { 6010 5334 riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; … … 6022 5346 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ) 6023 5347 { 6024 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 5348 #if NH_3D_VSP // bug fix 5349 UInt uiCurrPartNumb = m_pcPic->getNumPartitionsInCtu() >> (uiDepth << 1); 5350 assert(m_pcPic->getNumPartitionsInCtu() ==m_pcPic->getNumPartInCtuWidth()*m_pcPic->getNumPartInCtuHeight()); 5351 5352 #else 5353 UInt uiCurrPartNumb = m_pcPic->getNumPartInCtuWidth() >> (uiDepth << 1); 5354 #endif 6025 5355 for (UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 6026 5356 { … … 6028 5358 } 6029 5359 } 6030 #if H_3D_VSP5360 #if NH_3D_VSP || NH_3D_DBBP 6031 5361 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ) 6032 5362 { … … 6041 5371 Int iColViewIdx, iColRefViewIdx; 6042 5372 TComPic *pColPic = getSlice()->getRefPic( eRefPicList, refidx); 6043 TComDataCU *pColCU = pColPic->getC U( uiCUAddr );5373 TComDataCU *pColCU = pColPic->getCtu( uiCUAddr ); 6044 5374 iColViewIdx = pColCU->getSlice()->getViewIndex(); 6045 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)== SIZE_NONE||pColCU->isIntra(uiPartUnitIdx))5375 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==NUMBER_OF_PART_SIZES||pColCU->isIntra(uiPartUnitIdx)) 6046 5376 { 6047 5377 return false; … … 6105 5435 6106 5436 Bool depthRefineFlag = false; 6107 #if H_3D_NBDV_REF5437 #if NH_3D_NBDV_REF 6108 5438 depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 6109 #endif // H_3D_NBDV_REF5439 #endif // NH_3D_NBDV_REF 6110 5440 6111 5441 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; … … 6161 5491 #endif 6162 5492 6163 #if H_3D_SPIVMP5493 #if NH_3D_SPIVMP 6164 5494 Void TComDataCU::getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight) 6165 5495 { … … 6178 5508 Void TComDataCU::getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ) 6179 5509 { 6180 uiBaseAbsPartIdx += m_ uiAbsIdxInLCU;5510 uiBaseAbsPartIdx += m_absZIdxInCtu; 6181 5511 Int iBasePelX = g_auiRasterToPelX[g_auiZscanToRaster[uiBaseAbsPartIdx]]; 6182 5512 Int iBasePelY = g_auiRasterToPelY[g_auiZscanToRaster[uiBaseAbsPartIdx]]; 6183 5513 Int iCurrPelX = iBasePelX + iPartIdx%iNumPartLine * iWidth; 6184 5514 Int iCurrPelY = iBasePelY + iPartIdx/iNumPartLine * iHeight; 6185 Int iCurrRaster = iCurrPelY / getPic()->getMinCUHeight() * getPic()->getNumPartIn Width() + iCurrPelX/getPic()->getMinCUWidth();5515 Int iCurrRaster = iCurrPelY / getPic()->getMinCUHeight() * getPic()->getNumPartInCtuWidth() + iCurrPelX/getPic()->getMinCUWidth(); 6186 5516 ruiPartAddr = g_auiRasterToZscan[iCurrRaster]; 6187 ruiPartAddr -= m_ uiAbsIdxInLCU;5517 ruiPartAddr -= m_absZIdxInCtu; 6188 5518 } 6189 5519 6190 5520 Void TComDataCU::setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ) 6191 5521 { 6192 uiAbsPartIdx += getZorderIdxInC U();5522 uiAbsPartIdx += getZorderIdxInCtu(); 6193 5523 Int iStartPelX = g_auiRasterToPelX[g_auiZscanToRaster[uiAbsPartIdx]]; 6194 5524 Int iStartPelY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIdx]]; … … 6202 5532 for (Int j=iStartPelX; j < iEndPelX; j += getPic()->getMinCUWidth()) 6203 5533 { 6204 iCurrRaster = i / getPic()->getMinCUHeight() * getPic()->getNumPartIn Width() + j/getPic()->getMinCUWidth();5534 iCurrRaster = i / getPic()->getMinCUHeight() * getPic()->getNumPartInCtuWidth() + j/getPic()->getMinCUWidth(); 6205 5535 uiPartAddr = g_auiRasterToZscan[iCurrRaster]; 6206 uiPartAddr -= getZorderIdxInC U();5536 uiPartAddr -= getZorderIdxInCtu(); 6207 5537 6208 5538 m_puhInterDir[uiPartAddr] = uiDir; … … 6212 5542 #endif 6213 5543 6214 #if H_3D_IV_MERGE5544 #if NH_3D_IV_MERGE 6215 5545 Bool 6216 5546 TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth 6217 #if H_3D_SPIVMP5547 #if NH_3D_SPIVMP 6218 5548 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 6219 5549 #endif … … 6234 5564 6235 5565 Int iCurrPosX, iCurrPosY; 6236 pcBaseRec->getTopLeftSamplePos( get Addr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );6237 6238 #if ! H_3D_SPIVMP5566 pcBaseRec->getTopLeftSamplePos( getCtuRsAddr(), getZorderIdxInCtu() + uiPartAddr, iCurrPosX, iCurrPosY ); 5567 5568 #if !NH_3D_SPIVMP 6239 5569 iCurrPosX += ( iWidth >> 1 ); 6240 5570 iCurrPosY += ( iHeight >> 1 ); … … 6242 5572 6243 5573 Bool depthRefineFlag = false; 6244 #if H_3D_NBDV_REF5574 #if NH_3D_NBDV_REF 6245 5575 depthRefineFlag = m_pcSlice->getDepthRefinementFlag( ); 6246 #endif // H_3D_NBDV_REF5576 #endif // NH_3D_NBDV_REF 6247 5577 6248 5578 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; … … 6253 5583 6254 5584 Bool abPdmAvailable[8] = {false, false, false, false, false, false, false, false}; 6255 #if H_3D_NBDV5585 #if NH_3D_NBDV 6256 5586 for( Int i = 0; i < 8; i++) 6257 5587 { … … 6263 5593 { 6264 5594 6265 #if H_3D_SPIVMP5595 #if NH_3D_SPIVMP 6266 5596 //////////////////////////////// 6267 5597 //////////sub-PU IvMC/////////// … … 6269 5599 if(!m_pcSlice->getIsDepth()) 6270 5600 { 5601 #if H_3D_DBBP 6271 5602 if (!getDBBPFlag(0)) 5603 #else 5604 if (1) 5605 #endif 6272 5606 { 6273 5607 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; … … 6301 5635 } 6302 5636 6303 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth ( ) - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );6304 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight( ) - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );5637 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth (COMPONENT_Y) - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 5638 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight(COMPONENT_Y) - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 6305 5639 6306 5640 pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx ); 6307 TComDataCU* pcDefaultCU = pcBasePic->getC U( iRefCenterCUAddr );5641 TComDataCU* pcDefaultCU = pcBasePic->getCtu( iRefCenterCUAddr ); 6308 5642 if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA )) 6309 5643 { … … 6329 5663 abPdmAvailable[ uiCurrRefListId ] = true; 6330 5664 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 6331 #if H_3D_NBDV6332 #if H_3D_IV_MERGE5665 #if NH_3D_NBDV 5666 #if NH_3D_IV_MERGE 6333 5667 if( !bIsDepth ) 6334 5668 { … … 6338 5672 cMv.setIDVVer (cDv.getVer()); 6339 5673 cMv.setIDVVId (iViewIndex); 6340 #if H_3D_IV_MERGE5674 #if NH_3D_IV_MERGE 6341 5675 } 6342 5676 #endif … … 6363 5697 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth) 6364 5698 { 6365 iBasePosX = Clip3( 0, pcBaseRec->getWidth ( ) - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));6366 iBasePosY = Clip3( 0, pcBaseRec->getHeight( ) - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));5699 iBasePosX = Clip3( 0, pcBaseRec->getWidth (COMPONENT_Y) - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 )); 5700 iBasePosY = Clip3( 0, pcBaseRec->getHeight(COMPONENT_Y) - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 6367 5701 6368 5702 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx ); 6369 pcBaseCU = pcBasePic->getC U( iBaseCUAddr );5703 pcBaseCU = pcBasePic->getCtu( iBaseCUAddr ); 6370 5704 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 6371 5705 { … … 6435 5769 //////////////////////////////// 6436 5770 6437 #if H_3D_SPIVMP5771 #if NH_3D_SPIVMP 6438 5772 if(m_pcSlice->getIsDepth()) 6439 5773 { … … 6441 5775 iCurrPosY += ( iHeight >> 1 ); 6442 5776 } 5777 #if H_3D_DBBP 6443 5778 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 6444 5779 #else 5780 for(Int iLoopCan = ( m_pcSlice->getIsDepth() ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5781 #endif 5782 #else 6445 5783 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 6446 5784 #endif … … 6452 5790 Int iBaseAbsPartIdx; 6453 5791 6454 Int offsetW = (iLoopCan == 0) ? 0 : ( iWidth * 2 6455 Int offsetH = (iLoopCan == 0) ? 0 : ( iHeight * 2 6456 6457 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth ( ) - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );6458 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight( ) - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );5792 Int offsetW = (iLoopCan == 0) ? 0 : ( iWidth * 2); 5793 Int offsetH = (iLoopCan == 0) ? 0 : ( iHeight * 2); 5794 5795 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth (COMPONENT_Y) - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 5796 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight(COMPONENT_Y) - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 6459 5797 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 6460 5798 6461 TComDataCU* pcBaseCU = pcBasePic->getC U( iBaseCUAddr );5799 TComDataCU* pcBaseCU = pcBasePic->getCtu( iBaseCUAddr ); 6462 5800 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 6463 5801 { … … 6486 5824 abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true; 6487 5825 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 6488 #if H_3D_NBDV6489 #if H_3D_IV_MERGE5826 #if NH_3D_NBDV 5827 #if NH_3D_IV_MERGE 6490 5828 if( !bIsDepth ) 6491 5829 { … … 6495 5833 cMv.setIDVVer (cDv.getVer()); 6496 5834 cMv.setIDVVId (iViewIndex); 6497 #if H_3D_IV_MERGE5835 #if NH_3D_IV_MERGE 6498 5836 } 6499 5837 #endif … … 6511 5849 } 6512 5850 } 6513 #if H_3D_SPIVMP 5851 #if NH_3D_SPIVMP 5852 #if H_3D_DBBP 6514 5853 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5854 #else 5855 for(Int iLoopCan = ( m_pcSlice->getIsDepth() ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 5856 #endif 6515 5857 #else 6516 5858 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) … … 6541 5883 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 6542 5884 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 6543 #if H_3D_NBDV_REF5885 #if NH_3D_NBDV_REF 6544 5886 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 6545 5887 #endif 6546 5888 cMv.setHor( cMv.getHor() + ioffsetDV ); 6547 #if H_3D_IV_MERGE5889 #if NH_3D_IV_MERGE 6548 5890 if( bIsDepth ) 6549 5891 { … … 6566 5908 } 6567 5909 #endif 6568 #if H_3D_ARP5910 #if NH_3D_ARP 6569 5911 Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ) 6570 5912 { 6571 assert( sizeof( *m_puhARPW) == 1 ); 6572 memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) ); 6573 } 6574 #endif 6575 6576 #if H_3D_IC 5913 setSubPart<UChar>( w, m_puhARPW, uiAbsPartIdx, uiDepth, 0 ); 5914 } 5915 #endif 5916 5917 #if NH_3D_IC 6577 5918 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 6578 5919 { 6579 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPart InCU() >> ( 2 * uiDepth ))*sizeof(Bool) );5920 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartitionsInCtu() >> ( 2 * uiDepth ))*sizeof(Bool) ); 6580 5921 } 6581 5922 … … 6636 5977 #endif 6637 5978 6638 #if H_3D_VSP5979 #if NH_3D_VSP 6639 5980 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize ) 6640 5981 { … … 6692 6033 TComCUMvField *cuMvField = cu->getCUMvField( refPicList ); 6693 6034 Int partAddrRasterSubPULine = g_auiZscanToRaster[ partAddr ]; 6694 Int numPartsLine = cu->getPic()->getNumPartIn Width();6035 Int numPartsLine = cu->getPic()->getNumPartInCtuWidth(); 6695 6036 6696 6037 Int nTxtPerMvInfoX = 4; // cu->getPic()->getMinCUWidth(); 6697 6038 Int nTxtPerMvInfoY = 4; // cu->getPic()->getMinCUHeight(); 6698 6039 6699 Int refDepStride = picRefDepth->getStride( );6040 Int refDepStride = picRefDepth->getStride( COMPONENT_Y ); 6700 6041 6701 6042 TComMv tmpMv(0, 0); … … 6703 6044 6704 6045 Int refDepOffset = ( (dv->getHor()+2) >> 2 ) + ( (dv->getVer()+2) >> 2 ) * refDepStride; 6705 Pel *refDepth = picRefDepth->get LumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refDepOffset;6046 Pel *refDepth = picRefDepth->getAddr( COMPONENT_Y, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refDepOffset; 6706 6047 6707 6048 if ((height % 8)) -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComDataCU.h
r1258 r1279 50 50 #include "TComPattern.h" 51 51 52 #if H_3D_ARP53 #include "TComYuv.h"54 #endif55 52 #if H_3D 56 53 #include <algorithm> … … 65 62 static const UInt NUM_MOST_PROBABLE_MODES=3; 66 63 67 #if H_3D_DBBP64 #if NH_3D_DBBP 68 65 typedef struct _DBBPTmpData 69 66 { … … 167 164 Char* m_apiMVPNum[NUM_REF_PIC_LIST_01]; ///< array of number of possible motion vectors predictors 168 165 Bool* m_pbIPCMFlag; ///< array of intra_pcm flags 169 #if H_3D_NBDV166 #if NH_3D_NBDV 170 167 DisInfo* m_pDvInfo; 171 168 #endif 172 #if H_3D_VSP169 #if NH_3D_VSP 173 170 Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not ///< 0: non-VSP; 1: VSP 174 171 #endif 175 #if H_3D_SPIVMP172 #if NH_3D_SPIVMP 176 173 Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP 177 174 #endif 178 #if H_3D_ARP175 #if NH_3D_ARP 179 176 UChar* m_puhARPW; 180 177 #endif 181 #if H_3D_IC178 #if NH_3D_IC 182 179 Bool* m_pbICFlag; ///< array of IC flags 183 180 #endif … … 190 187 Pel* m_apSegmentDCOffset[2]; 191 188 #endif 192 #if H_3D_DBBP189 #if NH_3D_DBBP 193 190 Bool* m_pbDBBPFlag; ///< array of DBBP flags 194 191 DbbpTmpData m_sDBBPTmpData; 195 192 #endif 196 #if H_3D193 #if NH_3D_MLC 197 194 Bool m_bAvailableFlagA1; ///< A1 available flag 198 195 Bool m_bAvailableFlagB1; ///< B1 available flag … … 217 214 UInt m_uiTotalBins; ///< sum of partition bins 218 215 Char m_codedQP; 219 #if H_3D 220 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing 221 #endif 222 #if H_3D_IV_MERGE 223 TComMotionCand m_mergCands[MRG_IVSHIFT+1]; 224 Int m_baseListidc; 216 #if NH_3D_MLC 217 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing 218 TComMotionCand m_mergCands[MRG_IVSHIFT+1]; ///< Motion candidates for merge mode 219 Int m_numSpatialCands; 225 220 #endif 226 221 … … 232 227 Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 233 228 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 234 #if H_3D_VSP229 #if NH_3D_VSP 235 230 Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount); 236 231 #endif 237 #if H_3D_IV_MERGE232 #if NH_3D_IV_MERGE 238 233 Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ); 239 234 #endif … … 241 236 Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); 242 237 Bool xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 243 #if H_3D_TMVP238 #if NH_3D_TMVP 244 239 , Bool bMRG = true 245 240 #endif … … 248 243 249 244 /// compute scaling factor from POC difference 250 #if ! H_3D_ARP245 #if !NH_3D_ARP 251 246 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 252 247 #endif … … 254 249 Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); 255 250 256 #if H_3D_VSP251 #if NH_3D_VSP 257 252 Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); 258 253 #endif … … 265 260 // create / destroy / initialize / copy 266 261 // ------------------------------------------------------------------------------------------------------------------- 267 #if H_3D_ARP 262 #if NH_3D_ARP 263 /// compute scaling factor from POC difference 268 264 Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); 269 265 #endif … … 279 275 Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); 280 276 Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); 281 #if H_3D_NBDV282 Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx);277 #if NH_3D_NBDV 278 Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); 283 279 #endif 284 280 285 281 Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx ); 286 282 Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 287 #if H_3D_NBDV283 #if NH_3D_NBDV 288 284 , Bool bNBDV = false 289 285 #endif … … 316 312 #endif 317 313 314 #if NH_3D_ARP 315 Void setSlice ( TComSlice* pcSlice) { m_pcSlice = pcSlice; } 316 Void setPic ( TComDataCU* pcCU ) { m_pcPic = pcCU->getPic(); } 317 #endif 318 318 // ------------------------------------------------------------------------------------------------------------------- 319 319 // member functions for CU data … … 326 326 Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); 327 327 328 #if H_3D_DBBP328 #if NH_3D_DBBP 329 329 Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); 330 330 #endif … … 350 350 Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); 351 351 352 #if H_3D_DBBP352 #if NH_3D_DBBP 353 353 Bool* getDBBPFlag () { return m_pbDBBPFlag; } 354 354 Bool getDBBPFlag ( UInt uiIdx ) { return m_pbDBBPFlag[uiIdx]; } … … 451 451 template <typename T> 452 452 Void setSubPart ( T bParameter, T* pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 453 #if H_3D_VSP 453 #if H_3D_VSP || NH_3D_DBBP 454 454 template<typename T> 455 455 Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); … … 477 477 Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } 478 478 Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); 479 #if H_3D_NBDV479 #if NH_3D_NBDV 480 480 Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); 481 #if H_3D_VSP || NH_3D_DBBP 481 482 Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); 483 #endif 482 484 DisInfo* getDvInfo () { return m_pDvInfo; } 483 485 DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } 484 486 #endif 485 #if H_3D_NBDV487 #if NH_3D_NBDV 486 488 Void xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb ); 487 489 Bool xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, 488 490 UInt uiMvpDvPos 489 #if H_3D_NBDV_REF491 #if NH_3D_NBDV_REF 490 492 , Bool bDepthRefine = false 491 493 #endif … … 493 495 Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 494 496 Void getDisMvpCandNBDV ( DisInfo* pDInfo 495 #if H_3D_NBDV_REF497 #if NH_3D_NBDV_REF 496 498 , Bool bDepthRefine = false 497 499 #endif 498 500 ); 499 501 502 #if NH_3D_IV_MERGE 503 Void getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); 504 #endif 505 500 506 #if H_3D 501 507 Void getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); 502 508 Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); 503 509 #endif 504 #if H_3D_NBDV_REF510 #if NH_3D_NBDV_REF 505 511 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); 506 512 Void estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred ); 507 #endif // H_3D_NBDV_REF513 #endif //NH_3D_NBDV_REF 508 514 #endif 509 515 #if NH_3D_DIS … … 513 519 Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); 514 520 #endif 515 #if H_3D_SPIVMP521 #if NH_3D_SPIVMP 516 522 Void getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight); 517 523 Void getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ); 518 524 Void setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ); 519 525 #endif 520 #if H_3D_IV_MERGE526 #if NH_3D_IV_MERGE 521 527 Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth 522 528 523 #if H_3D_SPIVMP529 #if NH_3D_SPIVMP 524 530 , TComMvField* pcMFieldSP, UChar* puhInterDirSP 525 531 #endif … … 527 533 ); 528 534 #endif 529 #if H_3D_ARP535 #if NH_3D_ARP 530 536 UChar* getARPW () { return m_puhARPW; } 531 537 UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } 532 538 Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } 533 539 Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); 534 Double getARPWFactor ( UInt uiIdx ); 535 #endif 536 #if H_3D_IC 540 #endif 541 #if NH_3D_IC 537 542 Bool* getICFlag () { return m_pbICFlag; } 538 543 Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } … … 540 545 Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 541 546 Bool isICFlagRequired ( UInt uiAbsPartIdx ); 547 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 548 #elif NH_3D_VSP 542 549 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 543 550 #else … … 647 654 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 648 655 649 #if H_3D650 Bool getAvailableFlagA1() { return m_bAvailableFlagA1; }651 Bool getAvailableFlagB1() { return m_bAvailableFlagB1; }652 Bool getAvailableFlagB0() { return m_bAvailableFlagB0; }653 Bool getAvailableFlagA0() { return m_bAvailableFlagA0; }654 Bool getAvailableFlagB2() { return m_bAvailableFlagB2; }656 #if NH_3D_MLC 657 Bool getAvailableFlagA1() { return m_bAvailableFlagA1; } 658 Bool getAvailableFlagB1() { return m_bAvailableFlagB1; } 659 Bool getAvailableFlagB0() { return m_bAvailableFlagB0; } 660 Bool getAvailableFlagA0() { return m_bAvailableFlagA0; } 661 Bool getAvailableFlagB2() { return m_bAvailableFlagB2; } 655 662 Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } 656 663 Void buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 657 #if H_3D_VSP664 #if NH_3D_VSP 658 665 , Int* vspFlag 659 666 #endif 660 #if H_3D_SPIVMP667 #if NH_3D_SPIVMP 661 668 , Bool* pbSPIVMPFlag 662 669 #endif 663 670 , Int& numValidMergeCand 664 671 ); 665 Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); 666 Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 667 #else 672 Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 673 #if NH_3D_SPIVMP 674 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 675 #endif 676 , Int& numValidMergeCand, Int mrgCandIdx = -1 ); 677 #endif 668 678 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); 669 #endif 670 #if H_3D_SPIVMP 671 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 672 #endif 673 674 #if H_3D_VSP 675 #if H_3D_SPIVMP 679 680 #if NH_3D_VSP 681 #if NH_3D_SPIVMP 676 682 Bool* getSPIVMPFlag () { return m_pbSPIVMPFlag; } 677 683 Bool getSPIVMPFlag ( UInt uiIdx ) { return m_pbSPIVMPFlag[uiIdx]; } … … 698 704 Bool isBipredRestriction( UInt puIdx ); 699 705 700 #if H_3D_IC701 Bool isIC ( UInt uiPartIdx );702 #endif703 704 706 // ------------------------------------------------------------------------------------------------------------------- 705 707 // member functions for symbol prediction (most probable / mode conversion) … … 720 722 UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); 721 723 UInt getCtxInterDir ( UInt uiAbsPartIdx ); 722 #if H_3D_ARP724 #if NH_3D_ARP 723 725 UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); 724 726 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r1200 r1279 75 75 }; 76 76 77 #if H_3D_ARP77 #if NH_3D_ARP 78 78 const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] = 79 79 { … … 361 361 */ 362 362 Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth 363 #if H_3D_ARP363 #if NH_3D_ARP 364 364 , Bool filterType 365 365 #endif … … 372 372 else if (isLuma(compID)) 373 373 { 374 #if H_3D_ARP 374 assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 375 #if NH_3D_ARP 375 376 if(filterType) 376 377 { 377 filterHor<NTAPS_LUMA_ARP>( g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]);378 filterHor<NTAPS_LUMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]); 378 379 } 379 380 else 380 381 { 381 382 #endif 382 383 assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);384 383 filterHor<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 385 #if H_3D_ARP384 #if NH_3D_ARP 386 385 } 387 386 #endif … … 392 391 const UInt csx = getComponentScaleX(compID, fmt); 393 392 assert(frac >=0 && csx<2 && (frac<<(1-csx)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 393 #if NH_3D_ARP 394 if(filterType) 395 { 396 filterHor<NTAPS_CHROMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]); 397 } 398 else 399 { 400 #endif 394 401 filterHor<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]); 402 #if NH_3D_ARP 403 } 404 #endif 395 405 } 396 406 } … … 414 424 */ 415 425 Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth 416 #if H_3D_ARP426 #if NH_3D_ARP 417 427 , Bool filterType 418 428 #endif … … 425 435 else if (isLuma(compID)) 426 436 { 427 #if H_3D_ARP 437 assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 438 #if NH_3D_ARP 428 439 if(filterType) 429 440 { 430 filterVer<NTAPS_LUMA_ARP>( g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]);441 filterVer<NTAPS_LUMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]); 431 442 } 432 443 else 433 444 { 434 445 #endif 435 assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);436 446 filterVer<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); 437 #if H_3D_ARP447 #if NH_3D_ARP 438 448 } 439 449 #endif … … 444 454 const UInt csy = getComponentScaleY(compID, fmt); 445 455 assert(frac >=0 && csy<2 && (frac<<(1-csy)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 456 #if NH_3D_ARP 457 if(filterType) 458 { 459 filterVer<NTAPS_CHROMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); 460 } 461 else 462 { 463 #endif 446 464 filterVer<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]); 447 } 448 } 449 450 #if H_3D_ARP 451 , Bool filterType 452 #endif 453 454 #if H_3D_ARP 455 if(filterType) 456 { 457 filterHor<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]); 458 } 459 else 460 { 461 #endif 462 #if H_3D_ARP 463 } 464 #endif 465 #if H_3D_ARP 466 , Bool filterType 467 #endif 468 #if H_3D_ARP 469 if(filterType) 470 { 471 filterVer<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); 472 } 473 else 474 { 475 #endif 476 #if H_3D_ARP 477 } 478 #endif 479 480 481 465 #if NH_3D_ARP 466 } 467 #endif 468 } 469 } 482 470 //! \} -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComInterpolationFilter.h
r1200 r1279 45 45 //! \{ 46 46 47 #if H_3D_ARP47 #if NH_3D_ARP 48 48 #define NTAPS_LUMA_ARP 2 ///< Number of taps for luma 49 49 #define NTAPS_CHROMA_ARP 2 ///< Number of taps for chroma … … 63 63 static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps 64 64 static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps 65 #if H_3D_ARP65 #if NH_3D_ARP 66 66 static const Short m_lumaFilterARP [4][NTAPS_LUMA_ARP]; ///< Luma filter taps for ARP 67 67 static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP]; ///< Chroma filter taps for ARP … … 83 83 84 84 Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth 85 #if H_3D_ARP85 #if NH_3D_ARP 86 86 , Bool filterType = false 87 87 #endif 88 88 ); 89 89 Void filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth 90 #if H_3D_ARP90 #if NH_3D_ARP 91 91 , Bool filterType = false 92 92 #endif … … 94 94 }; 95 95 96 #if H_3D_ARP97 , Bool filterType = false98 #endif99 #if H_3D_ARP100 , Bool filterType = false101 #endif102 103 96 //! \} 104 97 -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComMotionInfo.cpp
r1200 r1279 40 40 #include "assert.h" 41 41 #include <stdlib.h> 42 #if H_3D_SPIVMP42 #if NH_3D_SPIVMP 43 43 #include "TComDataCU.h" 44 44 #include "TComPic.h" … … 328 328 } 329 329 330 #if H_3D_SPIVMP330 #if NH_3D_SPIVMP 331 331 Void TComCUMvField::setMvFieldSP( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ) 332 332 { 333 uiAbsPartIdx += pcCU->getZorderIdxInC U();333 uiAbsPartIdx += pcCU->getZorderIdxInCtu(); 334 334 Int iStartPelX = g_auiRasterToPelX[g_auiZscanToRaster[uiAbsPartIdx]]; 335 335 Int iStartPelY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIdx]]; … … 341 341 for (Int j=iStartPelX; j < iEndPelX; j += pcCU->getPic()->getMinCUWidth()) 342 342 { 343 Int iCurrRaster = i / pcCU->getPic()->getMinCUHeight() * pcCU->getPic()->getNumPartIn Width() + j/pcCU->getPic()->getMinCUWidth();343 Int iCurrRaster = i / pcCU->getPic()->getMinCUHeight() * pcCU->getPic()->getNumPartInCtuWidth() + j/pcCU->getPic()->getMinCUWidth(); 344 344 Int uiPartAddr = g_auiRasterToZscan[iCurrRaster]; 345 uiPartAddr -= pcCU->getZorderIdxInC U();345 uiPartAddr -= pcCU->getZorderIdxInCtu(); 346 346 347 347 m_pcMv[uiPartAddr] = cMvField.getMv(); -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComMotionInfo.h
r1196 r1279 50 50 // ==================================================================================================================== 51 51 52 #if H_3D_SPIVMP52 #if NH_3D_SPIVMP 53 53 class TComDataCU; 54 54 #endif … … 60 60 } AMVPInfo; 61 61 62 #if H_3D_NBDV62 #if NH_3D_NBDV 63 63 typedef struct _DisCand 64 64 { 65 65 TComMv m_acNBDV; // DV from NBDV 66 #if H_3D_NBDV_REF66 #if NH_3D_NBDV_REF 67 67 TComMv m_acDoNBDV; // DV from DoNBDV 68 68 #endif … … 107 107 Int getHor () const { return m_acMv.getHor(); } 108 108 Int getVer () const { return m_acMv.getVer(); } 109 #if H_3D_IV_MERGE109 #if NH_3D_IV_MERGE 110 110 Bool operator== ( const TComMvField& rcMv ) const 111 111 { … … 167 167 Void setAllRefIdx ( Int iRefIdx, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 168 168 Void setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 169 #if H_3D_SPIVMP169 #if NH_3D_SPIVMP 170 170 Void setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight ); 171 171 #endif 172 #if H_3D_VSP172 #if NH_3D_VSP 173 173 Void setMv ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; } 174 174 Void setRefIdx ( Int iIdx, Int iRefIdx ) { m_piRefIdx[iIdx] = iRefIdx; } … … 192 192 //! \} 193 193 194 #if H_3D_IV_MERGE 194 #if NH_3D_MLC 195 /// class for container of merge candidate 195 196 class TComMotionCand 196 197 { … … 199 200 TComMvField m_cMvField[2]; 200 201 UChar m_uDir; 201 #if H_3D_VSP202 #if NH_3D_VSP 202 203 Int m_iVspFlag; 203 #endif 204 #endif 205 #if NH_3D_SPIVMP 204 206 Bool m_bSPIVMPFlag; 207 #endif 205 208 206 209 public: … … 209 212 m_bAvailable = false; 210 213 m_uDir = 0; 211 #if H_3D_VSP214 #if NH_3D_VSP 212 215 m_iVspFlag = 0; 213 216 #endif 217 #if NH_3D_SPIVMP 214 218 m_bSPIVMPFlag = false; 219 #endif 215 220 } 216 221 … … 226 231 m_bAvailable = false; 227 232 m_uDir = 0; 228 #if H_3D_VSP233 #if NH_3D_VSP 229 234 m_iVspFlag = 0; 230 235 #endif 236 #if NH_3D_SPIVMP 231 237 m_bSPIVMPFlag = false; 238 #endif 232 239 m_cMvField[0].setMvField(cZeroMv, NOT_VALID); 233 240 m_cMvField[1].setMvField(cZeroMv, NOT_VALID); … … 235 242 236 243 Void setCand(TComMvField* pcMvFieldNeighbours, UChar uhInterDirNeighbours 237 #if H_3D_VSP244 #if NH_3D_VSP 238 245 , Int vspFlag 239 246 #endif 247 #if NH_3D_SPIVMP 240 248 , Bool bSPIVMPFlag 249 #endif 241 250 ) 242 251 { … … 245 254 m_cMvField[1] = pcMvFieldNeighbours[1]; 246 255 m_uDir = uhInterDirNeighbours; 247 #if H_3D_VSP256 #if NH_3D_VSP 248 257 m_iVspFlag = vspFlag; 249 258 #endif 259 #if NH_3D_SPIVMP 250 260 m_bSPIVMPFlag = bSPIVMPFlag; 251 } 252 253 261 #endif 262 } 263 254 264 Void getCand(Int iCount, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 255 #if H_3D_VSP265 #if NH_3D_VSP 256 266 , Int* vspFlag 257 267 #endif 268 #if NH_3D_SPIVMP 258 269 , Bool* pbSPIVMPFlag 270 #endif 259 271 ) 260 272 { … … 262 274 pcMvFieldNeighbours[(iCount<<1) + 1] = m_cMvField[1]; 263 275 puhInterDirNeighbours[iCount] = m_uDir; 264 #if H_3D_VSP276 #if NH_3D_VSP 265 277 vspFlag[iCount] = m_iVspFlag; 266 278 #endif 279 #if NH_3D_SPIVMP 267 280 pbSPIVMPFlag[iCount] = m_bSPIVMPFlag; 281 #endif 268 282 } 269 283 }; -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComMv.h
r1200 r1279 57 57 Short m_iHor; ///< horizontal component of motion vector 58 58 Short m_iVer; ///< vertical component of motion vector 59 #if H_3D_NBDV59 #if NH_3D_NBDV 60 60 Bool m_bIDV; 61 61 Short m_iIDVHor; … … 72 72 m_iHor(0), 73 73 m_iVer(0) 74 #if H_3D_NBDV74 #if NH_3D_NBDV 75 75 , m_bIDV(false) 76 76 , m_iIDVHor(0) … … 84 84 m_iHor(iHor), 85 85 m_iVer(iVer) 86 #if H_3D_NBDV86 #if NH_3D_NBDV 87 87 , m_bIDV(false) 88 88 , m_iIDVHor(0) … … 101 101 Void setVer ( Short i ) { m_iVer = i; } 102 102 Void setZero () { m_iHor = m_iVer = 0; 103 #if H_3D_NBDV103 #if NH_3D_NBDV 104 104 m_bIDV = false; m_iIDVHor = m_iIDVVer = 0; 105 105 m_iIDVVId = 0; 106 106 #endif 107 107 } 108 #if H_3D_NBDV108 #if NH_3D_NBDV 109 109 Void setIDVHor (Short i) {m_iIDVHor = i;} 110 110 Void setIDVVer (Short i) {m_iIDVVer = i;} … … 120 120 Int getAbsHor () const { return abs( m_iHor ); } 121 121 Int getAbsVer () const { return abs( m_iVer ); } 122 #if H_3D_NBDV122 #if NH_3D_NBDV 123 123 Short getIDVHor () const { return m_iIDVHor; } 124 124 Short getIDVVer () const { return m_iIDVVer; } -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPattern.h
r1200 r1279 81 81 // TComPatternParam m_cPatternCb; 82 82 //TComPatternParam m_cPatternCr; 83 #if H_3D_IC83 #if NH_3D_IC 84 84 Bool m_bICFlag; 85 85 #endif … … 98 98 Int getBitDepthY() { return m_cPatternY.m_bitDepth; } 99 99 100 #if H_3D_IC100 #if NH_3D_IC 101 101 Bool getICFlag() { return m_bICFlag; } 102 102 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.cpp
r1200 r1279 75 75 m_apcPicYuv[i] = NULL; 76 76 } 77 #if H_3D_QTLPC77 #if NH_3D_QTLPC 78 78 m_bReduceBitsQTL = 0; 79 79 #endif 80 #if H_3D_NBDV80 #if NH_3D_NBDV 81 81 m_iNumDdvCandPics = 0; 82 82 m_eRapRefList = REF_PIC_LIST_0; … … 143 143 } 144 144 #if NH_3D 145 #if NH_3D_ARP 146 Void TComPic::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ) 147 { 148 Int iMaxCUWidth = (Int) ( getPicSym()->getSPS().getMaxCUWidth() ); 149 Int iMaxCuHeight = (Int) ( getPicSym()->getSPS().getMaxCUHeight() ); 150 151 UInt uiMaxTotalCUDepth = getPicSym()->getSPS().getMaxTotalCUDepth(); 152 Int iBaseUnitWidth = iMaxCUWidth >> uiMaxTotalCUDepth; 153 Int iBaseUnitHeight = iMaxCUWidth >> uiMaxTotalCUDepth; 154 155 Int iNumCuInWidth = getPicYuvRec()->getWidth(COMPONENT_Y) / iMaxCUWidth; 156 iNumCuInWidth += ( getPicYuvRec()->getWidth(COMPONENT_Y) % iMaxCUWidth ) ? 1 : 0; 157 158 159 Int iCuX = iX / iMaxCUWidth; 160 Int iCuY = iY / iMaxCuHeight; 161 Int iBaseX = ( iX - iCuX * iMaxCUWidth ) / iBaseUnitWidth; 162 Int iBaseY = ( iY - iCuY * iMaxCuHeight ) / iBaseUnitHeight; 163 Int iCuSizeInBases = iMaxCuHeight / iBaseUnitWidth; 164 165 riCuAddr = iCuY * iNumCuInWidth + iCuX; 166 Int iRastPartIdx = iBaseY * iCuSizeInBases + iBaseX; 167 riAbsZorderIdx = g_auiRasterToZscan[ iRastPartIdx ]; 168 } 169 #endif 145 170 Void TComPic::compressMotion(Int scale) 146 171 #else … … 283 308 return getPicYuv( layerIdInNuh, poc, recon ); 284 309 } 285 #if H_3D_ARP310 #if NH_3D_ARP 286 311 TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh ) 287 312 { … … 303 328 #endif // NH_MV 304 329 305 #if H_3D_NBDV306 Int TComPic::getDisCandRefPictures( Int iColPOC)330 #if NH_3D_NBDV 331 Int TComPic::getDisCandRefPictures(Int iColPOC) 307 332 { 308 333 UInt uiTempLayerCurr = 7; … … 310 335 UInt numDdvCandPics = 0; 311 336 312 if ( !currSlice->getEnableTMVPFlag() ) 337 if(!currSlice->getEnableTMVPFlag()) 338 { 313 339 return numDdvCandPics; 340 } 314 341 315 342 numDdvCandPics += 1; … … 318 345 UInt pocDiff = 255; 319 346 320 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr 321 { 322 UIntx = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();323 324 for 347 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr++) 348 { 349 Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); 350 351 for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) 325 352 { 326 353 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() 327 && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) && numDdvCandPics!=2)354 && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) && numDdvCandPics != 2) 328 355 { 329 356 TComSlice* refSlice = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx()); 330 Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1: 0;357 Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP()) ? 1 : 0; 331 358 UInt uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer(); 332 359 333 if( bRAP)360 if(bRAP) 334 361 { 335 362 this->setRapRefIdx(i); … … 350 377 UInt idx = 0; 351 378 352 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++)353 { 354 UInt x = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();379 for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2 : 1); lpNr++) 380 { 381 Bool x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag(); 355 382 356 for 383 for(UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++) 357 384 { 358 385 Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC(); 359 Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc);386 Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr) : (pocCurr - iTempPoc); 360 387 361 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC)362 && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff)388 if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() && (x == currSlice->getColFromL0Flag() || currSlice->getRefPOC((RefPicList)x, i) != iColPOC) 389 && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff) 363 390 { 364 391 pocDiff = iTempDiff; … … 369 396 } 370 397 371 if( pocDiff < 255)398 if(pocDiff < 255) 372 399 { 373 400 this->setRapRefIdx(idx); 374 this->setRapRefList((RefPicList) z 401 this->setRapRefList((RefPicList) z); 375 402 numDdvCandPics = 2; 376 403 } … … 383 410 TComSlice* currSlice = getSlice(getCurrSliceIdx()); 384 411 const Int numCandPics = this->getNumDdvCandPics(); 412 385 413 for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++) 386 414 { 387 415 RefPicList eCurRefPicList = REF_PIC_LIST_0 ; 388 416 Int curCandPicRefIdx = 0; 389 if( curCandPic == 0)417 if(curCandPic == 0) 390 418 { 391 eCurRefPicList = RefPicList(currSlice->isInterB() ? 1 -currSlice->getColFromL0Flag() : 0);419 eCurRefPicList = RefPicList(currSlice->isInterB() ? 1 - currSlice->getColFromL0Flag() : 0); 392 420 curCandPicRefIdx = currSlice->getColRefIdx(); 393 421 } … … 397 425 curCandPicRefIdx = this->getRapRefIdx(); 398 426 } 399 TComPic* pcCandColPic = currSlice->getRefPic( eCurRefPicList, curCandPicRefIdx); 400 TComSlice* pcCandColSlice = pcCandColPic->getSlice(0);// currently only support single slice 427 428 TComPic* pcCandColPic = currSlice->getRefPic(eCurRefPicList, curCandPicRefIdx); 429 TComSlice* pcCandColSlice = pcCandColPic->getSlice(0); // currently only support single slice 401 430 402 431 if(!pcCandColSlice->isIntra()) 403 432 { 404 for( Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2: 1); iColRefDir ++)405 { 406 for( Int iColRefIdx =0; iColRefIdx < pcCandColSlice->getNumRefIdx(( RefPicList )iColRefDir); iColRefIdx++)433 for(Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2 : 1); iColRefDir++) 434 { 435 for(Int iColRefIdx = 0; iColRefIdx < pcCandColSlice->getNumRefIdx((RefPicList)iColRefDir); iColRefIdx++) 407 436 { 408 437 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false; 409 438 Int iColViewIdx = pcCandColSlice->getViewIndex(); 410 Int iColRefViewIdx = pcCandColSlice->getRefPic( ( RefPicList)iColRefDir, iColRefIdx)->getViewIndex();439 Int iColRefViewIdx = pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx)->getViewIndex(); 411 440 if(iColViewIdx == iColRefViewIdx) 441 { 412 442 continue; 413 414 for(Int iCurrRefDir = 0;(iCurrRefDir < (currSlice->isInterB() ? 2: 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false ); iCurrRefDir++) 443 } 444 445 for(Int iCurrRefDir = 0; (iCurrRefDir < (currSlice->isInterB() ? 2 : 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false); iCurrRefDir++) 415 446 { 416 for( Int iCurrRefIdx =0; iCurrRefIdx < currSlice->getNumRefIdx(( RefPicList )iCurrRefDir); iCurrRefIdx++)447 for(Int iCurrRefIdx = 0; iCurrRefIdx < currSlice->getNumRefIdx((RefPicList)iCurrRefDir); iCurrRefIdx++) 417 448 { 418 if( currSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx )->getViewIndex() == iColRefViewIdx)449 if(currSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iColRefViewIdx) 419 450 { 420 451 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true; … … 428 459 } 429 460 } 461 430 462 Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx) 431 463 { … … 433 465 } 434 466 435 Void TComPic::checkTextureRef( 467 Void TComPic::checkTextureRef() 436 468 { 437 469 TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); 438 TComPic* pcTextPic = pcCurrSlice->get TexturePic();470 TComPic* pcTextPic = pcCurrSlice->getIvPic(0, getViewIndex()); 439 471 #if H_3D_FCO 440 472 if ( pcTextPic ) 441 473 { 442 474 #endif 443 444 475 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 445 476 446 for( Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB()? 2:1) ) && !pcTextSlice->isIntra(); iTextRefDir ++)447 { 448 for( Int iTextRefIdx =0; iTextRefIdx<pcTextSlice->getNumRefIdx(( RefPicList )iTextRefDir); iTextRefIdx++)449 { 450 Int iTextRefPOC = pcTextSlice->getRefPOC( ( RefPicList)iTextRefDir, iTextRefIdx);451 Int iTextRefViewId = pcTextSlice->getRefPic( ( RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex();477 for(Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB() ? 2 :1) ) && !pcTextSlice->isIntra(); iTextRefDir++) 478 { 479 for(Int iTextRefIdx =0; iTextRefIdx < pcTextSlice->getNumRefIdx((RefPicList)iTextRefDir); iTextRefIdx++) 480 { 481 Int iTextRefPOC = pcTextSlice->getRefPOC((RefPicList)iTextRefDir, iTextRefIdx); 482 Int iTextRefViewId = pcTextSlice->getRefPic((RefPicList)iTextRefDir, iTextRefIdx)->getViewIndex(); 452 483 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; 453 484 Int iCurrRefDir = iTextRefDir; 454 for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++) 485 486 for(Int iCurrRefIdx = 0; (iCurrRefIdx<pcCurrSlice->getNumRefIdx((RefPicList)iCurrRefDir)) && (m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0); iCurrRefIdx++) 455 487 { 456 if( pcCurrSlice->getRefPOC( ( RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&457 pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId)488 if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 489 pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId) 458 490 { 459 491 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; … … 461 493 } 462 494 } 463 464 495 } 465 496 #if H_3D_FCO -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPic.h
r1200 r1279 94 94 #endif 95 95 #endif 96 #if H_3D_QTLPC96 #if NH_3D_QTLPC 97 97 Bool m_bReduceBitsQTL; 98 98 #endif 99 #if H_3D_NBDV99 #if NH_3D_NBDV 100 100 UInt m_uiRapRefIdx; 101 101 RefPicList m_eRapRefList; 102 102 Int m_iNumDdvCandPics; 103 Bool m_abTIVRINCurrRL 103 Bool m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists 104 104 Int m_aiTexToDepRef [2][MAX_NUM_REF]; 105 105 #endif … … 132 132 #endif 133 133 #endif 134 #if H_3D_QTLPC134 #if NH_3D_QTLPC 135 135 Bool getReduceBitsFlag () { return m_bReduceBitsQTL; } 136 136 Void setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag; } … … 182 182 #endif 183 183 #if NH_3D 184 #if NH_3D_ARP 185 Void getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx ); 186 #endif 184 187 Void compressMotion(Int scale); 185 188 #else … … 209 212 Void print( Bool legend ); 210 213 #endif 211 #if H_3D_NBDV214 #if NH_3D_NBDV 212 215 Int getNumDdvCandPics() {return m_iNumDdvCandPics; } 213 216 Int getDisCandRefPictures(Int iColPOC); … … 248 251 Void push_back( TComList<TComPic*>* list ) { m_lists.push_back( list ); } 249 252 Int size () { return (Int) m_lists.size(); } 250 #if H_3D_ARP253 #if NH_3D_ARP 251 254 TComList<TComPic*>* getPicList ( Int layerIdInNuh ); 252 255 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPicYuv.cpp
r1200 r1279 91 91 m_iPicHeight = iPicHeight; 92 92 93 #if H_3D_IV_MERGE 93 #if NH_3D_IV_MERGE 94 m_iCuWidth = uiMaxCUWidth; 95 m_iCuHeight = uiMaxCUHeight; 96 94 97 m_iNumCuInWidth = m_iPicWidth / m_iCuWidth; 95 98 m_iNumCuInWidth += ( m_iPicWidth % m_iCuWidth ) ? 1 : 0; … … 292 295 fclose(pFile); 293 296 } 294 #if H_3D 295 #if H_3D_IV_MERGE 297 #if NH_3D_IV_MERGE 296 298 Void 297 299 TComPicYuv::getTopLeftSamplePos( Int iCuAddr, Int iAbsZorderIdx, Int& riX, Int& riY ) … … 319 321 riAbsZorderIdx = g_auiRasterToZscan[ iRastPartIdx ]; 320 322 } 321 #endif 323 324 #endif 325 326 #if H_3D 322 327 Void TComPicYuv::setLumaTo( Pel pVal ) 323 328 { -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPicYuv.h
r1200 r1279 80 80 81 81 Bool m_bIsBorderExtended; 82 #if H_3D_IV_MERGE82 #if NH_3D_IV_MERGE 83 83 Int m_iBaseUnitWidth; ///< Width of Base Unit (with maximum depth or minimum size, m_iCuWidth >> Max. Depth) 84 84 Int m_iBaseUnitHeight; ///< Height of Base Unit (with maximum depth or minimum size, m_iCuHeight >> Max. Depth) 85 85 Int m_iNumCuInWidth; 86 Int m_iCuWidth; ///< Width of Coding Unit (CU) 87 Int m_iCuHeight; ///< Height of Coding Unit (CU) 86 88 #endif 87 89 … … 168 170 Void setLumaTo ( Pel pVal ); 169 171 Void setChromaTo ( Pel pVal ); 170 #if H_3D_IV_MERGE172 #if NH_3D_IV_MERGE 171 173 // sample to block and block to sample conversion 172 174 Void getTopLeftSamplePos( Int iCuAddr, Int iAbsZorderIdx, Int& riX, Int& riY ); -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPrediction.cpp
r1243 r1279 82 82 } 83 83 } 84 #if H_3D_VSP85 m_pDepthBlock = (Int*) malloc(MAX_NUM_ SPU_W*MAX_NUM_SPU_W*sizeof(Int));84 #if NH_3D_VSP 85 m_pDepthBlock = (Int*) malloc(MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH*sizeof(Int)); 86 86 if (m_pDepthBlock == NULL) 87 87 { … … 94 94 TComPrediction::~TComPrediction() 95 95 { 96 #if H_3D_VSP96 #if NH_3D_VSP 97 97 if (m_pDepthBlock != NULL) 98 98 { … … 123 123 m_cYuvPredTemp.destroy(); 124 124 125 #if H_3D_ARP125 #if NH_3D_ARP 126 126 m_acYuvPredBase[0].destroy(); 127 127 m_acYuvPredBase[1].destroy(); … … 182 182 183 183 m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 184 #if H_3D_ARP185 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);186 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);187 #endif 188 #if H_3D_VSP189 m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight);184 #if NH_3D_ARP 185 m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 186 m_acYuvPredBase[1] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 187 #endif 188 #if NH_3D_VSP 189 m_cYuvDepthOnVsp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 190 190 #endif 191 191 … … 201 201 } 202 202 } 203 #if H_3D_IC203 #if NH_3D_IC 204 204 m_uiaShift[0] = 0; 205 205 for( Int i = 1; i < 64; i++ ) … … 584 584 Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC(); 585 585 Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC(); 586 #if H_3D_ARP586 #if NH_3D_ARP 587 587 if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 588 588 #else … … 597 597 } 598 598 599 #if H_3D_SPIVMP599 #if NH_3D_SPIVMP 600 600 Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ) 601 601 { … … 606 606 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 607 607 } 608 #if H_3D_ARP // check this! 608 609 if( pcCU->getARPW( uiPartAddr ) != 0 ) 609 610 { 610 611 return; 611 612 } 613 #endif 612 614 613 615 // horizontal sub-PU merge … … 683 685 #endif 684 686 685 #if H_3D_DBBP687 #if NH_3D_DBBP 686 688 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU) 687 689 { 690 const TComSPS* sps = pcCU->getSlice()->getSPS(); 691 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 692 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 693 688 694 // find virtual partitioning for this CU based on depth block 689 695 // segmentation of texture block --> mask IDs … … 693 699 Int iSumDepth = 0; 694 700 Int iSubSample = 4; 695 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth( );696 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight( );701 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 702 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 697 703 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 698 704 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 700 706 cDv.setVer(0); 701 707 } 702 Int iBlkX = ( pcCU->get Addr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);703 Int iBlkY = ( pcCU->get Addr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);708 Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2); 709 Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2); 704 710 705 711 UInt t=0; … … 788 794 } 789 795 790 PartSize matchedPartSize = SIZE_NONE;796 PartSize matchedPartSize = NUMBER_OF_PART_SIZES; 791 797 792 798 Int iMaxMatchSum = 0; … … 803 809 } 804 810 805 AOF( matchedPartSize != SIZE_NONE);811 AOF( matchedPartSize != NUMBER_OF_PART_SIZES ); 806 812 807 813 return matchedPartSize; … … 810 816 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU) 811 817 { 818 const TComSPS* sps = pcCU->getSlice()->getSPS(); 819 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 820 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 821 812 822 // segmentation of texture block --> mask IDs 813 823 Pel* pDepthBlockStart = pDepthPels; … … 821 831 iSumDepth = pDepthPels[ 0 ]; 822 832 823 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth( );824 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight( );833 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 834 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 825 835 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 826 836 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 828 838 cDv.setVer(0); 829 839 } 830 Int iBlkX = ( pcCU->get Addr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);831 Int iBlkY = ( pcCU->get Addr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);840 Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2); 841 Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2); 832 842 if (iBlkX>(Int)(iPictureWidth - uiWidth)) 833 843 { … … 944 954 } 945 955 946 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )947 { 948 Pel* piSrc[2] = {pInYuv[0]->get LumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};949 UInt uiSrcStride = pInYuv[0]->getStride( );950 Pel* piDst = pOutYuv->get LumaAddr(uiPartAddr);951 UInt uiDstStride = pOutYuv->getStride( );956 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY ) 957 { 958 Pel* piSrc[2] = {pInYuv[0]->getAddr(COMPONENT_Y, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Y, uiPartAddr)}; 959 UInt uiSrcStride = pInYuv[0]->getStride(COMPONENT_Y); 960 Pel* piDst = pOutYuv->getAddr(COMPONENT_Y, uiPartAddr); 961 UInt uiDstStride = pOutYuv->getStride(COMPONENT_Y); 952 962 953 963 UInt uiMaskStride= MAX_CU_SIZE; … … 988 998 right = (x==uiWidth-1) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1]; 989 999 990 piDst[x] = (l!=r) ? Clip Y( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];1000 piDst[x] = (l!=r) ? ClipBD( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 991 1001 } 992 1002 piDst += uiDstStride; … … 1006 1016 bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x]; 1007 1017 1008 piDst[x] = (t!=b) ? Clip Y( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];1018 piDst[x] = (t!=b) ? ClipBD( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1009 1019 } 1010 1020 piDst += uiDstStride; … … 1019 1029 1020 1030 // now combine chroma 1021 Pel* piSrcU[2] = { pInYuv[0]->get CbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) };1022 Pel* piSrcV[2] = { pInYuv[0]->get CrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) };1023 UInt uiSrcStrideC = pInYuv[0]->get CStride();1024 Pel* piDstU = pOutYuv->get CbAddr(uiPartAddr);1025 Pel* piDstV = pOutYuv->get CrAddr(uiPartAddr);1026 UInt uiDstStrideC = pOutYuv->get CStride();1031 Pel* piSrcU[2] = { pInYuv[0]->getAddr(COMPONENT_Cb, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cb, uiPartAddr) }; 1032 Pel* piSrcV[2] = { pInYuv[0]->getAddr(COMPONENT_Cr, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cr, uiPartAddr) }; 1033 UInt uiSrcStrideC = pInYuv[0]->getStride(COMPONENT_Cb); 1034 Pel* piDstU = pOutYuv->getAddr(COMPONENT_Cb, uiPartAddr); 1035 Pel* piDstV = pOutYuv->getAddr(COMPONENT_Cr, uiPartAddr); 1036 UInt uiDstStrideC = pOutYuv->getStride(COMPONENT_Cb); 1027 1037 UInt uiWidthC = uiWidth >> 1; 1028 1038 UInt uiHeightC = uiHeight >> 1; … … 1070 1080 if (l!=r) 1071 1081 { 1072 filSrcU = Clip C( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));1073 filSrcV = Clip C( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));1082 filSrcU = ClipBD( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ), bitDepthY); 1083 filSrcV = ClipBD( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ), bitDepthY); 1074 1084 } 1075 1085 else … … 1103 1113 if (t!=b) 1104 1114 { 1105 filSrcU = Clip C( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));1106 filSrcV = Clip C( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));1115 filSrcU = ClipBD( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ), bitDepthY); 1116 filSrcV = ClipBD( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ), bitDepthY); 1107 1117 } 1108 1118 else … … 1141 1151 { 1142 1152 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1143 #if H_3D_VSP1153 #if NH_3D_VSP 1144 1154 if ( pcCU->getVSPFlag(uiPartAddr) == 0) 1145 1155 { 1146 1156 #endif 1147 if ( eRefPicList != REF_PIC_LIST_X ) 1148 { 1149 if( pcCU->getSlice()->getPPS()->getUseWP()) 1150 { 1151 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1157 if ( eRefPicList != REF_PIC_LIST_X ) 1158 { 1159 if( pcCU->getSlice()->getPPS()->getUseWP()) 1160 { 1161 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1162 } 1163 else 1164 { 1165 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1166 } 1167 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1168 { 1169 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1170 } 1152 1171 } 1153 1172 else 1154 1173 { 1155 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1156 } 1157 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1158 { 1159 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1160 } 1161 } 1162 else 1163 { 1164 #if H_3D_SPIVMP 1174 #if NH_3D_SPIVMP 1165 1175 if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1166 1176 { … … 1194 1204 { 1195 1205 #endif 1206 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1207 { 1208 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1209 } 1210 else 1211 { 1212 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1213 } 1214 #if NH_3D_SPIVMP 1215 } 1216 #endif 1217 } 1218 #if NH_3D_VSP 1219 } 1220 else 1221 { 1196 1222 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1197 1223 { 1198 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );1224 xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1199 1225 } 1200 1226 else 1201 1227 { 1202 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1203 } 1204 #if H_3D_SPIVMP 1205 } 1206 #endif 1207 } 1208 #if H_3D_VSP 1228 xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1229 } 1230 } 1231 #endif 1232 return; 1233 } 1234 1235 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ ) 1236 { 1237 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1238 1239 #if NH_3D_VSP 1240 if ( pcCU->getVSPFlag(uiPartAddr) == 0 ) 1241 { 1242 #endif 1243 if ( eRefPicList != REF_PIC_LIST_X ) 1244 { 1245 if( pcCU->getSlice()->getPPS()->getUseWP()) 1246 { 1247 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1248 } 1249 else 1250 { 1251 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1252 } 1253 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1254 { 1255 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1256 } 1209 1257 } 1210 1258 else 1211 1259 { 1212 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1213 { 1214 xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1215 } 1216 else 1217 { 1218 xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1219 } 1220 } 1221 #endif 1222 return; 1223 } 1224 1225 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ ) 1226 { 1227 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1228 1229 #if H_3D_VSP 1230 if ( pcCU->getVSPFlag(uiPartAddr) == 0 ) 1231 { 1232 #endif 1233 if ( eRefPicList != REF_PIC_LIST_X ) 1234 { 1235 if( pcCU->getSlice()->getPPS()->getUseWP()) 1236 { 1237 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1238 } 1239 else 1240 { 1241 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1242 } 1243 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1244 { 1245 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1246 } 1247 } 1248 else 1249 { 1250 #if H_3D_SPIVMP 1251 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1260 #if NH_3D_SPIVMP 1261 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1252 1262 { 1253 1263 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; … … 1279 1289 { 1280 1290 #endif 1281 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )1282 {1283 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );1284 }1285 else1286 {1287 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );1288 }1289 #if H_3D_SPIVMP1290 1291 #endif 1292 } 1293 #if H_3D_VSP1291 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1292 { 1293 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1294 } 1295 else 1296 { 1297 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1298 } 1299 #if NH_3D_SPIVMP 1300 } 1301 #endif 1302 } 1303 #if NH_3D_VSP 1294 1304 } 1295 1305 else … … 1317 1327 pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx ); 1318 1328 #endif 1319 #if H_3D_ARP 1320 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) 1321 { 1322 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi ); 1329 #if NH_3D_ARP 1330 if( pcCU->getARPW( uiPartAddr ) > 0 ) 1331 { 1332 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() ) 1333 { 1334 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi ); 1323 1335 } 1324 1336 else 1325 1337 { 1326 if( pcCU->getARPW( uiPartAddr ) > 0 1327 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N 1328 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 1329 ) 1330 { 1331 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 1338 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi ); 1339 } 1332 1340 } 1333 1341 else 1334 1342 { 1335 1343 #endif 1336 #if H_3D_IC 1337 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ); 1338 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1339 #if H_3D_ARP 1340 , false 1341 #endif 1342 , bICFlag ); 1343 bICFlag = bICFlag && (iWidth > 8); 1344 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi 1345 #if H_3D_ARP 1344 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++) 1345 { 1346 const ComponentID compID=ComponentID(comp); 1347 #if NH_3D_IC 1348 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) ); 1349 xPredInterBlk(compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) 1350 #if NH_3D_ARP 1346 1351 , false 1347 1352 #endif 1348 1353 , bICFlag ); 1349 1354 #else 1350 1351 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++)1352 {1353 const ComponentID compID=ComponentID(comp);1354 1355 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) ); 1355 } 1356 #endif 1357 #if H_3D_ARP 1358 } 1359 } 1360 #endif 1361 } 1362 1363 #if H_3D_VSP 1356 #endif 1357 } 1358 #if NH_3D_ARP 1359 } 1360 #endif 1361 } 1362 1363 #if NH_3D_VSP 1364 1364 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1365 1365 { … … 1382 1382 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU ) 1383 1383 { 1384 UInt numPartsInLine = pcCU->getPic()->getNumPartIn Width();1384 UInt numPartsInLine = pcCU->getPic()->getNumPartInCtuWidth(); 1385 1385 UInt horiNumPartsInSubPU = widthSubPU >> 2; 1386 1386 UInt vertNumPartsInSubPU = (heightSubPU >> 2) * numPartsInLine; … … 1398 1398 pcCU->clipMv(cMv); 1399 1399 1400 xPredInter LumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi);1401 xPredInter ChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi);1402 1403 } 1404 } 1405 } 1406 1407 #endif 1408 1409 #if H_3D_ARP1410 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi , TComMvField * pNewMvFiled)1411 { 1412 Int iRefIdx = p NewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );1413 TComMv cMv = p NewMvFiled ? pNewMvFiled->getMv() : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );1400 xPredInterBlk( COMPONENT_Y, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 1401 xPredInterBlk( COMPONENT_Cb, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) ); 1402 xPredInterBlk( COMPONENT_Cr, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) ); 1403 } 1404 } 1405 } 1406 #endif 1407 1408 #if NH_3D_ARP 1409 //temporal ARP 1410 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1411 { 1412 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1413 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1414 1414 Bool bTobeScaled = false; 1415 1415 TComPic* pcPicYuvBaseCol = NULL; 1416 1416 TComPic* pcPicYuvBaseRef = NULL; 1417 1417 1418 #if H_3D_NBDV1418 #if NH_3D_NBDV 1419 1419 DisInfo cDistparity; 1420 1420 cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV; … … 1425 1425 UChar dW = pcCU->getARPW ( uiPartAddr ); 1426 1426 1427 {1428 1427 Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList); 1429 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() ) 1430 { 1431 bTobeScaled = true; 1432 } 1433 1434 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 1435 1436 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 1437 1438 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 1428 if (arpRefIdx < 0 || !pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 1439 1429 { 1440 1430 dW = 0; … … 1443 1433 else 1444 1434 { 1445 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() ); 1435 if( arpRefIdx != iRefIdx ) 1436 { 1437 bTobeScaled = true; 1438 } 1439 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 1440 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 1446 1441 } 1447 1442 … … 1450 1445 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1451 1446 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 1452 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0);1447 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx ); 1453 1448 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 1454 1449 if ( iScale != 4096 ) … … 1456 1451 cMv = cMv.scaleMv( iScale ); 1457 1452 } 1458 iRefIdx = 0; 1459 } 1453 iRefIdx = arpRefIdx; 1460 1454 } 1461 1455 1462 1456 pcCU->clipMv(cMv); 1463 1457 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 1464 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1465 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1458 1459 for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++) 1460 { 1461 const ComponentID compID=ComponentID(comp); 1462 xPredInterBlk ( compID, pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1463 } 1466 1464 1467 1465 if( dW > 0 ) … … 1479 1477 pcCU->clipMv( cNBDV ); 1480 1478 1481 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 1482 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1483 if (iWidth > 8) 1484 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1479 TComPicYuv* pcPicYuvBaseColRec = pcPicYuvBaseCol->getPicYuvRec(); 1480 TComPicYuv* pcPicYuvBaseRefRec = pcPicYuvBaseRef->getPicYuvRec(); 1485 1481 1486 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 1487 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1488 1489 if (iWidth > 8) 1490 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1482 UInt uiCompNum = ( iWidth > 8 ) ? 3: 1; 1483 for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++) 1484 { 1485 const ComponentID compID=ComponentID(comp); 1486 xPredInterBlk ( compID, pcCU, pcPicYuvBaseColRec, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1487 xPredInterBlk ( compID, pcCU, pcPicYuvBaseRefRec, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1488 } 1491 1489 1492 1490 pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight ); … … 1496 1494 pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1497 1495 } 1498 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi );1496 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() ); 1499 1497 } 1500 1498 } … … 1505 1503 TComMv cDMv = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr ); 1506 1504 TComPic* pcPicYuvBaseCol = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 1507 TComPicYuv* pcYuvBaseCol = pcPicYuvBaseCol->getPicYuvRec();1508 Int uiLCUAddr,uiAbsPartAddr;1509 1505 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1510 1506 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1512 1508 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1513 1509 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1514 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1515 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1510 1511 Int uiLCUAddr,uiAbsPartAddr; 1512 pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1513 TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr ); 1516 1514 1517 1515 TComPic* pcPicYuvBaseTRef = NULL; … … 1565 1563 } 1566 1564 1567 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1565 //inter-view ARP 1566 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1568 1567 { 1569 1568 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); … … 1578 1577 Bool bTMVAvai = false; 1579 1578 TComMv cBaseTMV; 1580 if( pNewMvFiled ) 1581 { 1582 iRefIdx = pNewMvFiled->getRefIdx(); 1583 cDMv = pNewMvFiled->getMv(); 1584 } 1579 1585 1580 pcCU->clipMv(cTempDMv); 1586 1581 1587 assert(dW > 0);1588 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))1589 {1590 dW = 0;1591 }1592 Int uiLCUAddr,uiAbsPartAddr;1593 1582 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1594 1583 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1596 1585 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1597 1586 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1598 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1599 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1587 1588 Int uiLCUAddr,uiAbsPartAddr; 1589 pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1590 TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr ); 1600 1591 if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() ) 1601 1592 { … … 1668 1659 RefPicList eRefPicListCurr = RefPicList(iList); 1669 1660 Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr); 1670 if( iRef != -1 )1661 if( iRef != -1 && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex())) 1671 1662 { 1672 1663 pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); … … 1702 1693 } 1703 1694 1704 xPredInterLumaBlk ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1705 xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1706 1707 if( dW > 0 && bTMVAvai ) 1708 { 1695 for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++) 1696 { 1697 const ComponentID compID=ComponentID(comp); 1698 xPredInterBlk ( compID, pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), bTMVAvai ); 1699 } 1700 1701 if( dW > 0 ) 1702 { 1703 assert ( bTMVAvai ); 1709 1704 TComYuv* pYuvCurrTRef = &m_acYuvPredBase[0]; 1710 1705 TComYuv* pYuvBaseTRef = &m_acYuvPredBase[1]; … … 1720 1715 pYuvCurrTRef->clear(); pYuvBaseTRef->clear(); 1721 1716 } 1722 xPredInterLumaBlk ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1723 1724 if (iWidth > 8) 1725 xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1726 1727 xPredInterLumaBlk ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1728 1729 if (iWidth > 8) 1730 xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1717 1718 UInt uiCompNum = ( iWidth > 8 ) ? 3: 1; 1719 for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++) 1720 { 1721 const ComponentID compID=ComponentID(comp); 1722 xPredInterBlk ( compID, pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1723 xPredInterBlk ( compID, pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1724 } 1731 1725 1732 1726 pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); … … 1735 1729 pYuvCurrTRef->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1736 1730 } 1737 rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi );1731 rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() ); 1738 1732 } 1739 1733 } … … 1790 1784 } 1791 1785 1792 #if H_3D_VSP 1793 1786 #if NH_3D_VSP 1794 1787 Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ) 1795 1788 { … … 1813 1806 } 1814 1807 1815 xWeightedAverage( &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1816 } 1817 1808 xWeightedAverage( &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, pcCU->getSlice()->getSPS()->getBitDepths() ); 1809 } 1818 1810 #endif 1819 1811 … … 1835 1827 1836 1828 Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth 1837 #if H_3D_ARP1829 #if NH_3D_ARP 1838 1830 , Bool filterType 1839 1831 #endif 1840 #if H_3D_IC1832 #if NH_3D_IC 1841 1833 , Bool bICFlag 1842 1834 #endif … … 1857 1849 Int yFrac = mv->getVer() & ((1<<shiftVer)-1); 1858 1850 1859 #if H_3D_IC1851 #if NH_3D_INTEGER_MV_DEPTH 1860 1852 if( cu->getSlice()->getIsDepth() ) 1861 1853 { 1862 1854 refOffset = mv->getHor() + mv->getVer() * refStride; 1863 ref = refPic->get LumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ) + refOffset;1855 ref = refPic->getAddr(compID, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refOffset; 1864 1856 xFrac = 0; 1865 1857 yFrac = 0; … … 1874 1866 if ( yFrac == 0 ) 1875 1867 { 1876 #if H_3D_IC1877 m_if.filterHor Luma( ref, refStride, dst, dstStride, width, height, xFrac, !bi || bICFlag1868 #if NH_3D_IC 1869 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag, chFmt, bitDepth 1878 1870 #else 1879 1871 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth 1880 1872 #endif 1881 #if H_3D_ARP1873 #if NH_3D_ARP 1882 1874 , filterType 1883 1875 #endif … … 1886 1878 else if ( xFrac == 0 ) 1887 1879 { 1888 #if H_3D_IC1889 m_if.filterVer Luma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag1880 #if NH_3D_IC 1881 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag, chFmt, bitDepth 1890 1882 #else 1891 1883 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth 1892 1884 #endif 1893 #if H_3D_ARP1885 #if NH_3D_ARP 1894 1886 , filterType 1895 1887 #endif … … 1904 1896 1905 1897 m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false, chFmt, bitDepth 1906 #if H_3D_ARP1898 #if NH_3D_ARP 1907 1899 , filterType 1908 1900 #endif 1909 1901 ); 1910 #if H_3D_IC1911 m_if.filterVer Luma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi || bICFlag1902 #if NH_3D_IC 1903 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi || bICFlag, chFmt, bitDepth 1912 1904 #else 1913 1905 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt, bitDepth 1914 1906 #endif 1915 #if H_3D_ARP1907 #if NH_3D_ARP 1916 1908 , filterType 1917 1909 #endif … … 1919 1911 } 1920 1912 1921 #if H_3D_IC1913 #if NH_3D_IC 1922 1914 if( bICFlag ) 1923 1915 { 1924 1916 Int a, b, i, j; 1925 1917 const Int iShift = IC_CONST_SHIFT; 1926 1927 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA ); 1928 1929 1930 for ( i = 0; i < height; i++ )1931 { 1932 for ( j = 0; j < width; j++ )1933 { 1934 dst[j] = Clip3( 0, ( 1 << g_bitDepthY) - 1, ( ( a*dst[j] ) >> iShift ) + b );1918 Pel *dst2 = dst; 1919 1920 xGetLLSICPrediction( compID, cu, mv, refPic, a, b, bitDepth ); 1921 1922 for ( i = 0; i < cxHeight; i++ ) 1923 { 1924 for ( j = 0; j < cxWidth; j++ ) 1925 { 1926 dst[j] = Clip3( 0, ( 1 << bitDepth ) - 1, ( ( a*dst[j] ) >> iShift ) + b ); 1935 1927 } 1936 1928 dst += dstStride; … … 1939 1931 if(bi) 1940 1932 { 1941 Pel *dst2 = dstPic->getLumaAddr( partAddr ); 1942 Int shift = IF_INTERNAL_PREC - g_bitDepthY; 1943 for (i = 0; i < height; i++) 1944 { 1945 for (j = 0; j < width; j++) 1946 { 1947 Short val = dst2[j] << shift; 1948 dst2[j] = val - (Short)IF_INTERNAL_OFFS; 1933 Int shift = IF_INTERNAL_PREC - bitDepth; 1934 for (i = 0; i < cxHeight; i++) 1935 { 1936 for (j = 0; j < cxWidth; j++) 1937 { 1938 Pel val = dst2[j] << shift; 1939 dst2[j] = val - (Pel)IF_INTERNAL_OFFS; 1949 1940 } 1950 1941 dst2 += dstStride; … … 1956 1947 } 1957 1948 1958 1959 #if H_3D_ARP1960 , Bool filterType1961 #endif1962 #if H_3D_IC1963 , Bool bICFlag1964 #endif1965 #if H_3D_IC1966 m_if.filterHorChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag1967 #else1968 #endif1969 #if H_3D_ARP1970 , filterType1971 #endif1972 #if H_3D_IC1973 m_if.filterHorChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag1974 #else1975 #endif1976 #if H_3D_ARP1977 , filterType1978 #endif1979 #if H_3D_IC1980 m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag1981 #else1982 #endif1983 #if H_3D_ARP1984 , filterType1985 #endif1986 #if H_3D_IC1987 m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag1988 #else1989 #endif1990 #if H_3D_ARP1991 , filterType1992 #endif1993 #if H_3D_ARP1994 , filterType1995 #endif1996 #if H_3D_IC1997 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag1998 #else1999 #endif2000 #if H_3D_ARP2001 , filterType2002 #endif2003 #if H_3D_ARP2004 , filterType2005 #endif2006 #if H_3D_IC2007 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi || bICFlag2008 #else2009 #endif2010 #if H_3D_ARP2011 , filterType2012 #endif2013 #if H_3D_IC2014 if( bICFlag )2015 {2016 Int a, b, i, j;2017 const Int iShift = IC_CONST_SHIFT;2018 2019 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb2020 for ( i = 0; i < cxHeight; i++ )2021 {2022 for ( j = 0; j < cxWidth; j++ )2023 {2024 dstCb[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b );2025 }2026 dstCb += dstStride;2027 }2028 xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr2029 for ( i = 0; i < cxHeight; i++ )2030 {2031 for ( j = 0; j < cxWidth; j++ )2032 {2033 dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b );2034 }2035 dstCr += dstStride;2036 }2037 2038 if(bi)2039 {2040 Pel* dstCb2 = dstPic->getCbAddr( partAddr );2041 Pel* dstCr2 = dstPic->getCrAddr( partAddr );2042 Int shift = IF_INTERNAL_PREC - g_bitDepthC;2043 for (i = 0; i < cxHeight; i++)2044 {2045 for (j = 0; j < cxWidth; j++)2046 {2047 Short val = dstCb2[j] << shift;2048 dstCb2[j] = val - (Short)IF_INTERNAL_OFFS;2049 2050 val = dstCr2[j] << shift;2051 dstCr2[j] = val - (Short)IF_INTERNAL_OFFS;2052 }2053 dstCb2 += dstStride;2054 dstCr2 += dstStride;2055 }2056 }2057 }2058 #endif2059 1949 Void TComPrediction::xWeightedAverage( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* pcYuvDst, const BitDepths &clipBitDepths 2060 1950 ) … … 2201 2091 (uiDirMode==HOR_IDX || uiDirMode==VER_IDX); 2202 2092 } 2203 #if H_3D_IC2093 #if NH_3D_IC 2204 2094 /** Function for deriving the position of first non-zero binary bit of a value 2205 2095 * \param x input value … … 2231 2121 /** Function for deriving LM illumination compensation. 2232 2122 */ 2233 Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType)2123 Void TComPrediction::xGetLLSICPrediction( const ComponentID compID, TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, const Int bitDepth ) 2234 2124 { 2235 2125 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 2236 2126 Pel *pRec = NULL, *pRef = NULL; 2237 2127 UInt uiWidth, uiHeight, uiTmpPartIdx; 2238 Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride();2239 Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride();2128 Int iRecStride = pRecPic->getStride(compID); 2129 Int iRefStride = pRefPic->getStride(compID); 2240 2130 Int iRefOffset, iHor, iVer; 2241 2131 iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 ); 2242 2132 iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 ); 2243 if( eType != TEXT_LUMA)2133 if( !isLuma(compID) ) 2244 2134 { 2245 2135 iHor = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getHor() + 1 ) >> 1 ) : ( ( pMv->getHor() + 4 ) >> 3 ); 2246 2136 iVer = pcCU->getSlice()->getIsDepth() ? ( ( pMv->getVer() + 1 ) >> 1 ) : ( ( pMv->getVer() + 4 ) >> 3 ); 2247 2137 } 2248 uiWidth = ( eType == TEXT_LUMA ) ? pcCU->getWidth( 0 ) : ( pcCU->getWidth( 0 ) >> 1);2249 uiHeight = ( eType == TEXT_LUMA ) ? pcCU->getHeight( 0 ) : ( pcCU->getHeight( 0 ) >> 1);2138 uiWidth = pcCU->getWidth( 0 ) >> pRefPic->getComponentScaleX(compID); 2139 uiHeight = pcCU->getHeight( 0 ) >> pRefPic->getComponentScaleY(compID); 2250 2140 2251 2141 Int i, j, iCountShift = 0; 2252 2142 2253 // LLS parameters estimation -->2143 // LLS parameters estimation 2254 2144 2255 2145 Int x = 0, y = 0, xx = 0, xy = 0; 2256 Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12); 2257 2258 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) ) 2146 Int precShift = std::max(0, bitDepth - 12); 2147 2148 UInt partAddr = 0; 2149 if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCtu() ) ) 2259 2150 { 2260 2151 iRefOffset = iHor + iVer * iRefStride - iRefStride; 2261 if( eType == TEXT_LUMA ) 2262 { 2263 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2264 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 2265 } 2266 else if( eType == TEXT_CHROMA_U ) 2267 { 2268 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2269 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 2270 } 2271 else 2272 { 2273 assert( eType == TEXT_CHROMA_V ); 2274 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2275 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 2276 } 2277 2152 pRef = pRefPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) + iRefOffset; 2153 pRec = pRecPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) - iRecStride; 2278 2154 for( j = 0; j < uiWidth; j+=2 ) 2279 2155 { 2280 2156 x += pRef[j]; 2281 2157 y += pRec[j]; 2282 if ( eType == TEXT_LUMA)2158 if( isLuma(compID) ) 2283 2159 { 2284 2160 xx += (pRef[j] * pRef[j])>>precShift; … … 2289 2165 } 2290 2166 2291 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInC U() ) )2167 if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCtu() ) ) 2292 2168 { 2293 2169 iRefOffset = iHor + iVer * iRefStride - 1; 2294 if( eType == TEXT_LUMA ) 2295 { 2296 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2297 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 2298 } 2299 else if( eType == TEXT_CHROMA_U ) 2300 { 2301 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2302 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 2303 } 2304 else 2305 { 2306 assert( eType == TEXT_CHROMA_V ); 2307 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 2308 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 2309 } 2310 2170 pRef = pRefPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) + iRefOffset; 2171 pRec = pRecPic->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + partAddr ) - 1; 2311 2172 for( i = 0; i < uiHeight; i+=2 ) 2312 2173 { 2313 2174 x += pRef[0]; 2314 2175 y += pRec[0]; 2315 if ( eType == TEXT_LUMA)2176 if( isLuma(compID) ) 2316 2177 { 2317 2178 xx += (pRef[0] * pRef[0])>>precShift; … … 2331 2192 } 2332 2193 2333 if ( eType != TEXT_LUMA)2334 { 2335 a = 32;2194 if( !isLuma(compID) ) 2195 { 2196 a = ( 1 << IC_CONST_SHIFT ); 2336 2197 b = ( y - x + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 2337 2198 } … … 2343 2204 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 2344 2205 const Int iShift = IC_CONST_SHIFT; 2345 {2346 {2347 2206 const Int iShiftA2 = 6; 2348 2207 const Int iAccuracyShift = 15; … … 2350 2209 Int iScaleShiftA2 = 0; 2351 2210 Int iScaleShiftA1 = 0; 2352 Int a1s = a1;2353 Int a2s = a2;2211 Int a1s; 2212 Int a2s; 2354 2213 2355 2214 a1 = Clip3(0, 2*a2, a1); … … 2379 2238 } 2380 2239 } 2381 }2382 }2383 2240 #endif 2384 2241 -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComPrediction.h
r1243 r1279 45 45 #include "TComWeightPrediction.h" 46 46 47 #if NH_3D_ARP 48 #include "TComPic.h" 49 #endif 47 50 // forward declaration 48 51 class TComMv; … … 77 80 TComYuv m_acYuvPred[NUM_REF_PIC_LIST_01]; 78 81 TComYuv m_cYuvPredTemp; 79 #if H_3D_ARP82 #if NH_3D_ARP 80 83 TComYuv m_acYuvPredBase[2]; 81 84 #endif … … 87 90 Pel* m_pLumaRecBuffer; ///< array for downsampled reconstructed luma sample 88 91 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 89 #if H_3D_IC92 #if NH_3D_IC 90 93 UInt m_uiaShift[ 64 ]; // Table for multiplication to substitue of division operation 91 94 #endif 92 95 93 #if H_3D_VSP96 #if NH_3D_VSP 94 97 Int* m_pDepthBlock; ///< Store a depth block, local variable, to prevent memory allocation every time 95 98 TComYuv m_cYuvDepthOnVsp; … … 100 103 101 104 // motion compensation functions 102 #if H_3D_ARP 103 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL ); 105 #if NH_3D_ARP 106 Void xPredInterUniARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ); 107 Void xPredInterUniARPviewRef ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ); 104 108 Bool xCheckBiInterviewARP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc ); 105 Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );106 109 #endif 107 110 108 111 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv* pcYuvPred, Bool bi=false ); 109 112 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv* pcYuvPred ); 110 #if H_3D_VSP113 #if NH_3D_VSP 111 114 Void xPredInterUniVSP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false ); 112 115 Void xPredInterBiVSP ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ); … … 114 117 115 118 Void xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth 116 #if H_3D_ARP119 #if NH_3D_ARP 117 120 , Bool filterType = false 118 121 #endif 119 #if H_3D_IC122 #if NH_3D_IC 120 123 , Bool bICFlag = false 121 124 #endif 122 125 ); 123 126 124 #if H_3D_ARP 125 , Bool filterType = false 126 #endif 127 #if H_3D_IC 128 , Bool bICFlag = false 129 #endif 130 #if H_3D_VSP 127 #if NH_3D_VSP 131 128 Void xPredInterUniSubPU ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 ); 132 129 #endif … … 135 132 136 133 Void xGetLLSPrediction ( const Pel* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0, const ChromaFormat chFmt DEBUG_STRING_FN_DECLARE(sDebug) ); 137 #if H_3D_IC138 Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType);134 #if NH_3D_IC 135 Void xGetLLSICPrediction( const ComponentID compID, TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, const Int bitDepth); 139 136 #endif 140 137 Void xDCPredFiltering( const Pel* pSrc, Int iSrcStride, Pel* pDst, Int iDstStride, Int iWidth, Int iHeight, ChannelType channelType ); 141 138 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); 142 #if H_3D_SPIVMP139 #if NH_3D_SPIVMP 143 140 Bool xCheckTwoSPMotion ( TComDataCU* pcCU, UInt PartAddr0, UInt PartAddr1 ); 144 141 Void xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ); … … 174 171 #endif 175 172 176 #if H_3D_DBBP173 #if NH_3D_DBBP 177 174 PartSize getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU); 178 175 Bool getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU); 179 Void combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize );176 Void combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY ); 180 177 #endif 181 178 -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRdCost.cpp
r1209 r1279 311 311 m_bUseEstimatedVSD = false; 312 312 #endif 313 #if H_3D_DBBP313 #if NH_3D_DBBP 314 314 m_bUseMask = false; 315 315 #endif … … 340 340 rcDistParam.DistFunc = m_afpDistortFunc[eDFunc + g_aucConvertToBit[ rcDistParam.iCols ] + 1 ]; 341 341 342 #if H_3D_DBBP342 #if NH_3D_DBBP 343 343 if( m_bUseMask ) 344 344 { … … 397 397 } 398 398 399 #if H_3D_DBBP399 #if NH_3D_DBBP 400 400 if( m_bUseMask ) 401 401 { … … 446 446 } 447 447 448 #if H_3D_DBBP448 #if NH_3D_DBBP 449 449 if( m_bUseMask ) 450 450 { … … 468 468 rcDP.bitDepth = bitDepth; 469 469 rcDP.DistFunc = m_afpDistortFunc[ ( bHadamard ? DF_HADS : DF_SADS ) + g_aucConvertToBit[ iWidth ] + 1 ]; 470 #if H_3D_DBBP470 #if NH_3D_DBBP 471 471 if( m_bUseMask ) 472 472 { … … 561 561 cDtParam.bitDepth = bitDepth; 562 562 563 #if H_3D_IC563 #if NH_3D_IC 564 564 cDtParam.bUseIC = false; 565 565 #endif … … 602 602 cDtParam.bitDepth = bitDepth; 603 603 604 #if NH_3D_IC_FIX 605 cDtParam.bUseIC = false; 606 #endif 607 #if H_3D_INTER_SDC_FIX 608 cDtParam.bUseSDCMRSAD = false; 609 #endif 610 604 611 Dist dist = cDtParam.DistFunc( &cDtParam ); 605 612 … … 648 655 // ==================================================================================================================== 649 656 650 #if H_3D_DBBP657 #if NH_3D_DBBP 651 658 // -------------------------------------------------------------------------------------------------------------------- 652 659 // Masked distortion functions … … 689 696 690 697 AOF(!pcDtParam->bApplyWeight); 691 #if H_3D_IC698 #if NH_3D_IC 692 699 AOF(!pcDtParam->bUseIC); 693 700 #endif … … 763 770 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 764 771 } 765 #if H_3D_IC772 #if NH_3D_IC 766 773 if( pcDtParam->bUseIC ) 767 774 { … … 805 812 } 806 813 807 #if H_3D_IC814 #if NH_3D_IC 808 815 if( pcDtParam->bUseIC ) 809 816 { … … 850 857 } 851 858 852 #if H_3D_IC859 #if NH_3D_IC 853 860 if( pcDtParam->bUseIC ) 854 861 { … … 899 906 } 900 907 901 #if H_3D_IC908 #if NH_3D_IC 902 909 if( pcDtParam->bUseIC ) 903 910 { … … 955 962 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 956 963 } 957 #if H_3D_IC964 #if NH_3D_IC 958 965 if( pcDtParam->bUseIC ) 959 966 { … … 1003 1010 Distortion TComRdCost::xGetSAD16N( DistParam* pcDtParam ) 1004 1011 { 1005 #if H_3D_IC1012 #if NH_3D_IC 1006 1013 if( pcDtParam->bUseIC ) 1007 1014 { … … 1063 1070 } 1064 1071 1065 #if H_3D_IC1072 #if NH_3D_IC 1066 1073 if( pcDtParam->bUseIC ) 1067 1074 { … … 1136 1143 } 1137 1144 1138 #if H_3D_IC1145 #if NH_3D_IC 1139 1146 if( pcDtParam->bUseIC ) 1140 1147 { … … 1201 1208 } 1202 1209 1203 #if H_3D_IC1210 #if NH_3D_IC 1204 1211 if( pcDtParam->bUseIC ) 1205 1212 { … … 1305 1312 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1306 1313 } 1307 #if H_3D_IC1314 #if NH_3D_IC 1308 1315 if( pcDtParam->bUseIC ) 1309 1316 { … … 1388 1395 1389 1396 1390 #if H_3D_IC || H_3D_INTER_SDC1397 #if NH_3D_IC || H_3D_INTER_SDC 1391 1398 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1392 1399 { 1393 1400 if ( pcDtParam->bApplyWeight ) 1394 1401 { 1395 return xGetSADw( pcDtParam );1402 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1396 1403 } 1397 1404 Pel* piOrg = pcDtParam->pOrg; … … 1441 1448 if ( pcDtParam->bApplyWeight ) 1442 1449 { 1443 return xGetSADw( pcDtParam );1450 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1444 1451 } 1445 1452 Pel* piOrg = pcDtParam->pOrg; … … 1498 1505 if ( pcDtParam->bApplyWeight ) 1499 1506 { 1500 return xGetSADw( pcDtParam );1507 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1501 1508 } 1502 1509 Pel* piOrg = pcDtParam->pOrg; … … 1567 1574 if ( pcDtParam->bApplyWeight ) 1568 1575 { 1569 return xGetSADw( pcDtParam );1576 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1570 1577 } 1571 1578 Pel* piOrg = pcDtParam->pOrg; … … 1660 1667 if ( pcDtParam->bApplyWeight ) 1661 1668 { 1662 return xGetSADw( pcDtParam );1669 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1663 1670 } 1664 1671 Pel* piOrg = pcDtParam->pOrg; … … 1835 1842 if ( pcDtParam->bApplyWeight ) 1836 1843 { 1837 return xGetSADw( pcDtParam );1844 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1838 1845 } 1839 1846 Pel* piOrg = pcDtParam->pOrg; … … 1977 1984 if ( pcDtParam->bApplyWeight ) 1978 1985 { 1979 return xGetSADw( pcDtParam );1986 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 1980 1987 } 1981 1988 Pel* piOrg = pcDtParam->pOrg; … … 2094 2101 if ( pcDtParam->bApplyWeight ) 2095 2102 { 2096 return xGetSADw( pcDtParam );2103 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 2097 2104 } 2098 2105 Pel* piOrg = pcDtParam->pOrg; … … 2332 2339 if ( pcDtParam->bApplyWeight ) 2333 2340 { 2334 return xGetSADw( pcDtParam );2341 return TComRdCostWeightPrediction::xGetSADw( pcDtParam ); 2335 2342 } 2336 2343 … … 3327 3334 return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); 3328 3335 } 3329 #if H_3D_IC3336 #if NH_3D_IC 3330 3337 if( pcDtParam->bUseIC ) 3331 3338 { … … 3403 3410 } 3404 3411 3405 #if H_3D_IC || H_3D_INTER_SDC3412 #if NH_3D_IC || H_3D_INTER_SDC 3406 3413 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 3407 3414 { 3408 3415 if ( pcDtParam->bApplyWeight ) 3409 3416 { 3410 return xGetHADsw( pcDtParam );3417 return TComRdCostWeightPrediction::xGetHADsw( pcDtParam ); 3411 3418 } 3412 3419 Pel* piOrg = pcDtParam->pOrg; -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRdCost.h
r1209 r1279 91 91 Int iStrideVir; 92 92 #endif 93 #if H_3D_IC93 #if NH_3D_IC 94 94 Bool bUseIC; 95 95 #endif … … 167 167 #endif 168 168 Int m_iCostScale; 169 #if H_3D_DBBP169 #if NH_3D_DBBP 170 170 Bool m_bUseMask; 171 171 #endif … … 206 206 Void setDistParam( DistParam& rcDP, Int bitDepth, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false ); 207 207 208 #if H_3D_DBBP208 #if NH_3D_DBBP 209 209 Void setUseMask(Bool b) { m_bUseMask = b; } 210 210 #endif … … 256 256 static Distortion xGetSSE64 ( DistParam* pcDtParam ); 257 257 static Distortion xGetSSE16N ( DistParam* pcDtParam ); 258 #if H_3D_IC || H_3D_INTER_SDC258 #if NH_3D_IC || H_3D_INTER_SDC 259 259 static UInt xGetSADic ( DistParam* pcDtParam ); 260 260 static UInt xGetSAD4ic ( DistParam* pcDtParam ); … … 283 283 #endif 284 284 285 #if H_3D_IC || H_3D_INTER_SDC285 #if NH_3D_IC || H_3D_INTER_SDC 286 286 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 287 287 static UInt xGetSAD24ic ( DistParam* pcDtParam ); … … 294 294 295 295 296 #if H_3D_IC || H_3D_INTER_SDC296 #if NH_3D_IC || H_3D_INTER_SDC 297 297 static UInt xGetHADsic ( DistParam* pcDtParam ); 298 298 #endif … … 302 302 static Distortion xCalcHADs4x4 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); 303 303 static Distortion xCalcHADs8x8 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); 304 #if H_3D_DBBP304 #if NH_3D_DBBP 305 305 static UInt xGetMaskedSSE ( DistParam* pcDtParam ); 306 306 static UInt xGetMaskedSAD ( DistParam* pcDtParam ); -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.cpp
r1247 r1279 546 546 Bool g_disableNumbering = false; 547 547 Bool g_disableHLSTrace = false; 548 UInt64 g_stopAtCounter = 937234;548 UInt64 g_stopAtCounter = 4660; 549 549 Bool g_traceCopyBack = false; 550 550 Bool g_decTraceDispDer = false; … … 686 686 } 687 687 Bool stopFlag = false; 688 if ( g_stopAtPos && poc == 0 && layerId == 2)688 if ( g_stopAtPos && poc == 16 && layerId == 1 ) 689 689 { 690 690 Bool stopAtCU = true; 691 691 if ( stopAtCU ) // Stop at CU with specific size 692 692 { 693 stopFlag = ( cuPelX == 0 ) && ( cuPelY == 0 ) && ( cuWidth == 8 ) && ( cuHeight == 8);693 stopFlag = ( cuPelX == 0 ) && ( cuPelY == 0 ) && ( cuWidth == 32 ) && ( cuHeight == 32 ); 694 694 } 695 695 else … … 711 711 if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt ) 712 712 { 713 if ( g_stopAtCounter == g_nSymbolCounter ) 714 { 715 std::cout << "Break point here." << std::endl; 716 } 713 incSymbolCounter(); 717 714 if ( !g_disableNumbering ) 718 715 { 719 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter ++);716 fprintf( g_hTrace, "%8lld ", g_nSymbolCounter ); 720 717 } 721 718 fprintf( g_hTrace, "%-50s : %d\n", symbolName, val ); 722 fflush ( g_hTrace ); 723 g_nSymbolCounter++; 724 } 719 fflush ( g_hTrace ); 720 } 721 } 722 UInt64 incSymbolCounter( ) 723 { 724 g_nSymbolCounter++; 725 if ( g_stopAtCounter == g_nSymbolCounter ) 726 { 727 std::cout << "Break point here." << std::endl; 728 } 729 return g_nSymbolCounter; 725 730 } 726 731 Void writeToTraceFile( const Char* symbolName, Bool doIt ) … … 728 733 if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt ) 729 734 { 735 incSymbolCounter(); 730 736 fprintf( g_hTrace, "%s", symbolName ); 731 fflush ( g_hTrace ); 732 g_nSymbolCounter++; 737 fflush ( g_hTrace ); 733 738 } 734 739 } -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.h
r1247 r1279 196 196 Void writeToTraceFile( const Char* symbolName, Int val, Bool doIt ); 197 197 Void writeToTraceFile( const Char* symbolName, Bool doIt ); 198 incSymbolCounter incSymbolCounter(); 198 199 Void stopAtPos ( Int poc, Int layerId, Int cuPelX, Int cuPelY, Int cuWidth, Int cuHeight ); 199 200 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.cpp
r1258 r1279 140 140 , m_pocMsbValRequiredFlag (false) 141 141 #endif 142 #if H_3D_IC142 #if NH_3D_IC 143 143 , m_bApplyIC (false) 144 144 , m_icSkipParseFlag (false) … … 278 278 m_iSliceChromaQpDelta[component] = 0; 279 279 } 280 #if H_3D_IV_MERGE280 #if NH_3D_IV_MERGE 281 281 m_maxNumMergeCand = MRG_MAX_NUM_CANDS_MEM; 282 282 #else … … 289 289 m_cabacInitFlag = false; 290 290 m_enableTMVPFlag = true; 291 #if H_3D_TMVP291 #if NH_3D_TMVP 292 292 m_aiAlterRefIdx[0] = -1; 293 293 m_aiAlterRefIdx[1] = -1; … … 824 824 } 825 825 } 826 #if H_3D827 #if H_3D_TMVP826 #if NH_3D 827 #if NH_3D_TMVP 828 828 Void TComSlice::generateAlterRefforTMVP() 829 829 { … … 1171 1171 m_bApplyDIS = pSrc->m_bApplyDIS; 1172 1172 #endif 1173 #if H_3D_IC1173 #if NH_3D_IC 1174 1174 m_bApplyIC = pSrc->m_bApplyIC; 1175 1175 m_icSkipParseFlag = pSrc->m_icSkipParseFlag; … … 1996 1996 m_dimensionId[i][j] = 0; 1997 1997 } 1998 #if H_3D_ARP1998 #if NH_3D_ARP 1999 1999 #endif 2000 2000 } … … 3571 3571 #endif 3572 3572 } 3573 #if H_3D3574 Void TComSlice::setDefaultRefView( 3575 { 3576 setDefaultRefViewIdx( -1);3577 setDefaultRefViewIdxAvailableFlag( false);3573 #if NH_3D_NBDV 3574 Void TComSlice::setDefaultRefView() 3575 { 3576 setDefaultRefViewIdx(-1); 3577 setDefaultRefViewIdxAvailableFlag(false); 3578 3578 3579 3579 Int valid = 0; 3580 3580 Int DefaultRefViewIdx = -1; 3581 for( UInt curViewIdx = 0; curViewIdx < getViewIndex() && valid == 0; curViewIdx++ ) 3582 { 3583 for( Int iRefListId = 0; ( iRefListId < (isInterB() ? 2 : 1) ) && !isIntra() && valid == 0; iRefListId++ ) 3584 { 3585 RefPicList eRefPicList = RefPicList( iRefListId ); 3586 Int iNumRefPics = getNumRefIdx( eRefPicList ); 3587 for( Int i = 0; i < iNumRefPics; i++ ) 3581 3582 for(UInt curViewIdx = 0; curViewIdx < getViewIndex() && valid == 0; curViewIdx++) 3583 { 3584 for(Int iRefListId = 0; (iRefListId < (isInterB() ? 2 : 1)) && !isIntra() && valid == 0; iRefListId++) 3585 { 3586 RefPicList eRefPicList = RefPicList(iRefListId); 3587 Int iNumRefPics = getNumRefIdx(eRefPicList); 3588 3589 for(Int i = 0; i < iNumRefPics; i++) 3588 3590 { 3589 if(getPOC() == getRefPic( eRefPicList, i )->getPOC() && curViewIdx == getRefPic( eRefPicList, i)->getViewIndex())3591 if(getPOC() == getRefPic(eRefPicList, i)->getPOC() && curViewIdx == getRefPic(eRefPicList, i)->getViewIndex()) 3590 3592 { 3591 3593 valid = 1; … … 3596 3598 } 3597 3599 } 3598 if( valid ) 3599 { 3600 setDefaultRefViewIdx( DefaultRefViewIdx ); 3601 setDefaultRefViewIdxAvailableFlag( true ); 3602 } 3603 } 3604 #endif 3605 3606 #if H_3D_ARP 3600 3601 if(valid) 3602 { 3603 setDefaultRefViewIdx(DefaultRefViewIdx); 3604 setDefaultRefViewIdxAvailableFlag(true); 3605 } 3606 } 3607 #endif 3608 3609 #if NH_3D_ARP 3607 3610 Void TComSlice::setARPStepNum( TComPicLists*ivPicLists ) 3608 3611 { … … 3674 3677 } 3675 3678 } 3676 } 3677 #endif 3678 3679 #if H_3D_IC 3679 if( m_nARPStepNum > 1) 3680 { 3681 for(Int i = 0; i < getNumActiveRefLayerPics(); i ++ ) 3682 { 3683 Int iLayerId = getRefPicLayerId( i ); 3684 Int iViewIdx = getVPS()->getViewIndex(iLayerId); 3685 Bool bIsDepth = ( getVPS()->getDepthId ( iLayerId ) == 1 ); 3686 if( iViewIdx<getViewIndex() && !bIsDepth ) 3687 { 3688 setBaseViewRefPicList( ivPicLists->getPicList( iLayerId ), iViewIdx ); 3689 } 3690 } 3691 } 3692 } 3693 #endif 3694 3695 #if NH_3D_IC 3680 3696 // This is an encoder only function and should be moved to TEncSlice or TEncSearch!! 3681 3697 Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc) … … 3766 3782 { 3767 3783 // Histogram building - luminance 3768 Int iMaxPelValue = ( 1 << g _bitDepthY);3784 Int iMaxPelValue = ( 1 << getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 3769 3785 Int *aiRefOrgHist = (Int *) xMalloc( Int,iMaxPelValue ); 3770 3786 Int *aiCurrHist = (Int *) xMalloc( Int,iMaxPelValue ); … … 3772 3788 memset( aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 3773 3789 3774 Int iWidth = pcCurrPicYuv->getWidth(); 3775 Int iHeight = pcCurrPicYuv->getHeight(); 3776 3777 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 3778 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 3779 Int iCurrStride = pcCurrPicYuv->getStride(); 3780 Int iRefStride = pcRefPicYuvOrg->getStride(); 3781 3790 Int iWidth = pcCurrPicYuv->getWidth(COMPONENT_Y); 3791 Int iHeight = pcCurrPicYuv->getHeight(COMPONENT_Y); 3792 Pel* pCurrY = pcCurrPicYuv->getAddr(COMPONENT_Y); 3793 Pel* pRefOrgY = pcRefPicYuvOrg->getAddr(COMPONENT_Y); 3794 Int iCurrStride = pcCurrPicYuv->getStride(COMPONENT_Y); 3795 Int iRefStride = pcRefPicYuvOrg->getStride(COMPONENT_Y); 3782 3796 for ( Int y = 0; y < iHeight; y++ ) 3783 3797 { … … 3833 3847 setupLUT = setupLUT || getViewSynthesisPredFlag( ); 3834 3848 3835 #if H_3D_NBDV_REF3849 #if NH_3D_NBDV_REF 3836 3850 setupLUT = setupLUT || getDepthRefinementFlag( ); 3837 3851 #endif 3838 3852 3839 #if H_3D_IV_MERGE3853 #if NH_3D_IV_MERGE 3840 3854 setupLUT = setupLUT || ( getIvMvPredFlag() && getIsDepth() ); 3841 3855 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComSlice.h
r1251 r1279 2602 2602 IntAry2d m_aaiCodedOffset; 2603 2603 #endif 2604 #if H_3D_TMVP2604 #if NH_3D_TMVP 2605 2605 Int m_aiAlterRefIdx [2]; 2606 2606 #endif 2607 #if H_3D_ARP2607 #if NH_3D_ARP 2608 2608 Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS]; 2609 2609 TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; … … 2614 2614 std::vector<Int> m_pocsInCurrRPSs; 2615 2615 #endif 2616 #if H_3D_IC2616 #if NH_3D_IC 2617 2617 Bool m_bApplyIC; 2618 2618 Bool m_icSkipParseFlag; … … 2630 2630 #endif 2631 2631 #endif 2632 #if H_3D_IC2632 #if NH_3D_IC 2633 2633 Int* m_aICEnableCandidate; 2634 2634 Int* m_aICEnableNum; … … 2718 2718 TComPic* getIvPic( Bool depthFlag, Int viewIndex) const { return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } 2719 2719 TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } 2720 #endif 2721 #if H_3D_IC2720 #endif 2721 #if NH_3D_IC 2722 2722 Void setApplyIC( Bool b ) { m_bApplyIC = b; } 2723 2723 Bool getApplyIC() { return m_bApplyIC; } … … 2727 2727 Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } 2728 2728 #endif 2729 #if H_3D_ARP2729 #if NH_3D_ARP 2730 2730 Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } 2731 2731 Void setARPStepNum( TComPicLists*ivPicLists ); … … 2929 2929 Int getViewIndex () const { return m_viewIndex; } 2930 2930 #if NH_3D 2931 #if H_3D_TMVP2931 #if NH_3D_TMVP 2932 2932 Void generateAlterRefforTMVP (); 2933 2933 Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } 2934 2934 Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } 2935 2935 #endif 2936 #if H_3D_ARP2936 #if NH_3D_ARP 2937 2937 Int getFirstTRefIdx ( RefPicList e ) { return m_aiFirstTRefIdx[e]; } 2938 2938 Void setFirstTRefIdx ( RefPicList e, Int i ) { m_aiFirstTRefIdx[e] = i; } … … 2966 2966 Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ getVPS()->getVoiInVps( refViewIdx) ];} 2967 2967 Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ getVPS()->getVoiInVps( refViewIdx) ];} 2968 #if H_3D_IC2968 #if NH_3D_IC 2969 2969 Void setICEnableCandidate( Int* icEnableCandidate) { m_aICEnableCandidate = icEnableCandidate; } 2970 2970 Void setICEnableNum( Int* icEnableNum) { m_aICEnableNum = icEnableNum; } … … 3082 3082 Int getMpiSubPbSize ( ) { return m_mpiSubPbSize ; }; 3083 3083 Int getSubPbSize ( ) { return m_subPbSize ; }; 3084 #if NH_3D_NBDV 3085 Int getDefaultRefViewIdx() { return m_iDefaultRefViewIdx; } 3086 Void setDefaultRefViewIdx(Int iViewIdx) { m_iDefaultRefViewIdx = iViewIdx; } 3087 3088 Bool getDefaultRefViewIdxAvailableFlag() { return m_bDefaultRefViewIdxAvailableFlag; } 3089 Void setDefaultRefViewIdxAvailableFlag(Bool bViewIdx) { m_bDefaultRefViewIdxAvailableFlag = bViewIdx; } 3090 Void setDefaultRefView( ); 3091 #endif 3084 3092 #endif 3085 3093 // Inference -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComYuv.cpp
r1200 r1279 487 487 } 488 488 489 #if H_3D_ARP490 Void TComYuv::addARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip )491 { 492 addARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight , bClip );493 addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip );494 } 495 496 Void TComYuv::addARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip )489 #if NH_3D_ARP 490 Void TComYuv::addARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip, const BitDepths &clipBitDepths ) 491 { 492 addARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight , bClip , clipBitDepths); 493 addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip , clipBitDepths); 494 } 495 496 Void TComYuv::addARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip, const BitDepths &clipBitDepths ) 497 497 { 498 498 Int x, y; 499 499 500 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx ); 501 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx ); 502 Pel* pDst = getLumaAddr( uiAbsPartIdx ); 503 504 UInt iSrc0Stride = pcYuvSrc0->getStride(); 505 UInt iSrc1Stride = pcYuvSrc1->getStride(); 506 UInt iDstStride = getStride(); 507 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY; 500 Pel* pSrc0 = pcYuvSrc0->getAddr( COMPONENT_Y, uiAbsPartIdx ); 501 Pel* pSrc1 = pcYuvSrc1->getAddr( COMPONENT_Y, uiAbsPartIdx ); 502 Pel* pDst = getAddr( COMPONENT_Y, uiAbsPartIdx ); 503 504 UInt iSrc0Stride = pcYuvSrc0->getStride(COMPONENT_Y); 505 UInt iSrc1Stride = pcYuvSrc1->getStride(COMPONENT_Y); 506 UInt iDstStride = getStride(COMPONENT_Y); 507 const Int clipbd = clipBitDepths.recon[CHANNEL_TYPE_LUMA]; 508 Int iIFshift = IF_INTERNAL_PREC - clipbd; 508 509 Int iOffSet = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS; 509 510 for ( y = uiHeight-1; y >= 0; y-- ) … … 514 515 if( bClip ) 515 516 { 516 pDst[x] = ClipY( ( pDst[x] + iOffSet ) >> iIFshift);517 pDst[x] = Pel(ClipBD<Int>(Int( ( pDst[x] + iOffSet ) >> iIFshift ), clipbd)); 517 518 } 518 519 } … … 523 524 } 524 525 525 Void TComYuv::addARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip )526 Void TComYuv::addARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip, const BitDepths &clipBitDepths ) 526 527 { 527 528 Int x, y; 528 529 529 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx ); 530 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx ); 531 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx ); 532 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx ); 533 Pel* pDstU = getCbAddr( uiAbsPartIdx ); 534 Pel* pDstV = getCrAddr( uiAbsPartIdx ); 535 536 UInt iSrc0Stride = pcYuvSrc0->getCStride(); 537 UInt iSrc1Stride = pcYuvSrc1->getCStride(); 538 UInt iDstStride = getCStride(); 539 540 Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC; 530 Pel* pSrcU0 = pcYuvSrc0->getAddr( COMPONENT_Cb, uiAbsPartIdx ); 531 Pel* pSrcU1 = pcYuvSrc1->getAddr( COMPONENT_Cb, uiAbsPartIdx ); 532 Pel* pSrcV0 = pcYuvSrc0->getAddr( COMPONENT_Cr, uiAbsPartIdx ); 533 Pel* pSrcV1 = pcYuvSrc1->getAddr( COMPONENT_Cr, uiAbsPartIdx ); 534 Pel* pDstU = getAddr( COMPONENT_Cb, uiAbsPartIdx ); 535 Pel* pDstV = getAddr( COMPONENT_Cr, uiAbsPartIdx ); 536 537 UInt iSrc0StrideCb = pcYuvSrc0->getStride(COMPONENT_Cb); 538 UInt iSrc1StrideCb = pcYuvSrc1->getStride(COMPONENT_Cb); 539 UInt iDstStrideCb = getStride(COMPONENT_Cb); 540 541 UInt iSrc0StrideCr = pcYuvSrc0->getStride(COMPONENT_Cr); 542 UInt iSrc1StrideCr = pcYuvSrc1->getStride(COMPONENT_Cr); 543 UInt iDstStrideCr = getStride(COMPONENT_Cr); 544 545 const Int clipbd = clipBitDepths.recon[CHANNEL_TYPE_CHROMA]; 546 Int iIFshift = IF_INTERNAL_PREC - clipbd; 541 547 Int iOffSet = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS; 542 548 … … 549 555 if( bClip ) 550 556 { 551 pDstU[x] = ClipC( ( pDstU[x] + iOffSet ) >> iIFshift ); 552 pDstV[x] = ClipC( ( pDstV[x] + iOffSet ) >> iIFshift ); 553 } 554 } 555 557 pDstU[x] = Pel(ClipBD<Int>( Int( ( pDstU[x] + iOffSet ) >> iIFshift ), clipbd)); 558 pDstV[x] = Pel(ClipBD<Int>( Int( ( pDstV[x] + iOffSet ) >> iIFshift ), clipbd)); 559 } 560 } 561 562 pSrcU0 += iSrc0StrideCb; 563 pSrcU1 += iSrc1StrideCb; 564 pSrcV0 += iSrc0StrideCr; 565 pSrcV1 += iSrc1StrideCr; 566 pDstU += iDstStrideCb; 567 pDstV += iDstStrideCr; 568 } 569 } 570 571 Void TComYuv::subtractARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 572 { 573 subtractARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight ); 574 575 if (uiWidth > 8 && pcYuvSrc1->getNumberValidComponents() > 1) 576 { 577 subtractARPChroma( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 ); 578 } 579 } 580 581 Void TComYuv::subtractARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 582 { 583 Int x, y; 584 585 Pel* pSrc0 = pcYuvSrc0->getAddr(COMPONENT_Y, uiAbsPartIdx ); 586 Pel* pSrc1 = pcYuvSrc1->getAddr(COMPONENT_Y, uiAbsPartIdx ); 587 Pel* pDst = getAddr (COMPONENT_Y, uiAbsPartIdx ); 588 589 Int iSrc0Stride = pcYuvSrc0->getStride(COMPONENT_Y); 590 Int iSrc1Stride = pcYuvSrc1->getStride(COMPONENT_Y); 591 Int iDstStride = getStride(COMPONENT_Y); 592 for ( y = uiHeight-1; y >= 0; y-- ) 593 { 594 for ( x = uiWidth-1; x >= 0; x-- ) 595 { 596 pDst[x] = pSrc0[x] - pSrc1[x]; 597 } 598 pSrc0 += iSrc0Stride; 599 pSrc1 += iSrc1Stride; 600 pDst += iDstStride; 601 } 602 } 603 604 Void TComYuv::subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ) 605 { 606 Int x, y; 607 608 Pel* pSrcU0 = pcYuvSrc0->getAddr(COMPONENT_Cb, uiAbsPartIdx ); 609 Pel* pSrcU1 = pcYuvSrc1->getAddr(COMPONENT_Cb, uiAbsPartIdx ); 610 Pel* pSrcV0 = pcYuvSrc0->getAddr(COMPONENT_Cr, uiAbsPartIdx ); 611 Pel* pSrcV1 = pcYuvSrc1->getAddr(COMPONENT_Cr, uiAbsPartIdx ); 612 Pel* pDstU = getAddr(COMPONENT_Cb, uiAbsPartIdx ); 613 Pel* pDstV = getAddr(COMPONENT_Cr, uiAbsPartIdx ); 614 615 Int iSrc0Stride = pcYuvSrc0->getStride(COMPONENT_Cb); 616 Int iSrc1Stride = pcYuvSrc1->getStride(COMPONENT_Cb); 617 Int iDstStride = getStride( COMPONENT_Cb ); 618 for ( y = uiHeight-1; y >= 0; y-- ) 619 { 620 for ( x = uiWidth-1; x >= 0; x-- ) 621 { 622 pDstU[x] = pSrcU0[x] - pSrcU1[x]; 623 pDstV[x] = pSrcV0[x] - pSrcV1[x]; 624 } 556 625 pSrcU0 += iSrc0Stride; 557 626 pSrcU1 += iSrc1Stride; … … 563 632 } 564 633 565 Void TComYuv::subtractARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )566 {567 subtractARPLuma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth , uiHeight );568 569 if (uiWidth > 8)570 subtractARPChroma( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );571 }572 573 Void TComYuv::subtractARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )574 {575 Int x, y;576 577 Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx );578 Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx );579 Pel* pDst = getLumaAddr( uiAbsPartIdx );580 581 Int iSrc0Stride = pcYuvSrc0->getStride();582 Int iSrc1Stride = pcYuvSrc1->getStride();583 Int iDstStride = getStride();584 for ( y = uiHeight-1; y >= 0; y-- )585 {586 for ( x = uiWidth-1; x >= 0; x-- )587 {588 pDst[x] = pSrc0[x] - pSrc1[x];589 }590 pSrc0 += iSrc0Stride;591 pSrc1 += iSrc1Stride;592 pDst += iDstStride;593 }594 }595 596 Void TComYuv::subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )597 {598 Int x, y;599 600 Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx );601 Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx );602 Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx );603 Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx );604 Pel* pDstU = getCbAddr( uiAbsPartIdx );605 Pel* pDstV = getCrAddr( uiAbsPartIdx );606 607 Int iSrc0Stride = pcYuvSrc0->getCStride();608 Int iSrc1Stride = pcYuvSrc1->getCStride();609 Int iDstStride = getCStride();610 for ( y = uiHeight-1; y >= 0; y-- )611 {612 for ( x = uiWidth-1; x >= 0; x-- )613 {614 pDstU[x] = pSrcU0[x] - pSrcU1[x];615 pDstV[x] = pSrcV0[x] - pSrcV1[x];616 }617 pSrcU0 += iSrc0Stride;618 pSrcU1 += iSrc1Stride;619 pSrcV0 += iSrc0Stride;620 pSrcV1 += iSrc1Stride;621 pDstU += iDstStride;622 pDstV += iDstStride;623 }624 }625 626 634 Void TComYuv::multiplyARP( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 627 635 { 628 636 multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW ); 629 637 630 if (uiWidth > 8) 638 if ( uiWidth > 8 && getNumberValidComponents() > 1 ) 639 { 631 640 multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW ); 641 } 632 642 } 633 643 … … 641 651 Void TComYuv::multiplyARPLuma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 642 652 { 643 Pel* pDst = get LumaAddr(uiAbsPartIdx );644 Int iDstStride = getStride( );653 Pel* pDst = getAddr(COMPONENT_Y, uiAbsPartIdx ); 654 Int iDstStride = getStride(COMPONENT_Y); 645 655 for ( Int y = uiHeight-1; y >= 0; y-- ) 646 656 { … … 652 662 Void TComYuv::multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW ) 653 663 { 654 Pel* pDstU = get CbAddr(uiAbsPartIdx );655 Pel* pDstV = get CrAddr(uiAbsPartIdx );656 657 Int iDstStride = get CStride();664 Pel* pDstU = getAddr( COMPONENT_Cb, uiAbsPartIdx ); 665 Pel* pDstV = getAddr( COMPONENT_Cr, uiAbsPartIdx ); 666 667 Int iDstStride = getStride( COMPONENT_Cb ); 658 668 for ( Int y = uiHeight-1; y >= 0; y-- ) 659 669 { -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComYuv.h
r1200 r1279 206 206 #if NH_3D 207 207 Void addClipPartLuma( Int bitDepth, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 208 #if H_3D_ARP209 Void addARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );210 Void addARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );211 Void addARPChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );208 #if NH_3D_ARP 209 Void addARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths ); 210 Void addARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths ); 211 Void addARPChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths ); 212 212 Void subtractARP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); 213 213 Void subtractARPLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight ); -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TypeDef.h
r1258 r1279 67 67 #if NH_MV 68 68 #define H_MV_ENC_DEC_TRAC 1 //< CU/PU level tracking 69 #define H_MV_ENC_DEC_TRAC_FIX 1 // by SHARP 69 70 70 71 #if NH_3D 71 72 #define NH_3D_VSO 1 73 #define NH_3D_NBDV 1 74 #define NH_3D_TMVP 1 // QC_TMVP_C0047 75 // Sony_M23639 76 // H_3D_TMVP_SCALING_FIX_K0053 1 // QC/CY for K0053 77 #define NH_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 78 // Unifying rounding offset, for IC part, JCT3V-D0135 79 // SHARP_ILLUCOMP_REFINE_E0046 80 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 81 // LGE_IC_CTX_F0160 //JCT3V-F0160 82 // SEC_ONLY_TEXTURE_IC_F0151 83 // MTK_IC_FLAG_CABAC_SIMP_G0061 84 // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121 85 // MTK_LOW_LATENCY_IC_ENCODING_H0086 Low-latency IC encoding in JCT3V-H0086 86 // MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX 1 // Remove the global variables used in JCT3V-H0086 87 // SEC_IC_NEIGHBOR_CLIP_I0080 // Clipping of neighboring sample position, JCT3V-I0080 88 // LGE_CHROMA_IC_J0050_J0034 89 90 #define NH_3D_IC_FIX 1 // Fix uninitialized value in cDtParam.bUseIC (it happened on intra block) 91 #define NH_3D_FULL_PEL_DEPTH_MAP_MV_ACC 1 // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC 92 93 #define NH_3D_QTLPC 1 // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068 94 // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 95 // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055 96 97 #define NH_3D_NBDV_REF 1 98 #define NH_3D_MLC 1 99 #define NH_3D_VSP 1 100 #define NH_3D_IV_MERGE 1 101 #define NH_3D_SPIVMP 1 102 #define NH_3D_INTEGER_MV_DEPTH 1 103 #define NH_3D_TEXT_MERGE 1 104 #define NH_3D_DBBP 1 105 #define BUF_FIX 1 106 #define NH_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177 107 // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108 108 // SHARP_ARP_REF_CHECK_F0105 ARP reference picture selection and DPB check 109 // LGE_ARP_CTX_F0161 JCT3V-F0161 110 // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061 111 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 112 // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085 113 // QC_I0051_ARP_SIMP 114 // SHARP_ARP_CHROMA_I0104 115 // MTK_I0072_IVARP_SCALING_FIX 116 // SEC_ARP_VIEW_REF_CHECK_J0037 Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1 117 // SEC_ARP_REM_ENC_RESTRICT_K0035 Removal of encoder restriction of ARP, JCT3V-K0035 118 72 119 #define NH_3D_DMM 1 // Depth modeling modes 73 120 #define NH_3D_DLT 1 // Depth Lookup Table … … 108 155 // MTK_TEXTURE_MRGCAND_BUGFIX_E0182 Bug fix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 109 156 // LGE_SIMP_DISP_AVAIL_J0041 // Use 2 status for disparity availability - DISP_AVAILABLE and DISP_NONE 110 #define H_3D_ARP 1 // Advanced residual prediction (ARP), JCT3V-D0177111 // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108112 // SHARP_ARP_REF_CHECK_F0105 ARP reference picture selection and DPB check113 // LGE_ARP_CTX_F0161 JCT3V-F0161114 // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061115 // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053116 // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085117 // QC_I0051_ARP_SIMP118 // SHARP_ARP_CHROMA_I0104119 // MTK_I0072_IVARP_SCALING_FIX120 // SEC_ARP_VIEW_REF_CHECK_J0037 Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1121 // SEC_ARP_REM_ENC_RESTRICT_K0035 Removal of encoder restriction of ARP, JCT3V-K0035122 157 #define H_3D_IC 1 // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060 123 158 // Unifying rounding offset, for IC part, JCT3V-D0135 … … 133 168 // SEC_IC_NEIGHBOR_CLIP_I0080 // Clipping of neighboring sample position, JCT3V-I0080 134 169 // LGE_CHROMA_IC_J0050_J0034 135 #if H_3D_NBDV170 #if NH_3D_NBDV 136 171 #define H_3D_NBDV_REF 1 // Depth oriented neighboring block disparity derivation 137 172 // MTK_D0156 … … 237 272 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 238 273 // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates 274 #define H_3D_INTER_SDC_FIX 1 239 275 #define H_3D_SPIVMP 1 // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction 240 276 // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077 … … 298 334 #endif 299 335 //// ****** NEIGHBOURING BLOCK-BASED DISPARITY VECTOR ********* 300 #if H_3D_NBDV336 #if NH_3D_NBDV 301 337 #define DVFROM_LEFT 0 302 338 #define DVFROM_ABOVE 1 … … 304 340 #endif 305 341 ///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION ********* 306 #if H_3D_ARP342 #if NH_3D_ARP 307 343 #define H_3D_ARP_WFNR 3 308 344 #endif … … 320 356 /// GT: Move values which are not flags to CommonDef.h and convert to static int !! 321 357 /////////////////////////////////////////////////////////////////////////////////// 322 ///// ***** VIEW SYNTHESIS PREDICTION *********323 #if H_3D_VSP324 #define H_3D_VSP_BLOCKSIZE 4 // Supported values: 1, 2, and 4325 #if H_3D_VSP_BLOCKSIZE == 1326 #define H_3D_VSP_CONSTRAINED 1 // Constrained VSP @ 1x1327 #else328 #define H_3D_VSP_CONSTRAINED 0329 #endif330 #endif331 358 ///// ***** ILLUMATION COMPENSATION ********* 332 #if H_3D_IC359 #if NH_3D_IC 333 360 #define IC_REG_COST_SHIFT 7 334 361 #define IC_CONST_SHIFT 5 … … 337 364 #endif 338 365 ///// ***** DEPTH BASED BLOCK PARTITIONING ********* 339 #if H_3D_DBBP366 #if NH_3D_DBBP 340 367 #define DBBP_INVALID_SHORT (-4) 341 368 #define DBBP_PACK_MODE SIZE_2NxN … … 721 748 MD_ABOVE_LEFT ///< MVP of above left block 722 749 }; 723 #if H_3D750 #if NH_3D_MLC 724 751 enum DefaultMergCandOrder 725 752 { … … 734 761 MRG_A0, ///< Left bottom 735 762 MRG_B2, ///< Above left 736 MRG_IVSHIFT, ///< Shifted IVMC o fShifted IVDC. (These are mutually exclusive)763 MRG_IVSHIFT, ///< Shifted IVMC or Shifted IVDC. (These are mutually exclusive) 737 764 MRG_COL ///< Temporal co-located 738 765 };
Note: See TracChangeset for help on using the changeset viewer.