Changeset 597 in 3DVCSoftware
- Timestamp:
- 29 Aug 2013, 12:25:20 (11 years ago)
- Location:
- branches/HTM-DEV-2.0-dev0/source/Lib
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r542 r597 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_ALIGN_WD_E0172 946 m_pDvInfo[ ui ] = pcCU->m_pDvInfo[uiPartOffset+ui]; 947 #endif 948 #if MTK_VSP_FIX_E0172 949 m_piVSPDir[ui]=pcCU->m_piVSPDir[uiPartOffset+ui]; 950 #endif 924 951 #endif 925 952 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 1064 1091 #if H_3D_VSP 1065 1092 m_piVSPFlag = pcCU->getVSPFlag() + uiPart; 1093 #if MTK_VSP_FIX_E0172 1094 m_piVSPDir = pcCU->getVSPDir () + uiPart; 1095 #endif 1066 1096 #endif 1067 1097 … … 1211 1241 #if H_3D_VSP 1212 1242 m_piVSPFlag = pcCU->getVSPFlag() + uiAbsPartIdx; 1243 #if MTK_VSP_FIX_ALIGN_WD_E0172 1244 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1245 #endif 1246 #if MTK_VSP_FIX_E0172 1247 m_piVSPDir = pcCU->getVSPDir () + uiAbsPartIdx; 1248 #endif 1213 1249 #endif 1214 1250 … … 1258 1294 #if H_3D_VSP 1259 1295 memcpy( m_piVSPFlag + uiOffset, pcCU->getVSPFlag(), sizeof( Char ) * uiNumPartition ); 1296 #if MTK_VSP_FIX_ALIGN_WD_E0172 1297 memcpy( m_pDvInfo + uiOffset, pcCU->getDvInfo(), sizeof( *m_pDvInfo ) * uiNumPartition ); 1298 #endif 1299 #if MTK_VSP_FIX_E0172 1300 memcpy( m_piVSPDir + uiOffset, pcCU->getVSPDir (), sizeInChar ); 1301 #endif 1260 1302 #endif 1261 1303 memcpy( m_puhLumaIntraDir + uiOffset, pcCU->getLumaIntraDir(), iSizeInUchar ); … … 1378 1420 #if H_3D_VSP 1379 1421 memcpy( rpcCU->getVSPFlag() + m_uiAbsIdxInLCU, m_piVSPFlag, sizeof( Char ) * m_uiNumPartition ); 1422 #if MTK_VSP_FIX_ALIGN_WD_E0172 1423 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof( *m_pDvInfo ) * m_uiNumPartition ); 1424 #endif 1425 #if MTK_VSP_FIX_E0172 1426 memcpy( rpcCU->getVSPDir () + m_uiAbsIdxInLCU, m_piVSPDir , sizeInChar ); 1427 #endif 1380 1428 #endif 1381 1429 memcpy( rpcCU->getLumaIntraDir() + m_uiAbsIdxInLCU, m_puhLumaIntraDir, iSizeInUchar ); … … 1486 1534 #if H_3D_VSP 1487 1535 memcpy( rpcCU->getVSPFlag() + uiPartOffset, m_piVSPFlag, sizeof(Char) * uiQNumPart ); 1536 #if MTK_VSP_FIX_E0172 1537 memcpy( rpcCU->getVSPDir () + uiPartOffset, m_piVSPDir , sizeInChar ); 1538 #endif 1488 1539 #endif 1489 1540 memcpy( rpcCU->getLumaIntraDir() + uiPartOffset, m_puhLumaIntraDir, iSizeInUchar ); … … 2489 2540 setSubPart<Char>( iVSPFlag, m_piVSPFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2490 2541 } 2542 #if MTK_VSP_FIX_ALIGN_WD_E0172 2543 template<typename T> 2544 Void TComDataCU::setSubPartT( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ) 2545 { 2546 UInt uiCurrPartNumQ = (m_pcPic->getNumPartInCU() >> (2 * uiCUDepth)) >> 2; 2547 switch ( m_pePartSize[ uiCUAddr ] ) 2548 { 2549 case SIZE_2Nx2N: 2550 for (UInt ui = 0; ui < 4 * uiCurrPartNumQ; ui++) 2551 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2552 2553 break; 2554 case SIZE_2NxN: 2555 for (UInt ui = 0; ui < 2 * uiCurrPartNumQ; ui++) 2556 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2557 break; 2558 case SIZE_Nx2N: 2559 for (UInt ui = 0; ui < uiCurrPartNumQ; ui++) 2560 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2561 for (UInt ui = 0; ui < uiCurrPartNumQ; ui++) 2562 puhBaseLCU[uiCUAddr + 2 * uiCurrPartNumQ + ui] = uiParameter; 2563 break; 2564 case SIZE_NxN: 2565 for (UInt ui = 0; ui < uiCurrPartNumQ; ui++) 2566 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2567 break; 2568 case SIZE_2NxnU: 2569 if ( uiPUIdx == 0 ) 2570 { 2571 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1); ui++) 2572 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2573 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1); ui++) 2574 puhBaseLCU[uiCUAddr + uiCurrPartNumQ + ui] = uiParameter; 2575 2576 } 2577 else if ( uiPUIdx == 1 ) 2578 { 2579 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1); ui++) 2580 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2581 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1) + (uiCurrPartNumQ << 1); ui++) 2582 puhBaseLCU[uiCUAddr + uiCurrPartNumQ + ui] = uiParameter; 2583 2584 } 2585 else 2586 { 2587 assert(0); 2588 } 2589 break; 2590 case SIZE_2NxnD: 2591 if ( uiPUIdx == 0 ) 2592 { 2593 for (UInt ui = 0; ui < ((uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1)); ui++) 2594 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2595 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1); ui++) 2596 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + uiCurrPartNumQ + ui] = uiParameter; 2597 2598 } 2599 else if ( uiPUIdx == 1 ) 2600 { 2601 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1); ui++) 2602 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2603 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 1); ui++) 2604 puhBaseLCU[uiCUAddr + uiCurrPartNumQ + ui] = uiParameter; 2605 2606 } 2607 else 2608 { 2609 assert(0); 2610 } 2611 break; 2612 case SIZE_nLx2N: 2613 if ( uiPUIdx == 0 ) 2614 { 2615 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2616 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2617 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2618 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2619 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2620 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + ui] = uiParameter; 2621 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2622 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2623 2624 } 2625 else if ( uiPUIdx == 1 ) 2626 { 2627 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2628 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2629 for (UInt ui = 0; ui < (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)); ui++) 2630 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2631 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2632 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + ui] = uiParameter; 2633 for (UInt ui = 0; ui < (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)); ui++) 2634 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2635 2636 } 2637 else 2638 { 2639 assert(0); 2640 } 2641 break; 2642 case SIZE_nRx2N: 2643 if ( uiPUIdx == 0 ) 2644 { 2645 for (UInt ui = 0; ui < (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)); ui++) 2646 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2647 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2648 puhBaseLCU[uiCUAddr + uiCurrPartNumQ + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2649 for (UInt ui = 0; ui < (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)); ui++) 2650 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + ui] = uiParameter; 2651 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2652 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + uiCurrPartNumQ + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2653 2654 } 2655 else if ( uiPUIdx == 1 ) 2656 { 2657 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2658 puhBaseLCU[uiCUAddr + ui] = uiParameter; 2659 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2660 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2661 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2662 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + ui] = uiParameter; 2663 for (UInt ui = 0; ui < (uiCurrPartNumQ >> 2); ui++) 2664 puhBaseLCU[uiCUAddr + (uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1) + ui] = uiParameter; 2665 2666 } 2667 else 2668 { 2669 assert(0); 2670 } 2671 break; 2672 default: 2673 assert( 0 ); 2674 } 2675 2676 } 2677 #endif 2678 #if MTK_VSP_FIX_E0172 2679 Void TComDataCU::setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2680 { 2681 setSubPart<Char>( iVSPDir, m_piVSPDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 2682 } 2683 #endif 2491 2684 #endif 2492 2685 Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ) … … 2941 3134 * false: otherwise 2942 3135 */ 3136 #if MTK_VSP_FIX_E0172 3137 inline Bool TComDataCU::xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 3138 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int* vspDir ) 3139 #else 2943 3140 inline Bool TComDataCU::xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 2944 3141 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag ) 3142 #endif 2945 3143 { 2946 3144 if ( ucVspMergePos != H_3D_VSP_POSITION || 0 == m_pcSlice->getViewIndex() || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() ) … … 2957 3155 Int iRefListIdY = 0; 2958 3156 Int i; 2959 3157 #if MTK_VSP_FIX_ALIGN_WD_E0172 3158 Int currViewId = m_pcSlice->getViewId(); 3159 Int derivedViewId = -1; 3160 Int otherViewId = -1; 3161 #endif 3162 #if MTK_VSP_FIX_E0172 3163 Int currViewId = m_pcSlice->getViewId(); 3164 Int derivedViewId = -1; 3165 Int otherViewId = -1; 3166 #endif 2960 3167 for( iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) 2961 3168 { … … 2968 3175 refViewAvailFlag = true; 2969 3176 predFlag[iRefListIdX] = 1; 3177 #if MTK_VSP_FIX_ALIGN_WD_E0172 3178 derivedViewId = m_pcSlice->getRefPic(eRefPicList, i)->getViewId(); 3179 #endif 3180 #if MTK_VSP_FIX_E0172 3181 vspDir[iCount] = iRefListIdX; 3182 derivedViewId = m_pcSlice->getRefPic(eRefPicList, i)->getViewId(); 3183 #endif 2970 3184 iRefListIdY = 1 - iRefListIdX; 3185 #if H_3D_BVSP_FIX 3186 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i ); 3187 #else 2971 3188 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acDoNBDV, i ); 3189 #endif 2972 3190 #if H_3D_NBDV 2973 3191 pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].getMv().setIDVFlag (false); … … 2988 3206 refViewAvailFlag = true; 2989 3207 predFlag[iRefListIdY] = 1; 3208 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3209 #if H_3D_BVSP_FIX 3210 TComMv cMv = pDInfo->m_acNBDV; 3211 #else 3212 TComMv cMv = pDInfo->m_acDoNBDV; 3213 #endif 3214 otherViewId = m_pcSlice->getRefPic( eRefPicList, i)->getViewId(); 3215 Int iScale = xGetDistScaleFactor( currViewId, otherViewId, currViewId, derivedViewId ); 3216 if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) 3217 { 3218 cMv = cMv.scaleMv( iScale ); 3219 } 3220 else 3221 { 3222 3223 cMv = cMv; 3224 } 3225 clipMv( cMv ); 3226 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( cMv, i ); 3227 #else 3228 #if H_3D_BVSP_FIX 3229 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( pDInfo->m_acNBDV, i ); 3230 #else 2990 3231 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].setMvField( pDInfo->m_acDoNBDV, i ); 3232 #endif 3233 #endif 2991 3234 #if H_3D_NBDV 2992 3235 pcMvFieldNeighbours[(iCount<<1)+iRefListIdY].getMv().setIDVFlag (false); … … 3009 3252 } 3010 3253 3254 #endif 3255 3256 #if QC_INRIA_MTK_MRG_E0126 3257 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iPdmDir, TComMv* acPdmMv, 3258 Int* aiPdmRefIdx, Int iPosDmv, Int* vspFlag ) 3259 { 3260 for(Int iLoop = 0; iLoop < 2; iLoop ++ ) 3261 { 3262 if( iLoop == 1 ) 3263 { 3264 Int iFirDispCand = -1; 3265 if (xFirstDmvAvai(iCount, pcMvFieldNeighbours, iPdmDir, iPosDmv, vspFlag, iFirDispCand)) 3266 { 3267 TComMv cMv; 3268 cMv = pcMvFieldNeighbours[(iFirDispCand<<1)].getMv(); 3269 cMv.setHor(cMv.getHor()+4); 3270 if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps())) 3271 { 3272 cMv.setVer(0); 3273 } 3274 clipMv( cMv ); 3275 abCandIsInter[ iCount ] = true; 3276 puhInterDirNeighbours[ iCount ] = puhInterDirNeighbours[iFirDispCand]; 3277 pcMvFieldNeighbours[ iCount<<1 ].setMvField(cMv, pcMvFieldNeighbours[( iFirDispCand << 1)].getRefIdx() ); 3278 pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField(pcMvFieldNeighbours[(iFirDispCand << 1) + 1].getMv(), pcMvFieldNeighbours[( iFirDispCand << 1) + 1].getRefIdx() ); 3279 if( mrgCandIdx == iCount ) 3280 { 3281 return true; 3282 } 3283 iCount++; 3284 break; 3285 } 3286 } 3287 if(iPdmDir[iLoop + 2]) 3288 { 3289 abCandIsInter[ iCount ] = true; 3290 puhInterDirNeighbours[ iCount ] = iPdmDir[iLoop + 2]; 3291 if( ( iPdmDir[iLoop + 2] & 1 ) == 1 ) 3292 { 3293 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ (iLoop<<1) + 4 ], aiPdmRefIdx[ (iLoop<<1) + 4 ] ); 3294 } 3295 if( ( iPdmDir[iLoop + 2] & 2 ) == 2 ) 3296 { 3297 pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( acPdmMv[ (iLoop<<1) + 5 ], aiPdmRefIdx[ (iLoop<<1) + 5 ] ); 3298 } 3299 3300 bool bRemove = false; 3301 if(!iLoop && iPdmDir[0] > 0) 3302 { 3303 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3304 { 3305 bRemove = true; 3306 abCandIsInter [ iCount ] = false; 3307 puhInterDirNeighbours[iCount] = 0; 3308 TComMv cZeroMv; 3309 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 3310 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 3311 } 3312 } 3313 if(!bRemove) 3314 { 3315 #if H_3D_NBDV 3316 if(iLoop) 3317 { 3318 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 3319 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 3320 } 3321 #endif 3322 if( mrgCandIdx == iCount ) 3323 { 3324 return true; 3325 } 3326 iCount++; 3327 } 3328 break; 3329 } 3330 } 3331 return false; 3332 } 3333 3334 inline Bool TComDataCU::xFirstDmvAvai( Int& iCount, TComMvField* pcMvFieldNeighbours, Int* iPdmDir, Int iPosDmv, Int* vspFlag, Int& iFirDispCand ) 3335 { 3336 for ( Int i = (iPdmDir[0] ? 1: 0); i < iCount; i++ ) 3337 { 3338 if ( ( i == iPosDmv ) || ( vspFlag[ i ] == 1 ) ) 3339 { 3340 continue; 3341 } 3342 else if((pcMvFieldNeighbours[i<<1].getRefIdx()!=-1) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), pcMvFieldNeighbours[i<<1].getRefIdx())->getViewIndex())) 3343 { 3344 iFirDispCand = i; 3345 return true; 3346 } 3347 } 3348 return false; 3349 } 3350 3011 3351 #endif 3012 3352 /** Constructs a list of merging candidates … … 3021 3361 #if H_3D_VSP 3022 3362 , Int* vspFlag 3363 #if MTK_VSP_FIX_ALIGN_WD_E0172 3364 , InheritedVSPDisInfo* inheritedVSPDisInfo 3365 #endif 3366 #if MTK_VSP_FIX_E0172 3367 , Int* vspDir 3368 #endif 3023 3369 #endif 3024 3370 , Int& numValidMergeCand, Int mrgCandIdx … … 3058 3404 3059 3405 //===== add merge with predicted depth maps ===== 3406 #if QC_INRIA_MTK_MRG_E0126 3407 TComMv acPdmMv [8]; 3408 Int aiPdmRefIdx [8] = {-1, -1, -1, -1, -1, -1, -1, -1}; 3409 Int iPosDmv = -1; 3410 #else 3060 3411 TComMv acPdmMv [4]; 3061 3412 Int aiPdmRefIdx [4] = {-1, -1, -1, -1}; 3413 #endif 3062 3414 Bool bLeftAvai = false; 3063 3415 Int iPosLeftAbove[2] = {-1, -1}; … … 3072 3424 cDisInfo.m_acNBDV = getDvInfo(uiAbsPartIdx).m_acNBDV; 3073 3425 cDisInfo.m_aVIdxCan = getDvInfo(uiAbsPartIdx).m_aVIdxCan; 3074 3426 #if MTK_VSP_FIX_ALIGN_WD_E0172 3427 for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 3428 { 3429 inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo; 3430 } 3431 #endif 3075 3432 if( m_pcSlice->getIsDepth()) 3076 3433 { … … 3081 3438 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 3082 3439 { 3440 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 3441 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3442 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1].getRefIdx() ); 3443 if( (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0) && ( iValidDepRef >= 0 ) ) 3444 { 3445 TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv(); 3446 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 3447 cMvPred+=cAdd; 3448 cMvPred>>=2; 3449 clipMv(cMvPred); 3450 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,iValidDepRef); 3451 } 3452 3453 if ( getSlice()->isInterB() ) 3454 { 3455 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3456 iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx() ); 3457 if( (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0) && ( iValidDepRef >= 0) ) 3458 { 3459 TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv(); 3460 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 3461 cMvPred+=cAdd; 3462 cMvPred>>=2; 3463 clipMv(cMvPred); 3464 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,iValidDepRef); 3465 } 3466 } 3467 3468 puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0; 3469 puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0; 3470 3471 if( puhInterDirNeighbours[iCount] != 0 ) 3472 { 3473 abCandIsInter[iCount] = true; 3474 if ( mrgCandIdx == iCount ) 3475 { 3476 return; 3477 } 3478 iCount ++; 3479 } 3480 #else 3083 3481 abCandIsInter[iCount] = true; 3084 3482 puhInterDirNeighbours[iCount] = pcTextureCU->getInterDir( uiPartIdxCenter ); … … 3124 3522 } 3125 3523 iCount ++; 3126 } 3127 } 3128 3524 #endif//Bug fix 3525 } 3526 } 3527 3528 #if QC_INRIA_MTK_MRG_E0126 3529 Int iPdmDir[4] = {0, 0, 0, 0}; 3530 #else 3129 3531 Int iPdmDir[2] = {0, 0}; 3532 #endif 3130 3533 3131 3534 if ( ivMvPredFlag ) … … 3210 3613 #if H_3D_VSP 3211 3614 if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1) 3615 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3616 { 3617 #endif 3212 3618 vspFlag[iCount] = 1; 3619 #if MTK_VSP_FIX_ALIGN_WD_E0172 3620 xInheritVSPDisInfo(pcCULeft,uiLeftPartIdx,iCount,inheritedVSPDisInfo); 3621 } 3622 #endif 3623 #if MTK_VSP_FIX_E0172 3624 vspDir[iCount] = pcCULeft->getVSPDir( uiLeftPartIdx ); 3625 } 3626 #endif 3213 3627 #endif 3214 3628 if ( mrgCandIdx == iCount ) … … 3278 3692 #if H_3D_VSP 3279 3693 if (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 3694 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3695 { 3696 #endif 3280 3697 vspFlag[iCount] = 1; 3698 #if MTK_VSP_FIX_ALIGN_WD_E0172 3699 xInheritVSPDisInfo(pcCUAbove,uiAbovePartIdx,iCount,inheritedVSPDisInfo); 3700 } 3701 #endif 3702 #if MTK_VSP_FIX_E0172 3703 vspDir[iCount] = pcCUAbove->getVSPDir( uiAbovePartIdx ); 3704 } 3705 #endif 3281 3706 #endif 3282 3707 if ( mrgCandIdx == iCount ) … … 3324 3749 #if H_3D_VSP 3325 3750 if (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 3751 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3752 { 3753 #endif 3326 3754 vspFlag[iCount] = 1; 3755 #if MTK_VSP_FIX_ALIGN_WD_E0172 3756 xInheritVSPDisInfo(pcCUAboveRight,uiAboveRightPartIdx,iCount,inheritedVSPDisInfo); 3757 } 3758 #endif 3759 #if MTK_VSP_FIX_E0172 3760 vspDir[iCount] = pcCUAboveRight->getVSPDir( uiAboveRightPartIdx); 3761 } 3762 #endif 3327 3763 #endif 3328 3764 if ( mrgCandIdx == iCount ) … … 3376 3812 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 3377 3813 #endif 3814 #if QC_INRIA_MTK_MRG_E0126 3815 iPosDmv = iCount; 3816 #endif 3378 3817 if ( mrgCandIdx == iCount ) 3379 3818 return; … … 3390 3829 3391 3830 #if H_3D_VSP 3831 #if MTK_VSP_FIX_E0172 3832 if ( xAddVspCand( H_3D_VSP_POSITION, mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, vspDir ) ) 3833 #else 3392 3834 if ( xAddVspCand( H_3D_VSP_POSITION, mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag ) ) 3835 #endif 3393 3836 return; 3394 3837 // early termination … … 3421 3864 #if H_3D_VSP 3422 3865 if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1) 3866 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3867 { 3868 #endif 3423 3869 vspFlag[iCount] = 1; 3870 #if MTK_VSP_FIX_ALIGN_WD_E0172 3871 xInheritVSPDisInfo(pcCULeftBottom,uiLeftBottomPartIdx,iCount,inheritedVSPDisInfo); 3872 } 3873 #endif 3874 #if MTK_VSP_FIX_E0172 3875 vspDir[iCount] = pcCULeftBottom->getVSPDir( uiLeftBottomPartIdx); 3876 } 3877 #endif 3424 3878 #endif 3425 3879 if ( mrgCandIdx == iCount ) … … 3461 3915 #if H_3D_VSP 3462 3916 if (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 3917 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3918 { 3919 #endif 3463 3920 vspFlag[iCount] = 1; 3921 #if MTK_VSP_FIX_ALIGN_WD_E0172 3922 xInheritVSPDisInfo(pcCUAboveLeft,uiAboveLeftPartIdx,iCount,inheritedVSPDisInfo); 3923 } 3924 #endif 3925 #if MTK_VSP_FIX_E0172 3926 vspDir[iCount] = pcCUAboveLeft->getVSPDir( uiAboveLeftPartIdx); 3927 } 3928 #endif 3464 3929 #endif 3465 3930 if ( mrgCandIdx == iCount ) … … 3475 3940 return; 3476 3941 } 3942 #if QC_INRIA_MTK_MRG_E0126 3943 if( ivMvPredFlag ) 3944 { 3945 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, iPdmDir, acPdmMv, aiPdmRefIdx, iPosDmv, vspFlag)) 3946 { 3947 return; 3948 } 3949 //early termination 3950 if (iCount == getSlice()->getMaxNumMergeCand()) 3951 { 3952 return; 3953 } 3954 } 3955 #endif 3477 3956 if ( getSlice()->getEnableTMVPFlag()) 3478 3957 { … … 3656 4135 numValidMergeCand = uiArrayAddr; 3657 4136 } 3658 4137 #if MTK_VSP_FIX_ALIGN_WD_E0172 4138 inline Void TComDataCU::xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo* inheritedVSPDisInfo) 4139 { 4140 inheritedVSPDisInfo[iCount].m_acDvInfo.m_acNBDV = pcCURef->getDvInfo(uiAbsPartIdx).m_acNBDV; 4141 inheritedVSPDisInfo[iCount].m_acDvInfo.m_aVIdxCan = pcCURef->getDvInfo(uiAbsPartIdx).m_aVIdxCan; 4142 } 4143 #endif 3659 4144 /** Check whether the current PU and a spatial neighboring PU are in a same ME region. 3660 4145 * \param xN, xN location of the upper-left corner pixel of a neighboring PU … … 4888 5373 4889 5374 ///*** Derive bottom right neighbour position *** 5375 #if !SEC_SIMPLIFIED_NBDV_E0142 4890 5376 Int iLCUIdxRBNb = -1; 4891 5377 Int iPartIdxRBNb = -1; 4892 5378 xDeriveRightBottomNbIdx(iLCUIdxRBNb, iPartIdxRBNb ); 5379 #endif 4893 5380 4894 5381 ///*** Search temporal candidate pictures for disparity vector *** … … 4909 5396 } 4910 5397 5398 #if !SEC_SIMPLIFIED_NBDV_E0142 4911 5399 // Check BR and Center 4912 5400 for(Int curPosition = 0; curPosition < 2; curPosition++) 4913 5401 { 5402 #endif 4914 5403 Bool bCheck = false; 5404 #if !SEC_SIMPLIFIED_NBDV_E0142 4915 5405 if ( curPosition == 0 && iLCUIdxRBNb >= 0 ) 5406 #if MTK_NBDV_TN_FIX_E0172 5407 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5408 #else 4916 5409 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5410 #endif 4917 5411 4918 5412 if (curPosition == 1 ) 5413 #endif 5414 #if MTK_NBDV_TN_FIX_E0172 5415 bCheck = xGetColDisMV( curCandPic, eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5416 #else 4919 5417 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5418 #endif 4920 5419 4921 5420 if( bCheck ) … … 4936 5435 return true; 4937 5436 } 5437 #if !SEC_SIMPLIFIED_NBDV_E0142 4938 5438 } 5439 #endif 4939 5440 } 4940 5441 } … … 4967 5468 } 4968 5469 5470 #if !SEC_SIMPLIFIED_NBDV_E0142 4969 5471 //// ******* Get disparity from above right block ******* ///// 4970 5472 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true); … … 5007 5509 return true; 5008 5510 } 5511 #endif 5009 5512 5010 5513 //// ******* Search MCP blocks ******* ///// … … 5021 5524 pDInfo->m_acNBDV = cDispVec; 5022 5525 pDInfo->m_aVIdxCan = cIDVInfo.m_aVIdxCan[iList][ curPos ]; 5526 #if !MTK_DVMCP_FIX_E0172 5023 5527 assert(pDInfo->m_aVIdxCan == 0); //Notes from QC: only works for CTC 5528 #endif 5024 5529 #if H_3D_NBDV_REF 5025 5530 TComPic* picDepth = getSlice()->getIvPic( true, pDInfo->m_aVIdxCan ); … … 5040 5545 TComMv defaultDV(0, 0); 5041 5546 pDInfo->m_acNBDV = defaultDV; 5547 #if NBDV_DEFAULT_VIEWIDX_BUGFIX 5548 Int valid = 0; 5549 Int viewIndex = 0; 5550 for( UInt uiBId = 0; uiBId < getSlice()->getViewIndex() && valid==0; uiBId++ ) 5551 { 5552 UInt uiBaseId = uiBId; 5553 TComPic* pcBasePic = getSlice()->getIvPic( false, uiBaseId ); 5554 for( Int iRefListId = 0; ( iRefListId < (getSlice()->isInterB()? 2:1) ) && !getSlice()->isIntra() && valid==0; iRefListId++ ) 5555 { 5556 RefPicList eRefPicListTest = RefPicList( iRefListId ); 5557 Int iNumRefPics = getSlice()->getNumRefIdx( eRefPicListTest ) ; 5558 for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ ) 5559 { 5560 if(pcBasePic->getPOC() == getSlice()->getRefPic( eRefPicListTest, iRefIndex )->getPOC() 5561 && pcBasePic->getViewIndex() == getSlice()->getRefPic( eRefPicListTest, iRefIndex )->getViewIndex()) 5562 { 5563 valid=1; 5564 viewIndex = uiBaseId; 5565 break; 5566 } 5567 } 5568 } 5569 } 5570 if(valid) 5571 { 5572 pDInfo->m_aVIdxCan = viewIndex; 5573 #if H_3D_NBDV_REF 5574 TComPic* picDepth = NULL; 5575 picDepth = getSlice()->getIvPic( true, viewIndex ); 5576 assert(picDepth!=NULL); 5577 5578 if (picDepth && bDepthRefine) 5579 { 5580 estimateDVFromDM(viewIndex, uiPartIdx, picDepth, uiPartAddr, &defaultDV ); // from base view 5581 } 5582 pDInfo->m_acDoNBDV = defaultDV; 5583 #endif 5584 } 5585 #else 5042 5586 pDInfo->m_aVIdxCan = 0; 5043 5587 #if H_3D_NBDV_REF … … 5052 5596 pDInfo->m_acDoNBDV = defaultDV; 5053 5597 #endif 5054 5598 #endif 5055 5599 return false; 5056 5600 } … … 5061 5605 Int iPictureWidth = pcBaseViewDepthPicYuv->getWidth(); 5062 5606 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(); 5063 5607 5608 #if NTT_DoNBDV_VECTOR_CLIP_E0141 5609 Int depthStartPosX = Clip3(0, iPictureWidth - 1, iBlkX + ((mv->getHor()+2)>>2)); 5610 Int depthStartPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((mv->getVer()+2)>>2)); 5611 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2)); 5612 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5613 #else 5064 5614 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2)); 5065 5615 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2)); 5066 5616 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2)); 5067 5617 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5618 #endif 5068 5619 5069 5620 Pel* depthTL = pcBaseViewDepthPicYuv->getLumaAddr(); … … 5144 5695 assert( uiMvpDvPos < IDV_CANDS ); 5145 5696 paIDVInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.getIDVHor(), cMvPred.getIDVVer() ); 5146 //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. 5697 //Notes from QC: DvMCP is implemented in a way that doesnE½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. 5698 #if MTK_DVMCP_FIX_E0172 5699 paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = cMvPred.getIDVVId(); 5700 #else 5147 5701 paIDVInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = 0; 5702 #endif 5148 5703 paIDVInfo->m_bAvailab[iList][ uiMvpDvPos ] = true; 5149 5704 paIDVInfo->m_bFound = true; … … 5210 5765 } 5211 5766 } 5212 5767 #if MTK_VSP_FIX_ALIGN_WD_E0172 5768 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ) 5769 { 5770 setSubPartT<DisInfo>( cDvInfo, m_pDvInfo, uiAbsPartIdx, uiDepth, uiPUIdx ); 5771 } 5772 #endif 5773 #if MTK_NBDV_TN_FIX_E0172 5774 Bool TComDataCU::xGetColDisMV( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5775 #else 5213 5776 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5777 #endif 5214 5778 { 5215 5779 … … 5245 5809 else 5246 5810 { 5811 #if MTK_NBDV_TN_FIX_E0172 5812 if(getPic()->isTempIVRefValid(currCandPic, ilist, iColRefIdx)) 5813 { 5814 #endif 5247 5815 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiPartUnitIdx); 5248 5816 rcMv.setIDVFlag(0); … … 5250 5818 iStartViewIdx = iColViewIdx ; 5251 5819 return true; 5820 #if MTK_NBDV_TN_FIX_E0172 5821 } 5822 #endif 5252 5823 } 5253 5824 } … … 5284 5855 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 5285 5856 5857 #if !QC_INRIA_MTK_MRG_E0126 5286 5858 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 5287 5859 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 )); … … 5292 5864 5293 5865 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 5294 5866 #endif 5867 #if QC_INRIA_MTK_MRG_E0126 5868 Bool abPdmAvailable[8] = {false, false, false, false, false, false, false, false}; 5869 #else 5295 5870 Bool abPdmAvailable[4] = {false, false, false, false}; 5871 #endif 5296 5872 #if H_3D_NBDV 5873 #if QC_INRIA_MTK_MRG_E0126 5874 for( Int i = 0; i < 8; i++) 5875 #else 5297 5876 for( Int i = 0; i < 4; i++) 5877 #endif 5298 5878 { 5299 5879 pacPdmMv[i].setIDVFlag (false); 5300 5880 } 5881 #endif 5882 #if QC_INRIA_MTK_MRG_E0126 5883 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5884 { 5885 Int iBaseCUAddr; 5886 Int iBaseAbsPartIdx; 5887 5888 Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth/2)*4) + 4 ); 5889 Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 ); 5890 5891 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 5892 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 5893 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 5894 5895 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 5301 5896 #endif 5302 5897 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) … … 5322 5917 if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 5323 5918 { 5919 #if QC_INRIA_MTK_MRG_E0126 5920 abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true; 5921 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 5922 #if H_3D_NBDV 5923 cMv.setIDVFlag (true); 5924 cMv.setIDVHor (cDv.getHor()); 5925 cMv.setIDVVer (cDv.getVer()); 5926 #if MTK_DVMCP_FIX_E0172 5927 cMv.setIDVVId (iViewIndex); 5928 #endif 5929 #endif 5930 clipMv( cMv ); 5931 paiPdmRefIdx [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx; 5932 pacPdmMv [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv; 5933 #else 5324 5934 abPdmAvailable[ uiCurrRefListId ] = true; 5325 5935 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); … … 5328 5938 cMv.setIDVHor (cDv.getHor()); 5329 5939 cMv.setIDVVer (cDv.getVer()); 5940 #if MTK_DVMCP_FIX_E0172 5941 cMv.setIDVVId (iViewIndex); 5942 #endif 5330 5943 #endif 5331 5944 clipMv( cMv ); 5332 5945 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 5333 5946 pacPdmMv [ uiCurrRefListId ] = cMv; 5947 #endif 5334 5948 stopLoop = true; 5335 5949 break; … … 5341 5955 } 5342 5956 } 5957 #if QC_INRIA_MTK_MRG_E0126 5958 } 5959 #endif 5960 #if QC_INRIA_MTK_MRG_E0126 5961 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5962 { 5963 availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0); 5964 } 5965 #else 5343 5966 availableMcDc[0] = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 5967 #endif 5344 5968 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 5345 5969 { … … 5348 5972 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 5349 5973 { 5974 #if MTK_DIVMC_FIX_E0172 5975 if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan)) 5976 #else 5350 5977 if( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) 5351 { 5978 #endif 5979 { 5980 #if QC_INRIA_MTK_MRG_E0126 5981 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5982 { 5983 Int ioffsetDV = (iLoopCan == 0) ? 0 : 4; 5984 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 5985 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 5986 #if H_3D_NBDV_REF 5987 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 5988 #endif 5989 cMv.setHor( cMv.getHor() + ioffsetDV ); 5990 cMv.setVer( 0 ); 5991 clipMv( cMv ); 5992 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; 5993 } 5994 break; 5995 #else 5352 5996 abPdmAvailable[ iRefListId+2 ] = true; 5353 5997 paiPdmRefIdx [ iRefListId+2 ] = iPdmRefIdx; … … 5360 6004 pacPdmMv [ iRefListId + 2] = cMv; 5361 6005 break; 5362 } 5363 } 5364 } 6006 #endif 6007 } 6008 } 6009 } 6010 #if QC_INRIA_MTK_MRG_E0126 6011 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 6012 { 6013 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 6014 } 6015 #else 5365 6016 availableMcDc[1] = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ); 6017 #endif 5366 6018 return false; 5367 6019 } -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.h
r531 r597 197 197 Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not 198 198 ///< 0: non-VSP; 1: VSP 199 #if MTK_VSP_FIX_E0172 200 Char* m_piVSPDir; ///< 0: LIST0; 1: LIST1 201 #endif 199 202 #endif 200 203 #if H_3D_ARP … … 246 249 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 247 250 #if H_3D_VSP 251 #if MTK_VSP_FIX_E0172 252 Bool xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 253 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int* vspDir ); 254 #else 248 255 Bool xAddVspCand( UChar ucVspMergePos, Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 249 256 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag ); 257 #endif 258 #endif 259 #if QC_INRIA_MTK_MRG_E0126 260 Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iPdmDir, TComMv* acPdmMv, 261 Int* aiPdmRefIdx, Int iPosDmv, Int* vspFlag ); 262 Bool xFirstDmvAvai( Int& iCount, TComMvField* pcMvFieldNeighbours, Int* iPdmDir, Int iPosDmv, Int* vspFlag, Int& iFirDispCand ); 250 263 #endif 251 264 … … 422 435 template <typename T> 423 436 Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 424 437 #if MTK_VSP_FIX_ALIGN_WD_E0172 438 template<typename T> 439 Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 440 #endif 425 441 #if AMP_MRG 426 442 Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } … … 448 464 #if H_3D_NBDV 449 465 Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); 466 #if MTK_VSP_FIX_ALIGN_WD_E0172 467 Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); 468 #endif 450 469 DisInfo* getDvInfo () { return m_pDvInfo; } 451 470 DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } … … 473 492 #endif 474 493 ); 494 #if MTK_NBDV_TN_FIX_E0172 495 Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 496 #else 475 497 Bool xGetColDisMV ( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 498 #endif 476 499 Bool getDisMvpCandNBDV ( DisInfo* pDInfo 477 500 #if H_3D_NBDV_REF … … 632 655 #if H_3D_VSP 633 656 , Int* vspFlag 657 #if MTK_VSP_FIX_ALIGN_WD_E0172 658 , InheritedVSPDisInfo* inheritedVSPDisInfo 659 #endif 660 #if MTK_VSP_FIX_E0172 661 , Int* vspDir 662 #endif 634 663 #endif 635 664 , Int& numValidMergeCand, Int mrgCandIdx = -1 ); 665 #if MTK_VSP_FIX_ALIGN_WD_E0172 666 inline Void xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo* inheritedVSPDisInfo); 667 #endif 636 668 #if H_3D_VSP 637 669 Char* getVSPFlag () { return m_piVSPFlag; } … … 639 671 Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } 640 672 Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 673 #if MTK_VSP_FIX_E0172 674 Char* getVSPDir () { return m_piVSPDir; } 675 Char getVSPDir ( UInt uiIdx ) { return m_piVSPDir[uiIdx]; } 676 Void setVSPDir ( UInt uiIdx, Int n ) { m_piVSPDir[uiIdx] = n; } 677 Void setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 678 #endif 641 679 #endif 642 680 Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComMotionInfo.h
r478 r597 76 76 Bool m_bFound; 77 77 } IDVInfo; 78 #endif 79 #if MTK_VSP_FIX_ALIGN_WD_E0172 80 typedef struct _InheritedVSPDisCand 81 { 82 DisInfo m_acDvInfo; 83 } InheritedVSPDisInfo; 78 84 #endif 79 85 // ==================================================================================================================== -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComMv.h
r499 r597 58 58 Short m_iIDVHor; 59 59 Short m_iIDVVer; 60 #if MTK_DVMCP_FIX_E0172 61 Short m_iIDVVId; //view index of the IDV 62 #endif 60 63 #endif 61 64 public: … … 72 75 , m_iIDVHor(0) 73 76 , m_iIDVVer(0) 77 #if MTK_DVMCP_FIX_E0172 78 , m_iIDVVId(0) 79 #endif 74 80 #endif 75 81 { … … 83 89 , m_iIDVHor(0) 84 90 , m_iIDVVer(0) 91 #if MTK_DVMCP_FIX_E0172 92 , m_iIDVVId(0) 93 #endif 85 94 #endif 86 95 { … … 97 106 #if H_3D_NBDV 98 107 m_bIDV = false; m_iIDVHor = m_iIDVVer = 0; 108 #if MTK_DVMCP_FIX_E0172 109 m_iIDVVId = 0; 110 #endif 99 111 #endif 100 112 } … … 103 115 Void setIDVVer (Short i) {m_iIDVVer = i;} 104 116 Void setIDVFlag (Bool b ) {m_bIDV = b;} 117 #if MTK_DVMCP_FIX_E0172 118 Void setIDVVId (Short i) {m_iIDVVId = i;} 119 #endif 105 120 #endif 106 121 // ------------------------------------------------------------------------------------------------------------------ … … 116 131 Short getIDVVer () const { return m_iIDVVer; } 117 132 Bool getIDVFlag() const { return m_bIDV; } 133 #if MTK_DVMCP_FIX_E0172 134 Short getIDVVId () const { return m_iIDVVId; } 135 #endif 118 136 #endif 119 137 // ------------------------------------------------------------------------------------------------------------------ -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPic.cpp
r539 r597 655 655 } 656 656 #endif 657 #if MTK_NBDV_TN_FIX_E0172 658 Void TComPic::checkTemporalIVRef() 659 { 660 TComSlice* currSlice = getSlice(getCurrSliceIdx()); 661 const Int numCandPics = this->getNumDdvCandPics(); 662 for(Int curCandPic = 0; curCandPic < numCandPics; curCandPic++) 663 { 664 RefPicList eCurRefPicList = REF_PIC_LIST_0 ; 665 Int curCandPicRefIdx = 0; 666 if( curCandPic == 0 ) 667 { 668 eCurRefPicList = RefPicList(currSlice->isInterB() ? 1-currSlice->getColFromL0Flag() : 0); 669 curCandPicRefIdx = currSlice->getColRefIdx(); 670 } 671 else 672 { 673 eCurRefPicList = this->getRapRefList(); 674 curCandPicRefIdx = this->getRapRefIdx(); 675 } 676 TComPic* pcCandColPic = currSlice->getRefPic( eCurRefPicList, curCandPicRefIdx); 677 TComSlice* pcCandColSlice = pcCandColPic->getSlice(0);// currently only support single slice 678 679 if(!pcCandColSlice->isIntra()) 680 { 681 for( Int iColRefDir = 0; iColRefDir < (pcCandColSlice->isInterB() ? 2: 1); iColRefDir ++ ) 682 { 683 for( Int iColRefIdx =0; iColRefIdx < pcCandColSlice->getNumRefIdx(( RefPicList )iColRefDir ); iColRefIdx++) 684 { 685 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false; 686 Int iColViewIdx = pcCandColSlice->getViewIndex(); 687 Int iColRefViewIdx = pcCandColSlice->getRefPic( ( RefPicList )iColRefDir, iColRefIdx)->getViewIndex(); 688 if(iColViewIdx == iColRefViewIdx) 689 continue; 690 691 for(Int iCurrRefDir = 0;(iCurrRefDir < (currSlice->isInterB() ? 2: 1)) && (m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] == false ); iCurrRefDir++) 692 { 693 for( Int iCurrRefIdx =0; iCurrRefIdx < currSlice->getNumRefIdx(( RefPicList )iCurrRefDir ); iCurrRefIdx++) 694 { 695 if( currSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx )->getViewIndex() == iColRefViewIdx ) 696 { 697 m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = true; 698 break; 699 } 700 } 701 } 702 } 703 } 704 } 705 } 706 } 707 Bool TComPic::isTempIVRefValid(Int currCandPic, Int iColRefDir, Int iColRefIdx) 708 { 709 return m_abTIVRINCurrRL[currCandPic][iColRefDir][iColRefIdx]; 710 } 711 #endif 712 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 713 Void TComPic::checkTextureRef( ) 714 { 715 TComSlice* pcCurrSlice = getSlice(getCurrSliceIdx()); 716 TComPic* pcTextPic = pcCurrSlice->getTexturePic(); 717 TComSlice* pcTextSlice = pcTextPic->getSlice(0); // currently only support single slice 718 719 for( Int iTextRefDir = 0; (iTextRefDir < (pcTextSlice->isInterB()? 2:1) ) && !pcTextSlice->isIntra(); iTextRefDir ++ ) 720 { 721 for( Int iTextRefIdx =0; iTextRefIdx<pcTextSlice->getNumRefIdx(( RefPicList )iTextRefDir ); iTextRefIdx++) 722 { 723 Int iTextRefPOC = pcTextSlice->getRefPOC( ( RefPicList )iTextRefDir, iTextRefIdx); 724 Int iTextRefViewId = pcTextSlice->getRefPic( ( RefPicList )iTextRefDir, iTextRefIdx)->getViewIndex(); 725 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = -1; 726 Int iCurrRefDir = iTextRefDir; 727 for( Int iCurrRefIdx =0; ( iCurrRefIdx<pcCurrSlice->getNumRefIdx(( RefPicList )iCurrRefDir ) ) && ( m_aiTexToDepRef[iTextRefDir][iTextRefIdx] < 0 ) ; iCurrRefIdx++) 728 { 729 if( pcCurrSlice->getRefPOC( ( RefPicList )iCurrRefDir, iCurrRefIdx ) == iTextRefPOC && 730 pcCurrSlice->getRefPic( ( RefPicList )iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId ) 731 { 732 m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx; 733 } 734 } 735 } 736 737 } 738 } 739 740 Int TComPic::isTextRefValid(Int iTextRefDir, Int iTextRefIdx) 741 { 742 return m_aiTexToDepRef[iTextRefDir][iTextRefIdx]; 743 } 744 #endif 657 745 //! \} -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPic.h
r541 r597 104 104 Int m_iNumDdvCandPics; 105 105 #endif 106 #if MTK_NBDV_TN_FIX_E0172 107 Bool m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists 108 #endif 109 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 110 Int m_aiTexToDepRef [2][MAX_NUM_REF]; 111 #endif 106 112 public: 107 113 TComPic(); … … 215 221 RefPicList getRapRefList() {return m_eRapRefList; } 216 222 #endif 223 #if MTK_NBDV_TN_FIX_E0172 224 Void checkTemporalIVRef(); 225 Bool isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx); 226 #endif 227 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 228 Void checkTextureRef( ); 229 Int isTextRefValid(Int iTextRefDir, Int iTextRefIdx); 230 #endif 217 231 /** transfer ownership of seis to this picture */ 218 232 void setSEIs(SEIMessages& seis) { m_SEIs = seis; } -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r537 r597 63 63 if (m_pDepthBlock != NULL) 64 64 free(m_pDepthBlock); 65 #if NTT_VSP_COMMON_E0207_E0208 66 m_cYuvDepthOnVsp.destroy(); 67 #endif 65 68 #endif 66 69 … … 119 122 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 120 123 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 124 #endif 125 #if NTT_VSP_COMMON_E0207_E0208 126 m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight ); 121 127 #endif 122 128 } … … 697 703 { 698 704 // Get depth reference 705 #if MTK_VSP_FIX_E0172 706 Int vspDir = pcCU->getVSPDir( uiPartAddr ); 707 RefPicList privateRefPicList = (vspDir == 0) ? REF_PIC_LIST_0 : REF_PIC_LIST_1; 708 Int privateRefIdx = pcCU->getCUMvField( privateRefPicList )->getRefIdx( uiPartAddr ); 709 Int depthRefViewIdx = pcCU->getSlice()->getRefPic(privateRefPicList, privateRefIdx)->getViewIndex(); 710 #else 699 711 Int depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 712 #endif 700 713 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx ); 701 714 assert(pRefPicBaseDepth != NULL); … … 716 729 717 730 // Do compensation 731 #if MTK_VSP_FIX_ALIGN_WD_E0172 732 TComMv cDv = pcCU->getDvInfo(uiPartAddr).m_acNBDV; 733 #else 734 #if MTK_VSP_FIX_E0172 735 TComMv cDv = pcCU->getCUMvField( privateRefPicList )->getMv( uiPartAddr ); 736 #else 718 737 TComMv cDv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); // cDv is the disparity vector derived from the neighbors 738 #endif 739 #endif // end of MTK_VSP_FIX_ALIGN_WD_E0172 719 740 pcCU->clipMv(cDv); 741 742 #if NTT_VSP_COMMON_E0207_E0208 743 // fetch virtual depth map 744 #if NTT_VSP_VECTOR_CLIP_E0208 745 pcBaseViewDepthPicYuv->extendPicBorder(); 746 #endif 747 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp ); 748 // sub-PU based compensation 749 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 750 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 751 #else 720 752 UInt uiAbsPartIdx = pcCU->getZorderIdxInCU(); 721 753 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; … … 723 755 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 724 756 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 757 #endif 758 725 759 } 726 760 #endif … … 1502 1536 1503 1537 #if H_3D_VSP 1538 1539 #if NTT_VSP_COMMON_E0207_E0208 1540 // not fully support iRatioTxtPerDepth* != 1 1541 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) 1542 { 1543 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; 1544 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE; 1545 1546 Int refDepStride = picRefDepth->getStride(); 1547 1548 #if NTT_VSP_VECTOR_CLIP_E0208 1549 1550 Int refDepOffset = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride; 1551 Pel *refDepth = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ); 1552 1553 if( ratioTxtPerDepthX!=1 || ratioTxtPerDepthY!=1 ) 1554 { 1555 Int posX, posY; 1556 refDepth = picRefDepth->getLumaAddr( ); 1557 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture 1558 posX /= ratioTxtPerDepthX; // texture position -> depth postion 1559 posY /= ratioTxtPerDepthY; 1560 refDepOffset += posX + posY * refDepStride; 1561 1562 width /= ratioTxtPerDepthX; // texture size -> depth size 1563 height /= ratioTxtPerDepthY; 1564 } 1565 1566 refDepth += refDepOffset; 1567 1568 #else // NTT_VSP_VECTOR_CLIP_E0208 1569 1570 Int widthDepth = picRefDepth->getWidth(); 1571 Int heightDepth = picRefDepth->getHeight(); 1572 Int posX, posY; 1573 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture 1574 posX /= ratioTxtPerDepthX; // texture position -> depth postion 1575 posY /= ratioTxtPerDepthY; 1576 1577 posX = Clip3(0, widthDepth-width, posX + ((mv->getHor()+2)>>2)); 1578 posY = Clip3(0, heightDepth-height, posY + ((mv->getVer()+2)>>2)); 1579 1580 Pel *refDepth = picRefDepth->getLumaAddr() + posX + posY * refDepStride; 1581 1582 #endif // NTT_VSP_VECTOR_CLIP_E0208 1583 1584 Int depStride = yuvDepth->getStride(); 1585 Pel *depth = yuvDepth->getLumaAddr(); 1586 1587 #if NTT_VSP_ADAPTIVE_SPLIT_E0207 1588 1589 if( width<8 || height<8 ) 1590 { // no split 1591 Int rightOffset = width - 1; 1592 Int depStrideBlock = depStride * nTxtPerDepthY; 1593 Pel *refDepthTop = refDepth; 1594 Pel *refDepthBot = refDepthTop + (height-1)*refDepStride; 1595 1596 Pel maxDepth = refDepthTop[0] > refDepthBot[0] ? refDepthTop[0] : refDepthBot[0]; 1597 if( maxDepth < refDepthTop[rightOffset] ) { maxDepth = refDepthTop[rightOffset]; } 1598 if( maxDepth < refDepthBot[rightOffset] ) { maxDepth = refDepthBot[rightOffset]; } 1599 1600 for( Int sY=0; sY<height; sY+=nTxtPerDepthY ) 1601 { 1602 for( Int sX=0; sX<width; sX+=nTxtPerDepthX ) 1603 { 1604 depth[sX] = maxDepth; 1605 } 1606 depth += depStrideBlock; 1607 } 1608 } 1609 else 1610 { // split to 4x8, or 8x4 1611 Int blocksize = 8; 1612 Int subblocksize = 4; 1613 Int depStrideBlock = depStride * blocksize; 1614 Pel *depthTmp = NULL; 1615 Int depStrideTmp = depStride * nTxtPerDepthY; 1616 Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 }; 1617 Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL }; 1618 Pel repDepth4x8[2] = {0, 0}; 1619 Pel repDepth8x4[2] = {0, 0}; 1620 1621 Int refDepStrideBlock = refDepStride * blocksize; 1622 Int refDepStrideSubBlock = refDepStride * subblocksize; 1623 1624 refDepthTmp[0] = refDepth; 1625 refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock; 1626 refDepthTmp[1] = refDepthTmp[2] - refDepStride; 1627 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 1628 1629 for( Int y=0; y<height; y+=blocksize ) 1630 { 1631 for( Int x=0; x<width; x+=blocksize ) 1632 { 1633 Bool ULvsBR = false, URvsBL = false; 1634 1635 ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]]; 1636 URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]]; 1637 1638 if( ULvsBR ^ URvsBL ) 1639 { // 4x8 1640 repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]]; 1641 if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] ) 1642 { 1643 repDepth4x8[0] = refDepthTmp[3][x+offset[0]]; 1644 } 1645 if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] ) 1646 { 1647 repDepth4x8[0] = refDepthTmp[3][x+offset[1]]; 1648 } 1649 repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]]; 1650 if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] ) 1651 { 1652 repDepth4x8[1] = refDepthTmp[3][x+offset[2]]; 1653 } 1654 if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] ) 1655 { 1656 repDepth4x8[1] = refDepthTmp[3][x+offset[3]]; 1657 } 1658 1659 depthTmp = &depth[x]; 1660 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY ) 1661 { 1662 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX ) 1663 { 1664 depthTmp[sX] = repDepth4x8[0]; 1665 } 1666 depthTmp += depStrideTmp; 1667 } 1668 depthTmp = &depth[x+subblocksize]; 1669 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY ) 1670 { 1671 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX ) 1672 { 1673 depthTmp[sX] = repDepth4x8[1]; 1674 } 1675 depthTmp += depStrideTmp; 1676 } 1677 } 1678 else 1679 { // 8x4 1680 repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]]; 1681 if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] ) 1682 { 1683 repDepth8x4[0] = refDepthTmp[1][x+offset[0]]; 1684 } 1685 if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] ) 1686 { 1687 repDepth8x4[0] = refDepthTmp[1][x+offset[3]]; 1688 } 1689 repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]]; 1690 if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] ) 1691 { 1692 repDepth8x4[1] = refDepthTmp[3][x+offset[0]]; 1693 } 1694 if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] ) 1695 { 1696 repDepth8x4[1] = refDepthTmp[3][x+offset[3]]; 1697 } 1698 1699 depthTmp = &depth[x]; 1700 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY ) 1701 { 1702 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX ) 1703 { 1704 depthTmp[sX] = repDepth8x4[0]; 1705 } 1706 depthTmp += depStrideTmp; 1707 } 1708 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY ) 1709 { 1710 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX ) 1711 { 1712 depthTmp[sX] = repDepth8x4[1]; 1713 } 1714 depthTmp += depStrideTmp; 1715 } 1716 } 1717 } 1718 refDepthTmp[0] += refDepStrideBlock; 1719 refDepthTmp[1] += refDepStrideBlock; 1720 refDepthTmp[2] += refDepStrideBlock; 1721 refDepthTmp[3] += refDepStrideBlock; 1722 depth += depStrideBlock; 1723 } 1724 } 1725 1726 #else // NTT_VSP_ADAPTIVE_SPLIT_E0207 1727 1728 Int rightOffset = nTxtPerDepthX - 1; 1729 Int depStrideBlock = depStride * nTxtPerDepthY; 1730 Int refDepStrideBlock = refDepStride * nTxtPerDepthY; 1731 Pel *refDepthTop = refDepth; 1732 Pel *refDepthBot = refDepthTop + (nTxtPerDepthY-1)*refDepStride; 1733 1734 for( Int y=0; y<height; y+= nTxtPerDepthY ) 1735 { 1736 for( Int x=0; x<width; x+=nTxtPerDepthX ) 1737 { 1738 Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x]; 1739 1740 if( maxDepth < refDepthTop[x+rightOffset] ) 1741 { 1742 maxDepth = refDepthTop[x+rightOffset]; 1743 } 1744 if( maxDepth < refDepthBot[x+rightOffset] ) 1745 { 1746 maxDepth = refDepthBot[x+rightOffset]; 1747 } 1748 1749 depth[x] = maxDepth; 1750 1751 } 1752 refDepthTop += refDepStrideBlock; 1753 refDepthBot += refDepStrideBlock; 1754 depth += depStrideBlock; 1755 } 1756 1757 #endif // NTT_VSP_ADAPTIVE_SPLIT_E0207 1758 } 1759 1760 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi ) 1761 { 1762 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; 1763 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE; 1764 1765 Int refStride = picRef->getStride(); 1766 Int dstStride = yuvDst->getStride(); 1767 Int depStride = yuvDepth->getStride(); 1768 Int refStrideBlock = refStride * nTxtPerDepthY; 1769 Int dstStrideBlock = dstStride * nTxtPerDepthY; 1770 Int depStrideBlock = depStride * nTxtPerDepthY; 1771 1772 Pel *ref = picRef->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ); 1773 Pel *dst = yuvDst->getLumaAddr(partAddr); 1774 Pel *depth = yuvDepth->getLumaAddr(); 1775 1776 #if !(NTT_VSP_DC_BUGFIX_E0208) 1777 Int widthLuma = picRef->getWidth(); 1778 Int posX, posY; 1779 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture 1780 #endif 1781 1782 #if H_3D_VSP_BLOCKSIZE == 1 1783 #if H_3D_VSP_CONSTRAINED 1784 //get LUT based horizontal reference range 1785 Int range = xGetConstrainedSize(width, height); 1786 1787 // The minimum depth value 1788 Int minRelativePos = MAX_INT; 1789 Int maxRelativePos = MIN_INT; 1790 1791 Pel* depthTemp, *depthInitial=depth; 1792 for (Int yTxt = 0; yTxt < height; yTxt++) 1793 { 1794 for (Int xTxt = 0; xTxt < width; xTxt++) 1795 { 1796 if (depthPosX+xTxt < widthDepth) 1797 { 1798 depthTemp = depthInitial + xTxt; 1799 } 1800 else 1801 { 1802 depthTemp = depthInitial + (widthDepth - depthPosX - 1); 1803 } 1804 1805 Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec; 1806 Int disparityInt = disparity >> 2; 1807 1808 if( disparity <= 0) 1809 { 1810 if (minRelativePos > disparityInt+xTxt) 1811 { 1812 minRelativePos = disparityInt+xTxt; 1813 } 1814 } 1815 else 1816 { 1817 if (maxRelativePos < disparityInt+xTxt) 1818 { 1819 maxRelativePos = disparityInt+xTxt; 1820 } 1821 } 1822 } 1823 if (depthPosY+yTxt < heightDepth) 1824 { 1825 depthInitial = depthInitial + depStride; 1826 } 1827 } 1828 1829 Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec; 1830 if (disparity_tmp <= 0) 1831 { 1832 maxRelativePos = minRelativePos + range -1 ; 1833 } 1834 else 1835 { 1836 minRelativePos = maxRelativePos - range +1 ; 1837 } 1838 #endif 1839 #endif // H_3D_VSP_BLOCKSIZE == 1 1840 1841 TComMv dv(0, 0); 1842 1843 for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY ) 1844 { 1845 for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX ) 1846 { 1847 Pel repDepth = depth[ xTxt ]; 1848 assert( repDepth >= 0 && repDepth <= 255 ); 1849 1850 Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ?? 1851 Int xFrac = disparity & 0x3; 1852 1853 #if NTT_VSP_DC_BUGFIX_E0208 1854 1855 dv.setHor( disparity ); 1856 cu->clipMv( dv ); 1857 1858 Int refOffset = xTxt + (dv.getHor() >> 2); 1859 1860 #if H_3D_VSP_CONSTRAINED 1861 if(refOffset<minRelativePos || refOffset>maxRelativePos) 1862 { 1863 xFrac = 0; 1864 } 1865 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 1866 #endif 1867 1868 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 1869 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 1870 1871 #else // NTT_VSP_DC_BUGFIX_E0208 1872 1873 for( Int j=0; j < nTxtPerDepthX; j++ ) 1874 { 1875 Int refOffset = xTxt+j + (disparity >> 2); 1876 #if H_3D_VSP_CONSTRAINED 1877 if(refOffset<minRelativePos || refOffset>maxRelativePos) 1878 { 1879 xFrac = 0; 1880 } 1881 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 1882 #endif 1883 Int absX = posX + refOffset; 1884 1885 if (xFrac == 0) 1886 { 1887 absX = Clip3(0, widthLuma-1, absX); 1888 } 1889 else 1890 { 1891 absX = Clip3(4, widthLuma-5, absX); 1892 } 1893 1894 refOffset = absX - posX; 1895 assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 ); 1896 1897 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi ); 1898 } 1899 1900 #endif // NTT_VSP_DC_BUGFIX_E0208 1901 1902 } 1903 ref += refStrideBlock; 1904 dst += dstStrideBlock; 1905 depth += depStrideBlock; 1906 } 1907 1908 } 1909 1910 Void TComPrediction::xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi ) 1911 { 1912 #if (H_3D_VSP_BLOCKSIZE==1) 1913 Int nTxtPerDepthX = 1; 1914 Int nTxtPerDepthY = 1; 1915 #else 1916 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1; 1917 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1; 1918 #endif 1919 1920 Int refStride = picRef->getCStride(); 1921 Int dstStride = yuvDst->getCStride(); 1922 Int depStride = yuvDepth->getStride(); 1923 Int refStrideBlock = refStride * nTxtPerDepthY; 1924 Int dstStrideBlock = dstStride * nTxtPerDepthY; 1925 Int depStrideBlock = depStride * (nTxtPerDepthY<<1); 1926 1927 Pel *refCb = picRef->getCbAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ); 1928 Pel *refCr = picRef->getCrAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr ); 1929 Pel *dstCb = yuvDst->getCbAddr(partAddr); 1930 Pel *dstCr = yuvDst->getCrAddr(partAddr); 1931 Pel *depth = yuvDepth->getLumaAddr(); 1932 1933 #if !(NTT_VSP_DC_BUGFIX_E0208) 1934 Int widthChroma = picRef->getWidth() >> 1; 1935 Int posX, posY; 1936 cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture 1937 posX >>= 1; 1938 posY >>= 1; 1939 #endif 1940 1941 #if H_3D_VSP_BLOCKSIZE == 1 1942 #if H_3D_VSP_CONSTRAINED 1943 //get LUT based horizontal reference range 1944 Int range = xGetConstrainedSize(width, height, false); 1945 1946 // The minimum depth value 1947 Int minRelativePos = MAX_INT; 1948 Int maxRelativePos = MIN_INT; 1949 1950 Int depthTmp; 1951 for (Int yTxt=0; yTxt<height; yTxt++) 1952 { 1953 for (Int xTxt=0; xTxt<width; xTxt++) 1954 { 1955 depthTmp = m_pDepthBlock[xTxt+yTxt*width]; 1956 Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec; 1957 Int disparityInt = disparity >> 3;//in chroma resolution 1958 1959 if (disparityInt < 0) 1960 { 1961 if (minRelativePos > disparityInt+xTxt) 1962 { 1963 minRelativePos = disparityInt+xTxt; 1964 } 1965 } 1966 else 1967 { 1968 if (maxRelativePos < disparityInt+xTxt) 1969 { 1970 maxRelativePos = disparityInt+xTxt; 1971 } 1972 } 1973 } 1974 } 1975 1976 depthTmp = m_pDepthBlock[0]; 1977 Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec; 1978 if ( disparity_tmp < 0 ) 1979 { 1980 maxRelativePos = minRelativePos + range - 1; 1981 } 1982 else 1983 { 1984 minRelativePos = maxRelativePos - range + 1; 1985 } 1986 1987 #endif // H_3D_VSP_CONSTRAINED 1988 #endif // H_3D_VSP_BLOCKSIZE == 1 1989 1990 TComMv dv(0, 0); 1991 // luma size -> chroma size 1992 height >>= 1; 1993 width >>= 1; 1994 1995 for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY ) 1996 { 1997 for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX ) 1998 { 1999 Pel repDepth = depth[ xTxt<<1 ]; 2000 assert( repDepth >= 0 && repDepth <= 255 ); 2001 2002 Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec; 2003 Int xFrac = disparity & 0x7; 2004 2005 #if NTT_VSP_DC_BUGFIX_E0208 2006 2007 dv.setHor( disparity ); 2008 cu->clipMv( dv ); 2009 2010 Int refOffset = xTxt + (dv.getHor() >> 3); 2011 2012 #if H_3D_VSP_CONSTRAINED 2013 if(refOffset<minRelativePos || refOffset>maxRelativePos) 2014 { 2015 xFrac = 0; 2016 } 2017 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2018 #endif 2019 2020 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 2021 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 2022 2023 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2024 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2025 2026 #else // NTT_VSP_DC_BUGFIX_E0208 2027 2028 for( Int j=0; j < nTxtPerDepthX; j++ ) 2029 { 2030 Int refOffset = xTxt+j + (disparity >> 3); 2031 #if H_3D_VSP_CONSTRAINED 2032 if(refOffset<minRelativePos || refOffset>maxRelativePos) 2033 { 2034 xFrac = 0; 2035 } 2036 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 2037 #endif 2038 Int absX = posX + refOffset; 2039 2040 if (xFrac == 0) 2041 { 2042 absX = Clip3(0, widthChroma-1, absX); 2043 } 2044 else 2045 { 2046 absX = Clip3(4, widthChroma-5, absX); 2047 } 2048 2049 refOffset = absX - posX; 2050 assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 ); 2051 assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 ); 2052 2053 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi ); 2054 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi ); 2055 } 2056 2057 #endif // NTT_VSP_DC_BUGFIX_E0208 2058 } 2059 refCb += refStrideBlock; 2060 refCr += refStrideBlock; 2061 dstCb += dstStrideBlock; 2062 dstCr += dstStrideBlock; 2063 depth += depStrideBlock; 2064 } 2065 2066 } 2067 #else // NTT_VSP_COMMON_E0207_E0208 2068 1504 2069 // Input: 1505 2070 // refPic: Ref picture. Full picture, with padding … … 1955 2520 } 1956 2521 2522 #endif // NTT_VSP_COMMON_E0207_E0208 2523 1957 2524 #if H_3D_VSP_CONSTRAINED 1958 2525 Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma) -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.h
r531 r597 84 84 Int xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true); 85 85 #endif 86 #if NTT_VSP_COMMON_E0207_E0208 87 TComYuv m_cYuvDepthOnVsp; 88 #endif 86 89 #endif 87 90 … … 119 122 120 123 #if H_3D_VSP 124 #if NTT_VSP_COMMON_E0207_E0208 125 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int txtPerDepthX=1, Int txtPerDepthY=1 ); 126 Void xPredInterLumaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 127 Void xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 128 #else 121 129 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi ); 122 130 Void xPredInterChromaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, TComMv* dv, UInt partAddr, Int posX, Int posY, Int sizeX, Int sizeY, Bool isDepth, TComYuv *&dstPic, Bool bi ); 131 #endif 123 132 #endif 124 133 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r542 r597 1510 1510 } 1511 1511 #endif 1512 #if H_3D_TMVP 1512 1513 m_ivMvScalingFlag = true; 1514 #endif 1513 1515 #endif 1514 1516 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TypeDef.h
r543 r597 101 101 // MERL_D0166: Reference view selection in NBDV & Bi-VSP 102 102 // MERL_C0152: Basic VSP 103 104 #define NBDV_DEFAULT_VIEWIDX_BUGFIX 1 // Bug fix for invalid default view index for NBDV 105 #define MTK_RVS_BUGFIX_E0172 1 // Bug fix for issues caused by reference view selection, JCT3V-E0172 106 #if MTK_RVS_BUGFIX_E0172 107 #define MTK_DVMCP_FIX_E0172 1 // fix the mismatch between software and WD for DV derivation from DVMCP blocks, issue 2 in JCT3V-E0172 108 #define MTK_VSP_FIX_ALIGN_WD_E0172 1 // fix the issues related to VSP merge candidate, issue 3, 4 in JCT3V-E0172, using an implementation aligned with WD 109 #if !MTK_VSP_FIX_ALIGN_WD_E0172 110 #define MTK_VSP_FIX_E0172 1 // fix the issues related to VSP merge candidate, issue 3, 4 in JCT3V-E0172 111 #endif 112 #define MTK_DIVMC_FIX_E0172 1 // fix the issue of derivation of disparity inter-view merge candidate, issue 5 in JCT3V-E0172 113 #define MTK_NBDV_TN_FIX_E0172 1 // fix the issue of DV derivation from the temporal neighboring blocks, issue 7 in JCT3V-E0172 114 #endif 115 #define MTK_TEXTURE_MRGCAND_BUGFIX_E0182 1 // Bugfix for TEXTURE MERGING CANDIDATE , JCT3V-E0182 116 #if H_3D_NBDV_REF 117 #define NTT_DoNBDV_VECTOR_CLIP_E0141 1 // disparity vector clipping in DoNBDV, JCT3V-E0141 and JCT3V-E0209 118 #define SEC_SIMPLIFIED_NBDV_E0142 1 // Simplified NBDV, JCT3V-E0142 and JCT3V-E0190 119 #endif 103 120 #endif 104 121 #define H_3D_VSP 1 // View synthesis prediction … … 135 152 // FIX_SDC_ENC_RD_WVSO_D0163 136 153 // MTK_SAMPLE_BASED_SDC_D0110 137 154 #define H_3D_FIX 1 155 #if H_3D_FIX 156 #define H_3D_BVSP_FIX 1 //DV from NBDV instead of DoNBDV should be used 157 #define FIX036 1 // fix for ticket #36 158 #endif 138 159 #endif 139 160 … … 156 177 //// ****** Neighbouring block-based Disparity Vector ********* 157 178 #if H_3D_NBDV 179 #if SEC_SIMPLIFIED_NBDV_E0142 180 #define DVFROM_LEFT 0 181 #define DVFROM_ABOVE 1 182 #define IDV_CANDS 2 183 #else 158 184 #define DVFROM_LEFTBELOW 0 159 185 #define DVFROM_LEFT 1 … … 162 188 #define DVFROM_ABOVELEFT 4 163 189 #define IDV_CANDS 5 190 #endif 191 #endif 192 //// **** Inter-view motion prediction for merge ********* 193 #if H_3D_IV_MERGE 194 #define QC_INRIA_MTK_MRG_E0126 1 // additional merge candidates JCT3V-E0126 164 195 #endif 165 196 ///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION ********* … … 187 218 #define H_3D_VSP_CONSTRAINED 0 188 219 #endif 220 221 #define NTT_VSP_COMMON_E0207_E0208 1 // common part of JCT3V-E0207 and JCT3V-E0208 222 #if NTT_VSP_COMMON_E0207_E0208 223 #define NTT_VSP_DC_BUGFIX_E0208 1 // bugfix for sub-PU based DC in VSP, JCT3V-E0208 224 #define NTT_VSP_VECTOR_CLIP_E0208 1 // disparity vector clipping on fetching depth map in VSP, JCT3V-E0208 225 #define NTT_VSP_ADAPTIVE_SPLIT_E0207 1 // adaptive sub-PU partitioning in VSP, JCT3V-E0207 226 #endif 227 189 228 #endif 190 229 … … 398 437 399 438 #if H_3D_VSO_DIST_INT 439 #if FIX036 440 typedef Int64 Dist; ///< RDO distortion 441 #else 400 442 typedef Int Dist; ///< RDO distortion 443 #endif 401 444 typedef Int64 Dist64; 402 445 #define RDO_DIST_MIN MIN_INT -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r531 r597 366 366 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 367 367 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 368 368 #if MTK_VSP_FIX_ALIGN_WD_E0172 369 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 370 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex ); 371 #else 372 #if MTK_VSP_FIX_E0172 373 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 374 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 375 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand, uiMergeIndex ); 376 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 377 #else 369 378 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex ); 379 #endif 380 #endif// end of MTK_VSP_FIX_ALIGN_WD_E0172 370 381 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 371 382 #else 372 383 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 373 384 #endif 374 385 #if MTK_VSP_FIX_ALIGN_WD_E0172 386 if(vspFlag[uiMergeIndex]) 387 { 388 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiAbsPartIdx, 0, uiDepth); 389 } 390 #endif 375 391 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 376 392 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r531 r597 243 243 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 244 244 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 245 #if MTK_VSP_FIX_ALIGN_WD_E0172 246 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 247 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand ); 248 #else 249 #if MTK_VSP_FIX_E0172 250 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 251 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 252 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir, numValidMergeCand ); 253 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 254 #else 245 255 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand ); 256 #endif 257 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172 246 258 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 259 #if MTK_VSP_FIX_ALIGN_WD_E0172 260 if(vspFlag[uiMergeIndex]) 261 { 262 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth); 263 } 264 #endif 247 265 #else 248 266 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); … … 258 276 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 259 277 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 278 #if MTK_VSP_FIX_ALIGN_WD_E0172 279 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 280 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex ); 281 #else 282 #if MTK_VSP_FIX_E0172 283 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 284 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 285 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir,numValidMergeCand, uiMergeIndex ); 286 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 287 #else 260 288 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex ); 289 #endif 290 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172 261 291 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 292 #if MTK_VSP_FIX_ALIGN_WD_E0172 293 if(vspFlag[uiMergeIndex]) 294 { 295 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth); 296 } 297 #endif 262 298 #else 263 299 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); … … 291 327 } 292 328 } 329 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 330 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false)) 331 #else 293 332 if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) ) 333 #endif 294 334 { 295 335 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx); -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecGop.cpp
r542 r597 159 159 } 160 160 #endif 161 #if MTK_NBDV_TN_FIX_E0172 162 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 163 { 164 rpcPic->checkTemporalIVRef(); 165 } 166 #endif 167 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 168 if(pcSlice->getIsDepth()) 169 { 170 rpcPic->checkTextureRef(); 171 } 172 #endif 161 173 #if H_3D 162 174 pcSlice->setDepthToDisparityLUTs(); -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r541 r597 416 416 417 417 Bool bTrySplitDQP = true; 418 418 #if MTK_VSP_FIX_ALIGN_WD_E0172 419 DisInfo DvInfo; 420 DvInfo.bDV = false; 421 DvInfo.m_acNBDV.setZero(); 422 DvInfo.m_aVIdxCan = 0; 423 #if H_3D_NBDV_REF 424 DvInfo.m_acDoNBDV.setZero(); 425 #endif 426 #endif 419 427 static Double afCost[ MAX_CU_DEPTH ]; 420 428 static Int aiNum [ MAX_CU_DEPTH ]; … … 517 525 518 526 #if H_3D_NBDV 527 #if !MTK_VSP_FIX_ALIGN_WD_E0172 519 528 DisInfo DvInfo; 520 529 DvInfo.bDV = false; … … 524 533 DvInfo.m_acDoNBDV.setZero(); 525 534 #endif 526 535 #endif 527 536 if( rpcTempCU->getSlice()->getSliceType() != I_SLICE ) 528 537 { … … 571 580 #endif 572 581 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N 582 #if MTK_VSP_FIX_ALIGN_WD_E0172 583 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 584 #endif 573 585 } 574 586 // SKIP … … 578 590 xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N 579 591 rpcTempCU->initEstData( uiDepth, iQP ); 580 592 #if MTK_VSP_FIX_ALIGN_WD_E0172 593 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 594 #endif 581 595 // fast encoder decision for early skip 582 596 if ( m_pcEncCfg->getUseFastEnc() ) … … 599 613 #endif 600 614 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); rpcTempCU->initEstData( uiDepth, iQP ); 615 #if MTK_VSP_FIX_ALIGN_WD_E0172 616 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 617 #endif 601 618 if(m_pcEncCfg->getUseCbfFastMode()) 602 619 { … … 679 696 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN ); 680 697 rpcTempCU->initEstData( uiDepth, iQP ); 698 #if MTK_VSP_FIX_ALIGN_WD_E0172 699 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 700 #endif 681 701 } 682 702 } … … 692 712 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N ); 693 713 rpcTempCU->initEstData( uiDepth, iQP ); 714 #if MTK_VSP_FIX_ALIGN_WD_E0172 715 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 716 #endif 694 717 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_Nx2N ) 695 718 { … … 705 728 xCheckRDCostInter ( rpcBestCU, rpcTempCU, SIZE_2NxN ); 706 729 rpcTempCU->initEstData( uiDepth, iQP ); 730 #if MTK_VSP_FIX_ALIGN_WD_E0172 731 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 732 #endif 707 733 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxN) 708 734 { … … 737 763 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU ); 738 764 rpcTempCU->initEstData( uiDepth, iQP ); 765 #if MTK_VSP_FIX_ALIGN_WD_E0172 766 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 767 #endif 739 768 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU ) 740 769 { … … 750 779 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD ); 751 780 rpcTempCU->initEstData( uiDepth, iQP ); 781 #if MTK_VSP_FIX_ALIGN_WD_E0172 782 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 783 #endif 752 784 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD ) 753 785 { … … 767 799 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, true ); 768 800 rpcTempCU->initEstData( uiDepth, iQP ); 801 #if MTK_VSP_FIX_ALIGN_WD_E0172 802 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 803 #endif 769 804 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU ) 770 805 { … … 780 815 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, true ); 781 816 rpcTempCU->initEstData( uiDepth, iQP ); 817 #if MTK_VSP_FIX_ALIGN_WD_E0172 818 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 819 #endif 782 820 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD ) 783 821 { … … 799 837 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N ); 800 838 rpcTempCU->initEstData( uiDepth, iQP ); 839 #if MTK_VSP_FIX_ALIGN_WD_E0172 840 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 841 #endif 801 842 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N ) 802 843 { … … 812 853 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N ); 813 854 rpcTempCU->initEstData( uiDepth, iQP ); 855 #if MTK_VSP_FIX_ALIGN_WD_E0172 856 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 857 #endif 814 858 } 815 859 } … … 825 869 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, true ); 826 870 rpcTempCU->initEstData( uiDepth, iQP ); 871 #if MTK_VSP_FIX_ALIGN_WD_E0172 872 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 873 #endif 827 874 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N ) 828 875 { … … 838 885 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, true ); 839 886 rpcTempCU->initEstData( uiDepth, iQP ); 887 #if MTK_VSP_FIX_ALIGN_WD_E0172 888 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 889 #endif 840 890 } 841 891 } … … 849 899 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU ); 850 900 rpcTempCU->initEstData( uiDepth, iQP ); 901 #if MTK_VSP_FIX_ALIGN_WD_E0172 902 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 903 #endif 851 904 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD ); 852 905 rpcTempCU->initEstData( uiDepth, iQP ); 906 #if MTK_VSP_FIX_ALIGN_WD_E0172 907 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 908 #endif 853 909 #if H_3D_QTLPC 854 910 } … … 858 914 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N ); 859 915 rpcTempCU->initEstData( uiDepth, iQP ); 916 #if MTK_VSP_FIX_ALIGN_WD_E0172 917 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 918 #endif 860 919 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N ); 861 920 rpcTempCU->initEstData( uiDepth, iQP ); 921 #if MTK_VSP_FIX_ALIGN_WD_E0172 922 rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth); 923 #endif 862 924 #if H_3D_QTLPC 863 925 } … … 1615 1677 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 1616 1678 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1679 #if MTK_VSP_FIX_ALIGN_WD_E0172 1680 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 1681 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo, numValidMergeCand ); 1682 #else 1683 #if MTK_VSP_FIX_E0172 1684 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 1685 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 1686 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand ); 1687 #else 1617 1688 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand ); 1689 #endif 1690 #endif//end of MTK_VSP_FIX_ALIGN_WD_E0172 1618 1691 #else 1619 1692 rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); … … 1683 1756 #if H_3D_VSP 1684 1757 rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth ); 1758 #if MTK_VSP_FIX_ALIGN_WD_E0172 1759 rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth ); 1760 #endif 1761 #if MTK_VSP_FIX_E0172 1762 rpcTempCU->setVSPDirSubParts( vspDir[uiMergeCand], 0, 0, uhDepth ); 1763 #endif 1685 1764 #endif 1686 1765 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r542 r597 1078 1078 #endif 1079 1079 #endif 1080 #if MTK_NBDV_TN_FIX_E0172 1081 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 1082 { 1083 pcPic->checkTemporalIVRef(); 1084 } 1085 #endif 1086 #if MTK_TEXTURE_MRGCAND_BUGFIX_E0182 1087 if(pcSlice->getIsDepth()) 1088 { 1089 pcPic->checkTextureRef(); 1090 } 1091 #endif 1080 1092 while(nextCUAddr<uiRealEndAddress) // determine slice boundaries 1081 1093 { -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r537 r597 3550 3550 #if H_3D_VSP 3551 3551 , Int* vspFlag 3552 #if MTK_VSP_FIX_ALIGN_WD_E0172 3553 , InheritedVSPDisInfo* inheritedVSPDisInfo 3554 #endif 3555 #if MTK_VSP_FIX_E0172 3556 , Int* vspDir 3557 #endif 3552 3558 #endif 3553 3559 , Int& numValidMergeCand … … 3569 3575 #if H_3D_VSP 3570 3576 , vspFlag 3577 #if MTK_VSP_FIX_ALIGN_WD_E0172 3578 , inheritedVSPDisInfo 3579 #endif 3580 #if MTK_VSP_FIX_E0172 3581 , vspDir 3582 #endif 3571 3583 #endif 3572 3584 , numValidMergeCand … … 3580 3592 #if H_3D_VSP 3581 3593 , vspFlag 3594 #if MTK_VSP_FIX_ALIGN_WD_E0172 3595 , inheritedVSPDisInfo 3596 #endif 3597 #if MTK_VSP_FIX_E0172 3598 , vspDir 3599 #endif 3582 3600 #endif 3583 3601 , numValidMergeCand 3584 3602 ); 3585 3603 } 3604 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3605 xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand ); 3606 #else 3586 3607 xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 3608 #endif 3587 3609 3588 3610 ruiCost = MAX_UINT; … … 3600 3622 #if H_3D_VSP 3601 3623 pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3624 #if MTK_VSP_FIX_ALIGN_WD_E0172 3625 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3626 #endif 3627 #if MTK_VSP_FIX_E0172 3628 pcCU->setVSPDirSubParts( vspDir[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3629 #endif 3602 3630 #endif 3603 3631 … … 3629 3657 * \returns Void 3630 3658 */ 3659 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3660 Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand ) 3661 #else 3631 3662 Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int numValidMergeCand ) 3663 #endif 3632 3664 { 3633 3665 if ( pcCU->isBipredRestriction(puIdx) ) … … 3635 3667 for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand ) 3636 3668 { 3669 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 3670 if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) ) 3671 #else 3637 3672 if ( interDirNeighbours[mergeCand] == 3 ) 3673 #endif 3638 3674 { 3639 3675 interDirNeighbours[mergeCand] = 1; … … 3758 3794 #if H_3D_VSP 3759 3795 pcCU->setVSPFlagSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3796 #if MTK_VSP_FIX_E0172 3797 pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3798 #endif 3760 3799 #endif 3761 3800 … … 4250 4289 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 4251 4290 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 4291 #if MTK_VSP_FIX_ALIGN_WD_E0172 4292 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 4293 UInt uiAbsPartIdx = 0; 4294 Int iWidth = 0; 4295 Int iHeight = 0; 4296 pcCU->getPartIndexAndSize( iPartIdx, uiAbsPartIdx, iWidth, iHeight ); 4297 DisInfo OriginalDvInfo = pcCU->getDvInfo(uiAbsPartIdx); 4298 #endif 4299 #if MTK_VSP_FIX_E0172 4300 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 4301 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 4302 #endif 4252 4303 #endif 4253 4304 … … 4255 4306 #if H_3D_VSP 4256 4307 , vspFlag 4308 #if MTK_VSP_FIX_ALIGN_WD_E0172 4309 , inheritedVSPDisInfo 4310 #endif 4311 #if MTK_VSP_FIX_E0172 4312 , vspDir 4313 #endif 4257 4314 #endif 4258 4315 , numValidMergeCand … … 4265 4322 #if H_3D_VSP 4266 4323 pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4324 #if MTK_VSP_FIX_ALIGN_WD_E0172 4325 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4326 #endif 4327 #if MTK_VSP_FIX_E0172 4328 pcCU->setVSPDirSubParts( vspDir[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4329 #endif 4267 4330 #endif 4268 4331 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); … … 4287 4350 #if H_3D_VSP 4288 4351 pcCU->setVSPFlagSubParts ( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4352 #if MTK_VSP_FIX_ALIGN_WD_E0172 4353 pcCU->setDvInfoSubParts(OriginalDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4354 #endif 4355 #if MTK_VSP_FIX_E0172 4356 pcCU->setVSPDirSubParts ( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 4357 #endif 4289 4358 #endif 4290 4359 { -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncSearch.h
r531 r597 415 415 #if H_3D_VSP 416 416 , Int* vspFlag 417 #if MTK_VSP_FIX_ALIGN_WD_E0172 418 , InheritedVSPDisInfo* inheritedVSPDisInfo 419 #endif 420 #if MTK_VSP_FIX_E0172 421 , Int* vspDir 422 #endif 417 423 #endif 418 424 , Int& numValidMergeCand … … 423 429 TComMvField* mvFieldNeighbours, 424 430 UChar* interDirNeighbours, 431 #if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172 432 Int* vspFlag, 433 #endif 425 434 Int numValidMergeCand ); 426 435
Note: See TracChangeset for help on using the changeset viewer.