diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 01c3d6262bae007a1b2a596c69f3f00111dfb788..d847bba2175ece99b10f1d64e102aa033db79d45 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -266,10 +266,8 @@ void EncApp::xInitLibCfg( int layerIdx ) m_confWinRight / SPS::getWinUnitX(m_inputChromaFormatIDC), m_confWinTop / SPS::getWinUnitY(m_inputChromaFormatIDC), m_confWinBottom / SPS::getWinUnitY(m_inputChromaFormatIDC)); -#if JVET_AE0181_SCALING_WINDOW_ENABLED m_cEncLib.setExplicitScalingWindowEnabled ( m_explicitScalingWindowEnabled ); m_cEncLib.setScalingWindow ( m_scalWinLeft / SPS::getWinUnitX( m_inputChromaFormatIDC ), m_scalWinRight / SPS::getWinUnitX( m_inputChromaFormatIDC ), m_scalWinTop / SPS::getWinUnitY( m_inputChromaFormatIDC ), m_scalWinBottom / SPS::getWinUnitY( m_inputChromaFormatIDC ) ); -#endif m_cEncLib.setScalingRatio ( m_scalingRatioHor, m_scalingRatioVer ); m_cEncLib.setGOPBasedRPREnabledFlag (m_gopBasedRPREnabledFlag); m_cEncLib.setGOPBasedRPRQPThreshold (m_gopBasedRPRQPThreshold); @@ -1921,11 +1919,7 @@ void EncApp::xWriteOutput(int numEncoded, std::list<PelUnitBuf *> &recBufList) } else { -#if JVET_AE0181_SCALING_WINDOW_ENABLED ppsID = ((sps.getMaxPicWidthInLumaSamples() != pcPicYuvRec->get(COMPONENT_Y).width || sps.getMaxPicHeightInLumaSamples() != pcPicYuvRec->get(COMPONENT_Y).height) && !m_explicitScalingWindowEnabled) ? m_resChangeInClvsEnabled ? (ENC_PPS_ID_RPR + layerId) : layerId : layerId; -#else - ppsID = (sps.getMaxPicWidthInLumaSamples() != pcPicYuvRec->get(COMPONENT_Y).width || sps.getMaxPicHeightInLumaSamples() != pcPicYuvRec->get(COMPONENT_Y).height) ? (ENC_PPS_ID_RPR + layerId) : layerId; -#endif } const PPS& pps = *m_cEncLib.getPPS(ppsID); if( m_cEncLib.isResChangeInClvsEnabled() && m_cEncLib.getUpscaledOutput() ) diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index df00b6e2127d8f650cc8e42a06471ff47bd4ec70..0fc0dc5f87522b142ae1907c7e5d3961cf4532df 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -815,13 +815,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3") ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") -#if JVET_AE0181_SCALING_WINDOW_ENABLED ("ScalingWindow", m_explicitScalingWindowEnabled, false, "Enable scaling window") ("ScalWinLeft,-swl", m_scalWinLeft, 0, "Left offset for scaling window") ("ScalWinRight,-swr", m_scalWinRight, 0, "Right offset for scaling window") ("ScalWinTop,-swt", m_scalWinTop, 0, "Top offset for scaling window") ("ScalWinBottom,-swb", m_scalWinBottom, 0, "Bottom offset for scaling window") -#endif ("AccessUnitDelimiter", m_AccessUnitDelimiter, false, "Enable Access Unit Delimiter NALUs") ("EnablePictureHeaderInSliceHeader", m_enablePictureHeaderInSliceHeader, true, "Enable Picture Header in Slice Header") ("FrameRate,-fr", frameRate, std::to_string(0), "Frame rate") @@ -4248,7 +4246,6 @@ bool EncAppCfg::xCheckParameter() "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); xConfirmPara(m_confWinBottom % SPS::getWinUnitY(m_chromaFormatIdc) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); -#if JVET_AE0181_SCALING_WINDOW_ENABLED xConfirmPara(m_explicitScalingWindowEnabled && (m_scalingRatioHor != 1.0 || m_scalingRatioVer != 1.0 || m_gopBasedRPREnabledFlag), "ScalingWindow cannot be enabled when GOPBasedRPR is enabled"); xConfirmPara(m_scalWinLeft % SPS::getWinUnitX(m_chromaFormatIdc) != 0, "Left scaling window offset must be an integer multiple of the specified chroma subsampling"); xConfirmPara(m_scalWinRight % SPS::getWinUnitX(m_chromaFormatIdc) != 0, "Right scaling window offset must be an integer multiple of the specified chroma subsampling"); @@ -4266,7 +4263,6 @@ bool EncAppCfg::xCheckParameter() "The values of SubWidthC * (pps_scaling_win_left_offset + pps_scaling_win_right_offset) shall be greater than or equal to -pps_pic_width_in_luma_samples * 15 and less than pps_pic_width_in_luma_samples"); xConfirmPara(((m_scalWinTop+m_scalWinBottom) < -m_sourceHeight * 15) || ((m_scalWinTop+m_scalWinBottom) >= m_sourceHeight), "The values of SubHeightC * (pps_scaling_win_top_offset + pps_scaling_win_bottom_offset) shall be greater than or equal to -pps_pic_height_in_luma_samples * 15 and less than pps_pic_height_in_luma_samples"); -#endif // max CU width and height should be power of 2 diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 2527f72a56289fd85a70be8752392fa0700b8072..2f9717861d4d41d2b4634ca07ecd7fa7fdd20ebd 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -111,13 +111,11 @@ protected: int m_confWinRight; int m_confWinTop; int m_confWinBottom; -#if JVET_AE0181_SCALING_WINDOW_ENABLED bool m_explicitScalingWindowEnabled; int m_scalWinLeft; int m_scalWinRight; int m_scalWinTop; int m_scalWinBottom; -#endif int m_sourcePadding[2]; ///< number of padded pixels for width and height int m_firstValidFrame; int m_lastValidFrame; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 206e6bb760dcd7a9fd90834fdef52d0b13d45a28..23e45099a829925a9af8bbdeeb392ae415636e47 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -73,7 +73,6 @@ -#define JVET_AE0181_SCALING_WINDOW_ENABLED 1 // JVET-AE0181: Scaling window support #define JVET_AE0134_END_REPEATED_INFERENCE 1 // JVET_AE0134 item 2: At the end of a bitstream or CLVS, add repeated inference of NNPF for creating pictures corresponding to input pictures diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index 11e0ca47597d86b03c3fda5e802ba338fcd96524..fd0f88cd0ea4ebadf216b66a3802be5c72072363 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -161,10 +161,8 @@ protected: int m_sourceWidth; int m_sourceHeight; Window m_conformanceWindow; -#if JVET_AE0181_SCALING_WINDOW_ENABLED bool m_explicitScalingWindowEnabled; Window m_scalingWindow; -#endif int m_sourcePadding[2]; int m_framesToBeEncoded; int m_firstValidFrame; @@ -1216,10 +1214,8 @@ public: Window &getConformanceWindow() { return m_conformanceWindow; } void setConformanceWindow (int confLeft, int confRight, int confTop, int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); } -#if JVET_AE0181_SCALING_WINDOW_ENABLED void setExplicitScalingWindowEnabled(bool enabled) { m_explicitScalingWindowEnabled = enabled; } void setScalingWindow (int scalingLeft, int scalingRight, int scalingTop, int scalingBottom ) { m_scalingWindow.setWindow (scalingLeft, scalingRight, scalingTop, scalingBottom); } -#endif void setFramesToBeEncoded ( int i ) { m_framesToBeEncoded = i; } diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index f919c72afe58df71cdeaccca5125aaa5a0ee648d..ac09801999a8f248cf9c677b12dcdb8503bdb390 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -199,13 +199,11 @@ void EncLib::init(AUWriterIf *auWriterIf) pps0.setConformanceWindow( m_conformanceWindow ); pps0.setConformanceWindowFlag( m_conformanceWindow.getWindowEnabledFlag() ); } -#if JVET_AE0181_SCALING_WINDOW_ENABLED if (m_explicitScalingWindowEnabled) { pps0.setExplicitScalingWindowFlag(true); pps0.setScalingWindow(m_scalingWindow); } -#endif if (!pps0.getExplicitScalingWindowFlag()) { pps0.setScalingWindow(pps0.getConformanceWindow()); @@ -1391,7 +1389,6 @@ void EncLib::xInitSPS( SPS& sps ) sps.setMaxPicWidthInLumaSamples( m_sourceWidth ); sps.setMaxPicHeightInLumaSamples( m_sourceHeight ); -#if JVET_AE0181_SCALING_WINDOW_ENABLED bool scalingWindowResChanged = false; if (m_multiLayerEnabledFlag && m_vps->getMaxLayers() > 0) { @@ -1441,7 +1438,6 @@ void EncLib::xInitSPS( SPS& sps ) sps.setMaxPicWidthInLumaSamples(maxPicWidth); sps.setMaxPicHeightInLumaSamples(maxPicHeight); } -#endif if (m_resChangeInClvsEnabled) { @@ -1730,13 +1726,8 @@ void EncLib::xInitSPS( SPS& sps ) sps.setInterLayerPresentFlag( m_layerId > 0 && m_vps->getMaxLayers() > 1 && !m_vps->getAllIndependentLayersFlag() && !m_vps->getIndependentLayerFlag( m_vps->getGeneralLayerIdx( m_layerId ) ) ); CHECK( m_vps->getIndependentLayerFlag( m_vps->getGeneralLayerIdx( m_layerId ) ) && sps.getInterLayerPresentFlag(), " When vps_independent_layer_flag[GeneralLayerIdx[nuh_layer_id ]] is equal to 1, the value of inter_layer_ref_pics_present_flag shall be equal to 0." ); -#if JVET_AE0181_SCALING_WINDOW_ENABLED sps.setResChangeInClvsEnabledFlag(m_resChangeInClvsEnabled || m_constrainedRaslEncoding || scalingWindowResChanged); sps.setRprEnabledFlag(m_rprEnabledFlag || m_explicitScalingWindowEnabled || scalingWindowResChanged); -#else - sps.setResChangeInClvsEnabledFlag(m_resChangeInClvsEnabled || m_constrainedRaslEncoding); - sps.setRprEnabledFlag(m_rprEnabledFlag); -#endif sps.setGOPBasedRPREnabledFlag(m_gopBasedRPREnabledFlag); sps.setLog2ParallelMergeLevelMinus2( m_log2ParallelMergeLevelMinus2 );