Commit 7e2b096e authored by Karsten Suehring's avatar Karsten Suehring

Move dumping of 360 related SEIs into own class

parent 6a7d84cf
......@@ -634,11 +634,7 @@ uint32_t BitstreamExtractorApp::decode()
// decoding a SEI
SEIMessages SEIs;
HRD hrd;
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiReader.parseSEImessage(&(nalu.getBitstream()), SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, m_parameterSetManager.getActiveSPS(), hrd, &std::cout, std::string(""));
#else
m_seiReader.parseSEImessage(&(nalu.getBitstream()), SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, m_parameterSetManager.getActiveSPS(), hrd, &std::cout);
#endif
for (auto sei : SEIs)
{
// remove unqualiified scalable nesting SEI
......
......@@ -373,7 +373,9 @@ void DecApp::xCreateDecLib()
}
#if JVET_S0257_DUMP_360SEI_MESSAGE
if (!m_outputDecoded360SEIMessagesFilename.empty())
{
m_cDecLib.setDecoded360SEIMessageFileName(m_outputDecoded360SEIMessagesFilename);
}
#endif
m_cDecLib.m_targetSubPicIdx = this->m_targetSubPicIdx;
m_cDecLib.initScalingList();
......
......@@ -50,9 +50,6 @@
#include <assert.h>
#include <cassert>
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
//########### place macros to be removed in next cycle below this line ###############
#define JVET_S0074_SPS_REORDER 1 // JVET-S0074: aspect 1, rearrange some syntax elements in SPS
......@@ -62,6 +59,8 @@
//########### place macros to be be kept below this line ###############
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
#define JVET_R0351_HIGH_BIT_DEPTH_SUPPORT 1 // JVET-R0351: high bit depth coding support (syntax changes, no mathematical differences for CTCs)
#define JVET_R0351_HIGH_BIT_DEPTH_ENABLED 0 // JVET-R0351: high bit depth coding enabled (increases accuracies of some calculations, e.g. transforms)
......
......@@ -1782,10 +1782,9 @@ void DecLib::xParsePrefixSEImessages()
m_accessUnitSeiTids.push_back(nalu.m_temporalId);
const SPS *sps = m_parameterSetManager.getActiveSPS();
const VPS *vps = m_parameterSetManager.getVPS(sps->getVPSId());
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream, m_decoded360SeiDumpFileName );
#else
m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream );
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiCfgDump.write360SeiDump( m_decoded360SeiDumpFileName, m_SEIs, sps );
#endif
m_accessUnitSeiPayLoadTypes.push_back(std::tuple<NalUnitType, int, SEI::PayloadType>(nalu.m_nalUnitType, nalu.m_nuhLayerId, m_SEIs.back()->payloadType()));
delete m_prefixSEINALUs.front();
......@@ -2699,10 +2698,9 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay, i
m_accessUnitSeiTids.push_back(nalu.m_temporalId);
const SPS *sps = m_parameterSetManager.getActiveSPS();
const VPS *vps = m_parameterSetManager.getVPS(sps->getVPSId());
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream, m_decoded360SeiDumpFileName );
#else
m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, sps, m_HRD, m_pDecodedSEIOutputStream );
#if JVET_S0257_DUMP_360SEI_MESSAGE
m_seiCfgDump.write360SeiDump(m_decoded360SeiDumpFileName, m_pcPic->SEIs, sps);
#endif
m_accessUnitSeiPayLoadTypes.push_back(std::tuple<NalUnitType, int, SEI::PayloadType>(nalu.m_nalUnitType, nalu.m_nuhLayerId, m_pcPic->SEIs.back()->payloadType()));
}
......
......@@ -105,6 +105,9 @@ private:
HLSyntaxReader m_HLSReader;
CABACDecoder m_CABACDecoder;
SEIReader m_seiReader;
#if JVET_S0257_DUMP_360SEI_MESSAGE
SeiCfgFileDump m_seiCfgDump;
#endif
LoopFilter m_cLoopFilter;
SampleAdaptiveOffset m_cSAO;
AdaptiveLoopFilter m_cALF;
......
This diff is collapsed.
......@@ -53,37 +53,18 @@ class InputBitstream;
class SEIReader: public VLCReader
{
public:
#if JVET_S0257_DUMP_360SEI_MESSAGE
SEIReader() : m_360SEIMessageDumped(false) {};
#else
SEIReader() {};
#endif
virtual ~SEIReader() {};
#if JVET_S0257_DUMP_360SEI_MESSAGE
void parseSEImessage(InputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const uint32_t nuh_layer_id, const uint32_t temporalId,const VPS *vps, const SPS *sps, HRD &hrd, std::ostream *pDecodedMessageOutputStream, std::string decoded360MessageFileName);
#else
void parseSEImessage(InputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const uint32_t nuh_layer_id, const uint32_t temporalId,const VPS *vps, const SPS *sps, HRD &hrd, std::ostream *pDecodedMessageOutputStream);
#endif
protected:
#if JVET_S0257_DUMP_360SEI_MESSAGE
bool m_360SEIMessageDumped;
#endif
#if JVET_S0257_DUMP_360SEI_MESSAGE
void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const uint32_t nuh_layer_id, const uint32_t temporalId, const VPS *vps, const SPS *sps, HRD &hrd, std::ostream *pDecodedMessageOutputStream, std::string decoded360MessageFileName);
#else
void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const uint32_t nuh_layer_id, const uint32_t temporalId, const VPS *vps, const SPS *sps, HRD &hrd, std::ostream *pDecodedMessageOutputStream);
#endif
void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, uint32_t payloadSize, const SEIBufferingPeriod& bp, const uint32_t temporalId, std::ostream *pDecodedMessageOutputStream);
void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIPictureTiming (SEIPictureTiming& sei, uint32_t payloadSize, const uint32_t temporalId, const SEIBufferingPeriod& bp, std::ostream *pDecodedMessageOutputStream);
#if JVET_S0257_DUMP_360SEI_MESSAGE
void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, const uint32_t nuhLayerId, uint32_t payloadSize, const VPS *vps, const SPS *sps, std::ostream *decodedMessageOutputStream, std::string decoded360MessageFileName);
#else
void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, const uint32_t nuhLayerId, uint32_t payloadSize, const VPS *vps, const SPS *sps, std::ostream *decodedMessageOutputStream);
#endif
void xParseSEIFrameFieldinfo (SEIFrameFieldInfo& sei, const SEIPictureTiming& pt, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIDependentRAPIndication (SEIDependentRAPIndication& sei, uint32_t payLoadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIFramePacking (SEIFramePacking& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
......@@ -92,19 +73,11 @@ protected:
#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, uint32_t payLoadSize, std::ostream *pDecodedMessageOutputStream);
#endif
#if JVET_S0257_DUMP_360SEI_MESSAGE
void xParseSEIEquirectangularProjection (SEIEquirectangularProjection &sei, const SPS *sps, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream, std::string decoded360MessageFileName);
#else
void xParseSEIEquirectangularProjection (SEIEquirectangularProjection &sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
void xParseSEISphereRotation (SEISphereRotation &sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIOmniViewport (SEIOmniViewport& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIRegionWisePacking (SEIRegionWisePacking& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
#if JVET_S0257_DUMP_360SEI_MESSAGE
void xParseSEIGeneralizedCubemapProjection (SEIGeneralizedCubemapProjection &sei, const SPS *sps, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream, std::string decoded360MessageFileName);
#else
void xParseSEIGeneralizedCubemapProjection (SEIGeneralizedCubemapProjection &sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
void xParseSEISubpictureLevelInfo (SEISubpicureLevelInfo& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEISampleAspectRatioInfo (SEISampleAspectRatioInfo& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIUserDataRegistered (SEIUserDataRegistered& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
......@@ -123,6 +96,27 @@ protected:
HRD m_nestedHrd;
};
#if JVET_S0257_DUMP_360SEI_MESSAGE
class SeiCfgFileDump
{
public:
SeiCfgFileDump()
: m_360SEIMessageDumped(false)
{};
virtual ~SeiCfgFileDump() {};
void write360SeiDump (std::string decoded360MessageFileName, SEIMessages& seis, const SPS* sps);
protected:
void xDumpSEIEquirectangularProjection (SEIEquirectangularProjection &sei, const SPS* sps, std::string decoded360MessageFileName);
void xDumpSEIGeneralizedCubemapProjection (SEIGeneralizedCubemapProjection &sei, const SPS* sps, std::string decoded360MessageFileName);
bool m_360SEIMessageDumped;
};
#endif
//! \}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment