- Timestamp:
- 18 Sep 2015, 23:09:19 (9 years ago)
- 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 224 224 #endif 225 225 #if NH_MV_SEI 226 #if NH_MV_ SEI_TBD226 #if NH_MV_LAYERS_NOT_PRESENT_SEI 227 227 case SEI::LAYERS_NOT_PRESENT : return new SEILayersNotPresent; 228 228 #endif … … 342 342 343 343 344 #if NH_MV_ SEI_TBD344 #if NH_MV_LAYERS_NOT_PRESENT_SEI 345 345 Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile) 346 346 { … … 349 349 350 350 // 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 ); 355 356 356 357 Int defSeiNaluId = 0; 357 358 Int defPositionInSeiNalu = 0; 358 Bool defModifyByEncoder = TBD;359 Bool defModifyByEncoder = false; //0: Use payload as specified in cfg file 1: Modify SEI by encoder 359 360 360 361 // Setup config file options … … 363 364 364 365 opts.addOptions() 365 ("LnpSeiActiveVpsId" , m_lnpSeiActiveVpsId , 0 , "LnpSeiActiveVpsId" ) 366 ("LnpSeiActiveVpsId" , m_lnpSeiActiveVpsId , 0 , "LnpSeiActiveVpsId" ) //Why? 366 367 ("LayerNotPresentFlag" , m_layerNotPresentFlag , BoolAry1d(1,0) , "LayerNotPresentFlag" ) 367 368 ; … … 372 373 po::ErrorReporter err; 373 374 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 //}; 400 403 #endif 401 404 -
branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibCommon/SEI.h
r1328 r1331 660 660 661 661 #if NH_MV_SEI 662 #if NH_MV_ SEI_TBD662 #if NH_MV_LAYERS_NOT_PRESENT_SEI 663 663 class SEILayersNotPresent : public SEI 664 664 { … … 670 670 671 671 Void setupFromCfgFile( const Char* cfgFile ); 672 Void setupFromSlice ( const TComSlice* slice );672 //Void setupFromSlice ( const TComSlice* slice ); 673 673 Bool checkCfg ( const TComSlice* slice ); 674 674 675 675 Int m_lnpSeiActiveVpsId; 676 UInt m_lnpSeiMaxLayers; 676 677 BoolAry1d m_layerNotPresentFlag; 678 679 void resizeDimI( Int sizeDimI ) 680 { 681 m_layerNotPresentFlag.resize( sizeDimI ); 682 } 677 683 }; 678 684 #endif -
branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibCommon/TypeDef.h
r1328 r1331 70 70 #define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!! 71 71 #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 72 73 #endif 73 74 #if NH_3D -
branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibDecoder/SEIread.cpp
r1328 r1331 124 124 * unmarshal a single SEI message from bitstream bs 125 125 */ 126 #if NH_MV_LAYERS_NOT_PRESENT_SEI 127 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 128 #else 126 129 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 130 #endif 127 131 { 128 132 setBitstream(bs); … … 131 135 do 132 136 { 137 #if NH_MV_LAYERS_NOT_PRESENT_SEI 138 xReadSEImessage(seis, nalUnitType, vps, sps, pDecodedMessageOutputStream); 139 #else 133 140 xReadSEImessage(seis, nalUnitType, sps, pDecodedMessageOutputStream); 134 141 #endif 135 142 /* SEI messages are an integer number of bytes, something has failed 136 143 * in the parsing if bitstream not byte-aligned */ … … 142 149 } 143 150 151 #if NH_MV_LAYERS_NOT_PRESENT_SEI 152 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 153 #else 144 154 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 155 #endif 145 156 { 146 157 #if ENC_DEC_TRACE … … 261 272 case SEI::SCALABLE_NESTING: 262 273 sei = new SEIScalableNesting; 274 #if NH_MV_LAYERS_NOT_PRESENT_SEI 275 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps, pDecodedMessageOutputStream); 276 #else 263 277 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps, pDecodedMessageOutputStream); 278 #endif 264 279 break; 265 280 case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS: … … 290 305 break; 291 306 #else 292 #if NH_MV_ TBD307 #if NH_MV_LAYERS_NOT_PRESENT_SEI 293 308 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 } 296 318 break; 297 319 #endif … … 885 907 } 886 908 909 #if NH_MV_LAYERS_NOT_PRESENT_SEI 910 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 911 #else 887 912 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 913 #endif 888 914 { 889 915 UInt uiCode; … … 927 953 do 928 954 { 955 #if NH_MV_LAYERS_NOT_PRESENT_SEI 956 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, pDecodedMessageOutputStream); 957 #else 929 958 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, pDecodedMessageOutputStream); 959 #endif 930 960 } while (m_pcBitstream->getNumBitsLeft() > 8); 931 961 … … 1183 1213 } 1184 1214 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 1216 Void 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); 1191 1222 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); 1195 1231 } 1196 1232 }; -
branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibDecoder/SEIread.h
r1328 r1331 56 56 SEIReader() {}; 57 57 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 58 61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 62 #endif 59 63 #if NH_MV_SEI 60 64 Void setLayerId ( Int layerId ) { m_layerId = layerId; }; … … 62 66 #endif 63 67 protected: 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 64 71 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 72 #endif 65 73 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 66 74 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); … … 78 86 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 79 87 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 80 91 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 92 #endif 81 93 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 82 94 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); … … 90 102 #endif 91 103 #endif 92 #if NH_MV_ SEI_TBD93 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); 94 106 #endif 95 107 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); -
branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibDecoder/TDecTop.cpp
r1328 r1331 836 836 InputNALUnit &nalu=*m_prefixSEINALUs.front(); 837 837 #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 838 841 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 842 #endif 839 843 #else 840 844 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); … … 1308 1312 { 1309 1313 #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 1311 1319 #else 1312 1320 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 129 129 #endif 130 130 #if NH_MV_SEI 131 #if NH_MV_ SEI_TBD131 #if NH_MV_LAYERS_NOT_PRESENT_SEI 132 132 case SEI::LAYERS_NOT_PRESENT: 133 xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));133 xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei)); 134 134 break; 135 135 #endif … … 881 881 } 882 882 883 #if NH_MV_ SEI_TBD884 Void SEIWriter::xWriteSEILayersNotPresent( 883 #if NH_MV_LAYERS_NOT_PRESENT_SEI 884 Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei) 885 885 { 886 886 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++ ) 888 888 { 889 889 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 84 84 85 85 #if NH_MV_SEI 86 #if NH_MV_ SEI_TBD86 #if NH_MV_LAYERS_NOT_PRESENT_SEI 87 87 Void xWriteSEILayersNotPresent ( const SEILayersNotPresent& sei); 88 88 #endif -
branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibEncoder/TEncGOP.cpp
r1328 r1331 329 329 xClearSEIs(currentMessages, !testWrite); 330 330 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 331 338 // And finally everything else one by one 332 339 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, localMessages, accessUnit, itNalu, temporalId, sps);
Note: See TracChangeset for help on using the changeset viewer.