Ignore:
Timestamp:
11 Dec 2015, 00:05:48 (8 years ago)
Author:
seregin
Message:

infer parameters in SPS after activation, fixing chroma scaling for non 4:2:0

File:
1 edited

Legend:

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

    r1459 r1502  
    288288  if(getUseScalingListId() == SCALING_LIST_OFF)
    289289  {
    290 #if SVC_EXTENSION
    291     getTrQuant()->setFlatScalingList( maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId) );
    292 #else
    293290    getTrQuant()->setFlatScalingList(maxLog2TrDynamicRange, m_cSPS.getBitDepths());
    294 #endif
    295291    getTrQuant()->setUseScalingList(false);
    296292    m_cSPS.setScalingListPresentFlag(false);
     
    311307
    312308      // infer the scaling list from the reference layer
    313       getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId) );
     309      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getBitDepths() );
    314310    }
    315311    else
     
    320316    m_cPPS.setScalingListPresentFlag(false);
    321317
    322 #if SVC_EXTENSION
    323     getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId));
    324 #else
    325318    getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), maxLog2TrDynamicRange, m_cSPS.getBitDepths());
    326 #endif
    327319#if SVC_EXTENSION
    328320    }
     
    344336
    345337      // infer the scaling list from the reference layer
    346       getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId) );
     338      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getBitDepths() );
    347339    }
    348340    else
     
    731723          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
    732724
    733           UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i);
    734 
    735           const Int bitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, &m_cSPS, m_layerId);
    736           const Int bitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, &m_cSPS, m_layerId);
    737           const Int refBitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, pcEncTopBase->getSPS(), refLayerId);
    738           const Int refBitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, pcEncTopBase->getSPS(), refLayerId);
     725          const Int bitDepthLuma = m_cSPS.getBitDepth(CHANNEL_TYPE_LUMA);
     726          const Int bitDepthChroma = m_cSPS.getBitDepth(CHANNEL_TYPE_CHROMA);
     727          const Int refBitDepthLuma = pcEncTopBase->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     728          const Int refBitDepthChroma = pcEncTopBase->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    739729
    740730          Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma );
     
    781771          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
    782772
    783           UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i);
    784 
    785           const Int bitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, &m_cSPS, m_layerId);
    786           const Int bitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, &m_cSPS, m_layerId);
    787           const Int refBitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, pcEncTopBase->getSPS(), refLayerId);
    788           const Int refBitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, pcEncTopBase->getSPS(), refLayerId);
     773          const Int bitDepthLuma = m_cSPS.getBitDepth(CHANNEL_TYPE_LUMA);
     774          const Int bitDepthChroma = m_cSPS.getBitDepth(CHANNEL_TYPE_CHROMA);
     775          const Int refBitDepthLuma = m_cSPS.getBitDepth(CHANNEL_TYPE_LUMA);
     776          const Int refBitDepthChroma = m_cSPS.getBitDepth(CHANNEL_TYPE_CHROMA);
    789777
    790778          Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma );
     
    10341022  m_cSPS.getSpsRangeExtension().setPersistentRiceAdaptationEnabledFlag(m_persistentRiceAdaptationEnabledFlag);
    10351023  m_cSPS.getSpsRangeExtension().setCabacBypassAlignmentEnabledFlag(m_cabacBypassAlignmentEnabledFlag);
     1024
     1025#if SVC_EXTENSION
     1026  m_cSPS.inferSPS( m_layerId, &m_cVPS );
     1027#endif
    10361028}
    10371029
Note: See TracChangeset for help on using the changeset viewer.