- Timestamp:
- 18 Jun 2013, 23:11:33 (12 years ago)
- Location:
- branches/SHM-2.1-dev/source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r290 r292 821 821 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") 822 822 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") 823 #if M0043_LAYERS_PRESENT_SEI 824 ("SEILayersPresent", m_layersPresentSEIEnabled, 0, "Control generation of layers present SEI message") 825 #endif 823 826 #if L0208_SOP_DESCRIPTION_SEI 824 827 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h
r288 r292 274 274 Int m_gradualDecodingRefreshInfoEnabled; 275 275 Int m_decodingUnitInfoSEIEnabled; 276 #if M0043_LAYERS_PRESENT_SEI 277 Int m_layersPresentSEIEnabled; 278 #endif 276 279 #if L0208_SOP_DESCRIPTION_SEI 277 280 Int m_SOPDescriptionSEIEnabled; -
branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r290 r292 388 388 m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); 389 389 m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); 390 #if M0043_LAYERS_PRESENT_SEI 391 m_acTEncTop[layer].setLayersPresentSEIEnabled( m_layersPresentSEIEnabled ); 392 #endif 390 393 #if L0208_SOP_DESCRIPTION_SEI 391 394 m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); … … 725 728 m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); 726 729 m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); 730 #if M0043_LAYERS_PRESENT_SEI 731 m_cTEncTop.setLayersPresentSEIEnabled( m_layersPresentSEIEnabled ); 732 #endif 727 733 #if L0208_SOP_DESCRIPTION_SEI 728 734 m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); -
branches/SHM-2.1-dev/source/Lib/TLibCommon/SEI.h
r191 r292 72 72 SCALABLE_NESTING = 133, 73 73 REGION_REFRESH_INFO = 134, 74 #if M0043_LAYERS_PRESENT_SEI 75 LAYERS_PRESENT = 137, 76 #endif 74 77 }; 75 78 … … 354 357 Bool m_gdrForegroundFlag; 355 358 }; 359 360 #if M0043_LAYERS_PRESENT_SEI 361 class SEILayersPresent : public SEI 362 { 363 public: 364 PayloadType payloadType() const { return LAYERS_PRESENT; } 365 366 SEILayersPresent() {} 367 virtual ~SEILayersPresent() {} 368 369 UInt m_activeVpsId; 370 UInt m_vpsMaxLayers; 371 Bool m_layerPresentFlag[MAX_LAYERS]; 372 }; 373 #endif 356 374 357 375 #if L0208_SOP_DESCRIPTION_SEI -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h
r291 r292 135 135 #define FIX1071 1 ///< Temporary fix for issue #1071 136 136 137 138 #define M0043_LAYERS_PRESENT_SEI 0 ///< M0043: add layers present SEI 137 139 #define L0208_SOP_DESCRIPTION_SEI 1 ///< L0208: add SOP descrioption SEI 138 140 #define MAX_NUM_PICS_IN_SOP 1024 -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/SEIread.cpp
r191 r292 95 95 break; 96 96 #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 97 102 #if L0208_SOP_DESCRIPTION_SEI 98 103 case SEI::SOP_DESCRIPTION: … … 115 120 * unmarshal a single SEI message from bitstream bs 116 121 */ 122 #if M0043_LAYERS_PRESENT_SEI 123 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 124 #else 117 125 void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps) 126 #endif 118 127 { 119 128 setBitstream(bs); … … 122 131 do 123 132 { 133 #if M0043_LAYERS_PRESENT_SEI 134 xReadSEImessage(seis, nalUnitType, vps, sps); 135 #else 124 136 xReadSEImessage(seis, nalUnitType, sps); 137 #endif 125 138 /* SEI messages are an integer number of bytes, something has failed 126 139 * in the parsing if bitstream not byte-aligned */ … … 133 146 } 134 147 148 #if M0043_LAYERS_PRESENT_SEI 149 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 150 #else 135 151 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps) 152 #endif 136 153 { 137 154 #if ENC_DEC_TRACE … … 240 257 break; 241 258 #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 242 272 #if L0208_SOP_DESCRIPTION_SEI 243 273 case SEI::SOP_DESCRIPTION: … … 249 279 case SEI::SCALABLE_NESTING: 250 280 sei = new SEIScalableNesting; 281 #if M0043_LAYERS_PRESENT_SEI 282 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps); 283 #else 251 284 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps); 285 #endif 252 286 break; 253 287 #endif … … 751 785 #endif 752 786 787 #if M0043_LAYERS_PRESENT_SEI 788 Void 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 753 808 #if L0208_SOP_DESCRIPTION_SEI 754 809 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize) … … 777 832 #endif 778 833 834 779 835 #if K0180_SCALABLE_NESTING_SEI 836 #if M0043_LAYERS_PRESENT_SEI 837 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) 838 #else 780 839 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps) 840 #endif 781 841 { 782 842 UInt uiCode; … … 820 880 // read nested SEI messages 821 881 do { 882 #if M0043_LAYERS_PRESENT_SEI 883 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 884 #else 822 885 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 886 #endif 823 887 } while (m_pcBitstream->getNumBitsLeft() > 8); 824 888 -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/SEIread.h
r191 r292 56 56 SEIReader() {}; 57 57 virtual ~SEIReader() {}; 58 #if M0043_LAYERS_PRESENT_SEI 59 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps); 60 #else 58 61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps); 62 #endif 59 63 protected: 64 #if M0043_LAYERS_PRESENT_SEI 65 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps); 66 #else 60 67 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps); 68 #endif 61 69 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize); 62 70 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize); … … 73 81 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 74 82 #endif 83 #if M0043_LAYERS_PRESENT_SEI 84 Void xParseSEILayersPresent (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps); 85 #endif 75 86 #if L0208_SOP_DESCRIPTION_SEI 76 87 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 77 88 #endif 78 89 #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 79 93 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps); 94 #endif 80 95 #endif 81 96 Void xParseByteAlign(); -
branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r291 r292 1098 1098 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1099 1099 { 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 1100 1103 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() ); 1104 #endif 1101 1105 } 1102 1106 else 1103 1107 { 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 1104 1111 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder[m_layerId].getActiveSPS() ); 1112 #endif 1105 1113 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); 1106 1114 if (activeParamSets.size()>0) … … 1118 1126 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1119 1127 { 1128 #if M0043_LAYERS_PRESENT_SEI 1129 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); 1130 #else 1120 1131 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1132 #endif 1121 1133 } 1122 1134 else 1123 1135 { 1136 #if M0043_LAYERS_PRESENT_SEI 1137 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); 1138 #else 1124 1139 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1140 #endif 1125 1141 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); 1126 1142 if (activeParamSets.size()>0) -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r191 r292 89 89 break; 90 90 #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 91 96 #if L0208_SOP_DESCRIPTION_SEI 92 97 case SEI::SOP_DESCRIPTION: … … 150 155 case SEI::TONE_MAPPING_INFO: 151 156 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)); 152 162 break; 153 163 #endif … … 591 601 } 592 602 603 #if M0043_LAYERS_PRESENT_SEI 604 Void 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 593 615 #if L0208_SOP_DESCRIPTION_SEI 594 616 Void SEIWriter::xWriteSEISOPDescription(const SEISOPDescription& sei) -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/SEIwrite.h
r191 r292 70 70 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 71 71 #endif 72 #if M0043_LAYERS_PRESENT_SEI 73 Void xWriteSEILayersPresent(const SEILayersPresent& sei); 74 #endif 72 75 #if L0208_SOP_DESCRIPTION_SEI 73 76 Void xWriteSEISOPDescription(const SEISOPDescription& sei); -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCfg.h
r290 r292 289 289 Int m_gradualDecodingRefreshInfoEnabled; 290 290 Int m_decodingUnitInfoSEIEnabled; 291 #if M0043_LAYERS_PRESENT_SEI 292 Int m_layersPresentSEIEnabled; 293 #endif 291 294 #if L0208_SOP_DESCRIPTION_SEI 292 295 Int m_SOPDescriptionSEIEnabled; … … 733 736 Void setDecodingUnitInfoSEIEnabled(Int b) { m_decodingUnitInfoSEIEnabled = b; } 734 737 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 735 742 #if L0208_SOP_DESCRIPTION_SEI 736 743 Void setSOPDescriptionSEIEnabled(Int b) { m_SOPDescriptionSEIEnabled = b; } -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r291 r292 173 173 } 174 174 175 #if M0043_LAYERS_PRESENT_SEI 176 SEILayersPresent* 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 175 194 SEIFramePacking* TEncGOP::xCreateSEIFramePacking() 176 195 { … … 319 338 #endif 320 339 } 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 321 352 322 353 if(m_pcCfg->getFramePackingArrangementSEIEnabled()) -
branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.h
r291 r292 180 180 181 181 SEIActiveParameterSets* xCreateSEIActiveParameterSets (TComSPS *sps); 182 #if M0043_LAYERS_PRESENT_SEI 183 SEILayersPresent* xCreateSEILayersPresent (); 184 #endif 182 185 SEIFramePacking* xCreateSEIFramePacking(); 183 186 SEIDisplayOrientation* xCreateSEIDisplayOrientation();
Note: See TracChangeset for help on using the changeset viewer.