From 20f7da80b507a698c0f49a910d50555ff1631646 Mon Sep 17 00:00:00 2001
From: zhangkai <zhangkai.video@bytedance.com>
Date: Mon, 17 Feb 2020 19:32:52 -0800
Subject: [PATCH] Add the decoder checking for duplicated DCI

---
 cfg/encoder_randomaccess_vtm.cfg    |  9 ---
 source/App/EncoderApp/EncApp.cpp    |  2 +-
 source/Lib/CommonLib/Slice.cpp      | 89 +++++++++++++++++++++++++++++
 source/Lib/CommonLib/Slice.h        | 22 ++++---
 source/Lib/CommonLib/TypeDef.h      |  8 +--
 source/Lib/DecoderLib/DecLib.cpp    | 26 ++++++++-
 source/Lib/DecoderLib/DecLib.h      |  4 ++
 source/Lib/DecoderLib/VLCReader.cpp |  4 ++
 source/Lib/EncoderLib/EncCfg.h      | 21 +------
 source/Lib/EncoderLib/EncGOP.cpp    | 12 ++--
 source/Lib/EncoderLib/EncLib.cpp    | 10 ----
 source/Lib/EncoderLib/EncLib.h      | 17 ++----
 source/Lib/EncoderLib/VLCWriter.cpp |  4 ++
 source/Lib/EncoderLib/VLCWriter.h   |  9 +--
 14 files changed, 154 insertions(+), 83 deletions(-)

diff --git a/cfg/encoder_randomaccess_vtm.cfg b/cfg/encoder_randomaccess_vtm.cfg
index b11046f7a..b8f56a639 100644
--- a/cfg/encoder_randomaccess_vtm.cfg
+++ b/cfg/encoder_randomaccess_vtm.cfg
@@ -92,16 +92,7 @@ InitialQP                           : 0                # Rate control: initial Q
 RCForceIntraQP                      : 0                # Rate control: force intra QP to be equal to initial QP
 
 #============ VTM settings ======================
-<<<<<<< HEAD
 SEIDecodedPictureHash               : 0
-=======
-LoopFilterTcOffset_div2             : 0
-<<<<<<< HEAD
-SEIDecodedPictureHash               : 1
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
-SEIDecodedPictureHash               : 0
->>>>>>> a03006cc... Fix issues raised by the SW coordinators
 CbQpOffset                          : 0
 CrQpOffset                          : 0
 SameCQPTablesForAllChroma           : 1
diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index a0e734a48..9a8aa4378 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -837,7 +837,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setCostMode                                          ( m_costMode );
   m_cEncLib.setUseRecalculateQPAccordingToLambda                 ( m_recalculateQPAccordingToLambda );
 #if JVET_Q0117_PARAMETER_SETS_CLEANUP
-  m_cEncLib.setDCIEnabled                                         ( m_DCIEnabled );
+  m_cEncLib.setDCIEnabled                                        ( m_DCIEnabled );
 #else
   m_cEncLib.setDecodingParameterSetEnabled                       ( m_decodingParameterSetEnabled );
 #endif
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index f6c9c461a..7df04c0f1 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -3950,6 +3950,95 @@ bool Slice::checkRPR()
   return false;
 }
 
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+bool             operator == (const ConstraintInfo& op1, const ConstraintInfo& op2)
+{
+  if( op1.m_progressiveSourceFlag                        != op2.m_progressiveSourceFlag                          ) return false;
+  if( op1.m_interlacedSourceFlag                         != op2.m_interlacedSourceFlag                           ) return false;
+  if( op1.m_nonPackedConstraintFlag                      != op2.m_nonPackedConstraintFlag                        ) return false;
+  if( op1.m_frameOnlyConstraintFlag                      != op2.m_frameOnlyConstraintFlag                        ) return false;
+  if( op1.m_intraOnlyConstraintFlag                      != op2.m_intraOnlyConstraintFlag                        ) return false;
+  if( op1.m_maxBitDepthConstraintIdc                     != op2.m_maxBitDepthConstraintIdc                       ) return false;
+  if( op1.m_maxChromaFormatConstraintIdc                 != op2.m_maxChromaFormatConstraintIdc                   ) return false;
+  if( op1.m_onePictureOnlyConstraintFlag                 != op2.m_onePictureOnlyConstraintFlag                   ) return false;
+  if( op1.m_lowerBitRateConstraintFlag                   != op2.m_lowerBitRateConstraintFlag                     ) return false;
+  if( op1.m_noQtbttDualTreeIntraConstraintFlag           != op2.m_noQtbttDualTreeIntraConstraintFlag             ) return false;
+  if( op1.m_noPartitionConstraintsOverrideConstraintFlag != op2.m_noPartitionConstraintsOverrideConstraintFlag   ) return false;
+  if( op1.m_noSaoConstraintFlag                          != op2.m_noSaoConstraintFlag                            ) return false;
+  if( op1.m_noAlfConstraintFlag                          != op2.m_noAlfConstraintFlag                            ) return false;
+#if JVET_Q0795_CCALF                                                                              
+  if( op1.m_noCCAlfConstraintFlag                        != op2.m_noCCAlfConstraintFlag                          ) return false;
+#endif                                                                                         
+  if( op1.m_noRefWraparoundConstraintFlag                != op2.m_noRefWraparoundConstraintFlag                  ) return false;
+  if( op1.m_noTemporalMvpConstraintFlag                  != op2.m_noTemporalMvpConstraintFlag                    ) return false;
+  if( op1.m_noSbtmvpConstraintFlag                       != op2.m_noSbtmvpConstraintFlag                         ) return false;
+  if( op1.m_noAmvrConstraintFlag                         != op2.m_noAmvrConstraintFlag                           ) return false;
+  if( op1.m_noBdofConstraintFlag                         != op2.m_noBdofConstraintFlag                           ) return false;
+  if( op1.m_noDmvrConstraintFlag                         != op2.m_noDmvrConstraintFlag                           ) return false;
+  if( op1.m_noCclmConstraintFlag                         != op2.m_noCclmConstraintFlag                           ) return false;
+  if( op1.m_noMtsConstraintFlag                          != op2.m_noMtsConstraintFlag                            ) return false;
+  if( op1.m_noSbtConstraintFlag                          != op2.m_noSbtConstraintFlag                            ) return false;
+  if( op1.m_noAffineMotionConstraintFlag                 != op2.m_noAffineMotionConstraintFlag                   ) return false;
+  if( op1.m_noBcwConstraintFlag                          != op2.m_noBcwConstraintFlag                            ) return false;
+  if( op1.m_noIbcConstraintFlag                          != op2.m_noIbcConstraintFlag                            ) return false;
+  if( op1.m_noCiipConstraintFlag                         != op2.m_noCiipConstraintFlag                           ) return false;
+  if( op1.m_noFPelMmvdConstraintFlag                     != op2.m_noFPelMmvdConstraintFlag                       ) return false;
+#if !JVET_Q0806
+  if( op1.m_noTriangleConstraintFlag                     != op2.m_noTriangleConstraintFlag                       ) return false;
+#endif
+  if( op1.m_noLadfConstraintFlag                         != op2.m_noLadfConstraintFlag                           ) return false;
+  if( op1.m_noTransformSkipConstraintFlag                != op2.m_noTransformSkipConstraintFlag                  ) return false;
+  if( op1.m_noBDPCMConstraintFlag                        != op2.m_noBDPCMConstraintFlag                          ) return false;
+  if( op1.m_noJointCbCrConstraintFlag                    != op2.m_noJointCbCrConstraintFlag                      ) return false;
+  if( op1.m_noQpDeltaConstraintFlag                      != op2.m_noQpDeltaConstraintFlag                        ) return false;
+  if( op1.m_noDepQuantConstraintFlag                     != op2.m_noDepQuantConstraintFlag                       ) return false;
+  if( op1.m_noSignDataHidingConstraintFlag               != op2.m_noSignDataHidingConstraintFlag                 ) return false;
+  if( op1.m_noTrailConstraintFlag                        != op2.m_noTrailConstraintFlag                          ) return false;
+  if( op1.m_noStsaConstraintFlag                         != op2.m_noStsaConstraintFlag                           ) return false;
+  if( op1.m_noRaslConstraintFlag                         != op2.m_noRaslConstraintFlag                           ) return false;
+  if( op1.m_noRadlConstraintFlag                         != op2.m_noRadlConstraintFlag                           ) return false;
+  if( op1.m_noIdrConstraintFlag                          != op2.m_noIdrConstraintFlag                            ) return false;
+  if( op1.m_noCraConstraintFlag                          != op2.m_noCraConstraintFlag                            ) return false;
+  if( op1.m_noGdrConstraintFlag                          != op2.m_noGdrConstraintFlag                            ) return false;
+  if( op1.m_noApsConstraintFlag                          != op2.m_noApsConstraintFlag                            ) return false;
+  return true;
+}
+bool             operator != (const ConstraintInfo& op1, const ConstraintInfo& op2)
+{
+  return !(op1 == op2);
+}
+
+bool             operator == (const ProfileTierLevel& op1, const ProfileTierLevel& op2)
+{
+  if (op1.m_tierFlag        != op2.m_tierFlag) return false;
+  if (op1.m_profileIdc      != op2.m_profileIdc) return false;
+  if (op1.m_numSubProfile   != op2.m_numSubProfile) return false;
+  if (op1.m_levelIdc        != op2.m_levelIdc) return false;
+  if (op1.m_constraintInfo  != op2.m_constraintInfo) return false;
+  if (op1.m_subProfileIdc   != op2.m_subProfileIdc) return false;
+
+  for (int i = 0; i < MAX_TLAYER - 1; i++)
+  {
+    if (op1.m_subLayerLevelPresentFlag[i] != op2.m_subLayerLevelPresentFlag[i])
+    {
+      return false;
+    }
+  }
+  for (int i = 0; i < MAX_TLAYER; i++)
+  {
+    if (op1.m_subLayerLevelIdc[i] != op2.m_subLayerLevelIdc[i])
+    {
+      return false;
+    }
+  }
+  return true;
+}
+bool             operator != (const ProfileTierLevel& op1, const ProfileTierLevel& op2)
+{
+  return !(op1 == op2);
+}
+#endif
+
 #if ENABLE_TRACING
 void xTraceVPSHeader()
 {
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index ec07c4ed8..f855d9ec1 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -482,6 +482,11 @@ public:
   void          setNoGdrConstraintFlag(bool bVal) { m_noGdrConstraintFlag = bVal; }
   bool          getNoApsConstraintFlag() const { return m_noApsConstraintFlag; }
   void          setNoApsConstraintFlag(bool bVal) { m_noApsConstraintFlag = bVal; }
+
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+  friend bool             operator == (const ConstraintInfo& op1, const ConstraintInfo& op2);
+  friend bool             operator != (const ConstraintInfo& op1, const ConstraintInfo& op2);
+#endif
 };
 
 class ProfileTierLevel
@@ -523,6 +528,10 @@ public:
 
   Level::Name             getSubLayerLevelIdc(int i) const             { return m_subLayerLevelIdc[i];   }
   void                    setSubLayerLevelIdc(int i, Level::Name x)    { m_subLayerLevelIdc[i] = x;      }
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+  friend bool             operator == (const ProfileTierLevel& op1, const ProfileTierLevel& op2);
+  friend bool             operator != (const ProfileTierLevel& op1, const ProfileTierLevel& op2);
+#endif
 };
 
 
@@ -853,6 +862,12 @@ public:
   size_t getNumPTLs() const { return m_profileTierLevel.size(); }
   void  setProfileTierLevel(const std::vector<ProfileTierLevel>& val) { m_profileTierLevel = val; }
   const ProfileTierLevel& getProfileTierLevel(int idx) const { return m_profileTierLevel[idx]; }
+  bool  IsIndenticalDCI(const DCI& comparedDCI) const
+  {
+    if(m_maxSubLayersMinus1 != comparedDCI.m_maxSubLayersMinus1) return false;
+    if(m_profileTierLevel != comparedDCI.m_profileTierLevel) return false;
+    return true;
+  }
 };
 #else
 class DPS
@@ -879,16 +894,9 @@ public:
   void  setProfileTierLevel(const std::vector<ProfileTierLevel> &val)   { m_profileTierLevel = val; }
   const ProfileTierLevel& getProfileTierLevel(int idx) const            { return m_profileTierLevel[idx]; }
 };
-<<<<<<< HEAD
-<<<<<<< HEAD
-=======
-#endif
 
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
 #endif
 
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
 
 class VPS
 {
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 9690fd43c..8f003b2b5 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -144,17 +144,11 @@
 
 #define JVET_Q0820_ACT                                    1 // JVET-Q0820: ACT bug fixes and reversible ACT transform 
 
-<<<<<<< HEAD
-<<<<<<< HEAD
 #define JVET_Q0814_DPB                                    1 // JVET-Q0814: DPB capacity is based on picture units regardless of the resoltuion
 #define ENABLING_MULTI_SPS                                1 // Bug fix to enable multiple SPS
 #define SPS_ID_CHECK                                      1 // add SPS id check to be the same within CLVS, related to mixed_nalu_types_in_pic_flag
-=======
 #define JVET_Q0117_PARAMETER_SETS_CLEANUP                 1 // JVET-Q0117: cleanups on parameter sets
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
-#define JVET_Q0117_PARAMETER_SETS_CLEANUP                 1 // JVET-Q0117: cleanups on parameter sets
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
+
 
 #define JVET_Q0353_ACT_SW_FIX                             1 // JVET-Q0353: Bug fix of ACT 
 
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index c387899ac..9c181afd3 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -474,10 +474,14 @@ DecLib::DecLib()
   , m_vps( nullptr )
   , m_scalingListUpdateFlag(true)
   , m_PreScalingListAPSId(-1)
+
 #if JVET_Q0044_SLICE_IDX_WITH_SUBPICS
   , m_maxDecSubPicIdx(0)
   , m_maxDecSliceAddrInSubPic(-1)
 #endif
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+  , m_dci(NULL)
+#endif
 {
 #if ENABLE_SIMD_OPT_BUFFER
   g_pelBufOP.initPelBufOpsX86();
@@ -505,6 +509,14 @@ void DecLib::destroy()
   delete m_apcSlicePilot;
   m_apcSlicePilot = NULL;
 
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+  if( m_dci )
+  {
+    delete m_dci;
+    m_dci = NULL;
+  }
+#endif
+
   m_cSliceDecoder.destroy();
 }
 
@@ -2153,12 +2165,20 @@ void DecLib::xDecodeVPS( InputNALUnit& nalu )
 #if JVET_Q0117_PARAMETER_SETS_CLEANUP
 void DecLib::xDecodeDCI(InputNALUnit& nalu)
 {
-  DCI* dci = new DCI();
   m_HLSReader.setBitstream(&nalu.getBitstream());
 
   CHECK(nalu.m_temporalId, "The value of TemporalId of DCI NAL units shall be equal to 0");
-
-  m_HLSReader.parseDCI(dci);
+  if (!m_dci)
+  {
+    m_dci = new DCI;
+    m_HLSReader.parseDCI(m_dci);
+  }
+  else
+  {
+    DCI dupDCI;
+    m_HLSReader.parseDCI(&dupDCI);
+    CHECK( !m_dci->IsIndenticalDCI(dupDCI), "Two signaled DCIs are different");
+  }
 }
 #else
 void DecLib::xDecodeDPS( InputNALUnit& nalu )
diff --git a/source/Lib/DecoderLib/DecLib.h b/source/Lib/DecoderLib/DecLib.h
index 807e9f62a..3d7d4a5b9 100644
--- a/source/Lib/DecoderLib/DecLib.h
+++ b/source/Lib/DecoderLib/DecLib.h
@@ -162,6 +162,10 @@ private:
 public:
   int                     m_targetSubPicIdx;
 #endif
+
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+  DCI*                    m_dci;
+#endif
 public:
   DecLib();
   virtual ~DecLib();
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 3c5e3e1f8..a2374b219 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -2173,7 +2173,11 @@ void HLSyntaxReader::parseDCI(DCI* dci)
   ptls.resize(numPTLs);
   for (int i = 0; i < numPTLs; i++)
   {
+#if JVET_Q0786_PTL_only
+    parseProfileTierLevel(&ptls[i], true, 0);
+#else
     parseProfileTierLevel(&ptls[i], 0);
+#endif
   }
   dci->setProfileTierLevel(ptls);
 
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index b2ceb4759..228d264f8 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -715,23 +715,16 @@ protected:
 
 #if !JVET_Q0814_DPB
   VPS       m_cVPS;
-<<<<<<< HEAD
-<<<<<<< HEAD
 #endif
-=======
-=======
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
+
 #if JVET_Q0117_PARAMETER_SETS_CLEANUP
   DCI       m_dci;
   bool      m_DCIEnabled;                                     ///< enable Decoding Capability Information (DCI)
 #else
-<<<<<<< HEAD
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
   DPS       m_dps;
   bool      m_decodingParameterSetEnabled;                   ///< enable decoding parameter set
 #endif
+
   bool      m_recalculateQPAccordingToLambda;                 ///< recalculate QP value according to the lambda value
 #if HEVC_SEI
   int       m_activeParameterSetsSEIEnabled;                  ///< enable active parameter set SEI message
@@ -1854,21 +1847,13 @@ public:
 #if !JVET_Q0814_DPB
   void         setVPS(VPS *p)                                        { m_cVPS = *p; }
   VPS *        getVPS()                                              { return &m_cVPS; }
-<<<<<<< HEAD
-<<<<<<< HEAD
 #endif
-=======
-=======
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
+
 
 #if JVET_Q0117_PARAMETER_SETS_CLEANUP
   void         setDCI(DCI *p)                                        { m_dci = *p; }
   DCI*         getDCI()                                              { return &m_dci; }
 #else
-<<<<<<< HEAD
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
   void         setDPS(DPS *p)                                        { m_dps = *p; }
   DPS*         getDPS()                                              { return &m_dps; }
 #endif
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index b161ae83a..59394ac2b 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -395,7 +395,11 @@ int EncGOP::xWriteParameterSets(AccessUnit &accessUnit, Slice *slice, const bool
 #if ENABLING_MULTI_SPS
     if (layerIdx == 0)
     {
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+      actualTotalBits += xWriteDCI(accessUnit, m_pcEncLib->getDCI());
+#else
       actualTotalBits += xWriteDPS(accessUnit, m_pcEncLib->getDPS());
+#endif
       if (slice->getSPS()->getVPSId() != 0)
       {
         actualTotalBits += xWriteVPS(accessUnit, m_pcEncLib->getVPS());
@@ -411,13 +415,7 @@ int EncGOP::xWriteParameterSets(AccessUnit &accessUnit, Slice *slice, const bool
 #else
     actualTotalBits += xWriteDPS( accessUnit, m_pcEncLib->getDPS() );
 #endif
-<<<<<<< HEAD
-<<<<<<< HEAD
-
-=======
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
+#endif
     if( m_pcEncLib->SPSNeedsWriting( slice->getSPS()->getSPSId() ) ) // Note this assumes that all changes to the SPS are made at the EncLib level prior to picture creation (EncLib::xGetNewPicBuffer).
     {
       CHECK( !( bSeqFirst ), "Unspecified error" ); // Implementations that use more than 1 SPS need to be aware of activation issues.
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index 0b3dee4fc..6d11babb4 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -238,21 +238,11 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
 #else
   xInitSPS( sps0, m_cVPS );
   xInitVPS(m_cVPS, sps0);
-<<<<<<< HEAD
-<<<<<<< HEAD
 #endif
 
-=======
 #if JVET_Q0117_PARAMETER_SETS_CLEANUP
   xInitDCI(m_dci, sps0);
 #else
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
-#if JVET_Q0117_PARAMETER_SETS_CLEANUP
-  int dciId = getDCIEnabled() ? 1 : 0;
-  xInitDCI(m_dci, sps0);
-#else
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
   int dpsId = getDecodingParameterSetEnabled() ? 1 : 0;
   xInitDPS(m_dps, sps0, dpsId);
   sps0.setDecodingParameterSetId(m_dps.getDecodingParameterSetId());
diff --git a/source/Lib/EncoderLib/EncLib.h b/source/Lib/EncoderLib/EncLib.h
index f60f7b6fc..5a8ba8c87 100644
--- a/source/Lib/EncoderLib/EncLib.h
+++ b/source/Lib/EncoderLib/EncLib.h
@@ -169,25 +169,16 @@ public:
 
 protected:
   void  xGetNewPicBuffer  ( std::list<PelUnitBuf*>& rcListPicYuvRecOut, Picture*& rpcPic, int ppsId ); ///< get picture buffer which will be processed. If ppsId<0, then the ppsMap will be queried for the first match.
-<<<<<<< HEAD
+#if JVET_Q0117_PARAMETER_SETS_CLEANUP
+  void  xInitDCI(DCI& dci, const SPS& sps); ///< initialize Decoding Capability Information (DCI) from encoder options
+#else
   void  xInitDPS          (DPS &dps, const SPS &sps, const int dpsId); ///< initialize DPS from encoder options
+#endif
 #if JVET_Q0814_DPB
   void  xInitVPS( const SPS& sps ); ///< initialize VPS from encoder options
   void  xInitSPS( SPS& sps );       ///< initialize SPS from encoder options
 #else
   void  xInitVPS(VPS& vps, const SPS& sps); ///< initialize VPS from encoder options
-=======
-  void  xInitVPS(VPS& vps, const SPS& sps); ///< initialize VPS from encoder options
-
-#if JVET_Q0117_PARAMETER_SETS_CLEANUP
-  void  xInitDCI(DCI& dci, const SPS& sps); ///< initialize Decoding Capability Information (DCI) from encoder options
-#else
-  void  xInitDPS          (DPS &dps, const SPS &sps, const int dpsId); ///< initialize DPS from encoder options
-#endif
-<<<<<<< HEAD
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
   void  xInitSPS          ( SPS& sps, VPS& vps );       ///< initialize SPS from encoder options
 #endif
   void  xInitPPS          (PPS &pps, const SPS &sps); ///< initialize PPS from encoder options
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index a919235c1..e5828b408 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -1479,7 +1479,11 @@ void HLSWriter::codeDCI(const DCI* dci)
   for (int i = 0; i < numPTLs; i++)
   {
     ProfileTierLevel ptl = dci->getProfileTierLevel(i);
+#if JVET_Q0786_PTL_only
+    codeProfileTierLevel(&ptl, true, 0);
+#else
     codeProfileTierLevel(&ptl, 0);
+#endif
   }
   WRITE_FLAG(0, "dci_extension_flag");
   xWriteRbspTrailingBits();
diff --git a/source/Lib/EncoderLib/VLCWriter.h b/source/Lib/EncoderLib/VLCWriter.h
index f69aef807..ce024a83f 100644
--- a/source/Lib/EncoderLib/VLCWriter.h
+++ b/source/Lib/EncoderLib/VLCWriter.h
@@ -135,17 +135,10 @@ public:
   void  codeDCI                 ( const DCI* dci );
 #else
   void  codeDPS                 ( const DPS* dps );
-<<<<<<< HEAD
-<<<<<<< HEAD
+#endif
 #if JVET_Q0775_PH_IN_SH
   void  codePictureHeader       ( PicHeader* picHeader, bool writeRbspTrailingBits );
 #else
-=======
-#endif
->>>>>>> effa8e16... Commit Q0117. HLS clenup: DPS is changed to DCI
-=======
-#endif
->>>>>>> f765570c... Commit Q0117. HLS clenup: DPS is changed to DCI
   void  codePictureHeader       ( PicHeader* picHeader );
 #endif
   void  codeSliceHeader         ( Slice* pcSlice );
-- 
GitLab