Ignore:
Timestamp:
3 Jun 2013, 20:08:00 (11 years ago)
Author:
seregin
Message:

initial multilayer reference implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r250 r253  
    507507      if(m_layerId > 0)
    508508      {
     509        for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
     510        {
     511          const Window scalEL = getSPS()->getScaledRefLayerWindow();
     512          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
     513
    509514#if VPS_EXTN_DIRECT_REF_LAYERS
    510         TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId - 1 );
    511 #else
    512         TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
    513 #endif
    514         if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )
    515         {
    516           pcEPic->setSpatialEnhLayerFlag( true );
    517 
    518           //only for scalable extension
    519           assert( m_cVPS.getScalabilityMask(1) == true );
     515          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
     516#else
     517          TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
     518#endif
     519          if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets )
     520          {
     521            pcEPic->setSpatialEnhLayerFlag( i, true );
     522
     523            //only for scalable extension
     524            assert( m_cVPS.getScalabilityMask(1) == true );
     525          }
    520526        }
    521527      }
     
    538544      if(m_layerId > 0)
    539545      {
     546        for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
     547        {
     548          const Window scalEL = getSPS()->getScaledRefLayerWindow();
     549          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
     550
    540551#if VPS_EXTN_DIRECT_REF_LAYERS
    541         TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId - 1 );
    542 #else
    543         TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
    544 #endif
    545         if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )
    546         {
    547           rpcPic->setSpatialEnhLayerFlag( true );
    548 
    549           //only for scalable extension
    550           assert( m_cVPS.getScalabilityMask(1) == true );
     552          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
     553#else
     554          TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
     555#endif
     556          if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets )
     557          {
     558            rpcPic->setSpatialEnhLayerFlag( i, true );
     559
     560            //only for scalable extension
     561            assert( m_cVPS.getScalabilityMask(1) == true );
     562          }
    551563        }
    552564      }
     
    12351247    if (m_cIlpPic[0] == NULL)
    12361248    {
    1237       for (Int j=0; j<1/*MAX_NUM_REF*/; j++)
     1249      for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++)
    12381250      {
    12391251        m_cIlpPic[j] = new  TComPic;
     
    12541266Void TEncTop::setILRPic(TComPic *pcPic)
    12551267{
    1256   if(m_cIlpPic[0])
    1257   {
    1258     m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec());
    1259     m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC());
    1260     m_cIlpPic[0]->setLayerId(pcPic->getSlice(0)->getBaseColPic()->getLayerId()); //set reference layerId
    1261     m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false);
    1262     m_cIlpPic[0]->getPicYuvRec()->extendPicBorder();
     1268  for( Int i = 0; i < pcPic->getSlice(0)->getActiveNumILRRefIdx(); i++ )
     1269  {
     1270    Int refLayerIdc = pcPic->getSlice(0)->getInterLayerPredLayerIdc(i);
     1271
     1272    if(m_cIlpPic[refLayerIdc])
     1273    {
     1274      m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(refLayerIdc), m_cIlpPic[refLayerIdc]->getPicYuvRec());
     1275      m_cIlpPic[refLayerIdc]->getSlice(0)->setPOC(pcPic->getPOC());
     1276      m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(refLayerIdc)->getLayerId()); //set reference layerId
     1277      m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false);
     1278      m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder();
     1279    }
    12631280  }
    12641281}
Note: See TracChangeset for help on using the changeset viewer.