diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 82e7b9d5b948fdf10831d4a9f7803a7bd51adff1..f5f5067c858bd61eb957339346e53661c313d978 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -91,6 +91,8 @@ #define JVET_R0371_MAX_NUM_SUB_BLK_MRG_CAND 1 // JVET-R0371: set the range of max number of subblock based merge candidate to 0 to 5 - sps_sbtmvp_enabled_flag. +#define JVET_R0113_AND_JVET_R0106_PPS_CLEANUP 1 // JVET-R0113 and JVET-R0106: Cleanup in Picture Parameter Set + #define JVET_R0233_CCALF_LINE_BUFFER_REDUCTION 1 // JVET-R0233 method 2: Line buffer reduction for CCALF #define JVET_Q0471_CHROMA_QT_SPLIT 0 // JVET-Q0471: Chroma QT split, reverted by JVET-R0131 diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 1beda45878ec01a24f5c29be312abad72ffd853e..d76edb5d6bcca068cb936c8c948a0b3a34458d09 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -538,10 +538,16 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) // rectangular slice signalling if (pcPPS->getNumTiles() > 1) { +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + READ_CODE(1, uiCode, "pps_loop_filter_across_tiles_enabled_flag"); pcPPS->setLoopFilterAcrossTilesEnabledFlag(uiCode == 1); +#endif READ_CODE(1, uiCode, "rect_slice_flag"); } else { +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + pcPPS->setLoopFilterAcrossTilesEnabledFlag(true); +#endif uiCode = 1; } pcPPS->setRectSliceFlag(uiCode == 1); @@ -673,8 +679,10 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) pcPPS->setSliceTileIdx(pcPPS->getNumSlicesInPic()-1, tileIdx ); } +#if !JVET_R0113_AND_JVET_R0106_PPS_CLEANUP // loop filtering across slice/tile controls READ_CODE(1, uiCode, "loop_filter_across_tiles_enabled_flag"); pcPPS->setLoopFilterAcrossTilesEnabledFlag( uiCode == 1 ); +#endif #if JVET_R0247_PPS_LP_FTR_ACROSS_SLICES_FLAG_CLEANUP if (pcPPS->getRectSliceFlag() == 0 || pcPPS->getSingleSlicePerSubPicFlag() || pcPPS->getNumSlicesInPic() > 1) { @@ -800,6 +808,17 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) { READ_FLAG( uiCode, "deblocking_filter_override_enabled_flag" ); pcPPS->setDeblockingFilterOverrideEnabledFlag( uiCode ? true : false ); READ_FLAG( uiCode, "pps_deblocking_filter_disabled_flag" ); pcPPS->setPPSDeblockingFilterDisabledFlag(uiCode ? true : false ); +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + if (!pcPPS->getNoPicPartitionFlag() && pcPPS->getDeblockingFilterOverrideEnabledFlag()) + { + READ_FLAG(uiCode, "pps_dbf_info_in_ph_flag"); + pcPPS->setDbfInfoInPhFlag(uiCode ? true : false); + } + else + { + pcPPS->setDbfInfoInPhFlag(false); + } +#endif if(!pcPPS->getPPSDeblockingFilterDisabledFlag()) { READ_SVLC( iCode, "pps_beta_offset_div2" ); pcPPS->setDeblockingFilterBetaOffsetDiv2( iCode ); @@ -830,8 +849,36 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) else { pcPPS->setDeblockingFilterOverrideEnabledFlag(false); +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + pcPPS->setDbfInfoInPhFlag(false); +#endif } +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + if (!pcPPS->getNoPicPartitionFlag()) + { + READ_FLAG(uiCode, "pps_rpl_info_in_ph_flag"); pcPPS->setRplInfoInPhFlag(uiCode ? true : false); + READ_FLAG(uiCode, "pps_sao_info_in_ph_flag"); pcPPS->setSaoInfoInPhFlag(uiCode ? true : false); + READ_FLAG(uiCode, "pps_alf_info_in_ph_flag"); pcPPS->setAlfInfoInPhFlag(uiCode ? true : false); + if ((pcPPS->getUseWP() || pcPPS->getWPBiPred()) && pcPPS->getRplInfoInPhFlag()) + { + READ_FLAG(uiCode, "pps_wp_info_in_ph_flag"); pcPPS->setWpInfoInPhFlag(uiCode ? true : false); + } + else + { + pcPPS->setWpInfoInPhFlag(false); + } + READ_FLAG(uiCode, "pps_qp_delta_info_in_ph_flag"); pcPPS->setQpDeltaInfoInPhFlag(uiCode ? true : false); + } + else + { + pcPPS->setRplInfoInPhFlag(false); + pcPPS->setSaoInfoInPhFlag(false); + pcPPS->setAlfInfoInPhFlag(false); + pcPPS->setWpInfoInPhFlag(false); + pcPPS->setQpDeltaInfoInPhFlag(false); + } +#else READ_FLAG(uiCode, "rpl_info_in_ph_flag"); pcPPS->setRplInfoInPhFlag(uiCode ? true : false); if( pcPPS->getDeblockingFilterOverrideEnabledFlag() ) { @@ -849,7 +896,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS ) pcPPS->setWpInfoInPhFlag(false); } READ_FLAG(uiCode, "qp_delta_info_in_ph_flag"); pcPPS->setQpDeltaInfoInPhFlag(uiCode ? true : false); - +#endif READ_FLAG( uiCode, "picture_header_extension_present_flag"); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index cc7811d539940c75b8decfb8a96060deec5f6bac..0be46d5ce044fa306753e3a1862ee937b6a8dbd6 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -342,6 +342,9 @@ void HLSWriter::codePPS( const PPS* pcPPS ) // rectangular slice signalling if (pcPPS->getNumTiles() > 1) { +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + WRITE_FLAG(pcPPS->getLoopFilterAcrossTilesEnabledFlag(), "pps_loop_filter_across_tiles_enabled_flag"); +#endif WRITE_FLAG(pcPPS->getRectSliceFlag() ? 1 : 0, "rect_slice_flag"); } if (pcPPS->getRectSliceFlag()) @@ -406,8 +409,10 @@ void HLSWriter::codePPS( const PPS* pcPPS ) } } +#if !JVET_R0113_AND_JVET_R0106_PPS_CLEANUP // loop filtering across slice/tile controls WRITE_FLAG( pcPPS->getLoopFilterAcrossTilesEnabledFlag(), "loop_filter_across_tiles_enabled_flag"); +#endif #if JVET_R0247_PPS_LP_FTR_ACROSS_SLICES_FLAG_CLEANUP if (pcPPS->getRectSliceFlag() == 0 || pcPPS->getSingleSlicePerSubPicFlag() || pcPPS->getNumSlicesInPic() > 1) { @@ -464,6 +469,12 @@ void HLSWriter::codePPS( const PPS* pcPPS ) { WRITE_FLAG( pcPPS->getDeblockingFilterOverrideEnabledFlag() ? 1 : 0, "deblocking_filter_override_enabled_flag" ); WRITE_FLAG( pcPPS->getPPSDeblockingFilterDisabledFlag() ? 1 : 0, "pps_deblocking_filter_disabled_flag" ); +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + if (!pcPPS->getNoPicPartitionFlag() && pcPPS->getDeblockingFilterOverrideEnabledFlag()) + { + WRITE_FLAG(pcPPS->getDbfInfoInPhFlag() ? 1 : 0, "pps_dbf_info_in_ph_flag"); + } +#endif if(!pcPPS->getPPSDeblockingFilterDisabledFlag()) { WRITE_SVLC( pcPPS->getDeblockingFilterBetaOffsetDiv2(), "pps_beta_offset_div2" ); @@ -475,6 +486,19 @@ void HLSWriter::codePPS( const PPS* pcPPS ) } } +#if JVET_R0113_AND_JVET_R0106_PPS_CLEANUP + if (!pcPPS->getNoPicPartitionFlag()) + { + WRITE_FLAG(pcPPS->getRplInfoInPhFlag() ? 1 : 0, "pps_rpl_info_in_ph_flag"); + WRITE_FLAG(pcPPS->getSaoInfoInPhFlag() ? 1 : 0, "pps_sao_info_in_ph_flag"); + WRITE_FLAG(pcPPS->getAlfInfoInPhFlag() ? 1 : 0, "pps_alf_info_in_ph_flag"); + if ((pcPPS->getUseWP() || pcPPS->getWPBiPred()) && pcPPS->getRplInfoInPhFlag()) + { + WRITE_FLAG(pcPPS->getWpInfoInPhFlag() ? 1 : 0, "pps_wp_info_in_ph_flag"); + } + WRITE_FLAG(pcPPS->getQpDeltaInfoInPhFlag() ? 1 : 0, "pps_qp_delta_info_in_ph_flag"); + } +#else WRITE_FLAG(pcPPS->getRplInfoInPhFlag() ? 1 : 0, "rpl_info_in_ph_flag"); if (pcPPS->getDeblockingFilterOverrideEnabledFlag()) { @@ -487,8 +511,7 @@ void HLSWriter::codePPS( const PPS* pcPPS ) WRITE_FLAG(pcPPS->getWpInfoInPhFlag() ? 1 : 0, "wp_info_in_ph_flag"); } WRITE_FLAG(pcPPS->getQpDeltaInfoInPhFlag() ? 1 : 0, "qp_delta_info_in_ph_flag"); - - +#endif WRITE_FLAG( pcPPS->getPictureHeaderExtensionPresentFlag() ? 1 : 0, "picture_header_extension_present_flag"); WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_header_extension_present_flag");