From 7cdcde22dc6a3369a3996239059d3fae559889af Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Wed, 21 Oct 2020 17:10:08 +0200
Subject: [PATCH] remove macro JVET_R0294_SUBPIC_HASH

---
 .../BitstreamExtractorApp.cpp                 | 65 -------------------
 .../BitstreamExtractorApp.h                   |  6 --
 source/App/EncoderApp/EncApp.cpp              |  6 --
 source/App/EncoderApp/EncAppCfg.cpp           |  6 --
 source/App/EncoderApp/EncAppCfg.h             |  2 -
 source/App/SubpicMergeApp/SubpicMergeApp.cpp  |  4 --
 source/Lib/CommonLib/TypeDef.h                |  1 -
 source/Lib/DecoderLib/SEIread.cpp             |  2 -
 source/Lib/EncoderLib/AnnexBwrite.h           | 34 ----------
 source/Lib/EncoderLib/EncCfg.h                |  4 --
 source/Lib/EncoderLib/EncGOP.cpp              | 14 ----
 source/Lib/EncoderLib/EncGOP.h                |  4 --
 source/Lib/EncoderLib/SEIEncoder.cpp          | 29 ---------
 source/Lib/EncoderLib/SEIEncoder.h            |  4 --
 14 files changed, 181 deletions(-)

diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp
index fa0104a503..bd3c93aed5 100644
--- a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp
+++ b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp
@@ -446,22 +446,8 @@ void BitstreamExtractorApp::xWriteVPS(VPS *vps, std::ostream& out, int layerId,
   m_hlSyntaxWriter.setBitstream( &naluOut.m_Bitstream );
   m_hlSyntaxWriter.codeVPS( vps );
 
-#if JVET_R0294_SUBPIC_HASH
   NALUnitEBSP naluWithHeader(naluOut);
   writeAnnexBNalUnit(out, naluWithHeader, true);
-#else
-  // create a dummy AU
-  AccessUnit tmpAu;
-  // convert to EBSP (this adds emulation prevention!) and add into NAL unit
-  tmpAu.push_back(new NALUnitEBSP(naluOut));
-
-  // write the dummy AU
-  // note: The first NAL unit in an access unit will be written with a 4-byte start code
-  //       Parameter sets are also coded with a 4-byte start code, so writing the dummy
-  //       AU works without chaning the start code length.
-  //       This cannot be done for VLC NAL units!
-  writeAnnexB (out, tmpAu);
-#endif
 }
 
 void BitstreamExtractorApp::xWriteSPS(SPS *sps, std::ostream& out, int layerId, int temporalId)
@@ -474,22 +460,8 @@ void BitstreamExtractorApp::xWriteSPS(SPS *sps, std::ostream& out, int layerId,
   m_hlSyntaxWriter.setBitstream( &naluOut.m_Bitstream );
   m_hlSyntaxWriter.codeSPS( sps );
 
-#if JVET_R0294_SUBPIC_HASH
   NALUnitEBSP naluWithHeader(naluOut);
   writeAnnexBNalUnit(out, naluWithHeader, true);
-#else
-  // create a dummy AU
-  AccessUnit tmpAu;
-  // convert to EBSP (this adds emulation prevention!) and add into NAL unit
-  tmpAu.push_back(new NALUnitEBSP(naluOut));
-
-  // write the dummy AU
-  // note: The first NAL unit in an access unit will be written with a 4-byte start code
-  //       Parameter sets are also coded with a 4-byte start code, so writing the dummy
-  //       AU works without chaning the start code length.
-  //       This cannot be done for VLC NAL units!
-  writeAnnexB (out, tmpAu);
-#endif
 }
 
 void BitstreamExtractorApp::xWritePPS(PPS *pps, std::ostream& out, int layerId, int temporalId)
@@ -501,22 +473,8 @@ void BitstreamExtractorApp::xWritePPS(PPS *pps, std::ostream& out, int layerId,
   m_hlSyntaxWriter.setBitstream( &naluOut.m_Bitstream );
   m_hlSyntaxWriter.codePPS( pps );
 
-#if JVET_R0294_SUBPIC_HASH
   NALUnitEBSP naluWithHeader(naluOut);
   writeAnnexBNalUnit(out, naluWithHeader, true);
-#else
-  // create a dummy AU
-  AccessUnit tmpAu;
-  // convert to EBSP (this adds emulation prevention!) and add into NAL unit
-  tmpAu.push_back(new NALUnitEBSP(naluOut));
-
-  // write the dummy AU
-  // note: The first NAL unit in an access unit will be written with a 4-byte start code
-  //       Parameter sets are also coded with a 4-byte start code, so writing the dummy
-  //       AU works without chaning the start code length.
-  //       This cannot be done for VLC NAL units!
-  writeAnnexB (out, tmpAu);
-#endif
 }
 
 // returns true, if the NAL unit is to be discarded
@@ -536,7 +494,6 @@ bool BitstreamExtractorApp::xCheckNumSubLayers(InputNALUnit &nalu, VPS *vps)
   return retval;
 }
 
-#if JVET_R0294_SUBPIC_HASH
 bool BitstreamExtractorApp::xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit& nalu, std::ostream& out, int subpicId)
 {
   SEIMessages scalableNestingSEIs = getSeisByType(SEIs, SEI::SCALABLE_NESTING);
@@ -580,7 +537,6 @@ bool BitstreamExtractorApp::xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit
   // keep all other SEIs
   return true;
 }
-#endif
 
 #if JVET_S0158_SUB_BITSTREAM_EXT
 bool BitstreamExtractorApp::xCheckScalableNestingSEI(SEIScalableNesting *seiNesting, InputNALUnit& nalu, VPS *vps)
@@ -885,29 +841,13 @@ uint32_t BitstreamExtractorApp::decode()
       {
         xReadPicHeader(nalu);
       }
-#if JVET_R0294_SUBPIC_HASH
       if ( (nalu.m_nalUnitType == NAL_UNIT_PREFIX_SEI) || (nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI))
       {
-#else
-      if (m_targetOlsIdx>=0)
-      {
-#if JVET_S0154_R0068_ASPECT5
-        if (nalu.m_nalUnitType == NAL_UNIT_PREFIX_SEI || nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI)
-#else
-        if (nalu.m_nalUnitType == NAL_UNIT_PREFIX_SEI)
-#endif
-        {
-#endif
         // decode SEI
         SEIMessages SEIs;
-#if !JVET_R0294_SUBPIC_HASH
-        HRD hrd;
-        m_seiReader.parseSEImessage(&(nalu.getBitstream()), SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, m_parameterSetManager.getActiveSPS(), hrd, &std::cout);
-#else
         m_seiReader.parseSEImessage(&(nalu.getBitstream()), SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, m_parameterSetManager.getActiveSPS(), m_hrd, &std::cout);
         if (m_targetOlsIdx>=0)
         {
-#endif
           for (auto sei : SEIs)
           {
             // remove unqualified scalable nesting SEI
@@ -943,9 +883,6 @@ uint32_t BitstreamExtractorApp::decode()
               writeInpuNalUnitToStream &= !targetOlsIdxGreaterThanZero;
             }
           }
-#if !JVET_R0294_SUBPIC_HASH
-        }
-#endif
 #if JVET_S0154_R0068_ASPECT5
           if (m_subPicIdx >= 0 && writeInpuNalUnitToStream)
           {
@@ -957,7 +894,6 @@ uint32_t BitstreamExtractorApp::decode()
             delete vps;
           }
         }
-#if JVET_R0294_SUBPIC_HASH
 #if JVET_S0154_R0068_ASPECT5
         if (m_subPicIdx >= 0)
         {
@@ -970,7 +906,6 @@ uint32_t BitstreamExtractorApp::decode()
         }
 #endif
       }
-#endif
 
 #if JVET_R0107_BITSTREAM_EXTACTION
       Slice slice;
diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h
index 7da37e10f2..7db298fc97 100644
--- a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h
+++ b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.h
@@ -50,9 +50,7 @@
 #include "VLCWriter.h"
 
 #include "SEIread.h"
-#if JVET_R0294_SUBPIC_HASH
 #include "SEIwrite.h"
-#endif
 class BitstreamExtractorApp : public BitstreamExtractorAppCfg
 {
 
@@ -80,13 +78,11 @@ protected:
   bool xCheckSliceSubpicture(InputNALUnit &nalu, int subPicId);
 #endif
   void xReadPicHeader(InputNALUnit &nalu);
-#if JVET_R0294_SUBPIC_HASH
 #if JVET_S0154_R0068_ASPECT5
   bool xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit& nalu, std::ostream& out, int subpicId);
 #else
   bool xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit& nalu, std::ostream& out);
 #endif
-#endif
 #if JVET_S0158_SUB_BITSTREAM_EXT
   bool xCheckScalableNestingSEI(SEIScalableNesting *seiNesting, InputNALUnit& nalu, VPS *vps);
 #endif
@@ -105,10 +101,8 @@ protected:
   HLSyntaxReader        m_hlSynaxReader;
   HLSWriter             m_hlSyntaxWriter;
   SEIReader             m_seiReader;
-#if JVET_R0294_SUBPIC_HASH
   SEIWriter             m_seiWriter;
   HRD                   m_hrd;
-#endif
 
   int                   m_vpsId;
   bool                  m_removeTimingSEI;
diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index 4de3f209d0..b8773d684f 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -848,9 +848,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setSaoGreedyMergeEnc                                 ( m_saoGreedyMergeEnc);
   m_cEncLib.setIntraSmoothingDisabledFlag                        (!m_enableIntraReferenceSmoothing );
   m_cEncLib.setDecodedPictureHashSEIType                         ( m_decodedPictureHashSEIType );
-#if JVET_R0294_SUBPIC_HASH
   m_cEncLib.setSubpicDecodedPictureHashType                      ( m_subpicDecodedPictureHashType );
-#endif
   m_cEncLib.setDependentRAPIndicationSEIEnabled                  ( m_drapPeriod > 0 );
   m_cEncLib.setBufferingPeriodSEIEnabled                         ( m_bufferingPeriodSEIEnabled );
   m_cEncLib.setPictureTimingSEIEnabled                           ( m_pictureTimingSEIEnabled );
@@ -1405,11 +1403,7 @@ void EncApp::xWriteOutput( int iNumEncoded, std::list<PelUnitBuf*>& recBufList )
 
 void EncApp::outputAU( const AccessUnit& au )
 {
-#if JVET_R0294_SUBPIC_HASH
   const vector<uint32_t>& stats = writeAnnexBAccessUnit(m_bitstream, au);
-#else
-  const vector<uint32_t>& stats = writeAnnexB(m_bitstream, au);
-#endif
   rateStatsAccum(au, stats);
   m_bitstream.flush();
 }
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index a4bb3b2627..66095bd9fe 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -563,9 +563,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   int tmpFastInterSearchMode;
   int tmpMotionEstimationSearchMethod;
   int tmpDecodedPictureHashSEIMappedType;
-#if JVET_R0294_SUBPIC_HASH
   int tmpSubpicDecodedPictureHashMappedType;
-#endif
   string inputColourSpaceConvert;
   string inputPathPrefix;
   ExtendedProfileName extendedProfile;
@@ -1173,13 +1171,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
                                                                                                                "\t2: CRC\n"
                                                                                                                "\t1: use MD5\n"
                                                                                                                "\t0: disable")
-#if JVET_R0294_SUBPIC_HASH
   ("SubpicDecodedPictureHash",                        tmpSubpicDecodedPictureHashMappedType,                0, "Control generation of decode picture hash SEI messages for each subpicture\n"
                                                                                                                "\t3: checksum\n"
                                                                                                                "\t2: CRC\n"
                                                                                                                "\t1: use MD5\n"
                                                                                                                "\t0: disable")
-#endif
   ("TMVPMode",                                        m_TMVPModeId,                                         1, "TMVP mode 0: TMVP disable for all slices. 1: TMVP enable for all slices (default) 2: TMVP enable for certain slices only")
   ("SliceLevelRpl",                                   m_sliceLevelRpl,                                   true, "Code reference picture lists in slice headers rather than picture header.")
   ("SliceLevelDblk",                                  m_sliceLevelDblk,                                  true, "Code deblocking filter parameters in slice headers rather than picture header.")
@@ -2020,7 +2016,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   {
     m_decodedPictureHashSEIType=HashType(tmpDecodedPictureHashSEIMappedType-1);
   }
-#if JVET_R0294_SUBPIC_HASH
   // Need to map values to match those of the SEI message:
   if (tmpSubpicDecodedPictureHashMappedType==0)
   {
@@ -2030,7 +2025,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   {
     m_subpicDecodedPictureHashType=HashType(tmpSubpicDecodedPictureHashMappedType-1);
   }
-#endif
   // allocate slice-based dQP values
   m_aidQP = new int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
   ::memset( m_aidQP, 0, sizeof(int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) );
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index b911447d99..92c77534be 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -499,9 +499,7 @@ protected:
   bool      m_bUseBLambdaForNonKeyLowDelayPictures;
 
   HashType  m_decodedPictureHashSEIType;                      ///< Checksum mode for decoded picture hash SEI message
-#if JVET_R0294_SUBPIC_HASH
   HashType  m_subpicDecodedPictureHashType;
-#endif
   bool      m_bufferingPeriodSEIEnabled;
   bool      m_pictureTimingSEIEnabled;
   bool      m_bpDeltasGOPStructure;
diff --git a/source/App/SubpicMergeApp/SubpicMergeApp.cpp b/source/App/SubpicMergeApp/SubpicMergeApp.cpp
index 4d3dfebd4e..b6bc02979f 100644
--- a/source/App/SubpicMergeApp/SubpicMergeApp.cpp
+++ b/source/App/SubpicMergeApp/SubpicMergeApp.cpp
@@ -967,11 +967,7 @@ void SubpicMergeApp::generateMergedPic(ParameterSetManager &psManager, bool mixe
   copyNalUnitsToAccessUnit(accessUnit, subpic0.nalus, (int)NAL_UNIT_EOS);
   copyNalUnitsToAccessUnit(accessUnit, subpic0.nalus, (int)NAL_UNIT_EOB);
 
-#if JVET_R0294_SUBPIC_HASH
   writeAnnexBAccessUnit(m_outputStream, accessUnit);
-#else
-  writeAnnexB(m_outputStream, accessUnit);
-#endif
 }
 
 /**
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 99c800f99b..44a8af7880 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -106,7 +106,6 @@
 
 
 
-#define JVET_R0294_SUBPIC_HASH                            1 // JVET-R0294: Allow decoded picture hash SEI messages to be nested in subpicture context
 
 #define JVET_S0181_PROPOSAL1                              1 // JVET-0181_Proposal1: Conditionally signal bp_sublayer_initial_cpb_removal_delay_present_flag
 
diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp
index 5c79e848c8..240d76b67d 100644
--- a/source/Lib/DecoderLib/SEIread.cpp
+++ b/source/Lib/DecoderLib/SEIread.cpp
@@ -330,12 +330,10 @@ void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType
         sei = new SEIDecodedPictureHash;
         xParseSEIDecodedPictureHash((SEIDecodedPictureHash&) *sei, payloadSize, pDecodedMessageOutputStream);
         break;
-#if JVET_R0294_SUBPIC_HASH
       case SEI::SCALABLE_NESTING:
         sei = new SEIScalableNesting;
         xParseSEIScalableNesting((SEIScalableNesting&)*sei, nalUnitType, nuh_layer_id, payloadSize, vps, sps, hrd, pDecodedMessageOutputStream);
         break;
-#endif
       default:
         for (uint32_t i = 0; i < payloadSize; i++)
         {
diff --git a/source/Lib/EncoderLib/AnnexBwrite.h b/source/Lib/EncoderLib/AnnexBwrite.h
index d891bf47a5..e696e68f68 100644
--- a/source/Lib/EncoderLib/AnnexBwrite.h
+++ b/source/Lib/EncoderLib/AnnexBwrite.h
@@ -42,7 +42,6 @@
 //! \ingroup EncoderLib
 //! \{
 
-#if JVET_R0294_SUBPIC_HASH
 uint32_t writeAnnexBNalUnit(std::ostream& out, const NALUnitEBSP& nalu, bool useLongStartcode)
 {
   uint32_t size = 0; /* size of annexB unit in bytes */
@@ -64,7 +63,6 @@ uint32_t writeAnnexBNalUnit(std::ostream& out, const NALUnitEBSP& nalu, bool use
 
   return size;
 }
-#endif
 
 /**
  * write all NALunits in au to bytestream out in a manner satisfying
@@ -73,49 +71,17 @@ uint32_t writeAnnexBNalUnit(std::ostream& out, const NALUnitEBSP& nalu, bool use
  *  - the initial startcode in the access unit,
  *  - any SPS/PPS nal units
  */
-#if JVET_R0294_SUBPIC_HASH
 std::vector<uint32_t> writeAnnexBAccessUnit(std::ostream& out, const AccessUnit& au)
-#else
-static std::vector<uint32_t> writeAnnexB(std::ostream& out, const AccessUnit& au)
-#endif
 {
   std::vector<uint32_t> annexBsizes;
 
   for (AccessUnit::const_iterator it = au.begin(); it != au.end(); it++)
   {
     const NALUnitEBSP& nalu = **it;
-#if !JVET_R0294_SUBPIC_HASH
-    uint32_t size = 0; /* size of annexB unit in bytes */
-
-    static const uint8_t start_code_prefix[] = {0,0,0,1};
-
-    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DCI || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS
-        || nalu.m_nalUnitType == NAL_UNIT_PPS || nalu.m_nalUnitType == NAL_UNIT_PREFIX_APS || nalu.m_nalUnitType == NAL_UNIT_SUFFIX_APS)
-    {
-      /* From AVC, When any of the following conditions are fulfilled, the
-       * zero_byte syntax element shall be present:
-       *  - the nal_unit_type within the nal_unit() is equal to 7 (sequence
-       *    parameter set) or 8 (picture parameter set),
-       *  - the byte stream NAL unit syntax structure contains the first NAL
-       *    unit of an access unit in decoding order, as specified by subclause
-       *    7.4.1.2.3.
-       */
-      out.write(reinterpret_cast<const char*>(start_code_prefix), 4);
-      size += 4;
-    }
-    else
-    {
-      out.write(reinterpret_cast<const char*>(start_code_prefix+1), 3);
-      size += 3;
-    }
-    out << nalu.m_nalUnitData.str();
-    size += uint32_t(nalu.m_nalUnitData.str().size());
-#else
     const bool useLongStartCode = (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DCI || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS
                                    || nalu.m_nalUnitType == NAL_UNIT_PPS || nalu.m_nalUnitType == NAL_UNIT_PREFIX_APS || nalu.m_nalUnitType == NAL_UNIT_SUFFIX_APS);
     const uint32_t size = writeAnnexBNalUnit(out, nalu, useLongStartCode);
 
-#endif
     annexBsizes.push_back(size);
   }
 
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index 914975c896..0f97da829e 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -528,9 +528,7 @@ protected:
   bool      m_entryPointPresentFlag;                           ///< flag for the presence of entry points
 
   HashType  m_decodedPictureHashSEIType;
-#if JVET_R0294_SUBPIC_HASH
   HashType  m_subpicDecodedPictureHashType;
-#endif
   bool      m_bufferingPeriodSEIEnabled;
   bool      m_pictureTimingSEIEnabled;
   bool      m_frameFieldInfoSEIEnabled;
@@ -1493,10 +1491,8 @@ public:
   void  setEntryPointPresentFlag(bool b)                             { m_entryPointPresentFlag = b; }
   void  setDecodedPictureHashSEIType(HashType m)                     { m_decodedPictureHashSEIType = m; }
   HashType getDecodedPictureHashSEIType() const                      { return m_decodedPictureHashSEIType; }
-#if JVET_R0294_SUBPIC_HASH
   void  setSubpicDecodedPictureHashType(HashType m)                  { m_subpicDecodedPictureHashType = m; }
   HashType getSubpicDecodedPictureHashType() const                   { return m_subpicDecodedPictureHashType; }
-#endif
 
   void  setBufferingPeriodSEIEnabled(bool b)                         { m_bufferingPeriodSEIEnabled = b; }
   bool  getBufferingPeriodSEIEnabled() const                         { return m_bufferingPeriodSEIEnabled; }
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index 5a55bcc346..9dd7351526 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -774,11 +774,7 @@ void EncGOP::xCreatePerPictureSEIMessages (int picInGOP, SEIMessages& seiMessage
 
 }
 
-#if JVET_R0294_SUBPIC_HASH
 void EncGOP::xCreateScalableNestingSEI(SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, const std::vector<int> &targetOLSs, const std::vector<int> &targetLayers, const std::vector<uint16_t>& subpicIDs)
-#else
-void EncGOP::xCreateScalableNestingSEI(SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, const std::vector<uint16_t>& subpicIDs)
-#endif
 {
   SEIMessages tmpMessages;
   while (!nestedSeiMessages.empty())
@@ -787,11 +783,7 @@ void EncGOP::xCreateScalableNestingSEI(SEIMessages& seiMessages, SEIMessages& ne
     nestedSeiMessages.pop_front();
     tmpMessages.push_back(sei);
     SEIScalableNesting *nestingSEI = new SEIScalableNesting();
-#if JVET_R0294_SUBPIC_HASH
     m_seiEncoder.initSEIScalableNesting(nestingSEI, tmpMessages, targetOLSs, targetLayers, subpicIDs);
-#else
-    m_seiEncoder.initSEIScalableNesting(nestingSEI, tmpMessages, subpicIDs);
-#endif
     seiMessages.push_back(nestingSEI);
     tmpMessages.clear();
   }
@@ -3533,7 +3525,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         m_seiEncoder.initDecodedPictureHashSEI(decodedPictureHashSei, recoBuf, digestStr, pcSlice->getSPS()->getBitDepths());
         trailingSeiMessages.push_back(decodedPictureHashSei);
       }
-#if JVET_R0294_SUBPIC_HASH
       // create per-subpicture decoded picture hash SEI messages, if more than one subpicture is enabled
       const PPS* pps = pcPic->cs->pps;
       const int numSubpics = pps->getNumSubPics();
@@ -3555,7 +3546,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
           xCreateScalableNestingSEI(trailingSeiMessages, nestedSEI, targetOLS, targetLayers, subPicIds);
         }
       }
-#endif
 
       m_pcCfg->setEncodedFlag(iGOPid, true);
 
@@ -3628,15 +3618,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
             }
           }
         }
-#if JVET_R0294_SUBPIC_HASH
         // Note (KJS): Using targetOLS = 0, 1 is as random as encapsulating the same SEIs in scalable nesting.
         //             This can just be seen as example regarding how to write scalable nesting, not what to write.
         std::vector<int> targetOLS = {0, 1};
         std::vector<int> targetLayers;
         xCreateScalableNestingSEI(leadingSeiMessages, nestedSeiMessages, targetOLS, targetLayers, subpicIDs);
-#else
-        xCreateScalableNestingSEI(leadingSeiMessages, nestedSeiMessages, subpicIDs);
-#endif
       }
 
       xWriteLeadingSEIMessages( leadingSeiMessages, duInfoSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS(), duData );
diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h
index 50c1339e4e..aaaeeca9d6 100644
--- a/source/Lib/EncoderLib/EncGOP.h
+++ b/source/Lib/EncoderLib/EncGOP.h
@@ -309,11 +309,7 @@ protected:
   void xUpdateDuData(AccessUnit &testAU, std::deque<DUData> &duData);
   void xUpdateTimingSEI(SEIPictureTiming *pictureTimingSEI, std::deque<DUData> &duData, const SPS *sps);
   void xUpdateDuInfoSEI(SEIMessages &duInfoSeiMessages, SEIPictureTiming *pictureTimingSEI, int maxSubLayers);
-#if JVET_R0294_SUBPIC_HASH
   void xCreateScalableNestingSEI(SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, const std::vector<int> &targetOLSs, const std::vector<int> &targetLayers, const std::vector<uint16_t>& subpicIDs);
-#else
-  void xCreateScalableNestingSEI(SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, const std::vector<uint16_t>& subpicIDs);
-#endif
   void xWriteSEI (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId);
   void xWriteSEISeparately (NalUnitType naluType, SEIMessages& seiMessages, AccessUnit &accessUnit, AccessUnit::iterator &auPos, int temporalId);
   void xClearSEIs(SEIMessages& seiMessages, bool deleteMessages);
diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp
index 49451b0898..d342cacd05 100644
--- a/source/Lib/EncoderLib/SEIEncoder.cpp
+++ b/source/Lib/EncoderLib/SEIEncoder.cpp
@@ -396,16 +396,11 @@ void SEIEncoder::initSEISampleAspectRatioInfo(SEISampleAspectRatioInfo* seiSampl
 //! initialize scalable nesting SEI message.
 //! Note: The SEI message structures input into this function will become part of the scalable nesting SEI and will be
 //!       automatically freed, when the nesting SEI is disposed.
-#if JVET_R0294_SUBPIC_HASH
 //  either targetOLS or targetLayer should be active, call with empty vector for the inactive mode
 void SEIEncoder::initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI, SEIMessages &nestedSEIs, const std::vector<int> &targetOLSs, const std::vector<int> &targetLayers, const std::vector<uint16_t> &subpictureIDs)
-#else
-void SEIEncoder::initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI, SEIMessages &nestedSEIs, const std::vector<uint16_t> &subpictureIDs)
-#endif
 {
   CHECK(!(m_isInitialized), "Scalable Nesting SEI already initialized ");
   CHECK(!(scalableNestingSEI != NULL), "No Scalable Nesting SEI object passed");
-#if JVET_R0294_SUBPIC_HASH
   CHECK (targetOLSs.size() > 0 && targetLayers.size() > 0, "Scalable Nesting SEI can apply to either OLS or layer(s), not both");
 
   scalableNestingSEI->m_snOlsFlag = (targetOLSs.size() > 0) ? 1 : 0;  // If the nested SEI messages are picture buffering SEI messages, picture timing SEI messages or sub-picture timing SEI messages, nesting_ols_flag shall be equal to 1, by default case
@@ -442,30 +437,6 @@ void SEIEncoder::initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI,
       scalableNestingSEI->m_snLayerId[i] = targetLayers[i];
     }
   }
-#else
-  //KJS: OLS and layer targeting needs to be fixed for the actual OLSs in the bitstream
-  scalableNestingSEI->m_snOlsFlag = 1;         // If the nested SEI messages are picture buffering SEI messages, picture timing SEI messages or sub-picture timing SEI messages, nesting_ols_flag shall be equal to 1, by default case
-  scalableNestingSEI->m_snNumOlssMinus1 =  1;  // by default the nesting scalable SEI message applies to two OLSs.
-  for (int i = 0; i <= scalableNestingSEI->m_snNumOlssMinus1; i++)
-  {
-    scalableNestingSEI->m_snOlsIdxDeltaMinus1[i] = 0; // first ols to which nesting SEI applies is
-  }
-  for (int i = 0; i <= scalableNestingSEI->m_snNumOlssMinus1; i++)
-  {
-    if (i == 0)
-    {
-      scalableNestingSEI->m_snOlsIdx[i] = scalableNestingSEI->m_snOlsIdxDeltaMinus1[i];
-    }
-    else
-    {
-      scalableNestingSEI->m_snOlsIdx[i] = scalableNestingSEI->m_snOlsIdxDeltaMinus1[i] + scalableNestingSEI->m_snOlsIdxDeltaMinus1[i - 1] + 1;
-    }
-  }
-
-  scalableNestingSEI->m_snAllLayersFlag = 1; // nesting is not applied to all layers
-  scalableNestingSEI->m_snNumLayersMinus1 = 2 - 1;  //nesting_num_layers_minus1
-  scalableNestingSEI->m_snLayerId[0] = 0;
-#endif
   if (!subpictureIDs.empty())
   {
     scalableNestingSEI->m_snSubpicFlag = 1;
diff --git a/source/Lib/EncoderLib/SEIEncoder.h b/source/Lib/EncoderLib/SEIEncoder.h
index bc2984c5f2..0fc26901da 100644
--- a/source/Lib/EncoderLib/SEIEncoder.h
+++ b/source/Lib/EncoderLib/SEIEncoder.h
@@ -72,11 +72,7 @@ public:
 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
   void initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *sei);
 #endif
-#if JVET_R0294_SUBPIC_HASH
   void initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI, SEIMessages &nestedSEIs, const std::vector<int> &targetOLSs, const std::vector<int> &targetLayers, const std::vector<uint16_t> &subpictureIDs);
-#else
-  void initSEIScalableNesting(SEIScalableNesting *scalableNestingSEI, SEIMessages &nestedSEIs, const std::vector<uint16_t> &subpictureIDs);
-#endif
   void initDecodedPictureHashSEI(SEIDecodedPictureHash *sei, PelUnitBuf& pic, std::string &rHashString, const BitDepths &bitDepths);
   void initSEIErp(SEIEquirectangularProjection *sei);
   void initSEISphereRotation(SEISphereRotation *sei);
-- 
GitLab