Changeset 134 in SHVCSoftware for branches/SHM-2.0-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
2 May 2013, 02:57:45 (12 years ago)
Author:
seregin
Message:

add reference layer dependency

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r133 r134  
    534534    if (m_layerId > 0)
    535535    {
     536#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     537      TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(m_layerId)->getListPic();
     538#else
    536539      TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic();
     540#endif
    537541      pcSlice->setBaseColPic (*cListPic, m_layerId );
    538542    }
     
    734738        for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++)
    735739        {
    736           if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR() )
     740          if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) )
    737741          {
    738742            ColRefIdx = colIdx;
     
    747751          for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++)
    748752          {
    749             if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR() )
     753            if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) )
    750754            {
    751755              ColRefIdx = colIdx;
     
    25502554    for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++)
    25512555    {
     2556#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     2557      if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR(m_layerId) )
     2558      {
     2559        printf( "%d(%d) ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR(), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() );
     2560      }
     2561      else
     2562#endif
    25522563      printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR());
    25532564    }
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r133 r134  
    32963296#if (ENCODER_FAST_MODE)
    32973297        TComPic* pcPic    = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp );
    3298         if( !testILR && pcPic->isILR() && (ePartSize == SIZE_2Nx2N) )
     3298        if( !testILR && pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N) )
    32993299        {
    33003300          continue;
     
    36223622        Bool     testIter = true;
    36233623        TComPic* pcPic    = pcCU->getSlice()->getRefPic( RefPicList(1 - iRefList), iRefIdxBi[1 - iRefList] );
    3624         if(pcPic->isILR() && (ePartSize == SIZE_2Nx2N))
     3624        if(pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N))
    36253625        {
    36263626          testIter = false;  //the fixed part is ILR, skip this iteration       
     
    36373637          Bool testRefIdx = true;
    36383638          pcPic           = pcCU->getSlice()->getRefPic( RefPicList(iRefList) , iRefIdxTemp );
    3639           if(pcPic->isILR() && (ePartSize == SIZE_2Nx2N))
     3639          if(pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N))
    36403640          {
    36413641            testRefIdx = false;  //the refined part is ILR, skip this reference pic           
     
    43084308  //  Do integer search
    43094309#if REF_IDX_ME_ZEROMV
    4310   if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR())  //ILR reference pic
     4310  if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getLayerId()))  //ILR reference pic
    43114311  {
    43124312    rcMv.setZero();  //use Mv(0, 0) for integer ME
     
    43414341  {
    43424342#if REF_IDX_ME_ZEROMV
    4343     if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR())  //ILR reference pic
     4343    if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getLayerId()))  //ILR reference pic
    43444344    {
    43454345      xPatternSearchFracDIFMv0( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost, bBi );
     
    63156315    for( Int refIdx = 0; refIdx < pcCU->getSlice()->getNumRefIdx(eRefPicList); refIdx++ )
    63166316    {
    6317       if( pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->isILR() )
     6317      if( pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->isILR(pcCU->getLayerId()) )
    63186318      {
    63196319        iRefIdxTemp = refIdx;
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r133 r134  
    500500    {
    501501      TEncPic* pcEPic = new TEncPic;
    502 #if SVC_EXTENSION //Temporal solution, should be modified
    503       if(m_layerId > 0)
    504       {
    505         TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
    506         if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )
    507         {
    508           pcEPic->setSpatialEnhLayerFlag( true );
    509         }
    510       }
    511 #endif
    512502
    513503#if SVC_UPSAMPLING
     
    524514      rpcPic = new TComPic;
    525515
    526 #if SVC_EXTENSION //Temporal solution, should be modified
    527       if(m_layerId > 0)
    528       {
    529         TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
    530         if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )
    531         {
    532           rpcPic->setSpatialEnhLayerFlag( true );
    533         }
    534       }
    535 #endif
    536516
    537517#if SVC_UPSAMPLING
     
    543523#endif
    544524    }
     525
     526#if SVC_EXTENSION //Temporal solution, should be modified
     527      if(m_layerId > 0)
     528      {
     529#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     530        TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId );
     531#else
     532        TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
     533#endif
     534        if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )
     535        {
     536          rpcPic->setSpatialEnhLayerFlag( true );
     537        }
     538      }
     539#endif
     540
    545541    if (getUseSAO())
    546542    {
     
    11751171}
    11761172
     1173#if SVC_EXTENSION
     1174#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     1175TEncTop* TEncTop::getRefLayerEnc( UInt layerId )
     1176{
     1177  if( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() <= 0 )
     1178  {
     1179    return NULL;
     1180  }
     1181
     1182  // currently only one reference layer is supported
     1183  assert( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() == 1 );
     1184
     1185  return (TEncTop *)getLayerEnc( getVPS()->getRefLayerId( m_layerId, 0 ) );
     1186}
     1187#endif
     1188
    11771189#if REF_IDX_FRAMEWORK
    11781190Void TEncTop::xInitILRP()
     
    12111223    m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec());
    12121224    m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC());
    1213     m_cIlpPic[0]->setLayerId(0); //set reference layerId
     1225    m_cIlpPic[0]->setLayerId(pcPic->getSlice(0)->getBaseColPic()->getLayerId()); //set reference layerId
    12141226    m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false);
    12151227    m_cIlpPic[0]->getPicYuvRec()->extendPicBorder();
     
    12171229}
    12181230#endif
     1231#endif
    12191232//! \}
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.h

    r133 r134  
    212212#if REF_IDX_FRAMEWORK
    213213  TComPic** getIlpList() { return m_cIlpPic; }
    214   Void setILRPic(TComPic *pcPic);
     214  Void      setILRPic(TComPic *pcPic);
    215215#endif
    216216#if REF_IDX_MFM
    217   Void setMFMEnabledFlag       (Bool flag)   {m_bMFMEnabledFlag = flag;}
    218   Bool getMFMEnabledFlag()                   {return m_bMFMEnabledFlag;}   
     217  Void      setMFMEnabledFlag       (Bool flag)   {m_bMFMEnabledFlag = flag;}
     218  Bool      getMFMEnabledFlag()                   {return m_bMFMEnabledFlag;}   
    219219#endif
    220220#if AVC_SYNTAX
     
    222222  fstream*  getBLSyntaxFile() { return m_pBLSyntaxFile; }
    223223#endif
    224   Void encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
    225               std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP  );
    226   Void encodePrep( TComPicYuv* pcPicYuvOrg );
     224  Void      encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP  );
     225  Void      encodePrep( TComPicYuv* pcPicYuvOrg );
     226#if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE
     227  TEncTop*  getRefLayerEnc(UInt layerId);
     228#endif
    227229#else
    228230  Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
Note: See TracChangeset for help on using the changeset viewer.