Changeset 773 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 16 Jan 2014, 09:56:13 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r724 r773 120 120 m_dmmWedgeTabIdx[i] = NULL; 121 121 } 122 #if !SEC_DMM3_RBC_F0147123 m_dmm3IntraTabIdx = NULL;124 #endif125 #endif126 #if H_3D_DIM_RBC127 m_pucEdgeCode = NULL;128 m_pucEdgeNumber = NULL;129 m_pucEdgeStartPos = NULL;130 m_pbEdgeLeftFirst = NULL;131 m_pbEdgePartition = NULL;132 122 #endif 133 123 #if H_3D_DIM_SDC … … 146 136 m_piVSPFlag = NULL; 147 137 #endif 148 #if MTK_SPIVMP_F0110138 #if H_3D_SPIVMP 149 139 m_pbSPIVMPFlag = NULL; 150 140 #endif … … 200 190 m_piVSPFlag = (Char* )xMalloc(Char, uiNumPartition); 201 191 #endif 202 #if MTK_SPIVMP_F0110192 #if H_3D_SPIVMP 203 193 m_pbSPIVMPFlag = (Bool* )xMalloc(Bool, uiNumPartition); 204 194 #endif … … 279 269 m_dmmWedgeTabIdx[i] = (UInt*)xMalloc(UInt, uiNumPartition); 280 270 } 281 #if !SEC_DMM3_RBC_F0147282 m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition);283 #endif284 #endif285 #if H_3D_DIM_RBC286 m_pucEdgeCode = (UChar*)xMalloc(UChar, uiNumPartition * RBC_MAX_EDGE_NUM_PER_4x4);287 m_pucEdgeNumber = (UChar*)xMalloc(UChar, uiNumPartition);288 m_pucEdgeStartPos = (UChar*)xMalloc(UChar, uiNumPartition);289 m_pbEdgeLeftFirst = (Bool*)xMalloc(Bool, uiNumPartition);290 m_pbEdgePartition = (Bool*)xMalloc(Bool, uiNumPartition * 16);291 271 #endif 292 272 #if H_3D_DIM_SDC … … 362 342 if ( m_piVSPFlag ) { xFree(m_piVSPFlag); m_piVSPFlag = NULL; } 363 343 #endif 364 #if MTK_SPIVMP_F0110344 #if H_3D_SPIVMP 365 345 if ( m_pbSPIVMPFlag ) { xFree(m_pbSPIVMPFlag); m_pbSPIVMPFlag = NULL; } 366 346 #endif … … 417 397 if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; } 418 398 } 419 #if !SEC_DMM3_RBC_F0147420 if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; }421 #endif422 #endif423 #if H_3D_DIM_RBC424 if ( m_pbEdgeLeftFirst ) { xFree( m_pbEdgeLeftFirst ); m_pbEdgeLeftFirst = NULL; }425 if ( m_pucEdgeStartPos ) { xFree( m_pucEdgeStartPos ); m_pucEdgeStartPos = NULL; }426 if ( m_pucEdgeNumber ) { xFree( m_pucEdgeNumber ); m_pucEdgeNumber = NULL; }427 if ( m_pucEdgeCode ) { xFree( m_pucEdgeCode ); m_pucEdgeCode = NULL; }428 if ( m_pbEdgePartition ) { xFree( m_pbEdgePartition ); m_pbEdgePartition = NULL; }429 399 #endif 430 400 #if H_3D_DIM_SDC … … 571 541 m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui]; 572 542 #endif 573 #if MTK_SPIVMP_F0110543 #if H_3D_SPIVMP 574 544 m_pbSPIVMPFlag[ui] = pcFrom->m_pbSPIVMPFlag[ui]; 575 545 #endif … … 616 586 memset( m_piVSPFlag + firstElement, 0, numElements * sizeof( *m_piVSPFlag ) ); 617 587 #endif 618 #if MTK_SPIVMP_F0110588 #if H_3D_SPIVMP 619 589 memset( m_pbSPIVMPFlag + firstElement, 0, numElements * sizeof( *m_pbSPIVMPFlag ) ); 620 590 #endif … … 643 613 memset( m_dmmWedgeTabIdx[i] + firstElement, 0, numElements * sizeof( *m_dmmWedgeTabIdx[i] ) ); 644 614 } 645 #if !SEC_DMM3_RBC_F0147646 memset( m_dmm3IntraTabIdx + firstElement, 0, numElements * sizeof( *m_dmm3IntraTabIdx ) );647 #endif648 #endif649 #if H_3D_DIM_RBC650 memset( m_pucEdgeCode + firstElement, 0, numElements * sizeof( *m_pucEdgeCode ) * RBC_MAX_EDGE_NUM_PER_4x4 );651 memset( m_pucEdgeNumber + firstElement, 0, numElements * sizeof( *m_pucEdgeNumber ) );652 memset( m_pucEdgeStartPos + firstElement, 0, numElements * sizeof( *m_pucEdgeStartPos ) );653 memset( m_pbEdgeLeftFirst + firstElement, false, numElements * sizeof( *m_pbEdgeLeftFirst ) );654 memset( m_pbEdgePartition + firstElement, false, numElements * sizeof( *m_pbEdgePartition ) * 16 );655 615 #endif 656 616 #if H_3D_DIM_SDC … … 799 759 m_piVSPFlag[ui] = 0; 800 760 #endif 801 #if MTK_SPIVMP_F0110761 #if H_3D_SPIVMP 802 762 m_pbSPIVMPFlag[ui] = 0; 803 763 #endif … … 825 785 m_dmmWedgeTabIdx[i] [ui] = 0; 826 786 } 827 #if !SEC_DMM3_RBC_F0147828 m_dmm3IntraTabIdx [ui] = 0;829 #endif830 787 #endif 831 788 #if H_3D_DIM_SDC … … 902 859 memset( m_piVSPFlag, 0, sizeof( Char ) * m_uiNumPartition ); 903 860 #endif 904 #if MTK_SPIVMP_F0110861 #if H_3D_SPIVMP 905 862 memset( m_pbSPIVMPFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 906 863 #endif … … 941 898 memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition ); 942 899 } 943 #if !SEC_DMM3_RBC_F0147944 memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition );945 #endif946 #endif947 #if H_3D_DIM_RBC948 memset( m_pucEdgeCode , 0, iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );949 memset( m_pucEdgeNumber , 0, iSizeInUchar );950 memset( m_pucEdgeStartPos, 0, iSizeInUchar );951 memset( m_pbEdgeLeftFirst, 0, iSizeInBool );952 memset( m_pbEdgePartition, 0, iSizeInBool * 16 );953 900 #endif 954 901 #if H_3D_DIM_SDC … … 1001 948 m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui]; 1002 949 #endif 1003 #if MTK_SPIVMP_F0110950 #if H_3D_SPIVMP 1004 951 m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui]; 1005 952 #endif … … 1028 975 m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui]; 1029 976 } 1030 #if !SEC_DMM3_RBC_F01471031 m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui];1032 #endif1033 977 #endif 1034 978 #if H_3D_DIM_SDC … … 1154 1098 m_piVSPFlag = pcCU->getVSPFlag() + uiPart; 1155 1099 #endif 1156 #if MTK_SPIVMP_F01101100 #if H_3D_SPIVMP 1157 1101 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiPart; 1158 1102 #endif … … 1187 1131 m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart; 1188 1132 } 1189 #if !SEC_DMM3_RBC_F01471190 m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart;1191 #endif1192 #endif1193 #if H_3D_DIM_RBC1194 m_pucEdgeCode = pcCU->getEdgeCode( uiPart );1195 m_pucEdgeNumber = pcCU->getEdgeNumber() + uiPart;1196 m_pucEdgeStartPos = pcCU->getEdgeStartPos() + uiPart;1197 m_pbEdgeLeftFirst = pcCU->getEdgeLeftFirst() + uiPart;1198 m_pbEdgePartition = pcCU->getEdgePartition( uiPart );1199 1133 #endif 1200 1134 #if H_3D_DIM_SDC … … 1313 1247 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1314 1248 #endif 1315 #if MTK_SPIVMP_F01101249 #if H_3D_SPIVMP 1316 1250 m_pbSPIVMPFlag = pcCU->getSPIVMPFlag() + uiAbsPartIdx; 1317 1251 #endif … … 1365 1299 1366 1300 #endif 1367 #if MTK_SPIVMP_F01101301 #if H_3D_SPIVMP 1368 1302 memcpy( m_pbSPIVMPFlag + uiOffset, pcCU->getSPIVMPFlag(), sizeof( Bool ) * uiNumPartition ); 1369 1303 #endif … … 1391 1325 memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition ); 1392 1326 } 1393 #if !SEC_DMM3_RBC_F01471394 memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition );1395 #endif1396 #endif1397 #if H_3D_DIM_RBC1398 memcpy( getEdgeCode( uiOffset ), pcCU->getEdgeCode(0), iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );1399 memcpy( getEdgeNumber() + uiOffset, pcCU->getEdgeNumber(), iSizeInUchar );1400 memcpy( getEdgeStartPos() + uiOffset, pcCU->getEdgeStartPos(), iSizeInUchar );1401 memcpy( getEdgeLeftFirst() + uiOffset, pcCU->getEdgeLeftFirst(), iSizeInBool );1402 memcpy( getEdgePartition( uiOffset ), pcCU->getEdgePartition(0), iSizeInBool * 16 );1403 1327 #endif 1404 1328 #if H_3D_DIM_SDC … … 1497 1421 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof( *m_pDvInfo ) * m_uiNumPartition ); 1498 1422 #endif 1499 #if MTK_SPIVMP_F01101423 #if H_3D_SPIVMP 1500 1424 memcpy( rpcCU->getSPIVMPFlag() + m_uiAbsIdxInLCU, m_pbSPIVMPFlag, sizeof( Bool ) * m_uiNumPartition ); 1501 1425 #endif … … 1523 1447 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition ); 1524 1448 } 1525 #if !SEC_DMM3_RBC_F01471526 memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition );1527 #endif1528 #endif1529 #if H_3D_DIM_RBC1530 memcpy( rpcCU->getEdgeCode( m_uiAbsIdxInLCU ), m_pucEdgeCode, iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );1531 memcpy( rpcCU->getEdgeNumber() + m_uiAbsIdxInLCU, m_pucEdgeNumber, iSizeInUchar );1532 memcpy( rpcCU->getEdgeStartPos() + m_uiAbsIdxInLCU, m_pucEdgeStartPos, iSizeInUchar );1533 memcpy( rpcCU->getEdgeLeftFirst() + m_uiAbsIdxInLCU, m_pbEdgeLeftFirst, iSizeInBool );1534 memcpy( rpcCU->getEdgePartition( m_uiAbsIdxInLCU ), m_pbEdgePartition, iSizeInBool * 16 );1535 1449 #endif 1536 1450 #if H_3D_DIM_SDC … … 1616 1530 memcpy( rpcCU->getVSPFlag() + uiPartOffset, m_piVSPFlag, sizeof(Char) * uiQNumPart ); 1617 1531 #endif 1618 #if MTK_SPIVMP_F01101532 #if H_3D_SPIVMP 1619 1533 memcpy( rpcCU->getSPIVMPFlag() + uiPartOffset, m_pbSPIVMPFlag, sizeof(Bool) * uiQNumPart ); 1620 1534 #endif … … 1641 1555 memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart ); 1642 1556 } 1643 #if !SEC_DMM3_RBC_F01471644 memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart );1645 #endif1646 #endif1647 #if H_3D_DIM_RBC1648 memcpy( rpcCU->getEdgeCode( uiPartOffset ), m_pucEdgeCode, iSizeInUchar * RBC_MAX_EDGE_NUM_PER_4x4 );1649 memcpy( rpcCU->getEdgeNumber() + uiPartOffset, m_pucEdgeNumber, iSizeInUchar );1650 memcpy( rpcCU->getEdgeStartPos() + uiPartOffset, m_pucEdgeStartPos, iSizeInUchar );1651 memcpy( rpcCU->getEdgeLeftFirst() + uiPartOffset, m_pbEdgeLeftFirst, iSizeInBool );1652 memcpy( rpcCU->getEdgePartition( uiPartOffset ), m_pbEdgePartition, iSizeInBool * 16 );1653 1557 #endif 1654 1558 #if H_3D_DIM_SDC … … 2375 2279 UInt uiCtx = 0; 2376 2280 2377 #if LGE_IC_CTX_F01602378 2281 TComDataCU* pcTempCU = NULL; 2379 2282 UInt uiTempPartIdx = 0; … … 2384 2287 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2385 2288 uiCtx += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0; 2386 #endif2387 2289 2388 2290 return uiCtx; … … 2745 2647 } 2746 2648 2747 #if MTK_SPIVMP_F01102649 #if H_3D_SPIVMP 2748 2650 Void TComDataCU::setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2749 2651 { … … 3345 3247 * false: otherwise 3346 3248 */ 3347 #if ETRIKHU_MERGE_REUSE_F00933348 3249 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 3349 3250 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ) 3350 #else 3351 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 3352 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag ) 3353 #endif 3354 { 3251 { 3355 3252 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() ) 3356 3253 { … … 3367 3264 } 3368 3265 3369 #if ETRIKHU_MERGE_REUSE_F00933370 3266 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 3371 #endif3372 3267 3373 3268 Bool refViewAvailFlag = false; … … 3454 3349 3455 3350 #if H_3D_IV_MERGE 3456 #if ETRIKHU_MERGE_REUSE_F00933457 3351 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, 3458 3352 Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ) 3459 #else3460 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,3461 Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag )3462 #endif3463 3353 { 3464 3354 for(Int iLoop = 0; iLoop < 2; iLoop ++ ) … … 3479 3369 clipMv( cMv ); 3480 3370 3481 #if ETRIKHU_MERGE_REUSE_F00933482 3371 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 3483 #endif3484 3372 3485 3373 abCandIsInter [ iCount ] = true; … … 3502 3390 if(ivCandDir[iLoop + 2]) 3503 3391 { 3504 #if ETRIKHU_MERGE_REUSE_F00933505 3392 TComMvField tmpMV[2]; 3506 3393 UChar tmpDir = ivCandDir[iLoop + 2]; 3507 #else3508 abCandIsInter [ iCount ] = true;3509 puhInterDirNeighbours[ iCount ] = ivCandDir[iLoop + 2];3510 #endif3511 3394 if( ( ivCandDir[iLoop + 2] & 1 ) == 1 ) 3512 3395 { 3513 #if ETRIKHU_MERGE_REUSE_F00933514 3396 tmpMV[0].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] ); 3515 #else3516 pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] );3517 #endif3518 3397 } 3519 3398 if( ( ivCandDir[iLoop + 2] & 2 ) == 2 ) 3520 3399 { 3521 #if ETRIKHU_MERGE_REUSE_F00933522 3400 tmpMV[1].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] ); 3523 #else3524 pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );3525 #endif3526 3401 } 3527 3402 … … 3530 3405 if( !iLoop && ivCandDir[0] > 0) 3531 3406 { 3532 #if ETRIKHU_MERGE_REUSE_F00933533 3407 if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1]) 3534 #else3535 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0 ]== pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[1]==pcMvFieldNeighbours[(iCount<<1)+1])3536 #endif3537 3408 { 3538 3409 bRemove = true; 3539 #if !ETRIKHU_MERGE_REUSE_F00933540 abCandIsInter [ iCount ] = false;3541 puhInterDirNeighbours[ iCount ] = 0;3542 TComMv cZeroMv;3543 pcMvFieldNeighbours [ iCount<<1 ].setMvField( cZeroMv, NOT_VALID );3544 pcMvFieldNeighbours [(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );3545 #endif3546 3410 } 3547 3411 } 3548 3412 if(!bRemove) 3549 3413 { 3550 3551 #if ETRIKHU_MERGE_REUSE_F00933552 3414 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 3553 3415 … … 3562 3424 pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] ); 3563 3425 } 3564 #endif3565 3566 3426 #if H_3D_NBDV 3567 3427 if(iLoop) // For IvMcShift candidate … … 3603 3463 #endif 3604 3464 3605 3606 3607 3608 3609 3610 3611 3612 3613 #if ETRIKHU_MERGE_REUSE_F0093 3465 #if H_3D 3614 3466 Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo* inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV) 3615 3467 { … … 3999 3851 * \param numValidMergeCand 4000 3852 */ 4001 #if ETRIKHU_MERGE_REUSE_F00933853 #if H_3D 4002 3854 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 4003 3855 #else … … 4008 3860 , InheritedVSPDisInfo* inheritedVSPDisInfo 4009 3861 #endif 4010 #if MTK_SPIVMP_F01103862 #if H_3D_SPIVMP 4011 3863 , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP 4012 3864 #endif … … 4024 3876 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 4025 3877 #endif 4026 #if ETRIKHU_MERGE_REUSE_F00933878 #if H_3D 4027 3879 TComMvField tmpMV[2]; 4028 3880 UChar tmpDir; … … 4046 3898 { 4047 3899 abCandIsInter[ui] = false; 4048 #if H_3D_IV_MERGE4049 pcMvFieldNeighbours[ ( ui << 1 ) ].setMvField(cZeroMv, NOT_VALID);4050 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID);4051 #else4052 3900 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 4053 3901 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 4054 #endif4055 3902 } 4056 3903 #endif … … 4069 3916 4070 3917 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4071 #if ! ETRIKHU_MERGE_REUSE_F00933918 #if !H_3D 4072 3919 PartSize cCurPS = getPartitionSize( uiAbsPartIdx ); 4073 3920 #endif 4074 3921 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 4075 3922 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 4076 #if SEC_MPI_ENABLING_MERGE_F01503923 #if H_3D 4077 3924 Bool bMPIFlag = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() ); 4078 #endif4079 #if QC_DEPTH_IV_MRG_F01254080 3925 Bool bIsDepth = getSlice()->getIsDepth(); 4081 #if !BUGFIX_F00934082 Bool bDepthIPMCAvai = false;4083 #endif4084 3926 #endif 4085 3927 4086 #if LGE_SHARP_VSP_INHERIT_F01044087 3928 #if H_3D_IC 4088 3929 Bool bICFlag = getICFlag(uiAbsPartIdx); … … 4091 3932 Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false; 4092 3933 #endif 4093 #endif 4094 4095 #if ETRIKHU_MERGE_REUSE_F0093 3934 3935 #if H_3D 4096 3936 Int iPosLeftAbove[2] = {-1, -1}; 4097 3937 … … 4118 3958 #if H_3D_VSP 4119 3959 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1 4120 #if LGE_SHARP_VSP_INHERIT_F01044121 3960 #if H_3D_IC 4122 3961 && !bICFlag … … 4125 3964 && !bARPFlag 4126 3965 #endif 4127 #endif4128 3966 ) 4129 3967 { 4130 3968 vspFlag[numA1B1B0] = 1; 4131 #if !MTK_VSP_SIMPLIFICATION_F01114132 xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);4133 #endif4134 3969 } 4135 3970 #endif … … 4145 3980 iPosLeftAbove[1] = numA1B1B0; 4146 3981 #if H_3D_VSP 4147 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F01114148 3982 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 4149 #else4150 if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 14151 #endif4152 #if LGE_SHARP_VSP_INHERIT_F01044153 3983 #if H_3D_IC 4154 3984 && !bICFlag … … 4157 3987 && !bARPFlag 4158 3988 #endif 4159 #endif4160 3989 ) 4161 3990 { 4162 3991 vspFlag[numA1B1B0] = 1; 4163 #if !MTK_VSP_SIMPLIFICATION_F01114164 xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo);4165 #endif4166 3992 } 4167 3993 #endif … … 4177 4003 { 4178 4004 #if H_3D_VSP 4179 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F01114180 4005 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 4181 #else4182 if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 14183 #endif4184 #if LGE_SHARP_VSP_INHERIT_F01044185 4006 #if H_3D_IC 4186 4007 && !bICFlag … … 4189 4010 && !bARPFlag 4190 4011 #endif 4191 #endif4192 4012 ) 4193 4013 { 4194 4014 vspFlag[numA1B1B0] = 1; 4195 #if !MTK_VSP_SIMPLIFICATION_F01114196 xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);4197 #endif4198 4015 } 4199 4016 #endif … … 4208 4025 #if H_3D_VSP 4209 4026 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1 4210 #if LGE_SHARP_VSP_INHERIT_F01044211 4027 #if H_3D_IC 4212 4028 && !bICFlag … … 4215 4031 && !bARPFlag 4216 4032 #endif 4217 #endif4218 4033 ) 4219 4034 { 4220 4035 vspFlag[numA1B1B0] = 1; 4221 #if !MTK_VSP_SIMPLIFICATION_F01114222 xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);4223 #endif4224 4036 } 4225 4037 #endif … … 4235 4047 { 4236 4048 #if H_3D_VSP 4237 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F01114238 4049 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 4239 #else4240 if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 14241 #endif4242 #if LGE_SHARP_VSP_INHERIT_F01044243 4050 #if H_3D_IC 4244 4051 && !bICFlag … … 4247 4054 && !bARPFlag 4248 4055 #endif 4249 #endif4250 4056 ) 4251 4057 { 4252 4058 vspFlag[numA1B1B0+iCountHEVC] = 1; 4253 #if !MTK_VSP_SIMPLIFICATION_F01114254 xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);4255 #endif4256 4059 } 4257 4060 #endif … … 4265 4068 4266 4069 #if H_3D_IV_MERGE 4267 4070 4268 4071 ///////////////////////////////////////////// 4269 4072 //////// TEXTURE MERGE CANDIDATE (T) //////// 4270 4073 ///////////////////////////////////////////// 4271 4272 #if SEC_MPI_ENABLING_MERGE_F0150 4074 4273 4075 if( bMPIFlag) 4274 #else4275 if( m_pcSlice->getIsDepth())4276 #endif4277 4076 { 4278 4077 UInt uiPartIdxCenter; 4279 4078 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4280 4281 #if ETRIKHU_MERGE_REUSE_F00934282 4079 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4283 4080 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4284 4081 Int tRef[2]={-1, -1}; 4285 #endif4286 4082 4287 4083 #if H_3D_FCO … … 4289 4085 TComDataCU *pcTextureCU = 0; 4290 4086 if ( pcTexturePic ) 4291 4087 pcTextureCU = pcTexturePic->getCU( getAddr() ); 4292 4088 #else 4293 4089 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4294 4090 #endif 4295 4091 4296 4092 #if H_3D_FCO 4297 4093 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) … … 4300 4096 #endif 4301 4097 { 4302 #if ETRIKHU_MERGE_REUSE_F00934303 4098 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] ); 4304 4099 tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() ); … … 4414 4209 } 4415 4210 iCount ++; 4416 4417 #else 4418 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4419 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() ); 4420 if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) ) 4421 { 4422 TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv(); 4423 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4424 cMvPred+=cAdd; 4425 cMvPred>>=2; 4426 clipMv(cMvPred); 4427 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef); 4428 } 4429 if ( getSlice()->isInterB() ) 4430 { 4431 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4432 iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() ); 4433 if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) ) 4434 { 4435 TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv(); 4436 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4437 cMvPred+=cAdd; 4438 cMvPred>>=2; 4439 clipMv(cMvPred); 4440 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef); 4441 } 4442 } 4443 puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0; 4444 puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0; 4445 if( puhInterDirNeighbours[iCount] != 0 ) 4446 { 4447 abCandIsInter[iCount] = true; 4448 if ( mrgCandIdx == iCount ) 4449 { 4450 return; 4451 } 4452 iCount ++; 4453 } 4454 #endif 4455 } 4456 } 4457 } 4458 4459 4460 #if !ETRIKHU_MERGE_REUSE_F0093 4461 ////////////////////////////////// 4462 //////// GET DISPARITIES //////// 4463 ////////////////////////////////// 4464 4465 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 4466 for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 4467 { 4468 inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo; 4469 } 4470 #endif 4211 } 4212 } 4213 } 4471 4214 4472 4215 ///////////////////////////////////////////////////////////////// … … 4475 4218 4476 4219 Int posIvDC = -1; 4477 #if !ETRIKHU_MERGE_REUSE_F00934478 Bool bLeftAvai = false;4479 Int iPosLeftAbove[2] = {-1, -1};4480 #endif4481 4220 4482 4221 // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; … … 4489 4228 4490 4229 Bool ivMvPredFlag = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() ); 4491 4230 4492 4231 if ( ivMvPredFlag ) 4493 4232 { 4494 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir 4495 #if QC_DEPTH_IV_MRG_F0125 4496 , bIsDepth 4497 #endif 4498 #if MTK_SPIVMP_F0110 4499 , pcMvFieldSP, puhInterDirSP 4500 #endif 4501 ); 4233 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP ); 4502 4234 } 4503 4235 4504 4236 /////////////////////////////////////////////// 4505 4237 //////// INTER VIEW MOTION COMP(IvMC) ///////// … … 4508 4240 if( ivCandDir[0] ) 4509 4241 { 4510 #if ETRIKHU_MERGE_REUSE_F00934511 4242 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4512 4243 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); … … 4525 4256 Int iCnloop=0; 4526 4257 4527 #if BUGFIX_F00934528 4258 if (!bIsDepth) 4529 4259 { 4530 #endif4531 4260 for(Int i = 0; i < 2; i ++) 4532 4261 { … … 4542 4271 } 4543 4272 } 4544 #if BUGFIX_F0093 4545 } 4546 #endif 4547 #if QC_DEPTH_IV_MRG_F0125 4548 #if BUGFIX_F0093 4273 } 4549 4274 if (bIsDepth) 4550 #else4551 if ( bIsDepth && !bRemoveSpa)4552 #endif4553 4275 { 4554 4276 iCnloop = iCount-1; 4555 4277 for(; iCnloop >= 0; iCnloop --) 4556 4278 { 4557 #if BUGFIX_F00934558 4279 if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1]) // F0125 compatible with F0093 4559 #else4560 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])4561 #endif4562 4280 { 4563 4281 bRemoveSpa = true; … … 4565 4283 } 4566 4284 } 4567 #if !BUGFIX_F0093 4568 if(!bRemoveSpa) 4569 { 4570 bDepthIPMCAvai = true; 4571 } 4572 #endif 4573 } 4574 #endif 4285 } 4575 4286 4576 4287 if (!bRemoveSpa) … … 4628 4339 if (bIvMC) 4629 4340 { 4630 #if MTK_SPIVMP_F01104631 4341 pbSPIVMPFlag[iCount] = true; 4632 #endif4633 4342 if( ( ivCandDir[0] & 1 ) == 1 ) 4634 4343 { … … 4642 4351 puhInterDirNeighbours[ iCount ] = ivCandDir[0]; 4643 4352 4644 #if !BUGFIX_F00934645 #if QC_DEPTH_IV_MRG_F01254646 if ( bDepthIPMCAvai || !bIsDepth )4647 {4648 #endif4649 #endif4650 if ( mrgCandIdx == iCount )4651 {4652 return;4653 }4654 iCount ++;4655 #if !BUGFIX_F00934656 #if QC_DEPTH_IV_MRG_F01254657 }4658 #endif4659 #endif4660 }4661 #else4662 abCandIsInter [ iCount ] = true;4663 puhInterDirNeighbours[ iCount ] = ivCandDir[0];4664 4665 if( ( ivCandDir[0] & 1 ) == 1 )4666 {4667 pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );4668 }4669 if( ( ivCandDir[0] & 2 ) == 2 )4670 {4671 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );4672 }4673 #if QC_DEPTH_IV_MRG_F01254674 if ( bIsDepth )4675 {4676 Bool bRemoveSpa = false;4677 Int iCnloop = iCount-1;4678 for(; iCnloop >= 0; iCnloop --)4679 {4680 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])4681 {4682 bRemoveSpa = true;4683 abCandIsInter [ iCount ] = false;4684 4685 puhInterDirNeighbours[iCount] = 0;4686 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );4687 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );4688 break;4689 }4690 }4691 if(!bRemoveSpa)4692 {4693 bDepthIPMCAvai = true;4694 }4695 }4696 if ( bDepthIPMCAvai || !bIsDepth )4697 {4698 #endif4699 4353 if ( mrgCandIdx == iCount ) 4700 4354 { … … 4702 4356 } 4703 4357 iCount ++; 4704 #if QC_DEPTH_IV_MRG_F0125 4705 } 4706 #endif 4707 4708 #endif 4709 4358 } 4710 4359 } 4711 4360 … … 4717 4366 #endif 4718 4367 4719 4720 4721 4722 4723 #if ETRIKHU_MERGE_REUSE_F0093 4368 #if H_3D 4724 4369 iCount += numA1B1B0; 4725 4370 #else 4726 #if H_3D4727 ////////////////////////////4728 //////// LEFT (A1) /////////4729 ////////////////////////////4730 #endif4731 4371 //left 4732 4372 UInt uiLeftPartIdx = 0; … … 4748 4388 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4749 4389 } 4750 #if H_3D_IV_MERGE 4751 Bool bRemoveSpa = false; //pruning to inter-view candidates 4752 #if QC_DEPTH_IV_MRG_F0125 4753 Int iCnloop = bDepthIPMCAvai ? (iCount-2): (iCount-1); 4754 #else 4755 Int iCnloop = iCount - 1; 4756 #endif 4757 for(; iCnloop >= 0; iCnloop --) 4758 { 4759 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 4760 { 4761 bRemoveSpa = true; 4762 abCandIsInter [ iCount ] = false; 4763 4764 //reset to the default value for MC 4765 puhInterDirNeighbours[iCount] = 0; 4766 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 4767 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 4768 break; 4769 } 4770 } 4771 if(!bRemoveSpa) 4772 { 4773 bLeftAvai = true; 4774 iPosLeftAbove[0] = iCount; 4775 #if H_3D_NBDV 4776 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 4777 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 4778 #endif 4779 #if H_3D_VSP 4780 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1 4781 #if LGE_SHARP_VSP_INHERIT_F0104 4782 #if H_3D_IC 4783 && !bICFlag 4784 #endif 4785 #if H_3D_ARP 4786 && !bARPFlag 4787 #endif 4788 #endif 4789 ) 4790 { 4791 vspFlag[iCount] = 1; 4792 #if !MTK_VSP_SIMPLIFICATION_F0111 4793 xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo); 4794 #endif 4795 } 4796 #endif 4797 if ( mrgCandIdx == iCount ) 4798 { 4799 return; 4800 } 4801 iCount ++; 4802 } 4803 #else // H_3D_IV_MERGE 4390 4804 4391 if ( mrgCandIdx == iCount ) 4805 4392 { … … 4807 4394 } 4808 4395 iCount ++; 4809 #endif // H_3D_IV_MERGE4810 4396 } 4811 4397 … … 4815 4401 return; 4816 4402 } 4817 #if H_3D 4818 //////////////////////////// 4819 //////// ABOVE (B1) //////// 4820 //////////////////////////// 4821 #endif 4403 4822 4404 // above 4823 4405 UInt uiAbovePartIdx = 0; … … 4839 4421 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4840 4422 } 4841 #if H_3D_IV_MERGE 4842 Bool bRemoveSpa = false; //pruning to inter-view candidates 4843 #if QC_DEPTH_IV_MRG_F0125 4844 Int iCnloop; 4845 if( bIsDepth ) 4846 iCnloop = (bLeftAvai && bDepthIPMCAvai) ? (iCount-3) : ((bLeftAvai || bDepthIPMCAvai) ? (iCount-2): (iCount-1)); 4847 else 4848 iCnloop = bLeftAvai? (iCount-2): (iCount-1); 4849 #else 4850 Int iCnloop = bLeftAvai? (iCount-2): (iCount-1); 4851 #endif 4852 for(; iCnloop >= 0; iCnloop --) 4853 { 4854 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 4855 { 4856 bRemoveSpa = true; 4857 abCandIsInter [ iCount ] = false; 4858 4859 //reset to the default value for MC 4860 puhInterDirNeighbours[iCount] = 0; 4861 4862 pcMvFieldNeighbours[iCount<<1] .setMvField( cZeroMv, NOT_VALID ); 4863 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 4864 break; 4865 } 4866 } 4867 4868 if(!bRemoveSpa) 4869 { 4870 iPosLeftAbove[1] = iCount; 4871 #if H_3D_NBDV 4872 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 4873 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 4874 #endif 4875 #if H_3D_VSP 4876 #if MTK_VSP_SIMPLIFICATION_F0111 4877 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 4878 #if LGE_SHARP_VSP_INHERIT_F0104 4879 #if H_3D_IC 4880 && !bICFlag 4881 #endif 4882 #if H_3D_ARP 4883 && !bARPFlag 4884 #endif 4885 #endif 4886 ) 4887 #else 4888 if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1 4889 #if LGE_SHARP_VSP_INHERIT_F0104 4890 #if H_3D_IC 4891 && !bICFlag 4892 #endif 4893 #if H_3D_ARP 4894 && !bARPFlag 4895 #endif 4896 #endif 4897 ) 4898 #endif 4899 { 4900 4901 vspFlag[iCount] = 1; 4902 #if !MTK_VSP_SIMPLIFICATION_F0111 4903 xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo); 4904 #endif 4905 } 4906 #endif 4907 if ( mrgCandIdx == iCount ) 4908 { 4909 return; 4910 } 4911 iCount ++; 4912 } 4913 #else // H_3D_IV_MERGE 4423 4914 4424 if ( mrgCandIdx == iCount ) 4915 4425 { … … 4917 4427 } 4918 4428 iCount ++; 4919 #endif // H_3D_IV_MERGE4920 4429 } 4921 4430 // early termination … … 4924 4433 return; 4925 4434 } 4926 4927 #if H_3D4928 //////////////////////////////////4929 //////// ABOVE RIGHT (B0) ////////4930 //////////////////////////////////4931 #endif4932 4435 4933 4436 // above right … … 4949 4452 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4950 4453 } 4951 #if H_3D_NBDV 4952 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 4953 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 4954 #endif 4955 #if H_3D_VSP 4956 #if MTK_VSP_SIMPLIFICATION_F0111 4957 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 4958 #if LGE_SHARP_VSP_INHERIT_F0104 4959 #if H_3D_IC 4960 && !bICFlag 4961 #endif 4962 #if H_3D_ARP 4963 && !bARPFlag 4964 #endif 4965 #endif 4966 ) 4967 #else 4968 if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1 4969 #if LGE_SHARP_VSP_INHERIT_F0104 4970 #if H_3D_IC 4971 && !bICFlag 4972 #endif 4973 #if H_3D_ARP 4974 && !bARPFlag 4975 #endif 4976 #endif 4977 ) 4978 #endif 4979 { 4980 vspFlag[iCount] = 1; 4981 #if !MTK_VSP_SIMPLIFICATION_F0111 4982 xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo); 4983 #endif 4984 } 4985 #endif 4454 4986 4455 if ( mrgCandIdx == iCount ) 4987 4456 { … … 5003 4472 ///////////////////////////////////////////// 5004 4473 5005 #if ETRIKHU_MERGE_REUSE_F00935006 4474 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand()) 5007 #else5008 if( ivCandDir[1] )5009 #endif5010 4475 { 5011 4476 assert(iCount < getSlice()->getMaxNumMergeCand()); 5012 4477 5013 #if ETRIKHU_MERGE_REUSE_F00935014 4478 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 5015 4479 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); … … 5022 4486 tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 5023 4487 } 5024 #else5025 abCandIsInter [ iCount ] = true;5026 puhInterDirNeighbours[ iCount ] = ivCandDir[1];5027 if( ( ivCandDir[1] & 1 ) == 1 )5028 {5029 pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );5030 }5031 if( ( ivCandDir[1] & 2 ) == 2 )5032 {5033 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );5034 }5035 #endif5036 4488 5037 4489 Bool bRemoveSpa = false; //pruning to A1, B1 … … 5046 4498 { 5047 4499 bRemoveSpa = true; 5048 #if !ETRIKHU_MERGE_REUSE_F00935049 abCandIsInter [ iCount ] = false;5050 //reset to the default value for MC5051 puhInterDirNeighbours[iCount] = 0;5052 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );5053 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );5054 #endif5055 4500 break; 5056 4501 } … … 5058 4503 if(!bRemoveSpa) 5059 4504 { 5060 #if ETRIKHU_MERGE_REUSE_F00935061 4505 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 5062 4506 puhInterDirNeighbours[ iCount ] = ivCandDir[1]; … … 5069 4513 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 5070 4514 } 5071 #endif5072 4515 #if H_3D_NBDV 5073 4516 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); … … 5092 4535 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// 5093 4536 ///////////////////////////////////////////////// 5094 #if ETRIKHU_MERGE_REUSE_F00935095 4537 if (iCount<getSlice()->getMaxNumMergeCand()) 5096 4538 { 5097 #endif5098 4539 5099 4540 if ( 5100 #if LGE_SHARP_VSP_INHERIT_F01045101 4541 #if H_3D_IC 5102 4542 !bICFlag && … … 5105 4545 !bARPFlag && 5106 4546 #endif 5107 #endif5108 #if ETRIKHU_MERGE_REUSE_F00935109 4547 xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) ) 5110 #else5111 xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )5112 #endif5113 4548 { 5114 4549 return; … … 5121 4556 } 5122 4557 #endif 5123 #if ETRIKHU_MERGE_REUSE_F00935124 } 5125 #endif 5126 5127 #if ETRIKHU_MERGE_REUSE_F00934558 #if H_3D 4559 } 4560 #endif 4561 4562 #if H_3D 5128 4563 iCount += numA0B2; 5129 4564 #else 5130 #if H_3D5131 ///////////////////////////////////5132 //////// LEFT BOTTOM (A0) ////////5133 ///////////////////////////////////5134 #endif5135 5136 4565 //left bottom 5137 4566 UInt uiLeftBottomPartIdx = 0; … … 5152 4581 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5153 4582 } 5154 #if H_3D_NBDV5155 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);5156 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);5157 #endif5158 #if H_3D_VSP5159 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 15160 #if LGE_SHARP_VSP_INHERIT_F01045161 #if H_3D_IC5162 && !bICFlag5163 #endif5164 #if H_3D_ARP5165 && !bARPFlag5166 #endif5167 #endif5168 )5169 {5170 vspFlag[iCount] = 1;5171 #if !MTK_VSP_SIMPLIFICATION_F01115172 xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);5173 #endif5174 }5175 #endif5176 4583 if ( mrgCandIdx == iCount ) 5177 4584 { … … 5185 4592 return; 5186 4593 } 5187 #if H_3D5188 ///////////////////////////////////5189 //////// LEFT ABOVE (B2) ////////5190 ///////////////////////////////////5191 #endif5192 4594 5193 4595 // above left … … 5212 4614 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5213 4615 } 5214 #if H_3D_NBDV5215 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);5216 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);5217 #endif5218 #if H_3D_VSP5219 #if MTK_VSP_SIMPLIFICATION_F01115220 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)5221 #if LGE_SHARP_VSP_INHERIT_F01045222 #if H_3D_IC5223 && !bICFlag5224 #endif5225 #if H_3D_ARP5226 && !bARPFlag5227 #endif5228 #endif5229 )5230 #else5231 if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 15232 #if LGE_SHARP_VSP_INHERIT_F01045233 #if H_3D_IC5234 && !bICFlag5235 #endif5236 #if H_3D_ARP5237 && !bARPFlag5238 #endif5239 #endif5240 )5241 #endif5242 {5243 vspFlag[iCount] = 1;5244 #if !MTK_VSP_SIMPLIFICATION_F01115245 xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);5246 #endif5247 }5248 #endif5249 4616 if ( mrgCandIdx == iCount ) 5250 4617 { … … 5266 4633 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 5267 4634 //////////////////////////////////////////////////// 5268 #if ETRIKHU_MERGE_REUSE_F00935269 4635 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() ) 5270 4636 { 5271 4637 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) ) 5272 #else5273 if( ivMvPredFlag )5274 {5275 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag))5276 #endif5277 4638 { 5278 4639 return; … … 5286 4647 #endif 5287 4648 5288 #if ETRIKHU_MERGE_REUSE_F00934649 #if H_3D 5289 4650 if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand()) 5290 4651 { … … 5297 4658 numValidMergeCand = iCount; 5298 4659 #else 5299 #if H_3D5300 /////////////////////////////////5301 //////// Collocate (COL) ////////5302 /////////////////////////////////5303 #endif5304 4660 if ( getSlice()->getEnableTMVPFlag()) 5305 4661 { … … 5366 4722 if ( getSlice()->isInterB() ) 5367 4723 { 5368 #if H_3D_TMVP5369 iRefIdx = 0;5370 #endif5371 4724 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 5372 4725 if( bExistMV == false ) … … 5385 4738 puhInterDirNeighbours[uiArrayAddr] = dir; 5386 4739 abCandIsInter[uiArrayAddr] = true; 5387 #if H_3D_NBDV5388 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);5389 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);5390 #endif5391 4740 if ( mrgCandIdx == iCount ) 5392 4741 { … … 5406 4755 if ( getSlice()->isInterB()) 5407 4756 { 5408 #if H_3D_IV_MERGE5409 UInt uiPriorityList0[20] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4 };5410 UInt uiPriorityList1[20] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2, 4, 0, 4, 1, 4, 2, 4, 3 };5411 #else5412 4757 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 5413 4758 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 5414 #endif5415 4759 5416 4760 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 5417 4761 { 5418 4762 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 5419 #if H_3D_VSP5420 Bool bValid = true;5421 if ( vspFlag[i] == 1 || vspFlag[j] == 1 )5422 {5423 bValid = false;5424 }5425 if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) )5426 {5427 assert(bValid == true);5428 }5429 #endif5430 #if H_3D_VSP5431 if (abCandIsInter[i] && abCandIsInter[j] && (puhInterDirNeighbours[i]&0x1) && (puhInterDirNeighbours[j]&0x2) && bValid)5432 #else5433 4763 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 5434 #endif5435 4764 { 5436 4765 abCandIsInter[uiArrayAddr] = true; … … 5488 4817 #endif 5489 4818 } 5490 5491 5492 5493 5494 4819 #else 5495 4820 … … 5503 4828 */ 5504 4829 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 5505 #if H_3D_VSP5506 , Int* vspFlag5507 , InheritedVSPDisInfo* inheritedVSPDisInfo5508 #endif5509 4830 , Int& numValidMergeCand, Int mrgCandIdx 5510 4831 ) 5511 4832 { 5512 4833 UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx; 5513 #if H_3D_IV_MERGE5514 ////////////////////////////5515 //////// INIT LISTS ////////5516 ////////////////////////////5517 TComMv cZeroMv;5518 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];5519 #else5520 4834 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 5521 #endif5522 4835 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 5523 4836 { 5524 4837 abCandIsInter[ui] = false; 5525 #if H_3D_IV_MERGE5526 pcMvFieldNeighbours[ ( ui << 1 ) ].setMvField(cZeroMv, NOT_VALID);5527 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID);5528 #else5529 4838 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 5530 4839 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 5531 #endif5532 4840 } 5533 4841 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 5534 #if H_3D5535 //////////////////////////////////5536 //////// DERIVE LOCATIONS ////////5537 //////////////////////////////////5538 #endif5539 4842 // compute the location of the current PU 5540 4843 Int xP, yP, nPSW, nPSH; … … 5547 4850 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 5548 4851 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 5549 #if SEC_MPI_ENABLING_MERGE_F0150 5550 Bool bMPIFlag = getSlice()->getVPS()->getMPIFlag( getSlice()->getLayerIdInVps() ); 5551 #endif 5552 #if QC_DEPTH_IV_MRG_F0125 5553 Bool bIsDepth = getSlice()->getIsDepth(); 5554 Bool bDepthIPMCAvai = false; 5555 #endif 5556 5557 #if LGE_SHARP_VSP_INHERIT_F0104 5558 #if H_3D_IC 5559 Bool bICFlag = getICFlag(uiAbsPartIdx); 5560 #endif 5561 #if H_3D_ARP 5562 Bool bARPFlag = getARPW(uiAbsPartIdx)>0 ? true : false; 5563 #endif 5564 #endif 5565 5566 #if H_3D_IV_MERGE 5567 5568 ///////////////////////////////////////////// 5569 //////// TEXTURE MERGE CANDIDATE (T) //////// 5570 ///////////////////////////////////////////// 5571 5572 #if SEC_MPI_ENABLING_MERGE_F0150 5573 if( bMPIFlag) 5574 #else 5575 if( m_pcSlice->getIsDepth()) 5576 #endif 5577 { 5578 UInt uiPartIdxCenter; 5579 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 5580 #if H_3D_FCO 5581 TComPic * pcTexturePic = m_pcSlice->getTexturePic(); 5582 TComDataCU *pcTextureCU = 0; 5583 if ( pcTexturePic ) 5584 pcTextureCU = pcTexturePic->getCU( getAddr() ); 5585 #else 5586 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 5587 #endif 5588 5589 #if H_3D_FCO 5590 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 5591 #else 5592 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 5593 #endif 5594 { 5595 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 5596 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() ); 5597 if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) ) 5598 { 5599 TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv(); 5600 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 5601 cMvPred+=cAdd; 5602 cMvPred>>=2; 5603 clipMv(cMvPred); 5604 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef); 5605 } 5606 5607 if ( getSlice()->isInterB() ) 5608 { 5609 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5610 iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() ); 5611 if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) ) 5612 { 5613 TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv(); 5614 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 5615 cMvPred+=cAdd; 5616 cMvPred>>=2; 5617 clipMv(cMvPred); 5618 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef); 5619 } 5620 } 5621 5622 puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0; 5623 puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0; 5624 5625 if( puhInterDirNeighbours[iCount] != 0 ) 5626 { 5627 abCandIsInter[iCount] = true; 5628 if ( mrgCandIdx == iCount ) 5629 { 5630 return; 5631 } 5632 iCount ++; 5633 } 5634 } 5635 } 5636 5637 ////////////////////////////////// 5638 //////// GET DISPARITIES //////// 5639 ////////////////////////////////// 5640 5641 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 5642 5643 for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 5644 { 5645 inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo; 5646 } 5647 5648 ///////////////////////////////////////////////////////////////// 5649 //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC Candidates ///// 5650 ///////////////////////////////////////////////////////////////// 5651 5652 Int posIvDC = -1; 5653 Bool bLeftAvai = false; 5654 Int iPosLeftAbove[2] = {-1, -1}; 5655 5656 5657 // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 5658 // An enumerator would be appropriate here! 5659 TComMv ivCandMv [8]; 5660 Int ivCandRefIdx[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; 5661 5662 // { IvMC, IvDC, IvMCShift, IvDCShift }; 5663 Int ivCandDir [4] = {0, 0, 0, 0}; 5664 5665 Bool ivMvPredFlag = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() ); 5666 5667 if ( ivMvPredFlag ) 5668 { 5669 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir 5670 #if QC_DEPTH_IV_MRG_F0125 5671 , bIsDepth 5672 #endif 5673 ); 5674 } 5675 5676 /////////////////////////////////////////////// 5677 //////// INTER VIEW MOTION COMP(IvMC) ///////// 5678 /////////////////////////////////////////////// 5679 5680 if( ivCandDir[0] ) 5681 { 5682 abCandIsInter [ iCount ] = true; 5683 puhInterDirNeighbours[ iCount ] = ivCandDir[0]; 5684 5685 if( ( ivCandDir[0] & 1 ) == 1 ) 5686 { 5687 pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] ); 5688 } 5689 if( ( ivCandDir[0] & 2 ) == 2 ) 5690 { 5691 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] ); 5692 } 5693 5694 #if QC_DEPTH_IV_MRG_F0125 5695 if ( bIsDepth ) 5696 { 5697 Bool bRemoveSpa = false; 5698 Int iCnloop = iCount-1; 5699 for(; iCnloop >= 0; iCnloop --) 5700 { 5701 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 5702 { 5703 bRemoveSpa = true; 5704 abCandIsInter [ iCount ] = false; 5705 5706 puhInterDirNeighbours[iCount] = 0; 5707 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 5708 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 5709 break; 5710 } 5711 } 5712 if(!bRemoveSpa) 5713 { 5714 bDepthIPMCAvai = true; 5715 } 5716 } 5717 if ( bDepthIPMCAvai || !bIsDepth ) 5718 { 5719 #endif 5720 if ( mrgCandIdx == iCount ) 5721 { 5722 return; 5723 } 5724 iCount ++; 5725 #if QC_DEPTH_IV_MRG_F0125 5726 } 5727 #endif 5728 } 5729 5730 // early termination 5731 if (iCount == getSlice()->getMaxNumMergeCand()) 5732 { 5733 return; 5734 } 5735 #endif 5736 5737 #if H_3D 5738 //////////////////////////// 5739 //////// LEFT (A1) ///////// 5740 //////////////////////////// 5741 #endif 4852 5742 4853 //left 5743 4854 UInt uiLeftPartIdx = 0; … … 5759 4870 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5760 4871 } 5761 #if H_3D_IV_MERGE5762 Bool bRemoveSpa = false; //pruning to inter-view candidates5763 #if QC_DEPTH_IV_MRG_F01255764 Int iCnloop = bDepthIPMCAvai ? (iCount-2): (iCount-1);5765 #else5766 Int iCnloop = iCount - 1;5767 #endif5768 for(; iCnloop >= 0; iCnloop --)5769 {5770 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])5771 {5772 bRemoveSpa = true;5773 abCandIsInter [ iCount ] = false;5774 5775 //reset to the default value for MC5776 puhInterDirNeighbours[iCount] = 0;5777 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );5778 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );5779 break;5780 }5781 }5782 if(!bRemoveSpa)5783 {5784 bLeftAvai = true;5785 iPosLeftAbove[0] = iCount;5786 #if H_3D_NBDV5787 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);5788 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);5789 #endif5790 #if H_3D_VSP5791 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 15792 #if LGE_SHARP_VSP_INHERIT_F01045793 #if H_3D_IC5794 && !bICFlag5795 #endif5796 #if H_3D_ARP5797 && !bARPFlag5798 #endif5799 #endif5800 )5801 {5802 vspFlag[iCount] = 1;5803 #if !MTK_VSP_SIMPLIFICATION_F01115804 xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo);5805 #endif5806 }5807 #endif5808 if ( mrgCandIdx == iCount )5809 {5810 return;5811 }5812 iCount ++;5813 }5814 #else // H_3D_IV_MERGE5815 4872 if ( mrgCandIdx == iCount ) 5816 4873 { … … 5818 4875 } 5819 4876 iCount ++; 5820 #endif // H_3D_IV_MERGE5821 4877 } 5822 4878 … … 5826 4882 return; 5827 4883 } 5828 #if H_3D 5829 //////////////////////////// 5830 //////// ABOVE (B1) //////// 5831 //////////////////////////// 5832 #endif 4884 5833 4885 // above 5834 4886 UInt uiAbovePartIdx = 0; … … 5850 4902 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5851 4903 } 5852 #if H_3D_IV_MERGE 5853 Bool bRemoveSpa = false; //pruning to inter-view candidates 5854 #if QC_DEPTH_IV_MRG_F0125 5855 Int iCnloop; 5856 if( bIsDepth ) 5857 iCnloop = (bLeftAvai && bDepthIPMCAvai) ? (iCount-3) : ((bLeftAvai || bDepthIPMCAvai) ? (iCount-2): (iCount-1)); 5858 else 5859 iCnloop = bLeftAvai? (iCount-2): (iCount-1); 5860 #else 5861 Int iCnloop = bLeftAvai? (iCount-2): (iCount-1); 5862 #endif 5863 for(; iCnloop >= 0; iCnloop --) 5864 { 5865 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 5866 { 5867 bRemoveSpa = true; 5868 abCandIsInter [ iCount ] = false; 5869 5870 //reset to the default value for MC 5871 puhInterDirNeighbours[iCount] = 0; 5872 5873 pcMvFieldNeighbours[iCount<<1] .setMvField( cZeroMv, NOT_VALID ); 5874 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 5875 break; 5876 } 5877 } 5878 5879 if(!bRemoveSpa) 5880 { 5881 iPosLeftAbove[1] = iCount; 5882 #if H_3D_NBDV 5883 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 5884 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 5885 #endif 5886 #if H_3D_VSP 5887 #if MTK_VSP_SIMPLIFICATION_F0111 5888 if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 5889 #if LGE_SHARP_VSP_INHERIT_F0104 5890 #if H_3D_IC 5891 && !bICFlag 5892 #endif 5893 #if H_3D_ARP 5894 && !bARPFlag 5895 #endif 5896 #endif 5897 ) 5898 #else 5899 if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1 5900 #if LGE_SHARP_VSP_INHERIT_F0104 5901 #if H_3D_IC 5902 && !bICFlag 5903 #endif 5904 #if H_3D_ARP 5905 && !bARPFlag 5906 #endif 5907 #endif 5908 ) 5909 #endif 5910 { 5911 5912 vspFlag[iCount] = 1; 5913 #if !MTK_VSP_SIMPLIFICATION_F0111 5914 xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo); 5915 #endif 5916 } 5917 #endif 5918 if ( mrgCandIdx == iCount ) 5919 { 5920 return; 5921 } 5922 iCount ++; 5923 } 5924 #else // H_3D_IV_MERGE 4904 5925 4905 if ( mrgCandIdx == iCount ) 5926 4906 { … … 5928 4908 } 5929 4909 iCount ++; 5930 #endif // H_3D_IV_MERGE5931 4910 } 5932 4911 // early termination … … 5936 4915 } 5937 4916 5938 #if H_3D5939 //////////////////////////////////5940 //////// ABOVE RIGHT (B0) ////////5941 //////////////////////////////////5942 #endif5943 4917 5944 4918 // above right … … 5960 4934 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5961 4935 } 5962 #if H_3D_NBDV5963 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);5964 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);5965 #endif5966 #if H_3D_VSP5967 #if MTK_VSP_SIMPLIFICATION_F01115968 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1)5969 #if LGE_SHARP_VSP_INHERIT_F01045970 #if H_3D_IC5971 && !bICFlag5972 #endif5973 #if H_3D_ARP5974 && !bARPFlag5975 #endif5976 #endif5977 )5978 #else5979 if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 15980 #if LGE_SHARP_VSP_INHERIT_F01045981 #if H_3D_IC5982 && !bICFlag5983 #endif5984 #if H_3D_ARP5985 && !bARPFlag5986 #endif5987 #endif5988 )5989 #endif5990 {5991 vspFlag[iCount] = 1;5992 #if !MTK_VSP_SIMPLIFICATION_F01115993 xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);5994 #endif5995 }5996 #endif5997 4936 if ( mrgCandIdx == iCount ) 5998 4937 { … … 6006 4945 return; 6007 4946 } 6008 6009 #if H_3D_IV_MERGE6010 /////////////////////////////////////////////6011 //////// INTER VIEW DISP COMP (IvDC) ////////6012 /////////////////////////////////////////////6013 6014 if( ivCandDir[1] )6015 {6016 assert(iCount < getSlice()->getMaxNumMergeCand());6017 abCandIsInter [ iCount ] = true;6018 puhInterDirNeighbours[ iCount ] = ivCandDir[1];6019 if( ( ivCandDir[1] & 1 ) == 1 )6020 {6021 pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );6022 }6023 if( ( ivCandDir[1] & 2 ) == 2 )6024 {6025 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );6026 }6027 6028 Bool bRemoveSpa = false; //pruning to A1, B16029 for(Int i = 0; i < 2; i ++)6030 {6031 Int iCnloop = iPosLeftAbove[i];6032 if ( iCnloop == -1 )6033 {6034 continue;6035 }6036 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])6037 {6038 bRemoveSpa = true;6039 abCandIsInter [ iCount ] = false;6040 //reset to the default value for MC6041 puhInterDirNeighbours[iCount] = 0;6042 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );6043 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );6044 break;6045 }6046 }6047 if(!bRemoveSpa)6048 {6049 #if H_3D_NBDV6050 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);6051 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);6052 #endif6053 posIvDC = iCount;6054 if ( mrgCandIdx == iCount )6055 return;6056 iCount ++;6057 6058 // early termination6059 if (iCount == getSlice()->getMaxNumMergeCand())6060 {6061 return;6062 }6063 }6064 }6065 #endif // H_3D_IV_MERGE6066 6067 #if H_3D_VSP6068 /////////////////////////////////////////////////6069 //////// VIEW SYNTHESIS PREDICTION (VSP) ////////6070 /////////////////////////////////////////////////6071 6072 if (6073 #if LGE_SHARP_VSP_INHERIT_F01046074 #if H_3D_IC6075 !bICFlag &&6076 #endif6077 #if H_3D_ARP6078 !bARPFlag &&6079 #endif6080 #endif6081 xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )6082 {6083 return;6084 }6085 6086 // early termination6087 if (iCount == getSlice()->getMaxNumMergeCand())6088 {6089 return;6090 }6091 #endif6092 #if H_3D6093 ///////////////////////////////////6094 //////// LEFT BOTTOM (A0) ////////6095 ///////////////////////////////////6096 #endif6097 4947 6098 4948 //left bottom … … 6114 4964 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 6115 4965 } 6116 #if H_3D_NBDV 6117 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 6118 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 6119 #endif 6120 #if H_3D_VSP 6121 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1 6122 #if LGE_SHARP_VSP_INHERIT_F0104 6123 #if H_3D_IC 6124 && !bICFlag 6125 #endif 6126 #if H_3D_ARP 6127 && !bARPFlag 6128 #endif 6129 #endif 6130 ) 6131 { 6132 vspFlag[iCount] = 1; 6133 #if !MTK_VSP_SIMPLIFICATION_F0111 6134 xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo); 6135 #endif 6136 } 6137 #endif 4966 6138 4967 if ( mrgCandIdx == iCount ) 6139 4968 { … … 6147 4976 return; 6148 4977 } 6149 #if H_3D6150 ///////////////////////////////////6151 //////// LEFT ABOVE (B2) ////////6152 ///////////////////////////////////6153 #endif6154 4978 6155 4979 // above left … … 6174 4998 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 6175 4999 } 6176 #if H_3D_NBDV6177 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);6178 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);6179 #endif6180 #if H_3D_VSP6181 #if MTK_VSP_SIMPLIFICATION_F01116182 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1)6183 #if LGE_SHARP_VSP_INHERIT_F01046184 #if H_3D_IC6185 && !bICFlag6186 #endif6187 #if H_3D_ARP6188 && !bARPFlag6189 #endif6190 #endif6191 )6192 #else6193 if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 16194 #if LGE_SHARP_VSP_INHERIT_F01046195 #if H_3D_IC6196 && !bICFlag6197 #endif6198 #if H_3D_ARP6199 && !bARPFlag6200 #endif6201 #endif6202 )6203 #endif6204 {6205 vspFlag[iCount] = 1;6206 #if !MTK_VSP_SIMPLIFICATION_F01116207 xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);6208 #endif6209 }6210 #endif6211 5000 if ( mrgCandIdx == iCount ) 6212 5001 { … … 6221 5010 return; 6222 5011 } 6223 #if H_3D_IV_MERGE 6224 //////////////////////////////////////////////////// 6225 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 6226 //////////////////////////////////////////////////// 6227 6228 if( ivMvPredFlag ) 6229 { 6230 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag)) 6231 { 6232 return; 6233 } 6234 //early termination 6235 if (iCount == getSlice()->getMaxNumMergeCand()) 6236 { 6237 return; 6238 } 6239 } 6240 #endif 6241 #if H_3D 6242 ///////////////////////////////// 6243 //////// Collocate (COL) //////// 6244 ///////////////////////////////// 6245 #endif 5012 6246 5013 if ( getSlice()->getEnableTMVPFlag()) 6247 5014 { … … 6308 5075 if ( getSlice()->isInterB() ) 6309 5076 { 6310 #if H_3D_TMVP6311 iRefIdx = 0;6312 #endif6313 5077 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 6314 5078 if( bExistMV == false ) … … 6327 5091 puhInterDirNeighbours[uiArrayAddr] = dir; 6328 5092 abCandIsInter[uiArrayAddr] = true; 6329 #if H_3D_NBDV6330 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);6331 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);6332 #endif6333 5093 if ( mrgCandIdx == iCount ) 6334 5094 { … … 6348 5108 if ( getSlice()->isInterB()) 6349 5109 { 6350 #if H_3D_IV_MERGE6351 UInt uiPriorityList0[20] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3, 0, 4, 1, 4, 2, 4, 3, 4 };6352 UInt uiPriorityList1[20] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2, 4, 0, 4, 1, 4, 2, 4, 3 };6353 #else6354 5110 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 6355 5111 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 6356 #endif6357 5112 6358 5113 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 6359 5114 { 6360 5115 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 6361 #if H_3D_VSP6362 Bool bValid = true;6363 if ( vspFlag[i] == 1 || vspFlag[j] == 1 )6364 {6365 bValid = false;6366 }6367 if( !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) )6368 {6369 assert(bValid == true);6370 }6371 #endif6372 #if H_3D_VSP6373 if (abCandIsInter[i] && abCandIsInter[j] && (puhInterDirNeighbours[i]&0x1) && (puhInterDirNeighbours[j]&0x2) && bValid)6374 #else6375 5116 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 6376 #endif6377 5117 { 6378 5118 abCandIsInter[uiArrayAddr] = true; … … 6429 5169 numValidMergeCand = uiArrayAddr; 6430 5170 } 6431 6432 6433 5171 #endif 6434 5172 … … 6770 5508 } 6771 5509 6772 #if LGE_IC_CTX_F01605510 #if H_3D_IC 6773 5511 Bool TComDataCU::isIC( UInt uiPartIdx ) 6774 5512 { … … 7623 6361 } 7624 6362 #endif 7625 #if QC_DEPTH_IV_MRG_F01256363 #if H_3D_IV_MERGE 7626 6364 Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 7627 6365 { … … 8203 6941 #endif 8204 6942 8205 #if MTK_SPIVMP_F01106943 #if H_3D_SPIVMP 8206 6944 Void TComDataCU::getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight) 8207 6945 { … … 8255 6993 #if H_3D_IV_MERGE 8256 6994 Bool 8257 TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc 8258 #if QC_DEPTH_IV_MRG_F0125 8259 , Bool bIsDepth 8260 #endif 8261 #if MTK_SPIVMP_F0110 6995 TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc , Bool bIsDepth 6996 #if H_3D_SPIVMP 8262 6997 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 8263 6998 #endif … … 8268 7003 8269 7004 //--- get base CU/PU and check prediction mode --- 8270 #if QC_DEPTH_IV_MRG_F01258271 7005 TComPic* pcBasePic = pcSlice->getIvPic( bIsDepth, iViewIndex ); 8272 #else8273 TComPic* pcBasePic = pcSlice->getIvPic( false, iViewIndex );8274 #endif8275 7006 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 8276 7007 … … 8283 7014 pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 8284 7015 8285 #if !MTK_SPIVMP_F0110 8286 #if QC_DEPTH_IV_MRG_F0125 7016 #if !H_3D_SPIVMP 8287 7017 iCurrPosX += ( iWidth >> 1 ); 8288 7018 iCurrPosY += ( iHeight >> 1 ); 8289 #else8290 iCurrPosX += ( ( iWidth - 1 ) >> 1 );8291 iCurrPosY += ( ( iHeight - 1 ) >> 1 );8292 #endif8293 7019 #endif 8294 7020 … … 8308 7034 #endif 8309 7035 8310 #if MTK_SPIVMP_F01107036 #if H_3D_SPIVMP 8311 7037 //////////////////////////////// 8312 7038 //////////sub-PU IvMC/////////// … … 8438 7164 //////////////////////////////// 8439 7165 8440 #if MTK_SPIVMP_F01107166 #if H_3D_SPIVMP 8441 7167 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 8442 7168 #else … … 8447 7173 // iLoopCan == 1 --> IvMCShift 8448 7174 8449 #if ! MTK_SPIVMP_F01107175 #if !H_3D_SPIVMP 8450 7176 Int iBaseCUAddr; 8451 7177 Int iBaseAbsPartIdx; … … 8455 7181 Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 ); 8456 7182 8457 #if MTK_SPIVMP_F01107183 #if H_3D_SPIVMP 8458 7184 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 8459 7185 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); … … 8464 7190 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 8465 7191 8466 #if MTK_SPIVMP_F01107192 #if H_3D_SPIVMP 8467 7193 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 8468 7194 #else … … 8496 7222 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 8497 7223 #if H_3D_NBDV 8498 #if QC_DEPTH_IV_MRG_F01257224 #if H_3D_IV_MERGE 8499 7225 if( !bIsDepth ) 8500 7226 { … … 8504 7230 cMv.setIDVVer (cDv.getVer()); 8505 7231 cMv.setIDVVId (iViewIndex); 8506 #if QC_DEPTH_IV_MRG_F01257232 #if H_3D_IV_MERGE 8507 7233 } 8508 7234 #endif … … 8521 7247 } 8522 7248 } 8523 #if MTK_SPIVMP_F01107249 #if H_3D_SPIVMP 8524 7250 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 8525 7251 #else … … 8552 7278 #endif 8553 7279 cMv.setHor( cMv.getHor() + ioffsetDV ); 8554 #if QC_DEPTH_IV_MRG_F01257280 #if H_3D_IV_MERGE 8555 7281 if( bIsDepth ) 8556 7282 cMv.setHor((cMv.getHor()+2)>>2); … … 8639 7365 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 8640 7366 } 8641 #if !SEC_DMM3_RBC_F01478642 Void TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )8643 {8644 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);8645 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm3IntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; }8646 }8647 #endif8648 #endif8649 #if H_3D_DIM_RBC8650 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )8651 {8652 Int iWidth;8653 Int iHeight;8654 if( uiDepth == 0 )8655 {8656 iWidth = 64;8657 iHeight = 64;8658 }8659 else if( uiDepth == 1 )8660 {8661 iWidth = 32;8662 iHeight = 32;8663 }8664 else if( uiDepth == 2 )8665 {8666 iWidth = 16;8667 iHeight = 16;8668 }8669 else if( uiDepth == 3 )8670 {8671 iWidth = 8;8672 iHeight = 8;8673 }8674 else // uiDepth == 48675 {8676 iWidth = 4;8677 iHeight = 4;8678 }8679 8680 Int iPtr = 0;8681 Int iX, iY;8682 Int iDir = -1;8683 Int iDiffX = 0, iDiffY = 0;8684 8685 // 1. Edge Code -> Vert & Horz Edges8686 Bool* pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight );8687 8688 for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ )8689 pbEdge [ ui ] = false;8690 8691 // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7)8692 // Code : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6)8693 const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 },8694 { 1, 5, 7, 2, 3, 4, 6 },8695 { 2, 4, 5, 0, 1, 6, 7 },8696 { 3, 7, 6, 1, 0, 5, 4 },8697 { 4, 0, 2, 6, 5, 3, 1 },8698 { 5, 2, 1, 4, 7, 0, 3 },8699 { 6, 3, 0, 7, 4, 1, 2 },8700 { 7, 1, 3, 5, 6, 2, 0 }};8701 8702 UChar ucCode = pucEdgeCode[iPtr++];8703 8704 if( !bLeft )8705 {8706 iX = ucStartPos;8707 iY = 0;8708 8709 switch(ucCode)8710 {8711 case 0: // bottom8712 iDir = 3;8713 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8714 break;8715 case 2: // left-bottom8716 iDir = 6;8717 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8718 break;8719 case 1: // right-bottom8720 iDir = 7;8721 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8722 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8723 break;8724 case 4: // left8725 iDir = 0;8726 assert(false);8727 break;8728 case 3: // right8729 iDir = 1;8730 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8731 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8732 break;8733 }8734 }8735 else8736 {8737 iX = 0;8738 iY = ucStartPos;8739 8740 switch(ucCode)8741 {8742 case 0: // right8743 iDir = 1;8744 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8745 break;8746 case 1: // right-top8747 iDir = 5;8748 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8749 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8750 break;8751 case 2: // right-bottom8752 iDir = 7;8753 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8754 break;8755 case 3: // top8756 iDir = 2;8757 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8758 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8759 break;8760 case 4: // bottom8761 iDir = 3;8762 assert(false);8763 break;8764 }8765 }8766 8767 switch( iDir )8768 {8769 case 0: // left8770 iDiffX = -1;8771 iDiffY = 0;8772 break;8773 case 1: // right8774 iDiffX = +1;8775 iDiffY = 0;8776 break;8777 case 2: // top8778 iDiffX = 0;8779 iDiffY = -1;8780 break;8781 case 3: // bottom8782 iDiffX = 0;8783 iDiffY = +1;8784 break;8785 case 4: // left-top8786 iDiffX = -1;8787 iDiffY = -1;8788 break;8789 case 5: // right-top8790 iDiffX = +1;8791 iDiffY = -1;8792 break;8793 case 6: // left-bottom8794 iDiffX = -1;8795 iDiffY = +1;8796 break;8797 case 7: // right-bottom8798 iDiffX = +1;8799 iDiffY = +1;8800 break;8801 }8802 8803 iX += iDiffX;8804 iY += iDiffY;8805 8806 while( iPtr < ucNumEdge )8807 {8808 ucCode = pucEdgeCode[iPtr++];8809 8810 Int iNewDir = tableDir[iDir][ucCode];8811 8812 switch( iNewDir )8813 {8814 case 0: // left8815 iDiffX = -1;8816 iDiffY = 0;8817 break;8818 case 1: // right8819 iDiffX = +1;8820 iDiffY = 0;8821 break;8822 case 2: // top8823 iDiffX = 0;8824 iDiffY = -1;8825 break;8826 case 3: // bottom8827 iDiffX = 0;8828 iDiffY = +1;8829 break;8830 case 4: // left-top8831 iDiffX = -1;8832 iDiffY = -1;8833 break;8834 case 5: // right-top8835 iDiffX = +1;8836 iDiffY = -1;8837 break;8838 case 6: // left-bottom8839 iDiffX = -1;8840 iDiffY = +1;8841 break;8842 case 7: // right-bottom8843 iDiffX = +1;8844 iDiffY = +1;8845 break;8846 }8847 8848 switch( iDir )8849 {8850 case 0: // left8851 switch( ucCode )8852 {8853 case 0:8854 case 2:8855 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8856 break;8857 case 1:8858 case 3:8859 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8860 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8861 break;8862 case 4:8863 case 6:8864 // no8865 break;8866 case 5:8867 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8868 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8869 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8870 break;8871 }8872 break;8873 case 1: // right8874 switch( ucCode )8875 {8876 case 0:8877 case 2:8878 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8879 break;8880 case 1:8881 case 3:8882 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8883 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8884 break;8885 case 4:8886 case 6:8887 // no8888 break;8889 case 5:8890 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8891 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8892 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8893 break;8894 }8895 break;8896 case 2: // top8897 switch( ucCode )8898 {8899 case 0:8900 case 2:8901 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8902 break;8903 case 1:8904 case 3:8905 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8906 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8907 break;8908 case 4:8909 case 6:8910 // no8911 break;8912 case 5:8913 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8914 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8915 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8916 break;8917 }8918 break;8919 case 3: // bottom8920 switch( ucCode )8921 {8922 case 0:8923 case 2:8924 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8925 break;8926 case 1:8927 case 3:8928 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8929 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8930 break;8931 case 4:8932 case 6:8933 // no8934 break;8935 case 5:8936 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8937 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8938 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8939 break;8940 }8941 break;8942 case 4: // left-top8943 switch( ucCode )8944 {8945 case 0:8946 case 1:8947 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8948 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8949 break;8950 case 2:8951 case 4:8952 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8953 break;8954 case 3:8955 case 5:8956 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8957 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8958 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8959 break;8960 case 6:8961 // no8962 break;8963 }8964 break;8965 case 5: // right-top8966 switch( ucCode )8967 {8968 case 0:8969 case 1:8970 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8971 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8972 break;8973 case 2:8974 case 4:8975 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8976 break;8977 case 3:8978 case 5:8979 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8980 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;8981 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;8982 break;8983 case 6:8984 // no8985 break;8986 }8987 break;8988 case 6: // left-bottom8989 switch( ucCode )8990 {8991 case 0:8992 case 1:8993 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8994 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;8995 break;8996 case 2:8997 case 4:8998 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;8999 break;9000 case 3:9001 case 5:9002 if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;9003 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;9004 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;9005 break;9006 case 6:9007 // no9008 break;9009 }9010 break;9011 case 7: // right-bottom9012 switch( ucCode )9013 {9014 case 0:9015 case 1:9016 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;9017 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;9018 break;9019 case 2:9020 case 4:9021 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;9022 break;9023 case 3:9024 case 5:9025 if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;9026 if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;9027 if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;9028 break;9029 case 6:9030 // no9031 break;9032 }9033 break;9034 }9035 9036 assert( iX >= 0 && iX <= iWidth );9037 assert( iY >= 0 && iY <= iHeight );9038 9039 iX += iDiffX;9040 iY += iDiffY;9041 iDir = iNewDir;9042 }9043 9044 // finalize edge chain9045 if( iX == iWidth-1 )9046 {9047 if( iY == 0 )9048 {9049 if( iDir == 1 )9050 {9051 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9052 }9053 else if( iDir == 5 )9054 {9055 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9056 }9057 else9058 {9059 assert(false);9060 }9061 }9062 else if( iY == iHeight-1 )9063 {9064 if( iDir == 3 )9065 {9066 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9067 }9068 else if( iDir == 7 )9069 {9070 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9071 }9072 else9073 {9074 assert(false);9075 }9076 }9077 else9078 {9079 if( iDir == 1 )9080 {9081 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9082 }9083 else if( iDir == 3 )9084 {9085 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9086 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9087 }9088 else if( iDir == 5 )9089 {9090 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9091 }9092 else if( iDir == 7 )9093 {9094 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9095 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9096 }9097 else9098 {9099 assert(false);9100 }9101 }9102 }9103 else if( iX == 0 )9104 {9105 if( iY == 0 )9106 {9107 if( iDir == 2 )9108 {9109 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9110 }9111 else if( iDir == 4 )9112 {9113 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9114 }9115 else9116 {9117 assert(false);9118 }9119 }9120 else if( iY == iHeight-1 )9121 {9122 if( iDir == 0 )9123 {9124 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9125 }9126 else if( iDir == 6 )9127 {9128 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9129 }9130 else9131 {9132 assert(false);9133 }9134 }9135 else9136 {9137 if( iDir == 0 )9138 {9139 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9140 }9141 else if( iDir == 2 )9142 {9143 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9144 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9145 }9146 else if( iDir == 4 )9147 {9148 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9149 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9150 }9151 else if( iDir == 6 )9152 {9153 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9154 }9155 else9156 {9157 assert(false);9158 }9159 }9160 }9161 else if( iY == 0 )9162 {9163 if( iDir == 1 )9164 {9165 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9166 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9167 }9168 else if( iDir == 2 )9169 {9170 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9171 }9172 else if( iDir == 4 )9173 {9174 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9175 }9176 else if( iDir == 5 )9177 {9178 pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;9179 pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;9180 }9181 else9182 {9183 assert(false);9184 }9185 }9186 else if( iY == iHeight-1 )9187 {9188 if( iDir == 0 )9189 {9190 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9191 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9192 }9193 else if( iDir == 3 )9194 {9195 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9196 }9197 else if( iDir == 6 )9198 {9199 pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;9200 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9201 }9202 else if( iDir == 7 )9203 {9204 pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;9205 }9206 else9207 {9208 assert(false);9209 }9210 }9211 else9212 {9213 printf("reconPartiton: wrong termination\n");9214 assert(false);9215 }9216 9217 // Reconstruct Region from Chain Code9218 Bool* pbVisit = (Bool*) xMalloc( Bool, iWidth * iHeight );9219 Int* piStack = (Int* ) xMalloc( Int, iWidth * iHeight );9220 9221 for( UInt ui = 0; ui < iWidth * iHeight; ui++ )9222 {9223 pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)9224 pbVisit [ ui ] = false;9225 }9226 9227 iPtr = 0;9228 piStack[iPtr++] = (0 << 8) | (0);9229 pbRegion[ 0 ] = false;9230 9231 while(iPtr > 0)9232 {9233 Int iTmp = piStack[--iPtr];9234 Int iX1, iY1;9235 iX1 = iTmp & 0xff;9236 iY1 = (iTmp >> 8) & 0xff;9237 9238 pbVisit[ iX1 + iY1 * iWidth ] = true;9239 9240 assert( iX1 >= 0 && iX1 < iWidth );9241 assert( iY1 >= 0 && iY1 < iHeight );9242 9243 if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )9244 {9245 piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);9246 pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;9247 }9248 if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )9249 {9250 piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);9251 pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;9252 }9253 if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )9254 {9255 piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;9256 pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;9257 }9258 if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )9259 {9260 piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;9261 pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;9262 }9263 }9264 9265 xFree( pbEdge );9266 xFree( pbVisit );9267 xFree( piStack );9268 }9269 7367 #endif 9270 7368
Note: See TracChangeset for help on using the changeset viewer.