Ignore:
Timestamp:
1 Jul 2012, 08:23:26 (12 years ago)
Author:
qualcomm
Message:

M24937 with macro QC_MULTI_DIS_CAN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r77 r91  
    7878  m_uiSubSampExpX       = uiSubSampExpX;
    7979  m_uiSubSampExpY       = uiSubSampExpY;
     80#if !QC_MULTI_DIS_CAN
    8081  m_ppcYuv              = new TComYuv*    [ m_uiMaxDepth ];
    8182  m_ppcCU               = new TComDataCU* [ m_uiMaxDepth ];
     
    9192  m_cTmpPic.create( uiPicWidth >> m_uiSubSampExpX, uiPicHeight >> m_uiSubSampExpY, uiMaxCUWidth >> m_uiSubSampExpX, uiMaxCUHeight >> m_uiSubSampExpY, uiMaxCUDepth );
    9293  xSetChroma( &m_cTmpPic, ( 1 << uiOrgBitDepth ) >> 1 );
     94#endif
    9395  m_bCreated    = true;
    9496}
     
    100102  {
    101103    m_bCreated    = false;
     104#if !QC_MULTI_DIS_CAN
    102105    for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ )
    103106    {
     
    114117    delete [] m_ppcCU;  m_ppcCU  = 0;
    115118    m_cTmpPic.destroy();
     119#endif
    116120    m_uiMaxDepth          = 0;
    117121    m_uiOrgDepthBitDepth  = 0;
     
    178182
    179183  // set basic SPS parameters
     184//#if !QC_MULTI_DIS_CAN
    180185  const Int iDisparityDir = 1; // 1 or -1, depending on the usage of disparity vectors
     186//#endif
    181187  TComSPS*  pcSPS         = pcPic->getSPS                 ();
    182188  Int       iVOI          = pcSPS->getViewOrderIdx        ();
     189//#if !QC_MULTI_DIS_CAN
    183190  UInt      uiPdmPrec     = pcSPS->getPdmPrecision        ();
    184191  UInt      uiCamPrec     = pcSPS->getCamParPrecision     ();
    185192  Bool      bInSlice      = pcSPS->hasCamParInSliceHeader ();
    186193  Int       iScaleVOI01   = ( 1 << ( uiPdmPrec + PDM_INTER_CALC_SHIFT + PDM_VIRT_DEPTH_PRECISION - 2 ) );
    187 
     194//#endif
    188195  // check availability of base views and set base id list
    189196  std::vector<Int>  aiAbsDeltaVOI;
     
    214221    aiAbsDeltaVOI[ uiNextBaseId ] = 0;
    215222  }
    216 
     223//#if !QC_MULTI_DIS_CAN
    217224  // check availability of prediction depth map
    218225  if( m_uiCurrViewId )
     
    365372  }
    366373#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
    370389Bool
    371390TComDepthMapGenerator::predictDepthMap( TComPic* pcPic )
     
    520539  m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 )  );
    521540}
    522 
     541#endif
    523542
    524543#if HHI_INTER_VIEW_MOTION_PRED
     
    563582
    564583#if HHI_INTER_VIEW_MOTION_PRED
     584#if QC_MULTI_DIS_CAN
     585Int
     586TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo )
     587#else
    565588Int
    566589TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv )
     590#endif
    567591{
    568592  Int  iMaxNumInterPics  = 1;
     
    580604      if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() )
    581605      {
     606#if QC_MULTI_DIS_CAN
     607                if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) )       
     608#else
    582609        if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) )
     610#endif
    583611        {
    584612          pcCU->clipMv( cMv );
     
    602630      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    603631      {
     632#if QC_MULTI_DIS_CAN
     633                if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) )
     634#else
    604635        if( getPdmMvPred( pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, true ) )
     636#endif
    605637        {
    606638          pcCU->clipMv( cMv );
     
    617649}
    618650
    619 
     651#if QC_MULTI_DIS_CAN
     652Bool
     653TComDepthMapGenerator::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
    620723Bool 
    621724TComDepthMapGenerator::getPdmMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge )
     
    697800  return false;
    698801}
     802#endif
    699803
    700804
     
    744848
    745849
    746 
     850#if !QC_MULTI_DIS_CAN
    747851/*=======================================================*
    748852 *=====                                             =====*
     
    15111615  return        true;
    15121616}
     1617#endif
    15131618
    15141619#endif // DEPTH_MAP_GENERATION
Note: See TracChangeset for help on using the changeset viewer.