Changeset 566 in 3DVCSoftware for branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 12 Aug 2013, 11:11:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev1-Mediatek/source/Lib/TLibCommon/TComDataCU.cpp
r542 r566 144 144 #if H_3D_VSP 145 145 m_piVSPFlag = NULL; 146 #if MTK_VSP_FIX_E0172 147 m_piVSPDir = NULL; 148 #endif 146 149 #endif 147 150 #if H_3D_ARP … … 187 190 #if H_3D_VSP 188 191 m_piVSPFlag = (Char* )xMalloc(Char, uiNumPartition); 192 #if MTK_VSP_FIX_E0172 193 m_piVSPDir = (Char* )xMalloc(Char, uiNumPartition); 194 #endif 189 195 #endif 190 196 m_puhLumaIntraDir = (UChar* )xMalloc(UChar, uiNumPartition); … … 336 342 #if H_3D_VSP 337 343 if ( m_piVSPFlag ) { xFree(m_piVSPFlag); m_piVSPFlag = NULL; } 344 #if MTK_VSP_FIX_E0172 345 if ( m_piVSPDir ) { xFree(m_piVSPDir ); m_piVSPDir = NULL; } 346 #endif 338 347 #endif 339 348 if ( m_puhLumaIntraDir ) { xFree(m_puhLumaIntraDir); m_puhLumaIntraDir = NULL; } … … 532 541 #if H_3D_VSP 533 542 m_piVSPFlag[ui] = pcFrom->m_piVSPFlag[ui]; 543 #if MTK_VSP_FIX_E0172 544 m_piVSPDir [ui] = pcFrom->m_piVSPDir[ui]; 545 #endif 534 546 #endif 535 547 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 571 583 #if H_3D_VSP 572 584 memset( m_piVSPFlag + firstElement, 0, numElements * sizeof( *m_piVSPFlag ) ); 585 #if MTK_VSP_FIX_E0172 586 memset( m_piVSPDir + firstElement, 0, numElements * sizeof( *m_piVSPDir ) ); 587 #endif 573 588 #endif 574 589 memset( m_puhLumaIntraDir + firstElement, DC_IDX, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 743 758 #if H_3D_VSP 744 759 m_piVSPFlag[ui] = 0; 760 #if MTK_VSP_FIX_E0172 761 m_piVSPDir [ui] = 0; 762 #endif 745 763 #endif 746 764 m_puhLumaIntraDir[ui] = DC_IDX; … … 835 853 #if H_3D_VSP 836 854 memset( m_piVSPFlag, 0, sizeof( Char ) * m_uiNumPartition ); 855 #if MTK_VSP_FIX_E0172 856 memset( m_piVSPDir , 0, sizeInChar ); 857 #endif 837 858 #endif 838 859 memset( m_puhLumaIntraDir, DC_IDX, iSizeInUchar ); … … 922 943 #if H_3D_VSP 923 944 m_piVSPFlag[ui]=pcCU->m_piVSPFlag[uiPartOffset+ui]; 945 #if MTK_VSP_FIX_E0172 946 m_piVSPDir[ui]=pcCU->m_piVSPDir[uiPartOffset+ui]; 947 #endif 924 948 #endif 925 949 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 1064 1088 #if H_3D_VSP 1065 1089 m_piVSPFlag = pcCU->getVSPFlag() + uiPart; 1090 #if MTK_VSP_FIX_E0172 1091 m_piVSPDir = pcCU->getVSPDir () + uiPart; 1092 #endif 1066 1093 #endif 1067 1094 … … 1211 1238 #if H_3D_VSP 1212 1239 m_piVSPFlag = pcCU->getVSPFlag() + uiAbsPartIdx; 1240 #if MTK_VSP_FIX_E0172 1241 m_piVSPDir = pcCU->getVSPDir () + uiAbsPartIdx; 1242 #endif 1213 1243 #endif 1214 1244 … … 1258 1288 #if H_3D_VSP 1259 1289 memcpy( m_piVSPFlag + uiOffset, pcCU->getVSPFlag(), sizeof( Char ) * uiNumPartition ); 1290 #if MTK_VSP_FIX_E0172 1291 memcpy( m_piVSPDir + uiOffset, pcCU->getVSPDir (), sizeInChar ); 1292 #endif 1260 1293 #endif 1261 1294 memcpy( m_puhLumaIntraDir + uiOffset, pcCU->getLumaIntraDir(), iSizeInUchar ); … … 1378 1411 #if H_3D_VSP 1379 1412 memcpy( rpcCU->getVSPFlag() + m_uiAbsIdxInLCU, m_piVSPFlag, sizeof( Char ) * m_uiNumPartition ); 1413 #if MTK_VSP_FIX_E0172 1414 memcpy( rpcCU->getVSPDir () + m_uiAbsIdxInLCU, m_piVSPDir , sizeInChar ); 1415 #endif 1380 1416 #endif 1381 1417 memcpy( rpcCU->getLumaIntraDir() + m_uiAbsIdxInLCU, m_puhLumaIntraDir, iSizeInUchar ); … … 1486 1522 #if H_3D_VSP 1487 1523 memcpy( rpcCU->getVSPFlag() + uiPartOffset, m_piVSPFlag, sizeof(Char) * uiQNumPart ); 1524 #if MTK_VSP_FIX_E0172 1525 memcpy( rpcCU->getVSPDir () + uiPartOffset, m_piVSPDir , sizeInChar ); 1526 #endif 1488 1527 #endif 1489 1528 memcpy( rpcCU->getLumaIntraDir() + uiPartOffset, m_puhLumaIntraDir, iSizeInUchar ); … … 2489 2528 setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2490 2529 } 2530 #if MTK_VSP_FIX_E0172 2531 Void TComDataCU::setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2532 { 2533 setSubPart<Char>( iVSPDir, m_piVSPDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 2534 } 2535 #endif 2491 2536 #endif 2492 2537 Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ) … … 2941 2986 * false: otherwise 2942 2987 */ 2988 #if MTK_VSP_FIX_E0172 2989 inline Bool TComDataCU::xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 2990 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int* vspDir ) 2991 #else 2943 2992 inline Bool TComDataCU::xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 2944 2993 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag ) 2994 #endif 2945 2995 { 2946 2996 if ( ucVspMergePos != H_3D_VSP_POSITION || 0 == m_pcSlice->getViewIndex() || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() ) … … 2957 3007 Int iRefListIdY = 0; 2958 3008 Int i; 2959 3009 #if MTK_VSP_FIX_E0172 3010 Int currViewId = m_pcSlice->getViewId(); 3011 Int derivedViewId = -1; 3012 Int otherViewId = -1; 3013 #endif 2960 3014 for( iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) 2961 3015 { … … 2968 3022 refViewAvailFlag = true; 2969 3023 predFlag[iRefListIdX] = 1; 3024 #if MTK_VSP_FIX_E0172 3025 vspDir[iCount] = iRefListIdX; 3026 derivedViewId = m_pcSlice->getRefPic(eRefPicList, i)->getViewId(); 3027 #endif 2970 3028 iRefListIdY = 1 - iRefListIdX; 2971 3029 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acDoNBDV, i ); … … 2988 3046 refViewAvailFlag = true; 2989 3047 predFlag[iRefListIdY] = 1; 3048 #if MTK_VSP_FIX_E0172 3049 TComMv cMv = pDInfo->m_acDoNBDV; 3050 otherViewId = m_pcSlice->getRefPic( eRefPicList, i)->getViewId(); 3051 Int iScale = xGetDistScaleFactor( currViewId, otherViewId, currViewId, derivedViewId ); 3052 if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) 3053 { 3054 cMv = cMv.scaleMv( iScale ); 3055 } 3056 else 3057 { 3058 3059 cMv = cMv; 3060 } 3061 clipMv( cMv ); 3062 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( cMv, i ); 3063 #else 2990 3064 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( pDInfo->m_acDoNBDV, i ); 3065 #endif 2991 3066 #if H_3D_NBDV 2992 3067 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].getMv().setIDVFlag (false); … … 3021 3096 #if H_3D_VSP 3022 3097 , Int* vspFlag 3098 #if MTK_VSP_FIX_E0172 3099 , Int* vspDir 3100 #endif 3023 3101 #endif 3024 3102 , Int& numValidMergeCand, Int mrgCandIdx … … 3210 3288 #if H_3D_VSP 3211 3289 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1) 3290 #if MTK_VSP_FIX_E0172 3291 { 3292 #endif 3212 3293 vspFlag[iCount] = 1; 3294 #if MTK_VSP_FIX_E0172 3295 vspDir[iCount] = pcCULeft->getVSPDir( uiLeftPartIdx ); 3296 } 3297 #endif 3213 3298 #endif 3214 3299 if ( mrgCandIdx == iCount ) … … 3278 3363 #if H_3D_VSP 3279 3364 if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 3365 #if MTK_VSP_FIX_E0172 3366 { 3367 #endif 3280 3368 vspFlag[iCount] = 1; 3369 #if MTK_VSP_FIX_E0172 3370 vspDir[iCount] = pcCUAbove->getVSPDir( uiAbovePartIdx ); 3371 } 3372 #endif 3281 3373 #endif 3282 3374 if ( mrgCandIdx == iCount ) … … 3324 3416 #if H_3D_VSP 3325 3417 if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 3418 #if MTK_VSP_FIX_E0172 3419 { 3420 #endif 3326 3421 vspFlag[iCount] = 1; 3422 #if MTK_VSP_FIX_E0172 3423 vspDir[iCount] = pcCUAboveRight->getVSPDir( uiAboveRightPartIdx); 3424 } 3425 #endif 3327 3426 #endif 3328 3427 if ( mrgCandIdx == iCount ) … … 3390 3489 3391 3490 #if H_3D_VSP 3491 #if MTK_VSP_FIX_E0172 3492 if ( xAddVspCand( H_3D_VSP_POSITION, mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, vspDir ) ) 3493 #else 3392 3494 if ( xAddVspCand( H_3D_VSP_POSITION, mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) ) 3495 #endif 3393 3496 return; 3394 3497 // early termination … … 3421 3524 #if H_3D_VSP 3422 3525 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1) 3526 #if MTK_VSP_FIX_E0172 3527 { 3528 #endif 3423 3529 vspFlag[iCount] = 1; 3530 #if MTK_VSP_FIX_E0172 3531 vspDir[iCount] = pcCULeftBottom->getVSPDir( uiLeftBottomPartIdx); 3532 } 3533 #endif 3424 3534 #endif 3425 3535 if ( mrgCandIdx == iCount ) … … 3461 3571 #if H_3D_VSP 3462 3572 if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 3573 #if MTK_VSP_FIX_E0172 3574 { 3575 #endif 3463 3576 vspFlag[iCount] = 1; 3577 #if MTK_VSP_FIX_E0172 3578 vspDir[iCount] = pcCUAboveLeft->getVSPDir( uiAboveLeftPartIdx); 3579 } 3580 #endif 3464 3581 #endif 3465 3582 if ( mrgCandIdx == iCount ) … … 4914 5031 Bool bCheck = false; 4915 5032 if ( curPosition == 0 && iLCUIdxRBNb >= 0 ) 5033 #if MTK_NBDV_TN_FIX_E0172 5034 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5035 #else 4916 5036 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5037 #endif 4917 5038 4918 5039 if (curPosition == 1 ) 5040 #if MTK_NBDV_TN_FIX_E0172 5041 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5042 #else 4919 5043 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5044 #endif 4920 5045 4921 5046 if( bCheck ) … … 5021 5146 pDInfo->m_acNBDV = cDispVec; 5022 5147 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 5148 #if !MTK_DVMCP_FIX_E0172 5023 5149 assert(pDInfo->m_aVIdxCan == 0); //Notes from QC: only works for CTC 5150 #endif 5024 5151 #if H_3D_NBDV_REF 5025 5152 TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); … … 5145 5272 paIDVInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.getIDVHor(), cMvPred.getIDVVer() ); 5146 5273 //Notes from QC: DvMCP is implemented in a way that doesn�t carry the reference view identifier as NBDV. It only works for CTC and needs to be fixed to be aligned with other part of the NBDV design. 5274 #if MTK_DVMCP_FIX_E0172 5275 paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = cMvPred.getIDVVId(); 5276 #else 5147 5277 paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = 0; 5278 #endif 5148 5279 paIDVInfo->m_bAvailab[iList][ uiMvpDvPos ] = true; 5149 5280 paIDVInfo->m_bFound = true; … … 5210 5341 } 5211 5342 } 5212 5343 #if MTK_NBDV_TN_FIX_E0172 5344 Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5345 #else 5213 5346 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5347 #endif 5214 5348 { 5215 5349 … … 5245 5379 else 5246 5380 { 5381 #if MTK_NBDV_TN_FIX_E0172 5382 if(getPic()->isTempIVRefValid(currCandPic, ilist, iColRefIdx)) 5383 { 5384 #endif 5247 5385 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx); 5248 5386 rcMv.setIDVFlag(0); … … 5250 5388 iStartViewIdx = iColViewIdx ; 5251 5389 return true; 5390 #if MTK_NBDV_TN_FIX_E0172 5391 } 5392 #endif 5252 5393 } 5253 5394 } … … 5328 5469 cMv.setIDVHor (cDv.getHor()); 5329 5470 cMv.setIDVVer (cDv.getVer()); 5471 #if MTK_DVMCP_FIX_E0172 5472 cMv.setIDVVId (iViewIndex); 5473 #endif 5330 5474 #endif 5331 5475 clipMv( cMv ); … … 5348 5492 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 5349 5493 { 5494 #if MTK_DIVMC_FIX_E0172 5495 if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan)) 5496 #else 5350 5497 if( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) 5498 #endif 5351 5499 { 5352 5500 abPdmAvailable[ iRefListId+2 ] = true;
Note: See TracChangeset for help on using the changeset viewer.