diff --git a/cfg/sei/alternative_transfer_characteristics.cfg b/cfg/sei_vui/alternative_transfer_characteristics.cfg similarity index 100% rename from cfg/sei/alternative_transfer_characteristics.cfg rename to cfg/sei_vui/alternative_transfer_characteristics.cfg diff --git a/cfg/sei/ambient_viewing_environment.cfg b/cfg/sei_vui/ambient_viewing_environment.cfg similarity index 100% rename from cfg/sei/ambient_viewing_environment.cfg rename to cfg/sei_vui/ambient_viewing_environment.cfg diff --git a/cfg/sei/content_colour_volume.cfg b/cfg/sei_vui/content_colour_volume.cfg similarity index 100% rename from cfg/sei/content_colour_volume.cfg rename to cfg/sei_vui/content_colour_volume.cfg diff --git a/cfg/sei/content_light_level.cfg b/cfg/sei_vui/content_light_level.cfg similarity index 100% rename from cfg/sei/content_light_level.cfg rename to cfg/sei_vui/content_light_level.cfg diff --git a/cfg/sei/equirectangular.cfg b/cfg/sei_vui/equirectangular.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/equirectangular.cfg rename to cfg/sei_vui/equirectangular.cfg diff --git a/cfg/sei/film_grain_characterstics.cfg b/cfg/sei_vui/film_grain_characterstics.cfg similarity index 100% rename from cfg/sei/film_grain_characterstics.cfg rename to cfg/sei_vui/film_grain_characterstics.cfg diff --git a/cfg/sei/frame_packing.cfg b/cfg/sei_vui/frame_packing.cfg similarity index 100% rename from cfg/sei/frame_packing.cfg rename to cfg/sei_vui/frame_packing.cfg diff --git a/cfg/sei/generalized_cubemap_projection.cfg b/cfg/sei_vui/generalized_cubemap_projection.cfg similarity index 100% rename from cfg/sei/generalized_cubemap_projection.cfg rename to cfg/sei_vui/generalized_cubemap_projection.cfg diff --git a/cfg/sei/mastering_display_colour_volume.cfg b/cfg/sei_vui/mastering_display_colour_volume.cfg similarity index 100% rename from cfg/sei/mastering_display_colour_volume.cfg rename to cfg/sei_vui/mastering_display_colour_volume.cfg diff --git a/cfg/sei/omni_viewport.cfg b/cfg/sei_vui/omni_viewport.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/omni_viewport.cfg rename to cfg/sei_vui/omni_viewport.cfg diff --git a/cfg/sei/region_wise_packing.cfg b/cfg/sei_vui/region_wise_packing.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/region_wise_packing.cfg rename to cfg/sei_vui/region_wise_packing.cfg diff --git a/cfg/sei/sample_aspect_ratio.cfg b/cfg/sei_vui/sample_aspect_ratio.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/sample_aspect_ratio.cfg rename to cfg/sei_vui/sample_aspect_ratio.cfg diff --git a/cfg/sei/sphere_rotation.cfg b/cfg/sei_vui/sphere_rotation.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/sphere_rotation.cfg rename to cfg/sei_vui/sphere_rotation.cfg diff --git a/cfg/sei/subpicture_level.cfg b/cfg/sei_vui/subpicture_level.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/subpicture_level.cfg rename to cfg/sei_vui/subpicture_level.cfg diff --git a/cfg/sei/timing.cfg b/cfg/sei_vui/timing.cfg old mode 100755 new mode 100644 similarity index 100% rename from cfg/sei/timing.cfg rename to cfg/sei_vui/timing.cfg diff --git a/cfg/sei_vui/vui_HD.cfg b/cfg/sei_vui/vui_HD.cfg new file mode 100644 index 0000000000000000000000000000000000000000..6705b1da5f934e0d1d41b4d9bf627a1af0b97073 --- /dev/null +++ b/cfg/sei_vui/vui_HD.cfg @@ -0,0 +1,17 @@ +VuiParametersPresent: 1 // enable VUI +AspectRatioInfoPresent: 1 // enable presence of sample aspect ratio information +AspectRatioIdc: 1 // sample aspect ratio pre-defined types according to Rec. ITU-T H.273 | ISO/IEC 23091-2 +SarWidth: 1 // sample aspect ratio width, if AspectRatioIdc is equal to 255 +SarHeight: 1 // sample aspect ratio height, if AspectRatioIdc is equal to 255 +ColourDescriptionPresent: 1 // enable presence of colour description information +ColourPrimaries: 1 // the source colour primaries according to Rec. ITU-T H.273 | ISO/IEC 23091-2 +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 +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 +ChromaSampleLocType: 0 // the location of chroma sample frame +OverscanInfoPresent: 1 // enable presence of overscan information +OverscanAppropriate: 0 // indicates if the cropped decoded pictures output are suitable for display using overscan + diff --git a/cfg/sei_vui/vui_UHD_PQ.cfg b/cfg/sei_vui/vui_UHD_PQ.cfg new file mode 100644 index 0000000000000000000000000000000000000000..717815029e845436e2f792e9b0d6015c9014e610 --- /dev/null +++ b/cfg/sei_vui/vui_UHD_PQ.cfg @@ -0,0 +1,17 @@ +VuiParametersPresent: 1 // enable VUI +AspectRatioInfoPresent: 1 // enable presence of sample aspect ratio information +AspectRatioIdc: 1 // sample aspect ratio pre-defined types according to Rec. ITU-T H.273 | ISO/IEC 23091-2 +SarWidth: 1 // sample aspect ratio width, if AspectRatioIdc is equal to 255 +SarHeight: 1 // sample aspect ratio height, if AspectRatioIdc is equal to 255 +ColourDescriptionPresent: 1 // enable presence of colour description information +ColourPrimaries: 9 // the source colour primaries according to Rec. ITU-T H.273 | ISO/IEC 23091-2 +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 +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 +ChromaSampleLocType: 2 // the location of chroma sample frame +OverscanInfoPresent: 1 // enable presence of overscan information +OverscanAppropriate: 0 // indicates if the cropped decoded pictures output are suitable for display using overscan + diff --git a/doc/software-manual.tex b/doc/software-manual.tex index 718b22377a0d3085ee02150dc9d4c4c9433a7cb0..b4e332d35f94018b9626b836f1366196d95141ab 100755 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -2450,26 +2450,13 @@ Indicates whether cropped decoded pictures are suitable for display using oversc 1 & Indicates that the decoded pictures may be displayed using overscan. \\ \end{tabular} \\ -\Option{VideoSignalTypePresent} & -\Default{false} & -Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present. -\\ \Option{VideoFormat} & \Default{5} & Indicates representation of pictures. \\ -\Option{VideoFullRange} & -\Default{false} & -Indicates the black level and range of luma and chroma signals. -\par -\begin{tabular}{cp{0.45\textwidth}} - 0 & Indicates that the luma and chroma signals are to be scaled prior to display. \\ - 1 & Indicates that the luma and chroma signals are not to be scaled prior to display. \\ -\end{tabular} -\\ \Option{ColourDescriptionPresent} & \Default{false} & -Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present. +Signals whether colour_primaries, transfer_characteristics, matrix_coefficients and video_full_range_flag are present. \\ \Option{ColourPrimaries} & \Default{2} & @@ -2483,6 +2470,15 @@ Indicates the opto-electronic transfer characteristics of the source. \Default{2} & Describes the matrix coefficients used in deriving luma and chroma from RGB primaries. \\ +\Option{VideoFullRange} & +\Default{false} & +Indicates the black level and range of luma and chroma signals. +\par +\begin{tabular}{cp{0.45\textwidth}} + 0 & Indicates that the luma and chroma signals are to be scaled prior to display. \\ + 1 & Indicates that the luma and chroma signals are not to be scaled prior to display. \\ +\end{tabular} +\\ \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 baf182c6bae220d1c4627111fe1a071bd951f1a6..4cfe47202269f3ce3f171dd45f53dc4341901ea6 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -935,7 +935,6 @@ void EncApp::xInitLibCfg() m_cEncLib.setChromaSampleLocType ( m_chromaSampleLocType ); m_cEncLib.setOverscanInfoPresentFlag ( m_overscanInfoPresentFlag ); m_cEncLib.setOverscanAppropriateFlag ( m_overscanAppropriateFlag ); - m_cEncLib.setVideoSignalTypePresentFlag ( m_videoSignalTypePresentFlag ); m_cEncLib.setVideoFullRangeFlag ( m_videoFullRangeFlag ); m_cEncLib.setEfficientFieldIRAPEnabled ( m_bEfficientFieldIRAPEnabled ); m_cEncLib.setHarmonizeGopFirstFieldCoupleEnabled ( m_bHarmonizeGopFirstFieldCoupleEnabled ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 0a9f80b9ad722c4b2af3803d980c2725fa292ce2..66fd4a471fbdca3072a322fb0f9f4dabdadca242 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1464,7 +1464,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("ChromaSampleLocType", m_chromaSampleLocType, 0, "Specifies the location of chroma samples for progressive content") ("OverscanInfoPresent", m_overscanInfoPresentFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n") ("OverscanAppropriate", m_overscanAppropriateFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n") - ("VideoSignalTypePresent", m_videoSignalTypePresentFlag, false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present") ("VideoFullRange", m_videoFullRangeFlag, false, "Indicates the black level and range of luma and chroma signals"); opts.addOptions() #if HEVC_SEI diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 10c9ab465b4fd5c5d0ebe74f6c03b4272f413f4d..86c38519ffb5da4276f96bc84f7a08046084bd7b 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -792,7 +792,6 @@ protected: int m_chromaSampleLocType; ///< Specifies the location of chroma samples for progressive content bool m_overscanInfoPresentFlag; ///< Signals whether overscan_appropriate_flag is present bool m_overscanAppropriateFlag; ///< Indicates whether conformant decoded pictures are suitable for display using overscan - bool m_videoSignalTypePresentFlag; ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present bool m_videoFullRangeFlag; ///< Indicates the black level and range of luma and chroma signals int m_ImvMode; ///< imv mode int m_Imv4PelFast; ///< imv 4-Pel fast mode diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index a6f28708edc9c4f03c6707923a9c6bc5bb29df06..d9f041f4f52b4290a77c47d0054717e0660ec404 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -909,6 +909,7 @@ class VUI { private: bool m_aspectRatioInfoPresentFlag; + bool m_aspectRatioConstantFlag; int m_aspectRatioIdc; int m_sarWidth; int m_sarHeight; @@ -923,12 +924,12 @@ private: int m_chromaSampleLocType; bool m_overscanInfoPresentFlag; bool m_overscanAppropriateFlag; - bool m_videoSignalTypePresentFlag; bool m_videoFullRangeFlag; public: VUI() : m_aspectRatioInfoPresentFlag (false) //TODO: This initialiser list contains magic numbers + , m_aspectRatioConstantFlag (true) , m_aspectRatioIdc (0) , m_sarWidth (0) , m_sarHeight (0) @@ -943,7 +944,6 @@ public: , m_chromaSampleLocType (0) , m_overscanInfoPresentFlag (false) , m_overscanAppropriateFlag (false) - , m_videoSignalTypePresentFlag (false) , m_videoFullRangeFlag (false) {} @@ -951,6 +951,8 @@ public: bool getAspectRatioInfoPresentFlag() const { return m_aspectRatioInfoPresentFlag; } void setAspectRatioInfoPresentFlag(bool i) { m_aspectRatioInfoPresentFlag = i; } + bool getAspectRatioConstantFlag() const { return m_aspectRatioConstantFlag; } + void setAspectRatioConstantFlag(bool b) { m_aspectRatioConstantFlag = b; } int getAspectRatioIdc() const { return m_aspectRatioIdc; } void setAspectRatioIdc(int i) { m_aspectRatioIdc = i; } @@ -994,9 +996,6 @@ public: bool getOverscanAppropriateFlag() const { return m_overscanAppropriateFlag; } void setOverscanAppropriateFlag(bool i) { m_overscanAppropriateFlag = i; } - bool getVideoSignalTypePresentFlag() const { return m_videoSignalTypePresentFlag; } - void setVideoSignalTypePresentFlag(bool i) { m_videoSignalTypePresentFlag = i; } - bool getVideoFullRangeFlag() const { return m_videoFullRangeFlag; } void setVideoFullRangeFlag(bool i) { m_videoFullRangeFlag = i; } diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index fa19885d26d2f39f6ea88f5b3f5e956763289285..5d0613e5a160595b0953234337644e6bbbd56202 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1313,6 +1313,7 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS) READ_FLAG( symbol, "aspect_ratio_info_present_flag"); pcVUI->setAspectRatioInfoPresentFlag(symbol); if (pcVUI->getAspectRatioInfoPresentFlag()) { + READ_FLAG( symbol, "aspect_ratio_constant_flag"); pcVUI->setAspectRatioConstantFlag(symbol); READ_CODE(8, symbol, "aspect_ratio_idc"); pcVUI->setAspectRatioIdc(symbol); if (pcVUI->getAspectRatioIdc() == 255) { @@ -1327,6 +1328,7 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS) READ_CODE(8, symbol, "colour_primaries"); pcVUI->setColourPrimaries(symbol); READ_CODE(8, symbol, "transfer_characteristics"); pcVUI->setTransferCharacteristics(symbol); READ_CODE(8, symbol, "matrix_coeffs"); pcVUI->setMatrixCoefficients(symbol); + READ_FLAG( symbol, "video_full_range_flag"); pcVUI->setVideoFullRangeFlag(symbol); } READ_FLAG( symbol, "field_seq_flag"); pcVUI->setFieldSeqFlag(symbol); @@ -1350,13 +1352,6 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS) { READ_FLAG( symbol, "overscan_appropriate_flag"); pcVUI->setOverscanAppropriateFlag(symbol); } - - READ_FLAG( symbol, "video_signal_type_present_flag"); pcVUI->setVideoSignalTypePresentFlag(symbol); - if (pcVUI->getVideoSignalTypePresentFlag()) - { - READ_FLAG( symbol, "video_full_range_flag"); pcVUI->setVideoFullRangeFlag(symbol); - } - } void HLSyntaxReader::parseHrdParameters(HRDParameters *hrd, uint32_t firstSubLayer, uint32_t maxNumSubLayersMinus1) diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 47f5b79d55cbe2fe09e1238b15114c082da25193..51c233b9bbc649bde2142fe1d4d412ba95ceba3e 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -836,7 +836,6 @@ protected: int m_chromaSampleLocType; ///< Specifies the location of chroma samples for progressive content bool m_overscanInfoPresentFlag; ///< Signals whether overscan_appropriate_flag is present bool m_overscanAppropriateFlag; ///< Indicates whether conformant decoded pictures are suitable for display using overscan - bool m_videoSignalTypePresentFlag; ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present bool m_videoFullRangeFlag; ///< Indicates the black level and range of luma and chroma signals bool m_bEfficientFieldIRAPEnabled; ///< enable to code fields in a specific, potentially more efficient, order. @@ -2137,8 +2136,6 @@ public: void setOverscanInfoPresentFlag(bool i) { m_overscanInfoPresentFlag = i; } bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } void setOverscanAppropriateFlag(bool i) { m_overscanAppropriateFlag = i; } - bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } - void setVideoSignalTypePresentFlag(bool i) { m_videoSignalTypePresentFlag = i; } bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } void setVideoFullRangeFlag(bool i) { m_videoFullRangeFlag = i; } diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 3c4601098bc66291c5802ebd7110714029583c45..b7d7ddefafb1598b0a76e2880fb5a30a83a81d76 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1679,6 +1679,7 @@ void EncLib::xInitSPS(SPS &sps) { VUI* pcVUI = sps.getVuiParameters(); pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioInfoPresentFlag()); + pcVUI->setAspectRatioConstantFlag(!getSampleAspectRatioInfoSEIEnabled()); pcVUI->setAspectRatioIdc(getAspectRatioIdc()); pcVUI->setSarWidth(getSarWidth()); pcVUI->setSarHeight(getSarHeight()); @@ -1693,7 +1694,6 @@ void EncLib::xInitSPS(SPS &sps) pcVUI->setChromaSampleLocType(getChromaSampleLocType()); pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag()); pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag()); - pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag()); pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag()); } diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 6bdb6490c240133c91f8f4af7543eb54a6743068..b85945f0d1a859c9f114c10d90dceef2632304e0 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -803,6 +803,7 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS ) WRITE_FLAG(pcVUI->getAspectRatioInfoPresentFlag(), "aspect_ratio_info_present_flag"); if (pcVUI->getAspectRatioInfoPresentFlag()) { + WRITE_FLAG(pcVUI->getAspectRatioConstantFlag(), "aspect_ratio_constant_flag"); WRITE_CODE(pcVUI->getAspectRatioIdc(), 8, "aspect_ratio_idc" ); if (pcVUI->getAspectRatioIdc() == 255) { @@ -816,6 +817,7 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS ) WRITE_CODE(pcVUI->getColourPrimaries(), 8, "colour_primaries"); WRITE_CODE(pcVUI->getTransferCharacteristics(), 8, "transfer_characteristics"); WRITE_CODE(pcVUI->getMatrixCoefficients(), 8, "matrix_coeffs"); + WRITE_FLAG(pcVUI->getVideoFullRangeFlag(), "video_full_range_flag"); } WRITE_FLAG(pcVUI->getFieldSeqFlag(), "field_seq_flag"); WRITE_FLAG(pcVUI->getChromaLocInfoPresentFlag(), "chroma_loc_info_present_flag"); @@ -836,12 +838,6 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS ) { WRITE_FLAG(pcVUI->getOverscanAppropriateFlag(), "overscan_appropriate_flag"); } - WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(), "video_signal_type_present_flag"); - if (pcVUI->getVideoSignalTypePresentFlag()) - { - WRITE_FLAG(pcVUI->getVideoFullRangeFlag(), "video_full_range_flag"); - } - } void HLSWriter::codeHrdParameters( const HRDParameters *hrd, const uint32_t firstSubLayer, const uint32_t maxNumSubLayersMinus1)