Changeset 795 in 3DVCSoftware for branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 24 Jan 2014, 02:36:31 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.3-dev1-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
r793 r795 153 153 m_pucInterSDCMask = NULL; 154 154 #endif 155 156 #if MTK_DDD_G0063 157 m_pucDisparityDerivedDepth = NULL; 158 m_pbUseDDD = NULL; 159 #endif 155 160 } 156 161 … … 298 303 m_pcPattern = (TComPattern*)xMalloc(TComPattern, 1); 299 304 305 #if MTK_DDD_G0063 306 m_pucDisparityDerivedDepth = (UChar* )xMalloc( UChar, uiNumPartition); 307 m_pbUseDDD = (Bool* ) xMalloc( Bool, uiNumPartition); 308 #endif 309 300 310 // create motion vector fields 301 311 … … 375 385 #if H_3D_NBDV 376 386 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 387 #endif 388 389 #if MTK_DDD_G0063 390 if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth); m_pucDisparityDerivedDepth = NULL; } 391 if ( m_pbUseDDD ) { xFree(m_pbUseDDD); m_pbUseDDD = NULL; } 377 392 #endif 378 393 … … 525 540 m_pbICFlag[ui] = pcFrom->m_pbICFlag[ui]; 526 541 #endif 542 543 #if MTK_DDD_G0063 544 m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui]; 545 m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui]; 546 #endif 547 527 548 m_puhWidth [ui] = pcFrom->getWidth(ui); 528 549 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 602 623 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) ); 603 624 #endif 625 626 #if MTK_DDD_G0063 627 memset( m_pucDisparityDerivedDepth + firstElement, 0, numElements * sizeof( *m_pucDisparityDerivedDepth ) ); 628 memset( m_pbUseDDD + firstElement, 0, numElements * sizeof( *m_pbUseDDD ) ); 629 #endif 630 604 631 #if H_3D_DIM 605 632 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 774 801 m_pbICFlag[ui] = false; 775 802 #endif 803 804 #if MTK_DDD_G0063 805 m_pucDisparityDerivedDepth[ui] = 0; 806 m_pbUseDDD[ui] = 0; 807 #endif 808 776 809 #if H_3D_DIM 777 810 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 879 912 memset( m_puhARPW, 0, iSizeInUchar ); 880 913 #endif 914 915 #if MTK_DDD_G0063 916 memset( m_pucDisparityDerivedDepth, 0, iSizeInUchar ); 917 memset( m_pbUseDDD, 0, iSizeInBool ); 918 #endif 919 881 920 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; 882 921 UChar uhHeight = g_uiMaxCUHeight >> uiDepth; … … 964 1003 m_pbICFlag [ui] = pcCU->m_pbICFlag[uiPartOffset+ui]; 965 1004 #endif 1005 1006 #if MTK_DDD_G0063 1007 m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui]; 1008 m_pbUseDDD[ui] = pcCU->m_pbUseDDD[uiPartOffset+ui]; 1009 #endif 1010 966 1011 #if H_3D_DIM 967 1012 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 1109 1154 #endif 1110 1155 1156 #if MTK_DDD_G0063 1157 m_pucDisparityDerivedDepth = pcCU->getDDDepth() + uiPart; 1158 m_pbUseDDD = pcCU->getUseDDD() + uiPart; 1159 #endif 1160 1111 1161 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; 1112 1162 m_puhChromaIntraDir = pcCU->getChromaIntraDir() + uiPart; … … 1256 1306 #if H_3D_ARP 1257 1307 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1308 #endif 1309 1310 #if MTK_DDD_G0063 1311 m_pucDisparityDerivedDepth = pcCU->getDDDepth() + uiAbsPartIdx; 1312 m_pbUseDDD = pcCU->getUseDDD() + uiAbsPartIdx; 1258 1313 #endif 1259 1314 … … 1314 1369 memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar ); 1315 1370 1371 #if MTK_DDD_G0063 1372 memcpy( m_pucDisparityDerivedDepth + uiOffset, pcCU->getDDDepth(), iSizeInUchar ); 1373 memcpy( m_pbUseDDD + uiOffset, pcCU->getUseDDD(), iSizeInBool ); 1374 #endif 1375 1376 1316 1377 #if H_3D_DIM 1317 1378 for( Int i = 0; i < DIM_NUM_TYPE; i++ ) … … 1410 1471 #if H_3D_NBDV 1411 1472 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1473 #endif 1474 1475 #if MTK_DDD_G0063 1476 memcpy( rpcCU->getDDDepth() + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth, iSizeInUchar ); 1477 memcpy( rpcCU->getUseDDD() + m_uiAbsIdxInLCU, m_pbUseDDD, iSizeInBool ); 1412 1478 #endif 1413 1479 … … 1544 1610 memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar ); 1545 1611 1612 #if MTK_DDD_G0063 1613 memcpy( rpcCU->getDDDepth() + uiPartOffset, m_pucDisparityDerivedDepth, iSizeInUchar ); 1614 memcpy( rpcCU->getUseDDD() + uiPartOffset, m_pbUseDDD, iSizeInBool ); 1615 #endif 1616 1546 1617 #if H_3D_DIM 1547 1618 for( Int i = 0; i < DMM_NUM_TYPE; i++ ) … … 1611 1682 #endif 1612 1683 } 1684 1685 #if MTK_DDD_G0063 1686 Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1687 { 1688 setSubPart<UChar>( ucDDD, m_pucDisparityDerivedDepth, uiAbsPartIdx, uiDepth, uiPartIdx ); 1689 } 1690 1691 Void TComDataCU::setUseDDD ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1692 { 1693 setSubPart<Bool>( bUseDDD, m_pbUseDDD, uiAbsPartIdx, uiDepth, uiPartIdx ); 1694 } 1695 1696 Void TComDataCU::setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth ) 1697 { 1698 memset( m_pbUseDDD + uiAbsPartIdx, bUseDDD, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) ); 1699 } 1700 1701 #endif 1613 1702 1614 1703 // -------------------------------------------------------------------------------------------------------------------- … … 3881 3970 TComMvField tmpMV[2]; 3882 3971 UChar tmpDir; 3972 3973 #if MTK_DDD_G0063 3974 m_iUseDDDCandIdx = -1; 3975 #endif 3883 3976 3884 3977 ////////////////////////////////// … … 4328 4421 #endif 4329 4422 } 4330 4423 #if MTK_DDD_G0063 4424 if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0 ) 4425 { 4426 UInt uiPartIdx; 4427 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4428 TComSlice *pcTextureSlice = pcTextureCU->getSlice(); 4429 4430 4431 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4432 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4433 tmpDir = 0; 4434 4435 xDeriveCenterIdx( uiPUIdx, uiPartIdx); 4436 4437 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) ) 4438 { 4439 4440 TComMvField cMVField; 4441 UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx ); 4442 4443 Int iDV = 0; 4444 Int iViewIdx = 0; 4445 if( ucInterDir & 1 ) 4446 { 4447 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField ); 4448 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4449 { 4450 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex(); 4451 iDV = cMVField.getHor(); 4452 4453 4454 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() ); 4455 4456 if( iValidDepRef >= 0 ) 4457 { 4458 const TComMv cAdd( 2, 2 ); 4459 cMVField.getMv() += cAdd; 4460 cMVField.getMv() >>= 2; 4461 clipMv( cMVField.getMv() ); 4462 tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef ); 4463 tmpDir = 1; 4464 } 4465 } 4466 } 4467 if( !tmpDir && ( ucInterDir & 2 )) 4468 { 4469 pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField ); 4470 if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() ) 4471 { 4472 iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex(); 4473 iDV = cMVField.getHor(); 4474 4475 Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() ); 4476 4477 if( iValidDepRef >= 0 ) 4478 { 4479 const TComMv cAdd( 2, 2 ); 4480 cMVField.getMv() += cAdd; 4481 cMVField.getMv() >>= 2; 4482 clipMv( cMVField.getMv() ); 4483 tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef ); 4484 tmpDir = 2; 4485 } 4486 } 4487 } 4488 if( tmpDir != 0 ) 4489 { 4490 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4491 m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV, iViewIdx ); 4492 m_iUseDDDCandIdx = iCount; 4493 4494 if( tmpDir == 1 ) 4495 { 4496 pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ]; 4497 } 4498 else if( tmpDir == 2 ) 4499 { 4500 pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ]; 4501 } 4502 4503 abCandIsInter [ iCount ] = true; 4504 puhInterDirNeighbours[ iCount ] = tmpDir; 4505 4506 if ( mrgCandIdx == iCount ) 4507 { 4508 return; 4509 } 4510 iCount ++; 4511 4512 Int iLeftAboveAvail = 0; 4513 if( iPosLeftAbove[ 0 ] != -1 ) 4514 { 4515 iPosLeftAbove[ 0 ] = iCount; 4516 iLeftAboveAvail = 1; 4517 } 4518 if( iPosLeftAbove[ 1 ] != -1 ) 4519 { 4520 iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail; 4521 } 4522 4523 } 4524 } 4525 4526 } 4527 #endif 4331 4528 ///////////////////////////////////////////////////////////////// 4332 4529 //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC Candidates ///// … … 4398 4595 for(; iCnloop >= 0; iCnloop --) 4399 4596 { 4597 #if MTK_DDD_G0063 4598 if( iCnloop == m_iUseDDDCandIdx ) 4599 { 4600 continue; 4601 } 4602 #endif 4400 4603 if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1]) // F0125 compatible with F0093 4401 4604 { … … 4595 4798 #endif 4596 4799 4800 #if MTK_DDD_G0063 4801 // early termination 4802 if ( iCount >= getSlice()->getMaxNumMergeCand()) 4803 { 4804 return; 4805 } 4806 #endif 4597 4807 4598 4808 #if H_3D_IV_MERGE
Note: See TracChangeset for help on using the changeset viewer.