diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index ba5e799efc7e1c08c01b8d41b3c1e718b8d51096..53d77fd05524c2fe6086c7626a1ae43598ec723e 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -529,6 +529,9 @@ void EncApp::xInitLibCfg() m_cEncLib.setDecodingRefreshType ( m_iDecodingRefreshType ); m_cEncLib.setGOPSize ( m_iGOPSize ); m_cEncLib.setDrapPeriod ( m_drapPeriod ); +#if JVET_U0084_EDRAP + m_cEncLib.setEdrapPeriod ( m_edrapPeriod ); +#endif m_cEncLib.setReWriteParamSets ( m_rewriteParamSets ); m_cEncLib.setRPLList0 ( m_RPLList0); m_cEncLib.setRPLList1 ( m_RPLList1); @@ -861,6 +864,9 @@ void EncApp::xInitLibCfg() m_cEncLib.setDecodedPictureHashSEIType ( m_decodedPictureHashSEIType ); m_cEncLib.setSubpicDecodedPictureHashType ( m_subpicDecodedPictureHashType ); m_cEncLib.setDependentRAPIndicationSEIEnabled ( m_drapPeriod > 0 ); +#if JVET_U0084_EDRAP + m_cEncLib.setEdrapIndicationSEIEnabled ( m_edrapPeriod > 0 ); +#endif m_cEncLib.setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); m_cEncLib.setPictureTimingSEIEnabled ( m_pictureTimingSEIEnabled ); m_cEncLib.setFrameFieldInfoSEIEnabled ( m_frameFieldInfoSEIEnabled ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index ed0823ede7f1c17389378d7d2f348eb10ae928f0..c894e608dc271b3ca25f4a6f6c070f0e50fa7521 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1012,6 +1012,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)") ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") ("DRAPPeriod", m_drapPeriod, 0, "DRAP period in frames (0: disable Dependent RAP indication SEI messages)") +#if JVET_U0084_EDRAP + ("EDRAPPeriod", m_edrapPeriod, 0, "EDRAP period in frames (0: disable Extended Dependent RAP indication SEI messages)") +#endif ("ReWriteParamSets", m_rewriteParamSets, false, "Enable rewriting of Parameter sets before every (intra) random access point") ("IDRRefParamList", m_idrRefParamList, false, "Enable indication of reference picture list syntax elements in slice headers of IDR pictures") // motion search options @@ -2769,6 +2772,9 @@ bool EncAppCfg::xCheckParameter() xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); xConfirmPara( m_drapPeriod < 0, "DRAP period must be greater or equal to 0" ); +#if JVET_U0084_EDRAP + xConfirmPara( m_edrapPeriod < 0, "EDRAP period must be greater or equal to 0" ); +#endif xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" ); if (m_isField) @@ -3995,6 +4001,9 @@ void EncAppCfg::xPrintParameter() msg( DETAILS, "Intra period : %d\n", m_iIntraPeriod ); msg( DETAILS, "Decoding refresh type : %d\n", m_iDecodingRefreshType ); msg( DETAILS, "DRAP period : %d\n", m_drapPeriod ); +#if JVET_U0084_EDRAP + msg( DETAILS, "EDRAP period : %d\n", m_edrapPeriod ); +#endif #if QP_SWITCHING_FOR_PARALLEL if (m_qpIncrementAtSourceFrame.bPresent) { diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 76eaa2db0c3430821e1646202c9ee04e74e2b35e..854d7aa2a97b5aa2a99eb322a266c4f8af7a3e2b 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -226,6 +226,9 @@ protected: int m_iDecodingRefreshType; ///< random access type int m_iGOPSize; ///< GOP size of hierarchical structure int m_drapPeriod; ///< period of dependent RAP pictures +#if JVET_U0084_EDRAP + int m_edrapPeriod; ///< period of extended dependent RAP pictures +#endif bool m_rewriteParamSets; ///< Flag to enable rewriting of parameter sets at random access points RPLEntry m_RPLList0[MAX_GOP]; ///< the RPL entries from the config file RPLEntry m_RPLList1[MAX_GOP]; ///< the RPL entries from the config file diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp index 892477ec57ecab3036d4bbb03c81f4ef3281d3ac..f11a3bfb4d8f79820c418a26cfab359fc6a41bc5 100644 --- a/source/Lib/CommonLib/Picture.cpp +++ b/source/Lib/CommonLib/Picture.cpp @@ -62,6 +62,9 @@ Picture::Picture() fieldPic = false; topField = false; precedingDRAP = false; +#if JVET_U0084_EDRAP + edrapRapId = -1; +#endif nonReferencePictureFlag = false; for( int i = 0; i < MAX_NUM_CHANNEL_TYPE; i++ ) diff --git a/source/Lib/CommonLib/Picture.h b/source/Lib/CommonLib/Picture.h index 2f985828e9cc920d21c8ebaa619a86364a3283a3..309d7b9230183ee86431fa5e87eb28ca1c35b0a3 100644 --- a/source/Lib/CommonLib/Picture.h +++ b/source/Lib/CommonLib/Picture.h @@ -126,6 +126,10 @@ struct Picture : public UnitArea void setPictureType(const NalUnitType val) { m_pictureType = val; } void setBorderExtension( bool bFlag) { m_bIsBorderExtended = bFlag;} Pel* getOrigin( const PictureType &type, const ComponentID compID ) const; +#if JVET_U0084_EDRAP + int getEdrapRapId() const { return edrapRapId ; } + void setEdrapRapId(const int val) { edrapRapId = val; } +#endif void setLossyQPValue(int i) { m_lossyQP = i; } int getLossyQPValue() const { return m_lossyQP; } @@ -183,6 +187,9 @@ public: bool fieldPic; int m_prevQP[MAX_NUM_CHANNEL_TYPE]; bool precedingDRAP; // preceding a DRAP picture in decoding order +#if JVET_U0084_EDRAP + int edrapRapId; +#endif bool nonReferencePictureFlag; int poc; diff --git a/source/Lib/CommonLib/SEI.cpp b/source/Lib/CommonLib/SEI.cpp index ef10af904e04a42a4e7642452373c936355d177f..85a642b68da9a559fde36eb7913e7ee04d633172 100644 --- a/source/Lib/CommonLib/SEI.cpp +++ b/source/Lib/CommonLib/SEI.cpp @@ -181,6 +181,9 @@ const char *SEI::getSEIMessageString(SEI::PayloadType payloadType) case SEI::SAMPLE_ASPECT_RATIO_INFO: return "Sample aspect ratio information"; case SEI::SUBPICTURE_LEVEL_INFO: return "Subpicture level information"; case SEI::ANNOTATED_REGIONS: return "Annotated Region"; +#if JVET_U0084_EDRAP + case SEI::EXTENDED_DRAP_INDICATION: return "Extended DRAP indication"; +#endif default: return "Unknown"; } } diff --git a/source/Lib/CommonLib/SEI.h b/source/Lib/CommonLib/SEI.h index 0c4e03602429756736faa1f2c30512dd852b6362..531fc27bc72589a6d5f943ab107f94ef08942aed 100644 --- a/source/Lib/CommonLib/SEI.h +++ b/source/Lib/CommonLib/SEI.h @@ -80,6 +80,9 @@ public: AMBIENT_VIEWING_ENVIRONMENT = 148, CONTENT_COLOUR_VOLUME = 149, ANNOTATED_REGIONS = 202, +#if JVET_U0084_EDRAP + EXTENDED_DRAP_INDICATION = 206, +#endif }; SEI() {} @@ -729,6 +732,23 @@ public: std::vector<std::pair<AnnotatedRegionObjectIndex, AnnotatedRegionObject> > m_annotatedRegions; std::vector<std::pair<AnnotatedRegionLabelIndex, AnnotatedRegionLabel> > m_annotatedLabels; }; + +#if JVET_U0084_EDRAP +class SEIExtendedDrapIndication : public SEI +{ +public: + PayloadType payloadType() const { return EXTENDED_DRAP_INDICATION; } + + SEIExtendedDrapIndication() {} + virtual ~SEIExtendedDrapIndication() {} + + int m_edrapIndicationRapIdMinus1; + bool m_edrapIndicationLeadingPicturesDecodableFlag; + int m_edrapIndicationReservedZero12Bits; + int m_edrapIndicationNumRefRapPicsMinus1; + std::vector<int> m_edrapIndicationRefRapId; +}; +#endif //! \} diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 5e7da254d39d45fb6a3690fb9d68b1b4db331ad1..c4cc9a598d189a0b304faecf4f9843115f39b8c1 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -199,6 +199,16 @@ void Slice::initSlice() m_useLTforDRAP = false; m_isDRAP = false; m_latestDRAPPOC = MAX_INT; +#if JVET_U0084_EDRAP + m_edrapRapId = 0; + m_enableEdrapSEI = false; + m_edrapRapId = 0; + m_useLTforEdrap = false; + m_edrapNumRefRapPics = 0; + m_edrapRefRapIds.resize(0); + m_latestEDRAPPOC = MAX_INT; + m_latestEdrapLeadingPicDecodableFlag = false; +#endif resetAlfEnabledFlag(); m_ccAlfFilterParam.reset(); m_ccAlfCbEnabledFlag = 0; @@ -2055,6 +2065,17 @@ bool Slice::isPocRestrictedByDRAP( int poc, bool precedingDRAPInDecodingOrder ) ( cvsHasPreviousDRAP() && getPOC() > getLatestDRAPPOC() && (precedingDRAPInDecodingOrder || poc < getLatestDRAPPOC()) ); } +#if JVET_U0084_EDRAP +bool Slice::isPocRestrictedByEdrap( int poc ) +{ + if (!getEnableEdrapSEI()) + { + return false; + } + return getEdrapRapId() > 0 && poc != getAssociatedIRAPPOC(); +} +#endif + void Slice::checkConformanceForDRAP( uint32_t temporalId ) { if (!(isDRAP() || cvsHasPreviousDRAP())) @@ -2116,6 +2137,61 @@ void Slice::checkConformanceForDRAP( uint32_t temporalId ) } } +#if JVET_U0084_EDRAP +void Slice::checkConformanceForEDRAP( uint32_t temporalId ) +{ + if (!(getEdrapRapId() > 0 || cvsHasPreviousEDRAP())) + { + return; + } + + if (getEdrapRapId() > 0) + { + if (!(getNalUnitType() == NalUnitType::NAL_UNIT_CODED_SLICE_TRAIL || + getNalUnitType() == NalUnitType::NAL_UNIT_CODED_SLICE_STSA)) + { + msg( WARNING, "Warning, non-conforming bitstream. The EDRAP picture should be a trailing picture.\n"); + } + if ( temporalId != 0) + { + msg( WARNING, "Warning, non-conforming bitstream. The EDRAP picture shall have a temporal sublayer identifier equal to 0.\n"); + } + for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_0); i++) + { + if (getRefPic(REF_PIC_LIST_0,i)->getEdrapRapId() < 0) + { + msg( WARNING, "Warning, non-conforming bitstream. Any picture that is in the same layer and follows the EDRAP picture in both decoding order and output order does not include, in the active entries of its reference picture lists, any picture that is in the same layer and precedes the EDRAP picture in decoding order or output order, with the exception of the referenceablePictures.\n"); + } + } + for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_1); i++) + { + if (getRefPic(REF_PIC_LIST_1,i)->getEdrapRapId() < 0) + { + msg( WARNING, "Warning, non-conforming bitstream. Any picture that is in the same layer and follows the EDRAP picture in both decoding order and output order does not include, in the active entries of its reference picture lists, any picture that is in the same layer and precedes the EDRAP picture in decoding order or output order, with the exception of the referenceablePictures.\n"); + } + } + } + + if (cvsHasPreviousEDRAP() && getPOC() > getLatestEDRAPPOC() && getLatestEdrapLeadingPicDecodableFlag()) + { + for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_0); i++) + { + if (getRefPic(REF_PIC_LIST_0,i)->getPOC() < getLatestEDRAPPOC() && getRefPic(REF_PIC_LIST_0,i)->getEdrapRapId() < 0) + { + msg( WARNING, "Warning, non-conforming bitstream. Any picture that is in the same layer and follows the EDRAP picture in decoding order and precedes the EDRAP picture in output order does not include, in the active entries of its reference picture lists, any picture that is in the same layer and precedes the EDRAP picture in decoding order, with the exception of the referenceablePictures. Problem is POC %d in RPL0.\n", getRefPic(REF_PIC_LIST_0,i)->getPOC()); + } + } + for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_1); i++) + { + if (getRefPic(REF_PIC_LIST_1,i)->getPOC() < getLatestEDRAPPOC() && getRefPic(REF_PIC_LIST_1,i)->getEdrapRapId() < 0) + { + msg( WARNING, "Warning, non-conforming bitstream. Any picture that is in the same layer and follows the EDRAP picture in decoding order and precedes the EDRAP picture in output order does not include, in the active entries of its reference picture lists, any picture that is in the same layer and precedes the EDRAP picture in decoding order, with the exception of the referenceablePictures. Problem is POC %d in RPL1", getRefPic(REF_PIC_LIST_1,i)->getPOC()); + } + } + } +} +#endif + //! get AC and DC values for weighted pred void Slice::getWpAcDcParam(const WPACDCParam *&wp) const diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 9842a9e4ab1afa255d45c3399cd274db1eaa3391..dcc988aba31a86b5237fafa97072f2d0d070222b 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -2641,6 +2641,15 @@ private: bool m_useLTforDRAP; bool m_isDRAP; int m_latestDRAPPOC; +#if JVET_U0084_EDRAP + bool m_enableEdrapSEI; + int m_edrapRapId; + bool m_useLTforEdrap; + int m_edrapNumRefRapPics; + std::vector<int> m_edrapRefRapIds; + int m_latestEDRAPPOC; + bool m_latestEdrapLeadingPicDecodableFlag; +#endif ReferencePictureList m_RPL0; //< RPL for L0 when present in slice header ReferencePictureList m_RPL1; //< RPL for L1 when present in slice header int m_rpl0Idx; //< index of used RPL in the SPS or -1 for local RPL in the slice header @@ -2906,6 +2915,26 @@ public: bool isPocRestrictedByDRAP( int poc, bool precedingDRAPinDecodingOrder ); bool isPOCInRefPicList( const ReferencePictureList *rpl, int poc ); void checkConformanceForDRAP( uint32_t temporalId ); +#if JVET_U0084_EDRAP + bool getEnableEdrapSEI () const { return m_enableEdrapSEI; } + void setEnableEdrapSEI ( bool b ) { m_enableEdrapSEI = b; } + int getEdrapRapId () const { return m_edrapRapId; } + void setEdrapRapId (int i) { m_edrapRapId = i; } + bool getUseLTforEdrap () const { return m_useLTforEdrap; } + void setUseLTforEdrap ( bool b ) { m_useLTforEdrap = b; } + int getEdrapNumRefRapPics () const { return m_edrapNumRefRapPics; } + void setEdrapNumRefRapPics (int i) { m_edrapNumRefRapPics = i; } + int getEdrapRefRapId (int idx) const { return m_edrapRefRapIds[idx]; } + void addEdrapRefRapIds (int i) { m_edrapRefRapIds.push_back(i); } + void deleteEdrapRefRapIds (int i) { m_edrapRefRapIds.erase(m_edrapRefRapIds.begin() + i); m_edrapNumRefRapPics--; } + bool isPocRestrictedByEdrap( int poc ); + void setLatestEDRAPPOC ( int i ) { m_latestEDRAPPOC = i; } + int getLatestEDRAPPOC () const { return m_latestEDRAPPOC; } + bool cvsHasPreviousEDRAP() const { return m_latestEDRAPPOC != MAX_INT; } + void setLatestEdrapLeadingPicDecodableFlag ( bool b ) { m_latestEdrapLeadingPicDecodableFlag = b; } + bool getLatestEdrapLeadingPicDecodableFlag () const { return m_latestEdrapLeadingPicDecodableFlag; } + void checkConformanceForEDRAP( uint32_t temporalId ); +#endif void setLambdas( const double lambdas[MAX_NUM_COMPONENT] ) { for (int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; } const double* getLambdas() const { return m_lambdas; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 7154f52f014fed14b5aef20a4e467c747dcd4fc1..391efca1d836102426a4956dea643449e043a9de 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -50,6 +50,8 @@ #include <assert.h> #include <cassert> +#define JVET_U0084_EDRAP 1 // EDRAP indication SEI message + #define JVET_V0106_RRC_RICE 1 // JVET_V0106: Extension of the RRC rice derivation for high bit depth profile (VVCv2). #define JVET_V0131_CORRECT_TR_HBD 1 // correcting the 4x4 BDST7/DCT8 transform matrices for high bit-depth coding // clang-format off diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index b3b4205eb4e20cc5eb6922b8f2346ee62603fef9..7caa60d1d615d55f0174540d723851a0e3447f3a 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -744,6 +744,9 @@ void DecLib::finishPicture(int &poc, PicList *&rpcListPic, MsgLevel msgl, bool a } if (pcSlice->isDRAP()) c = 'D'; +#if JVET_U0084_EDRAP + if (pcSlice->getEdrapRapId() > 0) c = 'E'; +#endif //-- For time output for each slice msg( msgl, "POC %4d LId: %2d TId: %1d ( %s, %c-SLICE, QP%3d ) ", pcSlice->getPOC(), pcSlice->getPic()->layerId, @@ -2723,6 +2726,23 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl pcSlice->setLatestDRAPPOC(pcSlice->getPOC()); } pcSlice->checkConformanceForDRAP(nalu.m_temporalId); +#if JVET_U0084_EDRAP + if (pcSlice->isIntra()) + pcSlice->getPic()->setEdrapRapId(0); + SEIMessages edrapSEIs = getSeisByType(m_pcPic->SEIs, SEI::EXTENDED_DRAP_INDICATION ); + if (!edrapSEIs.empty()) + { + msg( NOTICE, "Extended DRAP indication SEI decoded\n"); + SEIExtendedDrapIndication *seiEdrap = (SEIExtendedDrapIndication *)edrapSEIs.front(); + pcSlice->setEdrapRapId(seiEdrap->m_edrapIndicationRapIdMinus1 + 1); + pcSlice->getPic()->setEdrapRapId(seiEdrap->m_edrapIndicationRapIdMinus1 + 1); + pcSlice->setEdrapNumRefRapPics(seiEdrap->m_edrapIndicationNumRefRapPicsMinus1 + 1); + for (int i = 0; i < pcSlice->getEdrapNumRefRapPics(); i++) + pcSlice->addEdrapRefRapIds(seiEdrap->m_edrapIndicationRefRapId[i]); + pcSlice->setLatestEDRAPPOC(pcSlice->getPOC()); + } + pcSlice->checkConformanceForEDRAP(nalu.m_temporalId); +#endif Quant *quant = m_cTrQuant.getQuant(); diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index 25fc7cbbfc3339715a1e51dbf49c07fe17635d10..10182169ca053276930ab024fd8ef9a9abf6b552 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -230,6 +230,12 @@ void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType sei = new SEIDependentRAPIndication; xParseSEIDependentRAPIndication((SEIDependentRAPIndication&) *sei, payloadSize, pDecodedMessageOutputStream); break; +#if JVET_U0084_EDRAP + case SEI::EXTENDED_DRAP_INDICATION: + sei = new SEIExtendedDrapIndication; + xParseSEIExtendedDrapIndication((SEIExtendedDrapIndication&) *sei, payloadSize, pDecodedMessageOutputStream); + break; +#endif case SEI::FRAME_PACKING: sei = new SEIFramePacking; xParseSEIFramePacking((SEIFramePacking&) *sei, payloadSize, pDecodedMessageOutputStream); @@ -1639,6 +1645,24 @@ void SEIReader::xParseSEISampleAspectRatioInfo(SEISampleAspectRatioInfo& sei, ui } } +#if JVET_U0084_EDRAP +void SEIReader::xParseSEIExtendedDrapIndication(SEIExtendedDrapIndication& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream) +{ + uint32_t val; + output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); + sei_read_code( pDecodedMessageOutputStream, 16, val, "edrap_rap_id_minus1" ); sei.m_edrapIndicationRapIdMinus1 = val; + sei_read_flag( pDecodedMessageOutputStream, val, "edrap_leading_pictures_decodable_flag" ); sei.m_edrapIndicationLeadingPicturesDecodableFlag = val; + sei_read_code( pDecodedMessageOutputStream, 12, val, "edrap_reserved_zero_12bits" ); sei.m_edrapIndicationReservedZero12Bits = val; + sei_read_code( pDecodedMessageOutputStream, 3, val, "edrap_num_ref_rap_pics_minus1" ); sei.m_edrapIndicationNumRefRapPicsMinus1 = val; + sei.m_edrapIndicationRefRapId.resize(sei.m_edrapIndicationNumRefRapPicsMinus1 + 1); + for (int i = 0; i <= sei.m_edrapIndicationNumRefRapPicsMinus1; i++) + { + sei_read_code( pDecodedMessageOutputStream, 16, val, "edrap_ref_rap_id[i]" ); + sei.m_edrapIndicationRefRapId[i] = val; + } +} +#endif + #if JVET_S0257_DUMP_360SEI_MESSAGE void SeiCfgFileDump::write360SeiDump (std::string decoded360MessageFileName, SEIMessages& seis, const SPS* sps) { diff --git a/source/Lib/DecoderLib/SEIread.h b/source/Lib/DecoderLib/SEIread.h index 94cbd7f666ad339228ad1eb6263260657faf86c3..9631e293cbf28294bb4e40cd127dea4d21ee9417 100644 --- a/source/Lib/DecoderLib/SEIread.h +++ b/source/Lib/DecoderLib/SEIread.h @@ -87,6 +87,9 @@ protected: void xParseSEIContentLightLevelInfo (SEIContentLightLevelInfo& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream); void xParseSEIAmbientViewingEnvironment (SEIAmbientViewingEnvironment& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream); void xParseSEIContentColourVolume (SEIContentColourVolume& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream); +#if JVET_U0084_EDRAP + void xParseSEIExtendedDrapIndication (SEIExtendedDrapIndication& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream); +#endif void sei_read_scode(std::ostream *pOS, uint32_t length, int& code, const char *pSymbolName); void sei_read_code(std::ostream *pOS, uint32_t uiLength, uint32_t& ruiCode, const char *pSymbolName); diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 657288a663e6af3427ce90b4c3d0d2fce29e3c03..d95c27adfb8640369f665ee72be13f8fa6e5487b 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -271,6 +271,9 @@ protected: int m_maxDecPicBuffering[MAX_TLAYER]; int m_maxNumReorderPics[MAX_TLAYER]; int m_drapPeriod; +#if JVET_U0084_EDRAP + int m_edrapPeriod; +#endif int m_iQP; // if (AdaptiveQP == OFF) ChromaQpMappingTableParams m_chromaQpMappingTableParams; @@ -542,6 +545,9 @@ protected: bool m_pictureTimingSEIEnabled; bool m_frameFieldInfoSEIEnabled; bool m_dependentRAPIndicationSEIEnabled; +#if JVET_U0084_EDRAP + bool m_edrapIndicationSEIEnabled; +#endif bool m_framePackingSEIEnabled; int m_framePackingSEIType; int m_framePackingSEIId; @@ -991,6 +997,9 @@ public: void setMaxDecPicBuffering ( uint32_t u, uint32_t tlayer ) { m_maxDecPicBuffering[tlayer] = u; } void setMaxNumReorderPics ( int i, uint32_t tlayer ) { m_maxNumReorderPics[tlayer] = i; } void setDrapPeriod (int drapPeriod) { m_drapPeriod = drapPeriod; } +#if JVET_U0084_EDRAP + void setEdrapPeriod (int edrapPeriod) { m_edrapPeriod = edrapPeriod; } +#endif void setBaseQP ( int i ) { m_iQP = i; } #if X0038_LAMBDA_FROM_QP_CAPABILITY @@ -1366,6 +1375,9 @@ public: int getMaxDecPicBuffering (uint32_t tlayer) { return m_maxDecPicBuffering[tlayer]; } int getMaxNumReorderPics (uint32_t tlayer) { return m_maxNumReorderPics[tlayer]; } int getDrapPeriod () { return m_drapPeriod; } +#if JVET_U0084_EDRAP + int getEdrapPeriod () { return m_edrapPeriod; } +#endif #if X0038_LAMBDA_FROM_QP_CAPABILITY int getIntraQPOffset () const { return m_intraQPOffset; } int getLambdaFromQPEnable () const { return m_lambdaFromQPEnable; } @@ -1554,6 +1566,10 @@ public: bool getFrameFieldInfoSEIEnabled() const { return m_frameFieldInfoSEIEnabled; } void setDependentRAPIndicationSEIEnabled(bool b) { m_dependentRAPIndicationSEIEnabled = b; } int getDependentRAPIndicationSEIEnabled() const { return m_dependentRAPIndicationSEIEnabled; } +#if JVET_U0084_EDRAP + void setEdrapIndicationSEIEnabled(bool b) { m_edrapIndicationSEIEnabled = b; } + int getEdrapIndicationSEIEnabled() const { return m_edrapIndicationSEIEnabled; } +#endif void setFramePackingArrangementSEIEnabled(bool b) { m_framePackingSEIEnabled = b; } bool getFramePackingArrangementSEIEnabled() const { return m_framePackingSEIEnabled; } void setFramePackingArrangementSEIType(int b) { m_framePackingSEIType = b; } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 2323c8d776179f5eef1978f56a1b4afc0a5fd399..cac85ca579a13af0675cf41579db3a8bb2953de6 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -87,6 +87,10 @@ EncGOP::EncGOP() m_bFirst = true; m_iLastRecoveryPicPOC = 0; m_latestDRAPPOC = MAX_INT; +#if JVET_U0084_EDRAP + m_latestEDRAPPOC = MAX_INT; + m_latestEdrapLeadingPicDecodableFlag = false; +#endif m_lastRasPoc = MAX_INT; #if JVET_V0054_TSRC_RICE ::memset(m_riceBit, 0, 8 * 2 * sizeof(unsigned)); @@ -802,6 +806,24 @@ void EncGOP::xCreatePerPictureSEIMessages (int picInGOP, SEIMessages& seiMessage seiMessages.push_back(dependentRAPIndicationSEI); } +#if JVET_U0084_EDRAP + if (m_pcEncLib->getEdrapIndicationSEIEnabled() && slice->getEdrapRapId() > 0) + { + SEIExtendedDrapIndication *seiExtendedDrapIndication = new SEIExtendedDrapIndication(); + m_seiEncoder.initSEIExtendedDrapIndication(seiExtendedDrapIndication); + // update EDRAP SEI message according to the reference lists of the slice + seiExtendedDrapIndication->m_edrapIndicationRapIdMinus1 = slice->getEdrapRapId() - 1; + seiExtendedDrapIndication->m_edrapIndicationLeadingPicturesDecodableFlag = slice->getLatestEdrapLeadingPicDecodableFlag(); + seiExtendedDrapIndication->m_edrapIndicationNumRefRapPicsMinus1 = slice->getEdrapNumRefRapPics() - 1; + seiExtendedDrapIndication->m_edrapIndicationRefRapId.resize(seiExtendedDrapIndication->m_edrapIndicationNumRefRapPicsMinus1 + 1); + for (int i = 0; i <= seiExtendedDrapIndication->m_edrapIndicationNumRefRapPicsMinus1; i++) + { + seiExtendedDrapIndication->m_edrapIndicationRefRapId[i] = slice->getEdrapRefRapId(i); + } + seiMessages.push_back(seiExtendedDrapIndication); + } +#endif + // insert one Annotated Region SEI for the picture (if the file exists) if (!m_pcCfg->getAnnotatedRegionSEIFileRoot().empty()) { @@ -2200,6 +2222,13 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, { m_associatedIRAPType[pcPic->layerId] = pcSlice->getNalUnitType(); m_associatedIRAPPOC[pcPic->layerId] = pocCurr; +#if JVET_U0084_EDRAP + if (m_pcEncLib->getEdrapIndicationSEIEnabled()) + { + m_latestEDRAPPOC = MAX_INT; + pcPic->setEdrapRapId(0); + } +#endif } pcSlice->setAssociatedIRAPType(m_associatedIRAPType[pcPic->layerId]); pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC[pcPic->layerId]); @@ -2238,6 +2267,13 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, { m_associatedIRAPType[pcPic->layerId] = pcSlice->getNalUnitType(); m_associatedIRAPPOC[pcPic->layerId] = pocCurr; +#if JVET_U0084_EDRAP + if (m_pcEncLib->getEdrapIndicationSEIEnabled()) + { + m_latestEDRAPPOC = MAX_INT; + pcPic->setEdrapRapId(0); + } +#endif } pcSlice->setAssociatedIRAPType(m_associatedIRAPType[pcPic->layerId]); pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC[pcPic->layerId]); @@ -2281,10 +2317,70 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, } } +#if JVET_U0084_EDRAP + pcSlice->setEnableEdrapSEI(m_pcEncLib->getEdrapIndicationSEIEnabled()); + if (m_pcEncLib->getEdrapIndicationSEIEnabled()) + { + // Only mark the picture as Extended DRAP if all of the following applies: + // 1) Extended DRAP indication SEI messages are enabled + // 2) The current picture is not an intra picture + // 3) The current picture is in the EDRAP period + // 4) The current picture is a trailing picture + if (m_pcEncLib->getEdrapIndicationSEIEnabled() && m_pcEncLib->getEdrapPeriod() > 0 && !pcSlice->isIntra() && + pocCurr % m_pcEncLib->getEdrapPeriod() == 0 && pocCurr > pcSlice->getAssociatedIRAPPOC()) + { + pcSlice->setEdrapRapId(pocCurr / m_pcEncLib->getEdrapPeriod()); + pcSlice->getPic()->setEdrapRapId(pocCurr / m_pcEncLib->getEdrapPeriod()); + } + + if (pcSlice->getEdrapRapId() > 0) + { + m_latestEDRAPPOC = pocCurr; + m_latestEdrapLeadingPicDecodableFlag = false; + pcSlice->setTLayer(0); // Force Extended DRAP picture to have temporal layer 0 + } + pcSlice->setLatestEDRAPPOC(m_latestEDRAPPOC); + pcSlice->setLatestEdrapLeadingPicDecodableFlag(m_latestEdrapLeadingPicDecodableFlag); + pcSlice->setUseLTforEdrap(false); // When set, sets the associated IRAP/EDRAP as long-term in RPL0 at slice level, unless the associated IRAP/EDRAP is already included in RPL0 or RPL1 defined in SPS + + PicList::iterator iterPic = rcListPic.begin(); + Picture *rpcPic; + while (iterPic != rcListPic.end()) + { + rpcPic = *(iterPic++); + if ( pcSlice->getEdrapRapId() > 0 && rpcPic->getPOC() != pocCurr && rpcPic->getPOC() >= pcSlice->getAssociatedIRAPPOC() ) + { + if (rpcPic->getEdrapRapId() >= 0 && rpcPic->getPOC() % m_pcEncLib->getEdrapPeriod() == 0) + { + bool bRefExist = false; + for (int i = 0; i < pcSlice->getEdrapNumRefRapPics(); i++) + { + if (pcSlice->getEdrapRefRapId(i) == rpcPic->getEdrapRapId()) + bRefExist = true; + } + if (!bRefExist) + { + pcSlice->addEdrapRefRapIds(rpcPic->getPOC() / m_pcEncLib->getEdrapPeriod()); + pcSlice->setEdrapNumRefRapPics(pcSlice->getEdrapNumRefRapPics() + 1); + } + } + } + } + } +#endif + +#if JVET_U0084_EDRAP + if (pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL0(), 0, false) != 0 || pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL1(), 1, false) != 0 || + (m_pcEncLib->getDependentRAPIndicationSEIEnabled() && !pcSlice->isIRAP() && ( pcSlice->isDRAP() || !pcSlice->isPOCInRefPicList(pcSlice->getRPL0(), pcSlice->getAssociatedIRAPPOC())) ) || + (m_pcEncLib->getEdrapIndicationSEIEnabled() && !pcSlice->isIRAP() && ( pcSlice->getEdrapRapId() > 0 || !pcSlice->isPOCInRefPicList(pcSlice->getRPL0(), pcSlice->getAssociatedIRAPPOC()) ) ) + || ((m_pcEncLib->getAvoidIntraInDepLayer() || !pcSlice->isIRAP()) && pcSlice->getPic()->cs->vps && m_pcEncLib->getNumRefLayers(pcSlice->getPic()->cs->vps->getGeneralLayerIdx(m_pcEncLib->getLayerId()))) + ) +#else if (pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL0(), 0, false) != 0 || pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL1(), 1, false) != 0 || (m_pcEncLib->getDependentRAPIndicationSEIEnabled() && !pcSlice->isIRAP() && ( pcSlice->isDRAP() || !pcSlice->isPOCInRefPicList(pcSlice->getRPL0(), pcSlice->getAssociatedIRAPPOC())) ) || ((m_pcEncLib->getAvoidIntraInDepLayer() || !pcSlice->isIRAP()) && pcSlice->getPic()->cs->vps && m_pcEncLib->getNumRefLayers(pcSlice->getPic()->cs->vps->getGeneralLayerIdx(m_pcEncLib->getLayerId()))) ) +#endif { xCreateExplicitReferencePictureSetFromReference( pcSlice, rcListPic, pcSlice->getRPL0(), pcSlice->getRPL1() ); } @@ -4618,6 +4714,12 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni { c = 'D'; } +#if JVET_U0084_EDRAP + if (m_pcCfg->getEdrapIndicationSEIEnabled() && pcSlice->getEdrapRapId() > 0) + { + c = 'E'; + } +#endif if( g_verbosity >= NOTICE ) { @@ -5854,14 +5956,26 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL if (rpcPic->layerId == pic->layerId) { hasHigherTId = rpcPic->temporalId > pic->temporalId; +#if JVET_U0084_EDRAP + if (!rpl0->isRefPicLongterm(ii) && rpcPic->referenced + && rpcPic->getPOC() == slice->getPOC() + rpl0->getRefPicIdentifier(ii) + && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP) + && !slice->isPocRestrictedByEdrap(rpcPic->getPOC())) +#else if (!rpl0->isRefPicLongterm(ii) && rpcPic->referenced && rpcPic->getPOC() == slice->getPOC() + rpl0->getRefPicIdentifier(ii) && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP)) +#endif { isAvailable = true; break; } +#if JVET_U0084_EDRAP + else if (rpl0->isRefPicLongterm(ii) && rpcPic->referenced && (rpcPic->getPOC() & (pocCycle - 1)) == rpl0->getRefPicIdentifier(ii) && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP) + && !slice->isPocRestrictedByEdrap(rpcPic->getPOC())) +#else else if (rpl0->isRefPicLongterm(ii) && rpcPic->referenced && (rpcPic->getPOC() & (pocCycle - 1)) == rpl0->getRefPicIdentifier(ii) && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP)) +#endif { isAvailable = true; break; @@ -5937,6 +6051,35 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL } } } +#if JVET_U0084_EDRAP + if( slice->getEnableEdrapSEI() ) + { + pLocalRPL0->setNumberOfShorttermPictures( numOfSTRPL0 ); + pLocalRPL0->setNumberOfLongtermPictures( numOfLTRPL0 ); + pLocalRPL0->setNumberOfInterLayerPictures( numOfILRPL0 ); + + for (int i = 0; i < slice->getEdrapNumRefRapPics(); i++) + { + int refPoc = slice->getEdrapRefRapId(i) == 0 ? slice->getAssociatedIRAPPOC() : slice->getEdrapRefRapId(i) * m_pcEncLib->getEdrapPeriod(); + if( slice->isPOCInRefPicList( pLocalRPL0, refPoc ) ) + continue; + if( slice->getUseLTforEdrap() && !slice->isPOCInRefPicList( rpl1, refPoc ) ) + { + // Added as longterm picture + pLocalRPL0->setRefPicIdentifier( refPicIdxL0, refPoc, true, false, 0 ); + refPicIdxL0++; + numOfLTRPL0++; + } + else + { + // Added as shortterm picture + pLocalRPL0->setRefPicIdentifier(refPicIdxL0, refPoc - slice->getPOC(), false, false, 0); + refPicIdxL0++; + numOfSTRPL0++; + } + } + } +#endif // now add higher TId refs for (int i = 0; i < higherTLayerRefs.size(); i++) @@ -5975,14 +6118,25 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL if (rpcPic->layerId == pic->layerId) { hasHigherTId = rpcPic->temporalId > pic->temporalId; +#if JVET_U0084_EDRAP + if (!rpl1->isRefPicLongterm(ii) && rpcPic->referenced + && rpcPic->getPOC() == slice->getPOC() + rpl1->getRefPicIdentifier(ii) + && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP) + && !slice->isPocRestrictedByEdrap(rpcPic->getPOC())) +#else if (!rpl1->isRefPicLongterm(ii) && rpcPic->referenced && rpcPic->getPOC() == slice->getPOC() + rpl1->getRefPicIdentifier(ii) && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP)) +#endif { isAvailable = true; break; } +#if JVET_U0084_EDRAP + else if (rpl1->isRefPicLongterm(ii) && rpcPic->referenced && (rpcPic->getPOC() & (pocCycle - 1)) == rpl1->getRefPicIdentifier(ii) && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP) && !slice->isPocRestrictedByEdrap(rpcPic->getPOC())) +#else else if (rpl1->isRefPicLongterm(ii) && rpcPic->referenced && (rpcPic->getPOC() & (pocCycle - 1)) == rpl1->getRefPicIdentifier(ii) && !slice->isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP)) +#endif { isAvailable = true; break; @@ -6137,5 +6291,17 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL pLocalRPL1->setLtrpInSliceHeaderFlag( 1 ); slice->setRPL1idx( -1 ); *slice->getRPL1() = localRPL1; +#if JVET_U0084_EDRAP + // To ensure that any picture in the RefRapIds has been included in the refrence list. + for (int i = 0; i < slice->getEdrapNumRefRapPics(); i++) + { + int refPoc = slice->getEdrapRefRapId(i) == 0 ? slice->getAssociatedIRAPPOC() : slice->getEdrapRefRapId(i) * m_pcEncLib->getEdrapPeriod(); + if (!slice->isPOCInRefPicList( pLocalRPL0, refPoc ) && !slice->isPOCInRefPicList( pLocalRPL1, refPoc )) + { + slice->deleteEdrapRefRapIds(i); + } + } +#endif + } //! \} diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h index cc6af0134635f9564594a9938ce9ba07336acb84..8edcab833dac0d3b3ac881565a57692780ee97a1 100644 --- a/source/Lib/EncoderLib/EncGOP.h +++ b/source/Lib/EncoderLib/EncGOP.h @@ -128,6 +128,10 @@ private: bool m_bFirst; int m_iLastRecoveryPicPOC; int m_latestDRAPPOC; +#if JVET_U0084_EDRAP + int m_latestEDRAPPOC; + bool m_latestEdrapLeadingPicDecodableFlag; +#endif int m_lastRasPoc; #if JVET_V0054_TSRC_RICE unsigned m_riceBit[8][2]; diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp index f53b7551dbab4351433dd5cc9a9fb0d8c8568dd8..2ddcdad040f38d2d7cbf1ef81d91a043f639b03f 100644 --- a/source/Lib/EncoderLib/SEIEncoder.cpp +++ b/source/Lib/EncoderLib/SEIEncoder.cpp @@ -492,6 +492,23 @@ void SEIEncoder::initSEIDependentRAPIndication(SEIDependentRAPIndication *seiDep CHECK(!(seiDependentRAPIndication!=NULL), "Unspecified error"); } +#if JVET_U0084_EDRAP +void SEIEncoder::initSEIExtendedDrapIndication(SEIExtendedDrapIndication *sei) +{ + CHECK(!(m_isInitialized), "Unspecified error"); + CHECK(!(sei!=NULL), "Unspecified error"); + sei->m_edrapIndicationRapIdMinus1 = 0; + sei->m_edrapIndicationLeadingPicturesDecodableFlag = false; + sei->m_edrapIndicationReservedZero12Bits = 0; + sei->m_edrapIndicationNumRefRapPicsMinus1 = 0; + sei->m_edrapIndicationRefRapId.resize(sei->m_edrapIndicationNumRefRapPicsMinus1 + 1); + for (int i = 0; i <= sei->m_edrapIndicationNumRefRapPicsMinus1; i++) + { + sei->m_edrapIndicationRefRapId[i] = 0; + } +} +#endif + template <typename T> static void readTokenValue(T &returnedValue, /// value returned diff --git a/source/Lib/EncoderLib/SEIEncoder.h b/source/Lib/EncoderLib/SEIEncoder.h index aa6fdfedb30511215bddf03927f8f416355773d7..dac2a2cbc8ae1ddad52fa93bee0d5d006f701d40 100644 --- a/source/Lib/EncoderLib/SEIEncoder.h +++ b/source/Lib/EncoderLib/SEIEncoder.h @@ -68,6 +68,9 @@ public: void initSEIFramePacking(SEIFramePacking *sei, int currPicNum); void initSEIParameterSetsInclusionIndication(SEIParameterSetsInclusionIndication* sei); void initSEIDependentRAPIndication(SEIDependentRAPIndication *sei); +#if JVET_U0084_EDRAP + void initSEIExtendedDrapIndication(SEIExtendedDrapIndication *sei); +#endif void initSEIBufferingPeriod(SEIBufferingPeriod *sei, bool noLeadingPictures); #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI void initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *sei); diff --git a/source/Lib/EncoderLib/SEIwrite.cpp b/source/Lib/EncoderLib/SEIwrite.cpp index a00ca928479c7dacb4ec906a7fc30cafbb1e626f..3286b92d01b1f16636c9f4bee300fef623f29cf8 100644 --- a/source/Lib/EncoderLib/SEIwrite.cpp +++ b/source/Lib/EncoderLib/SEIwrite.cpp @@ -77,6 +77,11 @@ void SEIWriter::xWriteSEIpayloadData(OutputBitstream &bs, const SEI& sei, HRD &h case SEI::DEPENDENT_RAP_INDICATION: xWriteSEIDependentRAPIndication(*static_cast<const SEIDependentRAPIndication*>(&sei)); break; +#if JVET_U0084_EDRAP + case SEI::EXTENDED_DRAP_INDICATION: + xWriteSEIEdrapIndication(*static_cast<const SEIExtendedDrapIndication*>(&sei)); + break; +#endif case SEI::FRAME_PACKING: xWriteSEIFramePacking(*static_cast<const SEIFramePacking*>(&sei)); break; @@ -487,6 +492,20 @@ void SEIWriter::xWriteSEIDependentRAPIndication(const SEIDependentRAPIndication& // intentionally empty } +#if JVET_U0084_EDRAP +void SEIWriter::xWriteSEIEdrapIndication(const SEIExtendedDrapIndication& sei) +{ + WRITE_CODE( sei.m_edrapIndicationRapIdMinus1, 16, "edrap_rap_id_minsu1" ); + WRITE_FLAG( sei.m_edrapIndicationLeadingPicturesDecodableFlag ? 1 : 0, "edrap_leading_pictures_decodable_flag" ); + WRITE_CODE( sei.m_edrapIndicationReservedZero12Bits, 12, "edrap_reserved_zero_12bits" ); + WRITE_CODE( sei.m_edrapIndicationNumRefRapPicsMinus1, 3, "edrap_num_ref_rap_pics_minus1" ); + for (int i = 0; i <= sei.m_edrapIndicationNumRefRapPicsMinus1; i++) + { + WRITE_CODE( sei.m_edrapIndicationRefRapId[i], 16, "edrap_ref_rap_id[i]" ); + } +} +#endif + 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.") diff --git a/source/Lib/EncoderLib/SEIwrite.h b/source/Lib/EncoderLib/SEIwrite.h index ef3f9b4adb01e41d0b83b1c3e4096ea504737bb2..9d2a33722db6488e9221762f137068d3ef0873d9 100644 --- a/source/Lib/EncoderLib/SEIwrite.h +++ b/source/Lib/EncoderLib/SEIwrite.h @@ -59,6 +59,9 @@ protected: void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const SEIBufferingPeriod& bp, const uint32_t temporalId); void xWriteSEIFrameFieldInfo(const SEIFrameFieldInfo& sei); void xWriteSEIDependentRAPIndication(const SEIDependentRAPIndication& sei); +#if JVET_U0084_EDRAP + void xWriteSEIEdrapIndication(const SEIExtendedDrapIndication& sei); +#endif void xWriteSEIScalableNesting(OutputBitstream& bs, const SEIScalableNesting& sei); void xWriteSEIFramePacking(const SEIFramePacking& sei); void xWriteSEIParameterSetsInclusionIndication(const SEIParameterSetsInclusionIndication& sei);