Changeset 528 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib/TLibEncoder


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

N0371: Scaling list inferring with macro SCALINGLIST_INFERRING

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

Legend:

Unmodified
Added
Removed
  • 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.