Changeset 1233 in 3DVCSoftware
- Timestamp:
- 26 May 2015, 07:13:47 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev3-ETRI
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibCommon/CommonDef.h
r1200 r1233 363 363 #endif 364 364 365 #if H_3D_IV_MERGE365 #if NH_3D_MLC 366 366 #define MRG_MAX_NUM_CANDS_MEM (MRG_MAX_NUM_CANDS+1) // one extra for inter-view motion prediction 367 367 #endif -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibCommon/TComDataCU.cpp
r1217 r1233 3193 3193 3194 3194 #endif 3195 #if H_3D 3195 #if NH_3D_MLC 3196 /** Construct a extended list of merging candidates 3197 * \param pcMvFieldNeighbours 3198 * \param puhInterDirNeighbours 3199 * \param vspFlag 3200 * \param pbSPIVMPFlag 3201 * \param numValidMergeCand 3202 */ 3196 3203 Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 3197 3204 #if H_3D_VSP … … 3204 3211 ) 3205 3212 { 3206 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) // for only dependent texture3213 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) 3207 3214 { 3208 3215 return; … … 3220 3227 extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID); 3221 3228 extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID); 3229 #if H_3D_VSP 3222 3230 vspFlag[ui] = 0; 3223 } 3224 3225 // add candidates to temporal list 3226 // insert MPI ... IvShift candidate 3231 #endif 3232 } 3233 3234 // insert MPI ... IvShift candidate to extMergeCandList 3227 3235 for (Int i=0; i<=MRG_IVSHIFT; i++) 3228 3236 { 3229 3237 if (m_mergCands[i].m_bAvailable) 3230 3238 { 3231 m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt, vspFlag, pbSPIVMPFlag); 3239 m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt 3240 #if H_3D_VSP 3241 , vspFlag 3242 #endif 3243 #if H_3D_SPIVMP 3244 , pbSPIVMPFlag 3245 #endif 3246 ); 3232 3247 iCount++; 3233 3248 if (iCount >= getSlice()->getMaxNumMergeCand()) … … 3236 3251 } 3237 3252 3238 // insert remaining base candidates 3239 while (iCount < getSlice()->getMaxNumMergeCand() && m_baseListidc < getSlice()->getMaxNumMergeCand()) 3240 { 3241 uhInterDirNeighboursExt[iCount] = puhInterDirNeighbours[m_baseListidc]; 3242 extMergeCandList[iCount<<1].setMvField(pcMvFieldNeighbours[m_baseListidc<<1].getMv(), pcMvFieldNeighbours[m_baseListidc<<1].getRefIdx()); 3253 Int iCountBase = m_numSpatialCands; 3254 // insert remaining base candidates to extMergeCandList 3255 while (iCount < getSlice()->getMaxNumMergeCand() && iCountBase < getSlice()->getMaxNumMergeCand()) 3256 { 3257 uhInterDirNeighboursExt[iCount] = puhInterDirNeighbours[iCountBase]; 3258 extMergeCandList[iCount<<1].setMvField(pcMvFieldNeighbours[iCountBase<<1].getMv(), pcMvFieldNeighbours[iCountBase<<1].getRefIdx()); 3243 3259 if ( getSlice()->isInterB() ) 3244 3260 { 3245 extMergeCandList[(iCount<<1)+1].setMvField(pcMvFieldNeighbours[( m_baseListidc<<1)+1].getMv(), pcMvFieldNeighbours[(m_baseListidc<<1)+1].getRefIdx());3246 } 3247 m_baseListidc++;3261 extMergeCandList[(iCount<<1)+1].setMvField(pcMvFieldNeighbours[(iCountBase<<1)+1].getMv(), pcMvFieldNeighbours[(iCountBase<<1)+1].getRefIdx()); 3262 } 3263 iCountBase++; 3248 3264 iCount++; 3249 3265 } … … 3267 3283 } 3268 3284 3269 /** Constructs a list of merging candidates 3285 3286 3287 /** Derive 3D merge candidates 3270 3288 * \param uiAbsPartIdx 3271 3289 * \param uiPUIdx 3272 * \param uiDepth3273 3290 * \param pcMvFieldNeighbours 3291 * \param puhInterDirNeighbours 3292 * \param pcMvFieldSP 3274 3293 * \param puhInterDirNeighbours 3275 3294 * \param numValidMergeCand 3276 3295 */ 3277 // HM 12.0 based merge candidate list construction 3278 3279 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3280 { 3281 3282 UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx; 3283 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ]; 3296 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 3297 #if H_3D_SPIVMP 3298 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 3299 #endif 3300 , Int& numValidMergeCand, Int mrgCandIdx 3301 ) 3302 { 3303 #if H_3D_IV_MERGE 3284 3304 TComMv cZeroMv; 3285 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 3286 { 3287 abCandIsInter[ui] = false; 3288 pcMvFieldNeighbours[ ( ui << 1 ) ].setMvField(cZeroMv, NOT_VALID); 3289 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setMvField(cZeroMv, NOT_VALID); 3305 #endif 3306 TComMvField tmpMV[2]; 3307 UChar tmpDir; 3308 3309 ////////////////////////////////// 3310 //////// GET DISPARITIES //////// 3311 ////////////////////////////////// 3312 #if H_3D_IV_MERGE 3313 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx); 3314 m_cDefaultDisInfo = cDisInfo; 3315 #endif 3316 3317 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) 3318 { 3319 return; 3290 3320 } 3291 3321 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 3322 ////////////////////////////////// 3323 //////// DERIVE LOCATIONS //////// 3324 ////////////////////////////////// 3292 3325 // compute the location of the current PU 3293 3326 Int xP, yP, nPSW, nPSH; … … 3295 3328 3296 3329 Int iCount = 0; 3297 3298 3330 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 3299 PartSize cCurPS = getPartitionSize( uiAbsPartIdx );3300 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );3301 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );3302 3303 //left3304 UInt uiLeftPartIdx = 0;3305 TComDataCU* pcCULeft = 0;3306 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB );3307 Bool isAvailableA1 = pcCULeft &&3308 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) &&3309 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) &&3310 !pcCULeft->isIntra( uiLeftPartIdx ) ;3311 if ( isAvailableA1 )3312 {3313 m_bAvailableFlagA1 = 1;3314 abCandIsInter[iCount] = true;3315 // get Inter Dir3316 puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx );3317 // get Mv from Left3318 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );3319 if ( getSlice()->isInterB() )3320 {3321 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );3322 }3323 3324 iCount ++;3325 }3326 3327 // early termination3328 if (iCount == getSlice()->getMaxNumMergeCand())3329 {3330 return;3331 }3332 // above3333 UInt uiAbovePartIdx = 0;3334 TComDataCU* pcCUAbove = 0;3335 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );3336 Bool isAvailableB1 = pcCUAbove &&3337 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) &&3338 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) &&3339 !pcCUAbove->isIntra( uiAbovePartIdx );3340 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )3341 {3342 m_bAvailableFlagB1 = 1;3343 abCandIsInter[iCount] = true;3344 // get Inter Dir3345 puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx );3346 // get Mv from Left3347 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );3348 if ( getSlice()->isInterB() )3349 {3350 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );3351 }3352 if ( mrgCandIdx == iCount )3353 {3354 return;3355 }3356 iCount ++;3357 }3358 // early termination3359 if (iCount == getSlice()->getMaxNumMergeCand())3360 {3361 return;3362 }3363 3364 // above right3365 UInt uiAboveRightPartIdx = 0;3366 TComDataCU* pcCUAboveRight = 0;3367 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );3368 Bool isAvailableB0 = pcCUAboveRight &&3369 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) &&3370 !pcCUAboveRight->isIntra( uiAboveRightPartIdx );3371 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )3372 {3373 m_bAvailableFlagB0 = 1;3374 abCandIsInter[iCount] = true;3375 // get Inter Dir3376 puhInterDirNeighbours[iCount] = pcCUAboveRight->getInterDir( uiAboveRightPartIdx );3377 // get Mv from Left3378 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );3379 if ( getSlice()->isInterB() )3380 {3381 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );3382 }3383 if ( mrgCandIdx == iCount )3384 {3385 return;3386 }3387 iCount ++;3388 }3389 // early termination3390 if (iCount == getSlice()->getMaxNumMergeCand())3391 {3392 return;3393 }3394 3395 //left bottom3396 UInt uiLeftBottomPartIdx = 0;3397 TComDataCU* pcCULeftBottom = 0;3398 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );3399 Bool isAvailableA0 = pcCULeftBottom &&3400 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) &&3401 !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ;3402 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )3403 {3404 m_bAvailableFlagA0 = 1;3405 abCandIsInter[iCount] = true;3406 // get Inter Dir3407 puhInterDirNeighbours[iCount] = pcCULeftBottom->getInterDir( uiLeftBottomPartIdx );3408 // get Mv from Left3409 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );3410 if ( getSlice()->isInterB() )3411 {3412 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );3413 }3414 if ( mrgCandIdx == iCount )3415 {3416 return;3417 }3418 iCount ++;3419 }3420 // early termination3421 if (iCount == getSlice()->getMaxNumMergeCand())3422 {3423 return;3424 }3425 // above left3426 if( iCount < 4 )3427 {3428 UInt uiAboveLeftPartIdx = 0;3429 TComDataCU* pcCUAboveLeft = 0;3430 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );3431 Bool isAvailableB2 = pcCUAboveLeft &&3432 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) &&3433 !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx );3434 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )3435 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) )3436 {3437 m_bAvailableFlagB2 = 1;3438 abCandIsInter[iCount] = true;3439 // get Inter Dir3440 puhInterDirNeighbours[iCount] = pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx );3441 // get Mv from Left3442 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );3443 if ( getSlice()->isInterB() )3444 {3445 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );3446 }3447 if ( mrgCandIdx == iCount )3448 {3449 return;3450 }3451 iCount ++;3452 }3453 }3454 // early termination3455 if (iCount == getSlice()->getMaxNumMergeCand())3456 {3457 return;3458 }3459 if ( getSlice()->getEnableTMVPFlag())3460 {3461 //>> MTK colocated-RightBottom3462 UInt uiPartIdxRB;3463 3464 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB );3465 3466 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];3467 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();3468 3469 TComMv cColMv;3470 Int iRefIdx;3471 Int uiLCUIdx = -1;3472 3473 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check3474 {3475 }3476 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )3477 {3478 }3479 else3480 {3481 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU3482 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU3483 {3484 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];3485 uiLCUIdx = getAddr();3486 }3487 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU3488 {3489 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];3490 }3491 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU3492 {3493 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];3494 uiLCUIdx = getAddr() + 1;3495 }3496 else //is the right bottom corner of LCU3497 {3498 uiAbsPartAddr = 0;3499 }3500 }3501 3502 iRefIdx = 0;3503 Bool bExistMV = false;3504 UInt uiPartIdxCenter;3505 UInt uiCurLCUIdx = getAddr();3506 Int dir = 0;3507 UInt uiArrayAddr = iCount;3508 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );3509 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx );3510 if( bExistMV == false )3511 {3512 bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx );3513 }3514 if( bExistMV )3515 {3516 dir |= 1;3517 pcMvFieldNeighbours[ 2 * uiArrayAddr ].setMvField( cColMv, iRefIdx );3518 }3519 3520 if ( getSlice()->isInterB() )3521 {3522 #if H_3D_TMVP3523 iRefIdx = 0;3524 #endif3525 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx);3526 if( bExistMV == false )3527 {3528 bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx );3529 }3530 if( bExistMV )3531 {3532 dir |= 2;3533 pcMvFieldNeighbours[ 2 * uiArrayAddr + 1 ].setMvField( cColMv, iRefIdx );3534 }3535 }3536 3537 if (dir != 0)3538 {3539 puhInterDirNeighbours[uiArrayAddr] = dir;3540 abCandIsInter[uiArrayAddr] = true;3541 #if NH_3D_NBDV3542 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false);3543 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);3544 #endif3545 if ( mrgCandIdx == iCount )3546 {3547 return;3548 }3549 iCount++;3550 }3551 }3552 // early termination3553 if (iCount == getSlice()->getMaxNumMergeCand())3554 {3555 return;3556 }3557 UInt uiArrayAddr = iCount;3558 UInt uiCutoff = uiArrayAddr;3559 3560 if ( getSlice()->isInterB() && iCount<5) // JCT3V-F0129 by Qualcomm3561 {3562 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};3563 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};3564 3565 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++)3566 {3567 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];3568 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))3569 {3570 abCandIsInter[uiArrayAddr] = true;3571 puhInterDirNeighbours[uiArrayAddr] = 3;3572 3573 // get Mv from cand[i] and cand[j]3574 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx());3575 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(j<<1)+1].getMv(), pcMvFieldNeighbours[(j<<1)+1].getRefIdx());3576 3577 Int iRefPOCL0 = m_pcSlice->getRefPOC( REF_PIC_LIST_0, pcMvFieldNeighbours[(uiArrayAddr<<1)].getRefIdx() );3578 Int iRefPOCL1 = m_pcSlice->getRefPOC( REF_PIC_LIST_1, pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getRefIdx() );3579 if (iRefPOCL0 == iRefPOCL1 && pcMvFieldNeighbours[(uiArrayAddr<<1)].getMv() == pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv())3580 {3581 abCandIsInter[uiArrayAddr] = false;3582 }3583 else3584 {3585 uiArrayAddr++;3586 }3587 }3588 }3589 }3590 // early termination3591 if (uiArrayAddr == getSlice()->getMaxNumMergeCand())3592 {3593 return;3594 }3595 3596 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0);3597 Int r = 0;3598 Int refcnt = 0;3599 while (uiArrayAddr < getSlice()->getMaxNumMergeCand())3600 {3601 abCandIsInter[uiArrayAddr] = true;3602 puhInterDirNeighbours[uiArrayAddr] = 1;3603 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField( TComMv(0, 0), r);3604 3605 if ( getSlice()->isInterB() )3606 {3607 puhInterDirNeighbours[uiArrayAddr] = 3;3608 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r);3609 }3610 uiArrayAddr++;3611 if ( refcnt == iNumRefIdx - 1 )3612 {3613 r = 0;3614 }3615 else3616 {3617 ++r;3618 ++refcnt;3619 }3620 }3621 3622 numValidMergeCand = uiArrayAddr;3623 }3624 3625 3626 3627 /** Constructs a list of merging candidates3628 * \param uiAbsPartIdx3629 * \param uiPUIdx3630 * \param uiDepth3631 * \param pcMvFieldNeighbours3632 * \param puhInterDirNeighbours3633 * \param numValidMergeCand3634 */3635 #if H_3D3636 Void TComDataCU::xGetInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours3637 #else3638 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours3639 #endif3640 #if H_3D_SPIVMP3641 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP3642 #endif3643 , Int& numValidMergeCand, Int mrgCandIdx3644 )3645 {3646 #if H_3D_IV_MERGE3647 ////////////////////////////3648 //////// INIT LISTS ////////3649 ////////////////////////////3650 TComMv cZeroMv;3651 #else3652 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];3653 #endif3654 #if H_3D3655 TComMvField tmpMV[2];3656 UChar tmpDir;3657 3658 3659 //////////////////////////////////3660 //////// GET DISPARITIES ////////3661 //////////////////////////////////3662 DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);3663 m_cDefaultDisInfo = cDisInfo;3664 3665 if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0)) // current slice is not both dependent view or depth3666 {3667 return;3668 }3669 #else3670 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui )3671 {3672 abCandIsInter[ui] = false;3673 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID);3674 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID);3675 }3676 #endif3677 3678 numValidMergeCand = getSlice()->getMaxNumMergeCand();3679 #if H_3D3680 //////////////////////////////////3681 //////// DERIVE LOCATIONS ////////3682 //////////////////////////////////3683 #endif3684 // compute the location of the current PU3685 Int xP, yP, nPSW, nPSH;3686 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH);3687 3688 Int iCount = 0;3689 3690 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB;3691 #if !H_3D3692 PartSize cCurPS = getPartitionSize( uiAbsPartIdx );3693 #endif3694 3331 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 3695 3332 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); … … 3710 3347 #endif 3711 3348 3712 #if H_3D3713 3349 #if NH_3D_NBDV 3714 3350 for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 3715 3351 { 3716 pcMvFieldNeighbours[i<<1 ].getMv().setIDVFlag (false); 3717 pcMvFieldNeighbours[(i<<1)+1].getMv().setIDVFlag (false); 3718 } 3719 #endif 3720 // Clean version for MCL construction align with WD 3721 // init mergCands list 3352 pcMFieldNeighbours[i<<1 ].getMv().setIDVFlag (false); 3353 pcMFieldNeighbours[(i<<1)+1].getMv().setIDVFlag (false); 3354 } 3355 #endif 3356 // init containers 3722 3357 for (Int i = 0; i<MRG_IVSHIFT+1; i++) 3723 {3724 3358 m_mergCands[i].init(); 3725 } 3726 3727 m_baseListidc = 0; 3728 3359 3360 m_numSpatialCands = 0; 3361 3362 ////////////////////////////////// 3363 ///////// GET VSP FLAGS ////////// 3364 ////////////////////////////////// 3729 3365 //left 3730 3366 UInt uiLeftPartIdx = 0; … … 3734 3370 if (getAvailableFlagA1()) 3735 3371 { 3736 m_mergCands[MRG_A1].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3372 m_mergCands[MRG_A1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3737 3373 #if H_3D_VSP 3738 3374 , (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0 … … 3748 3384 ) 3749 3385 #endif 3386 #if H_3D_SPIVMP 3750 3387 , false 3388 #endif 3751 3389 ); 3752 m_ baseListidc++;3390 m_numSpatialCands++; 3753 3391 } 3754 3392 3755 3393 // above 3756 3757 3394 if (getAvailableFlagB1()) 3758 3395 { 3759 m_mergCands[MRG_B1].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3396 m_mergCands[MRG_B1].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3760 3397 #if H_3D_VSP 3761 3398 , false 3762 3399 #endif 3400 #if H_3D_SPIVMP 3763 3401 , false 3402 #endif 3764 3403 ); 3765 m_ baseListidc++;3404 m_numSpatialCands++; 3766 3405 } 3767 3406 3768 3407 // above right 3769 3770 3408 if (getAvailableFlagB0()) 3771 3409 { 3772 m_mergCands[MRG_B0].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3410 m_mergCands[MRG_B0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3773 3411 #if H_3D_VSP 3774 3412 , 3775 3413 false 3776 3414 #endif 3415 #if H_3D_SPIVMP 3777 3416 , false 3417 #endif 3778 3418 ); 3779 m_ baseListidc++;3419 m_numSpatialCands++; 3780 3420 } 3781 3421 3782 3422 // left bottom 3783 3784 3423 if (getAvailableFlagA0()) 3785 3424 { 3786 m_mergCands[MRG_A0].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3425 m_mergCands[MRG_A0].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3787 3426 #if H_3D_VSP 3788 3427 , false 3789 3428 #endif 3429 #if H_3D_SPIVMP 3790 3430 , false 3431 #endif 3791 3432 ); 3792 m_ baseListidc++;3433 m_numSpatialCands++; 3793 3434 } 3794 3435 3795 3436 // above left 3796 3797 3437 if (getAvailableFlagB2()) 3798 3438 { 3799 m_mergCands[MRG_B2].setCand( &pcM vFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]3439 m_mergCands[MRG_B2].setCand( &pcMFieldNeighbours[m_numSpatialCands<<1], puhInterDirNeighbours[m_numSpatialCands] 3800 3440 #if H_3D_VSP 3801 3441 , false 3802 3442 #endif 3443 #if H_3D_SPIVMP 3803 3444 , false 3445 #endif 3804 3446 ); 3805 m_baseListidc++; 3806 } 3807 3808 #endif 3447 m_numSpatialCands++; 3448 } 3809 3449 3810 3450 … … 4076 3716 #endif 4077 3717 3718 iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable; 3719 3720 #if H_3D_VSP 3721 ///////////////////////////////////////////////// 3722 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// 3723 ///////////////////////////////////////////////// 3724 if (iCount<getSlice()->getMaxNumMergeCand()) 3725 { 3726 if ( 3727 (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) && 3728 #if H_3D_IC 3729 !bICFlag && 3730 #endif 3731 #if H_3D_ARP 3732 !bARPFlag && 3733 #endif 4078 3734 #if H_3D 4079 iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable; 3735 (nPSW + nPSH > 12) && 3736 #endif 3737 #if H_3D_DBBP 3738 !bDBBPFlag && 3739 #endif 3740 xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) ) 3741 { 3742 return; 3743 } 3744 3745 // early termination 3746 if (iCount == getSlice()->getMaxNumMergeCand()) 3747 { 3748 return; 3749 } 3750 #endif 3751 #if H_3D_VSP 3752 } 3753 #endif 3754 3755 iCount += m_mergCands[MRG_B0].m_bAvailable; 3756 3757 #if H_3D_IV_MERGE 3758 ///////////////////////////////////////////// 3759 //////// INTER VIEW DISP COMP (IvDC) //////// 3760 ///////////////////////////////////////////// 3761 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 3762 { 3763 assert(iCount < getSlice()->getMaxNumMergeCand()); 3764 3765 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 3766 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 3767 if( ( ivCandDir[1] & 1 ) == 1 ) 3768 { 3769 tmpMV[0].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] ); 3770 } 3771 if( ( ivCandDir[1] & 2 ) == 2 ) 3772 { 3773 tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 3774 } 3775 3776 Bool bRemoveSpa = false; //pruning to A1, B1 3777 for(Int i = 0; i < 2; i ++) 3778 { 3779 if ( !m_mergCands[MRG_A1+i].m_bAvailable ) 3780 { 3781 continue; 3782 } 3783 if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1]) 3784 { 3785 bRemoveSpa = true; 3786 break; 3787 } 3788 } 3789 if(!bRemoveSpa) 3790 { 3791 #if NH_3D_NBDV 3792 tmpMV[0].getMv().setIDVFlag (false); 3793 tmpMV[1].getMv().setIDVFlag (false); 3794 #endif 3795 m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false); 3796 3797 if ( mrgCandIdx == iCount ) 3798 return; 3799 iCount ++; 3800 3801 // early termination 3802 if (iCount == getSlice()->getMaxNumMergeCand()) 3803 { 3804 return; 3805 } 3806 } 3807 } 3808 #endif // H_3D_IV_MERGE 3809 3810 iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable; 3811 3812 #if H_3D_IV_MERGE 3813 //////////////////////////////////////////////////// 3814 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 3815 //////////////////////////////////////////////////// 3816 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 3817 { 3818 if(xAddIvMRGCand( mrgCandIdx, iCount, ivCandDir, ivCandMv, ivCandRefIdx ) ) 3819 { 3820 return; 3821 } 3822 //early termination 3823 if (iCount == getSlice()->getMaxNumMergeCand()) 3824 { 3825 return; 3826 } 3827 } 3828 #endif 3829 } 3830 #endif 3831 3832 //! Construct a list of merging candidates 3833 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3834 { 3835 UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx; 3836 #if NH_3D_MLC 3837 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ]; 4080 3838 #else 3839 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 3840 #endif 3841 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 3842 { 3843 abCandIsInter[ui] = false; 3844 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 3845 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 3846 } 3847 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 3848 // compute the location of the current PU 3849 Int xP, yP, nPSW, nPSH; 3850 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 3851 3852 Int iCount = 0; 3853 3854 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 3855 PartSize cCurPS = getPartitionSize( uiAbsPartIdx ); 3856 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 3857 deriveLeftBottomIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 3858 4081 3859 //left 4082 3860 UInt uiLeftPartIdx = 0; 4083 3861 TComDataCU* pcCULeft = 0; 4084 3862 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 3863 4085 3864 Bool isAvailableA1 = pcCULeft && 4086 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 4087 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 4088 !pcCULeft->isIntra( uiLeftPartIdx ) ; 3865 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 3866 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 3867 pcCULeft->isInter( uiLeftPartIdx ) ; 3868 4089 3869 if ( isAvailableA1 ) 4090 3870 { 3871 #if NH_3D_MLC 3872 m_bAvailableFlagA1 = 1; 3873 #endif 4091 3874 abCandIsInter[iCount] = true; 4092 3875 // get Inter Dir … … 4098 3881 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4099 3882 } 4100 4101 3883 if ( mrgCandIdx == iCount ) 4102 3884 { … … 4107 3889 4108 3890 // early termination 4109 if (iCount == getSlice()->getMaxNumMergeCand()) 3891 if (iCount == getSlice()->getMaxNumMergeCand()) 4110 3892 { 4111 3893 return; 4112 3894 } 4113 4114 3895 // above 4115 3896 UInt uiAbovePartIdx = 0; 4116 3897 TComDataCU* pcCUAbove = 0; 4117 3898 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 3899 4118 3900 Bool isAvailableB1 = pcCUAbove && 4119 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 4120 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 4121 !pcCUAbove->isIntra( uiAbovePartIdx ); 3901 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 3902 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 3903 pcCUAbove->isInter( uiAbovePartIdx ); 3904 4122 3905 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 4123 3906 { 3907 #if NH_3D_MLC 3908 m_bAvailableFlagB1 = 1; 3909 #endif 4124 3910 abCandIsInter[iCount] = true; 4125 3911 // get Inter Dir … … 4131 3917 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4132 3918 } 4133 4134 3919 if ( mrgCandIdx == iCount ) 4135 3920 { … … 4139 3924 } 4140 3925 // early termination 4141 if (iCount == getSlice()->getMaxNumMergeCand()) 3926 if (iCount == getSlice()->getMaxNumMergeCand()) 4142 3927 { 4143 3928 return; … … 4148 3933 TComDataCU* pcCUAboveRight = 0; 4149 3934 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 3935 4150 3936 Bool isAvailableB0 = pcCUAboveRight && 4151 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 4152 !pcCUAboveRight->isIntra( uiAboveRightPartIdx ); 3937 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 3938 pcCUAboveRight->isInter( uiAboveRightPartIdx ); 3939 4153 3940 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4154 3941 { 3942 #if NH_3D_MLC 3943 m_bAvailableFlagB0 = 1; 3944 #endif 4155 3945 abCandIsInter[iCount] = true; 4156 3946 // get Inter Dir … … 4162 3952 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4163 3953 } 4164 4165 3954 if ( mrgCandIdx == iCount ) 4166 3955 { … … 4170 3959 } 4171 3960 // early termination 4172 if (iCount == getSlice()->getMaxNumMergeCand()) 3961 if (iCount == getSlice()->getMaxNumMergeCand()) 4173 3962 { 4174 3963 return; 4175 3964 } 4176 #endif 4177 4178 4179 #if H_3D_VSP 4180 ///////////////////////////////////////////////// 4181 //////// VIEW SYNTHESIS PREDICTION (VSP) //////// 4182 ///////////////////////////////////////////////// 4183 if (iCount<getSlice()->getMaxNumMergeCand()) 4184 { 4185 if ( 4186 (!getAvailableFlagA1() || !(pcCULeft->getVSPFlag(uiLeftPartIdx) != 0)) && 4187 #if H_3D_IC 4188 !bICFlag && 4189 #endif 4190 #if H_3D_ARP 4191 !bARPFlag && 4192 #endif 4193 #if H_3D 4194 (nPSW + nPSH > 12) && 4195 #endif 4196 #if H_3D_DBBP 4197 !bDBBPFlag && 4198 #endif 4199 xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) ) 4200 { 4201 return; 4202 } 4203 4204 // early termination 4205 if (iCount == getSlice()->getMaxNumMergeCand()) 4206 { 4207 return; 4208 } 4209 #endif 4210 #if H_3D_VSP 4211 } 4212 #endif 4213 4214 #if H_3D 4215 iCount += m_mergCands[MRG_B0].m_bAvailable; 4216 #endif 4217 4218 4219 #if H_3D_IV_MERGE 4220 ///////////////////////////////////////////// 4221 //////// INTER VIEW DISP COMP (IvDC) //////// 4222 ///////////////////////////////////////////// 4223 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 4224 { 4225 assert(iCount < getSlice()->getMaxNumMergeCand()); 4226 4227 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4228 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4229 if( ( ivCandDir[1] & 1 ) == 1 ) 4230 { 4231 tmpMV[0].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] ); 4232 } 4233 if( ( ivCandDir[1] & 2 ) == 2 ) 4234 { 4235 tmpMV[1].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] ); 4236 } 4237 4238 Bool bRemoveSpa = false; //pruning to A1, B1 4239 for(Int i = 0; i < 2; i ++) 4240 { 4241 if ( !m_mergCands[MRG_A1+i].m_bAvailable ) 4242 { 4243 continue; 4244 } 4245 if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1]) 4246 { 4247 bRemoveSpa = true; 4248 break; 4249 } 4250 } 4251 if(!bRemoveSpa) 4252 { 4253 #if NH_3D_NBDV 4254 tmpMV[0].getMv().setIDVFlag (false); 4255 tmpMV[1].getMv().setIDVFlag (false); 4256 #endif 4257 m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false); 4258 4259 if ( mrgCandIdx == iCount ) 4260 return; 4261 iCount ++; 4262 4263 // early termination 4264 if (iCount == getSlice()->getMaxNumMergeCand()) 4265 { 4266 return; 4267 } 4268 } 4269 } 4270 #endif // H_3D_IV_MERGE 4271 4272 4273 #if H_3D 4274 iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable; 4275 #else 3965 4276 3966 //left bottom 4277 3967 UInt uiLeftBottomPartIdx = 0; 4278 3968 TComDataCU* pcCULeftBottom = 0; 4279 3969 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 3970 4280 3971 Bool isAvailableA0 = pcCULeftBottom && 4281 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 4282 !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ; 3972 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 3973 pcCULeftBottom->isInter( uiLeftBottomPartIdx ) ; 3974 4283 3975 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4284 3976 { 3977 #if NH_3D_MLC 3978 m_bAvailableFlagA0 = 1; 3979 #endif 4285 3980 abCandIsInter[iCount] = true; 4286 3981 // get Inter Dir … … 4299 3994 } 4300 3995 // early termination 4301 if (iCount == getSlice()->getMaxNumMergeCand()) 3996 if (iCount == getSlice()->getMaxNumMergeCand()) 4302 3997 { 4303 3998 return; 4304 3999 } 4305 4000 4306 // above left 4001 // above left 4307 4002 if( iCount < 4 ) 4308 4003 { … … 4310 4005 TComDataCU* pcCUAboveLeft = 0; 4311 4006 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 4007 4312 4008 Bool isAvailableB2 = pcCUAboveLeft && 4313 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 4314 !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ); 4009 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 4010 pcCUAboveLeft->isInter( uiAboveLeftPartIdx ); 4011 4315 4012 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4316 4013 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) ) 4317 4014 { 4015 #if NH_3D_MLC 4016 m_bAvailableFlagB2 = 1; 4017 #endif 4318 4018 abCandIsInter[iCount] = true; 4319 4019 // get Inter Dir … … 4333 4033 } 4334 4034 // early termination 4335 if (iCount == getSlice()->getMaxNumMergeCand()) 4035 if (iCount == getSlice()->getMaxNumMergeCand()) 4336 4036 { 4337 4037 return; 4338 4038 } 4339 #endif 4340 4341 4342 #if H_3D_IV_MERGE 4343 //////////////////////////////////////////////////// 4344 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 4345 //////////////////////////////////////////////////// 4346 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 4347 { 4348 if(xAddIvMRGCand( mrgCandIdx, iCount, ivCandDir, ivCandMv, ivCandRefIdx ) ) 4349 { 4350 return; 4351 } 4352 //early termination 4353 if (iCount == getSlice()->getMaxNumMergeCand()) 4354 { 4355 return; 4356 } 4357 } 4358 #endif 4359 #if !H_3D 4360 if ( getSlice()->getEnableTMVPFlag()) 4039 4040 if ( getSlice()->getEnableTMVPFlag() ) 4361 4041 { 4362 4042 //>> MTK colocated-RightBottom 4363 4043 UInt uiPartIdxRB; 4364 4044 4365 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 4045 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 4366 4046 4367 4047 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 4368 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4048 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 4049 const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight(); 4369 4050 4370 4051 TComMv cColMv; 4371 4052 Int iRefIdx; 4372 Int uiLCUIdx = -1; 4373 4374 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check 4375 { 4376 } 4377 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 4378 { 4379 } 4380 else 4381 { 4382 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 4383 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 4384 { 4385 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 4386 uiLCUIdx = getAddr(); 4387 } 4388 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 4389 { 4390 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 4391 } 4392 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 4053 Int ctuRsAddr = -1; 4054 4055 if ( ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () ) // image boundary check 4056 && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 4057 { 4058 if ( ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) && // is not at the last column of CTU 4059 ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) ) // is not at the last row of CTU 4060 { 4061 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + numPartInCtuWidth + 1 ]; 4062 ctuRsAddr = getCtuRsAddr(); 4063 } 4064 else if ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) // is not at the last column of CTU But is last row of CTU 4065 { 4066 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + numPartInCtuWidth + 1) % m_pcPic->getNumPartitionsInCtu() ]; 4067 } 4068 else if ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) // is not at the last row of CTU But is last column of CTU 4393 4069 { 4394 4070 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 4395 uiLCUIdx = getAddr() + 1;4396 } 4397 else //is the right bottom corner of LCU4071 ctuRsAddr = getCtuRsAddr() + 1; 4072 } 4073 else //is the right bottom corner of CTU 4398 4074 { 4399 4075 uiAbsPartAddr = 0; 4400 4076 } 4401 4077 } 4402 4403 4078 4404 4079 iRefIdx = 0; 4080 4405 4081 Bool bExistMV = false; 4406 4082 UInt uiPartIdxCenter; 4407 UInt uiCurLCUIdx = getAddr();4408 4083 Int dir = 0; 4409 4084 UInt uiArrayAddr = iCount; 4410 4085 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4411 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx );4086 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_0, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx ); 4412 4087 if( bExistMV == false ) 4413 4088 { 4414 bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter,cColMv, iRefIdx );4089 bExistMV = xGetColMVP( REF_PIC_LIST_0, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4415 4090 } 4416 4091 if( bExistMV ) … … 4422 4097 if ( getSlice()->isInterB() ) 4423 4098 { 4424 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 4099 #if H_3D_TMVP 4100 iRefIdx = 0; 4101 #endif 4102 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_1, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx); 4425 4103 if( bExistMV == false ) 4426 4104 { 4427 bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx );4105 bExistMV = xGetColMVP( REF_PIC_LIST_1, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4428 4106 } 4429 4107 if( bExistMV ) … … 4433 4111 } 4434 4112 } 4435 4113 4436 4114 if (dir != 0) 4437 4115 { 4438 4116 puhInterDirNeighbours[uiArrayAddr] = dir; 4439 4117 abCandIsInter[uiArrayAddr] = true; 4118 #if NH_3D_NBDV 4119 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 4120 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 4121 #endif 4122 4440 4123 if ( mrgCandIdx == iCount ) 4441 4124 { … … 4445 4128 } 4446 4129 } 4447 // early termination 4448 if (iCount == getSlice()->getMaxNumMergeCand()) 4130 // early termination 4131 if (iCount == getSlice()->getMaxNumMergeCand()) 4449 4132 { 4450 4133 return; 4451 4134 } 4135 4452 4136 UInt uiArrayAddr = iCount; 4453 4137 UInt uiCutoff = uiArrayAddr; 4454 4455 if ( getSlice()->isInterB()) 4456 { 4457 UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 4458 UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 4138 4139 #if NH_3D_MLC 4140 if ( getSlice()->isInterB() && iCount<5) 4141 #else 4142 if ( getSlice()->isInterB() ) 4143 #endif 4144 { 4145 static const UInt NUM_PRIORITY_LIST=12; 4146 static const UInt uiPriorityList0[NUM_PRIORITY_LIST] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 4147 static const UInt uiPriorityList1[NUM_PRIORITY_LIST] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 4459 4148 4460 4149 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 4461 4150 { 4462 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 4151 assert(idx<NUM_PRIORITY_LIST); 4152 Int i = uiPriorityList0[idx]; 4153 Int j = uiPriorityList1[idx]; 4463 4154 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 4464 4155 { … … 4484 4175 } 4485 4176 // early termination 4486 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 4177 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 4487 4178 { 4488 4179 return; 4489 4180 } 4181 4490 4182 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0); 4183 4491 4184 Int r = 0; 4492 4185 Int refcnt = 0; … … 4503 4196 } 4504 4197 uiArrayAddr++; 4198 4505 4199 if ( refcnt == iNumRefIdx - 1 ) 4506 4200 { … … 4513 4207 } 4514 4208 } 4515 4516 4209 numValidMergeCand = uiArrayAddr; 4517 #endif 4518 } 4519 #else 4520 4521 //! Construct a list of merging candidates 4522 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 4523 { 4524 UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx; 4525 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 4526 for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui ) 4527 { 4528 abCandIsInter[ui] = false; 4529 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(NOT_VALID); 4530 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(NOT_VALID); 4531 } 4532 numValidMergeCand = getSlice()->getMaxNumMergeCand(); 4533 // compute the location of the current PU 4534 Int xP, yP, nPSW, nPSH; 4535 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 4536 4537 Int iCount = 0; 4538 4539 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 4540 PartSize cCurPS = getPartitionSize( uiAbsPartIdx ); 4541 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 4542 deriveLeftBottomIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 4543 4544 //left 4545 UInt uiLeftPartIdx = 0; 4546 TComDataCU* pcCULeft = 0; 4547 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 4548 4549 Bool isAvailableA1 = pcCULeft && 4550 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 4551 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 4552 pcCULeft->isInter( uiLeftPartIdx ) ; 4553 4554 if ( isAvailableA1 ) 4555 { 4556 abCandIsInter[iCount] = true; 4557 // get Inter Dir 4558 puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx ); 4559 // get Mv from Left 4560 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4561 if ( getSlice()->isInterB() ) 4562 { 4563 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4564 } 4565 if ( mrgCandIdx == iCount ) 4566 { 4567 return; 4568 } 4569 iCount ++; 4570 } 4571 4572 // early termination 4573 if (iCount == getSlice()->getMaxNumMergeCand()) 4574 { 4575 return; 4576 } 4577 // above 4578 UInt uiAbovePartIdx = 0; 4579 TComDataCU* pcCUAbove = 0; 4580 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 4581 4582 Bool isAvailableB1 = pcCUAbove && 4583 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 4584 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && 4585 pcCUAbove->isInter( uiAbovePartIdx ); 4586 4587 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 4588 { 4589 abCandIsInter[iCount] = true; 4590 // get Inter Dir 4591 puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx ); 4592 // get Mv from Left 4593 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4594 if ( getSlice()->isInterB() ) 4595 { 4596 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4597 } 4598 if ( mrgCandIdx == iCount ) 4599 { 4600 return; 4601 } 4602 iCount ++; 4603 } 4604 // early termination 4605 if (iCount == getSlice()->getMaxNumMergeCand()) 4606 { 4607 return; 4608 } 4609 4610 // above right 4611 UInt uiAboveRightPartIdx = 0; 4612 TComDataCU* pcCUAboveRight = 0; 4613 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 4614 4615 Bool isAvailableB0 = pcCUAboveRight && 4616 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 4617 pcCUAboveRight->isInter( uiAboveRightPartIdx ); 4618 4619 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4620 { 4621 abCandIsInter[iCount] = true; 4622 // get Inter Dir 4623 puhInterDirNeighbours[iCount] = pcCUAboveRight->getInterDir( uiAboveRightPartIdx ); 4624 // get Mv from Left 4625 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4626 if ( getSlice()->isInterB() ) 4627 { 4628 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4629 } 4630 if ( mrgCandIdx == iCount ) 4631 { 4632 return; 4633 } 4634 iCount ++; 4635 } 4636 // early termination 4637 if (iCount == getSlice()->getMaxNumMergeCand()) 4638 { 4639 return; 4640 } 4641 4642 //left bottom 4643 UInt uiLeftBottomPartIdx = 0; 4644 TComDataCU* pcCULeftBottom = 0; 4645 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 4646 4647 Bool isAvailableA0 = pcCULeftBottom && 4648 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 4649 pcCULeftBottom->isInter( uiLeftBottomPartIdx ) ; 4650 4651 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4652 { 4653 abCandIsInter[iCount] = true; 4654 // get Inter Dir 4655 puhInterDirNeighbours[iCount] = pcCULeftBottom->getInterDir( uiLeftBottomPartIdx ); 4656 // get Mv from Left 4657 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4658 if ( getSlice()->isInterB() ) 4659 { 4660 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4661 } 4662 if ( mrgCandIdx == iCount ) 4663 { 4664 return; 4665 } 4666 iCount ++; 4667 } 4668 // early termination 4669 if (iCount == getSlice()->getMaxNumMergeCand()) 4670 { 4671 return; 4672 } 4673 4674 // above left 4675 if( iCount < 4 ) 4676 { 4677 UInt uiAboveLeftPartIdx = 0; 4678 TComDataCU* pcCUAboveLeft = 0; 4679 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 4680 4681 Bool isAvailableB2 = pcCUAboveLeft && 4682 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 4683 pcCUAboveLeft->isInter( uiAboveLeftPartIdx ); 4684 4685 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4686 && ( !isAvailableB1 || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) ) 4687 { 4688 abCandIsInter[iCount] = true; 4689 // get Inter Dir 4690 puhInterDirNeighbours[iCount] = pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx ); 4691 // get Mv from Left 4692 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 4693 if ( getSlice()->isInterB() ) 4694 { 4695 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 4696 } 4697 if ( mrgCandIdx == iCount ) 4698 { 4699 return; 4700 } 4701 iCount ++; 4702 } 4703 } 4704 // early termination 4705 if (iCount == getSlice()->getMaxNumMergeCand()) 4706 { 4707 return; 4708 } 4709 4710 if ( getSlice()->getEnableTMVPFlag() ) 4711 { 4712 //>> MTK colocated-RightBottom 4713 UInt uiPartIdxRB; 4714 4715 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB ); 4716 4717 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 4718 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 4719 const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight(); 4720 4721 TComMv cColMv; 4722 Int iRefIdx; 4723 Int ctuRsAddr = -1; 4724 4725 if ( ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () ) // image boundary check 4726 && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 4727 { 4728 if ( ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) && // is not at the last column of CTU 4729 ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) ) // is not at the last row of CTU 4730 { 4731 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + numPartInCtuWidth + 1 ]; 4732 ctuRsAddr = getCtuRsAddr(); 4733 } 4734 else if ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) // is not at the last column of CTU But is last row of CTU 4735 { 4736 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + numPartInCtuWidth + 1) % m_pcPic->getNumPartitionsInCtu() ]; 4737 } 4738 else if ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) // is not at the last row of CTU But is last column of CTU 4739 { 4740 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 4741 ctuRsAddr = getCtuRsAddr() + 1; 4742 } 4743 else //is the right bottom corner of CTU 4744 { 4745 uiAbsPartAddr = 0; 4746 } 4747 } 4748 4749 iRefIdx = 0; 4750 4751 Bool bExistMV = false; 4752 UInt uiPartIdxCenter; 4753 Int dir = 0; 4754 UInt uiArrayAddr = iCount; 4755 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4756 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_0, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx ); 4757 if( bExistMV == false ) 4758 { 4759 bExistMV = xGetColMVP( REF_PIC_LIST_0, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4760 } 4761 if( bExistMV ) 4762 { 4763 dir |= 1; 4764 pcMvFieldNeighbours[ 2 * uiArrayAddr ].setMvField( cColMv, iRefIdx ); 4765 } 4766 4767 if ( getSlice()->isInterB() ) 4768 { 4769 bExistMV = ctuRsAddr >= 0 && xGetColMVP( REF_PIC_LIST_1, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx); 4770 if( bExistMV == false ) 4771 { 4772 bExistMV = xGetColMVP( REF_PIC_LIST_1, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx ); 4773 } 4774 if( bExistMV ) 4775 { 4776 dir |= 2; 4777 pcMvFieldNeighbours[ 2 * uiArrayAddr + 1 ].setMvField( cColMv, iRefIdx ); 4778 } 4779 } 4780 4781 if (dir != 0) 4782 { 4783 puhInterDirNeighbours[uiArrayAddr] = dir; 4784 abCandIsInter[uiArrayAddr] = true; 4785 4786 if ( mrgCandIdx == iCount ) 4787 { 4788 return; 4789 } 4790 iCount++; 4791 } 4792 } 4793 // early termination 4794 if (iCount == getSlice()->getMaxNumMergeCand()) 4795 { 4796 return; 4797 } 4798 4799 UInt uiArrayAddr = iCount; 4800 UInt uiCutoff = uiArrayAddr; 4801 4802 if ( getSlice()->isInterB() ) 4803 { 4804 static const UInt NUM_PRIORITY_LIST=12; 4805 static const UInt uiPriorityList0[NUM_PRIORITY_LIST] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3}; 4806 static const UInt uiPriorityList1[NUM_PRIORITY_LIST] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2}; 4807 4808 for (Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++) 4809 { 4810 assert(idx<NUM_PRIORITY_LIST); 4811 Int i = uiPriorityList0[idx]; 4812 Int j = uiPriorityList1[idx]; 4813 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 4814 { 4815 abCandIsInter[uiArrayAddr] = true; 4816 puhInterDirNeighbours[uiArrayAddr] = 3; 4817 4818 // get Mv from cand[i] and cand[j] 4819 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx()); 4820 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(j<<1)+1].getMv(), pcMvFieldNeighbours[(j<<1)+1].getRefIdx()); 4821 4822 Int iRefPOCL0 = m_pcSlice->getRefPOC( REF_PIC_LIST_0, pcMvFieldNeighbours[(uiArrayAddr<<1)].getRefIdx() ); 4823 Int iRefPOCL1 = m_pcSlice->getRefPOC( REF_PIC_LIST_1, pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getRefIdx() ); 4824 if (iRefPOCL0 == iRefPOCL1 && pcMvFieldNeighbours[(uiArrayAddr<<1)].getMv() == pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv()) 4825 { 4826 abCandIsInter[uiArrayAddr] = false; 4827 } 4828 else 4829 { 4830 uiArrayAddr++; 4831 } 4832 } 4833 } 4834 } 4835 // early termination 4836 if (uiArrayAddr == getSlice()->getMaxNumMergeCand()) 4837 { 4838 return; 4839 } 4840 4841 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0); 4842 4843 Int r = 0; 4844 Int refcnt = 0; 4845 while (uiArrayAddr < getSlice()->getMaxNumMergeCand()) 4846 { 4847 abCandIsInter[uiArrayAddr] = true; 4848 puhInterDirNeighbours[uiArrayAddr] = 1; 4849 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField( TComMv(0, 0), r); 4850 4851 if ( getSlice()->isInterB() ) 4852 { 4853 puhInterDirNeighbours[uiArrayAddr] = 3; 4854 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r); 4855 } 4856 uiArrayAddr++; 4857 4858 if ( refcnt == iNumRefIdx - 1 ) 4859 { 4860 r = 0; 4861 } 4862 else 4863 { 4864 ++r; 4865 ++refcnt; 4866 } 4867 } 4868 numValidMergeCand = uiArrayAddr; 4869 } 4870 #endif 4210 } 4871 4211 4872 4212 /** Check whether the current PU and a spatial neighboring PU are in a same ME region. -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibCommon/TComDataCU.h
r1217 r1233 197 197 DbbpTmpData m_sDBBPTmpData; 198 198 #endif 199 #if H_3D199 #if NH_3D_MLC 200 200 Bool m_bAvailableFlagA1; ///< A1 available flag 201 201 Bool m_bAvailableFlagB1; ///< B1 available flag … … 220 220 UInt m_uiTotalBins; ///< sum of partition bins 221 221 Char m_codedQP; 222 #if H_3D 223 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing 224 #endif 225 #if H_3D_IV_MERGE 226 TComMotionCand m_mergCands[MRG_IVSHIFT+1]; 227 Int m_baseListidc; 222 #if NH_3D_MLC 223 DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing 224 TComMotionCand m_mergCands[MRG_IVSHIFT+1]; ///< Motion candidates for merge mode 225 Int m_numSpatialCands; 228 226 #endif 229 227 … … 654 652 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 655 653 656 #if H_3D657 Bool getAvailableFlagA1() { return m_bAvailableFlagA1; }658 Bool getAvailableFlagB1() { return m_bAvailableFlagB1; }659 Bool getAvailableFlagB0() { return m_bAvailableFlagB0; }660 Bool getAvailableFlagA0() { return m_bAvailableFlagA0; }661 Bool getAvailableFlagB2() { return m_bAvailableFlagB2; }654 #if NH_3D_MLC 655 Bool getAvailableFlagA1() { return m_bAvailableFlagA1; } 656 Bool getAvailableFlagB1() { return m_bAvailableFlagB1; } 657 Bool getAvailableFlagB0() { return m_bAvailableFlagB0; } 658 Bool getAvailableFlagA0() { return m_bAvailableFlagA0; } 659 Bool getAvailableFlagB2() { return m_bAvailableFlagB2; } 662 660 Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } 663 661 Void buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours … … 670 668 , Int& numValidMergeCand 671 669 ); 672 Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); 673 Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 674 #else 670 Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours 671 #if H_3D_SPIVMP 672 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP 673 #endif 674 , Int& numValidMergeCand, Int mrgCandIdx = -1 ); 675 #endif 675 676 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); 676 #endif677 #if H_3D_SPIVMP678 , TComMvField* pcMvFieldSP, UChar* puhInterDirSP679 #endif680 677 681 678 #if H_3D_VSP -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibCommon/TComMotionInfo.h
r1217 r1233 192 192 //! \} 193 193 194 #if H_3D_IV_MERGE 194 #if NH_3D_MLC 195 /// class for container of merge candidate 195 196 class TComMotionCand 196 197 { … … 202 203 Int m_iVspFlag; 203 204 #endif 205 #if H_3D_SPIVMP 204 206 Bool m_bSPIVMPFlag; 207 #endif 205 208 206 209 public: … … 212 215 m_iVspFlag = 0; 213 216 #endif 217 #if H_3D_SPIVMP 214 218 m_bSPIVMPFlag = false; 219 #endif 215 220 } 216 221 … … 229 234 m_iVspFlag = 0; 230 235 #endif 236 #if H_3D_SPIVMP 231 237 m_bSPIVMPFlag = false; 238 #endif 232 239 m_cMvField[0].setMvField(cZeroMv, NOT_VALID); 233 240 m_cMvField[1].setMvField(cZeroMv, NOT_VALID); … … 238 245 , Int vspFlag 239 246 #endif 247 #if H_3D_SPIVMP 240 248 , Bool bSPIVMPFlag 249 #endif 241 250 ) 242 251 { … … 248 257 m_iVspFlag = vspFlag; 249 258 #endif 259 #if H_3D_SPIVMP 250 260 m_bSPIVMPFlag = bSPIVMPFlag; 251 } 252 253 261 #endif 262 } 263 254 264 Void getCand(Int iCount, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours 255 265 #if H_3D_VSP 256 266 , Int* vspFlag 257 267 #endif 268 #if H_3D_SPIVMP 258 269 , Bool* pbSPIVMPFlag 270 #endif 259 271 ) 260 272 { … … 265 277 vspFlag[iCount] = m_iVspFlag; 266 278 #endif 279 #if H_3D_SPIVMP 267 280 pbSPIVMPFlag[iCount] = m_bSPIVMPFlag; 281 #endif 268 282 } 269 283 }; -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibCommon/TypeDef.h
r1217 r1233 71 71 #define NH_3D_NBDV 1 72 72 #define NH_3D_NBDV_REF 1 73 #define NH_3D_MLC 1 73 74 #endif 74 75 … … 712 713 MD_ABOVE_LEFT ///< MVP of above left block 713 714 }; 714 #if H_3D715 #if NH_3D_MLC 715 716 enum DefaultMergCandOrder 716 717 { … … 725 726 MRG_A0, ///< Left bottom 726 727 MRG_B2, ///< Above left 727 MRG_IVSHIFT, ///< Shifted IVMC o fShifted IVDC. (These are mutually exclusive)728 MRG_IVSHIFT, ///< Shifted IVMC or Shifted IVDC. (These are mutually exclusive) 728 729 MRG_COL ///< Temporal co-located 729 730 }; -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibDecoder/TDecCu.cpp
r1217 r1233 385 385 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 386 386 #else 387 #if NH_3D_MLC 388 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 389 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 390 #else 387 391 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists 388 392 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 393 #endif 389 394 #endif 390 395 Int numValidMergeCand = 0; … … 402 407 #endif 403 408 409 404 410 #if H_3D_VSP 405 411 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 406 412 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 413 #endif 407 414 #if H_3D_SPIVMP 408 415 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; … … 413 420 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartition()]; 414 421 #endif 422 423 #if NH_3D_MLC 415 424 m_ppcCU[uiDepth]->initAvailableFlags(); 425 #endif 416 426 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 427 #if NH_3D_MLC 417 428 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 418 429 #if H_3D_SPIVMP … … 421 432 , numValidMergeCand, uiMergeIndex ); 422 433 423 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag 434 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 435 #if H_3D_VSP 436 , vspFlag 437 #endif 424 438 #if H_3D_SPIVMP 425 439 , bSPIVMPFlag 426 440 #endif 427 441 , numValidMergeCand ); 442 #endif 443 #if H_3D_VSP 428 444 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 429 #else 430 #if H_3D 431 m_ppcCU[uiDepth]->initAvailableFlags(); 432 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 433 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 434 #else 435 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 436 #endif 437 #endif 445 #endif 446 438 447 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 439 448 -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibDecoder/TDecEntropy.cpp
r1200 r1233 236 236 UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); 237 237 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 238 #if H_3D_IV_MERGE 238 //#if H_3D_IV_MERGE 239 #if NH_3D_MLC 239 240 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 240 241 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 483 484 { 484 485 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 486 487 #if NH_3D_MLC 488 #if H_3D_VSP 489 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 490 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 491 #endif 492 #if H_3D_SPIVMP 493 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 494 #endif 495 pcSubCU->initAvailableFlags(); 496 #endif 485 497 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 498 #if NH_3D_MLC 499 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 500 #if H_3D_SPIVMP 501 , pcMvFieldSP, puhInterDirSP 502 #endif 503 , numValidMergeCand ); 504 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 505 #if H_3D_VSP 506 , vspFlag 507 #endif 508 #if H_3D_SPIVMP 509 , bSPIVMPFlag 510 #endif 511 , numValidMergeCand ); 512 #if H_3D_VSP 513 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 514 #endif 515 #endif 486 516 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. 487 517 hasMergedCandList = true; … … 491 521 { 492 522 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 523 524 #if NH_3D_MLC 525 #if H_3D_VSP 526 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 527 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 528 #endif 529 #if H_3D_SPIVMP 530 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 531 #endif 532 pcSubCU->initAvailableFlags(); 533 #endif 493 534 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 535 #if NH_3D_MLC 536 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 537 #if H_3D_SPIVMP 538 , pcMvFieldSP, puhInterDirSP 539 #endif 540 ,numValidMergeCand, uiMergeIndex ); 541 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 542 #if H_3D_VSP 543 , vspFlag 544 #endif 545 #if H_3D_SPIVMP 546 , bSPIVMPFlag 547 #endif 548 ,numValidMergeCand ); 549 #if H_3D_VSP 550 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 551 #endif 552 #endif 494 553 } 495 554 -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibEncoder/TEncCu.cpp
r1217 r1233 1762 1762 { 1763 1763 assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE ); 1764 #if H_3D_IV_MERGE1764 #if NH_3D_MLC 1765 1765 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 1766 1766 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 1797 1797 1798 1798 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to CTU level 1799 1799 1800 #if H_3D_VSP 1800 1801 #if !H_3D_ARP … … 1802 1803 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1803 1804 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1804 rpcTempCU->m_bAvailableFlagA1 = 0; 1805 rpcTempCU->m_bAvailableFlagB1 = 0; 1806 rpcTempCU->m_bAvailableFlagB0 = 0; 1807 rpcTempCU->m_bAvailableFlagA0 = 0; 1808 rpcTempCU->m_bAvailableFlagB2 = 0; 1805 #if NH_3D_MLC 1806 rpcTempCU->initAvailableFlags(); 1807 #endif 1809 1808 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1810 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand ); 1811 #endif 1812 #else 1813 #if H_3D 1814 rpcTempCU->m_bAvailableFlagA1 = 0; 1815 rpcTempCU->m_bAvailableFlagB1 = 0; 1816 rpcTempCU->m_bAvailableFlagB0 = 0; 1817 rpcTempCU->m_bAvailableFlagA0 = 0; 1818 rpcTempCU->m_bAvailableFlagB2 = 0; 1819 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1820 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1821 #else 1809 #if NH_3D_MLC 1810 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 1811 #if H_3D_SPIVMP 1812 , pcMvFieldSP, puhInterDirSP 1813 #endif 1814 , numValidMergeCand 1815 ); 1816 1817 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag 1818 #if H_3D_SPIVMP 1819 , bSPIVMPFlag 1820 #endif 1821 , numValidMergeCand 1822 ); 1823 #endif 1824 #endif 1825 #else 1826 #if NH_3D_MLC 1827 rpcTempCU->initAvailableFlags(); 1828 #endif 1822 1829 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1823 #endif 1824 #endif 1825 #if H_3D_IV_MERGE 1830 #if NH_3D_MLC 1831 rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 1832 #if H_3D_SPIVMP 1833 , pcMvFieldSP, puhInterDirSP 1834 #endif 1835 , numValidMergeCand 1836 ); 1837 #if NH_3D_MLC 1838 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours 1839 #if H_3D_SPIVMP 1840 , bSPIVMPFlag 1841 #endif 1842 , numValidMergeCand 1843 ); 1844 #endif 1845 #endif 1846 #endif 1847 1848 1849 1850 1851 1852 1853 1854 1855 #if NH_3D_MLC 1826 1856 Int mergeCandBuffer[MRG_MAX_NUM_CANDS_MEM]; 1827 1857 #else … … 1831 1861 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui ) 1832 1862 #else 1863 #if NH_3D_MLC 1864 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui ) 1865 #else 1833 1866 for( UInt ui = 0; ui < numValidMergeCand; ++ui ) 1834 1867 #endif 1835 1868 #endif 1836 1869 { 1837 1870 mergeCandBuffer[ui] = 0; … … 1887 1920 ); 1888 1921 1889 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag 1922 rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours 1923 #if H_3D_VSP 1924 , vspFlag 1925 #endif 1890 1926 #if H_3D_SPIVMP 1891 1927 , bSPIVMPFlag -
branches/HTM-14.1-update-dev3-ETRI/source/Lib/TLibEncoder/TEncSearch.cpp
r1200 r1233 3925 3925 { 3926 3926 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set 3927 #if H_3D3927 #if NH_3D_MLC 3928 3928 pcCU->initAvailableFlags(); 3929 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );3929 pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 3930 3930 pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours 3931 3931 #if H_3D_SPIVMP … … 3942 3942 , pbSPIVMPFlag 3943 3943 #endif 3944 3944 , numValidMergeCand 3945 3945 ); 3946 3946 #else … … 3952 3952 else 3953 3953 { 3954 #if H_3D3954 #if NH_3D_MLC 3955 3955 pcCU->initAvailableFlags(); 3956 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);3956 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 3957 3957 pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours 3958 3958 #if H_3D_SPIVMP … … 3969 3969 , pbSPIVMPFlag 3970 3970 #endif 3971 3971 , numValidMergeCand 3972 3972 ); 3973 3973 #else
Note: See TracChangeset for help on using the changeset viewer.