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


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/TLibEncoder
Files:
5 edited

Legend:

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

    r191 r292  
    8989    break;
    9090#endif
     91#if M0043_LAYERS_PRESENT_SEI
     92  case SEI::LAYERS_PRESENT:
     93    fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
     94    break;
     95#endif
    9196#if L0208_SOP_DESCRIPTION_SEI
    9297  case SEI::SOP_DESCRIPTION:
     
    150155  case SEI::TONE_MAPPING_INFO:
    151156    xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
     157    break;
     158#endif
     159#if M0043_LAYERS_PRESENT_SEI
     160  case SEI::LAYERS_PRESENT:
     161    xWriteSEILayersPresent(*static_cast<const SEILayersPresent*>(&sei));
    152162    break;
    153163#endif
     
    591601}
    592602
     603#if M0043_LAYERS_PRESENT_SEI
     604Void SEIWriter::xWriteSEILayersPresent(const SEILayersPresent& sei)
     605{
     606  WRITE_UVLC( sei.m_activeVpsId,           "lp_sei_active_vps_id" );
     607  for (UInt i = 0; i < sei.m_vpsMaxLayers; i++)
     608  {
     609    WRITE_FLAG( sei.m_layerPresentFlag[i], "layer_present_flag"   );
     610  }
     611  xWriteByteAlign();
     612}
     613#endif
     614
    593615#if L0208_SOP_DESCRIPTION_SEI
    594616Void SEIWriter::xWriteSEISOPDescription(const SEISOPDescription& sei)
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/SEIwrite.h

    r191 r292  
    7070  Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei);
    7171#endif
     72#if M0043_LAYERS_PRESENT_SEI
     73  Void xWriteSEILayersPresent(const SEILayersPresent& sei);
     74#endif
    7275#if L0208_SOP_DESCRIPTION_SEI
    7376  Void xWriteSEISOPDescription(const SEISOPDescription& sei);
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCfg.h

    r290 r292  
    289289  Int       m_gradualDecodingRefreshInfoEnabled;
    290290  Int       m_decodingUnitInfoSEIEnabled;
     291#if M0043_LAYERS_PRESENT_SEI
     292  Int       m_layersPresentSEIEnabled;
     293#endif
    291294#if L0208_SOP_DESCRIPTION_SEI
    292295  Int       m_SOPDescriptionSEIEnabled;
     
    733736  Void  setDecodingUnitInfoSEIEnabled(Int b)                { m_decodingUnitInfoSEIEnabled = b;    }
    734737  Int   getDecodingUnitInfoSEIEnabled()                     { return m_decodingUnitInfoSEIEnabled; }
     738#if M0043_LAYERS_PRESENT_SEI
     739  Void  setLayersPresentSEIEnabled(Int b)                { m_layersPresentSEIEnabled = b; }
     740  Int   getLayersPresentSEIEnabled()                     { return m_layersPresentSEIEnabled; }
     741#endif
    735742#if L0208_SOP_DESCRIPTION_SEI
    736743  Void  setSOPDescriptionSEIEnabled(Int b)                { m_SOPDescriptionSEIEnabled = b; }
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r291 r292  
    173173}
    174174
     175#if M0043_LAYERS_PRESENT_SEI
     176SEILayersPresent* TEncGOP::xCreateSEILayersPresent ()
     177{
     178  UInt i = 0;
     179  SEILayersPresent *seiLayersPresent = new SEILayersPresent();
     180  seiLayersPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId();
     181  seiLayersPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
     182  for ( ; i < seiLayersPresent->m_vpsMaxLayers; i++)
     183  {
     184    seiLayersPresent->m_layerPresentFlag[i] = true;
     185  }
     186  for ( ; i < MAX_LAYERS; i++)
     187  {
     188    seiLayersPresent->m_layerPresentFlag[i] = false;
     189  }
     190  return seiLayersPresent;
     191}
     192#endif
     193
    175194SEIFramePacking* TEncGOP::xCreateSEIFramePacking()
    176195{
     
    319338#endif
    320339  }
     340
     341#if M0043_LAYERS_PRESENT_SEI
     342  if(m_pcCfg->getLayersPresentSEIEnabled())
     343  {
     344    SEILayersPresent *sei = xCreateSEILayersPresent ();
     345    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     346    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     347    writeRBSPTrailingBits(nalu.m_Bitstream);
     348    accessUnit.push_back(new NALUnitEBSP(nalu));
     349    delete sei;
     350  }
     351#endif
    321352
    322353  if(m_pcCfg->getFramePackingArrangementSEIEnabled())
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.h

    r291 r292  
    180180
    181181  SEIActiveParameterSets* xCreateSEIActiveParameterSets (TComSPS *sps);
     182#if M0043_LAYERS_PRESENT_SEI
     183  SEILayersPresent*       xCreateSEILayersPresent ();
     184#endif
    182185  SEIFramePacking*        xCreateSEIFramePacking();
    183186  SEIDisplayOrientation*  xCreateSEIDisplayOrientation();
Note: See TracChangeset for help on using the changeset viewer.