Changeset 95 in 3DVCSoftware for branches/HTM-3.1-MediaTek
- Timestamp:
- 27 Jul 2012, 13:15:41 (12 years ago)
- Location:
- branches/HTM-3.1-MediaTek/source/Lib/TLibCommon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-3.1-MediaTek/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r93 r95 628 628 #endif 629 629 { 630 #if MTK_INTERVIEW_MERGE_A0049 631 AOF ( m_bCreated && m_bInit ); 632 633 #if !QC_MULTI_DIS_CAN 634 ROFRS( m_bPDMAvailable, 0 ); 635 #endif 636 637 TComSlice* pcSlice = pcCU->getSlice (); 638 TComSPS* pcSPS = pcSlice->getSPS(); 639 AOF ( pcSPS->getViewId() == m_uiCurrViewId ); 640 Bool bPdmMerge = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ); 641 ROTRS( !bPdmMerge, 0 ); 642 643 Bool abPdmAvailable[2] = {false,false}; 644 645 Int iValid = 0; 646 Int iViewId = 0; 647 for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ ) 648 { 649 UInt uiBaseId = m_auiBaseIdList[ uiBId ]; 650 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 651 for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ ) 652 { 653 RefPicList eRefPicListTest = RefPicList( iRefListId ); 654 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ; 655 for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ ) 656 { 657 if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC() 658 && pcBasePic->getViewId() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewId()) 659 { 660 iValid=1; 661 iViewId = uiBaseId; 662 break; 663 } 664 } 665 } 666 } 667 if (iValid == 0) 668 return 0; 669 670 //--- get base CU/PU and check prediction mode --- 671 TComPic* pcBasePic = m_pcAUPicAccess->getPic( iViewId ); 672 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 673 674 #if QC_MULTI_DIS_CAN 675 Int iCurrPosX, iCurrPosY; 676 UInt uiPartAddr; 677 Int iWidth; 678 Int iHeight; 679 680 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 681 pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 682 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 683 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 684 685 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) ); 686 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 687 Int iBaseCUAddr; 688 Int iBaseAbsPartIdx; 689 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 690 #else 691 Int iPrdDepth, iCurrPosX, iCurrPosY; 692 Bool bAvailable = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY ); 693 AOF( bAvailable ); 694 TComPicYuv* pcBasePdm = pcBasePic->getPredDepthMap(); 695 Int iDisparity = xGetDisparityFromVirtDepth( iViewId, iPrdDepth ); 696 Int iShiftX = m_uiSubSampExpX + 2; 697 Int iAddX = ( 1 << iShiftX ) >> 1; 698 Int iBasePosX = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) ); 699 Int iBasePosY = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY ); 700 Int iBaseCUAddr; 701 Int iBaseAbsPartIdx; 702 pcBaseRec->getCUAddrAndPartIdx( iBasePosX<< m_uiSubSampExpX , iBasePosY<< m_uiSubSampExpY , iBaseCUAddr, iBaseAbsPartIdx ); 703 #endif 704 705 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 706 707 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTER || pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_SKIP ) 708 { 709 for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ ) 710 { 711 RefPicList eBaseRefPicList = RefPicList( uiBaseRefListId ); 712 TComMvField cBaseMvField; 713 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 714 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 715 716 if (iBaseRefIdx >= 0) 717 { 718 Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx); 719 if (iBaseRefPOC != pcSlice->getPOC()) 720 { 721 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eBaseRefPicList ); iPdmRefIdx++) 722 { 723 if (iBaseRefPOC == pcSlice->getRefPOC(eBaseRefPicList, iPdmRefIdx)) 724 { 725 abPdmAvailable[ uiBaseRefListId ] = true; 726 paiPdmRefIdx [ uiBaseRefListId ] = iPdmRefIdx; 727 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 728 pcCU->clipMv( cMv ); 729 pacPdmMv [ uiBaseRefListId ] = cMv; 730 break; 731 } 732 } 733 } 734 } 735 } 736 } 737 Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 738 739 if (iPdmInterDir == 0) 740 { 741 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 742 { 743 RefPicList eRefPicList = RefPicList( iRefListId ); 744 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicList ); 745 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 746 { 747 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 748 { 749 abPdmAvailable[ iRefListId ] = true; 750 paiPdmRefIdx [ iRefListId ] = iPdmRefIdx; 751 #if QC_MULTI_DIS_CAN 752 TComMv cMv = pDInfo->m_acMvCand[0]; 753 cMv.setVer(0); 754 #else 755 TComMv cMv(iDisparity, 0); 756 #endif 757 pcCU->clipMv( cMv ); 758 pacPdmMv [ iRefListId ] = cMv; 759 break; 760 } 761 } 762 } 763 iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ; 764 } 765 766 return iPdmInterDir; 767 768 #else 630 769 Int iMaxNumInterPics = 1; 631 770 Int iMaxNumAllPics = 2; … … 685 824 } 686 825 return iPdmInterDir; 826 #endif 687 827 } 688 828 -
branches/HTM-3.1-MediaTek/source/Lib/TLibCommon/TypeDef.h
r93 r95 52 52 #endif 53 53 54 #define MTK_INTERVIEW_MERGE_A0049 1 // JCT2-A0049 second part 55 54 56 55 57 #define HHI_VSO 1
Note: See TracChangeset for help on using the changeset viewer.