Ignore:
Timestamp:
18 Jun 2013, 23:24:53 (11 years ago)
Author:
tech
Message:
  • changed IV-MERGE HLS to match Test Model 4 spec
  • incorporated iv-refpic list to TComSlice
  • removed TComDepthMapGenerator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp

    r478 r479  
    4040#include "TComPic.h"
    4141
    42 #if H_3D_IV_MERGE
    43 #include "TComDepthMapGenerator.h"
    44 #endif
    4542//! \ingroup TLibCommon
    4643//! \{
     
    24582455  deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
    24592456#if H_3D_IV_MERGE
    2460   Bool bNoPdmMerge   = ( m_pcSlice->getSPS()->getViewIndex() == 0 || ( m_pcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) != PDM_USE_FOR_MERGE );
     2457  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    24612458
    24622459  //===== add merge with predicted depth maps =====
     
    25562553
    25572554  Int iPdmDir[2] = {0, 0};
    2558   getUnifiedMvPredCan(uiPUIdx, REF_PIC_LIST_0, 0, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir, true);
     2555  getInterViewMergeCands(uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir );
    25592556  Int iPdmInterDir;
    25602557
    2561   if( iPdmDir[0] && !bNoPdmMerge )
     2558  if( iPdmDir[0] && ivMvPredFlag )
    25622559  {
    25632560    abCandIsInter        [ iCount ] = true;
     
    27552752
    27562753#if H_3D_IV_MERGE
    2757   if(!bNoPdmMerge && iPdmDir[1] )
     2754  if(ivMvPredFlag && iPdmDir[1] )
    27582755  {
    27592756    assert(iCount < getSlice()->getMaxNumMergeCand());
     
    45004497#endif
    45014498#if H_3D_IV_MERGE
    4502 Bool TComDataCU::getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
    4503 {
    4504   TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
    4505   ROFRS( pcDepthMapGenerator, false );
    4506   if (pcDepthMapGenerator->getPdmCandidate(this, uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, pacPdmMv, pDInfo, iPdm, bMerge))
    4507     return true;
     4499Bool
     4500TComDataCU::getInterViewMergeCands(UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc )
     4501{
     4502  TComSlice*    pcSlice         = getSlice (); 
     4503
     4504  Bool valid     = false;
     4505  Int iViewIndex = 0;
     4506
     4507  for( UInt uiBIndex = 0; uiBIndex < pcSlice->getViewIndex( ) && !valid; uiBIndex++ )
     4508  {
     4509    UInt        uiBaseIndex = uiBIndex;   
     4510    TComPic*    pcBasePic   = pcSlice->getIvPic( false, uiBaseIndex );
     4511    for( Int iRefListId = 0; iRefListId < 2 && !valid; iRefListId++ )
     4512    {
     4513      RefPicList  eRefPicListTest = RefPicList( iRefListId );
     4514      Int         iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ;
     4515      for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ )
     4516      {
     4517        if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC()
     4518          && pcBasePic->getViewIndex() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewIndex())
     4519        {
     4520          valid = true;
     4521          iViewIndex = uiBaseIndex;
     4522          break;
     4523        }
     4524      }
     4525    }
     4526  }
     4527
     4528  if (!valid)
     4529    return false;
     4530
     4531  //--- get base CU/PU and check prediction mode ---
     4532  TComPic*    pcBasePic   = pcSlice->getIvPic( false, iViewIndex );
     4533  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
     4534
     4535  UInt          uiPartAddr;
     4536  Int           iWidth;
     4537  Int           iHeight;
     4538  getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
     4539
     4540  Int  iCurrPosX, iCurrPosY;
     4541  pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
     4542
     4543  iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
     4544  iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
     4545
     4546  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acNBDV.getHor() + 2 ) >> 2 ) );
     4547  Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acNBDV.getVer() + 2 ) >> 2 ));
     4548
     4549  Int         iBaseCUAddr;
     4550  Int         iBaseAbsPartIdx;
     4551  pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
     4552
     4553  TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     4554
     4555  Bool abPdmAvailable[4] = {false, false, false, false};
     4556  if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
     4557  {
     4558    for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4559    {
     4560      RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4561
     4562      Bool stopLoop = false;
     4563      for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
     4564      {
     4565        RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     4566        TComMvField cBaseMvField;
     4567        pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
     4568        Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
     4569        if (iBaseRefIdx >= 0)
     4570        {
     4571          Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
     4572          if (iBaseRefPOC != pcSlice->getPOC())   
     4573          {
     4574            for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
     4575            {
     4576              if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     4577              {
     4578                abPdmAvailable[ uiCurrRefListId ] = true;
     4579                TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
     4580
     4581                //                  cMv.m_bDvMcp = true;
     4582                //                  cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor();                 
     4583
     4584                clipMv( cMv );
     4585                paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
     4586                pacPdmMv      [ uiCurrRefListId ] = cMv;
     4587                stopLoop = true;
     4588                break;
     4589              }
     4590            }
     4591          }
     4592        }
     4593      }
     4594    }
     4595  }
     4596  availableMcDc[0] = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
     4597
     4598  for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
     4599  {
     4600    RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
     4601    Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
     4602    for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
     4603    {
     4604      if( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC())
     4605      {
     4606        abPdmAvailable[ iRefListId+2 ] = true;
     4607        paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
     4608
     4609        TComMv cMv = pDInfo->m_acNBDV;
     4610        cMv.setVer(0);
     4611        clipMv( cMv );
     4612        pacPdmMv      [ iRefListId + 2] = cMv;
     4613        break;
     4614      }
     4615    }
     4616  }
     4617  availableMcDc[1] = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 );
    45084618  return false;
    45094619}
Note: See TracChangeset for help on using the changeset viewer.