Changeset 91 in 3DVCSoftware for branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
- Timestamp:
- 1 Jul 2012, 08:23:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r77 r91 78 78 m_uiSubSampExpX = uiSubSampExpX; 79 79 m_uiSubSampExpY = uiSubSampExpY; 80 #if !QC_MULTI_DIS_CAN 80 81 m_ppcYuv = new TComYuv* [ m_uiMaxDepth ]; 81 82 m_ppcCU = new TComDataCU* [ m_uiMaxDepth ]; … … 91 92 m_cTmpPic.create( uiPicWidth >> m_uiSubSampExpX, uiPicHeight >> m_uiSubSampExpY, uiMaxCUWidth >> m_uiSubSampExpX, uiMaxCUHeight >> m_uiSubSampExpY, uiMaxCUDepth ); 92 93 xSetChroma( &m_cTmpPic, ( 1 << uiOrgBitDepth ) >> 1 ); 94 #endif 93 95 m_bCreated = true; 94 96 } … … 100 102 { 101 103 m_bCreated = false; 104 #if !QC_MULTI_DIS_CAN 102 105 for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ ) 103 106 { … … 114 117 delete [] m_ppcCU; m_ppcCU = 0; 115 118 m_cTmpPic.destroy(); 119 #endif 116 120 m_uiMaxDepth = 0; 117 121 m_uiOrgDepthBitDepth = 0; … … 178 182 179 183 // set basic SPS parameters 184 //#if !QC_MULTI_DIS_CAN 180 185 const Int iDisparityDir = 1; // 1 or -1, depending on the usage of disparity vectors 186 //#endif 181 187 TComSPS* pcSPS = pcPic->getSPS (); 182 188 Int iVOI = pcSPS->getViewOrderIdx (); 189 //#if !QC_MULTI_DIS_CAN 183 190 UInt uiPdmPrec = pcSPS->getPdmPrecision (); 184 191 UInt uiCamPrec = pcSPS->getCamParPrecision (); 185 192 Bool bInSlice = pcSPS->hasCamParInSliceHeader (); 186 193 Int iScaleVOI01 = ( 1 << ( uiPdmPrec + PDM_INTER_CALC_SHIFT + PDM_VIRT_DEPTH_PRECISION - 2 ) ); 187 194 //#endif 188 195 // check availability of base views and set base id list 189 196 std::vector<Int> aiAbsDeltaVOI; … … 214 221 aiAbsDeltaVOI[ uiNextBaseId ] = 0; 215 222 } 216 223 //#if !QC_MULTI_DIS_CAN 217 224 // check availability of prediction depth map 218 225 if( m_uiCurrViewId ) … … 365 372 } 366 373 #endif 367 } 368 369 374 //#else 375 // if( m_uiCurrViewId ) 376 // { 377 // Bool bCheckVId1 = ( m_uiCurrViewId > 1 && m_auiBaseIdList[0] == 0 ); 378 // UInt uiBaseVId = ( bCheckVId1 ? 1 : m_auiBaseIdList[0] ); 379 // TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseVId ); 380 // SliceType eSliceType = pcBasePic->getCurrSlice()->getSliceType(); 381 // Bool bNoRAPdm = ( pcPic->getSPS()->getPredDepthMapGeneration() == 1 ); 382 // m_bPDMAvailable = ( eSliceType != I_SLICE || !bNoRAPdm ); 383 //} 384 //#endif 385 386 } 387 388 #if !QC_MULTI_DIS_CAN 370 389 Bool 371 390 TComDepthMapGenerator::predictDepthMap( TComPic* pcPic ) … … 520 539 m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 ) ); 521 540 } 522 541 #endif 523 542 524 543 #if HHI_INTER_VIEW_MOTION_PRED … … 563 582 564 583 #if HHI_INTER_VIEW_MOTION_PRED 584 #if QC_MULTI_DIS_CAN 585 Int 586 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 587 #else 565 588 Int 566 589 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) 590 #endif 567 591 { 568 592 Int iMaxNumInterPics = 1; … … 580 604 if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() ) 581 605 { 606 #if QC_MULTI_DIS_CAN 607 if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 608 #else 582 609 if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) ) 610 #endif 583 611 { 584 612 pcCU->clipMv( cMv ); … … 602 630 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 603 631 { 632 #if QC_MULTI_DIS_CAN 633 if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 634 #else 604 635 if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) ) 636 #endif 605 637 { 606 638 pcCU->clipMv( cMv ); … … 617 649 } 618 650 619 651 #if QC_MULTI_DIS_CAN 652 Bool 653 TComDepthMapGenerator::getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 654 { 655 AOF ( m_bCreated && m_bInit ); 656 AOF ( iRefIdx >= 0 ); 657 AOF ( pcCU ); 658 //ROFRS( m_bPDMAvailable, false ); 659 TComSlice* pcSlice = pcCU->getSlice (); 660 TComSPS* pcSPS = pcSlice->getSPS(); 661 AOF ( pcSPS->getViewId() == m_uiCurrViewId ); 662 TComPic* pcRefPic = pcSlice->getRefPic( eRefPicList, iRefIdx ); 663 UInt uiRefViewId = pcRefPic->getSPS()->getViewId(); 664 Int iRefPoc = pcRefPic->getPOC(); 665 Bool bInterview = ( uiRefViewId < m_uiCurrViewId ); 666 AOT( bInterview && iRefPoc != pcSlice->getPOC() ); 667 AOT( !bInterview && iRefPoc == pcSlice->getPOC() ); 668 Bool bPdmIView = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW ); 669 Bool bPdmInter = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER ); 670 Bool bPdmMerge = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ); 671 ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false ); 672 ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false ); 673 ROTRS( bMerge && !bPdmMerge, false ); 674 Int iCurrPosX, iCurrPosY; 675 TComMv cDisMv; 676 677 if( bInterview ) 678 { 679 rcMv = pDInfo->m_acMvCand[0]; 680 rcMv.setVer(0); 681 return true; 682 } 683 for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ ) 684 { 685 UInt uiBaseId = uiBId; //m_auiBaseIdList[ uiBId ]; 686 if (m_uiCurrViewId >1 && uiBaseId ==1 ) continue; 687 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseId ); 688 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 689 UInt uiPartAddr; 690 Int iWidth; 691 Int iHeight; 692 pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); 693 pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 694 iCurrPosX += ( ( iWidth - 1 ) >> 1 ); 695 iCurrPosY += ( ( iHeight - 1 ) >> 1 ); 696 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) ); 697 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 698 Int iBaseCUAddr; 699 Int iBaseAbsPartIdx; 700 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 701 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 702 if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP ) 703 { 704 continue; 705 } 706 for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ ) 707 { 708 RefPicList eBaseRefPicList = RefPicList( uiBaseRefListId ); 709 TComMvField cBaseMvField; 710 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 711 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 712 Int iBaseRefPoc = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) ); 713 if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc ) 714 { 715 rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() ); 716 return true; 717 } 718 } 719 } 720 return false; 721 } 722 #else 620 723 Bool 621 724 TComDepthMapGenerator::getPdmMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge ) … … 697 800 return false; 698 801 } 802 #endif 699 803 700 804 … … 744 848 745 849 746 850 #if !QC_MULTI_DIS_CAN 747 851 /*=======================================================* 748 852 *===== =====* … … 1511 1615 return true; 1512 1616 } 1617 #endif 1513 1618 1514 1619 #endif // DEPTH_MAP_GENERATION
Note: See TracChangeset for help on using the changeset viewer.