diff --git a/cfg/multi-layer/two_layers_max_tid_ref_pic.cfg b/cfg/multi-layer/two_layers_max_tid_ref_pic.cfg
index fef7c148dd04e32112cc8003093f827359985f18..0e9454cbcdb781e22057ecb4ebc6775dd65eeb64 100644
--- a/cfg/multi-layer/two_layers_max_tid_ref_pic.cfg
+++ b/cfg/multi-layer/two_layers_max_tid_ref_pic.cfg
@@ -7,7 +7,6 @@ MaxSublayers                  : 7    # allow up to 7 temporal layers
 DefaultPtlDpbHrdMaxTidFlag    : 0
 AllIndependentLayersFlag      : 0
 
-MaxTidILRefPicsPlus1          : 3    # don't use pictures with temoporal_id > 2 for inter-layer reference
 #======== OLSs ===============
 EachLayerIsAnOlsFlag          : 0
 OlsModeIdc                    : 2
@@ -20,6 +19,7 @@ LayerId0                      : 0
 LayerId1                      : 1
 NumRefLayers1                 : 1
 RefLayerIdx1                  : 0
+MaxTidILRefPicsPlus11         : layer-0:3    # don't use pictures with temoporal_id > 2 for inter-layer reference
 #======== OLS-0 ===============
 OlsPTLIdx0                    : 0
 #======== OLS-1 ===============
diff --git a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp
index 4aa974b05bad24aa22c2f1a4992599905e0d4c0a..e0fac0f85051573c2feb47b6283688d4e13b2ed9 100644
--- a/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp
+++ b/source/App/BitstreamExtractorApp/BitstreamExtractorApp.cpp
@@ -771,10 +771,17 @@ uint32_t BitstreamExtractorApp::decode()
         msg (VERBOSE, "APS Info: APS ID = %d Type = %d Layer = %d\n", aps->getAPSId(), aps->getAPSType(), nalu.m_nuhLayerId);
         int apsId = aps->getAPSId();
         int apsType = aps->getAPSType();
-        // note: storeAPS may invalidate the aps pointer!
-        m_parameterSetManager.storeAPS( aps, nalu.getBitstream().getFifo() );
-        // get APS back
-        aps = m_parameterSetManager.getAPS(apsId, apsType);
+#if JVET_S0219_ASPECT1
+        if (writeInpuNalUnitToStream)
+        {
+#endif
+          // note: storeAPS may invalidate the aps pointer!
+          m_parameterSetManager.storeAPS(aps, nalu.getBitstream().getFifo());
+          // get APS back
+          aps = m_parameterSetManager.getAPS(apsId, apsType);
+#if JVET_S0219_ASPECT1
+        }
+#endif
       }
 
       if (nalu.m_nalUnitType == NAL_UNIT_PH)
diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index 06012eb08aa0fd4b6b6a98b3f925c1f64082db4f..5737dc1ab2822350f3c190c0ed1f34eb6f4abdc7 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -140,6 +140,19 @@ void EncApp::xInitLibCfg()
           {
             vps.setDirectRefLayerFlag(i, j, false);
           }
+#if JVET_R0193
+          bool bSetMaxTid = false;
+          for (int t = 0; t < vps.getMaxSubLayers(); t++)
+          {
+            if (m_cfgVPSParameters.m_maxTidILRefPicsPlus1Str[i].find("layer-"+to_string(j)+":"+to_string(t)) != std::string::npos)
+            {
+              vps.setMaxTidIlRefPicsPlus1(i, j, t);
+              bSetMaxTid = true;
+            }
+          }
+          if(!bSetMaxTid)
+            vps.setMaxTidIlRefPicsPlus1(i, j, vps.getMaxSubLayers());
+#endif
         }
       }
     }
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index 652d5721fb604a53aa207421154839864401fa94..47959f321d674fa6e3f92f2ba40f57203be3f62e 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -1400,7 +1400,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ( "OlsOutputLayer%d",                               m_olsOutputLayerStr, string(""), MAX_VPS_LAYERS, "Output layer index of i-th OLS")
   ( "NumPTLsInVPS",                                   m_numPtlsInVps,                               1, "Number of profile_tier_level structures in VPS" )
   ( "AvoidIntraInDepLayers",                          m_avoidIntraInDepLayer,                    true, "Replaces I pictures in dependent layers with B pictures" )
+#if JVET_R0193
+  ( "MaxTidILRefPicsPlus1%d",                         m_cfgVPSParameters.m_maxTidILRefPicsPlus1Str, string(""), MAX_VPS_LAYERS, "Maximum temporal ID for inter-layer reference pictures plus 1 of i-th layer, 0 for IRAP only")
+#else
   ( "MaxTidILRefPicsPlus1",                           m_cfgVPSParameters.m_maxTidILRefPicsPlus1,   -1, "Maximum temporal ID for inter-layer reference pictures plus 1, 0 for IRAP only" )
+#endif
     ;
 
   opts.addOptions()
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index 06db6fa2305385b7f97f49f4cd2a27f2a69d1599..0e2c0ecd7556c5736dc66912ed4d970eec6472a4 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -2198,12 +2198,18 @@ VPS::VPS()
   {
     m_vpsLayerId[i] = 0;
     m_vpsIndependentLayerFlag[i] = true;
+#if !JVET_R0193
     m_vpsMaxTidIlRefPicsPlus1[i] = 7;
+#endif
     m_generalLayerIdx[i] = 0;
     for (int j = 0; j < MAX_VPS_LAYERS; j++)
     {
       m_vpsDirectRefLayerFlag[i][j] = 0;
       m_directRefLayerIdx[i][j] = MAX_VPS_LAYERS;
+#if JVET_R0193
+      m_vpsMaxTidIlRefPicsPlus1[i][j] = 7;
+#endif
+
       m_interLayerRefIdx[i][i] = NOT_VALID;
     }
   }
@@ -2292,7 +2298,11 @@ void VPS::deriveOutputLayerSets()
 
   m_numOutputLayersInOls[0] = 1;
   m_outputLayerIdInOls[0][0] = m_vpsLayerId[0];
+#if JVET_R0193_S0141
+  m_numSubLayersInLayerInOLS[0][0] = m_ptlMaxTemporalId[m_olsPtlIdx[0]] + 1;
+#else
   m_numSubLayersInLayerInOLS[0][0] = m_vpsMaxSubLayers;
+#endif
   layerUsedAsOutputLayerFlag[0] = 1;
   for (int i = 1; i < m_maxLayers; i++)
   {
@@ -2305,18 +2315,38 @@ void VPS::deriveOutputLayerSets()
       layerUsedAsOutputLayerFlag[i] = 0;
     }
   }
-
   for( int i = 1; i < m_totalNumOLSs; i++ )
   {
     if( m_vpsEachLayerIsAnOlsFlag || m_vpsOlsModeIdc == 0 )
     {
       m_numOutputLayersInOls[i] = 1;
       m_outputLayerIdInOls[i][0] = m_vpsLayerId[i];
+#if JVET_R0193_S0141
+      if (m_vpsEachLayerIsAnOlsFlag) 
+        m_numSubLayersInLayerInOLS[i][0] = m_ptlMaxTemporalId[m_olsPtlIdx[i]] + 1;
+      else
+      {
+        m_numSubLayersInLayerInOLS[i][i] = m_ptlMaxTemporalId[m_olsPtlIdx[i]] + 1;
+        for (int k = i - 1; k >= 0; k--)
+        {
+          m_numSubLayersInLayerInOLS[i][k] = 0;
+          for (int m = k + 1; m <= i; m++)
+          {
+            uint32_t maxSublayerNeeded = std::min((uint32_t)m_numSubLayersInLayerInOLS[i][m], m_vpsMaxTidIlRefPicsPlus1[m][k]);
+            if (m_vpsDirectRefLayerFlag[m][k] && m_numSubLayersInLayerInOLS[i][k] < maxSublayerNeeded)
+            {
+              m_numSubLayersInLayerInOLS[i][k] = maxSublayerNeeded;
+            }
+          }
+      }
+      }
+#else
       for(int  j = 0; j < i  &&  ( m_vpsOlsModeIdc  ==  0 ); j++ )
       {
         m_numSubLayersInLayerInOLS[i][j] = m_vpsMaxTidIlRefPicsPlus1[i];
       }
       m_numSubLayersInLayerInOLS[i][i] = m_vpsMaxSubLayers;
+#endif
     }
     else if( m_vpsOlsModeIdc == 1 )
     {
@@ -2325,12 +2355,19 @@ void VPS::deriveOutputLayerSets()
       for( int j = 0; j < m_numOutputLayersInOls[i]; j++ )
       {
         m_outputLayerIdInOls[i][j] = m_vpsLayerId[j];
+#if JVET_R0193_S0141
+        m_numSubLayersInLayerInOLS[i][j] = m_ptlMaxTemporalId[m_olsPtlIdx[i]] + 1;
+#else
         m_numSubLayersInLayerInOLS[i][j] = m_vpsMaxSubLayers;
+#endif
       }
     }
     else if( m_vpsOlsModeIdc == 2 )
     {
       int j = 0;
+#if JVET_R0193
+      int highestIncludedLayer = 0;
+#endif
       for( j = 0; j  <  m_maxLayers; j++ )
       {
         m_numSubLayersInLayerInOLS[i][j] = 0;
@@ -2341,10 +2378,17 @@ void VPS::deriveOutputLayerSets()
         if( m_vpsOlsOutputLayerFlag[i][k] )
         {
           layerIncludedInOlsFlag[i][k] = 1;
+#if JVET_R0193
+          highestIncludedLayer = k;
+#endif
           layerUsedAsOutputLayerFlag[k] = 1;
           outputLayerIdx[i][j] = k;
           m_outputLayerIdInOls[i][j++] = m_vpsLayerId[k];
+#if JVET_R0193_S0141
+          m_numSubLayersInLayerInOLS[i][k] = m_ptlMaxTemporalId[m_olsPtlIdx[i]] + 1;
+#else
           m_numSubLayersInLayerInOLS[i][k] = m_vpsMaxSubLayers;
+#endif
         }
       }
       m_numOutputLayersInOls[i] = j;
@@ -2355,12 +2399,30 @@ void VPS::deriveOutputLayerSets()
         for( int k = 0; k < numRefLayers[idx]; k++ )
         {
           layerIncludedInOlsFlag[i][refLayerIdx[idx][k]] = 1;
+#if !JVET_R0193
           if( m_numSubLayersInLayerInOLS[i][ refLayerIdx[idx][k] ] < m_vpsMaxTidIlRefPicsPlus1[ m_outputLayerIdInOls[i][j] ] )
           {
             m_numSubLayersInLayerInOLS[i][ refLayerIdx[idx][k] ] =  m_vpsMaxTidIlRefPicsPlus1[ m_outputLayerIdInOls[i][j] ];
           }
+#endif
+        }
+      }
+#if JVET_R0193
+      for (int k = highestIncludedLayer - 1; k >= 0; k--)
+      {
+        if (layerIncludedInOlsFlag[i][k] && !m_vpsOlsOutputLayerFlag[i][k])
+        {
+          for (int m = k + 1; m <= highestIncludedLayer; m++)
+          {
+            uint32_t maxSublayerNeeded = std::min((uint32_t)m_numSubLayersInLayerInOLS[i][m], m_vpsMaxTidIlRefPicsPlus1[m][k]);
+            if (m_vpsDirectRefLayerFlag[m][k] && layerIncludedInOlsFlag[i][m] && m_numSubLayersInLayerInOLS[i][k] < maxSublayerNeeded)
+            {
+              m_numSubLayersInLayerInOLS[i][k] = maxSublayerNeeded;
+            }
+          }
         }
       }
+#endif
     }
   }
   for (int i = 0; i < m_maxLayers; i++)
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 37f7385be8286b794e8fe7130b4aac1d314d9630..5721b74ebe9998f545f09bedd7bddc9ae95b1d64 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -937,7 +937,11 @@ private:
   uint32_t              m_vpsCfgPredDirection[MAX_VPS_SUBLAYERS];
   bool                  m_vpsIndependentLayerFlag[MAX_VPS_LAYERS];
   bool                  m_vpsDirectRefLayerFlag[MAX_VPS_LAYERS][MAX_VPS_LAYERS];
+#if JVET_R0193
+  uint32_t              m_vpsMaxTidIlRefPicsPlus1[MAX_VPS_LAYERS][MAX_VPS_LAYERS];
+#else
   uint32_t              m_vpsMaxTidIlRefPicsPlus1[MAX_VPS_LAYERS];
+#endif
   bool                  m_vpsEachLayerIsAnOlsFlag;
   uint32_t              m_vpsOlsModeIdc;
   uint32_t              m_vpsNumOutputLayerSets;
@@ -1011,9 +1015,13 @@ public:
 
   bool              getIndependentLayerFlag(uint32_t layerIdx) const { return m_vpsIndependentLayerFlag[layerIdx]; }
   void              setIndependentLayerFlag(uint32_t layerIdx, bool t) { m_vpsIndependentLayerFlag[layerIdx] = t; }
-
+#if JVET_R0193
+  uint32_t          getMaxTidIlRefPicsPlus1(uint32_t layerIdx, uint32_t refLayerIdx) const { return m_vpsMaxTidIlRefPicsPlus1[layerIdx][refLayerIdx]; }
+  void              setMaxTidIlRefPicsPlus1(uint32_t layerIdx, uint32_t refLayerIdx, uint32_t i) { m_vpsMaxTidIlRefPicsPlus1[layerIdx][refLayerIdx] = i; }
+#else
   uint32_t          getMaxTidIlRefPicsPlus1(uint32_t layerIdx) const { return m_vpsMaxTidIlRefPicsPlus1[layerIdx]; }
   void              setMaxTidIlRefPicsPlus1(uint32_t layerIdx, uint32_t i) { m_vpsMaxTidIlRefPicsPlus1[layerIdx] = i; }
+#endif
 
   bool              getDirectRefLayerFlag(uint32_t layerIdx, uint32_t refLayerIdx) const { return m_vpsDirectRefLayerFlag[layerIdx][refLayerIdx]; }
   void              setDirectRefLayerFlag(uint32_t layerIdx, uint32_t refLayerIdx, bool t) { m_vpsDirectRefLayerFlag[layerIdx][refLayerIdx] = t; }
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index afa063aa5572f3b92db706ae6c3a87436a1507eb..54597162c6b4ace2d27e2d3873888aaa5656dbf7 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -52,7 +52,27 @@
 
 // clang-format off
 //########### place macros to be removed in next cycle below this line ###############
+#define JVET_S0219_ASPECT1                                1 // JVET-S0219 aspect1 : removal non-referred APS parameter set in the non-output layer. 
+<<<<<<< .mine
+#define JVET_S0121_ASPECT2                                1 // JVET-S0121 aspect 2: Remove the condition check of pps_deblocking_filter_override_enabled_flag for the signalling of ph_deblocking_params_present_flag
+=======
 
+>>>>>>> .theirs
+
+#define JVET_R0193                                        1 // JVET-R0193: signalling of the number of maximum sublayers used for inter-layer prediction for each layer
+<<<<<<< .mine
+
+=======
+
+>>>>>>> .theirs
+#define JVET_R0193_S0141                                  1 // JVET-S0141 item 47 : item 47: In the general sub-bitstream extraction process, specify the conditions under which an output sub-bitstream is required to be a conforming bitstream such that the value of tIdTarget is specified to be in the range of 0 to vps_ptl_max_tid[ vps_ols_ptl_idx[ targetOlsIdx ] ], inclusive (instead of 0 to 6 inclusive). (JVET-S0158 aspect 1)
+<<<<<<< .mine
+
+#define JVET_S0058_GCI                                    1 // no_mtt_constraint_flag and no_weightedpred_constraint_flag
+=======
+
+
+>>>>>>> .theirs
 
 //########### place macros to be be kept below this line ###############
 #define JVET_S0257_DUMP_360SEI_MESSAGE                    1 // Software support of 360 SEI messages
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 6ee2a25e28a45a1c893b05f3b277e86d3cb5c715..5497d189331faf02a7af0c18cf990053e03c7c80 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -2184,6 +2184,31 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS)
       READ_FLAG(uiCode, "vps_independent_layer_flag");     pcVPS->setIndependentLayerFlag(i, uiCode);
       if (!pcVPS->getIndependentLayerFlag(i))
       {
+#if JVET_R0193
+        READ_FLAG(uiCode, "max_tid_ref_present_flag[ i ]");
+        bool presentFlag = uiCode;
+        uint16_t sumUiCode = 0;
+        for (int j = 0, k = 0; j < i; j++)
+        {
+          READ_FLAG(uiCode, "vps_direct_ref_layer_flag"); pcVPS->setDirectRefLayerFlag(i, j, uiCode);
+          if (uiCode)
+          {
+            pcVPS->setInterLayerRefIdc(i, j, k);
+            pcVPS->setDirectRefLayerIdx(i, k++, j);
+            sumUiCode++;
+          }
+          if (presentFlag && pcVPS->getDirectRefLayerFlag(i, j))
+          {
+            READ_CODE(3, uiCode, "max_tid_il_ref_pics_plus1[ i ][ j ]");
+            pcVPS->setMaxTidIlRefPicsPlus1(i, j, uiCode);
+          }
+          else
+          {
+            pcVPS->setMaxTidIlRefPicsPlus1(i, j, 7);
+          }
+        }
+        CHECK(sumUiCode == 0, "There has to be at least one value of j such that the value of vps_direct_dependency_flag[ i ][ j ] is equal to 1,when vps_independent_layer_flag[ i ] is equal to 0 ");
+#else
         uint16_t sumUiCode = 0;
         for (int j = 0, k = 0; j < i; j++)
         {
@@ -2206,6 +2231,7 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS)
         {
           pcVPS->setMaxTidIlRefPicsPlus1(i, 7);
         }
+#endif
       }
     }
   }
diff --git a/source/Lib/EncoderLib/EncCfgParam.h b/source/Lib/EncoderLib/EncCfgParam.h
index 1635611b07004601d9f1061778bcf8dad81436c5..418cd1a089c2b05b3c2db26847115b04af555cee 100644
--- a/source/Lib/EncoderLib/EncCfgParam.h
+++ b/source/Lib/EncoderLib/EncCfgParam.h
@@ -48,12 +48,18 @@ class CfgVPSParameters
 {
 public:
   CfgVPSParameters()
+#if !JVET_R0193
   : m_maxTidILRefPicsPlus1(-1)
+#endif
   {}
 
   virtual ~CfgVPSParameters(){}
 
+#if JVET_R0193
+  std::string m_maxTidILRefPicsPlus1Str[MAX_VPS_LAYERS];
+#else
   int m_maxTidILRefPicsPlus1;
+#endif
 };
 
 class CfgSEISubpictureLevel
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index 4e6d94babbff198b9ea94713e0440db44fc72aeb..cb5dd2b16fe64584e9edeaebd6dc02c494248dbb 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -5333,9 +5333,19 @@ void EncGOP::applyDeblockingFilterParameterSelection( Picture* pcPic, const uint
 }
 #endif
 
+#if JVET_R0193
+bool EncGOP::xCheckMaxTidILRefPics(int layerIdx, Picture* refPic, bool currentPicIsIRAP)
+#else
 bool EncGOP::xCheckMaxTidILRefPics(Picture* refPic, bool currentPicIsIRAP)
+#endif
 {
+#if JVET_R0193
+  const VPS* vps = refPic->cs->vps;
+  int refLayerIdx = vps == nullptr ? 0 : vps->getGeneralLayerIdx(refPic->layerId);
+  const int maxTidILRefPicsPlus1 = vps->getMaxTidIlRefPicsPlus1(layerIdx, refLayerIdx);
+#else
   const int maxTidILRefPicsPlus1 = m_pcCfg->getVPSParameters().m_maxTidILRefPicsPlus1;
+#endif
 
   // -1 means not set
   if (maxTidILRefPicsPlus1 < 0)
@@ -5442,7 +5452,11 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL
         rpcPic = *( iterPic++ );
         int refLayerIdx = vps->getGeneralLayerIdx( rpcPic->layerId );
         if (rpcPic->referenced && rpcPic->getPOC() == pic->getPOC() && vps->getDirectRefLayerFlag(layerIdx, refLayerIdx)
+#if JVET_R0193
+            && xCheckMaxTidILRefPics(layerIdx, rpcPic, slice->isIRAP()))
+#else
             && xCheckMaxTidILRefPics(rpcPic, slice->isIRAP()) )
+#endif
         {
           pLocalRPL0->setRefPicIdentifier( refPicIdxL0, 0, true, true, vps->getInterLayerRefIdc( layerIdx, refLayerIdx ) );
           refPicIdxL0++;
@@ -5564,7 +5578,11 @@ void EncGOP::xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicL
         rpcPic = *( iterPic++ );
         int refLayerIdx = vps->getGeneralLayerIdx( rpcPic->layerId );
         if (rpcPic->referenced && rpcPic->getPOC() == pic->getPOC() && vps->getDirectRefLayerFlag(layerIdx, refLayerIdx)
+#if JVET_R0193
+            && xCheckMaxTidILRefPics( layerIdx, rpcPic, slice->isIRAP()))
+#else
             && xCheckMaxTidILRefPics( rpcPic, slice->isIRAP() ) )
+#endif
         {
           pLocalRPL1->setRefPicIdentifier( refPicIdxL1, 0, true, true, vps->getInterLayerRefIdc( layerIdx, refLayerIdx ) );
           refPicIdxL1++;
diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h
index 011847bcfe558d90179af4129c3b0cdb07ddb6ea..41750c24c4da036d4f5c98126e1c822b19831904 100644
--- a/source/Lib/EncoderLib/EncGOP.h
+++ b/source/Lib/EncoderLib/EncGOP.h
@@ -331,7 +331,11 @@ protected:
   void applyDeblockingFilterParameterSelection( Picture* pcPic, const uint32_t numSlices, const int gopID );
 #endif
   void xCreateExplicitReferencePictureSetFromReference( Slice* slice, PicList& rcListPic, const ReferencePictureList *rpl0, const ReferencePictureList *rpl1 );
+#if JVET_R0193
+  bool xCheckMaxTidILRefPics(int layerIdx, Picture* refPic, bool currentPicIsIRAP);
+#else
   bool xCheckMaxTidILRefPics(Picture* refPic, bool currentPicIsIRAP);
+#endif
 };// END CLASS DEFINITION EncGOP
 
 //! \}
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index aa9ee11af099c5db4aee047aef4e6df800cedfe5..b1ab472beb375dace0e6b4ee2c4fe425bbeebd0d 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -1138,6 +1138,7 @@ void EncLib::xInitVPS( const SPS& sps )
     m_vps->setHrdMaxTid(i, m_vps->getMaxSubLayers() - 1);
   }
 
+#if !JVET_R0193
   if (m_cfgVPSParameters.m_maxTidILRefPicsPlus1 >= 0)
   {
     for (int i = 0; i < m_vps->getMaxLayers(); i++)
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 639cb51f0827708b44c7c961c67f3abaed3ca41f..1cb60edfd6e28056254b9703d2c679d4f3638475 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -1347,6 +1347,22 @@ void HLSWriter::codeVPS(const VPS* pcVPS)
       WRITE_FLAG(pcVPS->getIndependentLayerFlag(i), "vps_independent_layer_flag");
       if (!pcVPS->getIndependentLayerFlag(i))
       {
+#if JVET_R0193
+        bool presentFlag = false;
+        for (int j = 0; j < i; j++)
+        {
+          presentFlag |= ((pcVPS->getMaxTidIlRefPicsPlus1(i, j) != 7) && pcVPS->getDirectRefLayerFlag(i, j));
+        }
+        WRITE_FLAG(presentFlag, "max_tid_ref_present_flag[ i ]");
+        for (int j = 0; j < i; j++)
+        {
+          WRITE_FLAG(pcVPS->getDirectRefLayerFlag(i, j), "vps_direct_ref_layer_flag");
+          if (presentFlag && pcVPS->getDirectRefLayerFlag(i, j))
+          {
+            WRITE_CODE(pcVPS->getMaxTidIlRefPicsPlus1(i, j), 3, "max_tid_il_ref_pics_plus1[ i ][ j ]");
+          }
+        }
+#else
         for (int j = 0; j < i; j++)
         {
           WRITE_FLAG(pcVPS->getDirectRefLayerFlag(i, j), "vps_direct_dependency_flag");
@@ -1357,6 +1373,7 @@ void HLSWriter::codeVPS(const VPS* pcVPS)
         {
           WRITE_CODE(pcVPS->getMaxTidIlRefPicsPlus1(i), 3, "vps_max_tid_il_ref_pics_plus1[ i ]");
         }
+#endif
       }
     }
   }