diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index b6ba6b484544a89012b608fecc234c1132511289..1462cbba5fe6e545eccb46718b945991d7011fa7 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -1032,8 +1032,9 @@ void EncApp::xInitLibCfg() m_cEncLib.setOverscanInfoPresentFlag ( m_overscanInfoPresentFlag ); m_cEncLib.setOverscanAppropriateFlag ( m_overscanAppropriateFlag ); m_cEncLib.setVideoFullRangeFlag ( m_videoFullRangeFlag ); - m_cEncLib.setEfficientFieldIRAPEnabled ( m_bEfficientFieldIRAPEnabled ); - m_cEncLib.setHarmonizeGopFirstFieldCoupleEnabled ( m_bHarmonizeGopFirstFieldCoupleEnabled ); + m_cEncLib.setFieldSeqFlag ( m_isField ); + m_cEncLib.setEfficientFieldIRAPEnabled ( m_efficientFieldIRAPEnabled ); + m_cEncLib.setHarmonizeGopFirstFieldCoupleEnabled ( m_harmonizeGopFirstFieldCoupleEnabled ); m_cEncLib.setSummaryOutFilename ( m_summaryOutFilename ); m_cEncLib.setSummaryPicFilenameBase ( m_summaryPicFilenameBase ); m_cEncLib.setSummaryVerboseness ( m_summaryVerboseness ); @@ -1167,9 +1168,9 @@ void EncApp::xDestroyLib() m_cEncLib.destroy(); } -void EncApp::xInitLib(bool isFieldCoding) +void EncApp::xInitLib() { - m_cEncLib.init(isFieldCoding, this ); + m_cEncLib.init(this); } // ==================================================================================================================== @@ -1204,7 +1205,7 @@ void EncApp::createLib( const int layerIdx ) xInitLibCfg(); const int layerId = m_cEncLib.getVPS() == nullptr ? 0 : m_cEncLib.getVPS()->getLayerId( layerIdx ); xCreateLib( m_recBufList, layerId ); - xInitLib( m_isField ); + xInitLib(); printChromaFormat(); diff --git a/source/App/EncoderApp/EncApp.h b/source/App/EncoderApp/EncApp.h index b86fad50d71db3f9d9ef0ecbda207a2e39142e38..93323155cbd315d53df070b81d48de64bbf6ae3d 100644 --- a/source/App/EncoderApp/EncApp.h +++ b/source/App/EncoderApp/EncApp.h @@ -83,7 +83,7 @@ private: // initialization void xCreateLib( std::list<PelUnitBuf*>& recBufList, const int layerId ); ///< create files & encoder class void xInitLibCfg (); ///< initialize internal variables - void xInitLib (bool isFieldCoding); ///< initialize encoder class + void xInitLib(); ///< initialize encoder class void xDestroyLib (); ///< destroy encoder class // file I/O diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index cc76095dd27b3b151944e172619e8e5fc4d951fc..577780e1dd51a9b9df77b8cd91115d9fbe474739 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -787,8 +787,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) //Field coding parameters ("FieldCoding", m_isField, false, "Signals if it's a field based coding") ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") - ("EfficientFieldIRAPEnabled", m_bEfficientFieldIRAPEnabled, true, "Enable to code fields in a specific, potentially more efficient, order.") - ("HarmonizeGopFirstFieldCoupleEnabled", m_bHarmonizeGopFirstFieldCoupleEnabled, true, "Enables harmonization of Gop first field couple") + ("EfficientFieldIRAPEnabled", m_efficientFieldIRAPEnabled, true, "Enable to code fields in a specific, potentially more efficient, order.") + ("HarmonizeGopFirstFieldCoupleEnabled", m_harmonizeGopFirstFieldCoupleEnabled, true, "Enables harmonization of Gop first field couple") // Profile and level ("Profile", extendedProfile, ExtendedProfileName::NONE, "Profile name to use for encoding. Use [multilayer_]main_10[_444][_still_picture], auto, or none") diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 6942f34e25f8c512fda6ab55d0aff500dd194c65..3639ba968b29cc2def6a3c98ef9629115dd73b83 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -105,8 +105,8 @@ protected: bool m_isField; ///< enable field coding bool m_isTopFieldFirst; - bool m_bEfficientFieldIRAPEnabled; ///< enable an efficient field IRAP structure. - bool m_bHarmonizeGopFirstFieldCoupleEnabled; + bool m_efficientFieldIRAPEnabled; ///< enable an efficient field IRAP structure. + bool m_harmonizeGopFirstFieldCoupleEnabled; int m_conformanceWindowMode; int m_confWinLeft; diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 97ad53f857db5ca7f822cd48bad4adad67cd8caf..48a582c3c8709c6fa896918f71ef805387fa9ddc 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -724,8 +724,9 @@ protected: bool m_overscanAppropriateFlag; ///< Indicates whether conformant decoded pictures are suitable for display using overscan 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. - bool m_bHarmonizeGopFirstFieldCoupleEnabled; + bool m_fieldSeqFlag; + bool m_efficientFieldIRAPEnabled; /// enable to code fields in a specific, potentially more efficient, order. + bool m_harmonizeGopFirstFieldCoupleEnabled; std::string m_summaryOutFilename; ///< filename to use for producing summary output file. std::string m_summaryPicFilenameBase; ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended. @@ -1835,11 +1836,14 @@ public: void setUseRecalculateQPAccordingToLambda (bool b) { m_recalculateQPAccordingToLambda = b; } bool getUseRecalculateQPAccordingToLambda () { return m_recalculateQPAccordingToLambda; } - void setEfficientFieldIRAPEnabled( bool b ) { m_bEfficientFieldIRAPEnabled = b; } - bool getEfficientFieldIRAPEnabled( ) const { return m_bEfficientFieldIRAPEnabled; } + void setFieldSeqFlag(const bool b) { m_fieldSeqFlag = b; } + bool getFieldSeqFlag() const { return m_fieldSeqFlag; } - void setHarmonizeGopFirstFieldCoupleEnabled( bool b ) { m_bHarmonizeGopFirstFieldCoupleEnabled = b; } - bool getHarmonizeGopFirstFieldCoupleEnabled( ) const { return m_bHarmonizeGopFirstFieldCoupleEnabled; } + void setEfficientFieldIRAPEnabled(const bool b) { m_efficientFieldIRAPEnabled = b; } + bool getEfficientFieldIRAPEnabled() const { return m_efficientFieldIRAPEnabled; } + + void setHarmonizeGopFirstFieldCoupleEnabled(const bool b) { m_harmonizeGopFirstFieldCoupleEnabled = b; } + bool getHarmonizeGopFirstFieldCoupleEnabled() const { return m_harmonizeGopFirstFieldCoupleEnabled; } bool getOPIEnabled() { return m_OPIEnabled; } void setOPIEnabled(bool i) { m_OPIEnabled = i; } diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index 26e60df36975b805ca0823ce18ed144e2bc44bfa..06607866a729df46835c3d7f048adc1ee38b0124 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -144,7 +144,7 @@ void EncLib::destroy () return; } -void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) +void EncLib::init(AUWriterIf *auWriterIf) { m_AUWriterIf = auWriterIf; @@ -198,7 +198,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf ) } xInitPPS(pps0, sps0); // initialize APS - xInitRPL(sps0, isFieldCoding); + xInitRPL(sps0); if (m_resChangeInClvsEnabled) { @@ -1283,7 +1283,7 @@ void EncLib::xInitSPS( SPS& sps ) } sps.setALFEnabledFlag( m_alf ); sps.setCCALFEnabledFlag( m_ccalf ); - sps.setFieldSeqFlag(false); + sps.setFieldSeqFlag(m_fieldSeqFlag); sps.setVuiParametersPresentFlag(getVuiParametersPresentFlag()); if (sps.getVuiParametersPresentFlag()) @@ -1855,9 +1855,10 @@ void EncLib::xInitAPS(APS &aps) //Do nothing now } -void EncLib::xInitRPL(SPS &sps, bool isFieldCoding) +void EncLib::xInitRPL(SPS &sps) { ReferencePictureList* rpl; + const bool isFieldCoding = sps.getFieldSeqFlag(); int numRPLCandidates = getRPLCandidateSize(0); // To allocate one additional memory for RPL of POC1 (first bottom field) which is not specified in cfg file diff --git a/source/Lib/EncoderLib/EncLib.h b/source/Lib/EncoderLib/EncLib.h index 1c05ed00bbfa81c97a8f9cf4d91112783c011bac..5808f9de5e04a3b1beee637ac291d1475dce3c44 100644 --- a/source/Lib/EncoderLib/EncLib.h +++ b/source/Lib/EncoderLib/EncLib.h @@ -148,7 +148,7 @@ protected: void xInitPPSforLT(PPS& pps); void xInitHrdParameters(SPS &sps); ///< initialize HRDParameters parameters - void xInitRPL(SPS &sps, bool isFieldCoding); ///< initialize SPS from encoder options + void xInitRPL(SPS &sps); ///< initialize SPS from encoder options public: EncLib( EncLibCommon* encLibCommon ); @@ -156,7 +156,7 @@ public: void create ( const int layerId ); void destroy (); - void init ( bool isFieldCoding, AUWriterIf* auWriterIf ); + void init(AUWriterIf *auWriterIf); void deletePicBuffer (); // -------------------------------------------------------------------------------------------------------------------