From f2c6852bc6be1e1ab150bfd31804bedecb72bdfc Mon Sep 17 00:00:00 2001 From: Kammachi Sreedhar <kashyap.kammachi-sreedhar@nokia.com> Date: Wed, 24 Apr 2019 10:11:29 +0300 Subject: [PATCH] JVET_N0047_v1 --- doc/software-manual.tex | 46 ++++------------------------- source/App/EncoderApp/EncApp.cpp | 6 +++- source/App/EncoderApp/EncAppCfg.cpp | 4 ++- source/App/EncoderApp/EncAppCfg.h | 3 ++ source/Lib/CommonLib/Slice.h | 8 ++++- source/Lib/CommonLib/TypeDef.h | 4 ++- source/Lib/DecoderLib/VLCReader.cpp | 10 ++++++- source/Lib/EncoderLib/EncCfg.h | 7 +++++ source/Lib/EncoderLib/EncLib.cpp | 3 ++ source/Lib/EncoderLib/VLCWriter.cpp | 10 +++++-- 10 files changed, 54 insertions(+), 47 deletions(-) diff --git a/doc/software-manual.tex b/doc/software-manual.tex index 2ecf08b30..24d144a63 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -1066,15 +1066,8 @@ elements. \par See section~\ref{sec:gop-structure} for further details. \\ - -\Option{ReWriteParamSets} & -%\ShortOption{-ip} & -\Default{$0$} & -Enable writing of parameter sets (SPS, PPS, etc.) before every (intra) random access point to enable true random access. -\\ \end{OptionTableNoShorthand} - %% %% Motion estimation parameters %% @@ -1158,24 +1151,12 @@ $} Specifies the maximum number of merge candidates to use. \\ -\Option{MaxNumTriangleCand} & -%\ShortOption{\None} & -\Default{5} & -Specifies the maximum number of triangle merge candidates to use. -\\ - \Option{DisableIntraInInter} & %\ShortOption{\None} & \Default{0} & Flag to disable intra PUs in inter slices. \\ -\Option{MMVD} & -%\ShortOption{\None} & -\Default{1} & -Enables or disables the merge mode with motion vector difference (MMVD). -\\ - \Option{MmvdDisNum} & %\ShortOption{\None} & \Default{6} & @@ -1622,6 +1603,12 @@ and NumRecSlicesInPicMinus1 is equal to 3, the values of RectSlicesBoundaryArray \end{tabular} \\ +\Option{IDRRefParamList} & +%\ShortOption{\None} & +\Default{false} & +Enables the signalling of reference picture list syntax elements in slice headers of IDR pictures +\\ + \Option{WaveFrontSynchro} & %\ShortOption{\None} & \Default{false} & @@ -1789,32 +1776,12 @@ Specifies the locations of the horizontal virtual boundaries in units of luma sa \begin{OptionTableNoShorthand}{Coding tools parameters}{tab:coding-tools} -\Option{MIP} & -%\ShortOption{\None} & -\Default{true} & -Enables or disables the use of matrix-based intra prediction (MIP). -\\ - \Option{AMP} & %\ShortOption{\None} & \Default{true} & Enables or disables the use of asymmetric motion partitions. \\ -\Option{ISP} & -%\ShortOption{\None} & -\Default{false} & -Enables or disables the Intra Sub-Partitions coding mode. -\\ - -\Option{ISPFast} & -%\ShortOption{\None} & -\Default{false} & -Enables or disables reduced testing of non-DCT-II transforms if ISP is likely to become the best mode for a given CU. -\par -This option has no effect if either ISP or MTS are disabled. -\\ - \Option{SAO} & %\ShortOption{\None} & \Default{true} & @@ -2063,7 +2030,6 @@ Enables or disables the use of low frequency non-separable transform (LFNST). \Default{false} & Enables or disables the fast encoding of low frequency non-separable transform (LFNST). \\ - \end{OptionTableNoShorthand} %% diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index af0e4e7b8..2dc3b9ca5 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -182,10 +182,14 @@ void EncApp::xInitLibCfg() m_cEncLib.setRPLList0 ( m_RPLList0); m_cEncLib.setRPLList1 ( m_RPLList1); #endif - m_cEncLib.setGopList ( m_GOPList ); #if !JVET_M0128 m_cEncLib.setExtraRPSs ( m_extraRPSs ); #endif +#if JVET_N0047_Merge_IDR_Non_IDR + m_cEncLib.setIDRRefParamListPresent ( m_idrRefParamList ); +#endif + m_cEncLib.setGopList ( m_GOPList ); + for(int i = 0; i < MAX_TLAYER; i++) { m_cEncLib.setNumReorderPics ( m_numReorderPics[i], i ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index f8feb0fcd..a22c1d488 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1023,7 +1023,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) //Alias with same name as in HM ("ReWriteParamSetsFlag", m_rewriteParamSets, false, "Alias for ReWriteParamSets") #endif - +#if JVET_N0047_Merge_IDR_Non_IDR + ("IDRRefParamList", m_idrRefParamList, false, "Enable indication of reference picture list syntax elements in slice headers of IDR pictures") +#endif // motion search options ("DisableIntraInInter", m_bDisableIntraPUsInInterSlices, false, "Flag to disable intra PUs in inter slices") ("FastSearch", tmpMotionEstimationSearchMethod, int(MESEARCH_DIAMOND), "0:Full search 1:Diamond 2:Selective 3:Enhanced Diamond") diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 903082d70..1643fe0b8 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -191,6 +191,9 @@ protected: RPLEntry m_RPLList1[MAX_GOP]; ///< the RPL entries from the config file #else int m_extraRPSs; ///< extra RPSs added to handle CRA +#endif +#if JVET_N0047_Merge_IDR_Non_IDR + bool m_idrRefParamList; ///< indicates if reference picture list syntax elements are present in slice headers of IDR pictures #endif GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file #if JVET_N0857_TILES_BRICKS diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 15db1dc20..1bad46234 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -1203,6 +1203,9 @@ private: unsigned m_maxBTDepth[3]; unsigned m_maxBTSize[3]; unsigned m_maxTTSize[3]; +#if JVET_N0047_Merge_IDR_Non_IDR + bool m_idrRefParamList; +#endif unsigned m_dualITree; uint32_t m_uiMaxCUWidth; uint32_t m_uiMaxCUHeight; @@ -1465,7 +1468,10 @@ public: unsigned getMaxTTSize() const { return m_maxTTSize[1]; } unsigned getMaxTTSizeI() const { return m_maxTTSize[0]; } unsigned getMaxTTSizeIChroma() const { return m_maxTTSize[2]; } - +#if JVET_N0047_Merge_IDR_Non_IDR + void setIDRRefParamListPresent(bool b) { m_idrRefParamList = b; } + bool getIDRRefParamListPresent() const { return m_idrRefParamList; } +#endif void setUseDualITree(bool b) { m_dualITree = b; } bool getUseDualITree() const { return m_dualITree; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index ccba812dc..1d7079279 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -49,7 +49,9 @@ #include <cstring> #include <assert.h> #include <cassert> - + +#define JVET_N0047_Merge_IDR_Non_IDR 1 // merging IDR and non-IDR pictures + #define JVET_N0276_CONSTRAINT_FLAGS 1 // JVET-N0276: On interoperability point signalling #define JVET_N0278_HLS 1 // JVET-N0278: HLS for MPEG requirements on immersive media delivery and access diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index e9ead8c27..f5fef2784 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1563,7 +1563,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); CHECK(uiCode > 12, "Invalid code"); - +#if JVET_N0047_Merge_IDR_Non_IDR + READ_FLAG( uiCode, "sps_idr_rpl_present_flag" ); pcSPS->setIDRRefParamListPresent( (bool) uiCode); +#endif // KJS: Marakech decision: sub-layers added back uint32_t subLayerOrderingInfoPresentFlag; READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); @@ -2222,7 +2224,11 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para // read colour_plane_id // (separate_colour_plane_flag == 1) is not supported in this version of the standard. +#if JVET_N0047_Merge_IDR_Non_IDR + if( pcSlice->getIdrPicFlag() && !(sps->getIDRRefParamListPresent())) +#else if( pcSlice->getIdrPicFlag() ) +#endif { READ_CODE(sps->getBitsForPOC(), uiCode, "slice_pic_order_cnt_lsb"); pcSlice->setPOC(uiCode); @@ -2521,6 +2527,8 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para pcSlice->setEnableTMVPFlag(false); } } + + if(sps->getSAOEnabledFlag()) { READ_FLAG(uiCode, "slice_sao_luma_flag"); pcSlice->setSaoEnabledFlag(CHANNEL_TYPE_LUMA, (bool)uiCode); diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index c29693738..ba959b3b1 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -280,6 +280,9 @@ protected: uint32_t m_uiDecodingRefreshType; ///< the type of decoding refresh employed for the random access. #if JCTVC_Y0038_PARAMS bool m_rewriteParamSets; +#endif +#if JVET_N0047_Merge_IDR_Non_IDR + bool m_idrRefParamList; #endif int m_iGOPSize; #if JVET_M0128 @@ -888,6 +891,10 @@ public: void setDecodingRefreshType ( int i ) { m_uiDecodingRefreshType = (uint32_t)i; } #if JCTVC_Y0038_PARAMS void setReWriteParamSets ( bool b ) { m_rewriteParamSets = b; } +#endif +#if JVET_N0047_Merge_IDR_Non_IDR + void setIDRRefParamListPresent ( bool b ) { m_idrRefParamList = b; } + bool getIDRRefParamListPresent () const { return m_idrRefParamList; } #endif void setGOPSize ( int i ) { m_iGOPSize = i; } void setGopList(const GOPEntry GOPList[MAX_GOP]) { for (int i = 0; i < MAX_GOP; i++) m_GOPList[i] = GOPList[i]; } diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 563fa171c..7ce50c5eb 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1098,6 +1098,9 @@ void EncLib::xInitSPS(SPS &sps) sps.setSplitConsOverrideEnabledFlag ( m_useSplitConsOverride ); sps.setMinQTSizes ( m_uiMinQT ); sps.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma ); +#if JVET_N0047_Merge_IDR_Non_IDR + sps.setIDRRefParamListPresent ( m_idrRefParamList ); +#endif sps.setUseDualITree ( m_dualITree ); #if JVET_N0193_LFNST sps.setUseLFNST ( m_LFNST ); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 450ad9fad..7df2e8d19 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -1082,7 +1082,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) WRITE_UVLC( chromaEnabled ? (pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA) - 8):0, "bit_depth_chroma_minus8" ); WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); - +#if JVET_N0047_Merge_IDR_Non_IDR + WRITE_FLAG( pcSPS->getIDRRefParamListPresent(), "sps_idr_rpl_present_flag" ); +#endif // KJS: Marakech decision: sub-layers added back const bool subLayerOrderingInfoPresentFlag = 1; WRITE_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); @@ -1606,7 +1608,11 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) int pocBits = pcSlice->getSPS()->getBitsForPOC(); int pocMask = (1 << pocBits) - 1; WRITE_CODE(pcSlice->getPOC() & pocMask, pocBits, "slice_pic_order_cnt_lsb"); - if( !pcSlice->getIdrPicFlag() ) +#if JVET_N0047_Merge_IDR_Non_IDR + if( !pcSlice->getIdrPicFlag() || pcSlice->getSPS()->getIDRRefParamListPresent()) +#else + if( !pcSlice->getIdrPicFlag() ) +#endif { #if JVET_M0128 //Write L0 related syntax elements -- GitLab