Changeset 528 in SHVCSoftware


Ignore:
Timestamp:
24 Dec 2013, 18:24:19 (11 years ago)
Author:
seregin
Message:

N0371: Scaling list inferring with macro SCALINGLIST_INFERRING

Location:
branches/SHM-4.1-dev/source/Lib
Files:
9 edited

Legend:

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

    r525 r528  
    23742374#endif
    23752375#endif
     2376#if SCALINGLIST_INFERRING
     2377, m_inferScalingListFlag ( false )
     2378, m_scalingListRefLayerId ( 0 )
     2379#endif
    23762380#endif //SVC_EXTENSION
    23772381{
     
    23972401TComSPS::~TComSPS()
    23982402{
     2403#if SCALINGLIST_INFERRING
     2404  if( !m_inferScalingListFlag )
     2405#endif
    23992406  delete m_scalingList;
    24002407  m_RPSList.destroy();
     
    25742581, m_listsModificationPresentFlag(  0)
    25752582, m_numExtraSliceHeaderBits(0)
     2583#if SCALINGLIST_INFERRING
     2584, m_inferScalingListFlag ( false )
     2585, m_scalingListRefLayerId ( 0 )
     2586#endif
    25762587{
    25772588  m_scalingList = new TComScalingList;
     
    25902601    m_puiRowHeight = NULL;
    25912602  }
     2603
     2604#if SCALINGLIST_INFERRING
     2605  if( !m_inferScalingListFlag )
     2606#endif
    25922607  delete m_scalingList;
    25932608}
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h

    r525 r528  
    13161316  UInt m_updateRepFormatIndex;
    13171317#endif
     1318#endif
     1319#if SCALINGLIST_INFERRING
     1320  Bool       m_inferScalingListFlag;
     1321  UInt       m_scalingListRefLayerId;
    13181322#endif
    13191323#endif //SVC_EXTENSION
     
    14491453#endif
    14501454
     1455#if SCALINGLIST_INFERRING
     1456  Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; }
     1457#else
    14511458  Void setScalingList      ( TComScalingList *scalingList);
     1459#endif
    14521460  TComScalingList* getScalingList ()       { return m_scalingList; }               //!< get ScalingList class pointer in SPS
    14531461
     
    15081516  Void     setUpdateRepFormatIndex(UInt index)  { m_updateRepFormatIndex = index; }
    15091517#endif
     1518#endif
     1519#if SCALINGLIST_INFERRING
     1520  Bool     getInferScalingListFlag()  { return m_inferScalingListFlag;  }
     1521  UInt     getScalingListRefLayerId() { return m_scalingListRefLayerId; }
     1522  Void     setInferScalingListFlag( Bool flag )     { m_inferScalingListFlag = flag;     }
     1523  Void     setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; }
    15101524#endif
    15111525#endif //SVC_EXTENSION
     
    16091623  UInt m_log2ParallelMergeLevelMinus2;
    16101624  Int m_numExtraSliceHeaderBits;
     1625
     1626#if SCALINGLIST_INFERRING
     1627  Bool     m_inferScalingListFlag;
     1628  UInt     m_scalingListRefLayerId;
     1629#endif
    16111630
    16121631public:
     
    17201739  Void     setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag  = b;       }
    17211740
     1741#if SCALINGLIST_INFERRING
     1742  UInt     getLayerId() { return m_layerId; }
     1743  Void     setLayerId( UInt layerId ) { m_layerId = layerId;            }
     1744  Bool     getInferScalingListFlag()  { return m_inferScalingListFlag;  }
     1745  UInt     getScalingListRefLayerId() { return m_scalingListRefLayerId; }
     1746  Void     setInferScalingListFlag( Bool flag )     { m_inferScalingListFlag = flag;     }
     1747  Void     setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; }
     1748#endif
    17221749#if IL_SL_SIGNALLING_N0371
    17231750  Void     setLayerId(UInt layerId) { m_layerId = layerId; }
     
    17331760#endif
    17341761
     1762#if SCALINGLIST_INFERRING
     1763  Void     setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; }
     1764#else
    17351765  Void     setScalingList      ( TComScalingList *scalingList);
     1766#endif
    17361767  TComScalingList* getScalingList ()          { return m_scalingList; }         //!< get ScalingList class pointer in PPS
    17371768  Bool getListsModificationPresentFlag ()          { return m_listsModificationPresentFlag; }
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h

    r526 r528  
    6464
    6565#define IL_SL_SIGNALLING_N0371           0      ///< JCTVC-N0371: inter-layer scaling list
     66#define SCALINGLIST_INFERRING            1      ///< JCTVC-N0371: inter-layer scaling list
    6667#define M0463_VUI_EXT_ILP_REF            0      ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling
    6768#define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r525 r528  
    290290    }
    291291  }
     292
     293#if SCALINGLIST_INFERRING
     294  if( pcPPS->getLayerId() > 0 )
     295  {
     296    READ_FLAG( uiCode, "pps_infer_scaling_list_flag" );
     297    pcPPS->setInferScalingListFlag( uiCode );
     298  }
     299
     300  if( pcPPS->getInferScalingListFlag() )
     301  {
     302    READ_UVLC( uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode );
     303
     304    // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     305    assert( pcPPS->getScalingListRefLayerId() <= 62 );
     306
     307    pcPPS->setScalingListPresentFlag( false );
     308  }
     309  else
     310  {
     311#endif
     312
    292313  READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
    293314
     
    343364#endif
    344365  }
     366
     367#if SCALINGLIST_INFERRING
     368  }
     369#endif
    345370
    346371  READ_FLAG( uiCode, "lists_modification_present_flag");
     
    716741  if(pcSPS->getScalingListFlag())
    717742  {
     743#if SCALINGLIST_INFERRING
     744    if( pcSPS->getLayerId() > 0 )
     745    {
     746      READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setInferScalingListFlag( uiCode );
     747    }
     748
     749    if( pcSPS->getInferScalingListFlag() )
     750    {
     751      READ_UVLC( uiCode, "sps_scaling_list_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode );
     752
     753      // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     754      assert( pcSPS->getScalingListRefLayerId() <= 62 );
     755
     756      pcSPS->setScalingListPresentFlag( false );
     757    }
     758    else
     759    {
     760#endif
    718761    READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
    719762    if(pcSPS->getScalingListPresentFlag ())
     
    766809
    767810    }
     811#if SCALINGLIST_INFERRING
     812    }
     813#endif
    768814  }
    769815  READ_FLAG( uiCode, "amp_enabled_flag" );                          pcSPS->setUseAMP( uiCode );
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r526 r528  
    551551  printf("\ninserting lost poc : %d\n",iLostPoc);
    552552  TComSlice cFillSlice;
    553 #if SVC_EXTENSION
    554   cFillSlice.setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );
    555   cFillSlice.setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );
    556   cFillSlice.setVPS( m_parameterSetManagerDecoder[m_layerId].getFirstVPS() );
    557   cFillSlice.initSlice( m_layerId );
    558 #else
    559553  cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    560554  cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
     555#if SVC_EXTENSION
     556  cFillSlice.setVPS( m_parameterSetManagerDecoder.getFirstVPS() );
     557  cFillSlice.initSlice( m_layerId );
     558#else
    561559  cFillSlice.initSlice();
    562560#endif
    563561  TComPic *cFillPic;
    564562  xGetNewPicBuffer(&cFillSlice,cFillPic);
    565 #if SVC_EXTENSION
    566   cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );
    567   cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );
    568   cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder[m_layerId].getFirstVPS() );
    569   cFillPic->getSlice(0)->initSlice( m_layerId );
    570 #else
    571563  cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    572564  cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
     565#if SVC_EXTENSION
     566  cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder.getFirstVPS() );
     567  cFillPic->getSlice(0)->initSlice( m_layerId );
     568#else
    573569  cFillPic->getSlice(0)->initSlice();
    574570#endif
     
    613609Void TDecTop::xActivateParameterSets()
    614610{
    615 #if SVC_EXTENSION
    616   m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS();
    617  
    618   TComPPS *pps = m_parameterSetManagerDecoder[m_layerId].getPPS(m_apcSlicePilot->getPPSId());
    619   assert (pps != 0);
    620 
    621   TComSPS *sps = m_parameterSetManagerDecoder[m_layerId].getSPS(pps->getSPSId());
    622   assert (sps != 0);
    623 
    624   if( false == m_parameterSetManagerDecoder[m_layerId].activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->isIRAP()) )
    625 #else
    626611  m_parameterSetManagerDecoder.applyPrefetchedPS();
    627612 
     
    633618
    634619  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    635 #endif
    636620  {
    637621    printf ("Parameter set activation failed!");
    638622    assert (0);
    639623  }
     624
     625#if SCALINGLIST_INFERRING
     626  // scaling list settings and checks
     627  TComVPS *activeVPS = m_parameterSetManagerDecoder.getActiveVPS();
     628  TComSPS *activeSPS = m_parameterSetManagerDecoder.getActiveSPS();
     629  TComPPS *activePPS = m_parameterSetManagerDecoder.getActivePPS();
     630
     631  if( activeSPS->getInferScalingListFlag() )
     632  {
     633    UInt refLayerId = activeSPS->getScalingListRefLayerId();
     634    TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL );
     635
     636    // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
     637    if( activeVPS->getAvcBaseLayerFlag() )
     638    {
     639      assert( refLayerId > 0 );
     640    }
     641
     642    // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
     643    // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id
     644    assert( refSps->getInferScalingListFlag() == false );
     645
     646    // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
     647    // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
     648    assert( activeVPS->getRecursiveRefLayerFlag( activeSPS->getLayerId(), refLayerId ) == true );
     649   
     650    if( activeSPS->getScalingList() != refSps->getScalingList() )
     651    {
     652      // delete created instance of scaling list since it will be inferred
     653      delete activeSPS->getScalingList();
     654
     655      // infer scaling list
     656      activeSPS->setScalingList( refSps->getScalingList() );
     657    }
     658  }
     659
     660  if( activePPS->getInferScalingListFlag() )
     661  {
     662    UInt refLayerId = activePPS->getScalingListRefLayerId();
     663    TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL );
     664
     665    // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
     666    if( activeVPS->getAvcBaseLayerFlag() )
     667    {
     668      assert( refLayerId > 0 );
     669    }
     670
     671    // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
     672    // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id
     673    assert( refPps->getInferScalingListFlag() == false );
     674
     675    // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
     676    // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
     677    assert( activeVPS->getRecursiveRefLayerFlag( activePPS->getLayerId(), refLayerId ) == true );
     678   
     679    if( activePPS->getScalingList() != refPps->getScalingList() )
     680    {
     681      // delete created instance of scaling list since it will be inferred
     682      delete activePPS->getScalingList();
     683
     684      // infer scaling list
     685      activePPS->setScalingList( refPps->getScalingList() );
     686    }
     687
     688  }
     689#endif
    640690
    641691  if( pps->getDependentSliceSegmentsEnabledFlag() )
     
    709759  TComPic*&   pcPic         = m_pcPic;
    710760#if SVC_EXTENSION
    711   m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder[m_layerId].getPrefetchedVPS(0) );
     761  m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) );
    712762#if OUTPUT_LAYER_SET_INDEX
    713763  // Following check should go wherever the VPS is activated
     
    751801  m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() );
    752802#endif
    753   m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder[m_layerId]);
    754 #else
     803#endif
    755804  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    756 #endif
    757805
    758806  // set POC for dependent slices in skipped pictures
     
    950998  {
    951999#if AVC_BASE
    952     if( m_layerId == 1 && m_parameterSetManagerDecoder[0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
     1000    if( m_layerId == 1 && m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
    9531001    {
    9541002      TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
     
    11871235        UInt refLayerIdc = i;
    11881236#if AVC_BASE
    1189         if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )
     1237        if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() )
    11901238        {
    11911239          pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() );
     
    12781326        UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    12791327#if AVC_BASE
    1280         if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )
     1328        if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() )
    12811329        {
    12821330          pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() );
     
    14311479      pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList()  );
    14321480    }
     1481#if SCALINGLIST_INFERRING
     1482    if( m_layerId == 0 || ( m_layerId > 0 && !pcSlice->getPPS()->getInferScalingListFlag() && !pcSlice->getSPS()->getInferScalingListFlag() ) )
     1483#endif
    14331484    if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag())
    14341485    {
     
    14661517 
    14671518  m_cEntropyDecoder.decodeVPS( vps );
    1468 #if SVC_EXTENSION
    1469   m_parameterSetManagerDecoder[0].storePrefetchedVPS(vps);
    1470 #else
    14711519  m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 
    1472 #endif
    14731520}
    14741521
     
    14781525#if SVC_EXTENSION
    14791526  sps->setLayerId(m_layerId);
    1480   m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder[0] );
    1481   m_parameterSetManagerDecoder[m_layerId].storePrefetchedSPS(sps);
     1527  m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder );
     1528  m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
    14821529#if !REPN_FORMAT_IN_VPS   // ILRP can only be initialized at activation 
    14831530  if(m_numLayer>0)
     
    14961543  TComPPS* pps = new TComPPS();
    14971544
    1498 #if IL_SL_SIGNALLING_N0371
    1499   pps->setLayerId(m_layerId);
     1545#if SCALINGLIST_INFERRING || IL_SL_SIGNALLING_N0371
     1546  pps->setLayerId( m_layerId );
    15001547#endif
    15011548
    15021549  m_cEntropyDecoder.decodePPS( pps );
    1503 #if SVC_EXTENSION
    1504   m_parameterSetManagerDecoder[m_layerId].storePrefetchedPPS( pps );
    1505 #else
    15061550  m_parameterSetManagerDecoder.storePrefetchedPPS( pps );
    1507 #endif
    15081551
    15091552  if( pps->getDependentSliceSegmentsEnabledFlag() )
     
    15331576#endif
    15341577#if M0043_LAYERS_PRESENT_SEI
    1535     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
    1536 #else
    1537     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     1578    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
     1579#else
     1580    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    15381581#endif
    15391582  }
     
    15411584  {
    15421585#if M0043_LAYERS_PRESENT_SEI
    1543     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
    1544 #else
    1545     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     1586    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
     1587#else
     1588    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    15461589#endif
    15471590    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
     
    15491592    {
    15501593      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    1551       m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS();
     1594      m_parameterSetManagerDecoder.applyPrefetchedPS();
    15521595      assert(seiAps->activeSeqParamSetId.size()>0);
    1553       if (! m_parameterSetManagerDecoder[m_layerId].activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     1596      if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParamSetId[0] ) )
    15541597      {
    15551598        printf ("Warning SPS activation with Active parameter set SEI failed");
     
    16061649      xDecodeVPS();
    16071650#if AVC_BASE
    1608       if( m_parameterSetManagerDecoder[0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
     1651      if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
    16091652      {
    16101653        if( !m_ppcTDecTop[0]->getBLReconFile()->good() )
     
    16321675      xDecodeSPS();
    16331676#if AVC_BASE
    1634       if( m_parameterSetManagerDecoder[0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
     1677      if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() )
    16351678      {
    16361679        TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
     
    16381681        {
    16391682          // using EL SPS with spsId = 1
    1640           TComSPS* sps = m_parameterSetManagerDecoder[nalu.m_layerId].getPrefetchedSPS(1);
     1683          TComSPS* sps = m_parameterSetManagerDecoder.getPrefetchedSPS(1);
    16411684          Int  numReorderPics[MAX_TLAYER];
    16421685          Window &conformanceWindow = sps->getConformanceWindow();
     
    17871830TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdc )
    17881831{
    1789   TComVPS* vps = m_parameterSetManagerDecoder[0].getActiveVPS();
     1832  TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS();
    17901833  if( vps->getNumDirectRefLayers( m_layerId ) <= 0 )
    17911834  {
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.h

    r521 r528  
    7272
    7373  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
    74 #if SVC_EXTENSION
    75   ParameterSetManagerDecoder m_parameterSetManagerDecoder[MAX_LAYERS];  // storage for parameter sets
    76 #else
    7774  ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
    78 #endif
    7975
    8076  TComSlice*              m_apcSlicePilot;
     
    249245  Void      checkValueOfOutputLayerSetIdx(TComVPS *vps);
    250246#endif
     247#if SCALINGLIST_INFERRING
     248  ParameterSetManagerDecoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; }
     249#endif
    251250};// END CLASS DEFINITION TDecTop
    252251
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r525 r528  
    220220    }
    221221  }
     222
     223#if SCALINGLIST_INFERRING
     224  if( pcPPS->getLayerId() > 0 )
     225  {
     226    WRITE_FLAG( pcPPS->getInferScalingListFlag() ? 1 : 0, "pps_infer_scaling_list_flag" );
     227  }
     228
     229  if( pcPPS->getInferScalingListFlag() )
     230  {
     231    // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     232    assert( pcPPS->getScalingListRefLayerId() <= 62 );
     233
     234    WRITE_UVLC( pcPPS->getScalingListRefLayerId(), "pps_scaling_list_ref_layer_id" );
     235  }
     236  else
     237  {
     238#endif
     239
    222240  WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" );
    223241
     
    275293    codeScalingList( m_pcSlice->getScalingList() );
    276294#endif
    277 
    278   }
     295  }
     296
     297#if SCALINGLIST_INFERRING
     298  }
     299#endif
     300
    279301  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
    280302  WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
     
    553575  if(pcSPS->getScalingListFlag())
    554576  {
     577#if SCALINGLIST_INFERRING
     578    if( pcSPS->getLayerId() > 0 )
     579    {
     580      WRITE_FLAG( pcSPS->getInferScalingListFlag() ? 1 : 0, "sps_infer_scaling_list_flag" );
     581    }
     582
     583    if( pcSPS->getInferScalingListFlag() )
     584    {
     585      // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive
     586      assert( pcSPS->getScalingListRefLayerId() <= 62 );
     587
     588      WRITE_UVLC( pcSPS->getScalingListRefLayerId(), "sps_scaling_list_ref_layer_id" );
     589    }
     590    else
     591    {
     592#endif
    555593    WRITE_FLAG( pcSPS->getScalingListPresentFlag() ? 1 : 0,                          "sps_scaling_list_data_present_flag" );
    556594    if(pcSPS->getScalingListPresentFlag())
     
    606644
    607645    }
     646#if SCALINGLIST_INFERRING
     647    }
     648#endif
    608649  }
    609650  WRITE_FLAG( pcSPS->getUseAMP() ? 1 : 0,                                            "amp_enabled_flag" );
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r524 r528  
    683683    else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_DEFAULT)
    684684    {
     685#if SCALINGLIST_INFERRING
     686      // inferring of the scaling list can be moved to the config file
     687      UInt refLayerId = 0;
     688      if( m_layerId > 0 && !m_pcEncTop->getVPS()->getAvcBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )
     689      {
     690        m_pcEncTop->getSPS()->setInferScalingListFlag( true );
     691        m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );
     692        m_pcEncTop->getSPS()->setScalingListPresentFlag( false );
     693        m_pcEncTop->getPPS()->setInferScalingListFlag( false );
     694        m_pcEncTop->getPPS()->setScalingListPresentFlag( false );
     695
     696        // infer the scaling list from the reference layer
     697        pcSlice->setScalingList ( m_ppcTEncTop[refLayerId]->getScalingList() );
     698      }
     699      else
     700      {
     701#endif
    685702#if IL_SL_SIGNALLING_N0371
    686703      pcSlice->getScalingList()->setLayerId( m_layerId );
     
    695712      m_pcEncTop->getSPS()->setScalingListPresentFlag(false);
    696713      m_pcEncTop->getPPS()->setScalingListPresentFlag(false);
     714
     715#if SCALINGLIST_INFERRING
     716      }
     717#endif
     718
    697719      m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList());
    698720      m_pcEncTop->getTrQuant()->setUseScalingList(true);
     
    704726#endif
    705727
     728#if SCALINGLIST_INFERRING
     729      // inferring of the scaling list can be moved to the config file
     730      UInt refLayerId = 0;
     731      if( m_layerId > 0 && !m_pcEncTop->getVPS()->getAvcBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )
     732      {
     733        m_pcEncTop->getSPS()->setInferScalingListFlag( true );
     734        m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );
     735        m_pcEncTop->getSPS()->setScalingListPresentFlag( false );
     736        m_pcEncTop->getPPS()->setInferScalingListFlag( false );
     737        m_pcEncTop->getPPS()->setScalingListPresentFlag( false );
     738
     739        // infer the scaling list from the reference layer
     740        pcSlice->setScalingList ( m_ppcTEncTop[refLayerId]->getScalingList() );
     741      }
     742      else
     743      {
     744#endif
     745
    706746      if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile()))
    707747      {
     
    735775        m_pcEncTop->getPPS()->setScalingListRefLayerId( 0   );
    736776      }
     777#endif
     778
     779#if SCALINGLIST_INFERRING
     780    }
    737781#endif
    738782
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r507 r528  
    10741074Void TEncTop::xInitPPS()
    10751075{
    1076 #if IL_SL_SIGNALLING_N0371
    1077   m_cPPS.setLayerId(m_layerId);
     1076#if SCALINGLIST_INFERRING ||  IL_SL_SIGNALLING_N0371
     1077  m_cPPS.setLayerId( m_layerId );
    10781078#endif
    10791079
Note: See TracChangeset for help on using the changeset viewer.