Changeset 90 in SHVCSoftware for branches/HM-10.0-dev-SHM/source/Lib


Ignore:
Timestamp:
20 Mar 2013, 22:00:39 (12 years ago)
Author:
seregin
Message:

splitting parameter sets for layers

Location:
branches/HM-10.0-dev-SHM/source/Lib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp

    r89 r90  
    4444//! \ingroup TLibCommon
    4545//! \{
     46
     47#if SVC_EXTENSION
     48  ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS);
     49  Int ParameterSetManager::m_activeVPSId = -1;
     50#endif
    4651
    4752TComSlice::TComSlice()
     
    19041909
    19051910ParameterSetManager::ParameterSetManager()
     1911#if SVC_EXTENSION
     1912: m_spsMap(MAX_NUM_SPS)
     1913, m_ppsMap(MAX_NUM_PPS)
     1914, m_activeSPSId(-1)
     1915, m_activePPSId(-1)
     1916#else
    19061917: m_vpsMap(MAX_NUM_VPS)
    19071918, m_spsMap(MAX_NUM_SPS)
     
    19101921, m_activeSPSId(-1)
    19111922, m_activePPSId(-1)
     1923#endif
    19121924{
    19131925}
     
    19461958//! activate a PPS and depending on isIDR parameter also SPS and VPS
    19471959//! \returns true, if activation is successful
    1948 #if SVC_EXTENSION
    1949 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR, UInt layerId)
    1950 #else
    19511960Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR)
    1952 #endif
    19531961{
    19541962  TComPPS *pps = m_ppsMap.getPS(ppsId);
     
    19561964  {
    19571965    Int spsId = pps->getSPSId();
    1958 #if SVC_EXTENSION
    1959     if (!isIDR && (spsId != layerId ))
    1960 #else
    19611966    if (!isIDR && (spsId != m_activeSPSId))
    1962 #endif
    19631967    {
    19641968      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR.");
  • branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.h

    r76 r90  
    16761676  //! activate a PPS and depending on isIDR parameter also SPS and VPS
    16771677  //! \returns true, if activation is successful
    1678 #if SVC_EXTENSION
    1679   Bool activatePPS(Int ppsId, Bool isIDR, UInt layerId);
    1680 #else
    16811678  Bool activatePPS(Int ppsId, Bool isIDR);
    1682 #endif
    16831679
    16841680  TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };
     
    16871683
    16881684protected:
    1689  
     1685
     1686#if SVC_EXTENSION
     1687  static ParameterSetMap<TComVPS> m_vpsMap;
     1688#else
    16901689  ParameterSetMap<TComVPS> m_vpsMap;
     1690#endif
    16911691  ParameterSetMap<TComSPS> m_spsMap;
    16921692  ParameterSetMap<TComPPS> m_ppsMap;
    16931693
     1694#if SVC_EXTENSION
     1695  static Int m_activeVPSId;
     1696#else
    16941697  Int m_activeVPSId;
     1698#endif
    16951699  Int m_activeSPSId;
    16961700  Int m_activePPSId;
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSlice.cpp

    r54 r90  
    4141//! \{
    4242
     43#if SVC_EXTENSION
     44  ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS);
     45#endif
     46
    4347//////////////////////////////////////////////////////////////////////
    4448// Construction/Destruction
     
    398402
    399403ParameterSetManagerDecoder::ParameterSetManagerDecoder()
     404#if SVC_EXTENSION
     405: m_spsBuffer(MAX_NUM_SPS)
     406, m_ppsBuffer(MAX_NUM_PPS)
     407#else
    400408: m_vpsBuffer(MAX_NUM_VPS)
    401409, m_spsBuffer(MAX_NUM_SPS)
    402410, m_ppsBuffer(MAX_NUM_PPS)
     411#endif
    403412{
    404413}
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecSlice.h

    r54 r90  
    111111
    112112private:
     113#if SVC_EXTENSION
     114  static ParameterSetMap<TComVPS> m_vpsBuffer;
     115#else
    113116  ParameterSetMap<TComVPS> m_vpsBuffer;
     117#endif
    114118  ParameterSetMap<TComSPS> m_spsBuffer;
    115119  ParameterSetMap<TComPPS> m_ppsBuffer;
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.cpp

    r76 r90  
    4040
    4141#if SVC_EXTENSION
    42 ParameterSetManagerDecoder TDecTop::m_parameterSetManagerDecoder;  // storage for parameter sets
    4342UInt  TDecTop::m_prevPOC = MAX_UINT;
    4443UInt  TDecTop::m_uiPrevLayerId = MAX_UINT;
     
    332331  printf("\ninserting lost poc : %d\n",iLostPoc);
    333332  TComSlice cFillSlice;
     333#if SVC_EXTENSION
     334  cFillSlice.setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );
     335  cFillSlice.setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );
     336  cFillSlice.initSlice( m_layerId );
     337#else
    334338  cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    335339  cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
    336 #if SVC_EXTENSION
    337   cFillSlice.initSlice( m_parameterSetManagerDecoder.getFirstSPS()->getLayerId() );
    338 #else
    339340  cFillSlice.initSlice();
    340341#endif
    341342  TComPic *cFillPic;
    342343  xGetNewPicBuffer(&cFillSlice,cFillPic);
     344#if SVC_EXTENSION
     345  cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );
     346  cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );
     347  cFillPic->getSlice(0)->initSlice( m_layerId );
     348#else
    343349  cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    344350  cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
    345 #if SVC_EXTENSION
    346   cFillPic->getSlice(0)->initSlice( cFillPic->getLayerId() );
    347 #else
    348351  cFillPic->getSlice(0)->initSlice();
    349352#endif
     
    388391Void TDecTop::xActivateParameterSets()
    389392{
     393#if SVC_EXTENSION
     394  m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS();
     395 
     396  TComPPS *pps = m_parameterSetManagerDecoder[m_layerId].getPPS(m_apcSlicePilot->getPPSId());
     397  assert (pps != 0);
     398
     399  TComSPS *sps = m_parameterSetManagerDecoder[m_layerId].getSPS(pps->getSPSId());
     400  assert (sps != 0);
     401
     402  if( false == m_parameterSetManagerDecoder[m_layerId].activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->getIdrPicFlag()) )
     403#else
    390404  m_parameterSetManagerDecoder.applyPrefetchedPS();
    391405 
     
    396410  assert (sps != 0);
    397411
    398 #if SVC_EXTENSION
    399   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->getIdrPicFlag(), m_apcSlicePilot->getLayerId() ))
    400 #else
    401412  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->getIdrPicFlag()))
    402413#endif
     
    460471  m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId);
    461472
     473#if SVC_EXTENSION
     474  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder[m_layerId]);
     475#else
    462476  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
     477#endif
    463478  if (m_apcSlicePilot->isNextSlice())
    464479  {
     
    713728  {
    714729    pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA );
    715 #if !REF_IDX_FRAMEWORK || AVC_SYNTAX
    716730    // Set reference list
    717731    pcSlice->setRefPicList( m_cListPic );
    718 #endif
    719732
    720733#if SVC_EXTENSION   
     
    756769
    757770#if REF_IDX_FRAMEWORK
    758 #if !AVC_SYNTAX
    759     // Set reference list
    760     pcSlice->setRefPicList( m_cListPic );
    761 #endif
    762771    if(m_layerId > 0)
    763772    {
     
    869878 
    870879  m_cEntropyDecoder.decodeVPS( vps );
     880#if SVC_EXTENSION
     881  m_parameterSetManagerDecoder[0].storePrefetchedVPS(vps);
     882#else
    871883  m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 
     884#endif
    872885}
    873886
     
    879892#endif
    880893  m_cEntropyDecoder.decodeSPS( sps );
     894#if SVC_EXTENSION
     895  m_parameterSetManagerDecoder[m_layerId].storePrefetchedSPS(sps);
     896#else
    881897  m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
     898#endif
    882899#if REF_IDX_MFM
    883900  m_pcSPS = sps;
     
    896913  TComPPS* pps = new TComPPS();
    897914  m_cEntropyDecoder.decodePPS( pps );
     915#if SVC_EXTENSION
     916  m_parameterSetManagerDecoder[m_layerId].storePrefetchedPPS( pps );
     917#else
    898918  m_parameterSetManagerDecoder.storePrefetchedPPS( pps );
     919#endif
    899920
    900921  if( pps->getDependentSliceSegmentsEnabledFlag() )
     
    914935Void TDecTop::xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType )
    915936{
     937#if SVC_EXTENSION
     938  if(nalUnitType == NAL_UNIT_SEI_SUFFIX)
     939  {
     940    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     941  }
     942  else
     943  {
     944    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     945    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
     946    if (activeParamSets.size()>0)
     947    {
     948      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
     949      m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS();
     950      assert(seiAps->activeSeqParamSetId.size()>0);
     951      if (! m_parameterSetManagerDecoder[m_layerId].activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     952      {
     953        printf ("Warning SPS activation with Active parameter set SEI failed");
     954      }
     955    }
     956  }
     957#else
    916958  if(nalUnitType == NAL_UNIT_SEI_SUFFIX)
    917959  {
     
    933975    }
    934976  }
     977#endif
    935978}
    936979
  • branches/HM-10.0-dev-SHM/source/Lib/TLibDecoder/TDecTop.h

    r54 r90  
    7373  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
    7474#if SVC_EXTENSION
    75   static ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     75  ParameterSetManagerDecoder m_parameterSetManagerDecoder[MAX_LAYERS];  // storage for parameter sets
    7676#else
    7777  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
  • branches/HM-10.0-dev-SHM/source/Lib/TLibEncoder/TEncGOP.cpp

    r89 r90  
    10211021#if SVC_EXTENSION
    10221022      OutputNALUnit nalu(NAL_UNIT_VPS, 0, m_layerId);
     1023#if AVC_BASE
     1024      if( m_layerId == 1 )
     1025#else
     1026      if( m_layerId == 0 )
     1027#endif
     1028      {
    10231029#else
    10241030      OutputNALUnit nalu(NAL_UNIT_VPS);
     
    10301036#if RATE_CONTROL_LAMBDA_DOMAIN
    10311037      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
     1038#endif
     1039#if SVC_EXTENSION
     1040      }
    10321041#endif
    10331042
Note: See TracChangeset for help on using the changeset viewer.