diff --git a/cfg/sei_vui/vui_HD.cfg b/cfg/sei_vui/vui_HD.cfg index 6705b1da5f934e0d1d41b4d9bf627a1af0b97073..394aa6485089e30c08d76e44f576b7c69928b1fc 100644 --- a/cfg/sei_vui/vui_HD.cfg +++ b/cfg/sei_vui/vui_HD.cfg @@ -8,6 +8,8 @@ ColourPrimaries: 1 // the source colour primaries according TransferCharacteristics: 1 // transfer characteristics function according to Rec. ITU-T H.273 | ISO/IEC 23091-2 MatrixCoefficients: 1 // the formulae used in deriving luma and chroma signals acc. to Rec. ITU-T H.273 | ISO/IEC 23091-2 VideoFullRange: 0 // scaling and offset values applied according to Rec. ITU-T H.273 | ISO/IEC 23091-2 +ProgressiveSource: 1 // indicates if content is progressive +InterlacedSource: 0 // indicates if content is interlaced ChromaLocInfoPresent: 1 // enable presence of chroma location information ChromaSampleLocTypeTopField: 0 // the location of chroma sample top field ChromaSampleLocTypeBottomField: 0 // the location of chroma sample bottom field diff --git a/cfg/sei_vui/vui_UHD_PQ.cfg b/cfg/sei_vui/vui_UHD_PQ.cfg index 717815029e845436e2f792e9b0d6015c9014e610..ec337fe50a497f4c92a7220653252e20231c2f41 100644 --- a/cfg/sei_vui/vui_UHD_PQ.cfg +++ b/cfg/sei_vui/vui_UHD_PQ.cfg @@ -8,6 +8,8 @@ ColourPrimaries: 9 // the source colour primaries according TransferCharacteristics: 16 // transfer characteristics function according to Rec. ITU-T H.273 | ISO/IEC 23091-2 MatrixCoefficients: 9 // the formulae used in deriving luma and chroma signals acc. to Rec. ITU-T H.273 | ISO/IEC 23091-2 VideoFullRange: 0 // scaling and offset values applied according to Rec. ITU-T H.273 | ISO/IEC 23091-2 +ProgressiveSource: 1 // Indicates if content is progressive +InterlacedSource: 0 // Indicates if content is interlaced ChromaLocInfoPresent: 1 // enable presence of chroma location information ChromaSampleLocTypeTopField: 2 // the location of chroma sample top field ChromaSampleLocTypeBottomField: 2 // the location of chroma sample bottom field diff --git a/doc/software-manual.tex b/doc/software-manual.tex index a155272dda781520cf940e56cd43947252d8abdb..aa01684f08146d77982494e93e0deaadbdcfde73 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -1028,18 +1028,6 @@ For --profile=main-RExt, specifies the value of general_one_picture_only_constra Specifies the value of general_lower_bit_constraint_flag to use for RExt profiles. \\ -\Option{ProgressiveSource} & -%\ShortOption{\None} & -\Default{false} & -Specifies the value of general_progressive_source_flag -\\ - -\Option{InterlacedSource} & -%\ShortOption{\None} & -\Default{false} & -Specifies the value of general_interlaced_source_flag -\\ - \Option{NonPackedSource} & %\ShortOption{\None} & \Default{false} & @@ -2859,6 +2847,14 @@ Indicates the black level and range of luma and chroma signals. 1 & Indicates that the luma and chroma signals are not to be scaled prior to display. \\ \end{tabular} \\ +\Option{ProgressiveSource} & +\Default{false} & +Specifies the value of general_progressive_source_flag +\\ +\Option{InterlacedSource} & +\Default{false} & +Specifies the value of general_interlaced_source_flag +\\ \Option{ChromaLocInfoPresent} & \Default{false} & Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present. diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index f0a203bb9feeedb330a503fac98a0cd5e2083e7c..b250b5dc803c6e6a6092c1c6645929fa61e29f87 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -208,8 +208,10 @@ void EncApp::xInitLibCfg() { m_cEncLib.setSubProfile(i, m_subProfile[i]); } +#if !JVET_R0090_VUI m_cEncLib.setProgressiveSourceFlag ( m_progressiveSourceFlag); m_cEncLib.setInterlacedSourceFlag ( m_interlacedSourceFlag); +#endif m_cEncLib.setNonPackedConstraintFlag ( m_nonPackedConstraintFlag); m_cEncLib.setNonProjectedConstraintFlag ( m_nonProjectedConstraintFlag ); m_cEncLib.setNoResChangeInClvsConstraintFlag ( m_noResChangeInClvsConstraintFlag ); @@ -762,6 +764,10 @@ void EncApp::xInitLibCfg() m_cEncLib.setColourPrimaries ( m_colourPrimaries ); m_cEncLib.setTransferCharacteristics ( m_transferCharacteristics ); m_cEncLib.setMatrixCoefficients ( m_matrixCoefficients ); +#if JVET_R0090_VUI + m_cEncLib.setProgressiveSourceFlag ( m_progressiveSourceFlag); + m_cEncLib.setInterlacedSourceFlag ( m_interlacedSourceFlag); +#endif m_cEncLib.setChromaLocInfoPresentFlag ( m_chromaLocInfoPresentFlag ); m_cEncLib.setChromaSampleLocTypeTopField ( m_chromaSampleLocTypeTopField ); m_cEncLib.setChromaSampleLocTypeBottomField ( m_chromaSampleLocTypeBottomField ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 1b945c81cf7349a3e8f120c70594063f1be42217..673eb6141870c9a23a9c6c20e0d4f4105059ae4d 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -802,8 +802,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") ("IntraConstraintFlag", m_intraConstraintFlag, false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") +#if !JVET_R0090_VUI ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced") +#endif ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing") ("NonProjectedConstraintFlag", m_nonProjectedConstraintFlag, false, "Indicate that the bitstream contains projection SEI messages") ("NoResChangeInClvsConstraintFlag", m_noResChangeInClvsConstraintFlag, false, "Indicate that the picture spatial resolution does not change within any CLVS referring to the SPS") @@ -1152,6 +1154,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries") ("TransferCharacteristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source") ("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries") +#if JVET_R0090_VUI + ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") + ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced") +#endif ("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present") ("ChromaSampleLocTypeTopField", m_chromaSampleLocTypeTopField, 0, "Specifies the location of chroma samples for top field") ("ChromaSampleLocTypeBottomField", m_chromaSampleLocTypeBottomField, 0, "Specifies the location of chroma samples for bottom field") diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index ee76d6a84695523003fb8e8a2f8aaa4ec58b35c8..2f19e32b65555b8686784e0d3271eefb71d4c0d7 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -181,8 +181,10 @@ protected: uint32_t m_bitDepthConstraint; ChromaFormat m_chromaFormatConstraint; bool m_intraConstraintFlag; +#if !JVET_R0090_VUI bool m_progressiveSourceFlag; bool m_interlacedSourceFlag; +#endif bool m_nonPackedConstraintFlag; bool m_nonProjectedConstraintFlag; bool m_noResChangeInClvsConstraintFlag; @@ -639,6 +641,10 @@ protected: int m_colourPrimaries; ///< Indicates chromaticity coordinates of the source primaries int m_transferCharacteristics; ///< Indicates the opto-electronic transfer characteristics of the source int m_matrixCoefficients; ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries +#if JVET_R0090_VUI + bool m_progressiveSourceFlag; ///< Indicates if the content is progressive + bool m_interlacedSourceFlag; ///< Indicates if the content is interlaced +#endif bool m_chromaLocInfoPresentFlag; ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present int m_chromaSampleLocTypeTopField; ///< Specifies the location of chroma samples for top field int m_chromaSampleLocTypeBottomField; ///< Specifies the location of chroma samples for bottom field diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 3c0e837e764fae5cd44512b75767c9c7a52bdc24..7de09c48eb384a64a3011f42a4d6f08b980c4f85 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -3949,8 +3949,10 @@ bool Slice::checkRPR() bool operator == (const ConstraintInfo& op1, const ConstraintInfo& op2) { +#if !JVET_R0090_VUI if( op1.m_progressiveSourceFlag != op2.m_progressiveSourceFlag ) return false; if( op1.m_interlacedSourceFlag != op2.m_interlacedSourceFlag ) return false; +#endif if( op1.m_nonPackedConstraintFlag != op2.m_nonPackedConstraintFlag ) return false; if( op1.m_frameOnlyConstraintFlag != op2.m_frameOnlyConstraintFlag ) return false; if( op1.m_intraOnlyConstraintFlag != op2.m_intraOnlyConstraintFlag ) return false; diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index efbd1b7f2c89e98bd8a2d8930b7c7cb8beb409d2..65f2870b61bfeede0414a2f5f0bd6afcbfd38ace 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -237,8 +237,10 @@ private: class ConstraintInfo { +#if !JVET_R0090_VUI bool m_progressiveSourceFlag; bool m_interlacedSourceFlag; +#endif bool m_nonPackedConstraintFlag; bool m_nonProjectedConstraintFlag; bool m_noResChangeInClvsConstraintFlag; @@ -291,9 +293,13 @@ class ConstraintInfo public: ConstraintInfo() +#if !JVET_R0090_VUI : m_progressiveSourceFlag (false) , m_interlacedSourceFlag (false) , m_nonPackedConstraintFlag (false) +#else + : m_nonPackedConstraintFlag (false) +#endif , m_nonProjectedConstraintFlag(false) , m_noResChangeInClvsConstraintFlag(false) , m_oneTilePerPicConstraintFlag(false) @@ -343,11 +349,13 @@ public: , m_noApsConstraintFlag (false) {} +#if !JVET_R0090_VUI bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } void setProgressiveSourceFlag(bool b) { m_progressiveSourceFlag = b; } bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } void setInterlacedSourceFlag(bool b) { m_interlacedSourceFlag = b; } +#endif bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } void setNonPackedConstraintFlag(bool b) { m_nonPackedConstraintFlag = b; } @@ -1055,6 +1063,10 @@ private: int m_colourPrimaries; int m_transferCharacteristics; int m_matrixCoefficients; +#if JVET_R0090_VUI + bool m_progressiveSourceFlag; + bool m_interlacedSourceFlag; +#endif bool m_chromaLocInfoPresentFlag; int m_chromaSampleLocTypeTopField; int m_chromaSampleLocTypeBottomField; @@ -1074,6 +1086,10 @@ public: , m_colourPrimaries (2) , m_transferCharacteristics (2) , m_matrixCoefficients (2) +#if JVET_R0090_VUI + , m_progressiveSourceFlag (false) + , m_interlacedSourceFlag (false) +#endif , m_chromaLocInfoPresentFlag (false) , m_chromaSampleLocTypeTopField (0) , m_chromaSampleLocTypeBottomField (0) @@ -1111,6 +1127,13 @@ public: int getMatrixCoefficients() const { return m_matrixCoefficients; } void setMatrixCoefficients(int i) { m_matrixCoefficients = i; } +#if JVET_R0090_VUI + bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } + void setProgressiveSourceFlag(bool b) { m_progressiveSourceFlag = b; } + + bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } + void setInterlacedSourceFlag(bool b) { m_interlacedSourceFlag = b; } +#endif bool getChromaLocInfoPresentFlag() const { return m_chromaLocInfoPresentFlag; } void setChromaLocInfoPresentFlag(bool i) { m_chromaLocInfoPresentFlag = i; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 3f5e1b5010904e6003fa597b4d739fa87b79ce2c..e69ec3f5afda7ff60adea6b3060b8097480fc738 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -58,6 +58,8 @@ #define JVET_R0334_PLT_CLEANUP 1 // JVET-R0334: Disable chroma palette for local dual tree +#define JVET_R0090_VUI 1 // JVET-R0090: Fix parsing dependencies in VUI syntax + #define JVET_R0205 1 // JVET-R0205: Condition presence of inter_layer_ref_pics_present_flag on sps_video_parameter_set_id #define JVET_R0186_CLEANUP 1 // JVET-R0186 aspect 1: Signal the pps_no_pic_partition_flag ahead in the PPS. diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index dc7a4664b512263d23161888cb6279a3de89f920..93f91dc834e855d097173fa5b2fad7cd9733e796 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1144,11 +1144,19 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS) READ_FLAG( symbol, "vui_video_full_range_flag"); pcVUI->setVideoFullRangeFlag(symbol); } +#if JVET_R0090_VUI + READ_FLAG(symbol, "general_progressive_source_flag" ); pcVUI->setProgressiveSourceFlag(symbol ? true : false); + READ_FLAG(symbol, "general_interlaced_source_flag" ); pcVUI->setInterlacedSourceFlag(symbol ? true : false); +#endif READ_FLAG( symbol, "vui_chroma_loc_info_present_flag"); pcVUI->setChromaLocInfoPresentFlag(symbol); if (pcVUI->getChromaLocInfoPresentFlag()) { +#if JVET_R0090_VUI + if(pcVUI->getProgressiveSourceFlag() && !pcVUI->getInterlacedSourceFlag()) +#else if(pcSPS->getProfileTierLevel()->getConstraintInfo()->getProgressiveSourceFlag() && !pcSPS->getProfileTierLevel()->getConstraintInfo()->getInterlacedSourceFlag()) +#endif { READ_UVLC( symbol, "vui_chroma_sample_loc_type" ); pcVUI->setChromaSampleLocType(symbol); } @@ -4324,8 +4332,10 @@ void HLSyntaxReader::getSlicePoc(Slice* pcSlice, PicHeader* picHeader, Parameter void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo) { uint32_t symbol; +#if !JVET_R0090_VUI READ_FLAG(symbol, "general_progressive_source_flag" ); cinfo->setProgressiveSourceFlag(symbol ? true : false); READ_FLAG(symbol, "general_interlaced_source_flag" ); cinfo->setInterlacedSourceFlag(symbol ? true : false); +#endif READ_FLAG(symbol, "general_non_packed_constraint_flag" ); cinfo->setNonPackedConstraintFlag(symbol ? true : false); READ_FLAG(symbol, "general_frame_only_constraint_flag" ); cinfo->setFrameOnlyConstraintFlag(symbol ? true : false); READ_FLAG(symbol, "general_non_projected_constraint_flag" ); cinfo->setNonProjectedConstraintFlag(symbol ? true : false); diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 146887dbdc3816ae7fb9265ab76edd178b9cf606..c2587682ed95e9d89d462074169a80a7f2abf55c 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -219,8 +219,10 @@ protected: Level::Name m_level; std::vector<uint32_t> m_subProfile; uint8_t m_numSubProfile; +#if !JVET_R0090_VUI bool m_progressiveSourceFlag; bool m_interlacedSourceFlag; +#endif bool m_nonPackedConstraintFlag; bool m_nonProjectedConstraintFlag; bool m_noResChangeInClvsConstraintFlag; @@ -669,6 +671,10 @@ protected: int m_colourPrimaries; ///< Indicates chromaticity coordinates of the source primaries int m_transferCharacteristics; ///< Indicates the opto-electronic transfer characteristics of the source int m_matrixCoefficients; ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries +#if JVET_R0090_VUI + bool m_progressiveSourceFlag; ///< Indicates if the content is progressive + bool m_interlacedSourceFlag; ///< Indicates if the content is interlaced +#endif bool m_chromaLocInfoPresentFlag; ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present int m_chromaSampleLocTypeTopField; ///< Specifies the location of chroma samples for top field int m_chromaSampleLocTypeBottomField; ///< Specifies the location of chroma samples for bottom field diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 719053cf7519f1cae5e64f9c9c95e63035636325..6c9e60ef1d62c99d2b7163ed019332c486bf12eb 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1054,8 +1054,10 @@ void EncLib::xInitSPS( SPS& sps ) { ProfileTierLevel* profileTierLevel = sps.getProfileTierLevel(); ConstraintInfo* cinfo = profileTierLevel->getConstraintInfo(); +#if !JVET_R0090_VUI cinfo->setProgressiveSourceFlag (m_progressiveSourceFlag); cinfo->setInterlacedSourceFlag (m_interlacedSourceFlag); +#endif cinfo->setNonPackedConstraintFlag (m_nonPackedConstraintFlag); cinfo->setNonProjectedConstraintFlag(m_nonProjectedConstraintFlag); cinfo->setNoResChangeInClvsConstraintFlag(m_noResChangeInClvsConstraintFlag); @@ -1261,6 +1263,10 @@ void EncLib::xInitSPS( SPS& sps ) pcVUI->setColourPrimaries(getColourPrimaries()); pcVUI->setTransferCharacteristics(getTransferCharacteristics()); pcVUI->setMatrixCoefficients(getMatrixCoefficients()); +#if JVET_R0090_VUI + pcVUI->setProgressiveSourceFlag (getProgressiveSourceFlag()); + pcVUI->setInterlacedSourceFlag (getInterlacedSourceFlag()); +#endif pcVUI->setChromaLocInfoPresentFlag(getChromaLocInfoPresentFlag()); pcVUI->setChromaSampleLocTypeTopField(getChromaSampleLocTypeTopField()); pcVUI->setChromaSampleLocTypeBottomField(getChromaSampleLocTypeBottomField()); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index b81c5062db393df3b72271606f43f51195a6fe52..b95aa0cc39a587aaca44462f9a54cc3d45f0a9e8 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -705,11 +705,19 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS ) WRITE_CODE(pcVUI->getMatrixCoefficients(), 8, "vui_matrix_coeffs"); WRITE_FLAG(pcVUI->getVideoFullRangeFlag(), "vui_video_full_range_flag"); } +#if JVET_R0090_VUI + WRITE_FLAG(pcVUI->getProgressiveSourceFlag(), "general_progressive_source_flag" ); + WRITE_FLAG(pcVUI->getInterlacedSourceFlag(), "general_interlaced_source_flag" ); +#endif WRITE_FLAG(pcVUI->getChromaLocInfoPresentFlag(), "vui_chroma_loc_info_present_flag"); if (pcVUI->getChromaLocInfoPresentFlag()) { +#if JVET_R0090_VUI + if(pcVUI->getProgressiveSourceFlag() && !pcVUI->getInterlacedSourceFlag()) +#else if(pcSPS->getProfileTierLevel()->getConstraintInfo()->getProgressiveSourceFlag() && !pcSPS->getProfileTierLevel()->getConstraintInfo()->getInterlacedSourceFlag()) +#endif { WRITE_UVLC(pcVUI->getChromaSampleLocType(), "vui_chroma_sample_loc_type"); } @@ -2555,8 +2563,10 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) void HLSWriter::codeConstraintInfo ( const ConstraintInfo* cinfo ) { +#if !JVET_R0090_VUI WRITE_FLAG(cinfo->getProgressiveSourceFlag(), "general_progressive_source_flag" ); WRITE_FLAG(cinfo->getInterlacedSourceFlag(), "general_interlaced_source_flag" ); +#endif WRITE_FLAG(cinfo->getNonPackedConstraintFlag(), "general_non_packed_constraint_flag" ); WRITE_FLAG(cinfo->getFrameOnlyConstraintFlag(), "general_frame_only_constraint_flag" ); WRITE_FLAG(cinfo->getNonProjectedConstraintFlag(), "general_non_projected_constraint_flag");