Changeset 1331 in 3DVCSoftware


Ignore:
Timestamp:
18 Sep 2015, 23:09:19 (9 years ago)
Author:
vidyo
Message:

LAYERS_NOT_PRESENT SEI message changes by Vidyo, Inc.
All the changes are under the #define NH_MV_LAYERS_NOT_PRESENT_SEI
Extra information passed into parseSEI - vps as MaxNumLayers is required in order to know how many flags to read.
contact:
jpadia@…, danny@…

Location:
branches/HTM-15.1-dev0-Vidyo/source/Lib
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibCommon/SEI.cpp

    r1328 r1331  
    224224#endif
    225225#if NH_MV_SEI
    226 #if NH_MV_SEI_TBD
     226#if NH_MV_LAYERS_NOT_PRESENT_SEI
    227227  case SEI::LAYERS_NOT_PRESENT                    :               return new SEILayersNotPresent;
    228228#endif
     
    342342
    343343
    344 #if NH_MV_SEI_TBD
     344#if NH_MV_LAYERS_NOT_PRESENT_SEI
    345345Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile)
    346346{
     
    349349
    350350  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
    351   defAppLayerIds    .push_back( TBD );
    352   defAppPocs        .push_back( TBD );
    353   defAppTids        .push_back( TBD );
    354   defAppVclNaluTypes.push_back( TBD );
     351  // This SEI message doesn't need to be added by default to any Layer / POC / NAL Unit / T Layer. Not sure if empty is right.
     352  defAppLayerIds     empty( );      //push_back( TBD );
     353  defAppPocs         empty( );      //push_back( TBD );
     354  defAppTids         empty( );      //push_back( TBD );
     355  defAppVclNaluTypes.empty( );      //push_back( TBD );
    355356
    356357  Int      defSeiNaluId                  = 0;
    357358  Int      defPositionInSeiNalu          = 0;
    358   Bool     defModifyByEncoder            = TBD;
     359  Bool     defModifyByEncoder            = false;   //0: Use payload as specified in cfg file   1: Modify SEI by encoder
    359360
    360361  // Setup config file options
     
    363364
    364365  opts.addOptions()
    365     ("LnpSeiActiveVpsId"              , m_lnpSeiActiveVpsId                , 0                              , "LnpSeiActiveVpsId"                )
     366    ("LnpSeiActiveVpsId"              , m_lnpSeiActiveVpsId                , 0                              , "LnpSeiActiveVpsId"                )   //Why?
    366367    ("LayerNotPresentFlag"            , m_layerNotPresentFlag              , BoolAry1d(1,0)                 , "LayerNotPresentFlag"              )
    367368    ;
     
    372373  po::ErrorReporter err;
    373374  po::parseConfigFile( opts, cfgFile, err );
    374 };
    375 
    376 Bool SEILayersNotPresent::checkCfg( const TComSlice* slice )
    377 {
    378   // Check config values
    379   Bool wrongConfig = false;
    380 
    381   // TBD: Add constraints on presence of SEI here.
    382   xCheckCfg     ( wrongConfig, TBD , "TBD" );
    383   xCheckCfg     ( wrongConfig, TBD , "TBD" );
    384 
    385   // TBD: Modify constraints according to the SEI semantics.
    386   xCheckCfgRange( wrongConfig, m_lnpSeiActiveVpsId              , MINVAL , MAXVAL, "lnp_sei_active_vps_id"            );
    387   xCheckCfgRange( wrongConfig, m_layerNotPresentFlag[i]         , MINVAL , MAXVAL, "layer_not_present_flag"           );
    388 
    389   return wrongConfig;
    390 };
    391 
    392 Void SEILayersNotPresent::setupFromSlice  ( const TComSlice* slice )
    393 {
    394   sei.m_lnpSeiActiveVpsId =  TBD ;
    395   for( Int i = 0; i  <=  MaxLayersMinus1; i++ )
    396   {
    397     sei.m_layerNotPresentFlag[i] =  TBD ;
    398   }
    399 };
     375  m_lnpSeiMaxLayers = m_layerNotPresentFlag.size();
     376};
     377
     378  Bool SEILayersNotPresent::checkCfg( const TComSlice* slice )
     379  {
     380//  // Check config values
     381//  Bool wrongConfig = false;
     382//
     383//  // TBD: Add constraints on presence of SEI here.
     384//  xCheckCfg     ( wrongConfig, TBD , "TBD" );
     385//  xCheckCfg     ( wrongConfig, TBD , "TBD" );
     386//
     387//  // TBD: Modify constraints according to the SEI semantics.
     388//  xCheckCfgRange( wrongConfig, m_lnpSeiActiveVpsId              , MINVAL , MAXVAL, "lnp_sei_active_vps_id"            );
     389//  xCheckCfgRange( wrongConfig, m_layerNotPresentFlag[i]         , MINVAL , MAXVAL, "layer_not_present_flag"           );
     390//
     391//  return wrongConfig;
     392      return false;
     393  };
     394//
     395//Void SEILayersNotPresent::setupFromSlice  ( const TComSlice* slice )
     396//{
     397//  sei.m_lnpSeiActiveVpsId =  TBD ;
     398//  for( Int i = 0; i  <=  MaxLayersMinus1; i++ )
     399//  {
     400//    sei.m_layerNotPresentFlag[i] =  TBD ;
     401//  }
     402//};
    400403#endif
    401404
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibCommon/SEI.h

    r1328 r1331  
    660660
    661661#if NH_MV_SEI
    662 #if NH_MV_SEI_TBD
     662#if NH_MV_LAYERS_NOT_PRESENT_SEI
    663663class SEILayersNotPresent : public SEI
    664664{
     
    670670
    671671  Void setupFromCfgFile( const Char*      cfgFile );
    672   Void setupFromSlice  ( const TComSlice* slice   );
     672  //Void setupFromSlice  ( const TComSlice* slice   );
    673673  Bool checkCfg        ( const TComSlice* slice   );
    674674
    675675  Int       m_lnpSeiActiveVpsId;
     676  UInt      m_lnpSeiMaxLayers;
    676677  BoolAry1d m_layerNotPresentFlag;
     678
     679  void resizeDimI( Int sizeDimI )
     680  {
     681    m_layerNotPresentFlag.resize( sizeDimI );
     682  }
    677683};
    678684#endif
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibCommon/TypeDef.h

    r1328 r1331  
    7070#define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!!
    7171#define NH_MV_FIX_NUM_POC_TOTAL_CUR               1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!!
     72#define NH_MV_LAYERS_NOT_PRESENT_SEI              1 // Layers not present SEI message JCTMV-M0043
    7273#endif
    7374#if NH_3D
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibDecoder/SEIread.cpp

    r1328 r1331  
    124124 * unmarshal a single SEI message from bitstream bs
    125125 */
     126#if NH_MV_LAYERS_NOT_PRESENT_SEI
     127Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     128#else
    126129Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     130#endif
    127131{
    128132  setBitstream(bs);
     
    131135  do
    132136  {
     137#if NH_MV_LAYERS_NOT_PRESENT_SEI
     138    xReadSEImessage(seis, nalUnitType, vps, sps, pDecodedMessageOutputStream);
     139#else
    133140    xReadSEImessage(seis, nalUnitType, sps, pDecodedMessageOutputStream);
    134 
     141#endif
    135142    /* SEI messages are an integer number of bytes, something has failed
    136143    * in the parsing if bitstream not byte-aligned */
     
    142149}
    143150
     151#if NH_MV_LAYERS_NOT_PRESENT_SEI
     152Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     153#else
    144154Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     155#endif
    145156{
    146157#if ENC_DEC_TRACE
     
    261272    case SEI::SCALABLE_NESTING:
    262273      sei = new SEIScalableNesting;
     274#if NH_MV_LAYERS_NOT_PRESENT_SEI
     275      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps, pDecodedMessageOutputStream);
     276#else
    263277      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps, pDecodedMessageOutputStream);
     278#endif
    264279      break;
    265280    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:
     
    290305      break;
    291306#else
    292 #if NH_MV_TBD
     307#if NH_MV_LAYERS_NOT_PRESENT_SEI
    293308    case SEI::LAYERS_NOT_PRESENT:
    294       sei = new SEILayersNotPresent;
    295       xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, pDecodedMessageOutputStream );
     309      if (!vps)
     310      {
     311        printf ("Warning: Found Layers not present SEI message, but no active VPS is available. Ignoring.");
     312      }
     313      else
     314      {
     315        sei = new SEILayersNotPresent;
     316        xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, vps, pDecodedMessageOutputStream);
     317      }
    296318      break;
    297319#endif
     
    885907}
    886908
     909#if NH_MV_LAYERS_NOT_PRESENT_SEI
     910Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     911#else
    887912Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     913#endif
    888914{
    889915  UInt uiCode;
     
    927953  do
    928954  {
     955#if NH_MV_LAYERS_NOT_PRESENT_SEI
     956    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, pDecodedMessageOutputStream);
     957#else
    929958    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, pDecodedMessageOutputStream);
     959#endif
    930960  } while (m_pcBitstream->getNumBitsLeft() > 8);
    931961
     
    11831213}
    11841214
    1185 #if NH_MV_SEI_TBD
    1186 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    1187 {
    1188   UInt code;
    1189   output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    1190 
     1215#if NH_MV_LAYERS_NOT_PRESENT_SEI
     1216Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
     1217{
     1218  UInt code;
     1219  UInt i = 0;
     1220
     1221  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    11911222  sei_read_code( pDecodedMessageOutputStream, 4, code, "lnp_sei_active_vps_id" ); sei.m_lnpSeiActiveVpsId = code;
    1192   for( Int i = 0; i  <=  MaxLayersMinus1; i++ )
    1193   {
    1194     sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" ); sei.m_layerNotPresentFlag[i] = (code == 1);
     1223  assert(vps->getVPSId() == sei.m_lnpSeiActiveVpsId);
     1224
     1225  sei.m_lnpSeiMaxLayers = vps->getMaxLayersMinus1() + 1;
     1226  sei.resizeDimI(sei.m_lnpSeiMaxLayers);
     1227  for (; i < sei.m_lnpSeiMaxLayers; i++)
     1228  {
     1229    sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" );
     1230    sei.m_layerNotPresentFlag[i] = (code == 1);
    11951231  }
    11961232};
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibDecoder/SEIread.h

    r1328 r1331  
    5656  SEIReader() {};
    5757  virtual ~SEIReader() {};
     58#if NH_MV_LAYERS_NOT_PRESENT_SEI
     59  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     60#else
    5861  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     62#endif
    5963#if NH_MV_SEI
    6064  Void setLayerId                            ( Int   layerId )   { m_layerId  = layerId; };
     
    6266#endif
    6367protected:
     68#if NH_MV_LAYERS_NOT_PRESENT_SEI
     69  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     70#else
    6471  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     72#endif
    6573  Void xParseSEIuserDataUnregistered          (SEIuserDataUnregistered &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    6674  Void xParseSEIActiveParameterSets           (SEIActiveParameterSets  &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     
    7886  Void xParseSEIToneMappingInfo               (SEIToneMappingInfo& sei,               UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    7987  Void xParseSEISOPDescription                (SEISOPDescription &sei,                UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     88#if NH_MV_LAYERS_NOT_PRESENT_SEI
     89  Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     90#else
    8091  Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     92#endif
    8193  Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    8294  Void xParseSEITimeCode                      (SEITimeCode& sei,                      UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     
    90102#endif
    91103#endif
    92 #if NH_MV_SEI_TBD
    93   Void xParseSEILayersNotPresent              (SEILayersNotPresent& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     104#if NH_MV_LAYERS_NOT_PRESENT_SEI
     105  Void xParseSEILayersNotPresent              (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps ,std::ostream *pDecodedMessageOutputStream);
    94106#endif
    95107  Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibDecoder/TDecTop.cpp

    r1328 r1331  
    836836    InputNALUnit &nalu=*m_prefixSEINALUs.front();
    837837#if NH_MV
     838#if NH_MV_LAYERS_NOT_PRESENT_SEI
     839    m_seiReader.parseSEImessage(&(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream);
     840#else
    838841    m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream );
     842#endif
    839843#else
    840844    m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream );
     
    13081312      {
    13091313#if NH_MV
    1310         m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream );
     1314#if NH_MV_LAYERS_NOT_PRESENT_SEI
     1315      m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream);
     1316#else
     1317      m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream );
     1318#endif
    13111319#else
    13121320        m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream );
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibEncoder/SEIwrite.cpp

    r1328 r1331  
    129129#endif
    130130#if NH_MV_SEI
    131 #if NH_MV_SEI_TBD
     131#if NH_MV_LAYERS_NOT_PRESENT_SEI
    132132   case SEI::LAYERS_NOT_PRESENT:
    133      xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
     133       xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
    134134     break;
    135135#endif
     
    881881}
    882882
    883 #if NH_MV_SEI_TBD
    884 Void SEIWriter::xWriteSEILayersNotPresent( const SEILayersNotPresent& sei)
     883#if NH_MV_LAYERS_NOT_PRESENT_SEI
     884Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
    885885{
    886886  WRITE_CODE( sei.m_lnpSeiActiveVpsId, 4, "lnp_sei_active_vps_id" );
    887   for( Int i = 0; i  <=  MaxLayersMinus1; i++ )
     887  for( Int i = 0; i  <  sei.m_lnpSeiMaxLayers; i++ )
    888888  {
    889889    WRITE_FLAG( ( sei.m_layerNotPresentFlag[i] ? 1 : 0 ), "layer_not_present_flag" );
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibEncoder/SEIwrite.h

    r1328 r1331  
    8484
    8585#if NH_MV_SEI
    86 #if NH_MV_SEI_TBD
     86#if NH_MV_LAYERS_NOT_PRESENT_SEI
    8787  Void xWriteSEILayersNotPresent              ( const SEILayersNotPresent& sei);
    8888#endif
  • branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibEncoder/TEncGOP.cpp

    r1328 r1331  
    329329  xClearSEIs(currentMessages, !testWrite);
    330330
     331#if NH_MV_LAYERS_NOT_PRESENT_SEI
     332  // Layers not present SEI message
     333  currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT);
     334  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
     335  xClearSEIs(currentMessages, !testWrite);
     336#endif
     337
    331338  // And finally everything else one by one
    332339  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, localMessages, accessUnit, itNalu, temporalId, sps);
Note: See TracChangeset for help on using the changeset viewer.