Changeset 764 in 3DVCSoftware for branches/HTM-9.2-dev0/source
- Timestamp:
- 12 Jan 2014, 00:23:20 (11 years ago)
- Location:
- branches/HTM-9.2-dev0/source
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r738 r764 378 378 #if H_3D_DIM 379 379 ("DMM", m_useDMM, true, "Depth intra model modes") 380 #if !SEC_DMM3_RBC_F0147381 ("RBC", m_useRBC, true, "Region boundary chain mode")382 #endif383 380 ("SDC", m_useSDC, true, "Simplified depth coding") 384 381 ("DLT", m_useDLT, true, "Depth lookup table") … … 523 520 524 521 #if H_3D_IC 525 #if SEC_ONLY_TEXTURE_IC_F0151526 522 ("IlluCompEnable", m_abUseIC, true, "Enable illumination compensation") 527 #else528 ("IlluCompEnable", m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation")529 #endif530 523 #endif 531 524 #if H_3D_INTER_SDC … … 2518 2511 #endif 2519 2512 #if H_3D_IC 2520 #if SEC_ONLY_TEXTURE_IC_F01512521 2513 printf( "IlluCompEnable: %d ", m_abUseIC); 2522 #else2523 printf( "IlluCompEnable: %d %d ", m_abUseIC[0] ? 1 : 0, m_abUseIC[1] ? 1 : 0 );2524 #endif2525 2514 #endif 2526 2515 #if H_3D_NBDV_REF … … 2535 2524 #if H_3D_DIM 2536 2525 printf("DMM:%d ", m_useDMM ); 2537 #if !SEC_DMM3_RBC_F01472538 printf("RBC:%d ", m_useRBC );2539 #endif2540 2526 printf("SDC:%d ", m_useSDC ); 2541 2527 printf("DLT:%d ", m_useDLT ); -
branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncCfg.h
r738 r764 150 150 #endif 151 151 #if H_3D_IC 152 #if SEC_ONLY_TEXTURE_IC_F0151153 152 Bool m_abUseIC; 154 #else155 vector<Bool> m_abUseIC; ///< flag for using illumination compensation for inter-view prediction156 #endif157 153 #endif 158 154 #if H_3D_NBDV_REF … … 497 493 #if H_3D_DIM 498 494 Bool m_useDMM; ///< flag for using DMM 499 #if !SEC_DMM3_RBC_F0147500 Bool m_useRBC; ///< flag for using RBC501 #endif502 495 Bool m_useSDC; ///< flag for using SDC 503 496 Bool m_useDLT; ///< flag for using DLT -
branches/HTM-9.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r758 r764 198 198 #endif 199 199 #if H_3D_IC 200 #if SEC_ONLY_TEXTURE_IC_F0151201 200 m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC ); 202 #else203 m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] );204 #endif205 201 #endif 206 202 //========== Depth intra modes ========== 207 203 #if H_3D_DIM 208 204 m_cTEncTop.setUseDMM ( isDepth ? m_useDMM : false ); 209 #if !SEC_DMM3_RBC_F0147210 m_cTEncTop.setUseRBC ( isDepth ? m_useRBC : false );211 #endif212 205 m_cTEncTop.setUseSDC ( isDepth ? m_useSDC : false ); 213 206 m_cTEncTop.setUseDLT ( isDepth ? m_useDLT : false ); … … 1997 1990 1998 1991 #if H_3D_DIM 1999 #if SEC_DMM3_RBC_F01472000 1992 vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useSDC || m_useDLT ) ); 2001 #else2002 vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useRBC || m_useSDC || m_useDLT ) );2003 #endif2004 1993 #if H_3D_DIM_DLT 2005 1994 #if !DLT_DIFF_CODING_IN_PPS -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/ContextTables.h
r724 r764 109 109 #define NUM_DEPTH_INTRA_MODE_CTX 8 ///< number of context models for depth intra modes 110 110 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (DMM or RBC) 111 #if QC_DIM_DELTADC_UNIFY_F0132112 111 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or RBC) 113 #else114 #define NUM_DDC_DATA_CTX 2 ///< number of context models for deltaDC data (DMM or RBC)115 #endif116 112 #if H_3D_DIM_DMM 117 113 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 118 #if !SEC_DMM3_RBC_F0147119 #define NUM_DMM3_DATA_CTX 1 ///< number of context models for DMM3 data120 #endif121 #endif122 #if H_3D_DIM_RBC123 #define NUM_RBC_DATA_CTX 1 ///< number of context models for RBC data124 114 #endif 125 115 #endif … … 393 383 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 394 384 { 395 #if LGE_IC_CTX_F0160396 385 { 154, 154, 154, }, 397 386 { 154, 154, 154, }, 398 387 { 154, 154, 154, }, 399 #else400 { CNU, CNU, CNU, },401 { 197, 185, 201, },402 { 197, 185, 201, },403 #endif404 388 }; 405 389 #endif … … 423 407 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 424 408 { 425 #if QC_DIM_DELTADC_UNIFY_F0132 426 { 154 }, 427 { 154 }, 428 { 154 }, 429 #else 430 { CNU, CNU }, 431 { CNU, CNU }, 432 { CNU, CNU }, 433 #endif 409 { 154 }, 410 { 154 }, 411 { 154 }, 434 412 }; 435 413 #if H_3D_DIM_DMM … … 441 419 { CNU }, 442 420 }; 443 #if !SEC_DMM3_RBC_F0147444 static const UChar445 INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] =446 {447 { CNU },448 { CNU },449 { CNU },450 };451 #endif452 #endif453 #if H_3D_DIM_RBC454 static const UChar455 INIT_RBC_DATA[3][NUM_RBC_DATA_CTX] =456 {457 { CNU },458 { CNU },459 { CNU },460 };461 421 #endif 462 422 #if H_3D_DIM_SDC -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r724 r764 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 … … 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 … … 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 … … 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 … … 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 … … 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 … … 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 … … 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 … … 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 … … 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 … … 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; … … 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 … … 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 … … 4150 3985 if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1 4151 3986 #endif 4152 #if LGE_SHARP_VSP_INHERIT_F01044153 3987 #if H_3D_IC 4154 3988 && !bICFlag … … 4156 3990 #if H_3D_ARP 4157 3991 && !bARPFlag 4158 #endif4159 3992 #endif 4160 3993 ) … … 4177 4010 { 4178 4011 #if H_3D_VSP 4179 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F01114180 4012 if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 4181 #else4182 if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 14183 #endif4184 #if LGE_SHARP_VSP_INHERIT_F01044185 4013 #if H_3D_IC 4186 4014 && !bICFlag … … 4189 4017 && !bARPFlag 4190 4018 #endif 4191 #endif4192 4019 ) 4193 4020 { 4194 4021 vspFlag[numA1B1B0] = 1; 4195 #if !MTK_VSP_SIMPLIFICATION_F01114196 xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo);4197 #endif4198 4022 } 4199 4023 #endif … … 4208 4032 #if H_3D_VSP 4209 4033 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1 4210 #if LGE_SHARP_VSP_INHERIT_F01044211 4034 #if H_3D_IC 4212 4035 && !bICFlag … … 4215 4038 && !bARPFlag 4216 4039 #endif 4217 #endif4218 4040 ) 4219 4041 { 4220 4042 vspFlag[numA1B1B0] = 1; 4221 #if !MTK_VSP_SIMPLIFICATION_F01114222 xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo);4223 #endif4224 4043 } 4225 4044 #endif … … 4235 4054 { 4236 4055 #if H_3D_VSP 4237 #if BUGFIX_2_F0093 && MTK_VSP_SIMPLIFICATION_F01114238 4056 if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 4239 #else4240 if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 14241 #endif4242 #if LGE_SHARP_VSP_INHERIT_F01044243 4057 #if H_3D_IC 4244 4058 && !bICFlag … … 4247 4061 && !bARPFlag 4248 4062 #endif 4249 #endif4250 4063 ) 4251 4064 { 4252 4065 vspFlag[numA1B1B0+iCountHEVC] = 1; 4253 #if !MTK_VSP_SIMPLIFICATION_F01114254 xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo);4255 #endif4256 4066 } 4257 4067 #endif … … 4265 4075 4266 4076 #if H_3D_IV_MERGE 4267 4077 4268 4078 ///////////////////////////////////////////// 4269 4079 //////// TEXTURE MERGE CANDIDATE (T) //////// 4270 4080 ///////////////////////////////////////////// 4271 4272 #if SEC_MPI_ENABLING_MERGE_F0150 4081 4273 4082 if( bMPIFlag) 4274 #else4275 if( m_pcSlice->getIsDepth())4276 #endif4277 4083 { 4278 4084 UInt uiPartIdxCenter; 4279 4085 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4280 4281 #if ETRIKHU_MERGE_REUSE_F00934282 4086 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4283 4087 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4284 4088 Int tRef[2]={-1, -1}; 4285 #endif4286 4089 4287 4090 #if H_3D_FCO … … 4289 4092 TComDataCU *pcTextureCU = 0; 4290 4093 if ( pcTexturePic ) 4291 4094 pcTextureCU = pcTexturePic->getCU( getAddr() ); 4292 4095 #else 4293 4096 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4294 4097 #endif 4295 4098 4296 4099 #if H_3D_FCO 4297 4100 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) … … 4300 4103 #endif 4301 4104 { 4302 #if ETRIKHU_MERGE_REUSE_F00934303 4105 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] ); 4304 4106 tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() ); … … 4414 4216 } 4415 4217 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 4218 } 4219 } 4220 } 4471 4221 4472 4222 ///////////////////////////////////////////////////////////////// … … 4475 4225 4476 4226 Int posIvDC = -1; 4477 #if !ETRIKHU_MERGE_REUSE_F00934478 Bool bLeftAvai = false;4479 Int iPosLeftAbove[2] = {-1, -1};4480 #endif4481 4227 4482 4228 // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; … … 4489 4235 4490 4236 Bool ivMvPredFlag = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() ); 4491 4237 4492 4238 if ( ivMvPredFlag ) 4493 4239 { 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 ); 4240 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP ); 4502 4241 } 4503 4242 4504 4243 /////////////////////////////////////////////// 4505 4244 //////// INTER VIEW MOTION COMP(IvMC) ///////// … … 4508 4247 if( ivCandDir[0] ) 4509 4248 { 4510 #if ETRIKHU_MERGE_REUSE_F00934511 4249 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4512 4250 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); … … 4525 4263 Int iCnloop=0; 4526 4264 4527 #if BUGFIX_F00934528 4265 if (!bIsDepth) 4529 4266 { 4530 #endif4531 4267 for(Int i = 0; i < 2; i ++) 4532 4268 { … … 4542 4278 } 4543 4279 } 4544 #if BUGFIX_F0093 4545 } 4546 #endif 4547 #if QC_DEPTH_IV_MRG_F0125 4548 #if BUGFIX_F0093 4280 } 4549 4281 if (bIsDepth) 4550 #else4551 if ( bIsDepth && !bRemoveSpa)4552 #endif4553 4282 { 4554 4283 iCnloop = iCount-1; 4555 4284 for(; iCnloop >= 0; iCnloop --) 4556 4285 { 4557 #if BUGFIX_F00934558 4286 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 4287 { 4563 4288 bRemoveSpa = true; … … 4565 4290 } 4566 4291 } 4567 #if !BUGFIX_F0093 4568 if(!bRemoveSpa) 4569 { 4570 bDepthIPMCAvai = true; 4571 } 4572 #endif 4573 } 4574 #endif 4292 } 4575 4293 4576 4294 if (!bRemoveSpa) … … 4628 4346 if (bIvMC) 4629 4347 { 4630 #if MTK_SPIVMP_F01104631 4348 pbSPIVMPFlag[iCount] = true; 4632 #endif4633 4349 if( ( ivCandDir[0] & 1 ) == 1 ) 4634 4350 { … … 4642 4358 puhInterDirNeighbours[ iCount ] = ivCandDir[0]; 4643 4359 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 4360 if ( mrgCandIdx == iCount ) 4700 4361 { … … 4702 4363 } 4703 4364 iCount ++; 4704 #if QC_DEPTH_IV_MRG_F0125 4705 } 4706 #endif 4707 4708 #endif 4709 4365 } 4710 4366 } 4711 4367 … … 4717 4373 #endif 4718 4374 4719 4720 4721 4722 4723 #if ETRIKHU_MERGE_REUSE_F0093 4375 #if H_3D 4724 4376 iCount += numA1B1B0; 4725 4377 #else 4726 #if H_3D4727 ////////////////////////////4728 //////// LEFT (A1) /////////4729 ////////////////////////////4730 #endif4731 4378 //left 4732 4379 UInt uiLeftPartIdx = 0; … … 4748 4395 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4749 4396 } 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 4397 4804 4398 if ( mrgCandIdx == iCount ) 4805 4399 { … … 4807 4401 } 4808 4402 iCount ++; 4809 #endif // H_3D_IV_MERGE4810 4403 } 4811 4404 … … 4815 4408 return; 4816 4409 } 4817 #if H_3D 4818 //////////////////////////// 4819 //////// ABOVE (B1) //////// 4820 //////////////////////////// 4821 #endif 4410 4822 4411 // above 4823 4412 UInt uiAbovePartIdx = 0; … … 4839 4428 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4840 4429 } 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 4430 4914 4431 if ( mrgCandIdx == iCount ) 4915 4432 { … … 4917 4434 } 4918 4435 iCount ++; 4919 #endif // H_3D_IV_MERGE4920 4436 } 4921 4437 // early termination … … 4924 4440 return; 4925 4441 } 4926 4927 #if H_3D4928 //////////////////////////////////4929 //////// ABOVE RIGHT (B0) ////////4930 //////////////////////////////////4931 #endif4932 4442 4933 4443 // above right … … 4949 4459 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4950 4460 } 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 4461 4986 4462 if ( mrgCandIdx == iCount ) 4987 4463 { … … 5003 4479 ///////////////////////////////////////////// 5004 4480 5005 #if ETRIKHU_MERGE_REUSE_F00935006 4481 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand()) 5007 #else5008 if( ivCandDir[1] )5009 #endif5010 4482 { 5011 4483 assert(iCount < getSlice()->getMaxNumMergeCand()); 5012 4484 5013 #if ETRIKHU_MERGE_REUSE_F00935014 4485 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 5015 4486 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); … … 5022 4493 tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 5023 4494 } 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 4495 5037 4496 Bool bRemoveSpa = false; //pruning to A1, B1 … … 5046 4505 { 5047 4506 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 4507 break; 5056 4508 } … … 5058 4510 if(!bRemoveSpa) 5059 4511 { 5060 #if ETRIKHU_MERGE_REUSE_F00935061 4512 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 5062 4513 puhInterDirNeighbours[ iCount ] = ivCandDir[1]; … … 5069 4520 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 5070 4521 } 5071 #endif5072 4522 #if H_3D_NBDV 5073 4523 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); … … 5092 4542 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// 5093 4543 ///////////////////////////////////////////////// 5094 #if ETRIKHU_MERGE_REUSE_F00935095 4544 if (iCount<getSlice()->getMaxNumMergeCand()) 5096 4545 { 5097 #endif5098 4546 5099 4547 if ( 5100 #if LGE_SHARP_VSP_INHERIT_F01045101 4548 #if H_3D_IC 5102 4549 !bICFlag && … … 5105 4552 !bARPFlag && 5106 4553 #endif 5107 #endif5108 #if ETRIKHU_MERGE_REUSE_F00935109 4554 xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) ) 5110 #else5111 xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) )5112 #endif5113 4555 { 5114 4556 return; … … 5121 4563 } 5122 4564 #endif 5123 #if ETRIKHU_MERGE_REUSE_F00935124 } 5125 #endif 5126 5127 #if ETRIKHU_MERGE_REUSE_F00934565 #if H_3D 4566 } 4567 #endif 4568 4569 #if H_3D 5128 4570 iCount += numA0B2; 5129 4571 #else 5130 #if H_3D5131 ///////////////////////////////////5132 //////// LEFT BOTTOM (A0) ////////5133 ///////////////////////////////////5134 #endif5135 5136 4572 //left bottom 5137 4573 UInt uiLeftBottomPartIdx = 0; … … 5152 4588 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5153 4589 } 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 4590 if ( mrgCandIdx == iCount ) 5177 4591 { … … 5185 4599 return; 5186 4600 } 5187 #if H_3D5188 ///////////////////////////////////5189 //////// LEFT ABOVE (B2) ////////5190 ///////////////////////////////////5191 #endif5192 4601 5193 4602 // above left … … 5212 4621 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5213 4622 } 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 4623 if ( mrgCandIdx == iCount ) 5250 4624 { … … 5266 4640 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 5267 4641 //////////////////////////////////////////////////// 5268 #if ETRIKHU_MERGE_REUSE_F00935269 4642 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() ) 5270 4643 { 5271 4644 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 4645 { 5278 4646 return; … … 5286 4654 #endif 5287 4655 5288 #if ETRIKHU_MERGE_REUSE_F00934656 #if H_3D 5289 4657 if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand()) 5290 4658 { … … 5297 4665 numValidMergeCand = iCount; 5298 4666 #else 5299 #if H_3D5300 /////////////////////////////////5301 //////// Collocate (COL) ////////5302 /////////////////////////////////5303 #endif5304 4667 if ( getSlice()->getEnableTMVPFlag()) 5305 4668 { … … 5366 4729 if ( getSlice()->isInterB() ) 5367 4730 { 5368 #if H_3D_TMVP5369 iRefIdx = 0;5370 #endif5371 4731 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 5372 4732 if( bExistMV == false ) … … 5385 4745 puhInterDirNeighbours[uiArrayAddr] = dir; 5386 4746 abCandIsInter[uiArrayAddr] = true; 5387 #if H_3D_NBDV5388 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);5389 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);5390 #endif5391 4747 if ( mrgCandIdx == iCount ) 5392 4748 { … … 5406 4762 if ( getSlice()->isInterB()) 5407 4763 { 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 4764 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 5413 4765 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 5414 #endif5415 4766 5416 4767 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 5417 4768 { 5418 4769 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 4770 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 5434 #endif5435 4771 { 5436 4772 abCandIsInter[uiArrayAddr] = true; … … 5488 4824 #endif 5489 4825 } 5490 5491 5492 5493 5494 4826 #else 5495 4827 … … 5503 4835 */ 5504 4836 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 5505 #if H_3D_VSP5506 , Int* vspFlag5507 , InheritedVSPDisInfo* inheritedVSPDisInfo5508 #endif5509 4837 , Int& numValidMergeCand, Int mrgCandIdx 5510 4838 ) 5511 4839 { 5512 4840 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 4841 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 5521 #endif5522 4842 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 5523 4843 { 5524 4844 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 4845 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 5530 4846 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 5531 #endif5532 4847 } 5533 4848 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 5534 #if H_3D5535 //////////////////////////////////5536 //////// DERIVE LOCATIONS ////////5537 //////////////////////////////////5538 #endif5539 4849 // compute the location of the current PU 5540 4850 Int xP, yP, nPSW, nPSH; … … 5547 4857 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 5548 4858 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 4859 5742 4860 //left 5743 4861 UInt uiLeftPartIdx = 0; … … 5759 4877 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5760 4878 } 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 4879 if ( mrgCandIdx == iCount ) 5816 4880 { … … 5818 4882 } 5819 4883 iCount ++; 5820 #endif // H_3D_IV_MERGE5821 4884 } 5822 4885 … … 5826 4889 return; 5827 4890 } 5828 #if H_3D 5829 //////////////////////////// 5830 //////// ABOVE (B1) //////// 5831 //////////////////////////// 5832 #endif 4891 5833 4892 // above 5834 4893 UInt uiAbovePartIdx = 0; … … 5850 4909 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5851 4910 } 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 4911 5925 4912 if ( mrgCandIdx == iCount ) 5926 4913 { … … 5928 4915 } 5929 4916 iCount ++; 5930 #endif // H_3D_IV_MERGE5931 4917 } 5932 4918 // early termination … … 5936 4922 } 5937 4923 5938 #if H_3D5939 //////////////////////////////////5940 //////// ABOVE RIGHT (B0) ////////5941 //////////////////////////////////5942 #endif5943 4924 5944 4925 // above right … … 5960 4941 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 5961 4942 } 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 4943 if ( mrgCandIdx == iCount ) 5998 4944 { … … 6006 4952 return; 6007 4953 } 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 4954 6098 4955 //left bottom … … 6114 4971 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 6115 4972 } 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 4973 6138 4974 if ( mrgCandIdx == iCount ) 6139 4975 { … … 6147 4983 return; 6148 4984 } 6149 #if H_3D6150 ///////////////////////////////////6151 //////// LEFT ABOVE (B2) ////////6152 ///////////////////////////////////6153 #endif6154 4985 6155 4986 // above left … … 6174 5005 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 6175 5006 } 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 5007 if ( mrgCandIdx == iCount ) 6212 5008 { … … 6221 5017 return; 6222 5018 } 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 5019 6246 5020 if ( getSlice()->getEnableTMVPFlag()) 6247 5021 { … … 6308 5082 if ( getSlice()->isInterB() ) 6309 5083 { 6310 #if H_3D_TMVP6311 iRefIdx = 0;6312 #endif6313 5084 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 6314 5085 if( bExistMV == false ) … … 6327 5098 puhInterDirNeighbours[uiArrayAddr] = dir; 6328 5099 abCandIsInter[uiArrayAddr] = true; 6329 #if H_3D_NBDV6330 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);6331 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);6332 #endif6333 5100 if ( mrgCandIdx == iCount ) 6334 5101 { … … 6348 5115 if ( getSlice()->isInterB()) 6349 5116 { 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 5117 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 6355 5118 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 6356 #endif6357 5119 6358 5120 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 6359 5121 { 6360 5122 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 5123 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 6376 #endif6377 5124 { 6378 5125 abCandIsInter[uiArrayAddr] = true; … … 6429 5176 numValidMergeCand = uiArrayAddr; 6430 5177 } 6431 6432 6433 5178 #endif 6434 5179 … … 6770 5515 } 6771 5516 6772 #if LGE_IC_CTX_F01605517 #if H_3D_IC 6773 5518 Bool TComDataCU::isIC( UInt uiPartIdx ) 6774 5519 { … … 8639 7384 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; } 8640 7385 } 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 7386 #endif 9270 7387 -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComDataCU.h
r724 r764 212 212 #if H_3D_DIM_DMM 213 213 UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; 214 #if !SEC_DMM3_RBC_F0147215 UInt* m_dmm3IntraTabIdx;216 #endif217 #endif218 #if H_3D_DIM_RBC219 UChar* m_pucEdgeCode; ///< array of edge code220 UChar* m_pucEdgeNumber; ///< total number of edge221 UChar* m_pucEdgeStartPos; ///< starting point position222 Bool* m_pbEdgeLeftFirst; ///< true if edge should be checked in left boundary first223 Bool* m_pbEdgePartition; ///< true if it belongs to region 1, otherwise, region 0224 214 #endif 225 215 #if H_3D_DIM_SDC … … 233 223 UChar* m_pucInterSDCMask; 234 224 #endif 235 #if ETRIKHU_MERGE_REUSE_F0093225 #if H_3D 236 226 Bool m_bAvailableFlagA1; ///< A1 available flag 237 227 Bool m_bAvailableFlagB1; ///< B1 available flag … … 256 246 UInt* m_sliceSegmentStartCU; ///< Start CU address of current slice 257 247 Char m_codedQP; 258 #if ETRIKHU_MERGE_REUSE_F0093248 #if H_3D 259 249 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing 260 250 #endif … … 266 256 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 267 257 #if H_3D_VSP 268 #if ETRIKHU_MERGE_REUSE_F0093269 258 Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 270 259 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo); 271 #else272 Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,273 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag );274 #endif275 260 #endif 276 261 #if H_3D_IV_MERGE 277 #if ETRIKHU_MERGE_REUSE_F0093278 262 Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, 279 263 Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ); 280 #else281 Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,282 Int* ivCandRefIdx, Int posIvDC, Int* vspFlag );283 #endif284 264 Bool xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand ); 285 265 #endif … … 519 499 ); 520 500 521 #if ETRIKHU_MERGE_REUSE_F0093501 #if H_3D 522 502 Void rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo* inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV); 523 503 #endif … … 584 564 Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); 585 565 586 #if !SEC_DMM3_RBC_F0147587 UInt* getDmm3IntraTabIdx () { return m_dmm3IntraTabIdx; }588 UInt getDmm3IntraTabIdx ( UInt uiIdx ) { return m_dmm3IntraTabIdx[uiIdx]; }589 Void setDmm3IntraTabIdx ( UInt uiIdx, UInt uh ) { m_dmm3IntraTabIdx[uiIdx] = uh; }590 Void setDmm3IntraTabIdxSubParts ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );591 #endif592 #endif593 #if H_3D_DIM_RBC594 UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * RBC_MAX_EDGE_NUM_PER_4x4]; }595 596 UChar* getEdgeNumber( ) { return m_pucEdgeNumber; }597 UChar getEdgeNumber( UInt uiIdx ) { return m_pucEdgeNumber[uiIdx]; }598 Void setEdgeNumber( UInt uiIdx, UChar val ) { m_pucEdgeNumber[uiIdx] = val; }599 600 UChar* getEdgeStartPos( ) { return m_pucEdgeStartPos; }601 UChar getEdgeStartPos( UInt uiIdx ) { return m_pucEdgeStartPos[uiIdx]; }602 Void setEdgeStartPos( UInt uiIdx, UChar val ) { m_pucEdgeStartPos[uiIdx] = val; }603 604 Bool* getEdgeLeftFirst( ) { return m_pbEdgeLeftFirst; }605 Bool getEdgeLeftFirst( UInt uiIdx ) { return m_pbEdgeLeftFirst[uiIdx]; }606 Void setEdgeLeftFirst( UInt uiIdx, Bool val ) { m_pbEdgeLeftFirst[uiIdx] = val; }607 608 Bool* getEdgePartition( UInt uiIdx ) { return &m_pbEdgePartition[uiIdx * 16]; }609 610 Void reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion );611 566 #endif 612 567 #if H_3D_DIM_SDC … … 704 659 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 705 660 706 #if ETRIKHU_MERGE_REUSE_F0093661 #if H_3D 707 662 Bool getAvailableFlagA1() { return m_bAvailableFlagA1;} 708 663 Bool getAvailableFlagB1() { return m_bAvailableFlagB1;} … … 753 708 Bool isBipredRestriction( UInt puIdx ); 754 709 755 #if LGE_IC_CTX_F0160710 #if H_3D_IC 756 711 Bool isIC ( UInt uiPartIdx ); 757 712 #endif -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r758 r764 425 425 Bool dimDeltaDC = isDimDeltaDC( uiIntraMode ); 426 426 Bool isDmmMode = (dimType < DMM_NUM_TYPE); 427 #if !SEC_DMM3_RBC_F0147428 Bool isRbcMode = (dimType == RBC_IDX);429 #endif430 427 431 428 Bool* biSegPattern = NULL; … … 443 440 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]); 444 441 } break; 445 #if !SEC_DMM3_RBC_F0147446 case( DMM3_IDX ):447 {448 UInt uiTabIdx = 0;449 if( bFastEnc ) { uiTabIdx = pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ); }450 else451 {452 uiTabIdx = xPredWedgeFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, pcCU->getDmm3IntraTabIdx( uiAbsPartIdx ) );453 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, uiAbsPartIdx, (pcCU->getDepth(0) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1)) );454 }455 dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);456 } break;457 #endif458 442 case( DMM4_IDX ): 459 443 { … … 468 452 } 469 453 #endif 470 #if H_3D_DIM_RBC471 if( isRbcMode )472 {473 biSegPattern = pcCU->getEdgePartition( uiAbsPartIdx );474 patternStride = iWidth;475 }476 #endif477 454 478 455 // get predicted partition values 479 456 assert( biSegPattern ); 480 457 Int* piMask = NULL; 481 #if QC_DIM_DELTADC_UNIFY_F0132 || HHI_DIM_PREDSAMP_FIX_F0171482 458 piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering 483 #else484 if( isDmmMode ) piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); // no filtering for DMM485 else piMask = pcCU->getPattern()->getPredictorPtr( 0, g_aucConvertToBit[ iWidth ] + 2, m_piYuvExt );486 #endif487 459 assert( piMask ); 488 460 Int maskStride = 2*iWidth + 1; … … 499 471 Pel deltaDC2 = pcCU->getDimDeltaDC( dimType, 1, uiAbsPartIdx ); 500 472 #if H_3D_DIM_DMM 501 #if QC_DIM_DELTADC_UNIFY_F0132 && !SEC_DMM3_RBC_F0147502 if( isDmmMode || isRbcMode)503 #else504 473 if( isDmmMode ) 505 #endif506 474 { 507 475 #if H_3D_DIM_DLT 508 #if DLT_DIFF_CODING_IN_PPS509 476 segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 ); 510 477 segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 ); 511 478 #else 512 segDC1 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );513 segDC2 = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );514 #endif515 #else516 479 segDC1 = ClipY( predDC1 + deltaDC1 ); 517 480 segDC2 = ClipY( predDC2 + deltaDC2 ); 518 481 #endif 519 }520 #endif521 #if H_3D_DIM_RBC && !QC_DIM_DELTADC_UNIFY_F0132522 if( isRbcMode )523 {524 xDeltaDCQuantScaleUp( pcCU, deltaDC1 );525 xDeltaDCQuantScaleUp( pcCU, deltaDC2 );526 segDC1 = ClipY( predDC1 + deltaDC1 );527 segDC2 = ClipY( predDC2 + deltaDC2 );528 482 } 529 483 #endif … … 2564 2518 2565 2519 #if H_3D_DIM_DMM 2566 #if !SEC_DMM3_RBC_F01472567 UInt TComPrediction::xPredWedgeFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt intraTabIdx )2568 {2569 TComPic* pcPicTex = pcCU->getSlice()->getTexturePic();2570 assert( pcPicTex != NULL );2571 TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr());2572 UInt uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;2573 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255;2574 2575 assert( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 );2576 return g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]][uiColTexIntraDir-2].at(intraTabIdx);2577 }2578 #endif2579 2520 2580 2521 Void TComPrediction::xPredContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge ) … … 2628 2569 #endif 2629 2570 2630 #if H_3D_DIM_RBC 2631 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Pel& rDeltaDC ) 2632 { 2633 Int iSign = rDeltaDC < 0 ? -1 : 1; 2634 UInt uiAbs = abs( rDeltaDC ); 2635 2636 Int iQp = pcCU->getQP(0); 2637 Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) ); 2638 Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) ); 2639 2640 rDeltaDC = iSign * roftoi( uiAbs * dStepSize ); 2641 return; 2642 } 2643 2644 Void TComPrediction::xDeltaDCQuantScaleDown( TComDataCU* pcCU, Pel& rDeltaDC ) 2645 { 2646 Int iSign = rDeltaDC < 0 ? -1 : 1; 2647 UInt uiAbs = abs( rDeltaDC ); 2648 2649 Int iQp = pcCU->getQP(0); 2650 Double dMax = (Double)( 1<<( g_bitDepthY - 1 ) ); 2651 Double dStepSize = Clip3( 1.0, dMax, pow( 2.0, iQp/10.0 - 2.0 ) ); 2652 2653 rDeltaDC = iSign * roftoi( uiAbs / dStepSize ); 2654 return; 2655 } 2656 #endif 2571 2657 2572 #if H_3D_DIM_SDC 2658 2573 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComPrediction.h
r724 r764 155 155 Void xCopyTextureLumaBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight ); 156 156 #endif 157 #if H_3D_DIM_RBC158 Void xDeltaDCQuantScaleUp ( TComDataCU* pcCU, Pel& rDeltaDC );159 Void xDeltaDCQuantScaleDown ( TComDataCU* pcCU, Pel& rDeltaDC );160 #endif161 157 #endif 162 158 -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.cpp
r738 r764 612 612 std::vector< std::vector<TComWedgeRef> > g_dmmWedgeRefLists; 613 613 std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists; 614 #if !SEC_DMM3_RBC_F0147615 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;616 #endif617 614 618 615 Void initWedgeLists( Bool initNodeList ) … … 733 730 } 734 731 735 #if !SEC_DMM3_RBC_F0147 736 UInt uiThrSz = DMM3_SIMPLIFY_TR; 737 std::vector< std::vector<UInt> > auiWdgListSz; 738 for( Int idxM=2; idxM<=34 ; idxM++) 739 { 740 std::vector<UInt> auiWdgList; 741 for( Int idxW=0; idxW<racWedgeList.size(); idxW++) 742 { 743 UInt uiAbsDiff = abs(idxM-(Int)racWedgeList[idxW].getAng()); 744 if( uiAbsDiff <= uiThrSz ) 745 { 746 auiWdgList.push_back(idxW); 747 } 748 } 749 auiWdgListSz.push_back(auiWdgList); 750 } 751 g_aauiWdgLstM3.push_back(auiWdgListSz); 752 #endif 732 753 733 } 754 734 -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComRom.h
r738 r764 172 172 extern std::vector< std::vector<TComWedgeRef> > g_dmmWedgeRefLists; 173 173 extern std::vector< std::vector<TComWedgeNode> > g_dmmWedgeNodeLists; 174 #if !SEC_DMM3_RBC_F0147175 extern std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3;176 #endif177 174 178 175 Void initWedgeLists( Bool initNodeList = false ); -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TComWedgelet.h
r724 r764 50 50 enum DIM_IDX 51 51 { 52 #if SEC_DMM3_RBC_F014753 52 DMM1_IDX = 0, 54 53 DMM4_IDX = 1, 55 #else56 DMM1_IDX = 0,57 DMM3_IDX = 1,58 DMM4_IDX = 2,59 RBC_IDX = 360 #endif61 54 }; 62 55 63 #if SEC_DMM3_RBC_F014764 56 #define DMM_NUM_TYPE 2 65 57 #define DIM_NUM_TYPE (DMM_NUM_TYPE) 66 #else67 #define DMM_NUM_TYPE 368 #define RBC_NUM_TYPE 169 #define DIM_NUM_TYPE (DMM_NUM_TYPE+RBC_NUM_TYPE)70 #endif71 58 #define DIM_NO_IDX MAX_UINT 72 59 … … 76 63 #endif 77 64 78 #if H_3D_DIM_RBC79 #define RBC_THRESHOLD 2080 #define RBC_MAX_EDGE_NUM_PER_4x4 881 #define RBC_MAX_DISTANCE 25582 #endif83 84 65 #if H_3D_DIM_DMM 85 66 #define DMM_NO_WEDGEINDEX MAX_UINT 86 67 #define DMM_NUM_WEDGE_REFINES 8 87 #if !SEC_DMM3_RBC_F014788 #define DMM3_SIMPLIFY_TR 189 #endif90 68 91 69 enum WedgeResolution -
branches/HTM-9.2-dev0/source/Lib/TLibCommon/TypeDef.h
r762 r764 104 104 // SHARP_ILLUCOMP_REFINE_E0046 105 105 // MTK_CLIPPING_ALIGN_IC_E0168 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 106 // LGE_IC_CTX_F0160 //JCT3V-F0160 107 // SEC_ONLY_TEXTURE_IC_F0151 106 108 107 109 #if H_3D_NBDV … … 134 136 // TEXTURE MERGING CANDIDATE , JCT3V-C0137 135 137 // QC_INRIA_MTK_MRG_E0126 138 // ETRIKHU_MERGE_REUSE_F0093 136 139 137 140 … … 160 163 // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC 161 164 // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1 Removal of overlap between DMM3 and DMM1 165 // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159 166 // HHI_DIM_PREDSAMP_FIX_F0171 167 // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs 168 // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes 162 169 163 170 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding … … 317 324 318 325 #define FIX_MISSING_MACRO_R690 1 // Missing macro in integration to revision 690 319 320 326 #define SEC_MPI_ENABLING_MERGE_F0150 1 // MPI flag in VPS and enabling in Merge mode 321 #define ETRIKHU_MERGE_REUSE_F0093 1 // Reuse HEVC merge candidate list construction for base candidates, JCT3V-F0093322 327 323 328 #if H_3D_ARP … … 340 345 #define MTK_VSP_SIMPLIFICATION_F0111 1 // 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss 341 346 #define LGE_SHARP_VSP_INHERIT_F0104 1 342 #endif343 344 #define LGE_BUGFIX_F0158 1 //JCT3V-F0158345 #define LGE_IC_CTX_F0160 1 //JCT3V-F0160346 #define SEC_ONLY_TEXTURE_IC_F0151 1347 348 #if H_3D_DIM349 #define SEC_DMM3_RBC_F0147 1 // Removal of DMM3 and RBC from DMMs350 #if !SEC_DMM3_RBC_F0147351 #define H_3D_DIM_RBC 1 // Region Boundary Chain mode352 #endif353 #define QC_DIM_DELTADC_UNIFY_F0132 1 // Unify delta DC coding in depth intra modes354 #define HHI_DIM_PREDSAMP_FIX_F0171 1355 #define LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 1 //JCT3V-F0159356 347 #endif 357 348 #endif -
branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r758 r764 2550 2550 } 2551 2551 #if H_3D_IC 2552 #if SEC_ONLY_TEXTURE_IC_F01512553 2552 else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth()) 2554 #else2555 else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) )2556 #endif2557 2553 { 2558 2554 UInt uiCodeTmp = 0; -
branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r758 r764 390 390 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 391 391 392 #if LGE_SHARP_VSP_INHERIT_F0104393 392 #if H_3D_IC 394 393 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 396 395 #if H_3D_ARP 397 396 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 398 #endif399 397 #endif 400 398 … … 411 409 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 412 410 #endif 413 #if ETRIKHU_MERGE_REUSE_F0093414 411 m_ppcCU[uiDepth]->initAvailableFlags(); 415 412 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); … … 419 416 #endif 420 417 , numValidMergeCand, uiMergeIndex ); 421 #else422 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex );423 #endif424 418 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 425 419 #else 426 #if ETRIKHU_MERGE_REUSE_F0093420 #if H_3D 427 421 m_ppcCU[uiDepth]->initAvailableFlags(); 428 422 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); … … 496 490 #endif 497 491 #endif 498 #if !LGE_SHARP_VSP_INHERIT_F0104499 #if H_3D_IC500 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );501 #endif502 #if H_3D_ARP503 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );504 #endif505 #endif506 492 507 493 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); … … 534 520 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 535 521 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 536 #if !LGE_SHARP_VSP_INHERIT_F0104537 #if H_3D_IC538 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );539 #endif540 #if H_3D_ARP541 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth );542 #endif543 #endif544 522 #if H_3D_INTER_SDC 545 523 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 780 758 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 781 759 { 782 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159760 #if H_3D 783 761 #if DLT_DIFF_CODING_IN_PPS 784 762 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) … … 797 775 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); 798 776 } 799 #else800 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] );801 777 #endif 802 778 pRecIPred[ uiX ] = pReco[ uiX ]; -
branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r735 r764 111 111 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 112 112 113 #if SEC_ONLY_TEXTURE_IC_F0151114 113 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 115 #else116 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )117 #endif118 114 { 119 115 return; … … 245 241 decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth ); 246 242 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 247 #if LGE_SHARP_VSP_INHERIT_F0104248 243 #if H_3D_IC 249 244 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 251 246 #if H_3D_ARP 252 247 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 253 #endif254 248 #endif 255 249 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) … … 265 259 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 266 260 #endif 267 #if ETRIKHU_MERGE_REUSE_F0093268 261 pcSubCU->initAvailableFlags(); 269 262 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); … … 273 266 #endif 274 267 , numValidMergeCand ); 275 #else276 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );277 #endif278 268 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 279 269 … … 283 273 } 284 274 #else 285 #if ETRIKHU_MERGE_REUSE_F0093275 #if H_3D 286 276 pcSubCU->initAvailableFlags(); 287 277 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); … … 306 296 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 307 297 #endif 308 #if ETRIKHU_MERGE_REUSE_F0093309 298 pcSubCU->initAvailableFlags(); 310 299 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); … … 314 303 #endif 315 304 ,numValidMergeCand, uiMergeIndex ); 316 #else317 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex );318 #endif319 305 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 320 306 if(vspFlag[uiMergeIndex]) … … 323 309 } 324 310 #else 325 #if ETRIKHU_MERGE_REUSE_F0093311 #if H_3D 326 312 pcSubCU->initAvailableFlags(); 327 313 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); … … 381 367 } 382 368 } 383 #if LGE_SHARP_VSP_INHERIT_F0104384 369 #if H_3D_IC 385 370 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 387 372 #if H_3D_ARP 388 373 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 389 #endif390 374 #endif 391 375 } -
branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r758 r764 89 89 #if H_3D_DIM_DMM 90 90 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #if !SEC_DMM3_RBC_F014792 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)93 #endif94 #endif95 #if H_3D_DIM_RBC96 , m_cRbcDataSCModel ( 1, 1, NUM_RBC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)97 91 #endif 98 92 #if H_3D_DIM_SDC … … 178 172 #if H_3D_DIM_DMM 179 173 m_cDmm1DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM1_DATA ); 180 #if !SEC_DMM3_RBC_F0147181 m_cDmm3DataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM3_DATA );182 #endif183 #endif184 #if H_3D_DIM_RBC185 m_cRbcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_RBC_DATA );186 174 #endif 187 175 #if H_3D_DIM_SDC … … 253 241 #if H_3D_DIM_DMM 254 242 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 255 #if !SEC_DMM3_RBC_F0147256 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );257 #endif258 #endif259 #if H_3D_DIM_RBC260 m_cRbcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );261 243 #endif 262 244 #if H_3D_DIM_SDC … … 414 396 } 415 397 416 #if QC_DIM_DELTADC_UNIFY_F0132417 398 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt uiNumSeg ) 418 399 { … … 431 412 } 432 413 } 433 #else 434 Void TDecSbac::xParseDimDeltaDC( Pel& rValDeltaDC, UInt dimType ) 435 { 436 UInt absValDeltaDC = 0; 437 xReadExGolombLevel( absValDeltaDC, m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) ); 438 rValDeltaDC = (Pel)absValDeltaDC; 439 440 if( rValDeltaDC != 0 ) 441 { 442 UInt uiSign; 443 m_pcTDecBinIf->decodeBinEP( uiSign ); 444 if ( uiSign ) 445 { 446 rValDeltaDC = -rValDeltaDC; 447 } 448 } 449 } 450 #endif 414 451 415 452 416 #if H_3D_DIM_DMM … … 461 425 ruiTabIdx = uiIdx; 462 426 } 463 #if !SEC_DMM3_RBC_F0147 464 Void TDecSbac::xParseDmm3WedgeIdx( UInt& ruiIntraIdx, Int iNumBit ) 465 { 466 UInt uiSymbol, uiIdx = 0; 467 for( Int i = 0; i < iNumBit; i++ ) 468 { 469 m_pcTDecBinIf->decodeBin( uiSymbol, m_cDmm3DataSCModel.get(0, 0, 0) ); 470 uiIdx += uiSymbol << i; 471 } 472 ruiIntraIdx = uiIdx; 473 } 474 #endif 475 #endif 476 #if H_3D_DIM_RBC 477 Void TDecSbac::xParseRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 478 { 479 UInt uiSymbol = 0; 480 481 // 1. Top(0) or Left(1) 482 UChar ucLeft; 483 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 484 ucLeft = uiSymbol; 485 486 // 2. Start position (lowest bit first) 487 UChar ucStart = 0; 488 for( UInt ui = 0; ui < 6 - uiDepth; ui++ ) 489 { 490 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 491 ucStart |= (uiSymbol << ui); 492 } 493 494 // 3. Number of edges 495 UChar ucMax = 0; 496 for( UInt ui = 0; ui < 7 - uiDepth; ui++ ) 497 { 498 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 499 ucMax |= (uiSymbol << ui); 500 } 501 ucMax++; // +1 502 503 // 4. Edges 504 UChar* pucSymbolList = (UChar*) xMalloc( UChar, 256 * RBC_MAX_EDGE_NUM_PER_4x4 ); 505 for( Int iPtr = 0; iPtr < ucMax; iPtr++ ) 506 { 507 UChar ucEdge = 0; 508 UInt uiReorderEdge = 0; 509 for( UInt ui = 0; ui < 6; ui++ ) 510 { 511 m_pcTDecBinIf->decodeBin( uiSymbol, m_cRbcDataSCModel.get( 0, 0, 0 ) ); 512 ucEdge <<= 1; 513 ucEdge |= uiSymbol; 514 if( uiSymbol == 0 ) 515 break; 516 } 517 518 switch( ucEdge ) 519 { 520 case 0 : // "0" 521 uiReorderEdge = 0; 522 break; 523 case 2 : // "10" 524 uiReorderEdge = 1; 525 break; 526 case 6 : // "110" 527 uiReorderEdge = 2; 528 break; 529 case 14 : // "1110" 530 uiReorderEdge = 3; 531 break; 532 case 30 : // "11110" 533 uiReorderEdge = 4; 534 break; 535 case 62 : // "111110" 536 uiReorderEdge = 5; 537 break; 538 case 63 : // "111111" 539 uiReorderEdge = 6; 540 break; 541 default : 542 printf("parseIntraEdgeChain: error (unknown code %d)\n",ucEdge); 543 assert(false); 544 break; 545 } 546 pucSymbolList[iPtr] = uiReorderEdge; 547 } 548 ///////////////////// 549 // Edge Reconstruction 550 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPartIdx ); 551 pcCU->reconPartition( uiAbsPartIdx, uiDepth, ucLeft == 1, ucStart, ucMax, pucSymbolList, pbRegion ); 552 xFree( pucSymbolList ); 553 } 554 #endif 427 #endif 428 555 429 #if H_3D_DIM_SDC 556 430 Void TDecSbac::xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) … … 1175 1049 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dimType, absPartIdx, depth ); 1176 1050 } break; 1177 #if !SEC_DMM3_RBC_F01471178 case( DMM3_IDX ):1179 {1180 UInt uiIntraIdx = 0;1181 xParseDmm3WedgeIdx( uiIntraIdx, g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );1182 pcCU->setDmm3IntraTabIdxSubParts( uiIntraIdx, absPartIdx, depth );1183 } break;1184 #endif1185 1051 case( DMM4_IDX ): break; 1186 1052 #endif 1187 #if H_3D_DIM_RBC1188 case( RBC_IDX ):1189 {1190 xParseRbcEdge( pcCU, absPartIdx, depth );1191 } break;1192 #endif1193 1053 default: break; 1194 1054 } 1195 1055 1196 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132 1197 if( pcCU->getSDCFlag(absPartIdx) ) 1198 { 1199 assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N); 1200 pcCU->setTrIdxSubParts(0, absPartIdx, depth); 1201 pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth); 1202 1203 UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2; 1204 for (UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++) 1205 { 1206 xParseSDCResidualData(pcCU, absPartIdx, depth, uiSeg); 1207 } 1208 } 1209 else 1210 { 1211 #endif 1212 #if QC_DIM_DELTADC_UNIFY_F0132 1213 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1214 #else 1215 if( dimType < DIM_NUM_TYPE ) 1216 #endif 1217 { 1218 UInt symbol; 1219 #if QC_DIM_DELTADC_UNIFY_F0132 1220 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1056 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1057 { 1058 UInt symbol; 1059 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1060 1061 if( pcCU->getSDCFlag( absPartIdx ) ) 1062 { 1063 assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N); 1064 pcCU->setTrIdxSubParts(0, absPartIdx, depth); 1065 pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth); 1066 } 1067 1068 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) ); 1069 1070 if( symbol ) 1071 { 1072 if( !pcCU->getSDCFlag( absPartIdx ) ) 1073 { 1074 dir += symbol; 1075 } 1076 } 1077 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 1078 { 1079 Pel valDeltaDC = 0; 1080 if( symbol ) 1081 { 1082 xParseDimDeltaDC( valDeltaDC, uiNumSegments ); 1083 } 1221 1084 1222 1085 if( pcCU->getSDCFlag( absPartIdx ) ) 1223 1086 { 1224 assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N); 1225 pcCU->setTrIdxSubParts(0, absPartIdx, depth); 1226 pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth); 1227 } 1228 1229 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) ); 1230 1231 if( symbol ) 1232 { 1233 if( !pcCU->getSDCFlag( absPartIdx ) ) 1234 { 1235 dir += symbol; 1236 } 1237 } 1238 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 1239 { 1240 Pel valDeltaDC = 0; 1241 if( symbol ) 1242 { 1243 xParseDimDeltaDC( valDeltaDC, uiNumSegments ); 1244 } 1245 1246 if( pcCU->getSDCFlag( absPartIdx ) ) 1247 { 1248 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 1249 } 1250 else 1251 { 1252 pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC ); 1253 } 1254 } 1255 #else 1256 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) ); 1257 if( symbol ) 1258 { 1259 dir += symbol; 1260 for( UInt segment = 0; segment < 2; segment++ ) 1261 { 1262 Pel valDeltaDC = 0; 1263 xParseDimDeltaDC( valDeltaDC, dimType ); 1264 pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC ); 1265 } 1266 } 1267 #endif 1268 } 1269 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132 1270 } 1271 #endif 1087 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 1088 } 1089 else 1090 { 1091 pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC ); 1092 } 1093 } 1094 } 1272 1095 1273 1096 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); … … 1297 1120 else if( puIdx == 0 ) 1298 1121 { 1299 #if SEC_DMM3_RBC_F01471300 1122 while( binNum < 1 && symbol ) 1301 #else1302 while( binNum < 3 && symbol )1303 #endif1304 1123 { 1305 1124 ctxDepthMode = puIdx*3 + ((binNum >= 2) ? 2 : binNum); … … 1308 1127 binNum++; 1309 1128 } 1310 #if SEC_DMM3_RBC_F0147 1311 if( modeCode == 0 ) { dir = 0; sdcFlag = 0;} 1312 else if( modeCode == 1 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1313 #else 1314 if( modeCode == 0 ) { dir = 0; sdcFlag = 0;} 1315 else if( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1316 else if( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1317 else if( modeCode == 7 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1318 #endif 1129 if( modeCode == 0 ) 1130 { 1131 dir = 0; 1132 sdcFlag = 0; 1133 } 1134 else if ( modeCode == 1 ) 1135 { 1136 dir = (2*DMM1_IDX+DIM_OFFSET); 1137 sdcFlag = 0; 1138 } 1319 1139 } 1320 1140 else 1321 1141 { 1322 #if SEC_DMM3_RBC_F01471323 1142 while( binNum < 4 && symbol ) 1324 1143 { … … 1333 1152 else if ( modeCode == 14 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1334 1153 else if ( modeCode == 15 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1335 #else 1336 UInt maxBinNum = 0; 1337 m_pcTDecBinIf->decodeBinEP(symbol); 1338 if( symbol == 1 ) 1339 { 1340 maxBinNum = 3; 1341 } 1342 else 1343 { 1344 maxBinNum = 2; 1345 symbol = 1; 1346 } 1347 while( binNum<maxBinNum && symbol ) 1348 { 1349 ctxDepthMode = puIdx*3 + ( binNum >= 2 ? 2 : binNum ); 1350 m_pcTDecBinIf->decodeBin(symbol,m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode)); 1351 modeCode = (modeCode<<1)+symbol; 1352 binNum++; 1353 } 1354 if( maxBinNum == 3 ) 1355 { 1356 if ( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;} 1357 else if ( modeCode == 2 ) { dir = (2* RBC_IDX+DIM_OFFSET); sdcFlag = 0;} 1358 else if ( modeCode == 6 ) { dir = (2*DMM3_IDX+DIM_OFFSET); sdcFlag = 0;} 1359 else if ( modeCode == 7 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;} 1360 } 1361 else 1362 { 1363 if ( modeCode == 0 ) { dir = 5; sdcFlag = 0;} 1364 else if ( modeCode == 2 ) { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;} 1365 else if ( modeCode == 3 ) { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;} 1366 } 1367 #endif 1154 1368 1155 } 1369 1156 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); -
branches/HTM-9.2-dev0/source/Lib/TLibDecoder/TDecSbac.h
r758 r764 103 103 #if H_3D_DIM 104 104 Void xReadExGolombLevel ( UInt& ruiSymbol, ContextModel& rcSCModel ); 105 #if QC_DIM_DELTADC_UNIFY_F0132106 105 Void xParseDimDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg ); 107 #else108 Void xParseDimDeltaDC ( Pel& rValDeltaDC, UInt dimType );109 #endif110 106 #if H_3D_DIM_DMM 111 107 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 112 #if !SEC_DMM3_RBC_F0147113 Void xParseDmm3WedgeIdx ( UInt& ruiIntraIdx, Int iNumBit );114 #endif115 #endif116 #if H_3D_DIM_RBC117 Void xParseRbcEdge ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );118 108 #endif 119 109 #if H_3D_DIM_SDC … … 223 213 #if H_3D_DIM_DMM 224 214 ContextModel3DBuffer m_cDmm1DataSCModel; 225 #if !SEC_DMM3_RBC_F0147226 ContextModel3DBuffer m_cDmm3DataSCModel;227 #endif228 #endif229 #if H_3D_DIM_RBC230 ContextModel3DBuffer m_cRbcDataSCModel;231 215 #endif 232 216 #if H_3D_DIM_SDC -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r763 r764 2124 2124 } 2125 2125 #if H_3D_IC 2126 #if SEC_ONLY_TEXTURE_IC_F01512127 2126 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth()) 2128 #else2129 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) )2130 #endif2131 2127 { 2132 2128 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" ); -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCfg.h
r758 r764 420 420 #if H_3D_DIM 421 421 Bool m_useDMM; 422 #if !SEC_DMM3_RBC_F0147423 Bool m_useRBC;424 #endif425 422 Bool m_useSDC; 426 423 Bool m_useDLT; … … 1003 1000 Bool getUseDMM () { return m_useDMM; } 1004 1001 Void setUseDMM ( Bool b) { m_useDMM = b; } 1005 #if !SEC_DMM3_RBC_F01471006 Bool getUseRBC () { return m_useRBC; }1007 Void setUseRBC ( Bool b) { m_useRBC = b; }1008 #endif1009 1002 Bool getUseSDC () { return m_useSDC; } 1010 1003 Void setUseSDC ( Bool b) { m_useSDC = b; } -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r735 r764 497 497 #endif 498 498 #if H_3D_IC 499 #if SEC_ONLY_TEXTURE_IC_F0151500 499 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE ) && !rpcTempCU->getSlice()->getIsDepth(); 501 #else502 Bool bICEnabled = rpcTempCU->getSlice()->getViewIndex() && ( rpcTempCU->getSlice()->getSliceType() == P_SLICE || rpcTempCU->getSlice()->getSliceType() == B_SLICE );503 #endif504 500 bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC(); 505 501 #endif … … 1779 1775 #endif 1780 1776 1781 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F01041777 #if H_3D_ARP 1782 1778 DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0); 1783 1779 #else … … 1787 1783 1788 1784 #if H_3D_VSP 1789 #if ! (H_3D_ARP && LGE_SHARP_VSP_INHERIT_F0104)1785 #if !H_3D_ARP 1790 1786 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 1791 1787 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1792 1788 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1793 #if ETRIKHU_MERGE_REUSE_F00931794 1789 rpcTempCU->m_bAvailableFlagA1 = 0; 1795 1790 rpcTempCU->m_bAvailableFlagB1 = 0; … … 1799 1794 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1800 1795 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand ); 1801 #else 1802 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 1803 #endif 1804 #endif 1805 #else 1806 #if ETRIKHU_MERGE_REUSE_F0093 1796 #endif 1797 #else 1807 1798 rpcTempCU->m_bAvailableFlagA1 = 0; 1808 1799 rpcTempCU->m_bAvailableFlagB1 = 0; … … 1812 1803 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1813 1804 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1814 #else1815 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );1816 #endif1817 1805 #endif 1818 1806 … … 1822 1810 Int mergeCandBuffer[MRG_MAX_NUM_CANDS]; 1823 1811 #endif 1824 #if H_3D_ARP && LGE_SHARP_VSP_INHERIT_F01041812 #if H_3D_ARP 1825 1813 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui ) 1826 1814 #else … … 1856 1844 memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS*sizeof(Int) ); 1857 1845 #endif 1858 #if LGE_SHARP_VSP_INHERIT_F01041859 1846 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1860 1847 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth ); … … 1876 1863 puhInterDirSP = new UChar[rpcTempCU->getPic()->getPicSym()->getNumPartition()]; 1877 1864 #endif 1878 #if ETRIKHU_MERGE_REUSE_F00931865 #if H_3D 1879 1866 rpcTempCU->initAvailableFlags(); 1880 1867 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); … … 1888 1875 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 1889 1876 #endif 1890 #endif 1877 1891 1878 #endif 1892 1879 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) … … 1950 1937 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 1951 1938 #if MTK_SPIVMP_F0110 1952 }1953 #endif1954 #if H_3D_ARP && !QC_MTK_INTERVIEW_ARP_F0123_F01081955 if( nARPW )1956 {1957 Bool bSignalflag[2] = { true, true };1958 for( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )1959 {1960 Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx();1961 RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;1962 if( iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx) )1963 {1964 bSignalflag[uiRefListIdx] = false;1965 }1966 }1967 if( !bSignalflag[0] && !bSignalflag[1] )1968 {1969 #if LGE_SHARP_VSP_INHERIT_F01041970 continue;1971 #else1972 rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );1973 #endif1974 }1975 1939 } 1976 1940 #endif -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r724 r764 160 160 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 161 161 { 162 #if SEC_ONLY_TEXTURE_IC_F0151163 162 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() ) 164 #else165 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )166 #endif167 163 { 168 164 return; -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r758 r764 95 95 #if H_3D_DIM_DMM 96 96 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !SEC_DMM3_RBC_F014798 , m_cDmm3DataSCModel ( 1, 1, NUM_DMM3_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)99 #endif100 #endif101 #if H_3D_DIM_RBC102 , m_cRbcDataSCModel ( 1, 1, NUM_RBC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels)103 97 #endif 104 98 #if H_3D_DIM_SDC … … 176 170 #if H_3D_DIM_DMM 177 171 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 178 #if !SEC_DMM3_RBC_F0147179 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );180 #endif181 #endif182 #if H_3D_DIM_RBC183 m_cRbcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );184 172 #endif 185 173 #if H_3D_DIM_SDC … … 266 254 #if H_3D_DIM_DMM 267 255 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); 268 #if !SEC_DMM3_RBC_F0147269 curCost += m_cDmm3DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM3_DATA );270 #endif271 #endif272 #if H_3D_DIM_RBC273 curCost += m_cRbcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_RBC_DATA );274 256 #endif 275 257 } … … 337 319 #if H_3D_DIM_DMM 338 320 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); 339 #if !SEC_DMM3_RBC_F0147340 m_cDmm3DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM3_DATA );341 #endif342 #endif343 #if H_3D_DIM_RBC344 m_cRbcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_RBC_DATA );345 321 #endif 346 322 #if H_3D_DIM_SDC … … 526 502 } 527 503 528 #if QC_DIM_DELTADC_UNIFY_F0132529 504 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg ) 530 505 { … … 536 511 } 537 512 } 538 #else539 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt dimType )540 {541 xWriteExGolombLevel( UInt( abs( valDeltaDC ) ), m_cDdcDataSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) );542 if( valDeltaDC != 0 )543 {544 UInt uiSign = valDeltaDC > 0 ? 0 : 1;545 m_pcBinIf->encodeBinEP( uiSign );546 }547 }548 #endif549 513 550 514 #if H_3D_DIM_DMM … … 557 521 } 558 522 559 #if !SEC_DMM3_RBC_F0147 560 Void TEncSbac::xCodeDmm3WedgeIdx( UInt uiIntraIdx, Int iNumBit ) 561 { 562 for( Int i = 0; i < iNumBit; i++ ) 563 { 564 m_pcBinIf->encodeBin( ( uiIntraIdx >> i ) & 1, m_cDmm3DataSCModel.get(0, 0, 0) ); 565 } 566 } 567 #endif 568 #endif 569 #if H_3D_DIM_RBC 570 Void TEncSbac::xCodeRbcEdge( TComDataCU* pcCU, UInt uiAbsPartIdx ) 571 { 572 UInt uiDepth = pcCU->getDepth( uiAbsPartIdx ) + (pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 1 : 0); 573 UChar* pucSymbolList = pcCU->getEdgeCode ( uiAbsPartIdx ); 574 UChar ucEdgeNumber = pcCU->getEdgeNumber ( uiAbsPartIdx ); 575 Bool bLeft = pcCU->getEdgeLeftFirst( uiAbsPartIdx ); 576 UChar ucStart = pcCU->getEdgeStartPos ( uiAbsPartIdx ); 577 UInt uiSymbol; 578 579 // 1. Top(0) or Left(1) 580 uiSymbol = (bLeft == false) ? 0 : 1; 581 m_pcBinIf->encodeBinEP( uiSymbol ); 582 583 // 2. Start position (lowest bit first) 584 uiSymbol = ucStart; 585 for( UInt ui = 6; ui > uiDepth; ui-- ) // 64(0)->6, 32(1)->5, 16(2)->4, 8(3)->3, 4(4)->2 586 { 587 m_pcBinIf->encodeBinEP( uiSymbol & 0x1 ); 588 uiSymbol >>= 1; 589 } 590 591 // 3. Number of edges 592 uiSymbol = ucEdgeNumber > 0 ? ucEdgeNumber - 1 : 0; 593 for( UInt ui = 7; ui > uiDepth; ui-- ) // 64(0)->7, 32(1)->6, 16(2)->5, 8(3)->4, 4(4)->3 594 { 595 m_pcBinIf->encodeBinEP( uiSymbol & 0x1 ); 596 uiSymbol >>= 1; 597 } 598 599 if(uiSymbol != 0) 600 { 601 printf(" ucEdgeNumber %d at depth %d\n",ucEdgeNumber, uiDepth); 602 assert(false); 603 } 604 605 // 4. Edges 606 for( Int iPtr2 = 0; iPtr2 < ucEdgeNumber; iPtr2++ ) 607 { 608 UInt uiReorderSymbol = pucSymbolList[iPtr2]; 609 for( UInt ui = 0; ui < uiReorderSymbol; ui++ ) 610 { 611 m_pcBinIf->encodeBin( 1, m_cRbcDataSCModel.get( 0, 0, 0 ) ); 612 } 613 614 if( uiReorderSymbol != 6 ) 615 m_pcBinIf->encodeBin( 0, m_cRbcDataSCModel.get( 0, 0, 0 ) ); 616 } 617 } 618 #endif 523 #endif 524 619 525 #if H_3D_DIM_SDC 620 526 Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) … … 1239 1145 xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] ); 1240 1146 } break; 1241 #if !SEC_DMM3_RBC_F01471242 case( DMM3_IDX ):1243 {1244 xCodeDmm3WedgeIdx( pcCU->getDmm3IntraTabIdx( absPartIdx ), g_dmm3IntraTabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );1245 } break;1246 #endif1247 1147 case( DMM4_IDX ): break; 1248 1148 #endif 1249 #if H_3D_DIM_RBC1250 case( RBC_IDX ):1251 {1252 assert( pcCU->getWidth( absPartIdx ) < 64 );1253 xCodeRbcEdge( pcCU, absPartIdx );1254 } break;1255 #endif1256 1149 default: break; 1257 1150 } 1258 1151 1259 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132 1260 if( pcCU->getSDCFlag( absPartIdx ) ) 1261 { 1262 assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N); 1263 UInt uiNumSegments = ( dir == DC_IDX || dir == PLANAR_IDX )? 1 : 2; 1264 for(UInt uiSeg=0; uiSeg<uiNumSegments; uiSeg++) 1265 { 1266 xCodeSDCResidualData(pcCU, absPartIdx, uiSeg); 1267 } 1268 } 1269 else 1270 { 1271 #endif 1272 #if QC_DIM_DELTADC_UNIFY_F0132 1273 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1274 #else 1275 if( dimType < DIM_NUM_TYPE ) 1276 #endif 1277 { 1278 #if QC_DIM_DELTADC_UNIFY_F0132 1279 UInt dimDeltaDC; 1280 Pel deltaDC; 1281 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1282 if( pcCU->getSDCFlag( absPartIdx ) ) 1283 { 1284 if( uiNumSegments==1 ) 1285 { 1286 dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0; 1287 } 1288 else 1289 { 1290 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0; 1291 } 1152 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1153 { 1154 UInt dimDeltaDC; 1155 Pel deltaDC; 1156 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1157 if( pcCU->getSDCFlag( absPartIdx ) ) 1158 { 1159 if( uiNumSegments==1 ) 1160 { 1161 dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0; 1292 1162 } 1293 1163 else 1294 1164 { 1295 dimDeltaDC = isDimDeltaDC( dir ); 1296 } 1297 1298 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) ); 1299 1300 if( dimDeltaDC ) 1301 { 1302 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 1303 { 1304 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx ); 1305 xCodeDimDeltaDC( deltaDC, uiNumSegments ); 1306 } 1307 } 1308 #else 1309 UInt dimDeltaDC = isDimDeltaDC( dir ); 1310 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, (RBC_IDX == dimType) ? 1 : 0) ); 1311 if( dimDeltaDC ) 1312 { 1313 for( UInt segment = 0; segment < 2; segment++ ) 1314 { 1315 xCodeDimDeltaDC( pcCU->getDimDeltaDC( dimType, segment, absPartIdx ), dimType ); 1316 } 1317 } 1318 #endif 1319 } 1320 #if H_3D_DIM_SDC && !QC_DIM_DELTADC_UNIFY_F0132 1321 } 1322 #endif 1165 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0; 1166 } 1167 } 1168 else 1169 { 1170 dimDeltaDC = isDimDeltaDC( dir ); 1171 } 1172 1173 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) ); 1174 1175 if( dimDeltaDC ) 1176 { 1177 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 1178 { 1179 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx ); 1180 xCodeDimDeltaDC( deltaDC, uiNumSegments ); 1181 } 1182 } 1183 } 1323 1184 } 1324 1185 1325 1186 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1326 1187 { 1327 #if SEC_DMM3_RBC_F01471328 1188 UInt codeWordTable[3][7] = {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}}; 1329 1189 UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3, 4, 4, 0, 0},{1, 1, 0, 0, 0, 0, 0}}; 1330 #else1331 UInt codeWordTable[3][7] = {{0, 0, 0, 2, 0,6, 7},{0, 0, 2, 7, 3, 6, 2},{0, 1, 0, 0, 0, 0, 0}};1332 UInt codeWordLenTable[3][7] = {{0, 1, 0, 2, 0,3, 3},{1, 1, 2, 3, 2, 3, 2},{1, 1, 0, 0, 0, 0, 0}};1333 #endif1334 1190 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 1335 1191 UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 ); … … 1346 1202 case DMM1_IDX: codeIdx = 3; break; 1347 1203 case DMM4_IDX: codeIdx = 4; break; 1348 #if !SEC_DMM3_RBC_F01471349 case DMM3_IDX: codeIdx = 5; break;1350 case RBC_IDX: codeIdx = 6; break;1351 #endif1352 1204 default: break; 1353 1205 } … … 1362 1214 default: codeIdx = 2; break; 1363 1215 } 1364 }1365 #endif1366 #if !SEC_DMM3_RBC_F01471367 if( puIdx==1 )1368 {1369 if( codeIdx==1 || codeIdx==2 || codeIdx==4 )1370 {1371 m_pcBinIf->encodeBinEP( 0 );1372 }1373 else1374 {1375 m_pcBinIf->encodeBinEP( 1 );1376 }1377 1216 } 1378 1217 #endif -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSbac.h
r724 r764 116 116 Void xWriteEpExGolomb ( UInt uiSymbol, UInt uiCount ); 117 117 Void xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam ); 118 118 #if H_3D_DIM 119 119 Void xWriteExGolombLevel ( UInt uiSymbol, ContextModel& rcSCModel ); 120 #if QC_DIM_DELTADC_UNIFY_F0132121 120 Void xCodeDimDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); 122 #else123 Void xCodeDimDeltaDC ( Pel valDeltaDC, UInt dimType );124 #endif125 121 #if H_3D_DIM_DMM 126 122 Void xCodeDmm1WedgeIdx ( UInt uiTabIdx, Int iNumBit ); 127 #if !SEC_DMM3_RBC_F0147128 Void xCodeDmm3WedgeIdx ( UInt uiIntraIdx, Int iNumBit );129 #endif130 #endif131 #if H_3D_DIM_RBC132 Void xCodeRbcEdge ( TComDataCU* pcCU, UInt uiAbsPartIdx );133 123 #endif 134 124 #if H_3D_DIM_SDC … … 259 249 #if H_3D_DIM_DMM 260 250 ContextModel3DBuffer m_cDmm1DataSCModel; 261 #if !SEC_DMM3_RBC_F0147262 ContextModel3DBuffer m_cDmm3DataSCModel;263 #endif264 #endif265 #if H_3D_DIM_RBC266 ContextModel3DBuffer m_cRbcDataSCModel;267 251 #endif 268 252 #if H_3D_DIM_SDC -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r758 r764 1124 1124 { 1125 1125 #endif 1126 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1127 { 1128 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 1129 #if DLT_DIFF_CODING_IN_PPS 1130 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 1131 #else 1132 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 1133 #endif 1126 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1127 { 1128 #if H_3D_DIM 1129 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 1134 1130 { 1135 #if DLT_DIFF_CODING_IN_PPS1136 1131 pResi[ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ); 1137 #else1138 pResi[ uiX ] = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pOrg[ uiX ] ) - pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] );1139 #endif1140 1132 } 1141 1133 else 1142 1134 { 1143 1135 pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ]; 1144 1136 } 1145 1137 #else 1146 pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ];1147 #endif 1148 }1149 pOrg += uiStride;1150 pResi += uiStride;1151 pPred += uiStride;1138 pResi[ uiX ] = pOrg[ uiX ] - pPred[ uiX ]; 1139 #endif 1140 } 1141 pOrg += uiStride; 1142 pResi += uiStride; 1143 pPred += uiStride; 1152 1144 #if H_3D_DIM_ENC 1153 1145 } … … 1209 1201 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1210 1202 { 1211 #if LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 1212 #if DLT_DIFF_CODING_IN_PPS 1203 #if H_3D_DIM 1213 1204 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 1214 #else 1215 if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) ) 1216 #endif 1217 { 1218 #if DLT_DIFF_CODING_IN_PPS 1219 pReco [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) ); 1220 #else 1221 pReco [ uiX ] = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getVPS()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) ); 1222 #endif 1223 } 1224 else 1225 { 1226 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); 1227 } 1205 { 1206 pReco [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) ); 1207 } 1208 else 1209 { 1210 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); 1211 } 1228 1212 #else 1229 1213 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); … … 2924 2908 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 2925 2909 } break; 2926 #if !SEC_DMM3_RBC_F0147 2927 case( DMM3_IDX ): 2928 { 2929 2930 TComPic* pcPicTex = pcCU->getSlice()->getTexturePic(); 2931 TComDataCU* pcColTexCU = pcPicTex->getCU( pcCU->getAddr() ); 2932 UInt uiTexPartIdx = pcCU->getZorderIdxInCU() + uiPartOffset; 2933 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255; 2934 2935 if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) 2936 { 2937 UInt uiIntraTabIdx = 0; 2938 xSearchDmm3Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx, uiIntraTabIdx, uiColTexIntraDir ); 2939 pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType, uiPartOffset, uiDepth + uiInitTrDepth ); 2940 pcCU->setDmm3IntraTabIdxSubParts( uiIntraTabIdx, uiPartOffset, uiDepth + uiInitTrDepth ); 2941 biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]); 2942 } 2943 } break; 2944 #endif 2910 2945 2911 case( DMM4_IDX ): 2946 2912 { … … 2968 2934 } 2969 2935 #endif 2970 #if H_3D_DIM_RBC2971 if( m_pcEncCfg->getUseRBC()2972 #if H_3D_FAST_DEPTH_INTRA2973 && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)2974 #endif2975 )2976 {2977 if( xSearchRbcEdge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ) )2978 {2979 Pel deltaDC1 = 0; Pel deltaDC2 = 0;2980 #if QC_DIM_DELTADC_UNIFY_F01322981 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );2982 #else2983 xSearchRbcDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, pcCU->getEdgePartition( uiPartOffset ), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );2984 #endif2985 pcCU->setDimDeltaDC( RBC_IDX, 0, uiPartOffset, deltaDC1 );2986 pcCU->setDimDeltaDC( RBC_IDX, 1, uiPartOffset, deltaDC2 );2987 2988 uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX +DIM_OFFSET);2989 uiRdModeList[ numModesForFullRD++ ] = (2*RBC_IDX+1+DIM_OFFSET);2990 }2991 }2992 #endif2993 2936 } 2994 2937 #endif … … 3029 2972 Bool bTestZeroResi = false; 3030 2973 #if H_3D_DIM_ENC 3031 #if LGE_BUGFIX_F01583032 2974 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP(); 3033 #else3034 bTestZeroResi |= pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->isIRAP();3035 #endif3036 2975 #endif 3037 2976 #if H_3D_DIM_SDC … … 3660 3599 if ( iPUIdx == 0 ) 3661 3600 { 3662 #if ETRIKHU_MERGE_REUSE_F00933601 #if H_3D 3663 3602 pcCU->initAvailableFlags(); 3664 3603 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand); … … 3674 3613 ); 3675 3614 #else 3676 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 3677 #if H_3D_VSP 3678 , vspFlag 3679 , inheritedVSPDisInfo 3680 #endif 3681 , numValidMergeCand 3682 ); 3615 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 3683 3616 #endif 3684 3617 } … … 3687 3620 else 3688 3621 { 3689 #if ETRIKHU_MERGE_REUSE_F00933622 #if H_3D 3690 3623 pcCU->initAvailableFlags(); 3691 3624 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand); … … 3701 3634 ); 3702 3635 #else 3703 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours 3704 #if H_3D_VSP 3705 , vspFlag 3706 , inheritedVSPDisInfo 3707 #endif 3708 , numValidMergeCand 3636 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand 3709 3637 ); 3710 3638 #endif … … 7477 7405 } 7478 7406 7479 #if !SEC_DMM3_RBC_F0147 7480 Void TEncSearch::xSearchDmm3Wedge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir ) 7481 { 7482 ruiTabIdx = 0; 7483 ruiIntraTabIdx = 0; 7484 7485 // local pred buffer 7486 TComYuv cPredYuv; 7487 cPredYuv.create( uiWidth, uiHeight ); 7488 cPredYuv.clear(); 7489 Pel* piPred = cPredYuv.getLumaAddr(); 7490 UInt uiPredStride = cPredYuv.getStride(); 7491 7492 // wedge search 7493 UInt uiBestDist = MAX_UINT; 7494 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 7495 Pel refDC1 = 0; Pel refDC2 = 0; 7496 7497 std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]]; 7498 std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[colTexIntraDir-2]; 7499 for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ ) 7500 { 7501 UInt uiIdx = pauiWdgLst->at(uiIdxW); 7502 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiIdx)); 7503 xCalcBiSegDCs ( piRef, uiRefStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7504 xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 ); 7505 7506 UInt uiActDist = m_pcRdCost->getDistPart( g_bitDepthY, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, TEXT_LUMA, DF_SAD ); 7507 if( uiActDist < uiBestDist || uiBestDist == MAX_UINT ) 7508 { 7509 uiBestDist = uiActDist; 7510 ruiTabIdx = uiIdx; 7511 ruiIntraTabIdx = uiIdxW; 7512 } 7513 } 7514 cPredYuv.destroy(); 7515 } 7516 #endif 7517 #endif 7518 #if H_3D_DIM_RBC 7519 Void TEncSearch::xSearchRbcDeltaDCs( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ) 7520 { 7521 assert( biSegPattern ); 7522 Pel origDC1 = 0; Pel origDC2 = 0; 7523 xCalcBiSegDCs ( piOrig, uiStride, biSegPattern, patternStride, origDC1, origDC2 ); 7524 xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, origDC1, origDC2 ); 7525 7526 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( uiWidth, uiHeight, m_piYuvExt ); // no filtering for DMM 7527 Int maskStride = 2*uiWidth + 1; 7528 Int* ptrSrc = piMask+maskStride+1; 7529 Pel predDC1 = 0; Pel predDC2 = 0; 7530 xPredBiSegDCs( ptrSrc, maskStride, biSegPattern, patternStride, predDC1, predDC2 ); 7531 7532 rDeltaDC1 = origDC1 - predDC1; 7533 rDeltaDC2 = origDC2 - predDC2; 7534 7535 #if H_3D_VSO 7536 if( m_pcRdCost->getUseVSO() ) 7537 { 7538 Pel fullDeltaDC1 = rDeltaDC1; 7539 Pel fullDeltaDC2 = rDeltaDC2; 7540 7541 xDeltaDCQuantScaleDown( pcCU, fullDeltaDC1 ); 7542 xDeltaDCQuantScaleDown( pcCU, fullDeltaDC2 ); 7543 7544 Dist uiBestDist = RDO_DIST_MAX; 7545 UInt uiBestQStepDC1 = 0; 7546 UInt uiBestQStepDC2 = 0; 7547 7548 UInt uiDeltaDC1Max = abs(fullDeltaDC1); 7549 UInt uiDeltaDC2Max = abs(fullDeltaDC2); 7550 7551 //VSO Level delta DC check range extension 7552 uiDeltaDC1Max += (uiDeltaDC1Max>>1); 7553 uiDeltaDC2Max += (uiDeltaDC2Max>>1); 7554 7555 for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++ ) 7556 { 7557 Pel iLevelDeltaDC1 = (Pel)(uiQStepDC1) * (Pel)(( fullDeltaDC1 < 0 ) ? -1 : 1); 7558 xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 ); 7559 Pel testDC1 = ClipY( predDC1 + iLevelDeltaDC1 ); 7560 7561 for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++ ) 7562 { 7563 Pel iLevelDeltaDC2 = (Pel)(uiQStepDC2) * (Pel)(( fullDeltaDC2 < 0 ) ? -1 : 1); 7564 xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 ); 7565 Pel testDC2 = ClipY( predDC2 + iLevelDeltaDC2 ); 7566 7567 xAssignBiSegDCs( piPredic, uiStride, biSegPattern, patternStride, testDC1, testDC2 ); 7568 7569 Dist uiActDist = RDO_DIST_MAX; 7570 if( m_pcRdCost->getUseEstimatedVSD() ) 7571 { 7572 uiActDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7573 } 7574 else 7575 { 7576 uiActDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPtIdx, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false ); 7577 } 7578 7579 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX ) 7580 { 7581 uiBestDist = uiActDist; 7582 uiBestQStepDC1 = uiQStepDC1; 7583 uiBestQStepDC2 = uiQStepDC2; 7584 } 7585 } 7586 } 7587 7588 fullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( fullDeltaDC1 < 0 ) ? -1 : 1); 7589 fullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( fullDeltaDC2 < 0 ) ? -1 : 1); 7590 xDeltaDCQuantScaleUp( pcCU, fullDeltaDC1 ); 7591 xDeltaDCQuantScaleUp( pcCU, fullDeltaDC2 ); 7592 rDeltaDC1 = fullDeltaDC1; 7593 rDeltaDC2 = fullDeltaDC2; 7594 } 7595 #endif 7596 7597 xDeltaDCQuantScaleDown( pcCU, rDeltaDC1 ); 7598 xDeltaDCQuantScaleDown( pcCU, rDeltaDC2 ); 7599 } 7600 7601 Bool TEncSearch::xSearchRbcEdge( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, Int iWidth, Int iHeight ) 7602 { 7603 Bool* pbEdge = (Bool*) xMalloc( Bool, iWidth * iHeight * 4 ); 7604 7605 Short* psDiffX = new Short[ iWidth * iHeight ]; 7606 Short* psDiffY = new Short[ iWidth * iHeight ]; 7607 Bool* pbEdgeX = new Bool [ iWidth * iHeight ]; 7608 Bool* pbEdgeY = new Bool [ iWidth * iHeight ]; 7609 7610 // Find Horizontal Gradient & Edge Detection ((x+1, y) - (x,y)) 7611 for( Int y=0; y<iHeight; y++ ) 7612 { 7613 Short* psDiffXPtr = &psDiffX[ y * iHeight ]; 7614 Bool* pbEdgeXPtr = &pbEdgeX[ y * iHeight ]; 7615 for(Int x=0; x<iWidth-1; x++ ) 7616 { 7617 *psDiffXPtr = piRef[ x+1 + y*uiRefStride ] - piRef[ x + y*uiRefStride ]; 7618 if(*psDiffXPtr >= RBC_THRESHOLD || *psDiffXPtr <= (-1)*RBC_THRESHOLD) 7619 { 7620 *pbEdgeXPtr = true; 7621 } 7622 else 7623 { 7624 *pbEdgeXPtr = false; 7625 } 7626 7627 psDiffXPtr++; 7628 pbEdgeXPtr++; 7629 } 7630 } 7631 7632 // Find Vertical Gradient & Edge Detection((x,y+1) - (x,y)) 7633 for( Int y=0; y<iHeight-1; y++ ) 7634 { 7635 Short* psDiffYPtr = &psDiffY[ y * iHeight ]; 7636 Bool* pbEdgeYPtr = &pbEdgeY[ y * iHeight ]; 7637 for(Int x=0; x<iWidth; x++ ) 7638 { 7639 *psDiffYPtr = piRef[ x + (y+1)*uiRefStride ] - piRef[ x + y*uiRefStride ]; 7640 if(*psDiffYPtr >= RBC_THRESHOLD || *psDiffYPtr <= (-1)*RBC_THRESHOLD) 7641 { 7642 *pbEdgeYPtr = true; 7643 } 7644 else 7645 { 7646 *pbEdgeYPtr = false; 7647 } 7648 7649 psDiffYPtr++; 7650 pbEdgeYPtr++; 7651 } 7652 } 7653 7654 // Eliminate local maximum 7655 for( Int y=0; y<iHeight; y++ ) 7656 { 7657 Short* psDiffXPtr = &psDiffX[ y * iHeight ]; 7658 Bool* pbEdgeXPtr = &pbEdgeX[ y * iHeight ]; 7659 for( Int x=0; x<iWidth-1; x++ ) 7660 { 7661 UShort usAbs0=0, usAbs1=0, usAbs2=0; // 0 : left, 1 : current, 2 : right 7662 7663 if( x > 0 && *(pbEdgeXPtr-1) == true ) 7664 { 7665 if( *(psDiffXPtr-1) >= 0) 7666 { 7667 usAbs0 = *(psDiffXPtr-1); 7668 7669 } 7670 else 7671 { 7672 usAbs0 = (-1) * *(psDiffXPtr-1); 7673 } 7674 } 7675 if( *pbEdgeXPtr == true ) 7676 { 7677 if( *(psDiffXPtr) >= 0) 7678 { 7679 usAbs1 = *(psDiffXPtr); 7680 } 7681 else 7682 { 7683 usAbs1 = (-1) * *(psDiffXPtr); 7684 } 7685 } 7686 if( x < iWidth-2 && *(pbEdgeXPtr+1) == true ) 7687 { 7688 if( *(psDiffXPtr+1) >= 0) 7689 { 7690 usAbs2 = *(psDiffXPtr+1); 7691 //bSign2 = true; 7692 } 7693 else 7694 { 7695 usAbs2 = (-1) * *(psDiffXPtr+1); 7696 } 7697 } 7698 7699 if( x == 0 ) 7700 { 7701 if( usAbs1 < usAbs2 ) 7702 { 7703 *pbEdgeXPtr = false; 7704 } 7705 } 7706 else if( x == iWidth-2 ) 7707 { 7708 if( usAbs1 <= usAbs0 ) 7709 *pbEdgeXPtr = false; 7710 } 7711 else 7712 { 7713 if( usAbs2 > usAbs0 ) 7714 { 7715 if( usAbs1 < usAbs2 ) 7716 *pbEdgeXPtr = false; 7717 } 7718 else 7719 { 7720 if( usAbs1 <= usAbs0 ) 7721 *pbEdgeXPtr = false; 7722 } 7723 } 7724 7725 psDiffXPtr++; 7726 pbEdgeXPtr++; 7727 } 7728 } 7729 7730 for( Int y=0; y<iHeight-1; y++ ) 7731 { 7732 Short* psDiffYPtr = &psDiffY[ y * iWidth ]; 7733 Bool* pbEdgeYPtr = &pbEdgeY[ y * iWidth ]; 7734 for( Int x=0; x<iWidth; x++ ) 7735 { 7736 UShort usAbs0=0, usAbs1=0, usAbs2=0; // 0 : upper, 1 : current, 2 : bottom 7737 if( y > 0 && *(pbEdgeYPtr-iWidth) == true ) 7738 { 7739 if( *(psDiffYPtr-iWidth) >= 0) 7740 { 7741 usAbs0 = *(psDiffYPtr-iWidth); 7742 } 7743 else 7744 { 7745 usAbs0 = (-1) * *(psDiffYPtr-iWidth); 7746 } 7747 } 7748 if( *pbEdgeYPtr == true ) 7749 { 7750 if( *(psDiffYPtr) >= 0) 7751 { 7752 usAbs1 = *(psDiffYPtr); 7753 } 7754 else 7755 { 7756 usAbs1 = (-1) * *(psDiffYPtr); 7757 } 7758 } 7759 if( y < iHeight-2 && *(pbEdgeYPtr+iWidth) == true ) 7760 { 7761 if( *(psDiffYPtr+iWidth) >= 0) 7762 { 7763 usAbs2 = *(psDiffYPtr+iWidth); 7764 } 7765 else 7766 { 7767 usAbs2 = (-1) * *(psDiffYPtr+iWidth); 7768 } 7769 } 7770 7771 if( y == 0 ) 7772 { 7773 if( usAbs1 < usAbs2 ) 7774 *pbEdgeYPtr = false; 7775 } 7776 else if( y == iHeight-2 ) 7777 { 7778 if( usAbs1 <= usAbs0 ) 7779 *pbEdgeYPtr = false; 7780 } 7781 else 7782 { 7783 if( usAbs2 > usAbs0 ) 7784 { 7785 if( usAbs1 < usAbs2 ) 7786 *pbEdgeYPtr = false; 7787 } 7788 else 7789 { 7790 if( usAbs1 <= usAbs0 ) 7791 *pbEdgeYPtr = false; 7792 } 7793 } 7794 7795 psDiffYPtr++; 7796 pbEdgeYPtr++; 7797 } 7798 } 7799 7800 // Edge Merging 7801 for( Int i=0; i< 4 * iWidth * iHeight; i++ ) 7802 pbEdge[ i ] = false; 7803 /// Even Line (0,2,4,6,...) => Vertical Edge 7804 for( Int i=0; i<iHeight; i++) 7805 { 7806 for( Int j=0; j<iWidth-1; j++) 7807 { 7808 pbEdge[ (2 * j + 1) + (2 * i) * 2 * iWidth ] = pbEdgeX[ j + i * iHeight ]; 7809 } 7810 } 7811 /// Odd Line (1,3,5,7,...) => Horizontal Edge 7812 for( Int i=0; i<iHeight-1; i++) 7813 { 7814 for( Int j=0; j<iWidth; j++) 7815 { 7816 pbEdge[ (2 * j) + (2 * i + 1) * 2 * iWidth ] = pbEdgeY[ j + i * iHeight ]; 7817 } 7818 } 7819 7820 // Intersection Filling 7821 /// Vertical Edge between Horizontal Edges 7822 for( Int i = 1; i < 2 * iHeight - 3; i += 2) 7823 { 7824 for( Int j = 0; j < 2 * iWidth - 1; j += 2) 7825 { 7826 if( pbEdge[ j + i * 2 * iWidth ] ) 7827 { 7828 if( j != 0 && pbEdge[ (j - 2) + ((i + 2) * 2 * iWidth) ] ) 7829 { 7830 if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j - 1) + ((i + 3) * 2 * iWidth) ] ) 7831 pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] = true; 7832 } 7833 if( j != 2 * iWidth - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] ) 7834 { 7835 if( !pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 1) + ((i + 3) * 2 * iWidth) ] ) 7836 pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true; 7837 } 7838 } 7839 } 7840 } 7841 /// Horizontal Edge between Vertical Edges 7842 for( Int j = 1; j < 2 * iWidth - 3; j += 2) 7843 { 7844 for( Int i = 0; i < 2 * iHeight - 1; i += 2) 7845 { 7846 if( pbEdge[ j + i * 2 * iWidth ] ) 7847 { 7848 if( i != 0 && pbEdge[ (j + 2) + ((i - 2) * 2 * iWidth) ] ) 7849 { 7850 if( !pbEdge[ (j - 1) + ((i - 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i - 1) * 2 * iWidth) ] ) 7851 pbEdge[ (j + 1) + ((i - 1) * 2 * iWidth) ] = true; 7852 } 7853 if( i != 2 * iHeight - 2 && pbEdge[ (j + 2) + ((i + 2) * 2 * iWidth) ] ) 7854 { 7855 if( !pbEdge[ (j - 1) + ((i + 1) * 2 * iWidth) ] && !pbEdge[ (j + 3) + ((i + 1) * 2 * iWidth) ] ) 7856 pbEdge[ (j + 1) + ((i + 1) * 2 * iWidth) ] = true; 7857 } 7858 } 7859 } 7860 } 7861 7862 // Static Pruning Unnecessary Edges 7863 /// Step1. Stack push the unconnected edges 7864 UShort* pusUnconnectedEdgeStack = new UShort[ 4 * iWidth * iHeight ]; // approximate size calculation 7865 Int iUnconnectedEdgeStackPtr = 0; 7866 //// Vertical Edges 7867 for( Int i = 0; i < 2 * iHeight - 1; i += 2 ) 7868 { 7869 for( Int j = 1; j < 2 * iWidth - 2; j += 2 ) 7870 { 7871 if( pbEdge[ j + i * 2 * iWidth ] ) 7872 { 7873 if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) ) 7874 { 7875 pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j); 7876 iUnconnectedEdgeStackPtr++; 7877 } 7878 } 7879 } 7880 } 7881 7882 //// Horizontal Edges 7883 for( Int i = 1; i < 2 * iHeight - 2; i += 2 ) 7884 { 7885 for( Int j = 0; j < 2 * iWidth - 1; j += 2 ) 7886 { 7887 if( pbEdge[ j + i * 2 * iWidth ] ) 7888 { 7889 if( !xCheckTerminatedEdge( pbEdge, j, i, iWidth, iHeight ) ) 7890 { 7891 pusUnconnectedEdgeStack[iUnconnectedEdgeStackPtr] = (i << 8) | (j); 7892 iUnconnectedEdgeStackPtr++; 7893 } 7894 } 7895 } 7896 } 7897 7898 /// Step2. Remove the edges from the stack and push the new unconnected edges 7899 //// (This step may contain duplicated edges already in the stack) 7900 //// (But it doesn't cause any functional problems) 7901 while( iUnconnectedEdgeStackPtr != 0 ) 7902 { 7903 iUnconnectedEdgeStackPtr--; 7904 Int iX = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] & 0xff; 7905 Int iY = pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] >> 8; 7906 7907 pbEdge[ iX + iY * 2 * iWidth ] = false; 7908 7909 if( iY % 2 == 1 && iX > 0 && pbEdge[ iX - 2 + iY * 2 * iWidth ] && 7910 !xCheckTerminatedEdge( pbEdge, iX - 2, iY, iWidth, iHeight ) ) // left 7911 { 7912 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX - 2); 7913 iUnconnectedEdgeStackPtr++; 7914 } 7915 if( iY % 2 == 1 && iX < 2 * iWidth - 2 && pbEdge[ iX + 2 + iY * 2 * iWidth ] && 7916 !xCheckTerminatedEdge( pbEdge, iX + 2, iY, iWidth, iHeight ) ) // right 7917 { 7918 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 0) << 8) | (iX + 2); 7919 iUnconnectedEdgeStackPtr++; 7920 } 7921 if( iY % 2 == 0 && iY > 0 && pbEdge[ iX + (iY - 2) * 2 * iWidth ] && 7922 !xCheckTerminatedEdge( pbEdge, iX, iY - 2, iWidth, iHeight ) ) // top 7923 { 7924 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 2) << 8) | (iX + 0); 7925 iUnconnectedEdgeStackPtr++; 7926 } 7927 if( iY % 2 == 0 && iY < 2 * iHeight - 2 && pbEdge[ iX + (iY + 2) * 2 * iWidth ] && 7928 !xCheckTerminatedEdge( pbEdge, iX, iY + 2, iWidth, iHeight ) ) // bottom 7929 { 7930 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 2) << 8) | (iX + 0); 7931 iUnconnectedEdgeStackPtr++; 7932 } 7933 if( iX > 0 && iY > 0 && pbEdge[ iX - 1 + (iY - 1) * 2 * iWidth ] && 7934 !xCheckTerminatedEdge( pbEdge, iX - 1, iY - 1, iWidth, iHeight ) ) // left-top 7935 { 7936 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX - 1); 7937 iUnconnectedEdgeStackPtr++; 7938 } 7939 if( iX < 2 * iWidth - 1 && iY > 0 && pbEdge[ iX + 1 + (iY - 1) * 2 * iWidth ] && 7940 !xCheckTerminatedEdge( pbEdge, iX + 1, iY - 1, iWidth, iHeight ) ) // right-top 7941 { 7942 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY - 1) << 8) | (iX + 1); 7943 iUnconnectedEdgeStackPtr++; 7944 } 7945 if( iX > 0 && iY < 2 * iHeight - 1 && pbEdge[ iX - 1 + (iY + 1) * 2 * iWidth ] && 7946 !xCheckTerminatedEdge( pbEdge, iX - 1, iY + 1, iWidth, iHeight ) ) // left-bottom 7947 { 7948 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX - 1); 7949 iUnconnectedEdgeStackPtr++; 7950 } 7951 if( iX < 2 * iWidth - 1 && iY < 2 * iHeight - 1 && pbEdge[ iX + 1 + (iY + 1) * 2 * iWidth ] && 7952 !xCheckTerminatedEdge( pbEdge, iX + 1, iY + 1, iWidth, iHeight ) ) // right-bottom 7953 { 7954 pusUnconnectedEdgeStack[ iUnconnectedEdgeStackPtr ] = ((iY + 1) << 8) | (iX + 1); 7955 iUnconnectedEdgeStackPtr++; 7956 } 7957 } 7958 7959 7960 // Region Generation ( edge -> region ) 7961 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPtIdx ); 7962 Bool* pbVisit = new Bool[ iWidth * iHeight ]; 7963 7964 for( UInt ui = 0; ui < iWidth * iHeight; ui++ ) 7965 { 7966 pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next) 7967 pbVisit [ ui ] = false; 7968 } 7969 7970 Int* piStack = new Int[ iWidth * iHeight ]; 7971 7972 Int iPtr = 0; 7973 7974 piStack[iPtr++] = (0 << 8) | (0); 7975 pbRegion[ 0 ] = false; 7976 7977 while(iPtr > 0) 7978 { 7979 Int iTmp = piStack[--iPtr]; 7980 Int iX1, iY1; 7981 iX1 = iTmp & 0xff; 7982 iY1 = (iTmp >> 8) & 0xff; 7983 7984 pbVisit[ iX1 + iY1 * iWidth ] = true; 7985 7986 assert( iX1 >= 0 && iX1 < iWidth ); 7987 assert( iY1 >= 0 && iY1 < iHeight ); 7988 7989 if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] ) 7990 { 7991 piStack[iPtr++] = (iY1 << 8) | (iX1 - 1); 7992 pbRegion[ iX1 - 1 + iY1 * iWidth ] = false; 7993 } 7994 if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] ) 7995 { 7996 piStack[iPtr++] = (iY1 << 8) | (iX1 + 1); 7997 pbRegion[ iX1 + 1 + iY1 * iWidth ] = false; 7998 } 7999 if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] ) 8000 { 8001 piStack[iPtr++] = ((iY1 - 1) << 8) | iX1; 8002 pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false; 8003 } 8004 if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] ) 8005 { 8006 piStack[iPtr++] = ((iY1 + 1) << 8) | iX1; 8007 pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false; 8008 } 8009 } 8010 8011 /////////// 8012 iPtr = 0; 8013 for( Int i = 0; i < iWidth * iHeight; i++ ) 8014 pbVisit[ i ] = false; 8015 piStack[ iPtr++ ] = (0 << 8) | (0); // initial seed 8016 while( iPtr > 0 && iPtr < iWidth * iHeight ) 8017 { 8018 Int iX; 8019 Int iY; 8020 iPtr--; 8021 iX = piStack[ iPtr ] & 0xff; 8022 iY = piStack[ iPtr ] >> 8; 8023 pbVisit[ iY * iWidth + iX ] = true; 8024 8025 if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] ) 8026 { 8027 piStack[ iPtr++ ] = ((iY - 1) << 8) | iX; 8028 } 8029 if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] ) 8030 { 8031 piStack[ iPtr++ ] = ((iY + 1) << 8) | iX; 8032 } 8033 if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] ) 8034 { 8035 piStack[ iPtr++ ] = (iY << 8) | (iX - 1); 8036 } 8037 if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] ) 8038 { 8039 piStack[ iPtr++ ] = (iY << 8) | (iX + 1); 8040 } 8041 } 8042 assert( iPtr == 0 || iPtr == iWidth * iHeight ); 8043 8044 Bool bBipartition; 8045 if( iPtr == iWidth * iHeight ) 8046 { 8047 bBipartition = false; // single partition 8048 } 8049 else 8050 { 8051 for( Int i = 0; i < iWidth * iHeight; i++ ) 8052 { 8053 if( !pbVisit[ i ] ) 8054 { 8055 piStack[ iPtr++ ] = (( i / iWidth ) << 8) | ( i % iWidth ); 8056 pbVisit[ i ] = true; 8057 break; 8058 } 8059 } 8060 while( iPtr > 0 ) 8061 { 8062 Int iX; 8063 Int iY; 8064 iPtr--; 8065 iX = piStack[ iPtr ] & 0xff; 8066 iY = piStack[ iPtr ] >> 8; 8067 pbVisit[ iY * iWidth + iX ] = true; 8068 8069 if( iY > 0 && !pbVisit[ (iY - 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY - 1) * iWidth + iX ] ) 8070 { 8071 piStack[ iPtr++ ] = ((iY - 1) << 8) | iX; 8072 } 8073 if( iY < iHeight - 1 && !pbVisit[ (iY + 1) * iWidth + iX ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ (iY + 1) * iWidth + iX ] ) 8074 { 8075 piStack[ iPtr++ ] = ((iY + 1) << 8) | iX; 8076 } 8077 if( iX > 0 && !pbVisit[ iY * iWidth + (iX - 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX - 1) ] ) 8078 { 8079 piStack[ iPtr++ ] = (iY << 8) | (iX - 1); 8080 } 8081 if( iX < iWidth - 1 && !pbVisit[ iY * iWidth + (iX + 1) ] && pbRegion[ iY * iWidth + iX ] == pbRegion[ iY * iWidth + (iX + 1) ] ) 8082 { 8083 piStack[ iPtr++ ] = (iY << 8) | (iX + 1); 8084 } 8085 } 8086 bBipartition = true; 8087 for( Int i = 0; i < iWidth * iHeight; i++ ) 8088 { 8089 if( !pbVisit[ i ] ) 8090 { 8091 bBipartition = false; 8092 break; 8093 } 8094 } 8095 } 8096 8097 xFree( pbEdge ); 8098 delete[] pbEdgeX; pbEdgeX = NULL; 8099 delete[] pbEdgeY; pbEdgeY = NULL; 8100 delete[] psDiffX; psDiffX = NULL; 8101 delete[] psDiffY; psDiffY = NULL; 8102 delete[] pusUnconnectedEdgeStack; pusUnconnectedEdgeStack = NULL; 8103 delete[] pbVisit; pbVisit = NULL; 8104 delete[] piStack; piStack = NULL; 8105 8106 if( bBipartition ) 8107 { 8108 return xConstructChainCode( pcCU, uiAbsPtIdx, (UInt)iWidth, (UInt)iHeight ); 8109 } 8110 else 8111 { 8112 return false; 8113 } 8114 } 8115 8116 Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ) 8117 { 8118 if( (iY % 2) == 0 ) // vertical edge 8119 { 8120 Bool bTopConnected = false; 8121 Bool bBottomConnected = false; 8122 8123 if( iY != 0 ) 8124 { 8125 if( pbEdge[ iX + (iY - 2) * 2 * iWidth ] ) 8126 bTopConnected = true; 8127 if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] ) 8128 bTopConnected = true; 8129 if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] ) 8130 bTopConnected = true; 8131 } 8132 else 8133 { 8134 bTopConnected = true; 8135 } 8136 8137 8138 if( iY != 2 * iHeight - 2 ) 8139 { 8140 if( pbEdge[ iX + (iY + 2) * 2 * iWidth ] ) 8141 bBottomConnected = true; 8142 if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] ) 8143 bBottomConnected = true; 8144 if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] ) 8145 bBottomConnected = true; 8146 } 8147 else 8148 { 8149 bBottomConnected = true; 8150 } 8151 8152 8153 if( bTopConnected && bBottomConnected ) 8154 { 8155 return true; 8156 } 8157 else 8158 { 8159 return false; 8160 } 8161 } 8162 else 8163 { 8164 Bool bLeftConnected = false; 8165 Bool bRightConnected = false; 8166 8167 if( iX != 0 ) 8168 { 8169 if( pbEdge[ (iX - 2) + iY * 2 * iWidth ] ) 8170 bLeftConnected = true; 8171 if( pbEdge[ (iX - 1) + (iY - 1) * 2 * iWidth ] ) 8172 bLeftConnected = true; 8173 if( pbEdge[ (iX - 1) + (iY + 1) * 2 * iWidth ] ) 8174 bLeftConnected = true; 8175 } 8176 else 8177 { 8178 bLeftConnected = true; 8179 } 8180 8181 if( iX != 2 * iWidth - 2 ) 8182 { 8183 if( pbEdge[ (iX + 2) + iY * 2 * iWidth ] ) 8184 bRightConnected = true; 8185 if( pbEdge[ (iX + 1) + (iY - 1) * 2 * iWidth ] ) 8186 bRightConnected = true; 8187 if( pbEdge[ (iX + 1) + (iY + 1) * 2 * iWidth ] ) 8188 bRightConnected = true; 8189 } 8190 else 8191 { 8192 bRightConnected = true; 8193 } 8194 8195 8196 if( bLeftConnected && bRightConnected ) 8197 { 8198 return true; 8199 } 8200 else 8201 { 8202 return false; 8203 } 8204 } 8205 } 8206 Bool TEncSearch::xConstructChainCode( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight ) 8207 { 8208 //UInt uiWidth = pcCU->getWidth( uiPartIdx ) >> (bPU4x4 ? 1 : 0); 8209 //UInt uiHeight = pcCU->getHeight( uiPartIdx ) >> (bPU4x4 ? 1 : 0); 8210 Bool* pbEdge = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 ); 8211 Bool* pbVisit = (Bool*) xMalloc( Bool, uiWidth * uiHeight * 4 ); 8212 UInt uiMaxEdge = uiWidth * (RBC_MAX_EDGE_NUM_PER_4x4 / 4); 8213 Bool* pbRegion = pcCU->getEdgePartition( uiAbsPtIdx ); 8214 UChar* piEdgeCode = pcCU->getEdgeCode( uiAbsPtIdx ); 8215 Bool bStartLeft = false; 8216 Bool bPossible = false; 8217 Bool bFinish = false; 8218 Int iStartPosition = -1; 8219 Int iPtr = 0; 8220 Int iDir = -1, iNextDir = -1; 8221 Int iArrow = -1, iNextArrow = -1; 8222 Int iX = -1, iY = -1; 8223 Int iDiffX = 0, iDiffY = 0; 8224 UChar iCode = 255; 8225 UInt uiWidth2 = uiWidth * 2; 8226 8227 for( Int i = 0; i < uiWidth * uiHeight * 4; i++ ) 8228 pbEdge[ i ] = false; 8229 8230 for( Int i = 0; i < uiHeight; i++ ) 8231 { 8232 for( Int j = 0; j < uiWidth - 1; j++ ) 8233 { 8234 if( pbRegion[ i * uiWidth + j ] != pbRegion[ i * uiWidth + j + 1 ] ) 8235 pbEdge[ i * uiWidth * 4 + j * 2 + 1 ] = true; 8236 } 8237 } 8238 8239 for( Int i = 0; i < uiHeight - 1; i++ ) 8240 { 8241 for( Int j = 0; j < uiWidth; j++ ) 8242 { 8243 if( pbRegion[ (i + 0) * uiWidth + j ] != pbRegion[ (i + 1) * uiWidth + j ] ) 8244 pbEdge[ (2 * i + 1) * 2 * uiWidth + j * 2 ] = true; 8245 } 8246 } 8247 8248 for( Int i = 1; i < uiWidth2 - 2; i+=2 ) 8249 { 8250 if(pbEdge[ i ]) 8251 { 8252 bPossible = true; 8253 bStartLeft = false; 8254 iStartPosition = iX = i; 8255 iY = 0; 8256 iDir = 3; 8257 iArrow = 3; 8258 break; 8259 } 8260 } 8261 8262 if( !bPossible ) 8263 { 8264 for( Int i = 1; i < uiWidth2 - 2; i+=2 ) 8265 { 8266 if(pbEdge[ i * uiWidth2 ]) 8267 { 8268 bPossible = true; 8269 bStartLeft = true; 8270 iX = 0; 8271 iStartPosition = iY = i; 8272 iDir = 1; 8273 iArrow = 1; 8274 break; 8275 } 8276 } 8277 } 8278 8279 if( bPossible ) 8280 { 8281 for( Int i = 0; i < 4 * uiWidth * uiHeight; i++ ) 8282 pbVisit[ i ] = false; 8283 8284 while( !bFinish ) 8285 { 8286 Bool bArrowSkip = false; 8287 pbVisit[ iX + iY * uiWidth2 ] = true; 8288 8289 switch( iDir ) 8290 { 8291 case 0: // left 8292 if( iX > 0 && !pbVisit[ (iX - 2) + iY * uiWidth2 ] && pbEdge[ (iX - 2) + iY * uiWidth2 ] ) // left 8293 { 8294 iDiffX = -2; 8295 iDiffY = 0; 8296 iNextDir = 0; 8297 iNextArrow = 0; 8298 } 8299 else if( iX > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // top 8300 { 8301 iDiffX = -1; 8302 iDiffY = -1; 8303 iNextDir = 2; 8304 iNextArrow = 4; 8305 } 8306 else if( iX > 0 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // bottom 8307 { 8308 iDiffX = -1; 8309 iDiffY = +1; 8310 iNextDir = 3; 8311 iNextArrow = iArrow; 8312 if( !(iPtr == 0 && iX == uiWidth2 - 2 && iY == uiHeight * 2 - 3) ) 8313 bArrowSkip = true; 8314 else 8315 iNextArrow = 3; 8316 } 8317 else if( iX == 0 ) 8318 { 8319 iDiffX = 0; 8320 iDiffY = 0; 8321 iNextDir = iDir; 8322 iNextArrow = iArrow; 8323 bFinish = true; 8324 continue; 8325 } 8326 else 8327 { 8328 iPtr = 0; // edge loop or unwanted case 8329 bFinish = true; 8330 //continue; 8331 assert(false); 8332 } 8333 break; 8334 case 1: // right 8335 if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 2) + iY * uiWidth2 ] && pbEdge[ (iX + 2) + iY * uiWidth2 ] ) // right 8336 { 8337 iDiffX = +2; 8338 iDiffY = 0; 8339 iNextDir = 1; 8340 iNextArrow = 1; 8341 } 8342 else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // top 8343 { 8344 iDiffX = +1; 8345 iDiffY = -1; 8346 iNextDir = 2; 8347 iNextArrow = iArrow; 8348 if( !(iPtr == 0 && iX == 0 && iY == 1) ) 8349 bArrowSkip = true; 8350 else 8351 iNextArrow = 2; 8352 } 8353 else if( iX < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // bottom 8354 { 8355 iDiffX = +1; 8356 iDiffY = +1; 8357 iNextDir = 3; 8358 iNextArrow = 7; 8359 } 8360 else if( iX == uiWidth2 - 2 ) 8361 { 8362 iDiffX = 0; 8363 iDiffY = 0; 8364 iNextDir = iDir; 8365 iNextArrow = iArrow; 8366 bFinish = true; 8367 continue; 8368 } 8369 else 8370 { 8371 iPtr = 0; // edge loop or unwanted case 8372 bFinish = true; 8373 //continue; 8374 assert(false); 8375 } 8376 break; 8377 case 2: // top 8378 if( iY > 0 && !pbVisit[ (iX - 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY - 1) * uiWidth2 ] ) // left 8379 { 8380 iDiffX = -1; 8381 iDiffY = -1; 8382 iNextDir = 0; 8383 iNextArrow = iArrow; 8384 if( !(iPtr == 0 && iX == 1 && iY == uiHeight * 2 - 2) ) 8385 bArrowSkip = true; 8386 else 8387 iNextArrow = 0; 8388 } 8389 else if( iY > 0 && !pbVisit[ (iX + 1) + (iY - 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY - 1) * uiWidth2 ] ) // right 8390 { 8391 iDiffX = +1; 8392 iDiffY = -1; 8393 iNextDir = 1; 8394 iNextArrow = 5; 8395 } 8396 else if( iY > 0 && !pbVisit[ iX + (iY - 2) * uiWidth2 ] && pbEdge[ iX + (iY - 2) * uiWidth2 ] ) // top 8397 { 8398 iDiffX = 0; 8399 iDiffY = -2; 8400 iNextDir = 2; 8401 iNextArrow = 2; 8402 } 8403 else if( iY == 0 ) 8404 { 8405 iDiffX = 0; 8406 iDiffY = 0; 8407 iNextDir = iDir; 8408 iNextArrow = iArrow; 8409 bFinish = true; 8410 continue; 8411 } 8412 else 8413 { 8414 iPtr = 0; // edge loop or unwanted case 8415 bFinish = true; 8416 //continue; 8417 assert(false); 8418 } 8419 break; 8420 case 3: // bottom 8421 if( iY < uiWidth2 - 2 && !pbVisit[ (iX - 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX - 1) + (iY + 1) * uiWidth2 ] ) // left 8422 { 8423 iDiffX = -1; 8424 iDiffY = +1; 8425 iNextDir = 0; 8426 iNextArrow = 6; 8427 } 8428 else if( iY < uiWidth2 - 2 && !pbVisit[ (iX + 1) + (iY + 1) * uiWidth2 ] && pbEdge[ (iX + 1) + (iY + 1) * uiWidth2 ] ) // right 8429 { 8430 iDiffX = +1; 8431 iDiffY = +1; 8432 iNextDir = 1; 8433 iNextArrow = iArrow; 8434 if( !(iPtr == 0 && iX == uiWidth * 2 - 3 && iY == 0) ) 8435 bArrowSkip = true; 8436 else 8437 iNextArrow = 1; 8438 } 8439 else if( iY < uiWidth2 - 2 && !pbVisit[ iX + (iY + 2) * uiWidth2 ] && pbEdge[ iX + (iY + 2) * uiWidth2 ] ) // bottom 8440 { 8441 iDiffX = 0; 8442 iDiffY = +2; 8443 iNextDir = 3; 8444 iNextArrow = 3; 8445 } 8446 else if( iY == uiWidth2 - 2 ) 8447 { 8448 iDiffX = 0; 8449 iDiffY = 0; 8450 iNextDir = iDir; 8451 iNextArrow = iArrow; 8452 bFinish = true; 8453 continue; 8454 } 8455 else 8456 { 8457 iPtr = 0; // edge loop or unwanted case 8458 bFinish = true; 8459 //continue; 8460 assert(false); 8461 } 8462 break; 8463 } 8464 8465 const UChar tableCode[8][8] = { { 0, -1, 4, 3, 2, 6, 1, 5 }, // iArrow(current direction), iNextArrow(next direction) 8466 { -1, 0, 3, 4, 5, 1, 6, 2 }, 8467 { 3, 4, 0, -1, 1, 2, 5, 6 }, 8468 { 4, 3, -1, 0, 6, 5, 2, 1 }, 8469 { 1, 6, 2, 5, 0, 4, 3, -1 }, 8470 { 5, 2, 1, 6, 3, 0, -1, 4 }, 8471 { 2, 5, 6, 1, 4, -1, 0, 3 }, 8472 { 6, 1, 5, 2, -1, 3, 4, 0 } }; 8473 8474 iCode = tableCode[iArrow][iNextArrow]; 8475 8476 if(iPtr >= uiMaxEdge) 8477 { 8478 iPtr = 0; // over the maximum number of edge 8479 bPossible = false; 8480 break; 8481 } 8482 8483 if( !bArrowSkip ) 8484 { 8485 piEdgeCode[iPtr++] = iCode; // first edge coding 8486 //printf("xEdgeCoding: (%d,%d)->(%d,%d) code %d\n",iX,iY, iX+iDiffX, iY+iDiffY, iCode); 8487 } 8488 8489 iX += iDiffX; 8490 iY += iDiffY; 8491 iDir = iNextDir; 8492 iArrow = iNextArrow; 8493 } 8494 } 8495 8496 pcCU->setEdgeLeftFirst( uiAbsPtIdx, bStartLeft ); 8497 pcCU->setEdgeStartPos ( uiAbsPtIdx, bStartLeft ? (iStartPosition - 1) >> 1 : (iStartPosition + 1) >> 1); 8498 pcCU->setEdgeNumber ( uiAbsPtIdx, iPtr ); 8499 8500 xFree( pbEdge ); 8501 xFree( pbVisit ); 8502 8503 return (iPtr != 0); 8504 } 8505 #endif 7407 7408 #endif 7409 8506 7410 #endif 8507 7411 //! \} -
branches/HTM-9.2-dev0/source/Lib/TLibEncoder/TEncSearch.h
r724 r764 351 351 Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); 352 352 Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); 353 #if !SEC_DMM3_RBC_F0147354 Void xSearchDmm3Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, UInt& ruiIntraTabIdx, UInt colTexIntraDir );355 #endif356 #endif357 #if H_3D_DIM_RBC358 Void xSearchRbcDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 );359 Bool xSearchRbcEdge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, Int iWidth, Int iHeight );360 361 Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight );362 Bool xConstructChainCode ( TComDataCU* pcCU, UInt uiAbsPtIdx, UInt uiWidth, UInt uiHeight );363 353 #endif 364 354 #if H_3D_DIM_SDC
Note: See TracChangeset for help on using the changeset viewer.