From 603a8a4a05ccfa39a8ed0883566ec71179d376a6 Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Sun, 26 Apr 2020 20:09:32 +0200
Subject: [PATCH] remove macro JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS

---
 source/App/EncoderApp/EncAppCfg.cpp | 16 ----------------
 source/Lib/CommonLib/Slice.h        |  4 ----
 source/Lib/CommonLib/TypeDef.h      |  1 -
 source/Lib/DecoderLib/DecLib.cpp    |  2 --
 source/Lib/DecoderLib/VLCReader.cpp | 14 --------------
 source/Lib/EncoderLib/EncLib.cpp    |  2 --
 source/Lib/EncoderLib/VLCWriter.cpp | 13 -------------
 7 files changed, 52 deletions(-)

diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index e187fbdb7..4f3bbc68a 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -1810,14 +1810,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   m_inputColourSpaceConvert = stringToInputColourSpaceConvert(inputColourSpaceConvert, true);
   m_rgbFormat = (m_inputColourSpaceConvert == IPCOLOURSPACE_RGBtoGBR && m_chromaFormatIDC == CHROMA_444) ? true : false;
 
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   // Picture width and height must be multiples of 8 and minCuSize
   const int minResolutionMultiple = std::max(8, 1 << m_log2MinCuSize);
   CHECK(((m_iSourceWidth% minResolutionMultiple) || (m_iSourceHeight % minResolutionMultiple)) && m_conformanceWindowMode != 1, "Picture width or height is not a multiple of 8 or minCuSize, please use ConformanceMode 1!");
-#else
-  const int minCuSize = 1 << m_log2MinCuSize;
-  CHECK(((m_iSourceWidth % minCuSize ) || (m_iSourceHeight % minCuSize )) && m_conformanceWindowMode != 1, "Picture width or height is not a multiple of minCuSize, please use ConformanceMode 1!");
-#endif
   switch (m_conformanceWindowMode)
   {
   case 0:
@@ -1830,7 +1825,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   case 1:
     {
       // automatic padding to minimum CU size
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
       if (m_iSourceWidth % minResolutionMultiple)
       {
         m_aiPad[0] = m_confWinRight  = ((m_iSourceWidth / minResolutionMultiple) + 1) * minResolutionMultiple - m_iSourceWidth;
@@ -1839,16 +1833,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
       if (m_iSourceHeight % minResolutionMultiple)
       {
         m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minResolutionMultiple) + 1) * minResolutionMultiple - m_iSourceHeight;
-#else
-      if (m_iSourceWidth % minCuSize)
-      {
-        m_aiPad[0] = m_confWinRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
-        m_iSourceWidth  += m_confWinRight;
-      }
-      if (m_iSourceHeight % minCuSize)
-      {
-        m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
-#endif
         m_iSourceHeight += m_confWinBottom;
         if ( m_isField )
         {
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 348fbdd28..46f70b34c 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -1307,9 +1307,7 @@ private:
   // Structure
   uint32_t              m_maxWidthInLumaSamples;
   uint32_t              m_maxHeightInLumaSamples;
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   Window                m_conformanceWindow;
-#endif
 #if JVET_Q0119_CLEANUPS
   bool                  m_subPicInfoPresentFlag;                // indicates the presence of sub-picture info
 #else
@@ -1515,11 +1513,9 @@ public:
   uint32_t                getMaxPicWidthInLumaSamples() const                                             { return  m_maxWidthInLumaSamples; }
   void                    setMaxPicHeightInLumaSamples( uint32_t u )                                      { m_maxHeightInLumaSamples = u; }
   uint32_t                getMaxPicHeightInLumaSamples() const                                            { return  m_maxHeightInLumaSamples; }
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   Window&                 getConformanceWindow()                                                          { return  m_conformanceWindow; }
   const Window&           getConformanceWindow() const                                                    { return  m_conformanceWindow; }
   void                    setConformanceWindow( Window& conformanceWindow )                               { m_conformanceWindow = conformanceWindow; }
-#endif
 
 #if JVET_Q0119_CLEANUPS
   void      setSubPicInfoPresentFlag(bool b)                                                { m_subPicInfoPresentFlag = b;            }
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index cc40ae108..87cf4bc23 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -80,7 +80,6 @@
 
 
 
-#define JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS              1 // JVET-Q0260: Conformance cropping window in the SPS that applies to the max picture size
 
 #define JVET_Q0210_UEK_REMOVAL                            1 // JVET-Q0210 Aspect 8: Replace uek signalling in alf_data with ue(v).
 
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 4aceff7a1..ed52f3be2 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -1528,7 +1528,6 @@ void DecLib::xCheckParameterSetConstraints(const int layerId)
   }
 #endif
 
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   if (sps->getMaxPicWidthInLumaSamples() == pps->getPicWidthInLumaSamples() &&
       sps->getMaxPicHeightInLumaSamples() == pps->getPicHeightInLumaSamples())
   {
@@ -1539,7 +1538,6 @@ void DecLib::xCheckParameterSetConstraints(const int layerId)
     CHECK(spsConfWin.getWindowTopOffset() != ppsConfWin.getWindowTopOffset(), "When picture size is equal to maximum picutre size, conformance window top offset in SPS and PPS shall be equal");
     CHECK(spsConfWin.getWindowBottomOffset() != ppsConfWin.getWindowBottomOffset(), "When picture size is equal to maximum picutre size, conformance window bottom offset in SPS and PPS shall be equal");
   }
-#endif
   int levelIdcSps = int(sps->getProfileTierLevel()->getLevelIdc());
   int maxLevelIdxDci = 0;
   if (m_dci)
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 65ba8a49b..90705f384 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -431,7 +431,6 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
 
   READ_UVLC( uiCode, "pic_width_in_luma_samples" );          pcPPS->setPicWidthInLumaSamples( uiCode );
   READ_UVLC( uiCode, "pic_height_in_luma_samples" );         pcPPS->setPicHeightInLumaSamples( uiCode );
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   READ_FLAG(uiCode, "pps_conformance_window_flag");
   if (uiCode != 0)
   {
@@ -441,17 +440,6 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
     READ_UVLC(uiCode, "pps_conf_win_top_offset");                conf.setWindowTopOffset(uiCode);
     READ_UVLC(uiCode, "pps_conf_win_bottom_offset");             conf.setWindowBottomOffset(uiCode);
   }
-#else
-  READ_FLAG( uiCode, "conformance_window_flag" );
-  if( uiCode != 0 )
-  {
-    Window &conf = pcPPS->getConformanceWindow();
-    READ_UVLC( uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset( uiCode );
-    READ_UVLC( uiCode, "conf_win_right_offset" );              conf.setWindowRightOffset( uiCode );
-    READ_UVLC( uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset( uiCode );
-    READ_UVLC( uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode );
-  }
-#endif
   READ_FLAG( uiCode, "scaling_window_flag" );
   if( uiCode != 0 )
   {
@@ -1461,7 +1449,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 
   READ_UVLC( uiCode, "pic_width_max_in_luma_samples" );          pcSPS->setMaxPicWidthInLumaSamples( uiCode );
   READ_UVLC( uiCode, "pic_height_max_in_luma_samples" );         pcSPS->setMaxPicHeightInLumaSamples( uiCode );
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   READ_FLAG(uiCode, "sps_conformance_window_flag");
   if (uiCode != 0)
   {
@@ -1471,7 +1458,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
     READ_UVLC(uiCode, "sps_conf_win_top_offset");                conf.setWindowTopOffset(uiCode);
     READ_UVLC(uiCode, "sps_conf_win_bottom_offset");             conf.setWindowBottomOffset(uiCode);
   }
-#endif
 #if JVET_Q0265
   const uint32_t chromaArrayType = (int) pcSPS->getSeparateColourPlaneFlag() ? 0 : pcSPS->getChromaFormatIdc();
 #endif
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index f01f6fe1a..2e401b227 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -1237,9 +1237,7 @@ void EncLib::xInitSPS( SPS& sps, VPS& vps )
     sps.setMaxPicWidthInLumaSamples( maxPicWidth );
     sps.setMaxPicHeightInLumaSamples( maxPicHeight );
   }
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   sps.setConformanceWindow( m_conformanceWindow );
-#endif
 
   sps.setMaxCUWidth             ( m_maxCUWidth        );
   sps.setMaxCUHeight            ( m_maxCUHeight       );
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 9ba8ed0c4..d3abed421 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -264,7 +264,6 @@ void HLSWriter::codePPS( const PPS* pcPPS )
   WRITE_UVLC( pcPPS->getPicWidthInLumaSamples(), "pic_width_in_luma_samples" );
   WRITE_UVLC( pcPPS->getPicHeightInLumaSamples(), "pic_height_in_luma_samples" );
   Window conf = pcPPS->getConformanceWindow();
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   WRITE_FLAG(conf.getWindowEnabledFlag(), "pps_conformance_window_flag");
   if (conf.getWindowEnabledFlag())
   {
@@ -273,16 +272,6 @@ void HLSWriter::codePPS( const PPS* pcPPS )
     WRITE_UVLC(conf.getWindowTopOffset(), "pps_conf_win_top_offset");
     WRITE_UVLC(conf.getWindowBottomOffset(), "pps_conf_win_bottom_offset");
   }
-#else
-  WRITE_FLAG( conf.getWindowEnabledFlag(), "conformance_window_flag" );
-  if( conf.getWindowEnabledFlag() )
-  {
-    WRITE_UVLC( conf.getWindowLeftOffset(),   "conf_win_left_offset" );
-    WRITE_UVLC( conf.getWindowRightOffset(),  "conf_win_right_offset" );
-    WRITE_UVLC( conf.getWindowTopOffset(),    "conf_win_top_offset" );
-    WRITE_UVLC( conf.getWindowBottomOffset(), "conf_win_bottom_offset" );
-  }
-#endif
   Window scalingWindow = pcPPS->getScalingWindow();
 
   WRITE_FLAG( scalingWindow.getWindowEnabledFlag(), "scaling_window_flag" );
@@ -955,7 +944,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
 
   WRITE_UVLC( pcSPS->getMaxPicWidthInLumaSamples(), "pic_width_max_in_luma_samples" );
   WRITE_UVLC( pcSPS->getMaxPicHeightInLumaSamples(), "pic_height_max_in_luma_samples" );
-#if JVET_Q0260_CONFORMANCE_WINDOW_IN_SPS
   Window conf = pcSPS->getConformanceWindow();
   WRITE_FLAG(conf.getWindowEnabledFlag(), "sps_conformance_window_flag");
   if (conf.getWindowEnabledFlag())
@@ -966,7 +954,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
     WRITE_UVLC(conf.getWindowBottomOffset(), "sps_conf_win_bottom_offset");
   }
 
-#endif
   WRITE_CODE(floorLog2(pcSPS->getCTUSize()) - 5, 2, "sps_log2_ctu_size_minus5");
 
 #if JVET_Q0043_RPR_and_Subpics | JVET_Q0119_CLEANUPS
-- 
GitLab