Changeset 25 in SHVCSoftware for branches/SHM-1.0-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
4 Feb 2013, 08:30:23 (12 years ago)
Author:
qualcomm
Message:

L0336: motion field mapping of inter-layer reference picture from Qualcomm, cjianle@…

Location:
branches/SHM-1.0-dev/source/Lib/TLibEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r2 r25  
    600600#endif
    601601  WRITE_FLAG( pcSPS->getTMVPFlagsPresent()  ? 1 : 0,           "sps_temporal_mvp_enable_flag" );
     602#if REF_IDX_MFM
     603  if( pcSPS->getLayerId() > 0 )
     604  {
     605          assert(pcSPS->getMFMEnabledFlag());
     606          WRITE_FLAG( pcSPS->getMFMEnabledFlag() ? 1 : 0,          "sps_enh_mfm_enable_flag" );
     607  }
     608#endif
    602609#if SUPPORT_FOR_VUI
    603610  WRITE_FLAG( pcSPS->getVuiParametersPresentFlag(),             "vui_parameters_present_flag" );
  • branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r2 r25  
    465465#endif
    466466
     467#if REF_IDX_FRAMEWORK
     468    if (pcSlice->getSliceType() == B_SLICE)
     469      pcSlice->setColFromL0Flag(1-uiColDir);
     470#endif
     471
    467472    //  Set reference list
    468473    pcSlice->setRefPicList ( rcListPic );
     
    471476    {
    472477      m_pcEncTop->setILRPic(pcPic);
     478
     479#if REF_IDX_MFM
     480      pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
     481#endif
    473482      pcSlice->addRefPicList ( m_pcEncTop->getIlpList(), 1);
     483
     484#if REF_IDX_MFM
     485      Bool found         = false;
     486      UInt ColFromL0Flag = pcSlice->getColFromL0Flag();
     487      UInt ColRefIdx     = pcSlice->getColRefIdx();
     488      for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++)
     489      {
     490        if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getIsILR() )
     491        {
     492          ColRefIdx = colIdx;
     493          found = true;
     494          break;
     495        }
     496      }
     497
     498      if( found == false )
     499      {
     500        ColFromL0Flag = 1 - ColFromL0Flag;
     501        for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++)
     502        {
     503          if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getIsILR() )
     504          {
     505            ColRefIdx = colIdx;
     506            found = true;
     507            break;
     508          }
     509        }
     510      }
     511
     512      if(found == true)
     513      {
     514        pcSlice->setColFromL0Flag(ColFromL0Flag);
     515        pcSlice->setColRefIdx(ColRefIdx);
     516      }
     517#endif
    474518    }
    475519#endif
     
    495539    if (pcSlice->getSliceType() == B_SLICE)
    496540    {
     541#if !REF_IDX_FRAMEWORK
    497542      pcSlice->setColFromL0Flag(1-uiColDir);
     543#endif
    498544      Bool bLowDelay = true;
    499545      Int  iCurrPOC  = pcSlice->getPOC();
     
    15151561
    15161562      pcPic->compressMotion();
     1563#if REF_IDX_MFM
     1564      if( m_layerId == 0 && pcPic->upsampledMvFieldIsNull() )
     1565      {
     1566        Int     iEHeight     = m_ppcTEncTop[m_layerId+1]->getSourceHeight();
     1567        Int     iEWidth      = m_ppcTEncTop[m_layerId+1]->getSourceWidth();
     1568        pcPic->createUpSampledMvField(iEHeight, iEWidth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);  //create up-sampled mv field
     1569      }
     1570
     1571        if( m_layerId == 0 && pcPic->IsUpsampledMvField() == false )
     1572      {
     1573        Int iBWidth  = m_ppcTEncTop[m_layerId]->getSourceWidth() - m_ppcTEncTop[m_layerId]->getCropLeft() - m_ppcTEncTop[m_layerId]->getCropRight();
     1574        Int iBHeight = m_ppcTEncTop[m_layerId]->getSourceHeight() - m_ppcTEncTop[m_layerId]->getCropTop() - m_ppcTEncTop[m_layerId]->getCropBottom();
     1575
     1576        Int iEWidth  = m_ppcTEncTop[m_layerId+1]->getSourceWidth() - m_ppcTEncTop[m_layerId+1]->getCropLeft() - m_ppcTEncTop[m_layerId+1]->getCropRight();
     1577        Int iEHeight = m_ppcTEncTop[m_layerId+1]->getSourceHeight() - m_ppcTEncTop[m_layerId+1]->getCropTop() - m_ppcTEncTop[m_layerId+1]->getCropBottom();
     1578
     1579        UInt upSampleRatio;
     1580        if(iEWidth == iBWidth && iEHeight == iBHeight)
     1581          upSampleRatio = 0;
     1582        else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight)
     1583          upSampleRatio = 1;
     1584        else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight)
     1585          upSampleRatio = 2;
     1586        else
     1587          assert(0);
     1588
     1589        pcPic->doTheUpSampleMvField(upSampleRatio);
     1590        pcPic->setUpsampledMvField(true);
     1591      }
     1592#endif
    15171593     
    15181594      //-- For time output for each slice
  • branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r21 r25  
    8585  memset(m_cIlpPic, 0, sizeof(m_cIlpPic));
    8686#endif
     87#if REF_IDX_MFM
     88  m_bMFMEnabledFlag = false;
     89#endif
    8790}
    8891
     
    394397        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
    395398#endif
    396 #if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE
     399#if REF_IDX_ME_AROUND_ZEROMV || REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM
    397400        m_cIlpPic[j]->setIsILR(true);
    398401#endif
     
    599602  // mark it should be extended
    600603  rpcPic->getPicYuvRec()->setBorderExtension(false);
     604#if REF_IDX_MFM
     605  rpcPic->setUpsampledMvField(false);
     606#endif
    601607}
    602608
     
    605611#if SVC_EXTENSION
    606612  m_cSPS.setLayerId(m_layerId);
     613#endif
     614#if REF_IDX_MFM
     615  m_cSPS.setMFMEnabledFlag(m_bMFMEnabledFlag);
    607616#endif
    608617
  • branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.h

    r2 r25  
    140140  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
    141141#endif
     142#if REF_IDX_MFM
     143  Bool                    m_bMFMEnabledFlag;
     144#endif
    142145protected:
    143146  Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
     
    228231  Void setILRPic(TComPic *pcPic);
    229232#endif
     233#if REF_IDX_MFM
     234  Void setMFMEnabledFlag       (Bool flag)   {m_bMFMEnabledFlag = flag;}
     235  Bool getMFMEnabledFlag()                   {return m_bMFMEnabledFlag;}   
     236#endif
    230237
    231238};
Note: See TracChangeset for help on using the changeset viewer.