From 437f771be574c979a92d214dea3eb89674830dbd Mon Sep 17 00:00:00 2001 From: zhipin <zhipin.deng@bytedance.com> Date: Thu, 4 Jun 2020 18:11:20 +0800 Subject: [PATCH] signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU --- source/App/DecoderApp/DecApp.cpp | 4 ++++ source/Lib/CommonLib/Slice.cpp | 4 ++++ source/Lib/CommonLib/Slice.h | 8 ++++++++ source/Lib/CommonLib/TypeDef.h | 6 ++++++ source/Lib/DecoderLib/DecLib.cpp | 16 +++++++++++++++- source/Lib/DecoderLib/DecLib.h | 8 ++++++++ source/Lib/DecoderLib/VLCReader.cpp | 7 +++++++ source/Lib/EncoderLib/EncLib.cpp | 6 ++++++ 8 files changed, 58 insertions(+), 1 deletion(-) diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp index 6b05eca594..becb092d87 100644 --- a/source/App/DecoderApp/DecApp.cpp +++ b/source/App/DecoderApp/DecApp.cpp @@ -287,7 +287,11 @@ uint32_t DecApp::decode() m_cDecLib.resetPictureUnitNals(); } #endif +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU if (bNewAccessUnit || !bitstreamFile) { m_cDecLib.CheckNoOutputPriorPicFlagsInAccessUnit(); diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 289696aa1d..f8c83136e3 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -2198,7 +2198,11 @@ void VPS::deriveOutputLayerSets() m_numLayersInOls.resize( m_totalNumOLSs ); m_outputLayerIdInOls.resize( m_totalNumOLSs, std::vector<int>( m_uiMaxLayers, NOT_VALID ) ); m_layerIdInOls.resize( m_totalNumOLSs, std::vector<int>( m_uiMaxLayers, NOT_VALID ) ); +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU m_olsDpbChromaFormatIdc.resize(m_totalNumOLSs); m_olsDpbBitDepthMinus8.resize(m_totalNumOLSs); #endif diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 109300808d..cde8bbb58f 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -991,7 +991,11 @@ public: std::vector<int> m_numOutputLayersInOls; std::vector<int> m_numLayersInOls; std::vector<std::vector<int>> m_layerIdInOls; +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU std::vector<int> m_olsDpbChromaFormatIdc; std::vector<int> m_olsDpbBitDepthMinus8; #endif @@ -1096,7 +1100,11 @@ public: void setOlsDpbPicSize( int olsIdx, Size size ) { m_olsDpbPicSize[olsIdx] = size; } void setOlsDpbPicWidth( int olsIdx, int width ) { m_olsDpbPicSize[olsIdx].width = width; } void setOlsDpbPicHeight( int olsIdx, int height ) { m_olsDpbPicSize[olsIdx].height = height; } +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU int getOlsDpbChromaFormatIdc(int olsIdx) const { return m_olsDpbChromaFormatIdc[olsIdx]; } int getOlsDpbBitDepthMinus8(int olsIdx) const { return m_olsDpbBitDepthMinus8[olsIdx]; } void setOlsDpbChromaFormatIdc(int olsIdx, int chromaFormatIdc) { m_olsDpbChromaFormatIdc[olsIdx] = chromaFormatIdc; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 0902945bde..76ab80acfa 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -52,6 +52,7 @@ //########### place macros to be removed in next cycle below this line ############### +<<<<<<< HEAD #define JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG 1 // JVET-R0066: Signal the maximum values of chroma_format_idc and bit_depth_minus8 for all pictures of all layers in the VPS // The value of no_output_of_prior_pics_flag, when present, is required to be the same for all pictures in an AU @@ -70,6 +71,11 @@ #define JVET_R0041 1 // JVET-R0041: Picture types related constraints +======= +#define JVET_R0066 1 // JVET-R0066: Signal the maximum values of chroma_format_idc and bit_depth_minus8 for all pictures of all layers in the VPS + // The value of no_output_of_prior_pics_flag, when present, is required to be the same for all pictures in an AU + +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU #define JVET_R0064 1 // JVET-R0064, aspect 2: Move the flag scaling_matrix_for_lfnst_disabled_flag from the scaling_list_data( ) syntax to the SPS. #define RETRAIN_CABAC 1 // CABAC initial values retrained on VTM-9.0rc1 diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 6d26f4ea3e..a9a4170597 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -898,6 +898,7 @@ void DecLib::xCreateUnavailablePicture(int iUnavailablePoc, bool longTermFlag, c } } +<<<<<<< HEAD #if JVET_R0065 void DecLib::isCvsStart() @@ -933,6 +934,9 @@ void DecLib::checkIncludedInFirstAu() #endif #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU void DecLib::CheckNoOutputPriorPicFlagsInAccessUnit() { if (m_accessUnitNoOutputPriorPicFlags.size() > 1) @@ -1635,7 +1639,11 @@ void DecLib::xCheckParameterSetConstraints(const int layerId) { CHECK( sps->getMaxPicWidthInLumaSamples() > vps->getOlsDpbPicSize( vps->m_targetOlsIdx ).width, "pic_width_max_in_luma_samples shall be less than or equal to the value of ols_dpb_pic_width[ i ]" ); CHECK( sps->getMaxPicHeightInLumaSamples() > vps->getOlsDpbPicSize( vps->m_targetOlsIdx ).height, "pic_height_max_in_luma_samples shall be less than or equal to the value of ols_dpb_pic_height[ i ]" ); +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU CHECK( sps->getChromaFormatIdc() > vps->getOlsDpbChromaFormatIdc( vps->m_targetOlsIdx ), "sps_chroma_format_idc shall be less than or equal to the value of ols_dpb_chroma_format[ i ]"); CHECK((sps->getBitDepth(CHANNEL_TYPE_LUMA) - 8) > vps->getOlsDpbBitDepthMinus8( vps->m_targetOlsIdx ), "sps_bit_depth_minus8 shall be less than or equal to the value of ols_dpb_bitdepth_minus8[ i ]"); #endif @@ -1860,6 +1868,13 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl } #endif +#if JVET_R0066 + if (m_picHeader.getGdrOrIrapPicFlag()) + { + m_accessUnitNoOutputPriorPicFlags.push_back(m_picHeader.getNoOutputOfPriorPicsFlag()); + } +#endif + PPS *pps = m_parameterSetManager.getPPS(m_picHeader.getPPSId()); CHECK(pps == 0, "No PPS present"); SPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); @@ -1872,7 +1887,6 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl CHECK(nalu.m_temporalId == 0, "TemporalID of STSA picture shall not be zero in independent layers"); } - int currSubPicIdx = pps->getSubPicIdxFromSubPicId( m_apcSlicePilot->getSliceSubPicId() ); int currSliceAddr = m_apcSlicePilot->getSliceID(); for(int sp = 0; sp < currSubPicIdx; sp++) diff --git a/source/Lib/DecoderLib/DecLib.h b/source/Lib/DecoderLib/DecLib.h index e17ffcaa14..7c2645fae1 100644 --- a/source/Lib/DecoderLib/DecLib.h +++ b/source/Lib/DecoderLib/DecLib.h @@ -172,7 +172,11 @@ private: std::vector<NalUnitInfo> m_nalUnitInfo[MAX_VPS_LAYERS]; std::vector<int> m_accessUnitApsNals; std::vector<int> m_accessUnitSeiTids; +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU std::vector<bool> m_accessUnitNoOutputPriorPicFlags; #endif @@ -242,11 +246,15 @@ public: void checkTidLayerIdInAccessUnit(); void resetAccessUnitSeiPayLoadTypes() { m_accessUnitSeiPayLoadTypes.clear(); } void checkSEIInAccessUnit(); +<<<<<<< HEAD #if JVET_R0065 void isCvsStart(); void checkIncludedInFirstAu(); #endif #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG +======= +#if JVET_R0066 +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU void CheckNoOutputPriorPicFlagsInAccessUnit(); void resetAccessUnitNoOutputPriorPicFlags() { m_accessUnitNoOutputPriorPicFlags.clear(); } #endif diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 75dbaa8b79..d45110a32b 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -2645,6 +2645,7 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) { READ_UVLC( uiCode, "ols_dpb_pic_width[i]" ); pcVPS->setOlsDpbPicWidth( i, uiCode ); READ_UVLC( uiCode, "ols_dpb_pic_height[i]" ); pcVPS->setOlsDpbPicHeight( i, uiCode ); +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG READ_CODE( 2, uiCode, "ols_dpb_chroma_format[i]"); pcVPS->setOlsDpbChromaFormatIdc(i, uiCode); READ_UVLC( uiCode, "ols_dpb_bitdepth_minus8[i]"); pcVPS->setOlsDpbBitDepthMinus8(i, uiCode); @@ -2652,6 +2653,12 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) #if JVET_R0099_DPB_HRD_PARAMETERS_SIGNALLING if ((pcVPS->m_numDpbParams > 1) && (pcVPS->m_numDpbParams != pcVPS->m_numMultiLayeredOlss)) #else +======= +#if JVET_R0066 + READ_CODE(2, uiCode, "ols_dpb_chroma_format[i]"); pcVPS->setOlsDpbChromaFormatIdc(i, uiCode); + READ_UVLC(uiCode, "ols_dpb_bitdepth_minus8[i]"); pcVPS->setOlsDpbBitDepthMinus8(i, uiCode); +#endif +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU if( pcVPS->m_numDpbParams > 1 ) #endif { diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 30b27752f4..1aa8e9761a 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1047,9 +1047,15 @@ void EncLib::xInitVPS( const SPS& sps ) { m_vps->setOlsDpbPicWidth( olsIdx, std::max<int>( sps.getMaxPicWidthInLumaSamples(), m_vps->getOlsDpbPicSize( olsIdx ).width ) ); m_vps->setOlsDpbPicHeight( olsIdx, std::max<int>( sps.getMaxPicHeightInLumaSamples(), m_vps->getOlsDpbPicSize( olsIdx ).height ) ); +<<<<<<< HEAD #if JVET_R0066_DPB_NO_OUTPUT_PRIOR_PIC_FLAG m_vps->setOlsDpbChromaFormatIdc( dpbIdx, std::max<int>(sps.getChromaFormatIdc(), m_vps->getOlsDpbChromaFormatIdc(dpbIdx))); m_vps->setOlsDpbBitDepthMinus8( dpbIdx, std::max<int>(sps.getBitDepth(CHANNEL_TYPE_LUMA) - 8, m_vps->getOlsDpbBitDepthMinus8(dpbIdx))); +======= +#if JVET_R0066 + m_vps->setOlsDpbChromaFormatIdc(olsIdx, std::max<int>(sps.getChromaFormatIdc(), m_vps->getOlsDpbChromaFormatIdc(olsIdx))); + m_vps->setOlsDpbBitDepthMinus8(olsIdx, std::max<int>(sps.getBitDepth(CHANNEL_TYPE_LUMA) - 8, m_vps->getOlsDpbBitDepthMinus8(olsIdx))); +>>>>>>> signal ols_dpb_chroma_format[ i ] and ols_dpb_bitdepth_minus8[ i ] in the VPS, and check make sure no_output_of_prior_pics_flag are same foe all pics in an AU #endif } -- GitLab