Changeset 292 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
18 Jun 2013, 23:11:33 (12 years ago)
Author:
vidyo
Message:

Implementation of M0043 - Layers Present SEI.
This is disabled by default. Enable this by setting M0043_LAYERS_PRESENT_SEI to 1

Location:
branches/SHM-2.1-dev/source/Lib/TLibDecoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/Lib/TLibDecoder/SEIread.cpp

    r191 r292  
    9595    break;
    9696#endif
     97#if M0043_LAYERS_PRESENT_SEI
     98  case SEI::LAYERS_PRESENT:
     99    fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
     100    break;
     101#endif
    97102#if L0208_SOP_DESCRIPTION_SEI
    98103  case SEI::SOP_DESCRIPTION:
     
    115120 * unmarshal a single SEI message from bitstream bs
    116121 */
     122#if M0043_LAYERS_PRESENT_SEI
     123void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
     124#else
    117125void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps)
     126#endif
    118127{
    119128  setBitstream(bs);
     
    122131  do
    123132  {
     133#if M0043_LAYERS_PRESENT_SEI
     134    xReadSEImessage(seis, nalUnitType, vps, sps);
     135#else
    124136    xReadSEImessage(seis, nalUnitType, sps);
     137#endif
    125138    /* SEI messages are an integer number of bytes, something has failed
    126139    * in the parsing if bitstream not byte-aligned */
     
    133146}
    134147
     148#if M0043_LAYERS_PRESENT_SEI
     149Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
     150#else
    135151Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps)
     152#endif
    136153{
    137154#if ENC_DEC_TRACE
     
    240257      break;
    241258#endif
     259#if M0043_LAYERS_PRESENT_SEI
     260    case SEI::LAYERS_PRESENT:
     261      if (!vps)
     262      {
     263        printf ("Warning: Found Layers present SEI message, but no active VPS is available. Ignoring.");
     264      }
     265      else
     266      {
     267        sei = new SEILayersPresent;
     268        xParseSEILayersPresent((SEILayersPresent&) *sei, payloadSize, vps);
     269      }
     270      break;
     271#endif
    242272#if L0208_SOP_DESCRIPTION_SEI
    243273    case SEI::SOP_DESCRIPTION:
     
    249279    case SEI::SCALABLE_NESTING:
    250280      sei = new SEIScalableNesting;
     281#if M0043_LAYERS_PRESENT_SEI
     282      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps);
     283#else
    251284      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);
     285#endif
    252286      break;
    253287#endif
     
    751785#endif
    752786
     787#if M0043_LAYERS_PRESENT_SEI
     788Void SEIReader::xParseSEILayersPresent(SEILayersPresent &sei, UInt payloadSize, TComVPS *vps)
     789{
     790  UInt uiCode;
     791  UInt i = 0;
     792
     793  READ_UVLC( uiCode,           "lp_sei_active_vps_id" ); sei.m_activeVpsId = uiCode;
     794  assert(vps->getVPSId() == sei.m_activeVpsId);
     795  sei.m_vpsMaxLayers = vps->getMaxLayers();
     796  for (; i < sei.m_vpsMaxLayers; i++)
     797  {
     798    READ_FLAG( uiCode,         "layer_present_flag"   ); sei.m_layerPresentFlag[i] = uiCode ? true : false;
     799  }
     800  for (; i < MAX_LAYERS; i++)
     801  {
     802    sei.m_layerPresentFlag[i] = false;
     803  }
     804  xParseByteAlign();
     805}
     806#endif
     807
    753808#if L0208_SOP_DESCRIPTION_SEI
    754809Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize)
     
    777832#endif
    778833
     834
    779835#if K0180_SCALABLE_NESTING_SEI
     836#if M0043_LAYERS_PRESENT_SEI
     837Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps)
     838#else
    780839Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps)
     840#endif
    781841{
    782842  UInt uiCode;
     
    820880  // read nested SEI messages
    821881  do {
     882#if M0043_LAYERS_PRESENT_SEI
     883    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps);
     884#else
    822885    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps);
     886#endif
    823887  } while (m_pcBitstream->getNumBitsLeft() > 8);
    824888
  • branches/SHM-2.1-dev/source/Lib/TLibDecoder/SEIread.h

    r191 r292  
    5656  SEIReader() {};
    5757  virtual ~SEIReader() {};
     58#if M0043_LAYERS_PRESENT_SEI
     59  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
     60#else
    5861  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps);
     62#endif
    5963protected:
     64#if M0043_LAYERS_PRESENT_SEI
     65  Void xReadSEImessage                (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
     66#else
    6067  Void xReadSEImessage                (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps);
     68#endif
    6169  Void xParseSEIuserDataUnregistered  (SEIuserDataUnregistered &sei, UInt payloadSize);
    6270  Void xParseSEIActiveParameterSets   (SEIActiveParameterSets  &sei, UInt payloadSize);
     
    7381  Void xParseSEIToneMappingInfo       (SEIToneMappingInfo& sei, UInt payloadSize);
    7482#endif
     83#if M0043_LAYERS_PRESENT_SEI
     84  Void xParseSEILayersPresent         (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps);
     85#endif
    7586#if L0208_SOP_DESCRIPTION_SEI
    7687  Void xParseSEISOPDescription        (SEISOPDescription &sei, UInt payloadSize);
    7788#endif
    7889#if K0180_SCALABLE_NESTING_SEI
     90#if M0043_LAYERS_PRESENT_SEI
     91  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps);
     92#else
    7993  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);
     94#endif
    8095#endif
    8196  Void xParseByteAlign();
  • branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r291 r292  
    10981098  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    10991099  {
     1100#if M0043_LAYERS_PRESENT_SEI
     1101    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     1102#else
    11001103    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     1104#endif
    11011105  }
    11021106  else
    11031107  {
     1108#if M0043_LAYERS_PRESENT_SEI
     1109    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     1110#else
    11041111    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );
     1112#endif
    11051113    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
    11061114    if (activeParamSets.size()>0)
     
    11181126  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    11191127  {
     1128#if M0043_LAYERS_PRESENT_SEI
     1129    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
     1130#else
    11201131    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
     1132#endif
    11211133  }
    11221134  else
    11231135  {
     1136#if M0043_LAYERS_PRESENT_SEI
     1137    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
     1138#else
    11241139    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
     1140#endif
    11251141    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
    11261142    if (activeParamSets.size()>0)
Note: See TracChangeset for help on using the changeset viewer.