diff --git a/doc/software-manual.tex b/doc/software-manual.tex index 4a412c8691851a40be5c6578161f0fe1e66fedc7..f0f4e89d0ed2a0f304e2c97872bd2a21d8a5c782 100644 --- a/doc/software-manual.tex +++ b/doc/software-manual.tex @@ -3748,6 +3748,10 @@ If enabled, causes the encoder to not encode any frame after the frame specified %% VUI parameters %% \begin{OptionTableNoShorthand}{VUI parameters}{tab:VUI} +\Option{WriteVuiHrdFromY4m} & +\Default{true} & +Allow writing VUI and HRD information from input Y4M file. +\\ \Option{VuiParametersPresent (-vui)} & \Default{false} & Enable generation of vui_parameters(). diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index bca4c69f2847a8eca782fe3b34dfc04ffea122e9..16e3ef92d6a18cd7b5bfac083f4863ea6de79702 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -1657,7 +1657,7 @@ void EncApp::createLib( const int layerIdx ) } } - if (isY4mFileExt(m_inputFileName)) + if (isY4mFileExt(m_inputFileName) && m_writeVuiHrdFromY4m) { // Force signalling of HRD parameters to carry frame rate information m_hrdParametersPresentFlag = true; diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 9848f1ab35ddc87c8306e9b973427470a9fb17ca..5303a8c630e0b1da6b15a7204354c0585f3717e4 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1322,6 +1322,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case") ("HrdParametersPresent,-hrd", m_hrdParametersPresentFlag, false, "Enable generation of hrd_parameters()") ("VuiParametersPresent,-vui", m_vuiParametersPresentFlag, false, "Enable generation of vui_parameters()") + ("WriteVuiHrdFromY4m", m_writeVuiHrdFromY4m, true, "Allow writing VUI and HRD information from input Y4M file") ("SamePicTimingInAllOLS", m_samePicTimingInAllOLS, true, "Indicates that the same picture timing SEI message is used in all OLS") ("AspectRatioInfoPresent", m_aspectRatioInfoPresentFlag, false, "Signals whether aspect_ratio_idc is present") ("AspectRatioIdc", m_aspectRatioIdc, 0, "aspect_ratio_idc") @@ -2581,11 +2582,15 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) m_inputBitDepth.fill(inputBitDepth); m_chromaFormatIdc = chromaFormat; m_msbExtendedBitDepth = m_inputBitDepth; - m_chromaSampleLocType = locType; + if (m_writeVuiHrdFromY4m) + { + m_chromaSampleLocType = locType; + } } m_progressiveSourceFlag = true; // TODO: update when processing of interlaced y4m files is supported - if (m_chromaFormatIdc == ChromaFormat::_420 && m_chromaSampleLocType != Chroma420LocType::UNSPECIFIED) + if (m_chromaFormatIdc == ChromaFormat::_420 && m_chromaSampleLocType != Chroma420LocType::UNSPECIFIED + && m_writeVuiHrdFromY4m) { m_chromaLocInfoPresentFlag = true; m_vuiParametersPresentFlag = true; diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index b7b62df2b986a1684bd0be9a99ada67f52b75c42..837d0fe88286fb9c7d23ed3ffb5bc633d59fa213 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -900,6 +900,7 @@ protected: bool m_DCIEnabled; ///< enable Decoding Capability Information (DCI) bool m_hrdParametersPresentFlag; ///< enable generation of HRD parameters bool m_vuiParametersPresentFlag; ///< enable generation of VUI parameters + bool m_writeVuiHrdFromY4m; ///< allow writing VUI and HRD information from input Y4M file bool m_samePicTimingInAllOLS; ///< same picture timing SEI message is used in all OLS bool m_aspectRatioInfoPresentFlag; ///< Signals whether aspect_ratio_idc is present int m_aspectRatioIdc; ///< aspect_ratio_idc