diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 25c8132b38c36d85b4f818ce12670403b399a5a2..e0feb2869b3f4f557cdc7c88bebedf229837baca 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -429,7 +429,7 @@ void EncGOP::xWriteAccessUnitDelimiter (AccessUnit &accessUnit, Slice *slice) } // write SEI list into one NAL unit and add it to the Access unit at auPos -void EncGOP::xWriteSEI (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId, const SPS *sps) +void EncGOP::xWriteSEI (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId) { // don't do anything, if we get an empty list if (seiMessages.empty()) @@ -437,12 +437,12 @@ void EncGOP::xWriteSEI (NalUnitType naluType, SEIMessages& seiMessages, AccessUn return; } OutputNALUnit nalu( naluType, m_pcEncLib->getLayerId(), temporalId ); - m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, sps, *m_HRD, false, temporalId); + m_seiWriter.writeSEImessages(nalu.m_Bitstream, seiMessages, *m_HRD, false, temporalId); auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu)); auPos++; } -void EncGOP::xWriteSEISeparately (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId, const SPS *sps) +void EncGOP::xWriteSEISeparately (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId) { // don't do anything, if we get an empty list if (seiMessages.empty()) @@ -454,7 +454,7 @@ void EncGOP::xWriteSEISeparately (NalUnitType naluType, SEIMessages& seiMessages SEIMessages tmpMessages; tmpMessages.push_back(*sei); OutputNALUnit nalu( naluType, m_pcEncLib->getLayerId(), temporalId ); - m_seiWriter.writeSEImessages(nalu.m_Bitstream, tmpMessages, sps, *m_HRD, false, temporalId); + m_seiWriter.writeSEImessages(nalu.m_Bitstream, tmpMessages, *m_HRD, false, temporalId); auPos = accessUnit.insert(auPos, new NALUnitEBSP(nalu)); auPos++; } @@ -473,7 +473,7 @@ void EncGOP::xClearSEIs(SEIMessages& seiMessages, bool deleteMessages) } // write SEI messages as separate NAL units ordered -void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, bool testWrite) +void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, bool testWrite) { AccessUnit::iterator itNalu = accessUnit.begin(); @@ -500,13 +500,13 @@ void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duI // Buffering period SEI must always be following active parameter sets currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD); CHECK(!(currentMessages.size() <= 1), "Unspecified error"); - xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); + xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId); xClearSEIs(currentMessages, !testWrite); // Picture timing SEI must always be following buffering period currentMessages = extractSeisByType(localMessages, SEI::PICTURE_TIMING); CHECK(!(currentMessages.size() <= 1), "Unspecified error"); - xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); + xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId); xClearSEIs(currentMessages, !testWrite); // Decoding unit info SEI must always be following picture timing @@ -517,7 +517,7 @@ void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duI { duInfoSeiMessages.pop_front(); } - xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); + xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId); xClearSEIs(currentMessages, !testWrite); } @@ -525,13 +525,13 @@ void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duI { // Scalable nesting SEI must always be the following DU info currentMessages = extractSeisByType(localMessages, SEI::SCALABLE_NESTING); - xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); + xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId); xClearSEIs(currentMessages, !testWrite); } // And finally everything else one by one - xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, localMessages, accessUnit, itNalu, temporalId, sps); + xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, localMessages, accessUnit, itNalu, temporalId); xClearSEIs(localMessages, !testWrite); if (!testWrite) @@ -549,26 +549,26 @@ void EncGOP::xWriteLeadingSEIMessages (SEIMessages& seiMessages, SEIMessages& du SEIPictureTiming * picTiming = picTimingSEIs.empty() ? NULL : (SEIPictureTiming*) picTimingSEIs.front(); // test writing - xWriteLeadingSEIOrdered(seiMessages, duInfoSeiMessages, testAU, temporalId, sps, true); + xWriteLeadingSEIOrdered(seiMessages, duInfoSeiMessages, testAU, temporalId, true); // update Timing and DU info SEI xUpdateDuData(testAU, duData); xUpdateTimingSEI(picTiming, duData, sps); xUpdateDuInfoSEI(duInfoSeiMessages, picTiming, sps->getMaxTLayers()); // actual writing - xWriteLeadingSEIOrdered(seiMessages, duInfoSeiMessages, accessUnit, temporalId, sps, false); + xWriteLeadingSEIOrdered(seiMessages, duInfoSeiMessages, accessUnit, temporalId, false); // testAU will automatically be cleaned up when losing scope } -void EncGOP::xWriteTrailingSEIMessages (SEIMessages& seiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps) +void EncGOP::xWriteTrailingSEIMessages (SEIMessages& seiMessages, AccessUnit &accessUnit, int temporalId) { // Note: using accessUnit.end() works only as long as this function is called after slice coding and before EOS/EOB NAL units AccessUnit::iterator pos = accessUnit.end(); - xWriteSEISeparately(NAL_UNIT_SUFFIX_SEI, seiMessages, accessUnit, pos, temporalId, sps); + xWriteSEISeparately(NAL_UNIT_SUFFIX_SEI, seiMessages, accessUnit, pos, temporalId); deleteSEIs(seiMessages); } -void EncGOP::xWriteDuSEIMessages (SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, std::deque<DUData> &duData) +void EncGOP::xWriteDuSEIMessages (SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, std::deque<DUData> &duData) { if( m_pcCfg->getDecodingUnitInfoSEIEnabled() && m_HRD->getBufferingPeriodSEI()->m_decodingUnitCpbParamsInPicTimingSeiFlag ) { @@ -595,7 +595,7 @@ void EncGOP::xWriteDuSEIMessages (SEIMessages& duInfoSeiMessages, AccessUnit &ac // write the next SEI SEIMessages tmpSEI; tmpSEI.push_back(*duSEI); - xWriteSEI(NAL_UNIT_PREFIX_SEI, tmpSEI, accessUnit, nalu, temporalId, sps); + xWriteSEI(NAL_UNIT_PREFIX_SEI, tmpSEI, accessUnit, nalu, temporalId); // nalu points to the position after the SEI, so we have to increase the index as well naluIdx++; while ((naluIdx < duData[duIdx].accumNalsDU) && nalu!=accessUnit.end()) @@ -3512,7 +3512,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, xCalculateAddPSNRs(isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, encTime, snr_conversion, printFrameMSE, &PSNR_Y, isEncodeLtRef ); - xWriteTrailingSEIMessages(trailingSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS()); + xWriteTrailingSEIMessages(trailingSeiMessages, accessUnit, pcSlice->getTLayer()); printHash(m_pcCfg->getDecodedPictureHashSEIType(), digestStr); @@ -3581,7 +3581,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, } xWriteLeadingSEIMessages( leadingSeiMessages, duInfoSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS(), duData ); - xWriteDuSEIMessages( duInfoSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS(), duData ); + xWriteDuSEIMessages( duInfoSeiMessages, accessUnit, pcSlice->getTLayer(), duData ); m_AUWriterIf->outputAU( accessUnit ); diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h index 6203ebe6d35341ad5033ff498eac8a1cefdbe930..b21293029d19598bc64c8893f0a3b49a105c44b6 100644 --- a/source/Lib/EncoderLib/EncGOP.h +++ b/source/Lib/EncoderLib/EncGOP.h @@ -308,13 +308,13 @@ protected: void xUpdateTimingSEI(SEIPictureTiming *pictureTimingSEI, std::deque<DUData> &duData, const SPS *sps); void xUpdateDuInfoSEI(SEIMessages &duInfoSeiMessages, SEIPictureTiming *pictureTimingSEI, int maxSubLayers); void xCreateScalableNestingSEI(SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, const std::vector<uint16_t>& subpicIDs); - void xWriteSEI (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId, const SPS *sps); - void xWriteSEISeparately (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId, const SPS *sps); + void xWriteSEI (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId); + void xWriteSEISeparately (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId); void xClearSEIs(SEIMessages& seiMessages, bool deleteMessages); - void xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, bool testWrite); + void xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, bool testWrite); void xWriteLeadingSEIMessages (SEIMessages& seiMessages, SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, std::deque<DUData> &duData); - void xWriteTrailingSEIMessages (SEIMessages& seiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps); - void xWriteDuSEIMessages (SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, std::deque<DUData> &duData); + void xWriteTrailingSEIMessages (SEIMessages& seiMessages, AccessUnit &accessUnit, int temporalId); + void xWriteDuSEIMessages (SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, std::deque<DUData> &duData); int xWriteVPS (AccessUnit &accessUnit, const VPS *vps); int xWriteDCI (AccessUnit &accessUnit, const DCI *dci); diff --git a/source/Lib/EncoderLib/SEIwrite.cpp b/source/Lib/EncoderLib/SEIwrite.cpp index f121b4581370be05d05452e11ef7dc9dbc1cbd71..4f46c85d24fd038f3d00113a6be8250dfac76c24 100644 --- a/source/Lib/EncoderLib/SEIwrite.cpp +++ b/source/Lib/EncoderLib/SEIwrite.cpp @@ -41,7 +41,7 @@ //! \ingroup EncoderLib //! \{ -void SEIWriter::xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, const SPS *sps, HRD &hrd, const uint32_t temporalId) +void SEIWriter::xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, HRD &hrd, const uint32_t temporalId) { const SEIBufferingPeriod *bp = NULL; switch (sei.payloadType()) @@ -55,7 +55,7 @@ void SEIWriter::xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, const xWriteSEIDecodingUnitInfo(*static_cast<const SEIDecodingUnitInfo*>(& sei), *bp, temporalId); break; case SEI::SCALABLE_NESTING: - xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps); + xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei)); break; case SEI::DECODED_PICTURE_HASH: xWriteSEIDecodedPictureHash(*static_cast<const SEIDecodedPictureHash*>(&sei)); @@ -137,7 +137,7 @@ void SEIWriter::xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, const /** * marshal all SEI messages in provided list into one bitstream bs */ -void SEIWriter::writeSEImessages(OutputBitstream& bs, const SEIMessages &seiList, const SPS *sps, HRD &hrd, bool isNested, const uint32_t temporalId) +void SEIWriter::writeSEImessages(OutputBitstream& bs, const SEIMessages &seiList, HRD &hrd, bool isNested, const uint32_t temporalId) { #if ENABLE_TRACING if (g_HLSTraceEnable) @@ -157,7 +157,7 @@ void SEIWriter::writeSEImessages(OutputBitstream& bs, const SEIMessages &seiList bool traceEnable = g_HLSTraceEnable; g_HLSTraceEnable = false; #endif - xWriteSEIpayloadData(bs_count, **sei, sps, hrd, temporalId); + xWriteSEIpayloadData(bs_count, **sei, hrd, temporalId); #if ENABLE_TRACING g_HLSTraceEnable = traceEnable; #endif @@ -185,7 +185,7 @@ void SEIWriter::writeSEImessages(OutputBitstream& bs, const SEIMessages &seiList xTraceSEIMessageType((*sei)->payloadType()); #endif - xWriteSEIpayloadData(bs, **sei, sps, hrd, temporalId); + xWriteSEIpayloadData(bs, **sei, hrd, temporalId); } if (!isNested) { @@ -495,7 +495,7 @@ void SEIWriter::xWriteSEIDependentRAPIndication(const SEIDependentRAPIndication& // intentionally empty } -void SEIWriter::xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableNesting& sei, const SPS *sps) +void SEIWriter::xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableNesting& sei) { CHECK (sei.m_nestedSEIs.size()<1, "There must be at lease one SEI message nested in the scalable nesting SEI.") @@ -548,7 +548,7 @@ void SEIWriter::xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableN } // write nested SEI messages - writeSEImessages(bs, sei.m_nestedSEIs, sps, m_nestingHrd, true, 0); + writeSEImessages(bs, sei.m_nestedSEIs, m_nestingHrd, true, 0); } void SEIWriter::xWriteSEIFramePacking(const SEIFramePacking& sei) diff --git a/source/Lib/EncoderLib/SEIwrite.h b/source/Lib/EncoderLib/SEIwrite.h index 71f6de5203772898655df71c7c70d5129a45e382..912e0ee872704cef589b1ac6b1b93ddd7f65001b 100644 --- a/source/Lib/EncoderLib/SEIwrite.h +++ b/source/Lib/EncoderLib/SEIwrite.h @@ -49,7 +49,7 @@ public: SEIWriter() {}; virtual ~SEIWriter() {}; - void writeSEImessages(OutputBitstream& bs, const SEIMessages &seiList, const SPS *sps, HRD &hrd, bool isNested, const uint32_t temporalId); + void writeSEImessages(OutputBitstream& bs, const SEIMessages &seiList, HRD &hrd, bool isNested, const uint32_t temporalId); protected: void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); @@ -59,7 +59,7 @@ protected: void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const SEIBufferingPeriod& bp, const uint32_t temporalId); void xWriteSEIFrameFieldInfo(const SEIFrameFieldInfo& sei); void xWriteSEIDependentRAPIndication(const SEIDependentRAPIndication& sei); - void xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableNesting& sei, const SPS *sps); + void xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableNesting& sei); void xWriteSEIFramePacking(const SEIFramePacking& sei); void xWriteSEIParameterSetsInclusionIndication(const SEIParameterSetsInclusionIndication& sei); void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei); @@ -79,7 +79,7 @@ protected: void xWriteSEIContentLightLevelInfo(const SEIContentLightLevelInfo& sei); void xWriteSEIAmbientViewingEnvironment(const SEIAmbientViewingEnvironment& sei); void xWriteSEIContentColourVolume(const SEIContentColourVolume &sei); - void xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, const SPS *sps, HRD &hrd, const uint32_t temporalId); + void xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, HRD &hrd, const uint32_t temporalId); void xWriteByteAlign(); protected: HRD m_nestingHrd;