From 0c28ed9508de4cfa0076d1cec160fa31490be3d0 Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Mon, 6 Jul 2020 15:15:45 +0200
Subject: [PATCH] remove macro STILL_PICTURE_PROFILES

---
 source/App/EncoderApp/EncApp.cpp          |  2 --
 source/App/EncoderApp/EncAppCfg.cpp       | 22 ----------------------
 source/App/EncoderApp/EncAppCfg.h         |  2 --
 source/Lib/CommonLib/ProfileLevelTier.cpp | 11 -----------
 source/Lib/CommonLib/ProfileLevelTier.h   |  2 --
 source/Lib/CommonLib/TypeDef.h            |  1 -
 source/Lib/DecoderLib/VLCReader.cpp       |  2 --
 source/Lib/EncoderLib/EncCfg.h            |  4 ----
 source/Lib/EncoderLib/EncLib.cpp          |  2 --
 source/Lib/EncoderLib/VLCWriter.cpp       |  2 --
 10 files changed, 50 deletions(-)

diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index 709e11eb7..2d092e9b3 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -252,9 +252,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setAvoidIntraInDepLayer                              ( m_avoidIntraInDepLayer );
 
   //====== SPS constraint flags =======
-#if STILL_PICTURE_PROFILES
   m_cEncLib.setOnePictureOnlyConstraintFlag                      ( m_onePictureOnlyConstraintFlag );
-#endif
   m_cEncLib.setIntraOnlyConstraintFlag                           ( m_intraConstraintFlag );  // NOTE: This setting is not used, and is confused with setIntraConstraintFlag
   m_cEncLib.setMaxBitDepthConstraintIdc                          ( m_bitDepthConstraint - 8 );
   m_cEncLib.setMaxChromaFormatConstraintIdc                      ( m_chromaFormatConstraint );
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index c8f911f2e..c6da6cf15 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -60,17 +60,11 @@ namespace po = df::program_options_lite;
 
 enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations
 {
-#if STILL_PICTURE_PROFILES
   NONE,
   MAIN_10,
   MAIN_10_STILL_PICTURE,
   MAIN_444_10,
   MAIN_444_10_STILL_PICTURE,
-#else
-  NONE        = Profile::NONE,
-  MAIN_10     = Profile::MAIN_10,
-  MAIN_444_10 = Profile::MAIN_444_10,
-#endif
   AUTO = -1
 };
 
@@ -240,10 +234,8 @@ strToExtendedProfile[] =
     {"none",                      NONE             },
     {"main_10",                   MAIN_10          },
     {"main_444_10",               MAIN_444_10      },
-#if STILL_PICTURE_PROFILES
     {"main_10_still_picture",     MAIN_10_STILL_PICTURE },
     {"main_444_10_still_picture", MAIN_444_10_STILL_PICTURE },
-#endif
     {"auto",                      AUTO             }
 };
 
@@ -816,23 +808,15 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("HarmonizeGopFirstFieldCoupleEnabled",             m_bHarmonizeGopFirstFieldCoupleEnabled,            true, "Enables harmonization of Gop first field couple")
 
   // Profile and level
-#if STILL_PICTURE_PROFILES
   ("Profile",                                         extendedProfile,              ExtendedProfileName::NONE, "Profile name to use for encoding. Use main_10, main_10_still_picture, main_444_10, main_444_10_still_picture, auto, or none")
-#else
-  ("Profile",                                         extendedProfile,              ExtendedProfileName::NONE, "Profile name to use for encoding. Use main_10, main_444_10, auto, or none")
-#endif
   ("Level",                                           m_level,                                    Level::NONE, "Level limit to be used, eg 5.1, or none")
   ("Tier",                                            m_levelTier,                                Level::MAIN, "Tier to use for interpretation of --Level (main or high only)")
   ("SubProfile",                                      cfg_SubProfile,                          cfg_SubProfile,  "Sub-profile idc")
   ("EnableDecodingCapabilityInformation",             m_DCIEnabled,                                     false, "Enables writing of Decoding Capability Information")
   ("MaxBitDepthConstraint",                           m_bitDepthConstraint,                                0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
   ("MaxChromaFormatConstraint",                       tmpConstraintChromaFormat,                            0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
-#if STILL_PICTURE_PROFILES
   ("OnePictureOnlyConstraintFlag",                    m_onePictureOnlyConstraintFlag,                   false, "Value of general_intra_constraint_flag. Can only be used for single frame encodings. Will be set to true for still picture profiles")
   ("IntraConstraintFlag",                             m_intraConstraintFlag,                            false, "Value of intra_only_constraint_flag")
-#else
-  ("IntraConstraintFlag",                             m_intraConstraintFlag,                            false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
-#endif
 
   ("NonPackedSource",                                 m_nonPackedConstraintFlag,                        false, "Indicate that source does not contain frame packing")
   ("NonProjectedConstraintFlag",                      m_nonProjectedConstraintFlag,                     false, "Indicate that the bitstream contains projection SEI messages")
@@ -1771,7 +1755,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   }
   else
   {
-#if STILL_PICTURE_PROFILES
     switch (extendedProfile)
     {
       case ExtendedProfileName::NONE:                      m_profile = Profile::NONE; break;
@@ -1783,9 +1766,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
         EXIT( "Unable to determine profile from configured settings");
         break;
     }
-#else
-    m_profile = Profile::Name(extendedProfile);
-#endif
   }
 
   {
@@ -2528,13 +2508,11 @@ bool EncAppCfg::xCheckParameter()
 
   xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)");
 
-#if STILL_PICTURE_PROFILES
   xConfirmPara ( m_onePictureOnlyConstraintFlag && m_framesToBeEncoded!=1, "When onePictureOnlyConstraintFlag is true, the number of frames to be encoded must be 1" );
   if (m_profile == Profile::MAIN_10 || m_profile==Profile::MAIN_444_10)
   {
     xConfirmPara ( m_level==Level::LEVEL15_5 && !m_onePictureOnlyConstraintFlag, "Currently the only profiles that support level 15.5 are still pictures, which require onePictureOnlyConstraintFlag to be 1" );
   }
-#endif
 
   if( m_SubPuMvpMode == 3 && m_maxNumMergeCand < 7 )
   {
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index e603413c8..8de7603e3 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -191,9 +191,7 @@ protected:
 
   uint32_t          m_bitDepthConstraint;
   ChromaFormat  m_chromaFormatConstraint;
-#if STILL_PICTURE_PROFILES
   bool          m_onePictureOnlyConstraintFlag;
-#endif
   bool          m_intraConstraintFlag;
   bool          m_nonPackedConstraintFlag;
   bool          m_nonProjectedConstraintFlag;
diff --git a/source/Lib/CommonLib/ProfileLevelTier.cpp b/source/Lib/CommonLib/ProfileLevelTier.cpp
index 10bbb136e..900a863ea 100644
--- a/source/Lib/CommonLib/ProfileLevelTier.cpp
+++ b/source/Lib/CommonLib/ProfileLevelTier.cpp
@@ -76,16 +76,11 @@ static const LevelTierFeatures mainLevelTierInfo[] =
 
 static const ProfileFeatures validProfiles[] =
 {   //  profile,                   pNameString,             maxBitDepth, maxChrFmt, lvl15.5, cpbvcl, cpbnal, fcf*1000, mincr*100, levelInfo
-#if STILL_PICTURE_PROFILES
     // most constrained profiles must appear first.
     { Profile::MAIN_10,            "Main_10_Still_Picture",          10, CHROMA_420,  true,   1000,   1100,     1875,    100    , mainLevelTierInfo,  true },
     { Profile::MAIN_444_10,        "Main_444_10_Still_Picture",      10, CHROMA_444,  true,   2500,   2750,     3750,     75    , mainLevelTierInfo,  true },
     { Profile::MAIN_10,            "Main_10",                        10, CHROMA_420, false,   1000,   1100,     1875,    100    , mainLevelTierInfo, false },
     { Profile::MAIN_444_10,        "Main_444_10",                    10, CHROMA_444, false,   2500,   2750,     3750,     75    , mainLevelTierInfo, false },
-#else
-    { Profile::MAIN_10,            "Main_10",                        10, CHROMA_420, false,   1000,   1100,     1875,    100    , mainLevelTierInfo },
-    { Profile::MAIN_444_10,        "Main_444_10",                    10, CHROMA_444, false,   2500,   2750,     3750,     75    , mainLevelTierInfo },
-#endif
     { Profile::NONE, 0 }
 };
 
@@ -97,16 +92,10 @@ ProfileLevelTierFeatures::extractPTLInformation(const SPS &sps)
   m_tier = spsPtl.getTierFlag();
 
   // Identify the profile from the profile Idc, and possibly other constraints.
-#if STILL_PICTURE_PROFILES
   bool onePictureOnlyConstraintFlag=spsPtl.getConstraintInfo()->getOnePictureOnlyConstraintFlag();
-#endif
   for(int32_t i=0; validProfiles[i].profile != Profile::NONE; i++)
   {
-#if STILL_PICTURE_PROFILES
     if (spsPtl.getProfileIdc() == validProfiles[i].profile && !(validProfiles[i].onePictureOnlyFlagMustBe1 && !onePictureOnlyConstraintFlag))
-#else
-    if (spsPtl.getProfileIdc() == validProfiles[i].profile)
-#endif
     {
       m_pProfile = &(validProfiles[i]);
       break;
diff --git a/source/Lib/CommonLib/ProfileLevelTier.h b/source/Lib/CommonLib/ProfileLevelTier.h
index 6d89d5ae3..6a0c0ff44 100644
--- a/source/Lib/CommonLib/ProfileLevelTier.h
+++ b/source/Lib/CommonLib/ProfileLevelTier.h
@@ -76,9 +76,7 @@ struct ProfileFeatures
   uint32_t                 formatCapabilityFactorx1000;
   uint32_t                 minCrScaleFactorx100;
   const LevelTierFeatures *pLevelTiersListInfo;
-#if STILL_PICTURE_PROFILES
   bool                     onePictureOnlyFlagMustBe1;
-#endif
 };
 
 
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index b789b4733..f4570493c 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -153,7 +153,6 @@
 
 
 
-#define STILL_PICTURE_PROFILES                            1 // Adds support for still picture profiles
 
 //########### place macros to be be kept below this line ###############
 
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 8f8861ead..276c3fd50 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -4214,9 +4214,7 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
   READ_FLAG(symbol,  "general_non_packed_constraint_flag"       ); cinfo->setNonPackedConstraintFlag(symbol ? true : false);
   READ_FLAG(symbol,  "general_frame_only_constraint_flag"       ); cinfo->setFrameOnlyConstraintFlag(symbol ? true : false);
   READ_FLAG(symbol,  "general_non_projected_constraint_flag"    ); cinfo->setNonProjectedConstraintFlag(symbol ? true : false);
-#if STILL_PICTURE_PROFILES
   READ_FLAG(symbol,  "general_one_picture_only_constraint_flag"    ); cinfo->setOnePictureOnlyConstraintFlag(symbol ? true : false);
-#endif
   READ_FLAG(symbol,  "intra_only_constraint_flag"               ); cinfo->setIntraOnlyConstraintFlag(symbol ? true : false);
 
   READ_CODE(4, symbol,  "max_bitdepth_constraint_idc"              ); cinfo->setMaxBitDepthConstraintIdc(symbol);
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index 3b4461e23..2547b7c62 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -175,9 +175,7 @@ protected:
   bool      m_printSequenceMSE;
   bool      m_cabacZeroWordPaddingEnabled;
 
-#if STILL_PICTURE_PROFILES
   bool      m_onePictureOnlyConstraintFlag;
-#endif
   bool      m_bIntraOnlyConstraintFlag;
   uint32_t  m_maxBitDepthConstraintIdc;
   uint32_t  m_maxChromaFormatConstraintIdc;
@@ -762,10 +760,8 @@ public:
   void setNumSubProfile( uint8_t numSubProfile) { m_numSubProfile = numSubProfile; m_subProfile.resize(m_numSubProfile); }
   void setSubProfile( int i, uint32_t subProfile) { m_subProfile[i] = subProfile; }
 
-#if STILL_PICTURE_PROFILES
   bool      getOnePictureOnlyConstraintFlag() const                        { return m_onePictureOnlyConstraintFlag; }
   void      setOnePictureOnlyConstraintFlag(bool b)                        { m_onePictureOnlyConstraintFlag=b; }
-#endif
 
   bool      getIntraOnlyConstraintFlag() const { return m_bIntraOnlyConstraintFlag; }
   void      setIntraOnlyConstraintFlag(bool bVal) { m_bIntraOnlyConstraintFlag = bVal; }
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index 5481e6985..9a51e592a 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -1097,9 +1097,7 @@ void EncLib::xInitSPS( SPS& sps )
   cinfo->setOneSlicePerPicConstraintFlag(m_oneSlicePerPicConstraintFlag);
   cinfo->setOneSubpicPerPicConstraintFlag(m_oneSubpicPerPicConstraintFlag);
   cinfo->setFrameOnlyConstraintFlag     (m_frameOnlyConstraintFlag);
-#if STILL_PICTURE_PROFILES
   cinfo->setOnePictureOnlyConstraintFlag(m_onePictureOnlyConstraintFlag);
-#endif
   cinfo->setIntraOnlyConstraintFlag         (m_intraConstraintFlag);
   cinfo->setMaxBitDepthConstraintIdc    (m_maxBitDepthConstraintIdc);
   cinfo->setMaxChromaFormatConstraintIdc((ChromaFormat)m_maxChromaFormatConstraintIdc);
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index deefeb866..88afee44d 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -2419,9 +2419,7 @@ void  HLSWriter::codeConstraintInfo  ( const ConstraintInfo* cinfo )
   WRITE_FLAG(cinfo->getNonPackedConstraintFlag(), "general_non_packed_constraint_flag"      );
   WRITE_FLAG(cinfo->getFrameOnlyConstraintFlag(), "general_frame_only_constraint_flag"      );
   WRITE_FLAG(cinfo->getNonProjectedConstraintFlag(), "general_non_projected_constraint_flag");
-#if STILL_PICTURE_PROFILES
   WRITE_FLAG(cinfo->getOnePictureOnlyConstraintFlag(), "general_one_picture_only_constraint_flag" );
-#endif
   WRITE_FLAG(cinfo->getIntraOnlyConstraintFlag(),     "intra_only_constraint_flag"      );
 
   WRITE_CODE(cinfo->getMaxBitDepthConstraintIdc(), 4, "max_bitdepth_constraint_idc" );
-- 
GitLab