From cf7d892f53fe17ce910b7c85c8c0cf023c359ac2 Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Sun, 26 Apr 2020 20:12:56 +0200
Subject: [PATCH] remove macro JVET_SUBPIC_LEVEL_CFG

---
 source/App/EncoderApp/EncApp.cpp     |  4 ----
 source/App/EncoderApp/EncAppCfg.cpp  |  8 --------
 source/App/EncoderApp/EncAppCfg.h    |  4 ----
 source/Lib/CommonLib/TypeDef.h       |  1 -
 source/Lib/EncoderLib/EncCfg.h       |  9 ---------
 source/Lib/EncoderLib/EncCfgParam.h  |  2 --
 source/Lib/EncoderLib/EncGOP.cpp     |  4 ----
 source/Lib/EncoderLib/SEIEncoder.cpp | 14 --------------
 8 files changed, 46 deletions(-)

diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index fdd7984c8d..131177562e 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -672,11 +672,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setGcmpSEIGuardBandType                              ( m_gcmpSEIGuardBandType );
   m_cEncLib.setGcmpSEIGuardBandBoundaryExteriorFlag              ( m_gcmpSEIGuardBandBoundaryExteriorFlag );
   m_cEncLib.setGcmpSEIGuardBandSamplesMinus1                     ( (uint8_t)m_gcmpSEIGuardBandSamplesMinus1 );
-#if JVET_SUBPIC_LEVEL_CFG
   m_cEncLib.setSubpicureLevelInfoSEICfg                          (m_cfgSubpictureLevelInfoSEI);
-#else
-  m_cEncLib.setSubpicureLevelInfoSEIEnabled                      (m_subpicureLevelInfoSEIEnabled);
-#endif
   m_cEncLib.setSampleAspectRatioInfoSEIEnabled                   (m_sampleAspectRatioInfoSEIEnabled);
   m_cEncLib.setSariCancelFlag                                    (m_sariCancelFlag);
   m_cEncLib.setSariPersistenceFlag                               (m_sariPersistenceFlag);
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index 69db3a36f7..932a3fc33a 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -692,10 +692,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   SMultiValueInput<bool>      cfg_loopFilterAcrossSubpicEnabledFlag(0, 1, 0, MAX_NUM_SUB_PICS);
   SMultiValueInput<uint32_t>  cfg_subPicId(0, std::numeric_limits<uint16_t>::max(), 0, MAX_NUM_SUB_PICS);
 
-#if JVET_SUBPIC_LEVEL_CFG
   SMultiValueInput<int>          cfg_sliFractions(0, 100, 0, std::numeric_limits<int>::max());
   SMultiValueInput<Level::Name>  cfg_sliRefLevels(Level::NONE, Level::LEVEL8_5,  0, 8);
-#endif
 
   int warnUnknowParameter = 0;
 
@@ -1250,15 +1248,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("SEIGcmpGuardBandType",                            m_gcmpSEIGuardBandType,                   0u,                                       "Indicate the type of the guard bands")
   ("SEIGcmpGuardBandBoundaryExteriorFlag",            m_gcmpSEIGuardBandBoundaryExteriorFlag,   false,                                    "Indicate whether face boundaries contain guard bands")
   ("SEIGcmpGuardBandSamplesMinus1",                   m_gcmpSEIGuardBandSamplesMinus1,          0u,                                       "Specifies the number of guard band samples minus1 used in the cubemap projected picture")
-#if JVET_SUBPIC_LEVEL_CFG
   ("SEISubpicLevelInfoEnabled",                       m_cfgSubpictureLevelInfoSEI.m_enabled,             false,            "Control generation of Subpicture Level Information SEI messages")
   ("SEISubpicLevelInfoRefLevels",                     cfg_sliRefLevels,                                  cfg_sliRefLevels, "List of reference levels for Subpicture Level Information SEI messages")
   ("SEISubpicLevelInfoExplicitFraction",              m_cfgSubpictureLevelInfoSEI.m_explicitFraction,    false,            "Enable sending of explicit fractions in Subpicture Level Information SEI messages")
   ("SEISubpicLevelInfoNumSubpics",                    m_cfgSubpictureLevelInfoSEI.m_numSubpictures,      1,                "Number of subpictures for Subpicture Level Information SEI messages")
   ("SEISubpicLevelInfoRefLevelFractions",             cfg_sliFractions,                                  cfg_sliFractions, "List of fractions for Subpicture Level Information SEI messages")
-#else
-  ("SEISubpicureLevelInfo",                           m_subpicureLevelInfoSEIEnabled,           false, "Control generation of Subpicture Level Information SEI messages")
-#endif
   ("SEISampleAspectRatioInfo",                        m_sampleAspectRatioInfoSEIEnabled,        false, "Control generation of Sample Aspect Ratio Information SEI messages")
   ("SEISARICancelFlag",                               m_sariCancelFlag,                         false, "Indicates that Sample Aspect Ratio Information SEI message cancels the persistence or follows")
   ("SEISARIPersistenceFlag",                          m_sariPersistenceFlag,                    true, "Specifies the persistence of the Sample Aspect Ratio Information SEI message")
@@ -1594,7 +1588,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     CHECK( m_rprEnabled, "RPR and subpictures cannot be enabled together" );
   }
 
-#if JVET_SUBPIC_LEVEL_CFG
   if (m_cfgSubpictureLevelInfoSEI.m_enabled)
   {
     CHECK (m_numSubPics != m_cfgSubpictureLevelInfoSEI.m_numSubpictures, "NumSubPics must be equal to SEISubpicLevelInfoNumSubpics" );
@@ -1605,7 +1598,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
       CHECK (cfg_sliRefLevels.values.size() * m_cfgSubpictureLevelInfoSEI.m_numSubpictures != cfg_sliFractions.values.size(), "Number of subpicture level fractions must be equal to the numer of subpictures times the number of reference levels.");
     }
   }
-#endif
 
   if( m_picPartitionFlag ) 
   {
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index 6d3f2778cd..2ba6cba0c6 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -576,11 +576,7 @@ protected:
   bool                 m_gcmpSEIGuardBandBoundaryExteriorFlag;
   uint32_t             m_gcmpSEIGuardBandSamplesMinus1;
 
-#if JVET_SUBPIC_LEVEL_CFG
   EncCfgParam::CfgSEISubpictureLevel m_cfgSubpictureLevelInfoSEI;
-#else
-  bool m_subpicureLevelInfoSEIEnabled;
-#endif
 
   bool                  m_sampleAspectRatioInfoSEIEnabled;
   bool                  m_sariCancelFlag;
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 8d0740656c..cc33563393 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -173,7 +173,6 @@
 
 
 
-#define JVET_SUBPIC_LEVEL_CFG                             1  // improved configuration of subpicture level info SEI
 
 #define JVET_Q0217_PROPOSAL5                              1  // JVET-Q0217 Proposal 5: modifications to reference picture information signalling
 
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index 4e5219bdce..d0a2db4068 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -567,11 +567,7 @@ protected:
   uint8_t              m_gcmpSEIGuardBandType;
   bool                 m_gcmpSEIGuardBandBoundaryExteriorFlag;
   uint8_t              m_gcmpSEIGuardBandSamplesMinus1;
-#if JVET_SUBPIC_LEVEL_CFG
   EncCfgParam::CfgSEISubpictureLevel m_cfgSubpictureLevelInfoSEI;
-#else
-  bool m_subpicureLevelInfoSEIEnabled;
-#endif
   bool                  m_sampleAspectRatioInfoSEIEnabled;
   bool                  m_sariCancelFlag;
   bool                  m_sariPersistenceFlag;
@@ -1549,13 +1545,8 @@ public:
   bool    getGcmpSEIGuardBandBoundaryExteriorFlag()                                                 { return m_gcmpSEIGuardBandBoundaryExteriorFlag; }
   void    setGcmpSEIGuardBandSamplesMinus1( uint8_t u )                                             { m_gcmpSEIGuardBandSamplesMinus1 = u; }
   uint8_t getGcmpSEIGuardBandSamplesMinus1()                                                        { return m_gcmpSEIGuardBandSamplesMinus1; }
-#if JVET_SUBPIC_LEVEL_CFG
   const EncCfgParam::CfgSEISubpictureLevel getSubpicureLevelInfoSEICfg() const                      { return m_cfgSubpictureLevelInfoSEI; }
   void    setSubpicureLevelInfoSEICfg(EncCfgParam::CfgSEISubpictureLevel cfg)                       { m_cfgSubpictureLevelInfoSEI = cfg; }
-#else
-  bool    getSubpicureLevelInfoSEIEnabled() const { return m_subpicureLevelInfoSEIEnabled; }
-  void    setSubpicureLevelInfoSEIEnabled(bool val) { m_subpicureLevelInfoSEIEnabled = val; }
-#endif
   bool     getSampleAspectRatioInfoSEIEnabled() const                                                       { return m_sampleAspectRatioInfoSEIEnabled; }
   void     setSampleAspectRatioInfoSEIEnabled(const bool val)                                               { m_sampleAspectRatioInfoSEIEnabled = val; }
   bool     getSariCancelFlag() const                                                                        { return m_sariCancelFlag; }
diff --git a/source/Lib/EncoderLib/EncCfgParam.h b/source/Lib/EncoderLib/EncCfgParam.h
index fb1671afd2..13e5f839e0 100644
--- a/source/Lib/EncoderLib/EncCfgParam.h
+++ b/source/Lib/EncoderLib/EncCfgParam.h
@@ -44,7 +44,6 @@
 
 namespace EncCfgParam {
 
-#if JVET_SUBPIC_LEVEL_CFG
 class CfgSEISubpictureLevel
 {
 public:
@@ -63,7 +62,6 @@ public:
   int                       m_numSubpictures;
   std::vector<int>          m_fractions;
 };
-#endif
 
 }
 
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index c46bd4fe3d..42aced0717 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -659,11 +659,7 @@ void EncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const SPS
     m_seiEncoder.initSEIGcmp(sei);
     seiMessages.push_back(sei);
   }
-#if JVET_SUBPIC_LEVEL_CFG
   if (m_pcCfg->getSubpicureLevelInfoSEICfg().m_enabled)
-#else
-  if (m_pcCfg->getSubpicureLevelInfoSEIEnabled())
-#endif
   {
     SEISubpicureLevelInfo *seiSubpicureLevelInfo = new SEISubpicureLevelInfo;
     m_seiEncoder.initSEISubpictureLevelInfo(seiSubpicureLevelInfo, sps);
diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp
index 5f3c800ec2..2b520d38c1 100644
--- a/source/Lib/EncoderLib/SEIEncoder.cpp
+++ b/source/Lib/EncoderLib/SEIEncoder.cpp
@@ -616,7 +616,6 @@ void SEIEncoder::initSEIContentColourVolume(SEIContentColourVolume *seiContentCo
 }
 void SEIEncoder::initSEISubpictureLevelInfo(SEISubpicureLevelInfo *sei, const SPS *sps)
 {
-#if JVET_SUBPIC_LEVEL_CFG
   const EncCfgParam::CfgSEISubpictureLevel &cfgSubPicLevel = m_pcCfg->getSubpicureLevelInfoSEICfg();
 
   sei->m_numRefLevels = (int) cfgSubPicLevel.m_refLevels.size();
@@ -636,19 +635,6 @@ void SEIEncoder::initSEISubpictureLevelInfo(SEISubpicureLevelInfo *sei, const SP
       }
     }
   }
-#else
-  // subpicture level information should be specified via config file
-  // unfortunately the implementation of subpictures is still not available
-  // TODO: implement config file parameters and intialization
-  fprintf(stderr, "SEISubpicureLevelInfo depends on subpictures! Initializing to dummy values!\n");
-
-  sei->m_numSubpics = sps->getNumSubPics();
-  sei->m_numRefLevels = 2;
-  sei->m_refLevelIdc.resize(2);
-  sei->m_refLevelIdc[0] = Level::LEVEL4;
-  sei->m_refLevelIdc[1] = Level::LEVEL8_5;
-  sei->m_explicitFractionPresentFlag = false;
-#endif
 }
 
 
-- 
GitLab