diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index e2695907e10dffbf5c2a1251747cba2eef71ac5e..88235d70b7016bc4cff0a0b3c9e2ce32850465fc 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -434,6 +434,10 @@ void EncApp::xInitLibCfg()
     m_cEncLib.setNoSgpmConstraintFlag(m_noSgpmConstraintFlag);
     CHECK(m_noSgpmConstraintFlag && m_sgpm, "SGPM shall be deactivated when m_noSgpmConstraintFlag is equal to 1");
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+    m_cEncLib.setNoTmrlConstraintFlag(m_noTmrlConstraintFlag);
+    CHECK(m_noTmrlConstraintFlag && m_tmrl, "TMRL shall be deactivated when m_noTmrlConstraintFlag is equal to 1");
+#endif
 #if ENABLE_OBMC
     m_cEncLib.setNoObmcConstraintFlag(m_noObmcConstraintFlag);
     CHECK(m_noObmcConstraintFlag && m_OBMC, "OBMC shall be deactivated when m_noObmcConstraintFlag is equal to 1");
@@ -574,6 +578,9 @@ void EncApp::xInitLibCfg()
 #if JVET_AB0155_SGPM
     m_cEncLib.setNoSgpmConstraintFlag(false);
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+    m_cEncLib.setNoTmrlConstraintFlag(false);
+#endif
 #if ENABLE_OBMC
     m_cEncLib.setNoObmcConstraintFlag(false);
 #endif
@@ -884,6 +891,9 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setUseSgpmNoBlend                                    ( m_sgpmNoBlend );
 #endif
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  m_cEncLib.setUseTmrl                                           ( m_tmrl );
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   m_cEncLib.setUseCccm                                           ( m_cccm );
 #endif
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index 3c5dad6a3acd7482c08b3c93bfb64e4cdf81195d..039e84a72ce36d703c53e661a154df099e3a7692 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -929,6 +929,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
 #if JVET_AB0155_SGPM
   ("NoSgpmConstraintFlag",                             m_noSgpmConstraintFlag,                          false, "Indicate that SGPM is deactivated")
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  ("NoTmrlConstraintFlag",                             m_noTmrlConstraintFlag,                          false, "Indicate that TMRL is deactivated")
+#endif
 #if ENABLE_OBMC
   ("NoObmcConstraintFlag",                             m_noObmcConstraintFlag,                            false, "Indicate that OBMC is deactivated")
 #endif
@@ -1111,6 +1114,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ( "SGPMnoBlend",                                    m_sgpmNoBlend,                                     false,  "Enable spatial geometric partitioning mode without blending\n" )
 #endif
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  ("TMRL",                                            m_tmrl,                                            true,  "Enable template based multiple reference line intra prediction\n")
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   ( "CCCM",                                           m_cccm,                                               2,  "CCCM mode (0:off, 1:on, 2:on subsampling and no subsampling)  [default: 2]")
 #endif
@@ -5409,6 +5415,9 @@ void EncAppCfg::xPrintParameter()
   msg(VERBOSE, "SGPMnoBlend:%d ", m_sgpmNoBlend);
 #endif
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  msg(VERBOSE, "TMRL:%d ", m_tmrl);
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   msg(VERBOSE, "CCCM:%d ", m_cccm);
 #endif
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index a01940401f4faa9bfa394b2fcf5aefb93c584526..88bab28bee4b83642fef136aa1304a35271964c2 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -211,6 +211,9 @@ protected:
 #if JVET_AB0155_SGPM
   bool      m_noSgpmConstraintFlag;
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool      m_noTmrlConstraintFlag;
+#endif
 #if ENABLE_OBMC
   bool      m_noObmcConstraintFlag;
 #endif
@@ -466,6 +469,9 @@ protected:
   bool      m_sgpmNoBlend;
 #endif
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool      m_tmrl;
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   int       m_cccm;
 #endif
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 26bb5171b907fdb2889f86df3ee6c7e74d778373..4f41a1d2ae9c224bfa0548327bf9683569e37780 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -328,6 +328,9 @@ class ConstraintInfo
 #if JVET_AB0155_SGPM
   bool              m_noSgpmConstraintFlag;
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool              m_noTmrlConstraintFlag;
+#endif
 #if ENABLE_OBMC
   bool              m_noObmcConstraintFlag;
 #endif
@@ -642,6 +645,10 @@ public:
   bool          getNoSgpmConstraintFlag() const { return m_noSgpmConstraintFlag; }
   void          setNoSgpmConstraintFlag(bool bVal) { m_noSgpmConstraintFlag = bVal; }
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool          getNoTmrlConstraintFlag() const { return m_noTmrlConstraintFlag; }
+  void          setNoTmrlConstraintFlag(bool bVal) { m_noTmrlConstraintFlag = bVal; }
+#endif
 #if ENABLE_OBMC
   bool          getNoObmcConstraintFlag() const { return m_noObmcConstraintFlag; }
   void          setNoObmcConstraintFlag(bool bVal) { m_noObmcConstraintFlag = bVal; }
@@ -1751,6 +1758,9 @@ private:
 #if JVET_AB0155_SGPM
   bool              m_sgpm;
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool              m_tmrl;
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   int               m_cccm;
 #endif
@@ -2355,6 +2365,10 @@ void                    setCCALFEnabledFlag( bool b )
   void      setUseSgpm         (bool b)                                          { m_sgpm = b; }
   bool      getUseSgpm         ()                                      const     { return m_sgpm; }
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  void      setUseTmrl         (bool b)                                          { m_tmrl = b; }
+  bool      getUseTmrl         ()                                      const     { return m_tmrl; }
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   void      setUseCccm( int i )                                                  { m_cccm = i; }
   int       getUseCccm()                                               const     { return m_cccm; }
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index e00bd170c0fd3af9ab5bbeffe5318ee7850f85cf..c31bb678094eee1227a30f53c076226a14336efe 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -171,6 +171,9 @@
 #define JVET_AB0155_SGPM                                  1 // JVET-AB0155: Spatial geometric partitioning mode
 #define JVET_AC0189_SGPM_NO_BLENDING                      1 // JVET-AC0189: Allow no blending for SGPM
 #define JVET_AB0157_TMRL                                  1 // JVET-AB0157: Template-based multiple reference line intra prediction
+#if JVET_AB0157_TMRL
+#define JVET_AD0082_TMRL_CONFIG                           1 // JVET-AD0082: a configuration option for TMRL
+#endif
 #define JVET_AB0157_INTRA_FUSION                          1 // JVET-AB0157: Intra prediction fusion
 #define JVET_AC0094_REF_SAMPLES_OPT                       1 // JVET-AC0094: Optimizing the use of reference samples
 #define JVET_AC0105_DIRECTIONAL_PLANAR                    1 // JVET-AC0105: Directional planar
diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp
index b6e40f74a9de880bf0604da93fa55bfee3eec15c..f257979e4810f4fbfdb5808262af98c7778626d8 100644
--- a/source/Lib/CommonLib/UnitTools.cpp
+++ b/source/Lib/CommonLib/UnitTools.cpp
@@ -18934,7 +18934,12 @@ bool storeContexts( const Slice* slice, const int ctuXPosInCtus, const int ctuYP
 bool CU::allowTmrl(const CodingUnit& cu)
 {
   bool bReorder = true;
-  if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.bdpcmMode || !cu.cs->sps->getUseMRL()
+  if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.bdpcmMode
+#if JVET_AD0082_TMRL_CONFIG
+    || !cu.cs->sps->getUseTmrl() || MRL_NUM_REF_LINES <= 2 || cu.timd
+#else
+    || !cu.cs->sps->getUseMRL()
+#endif
 #if ENABLE_DIMD
     || cu.dimd
 #endif
@@ -18942,6 +18947,7 @@ bool CU::allowTmrl(const CodingUnit& cu)
   {
     bReorder = false;
   }
+
   bool isFirstLineOfCtu = (((cu.block(COMPONENT_Y).y) & ((cu.cs->sps)->getMaxCUWidth() - 1)) == 0);
   if (isFirstLineOfCtu)
   {
diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp
index bd9b92ebe8c4d2998c1c7f8ba2981a5bf5d836d9..d8e8dbee039d8d51b5a4e778ed3ca692ffcf58fa 100644
--- a/source/Lib/DecoderLib/CABACReader.cpp
+++ b/source/Lib/DecoderLib/CABACReader.cpp
@@ -2048,7 +2048,20 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
     return;
   }
 #endif
-
+#if JVET_AD0082_TMRL_CONFIG
+  if (CU::allowTmrl(cu))
+  {
+    cuTmrlFlag(cu);
+    if (cu.tmrlFlag)
+    {
+      return;
+    }
+  }
+  else
+  {
+    extend_ref_line(cu);
+  }
+#else
 #if JVET_AB0157_TMRL
   cuTmrlFlag(cu);
   if (cu.tmrlFlag)
@@ -2057,6 +2070,7 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
   }
 #else
   extend_ref_line( cu );
+#endif
 #endif
   isp_mode( cu );
 #if ENABLE_DIMD
@@ -7998,6 +8012,7 @@ void CABACReader::amvpMerge_mode( PredictionUnit& pu )
 #if JVET_AB0157_TMRL
 void CABACReader::cuTmrlFlag(CodingUnit& cu)
 {
+#if !JVET_AD0082_TMRL_CONFIG
   if (!CU::allowTmrl(cu))
   {
     cu.firstPU->multiRefIdx = 0;
@@ -8021,6 +8036,7 @@ void CABACReader::cuTmrlFlag(CodingUnit& cu)
   }
   else
   {
+#endif
 #endif
     int ctxId = 0;
     cu.tmrlFlag = bool(m_BinDecoder.decodeBin(Ctx::TmrlDerive(ctxId++)));
@@ -8048,8 +8064,10 @@ void CABACReader::cuTmrlFlag(CodingUnit& cu)
     {
       cu.tmrlListIdx = 0;
     }
+#if !JVET_AD0082_TMRL_CONFIG
 #if JVET_W0123_TIMD_FUSION
   }
 #endif
+#endif
 }
 #endif
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 92fb197ac31f112915015b8307307e9d935bfb8a..d5519cf55028452edd2a58b0066f85d18c3293d7 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -2541,6 +2541,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 #if JVET_AB0155_SGPM
   READ_FLAG(uiCode, "sps_sgpm_enabled_flag");                       pcSPS->setUseSgpm(uiCode != 0);
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  READ_FLAG(uiCode, "sps_tmrl_enabled_flag");                       pcSPS->setUseTmrl(uiCode != 0);
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   READ_UVLC(uiCode, "sps_cccm_cand");                               pcSPS->setUseCccm(uiCode);
 #endif
@@ -5518,6 +5521,9 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
 #endif
 #if JVET_AB0155_SGPM
     READ_FLAG(symbol, "gci_no_sgpm_constraint_flag");                    cinfo->setNoSgpmConstraintFlag(symbol > 0 ? true : false);
+#endif
+#if JVET_AD0082_TMRL_CONFIG
+    READ_FLAG(symbol, "gci_no_tmrl_constraint_flag");                    cinfo->setNoTmrlConstraintFlag(symbol > 0 ? true : false);
 #endif
     /* inter */
     READ_FLAG(symbol, "gci_no_ref_pic_resampling_constraint_flag");      cinfo->setNoRprConstraintFlag(symbol > 0 ? true : false);
diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp
index 4554678edbf10ed1b542235010bc3ed0b41631a3..c317b3051640f446f8ac96133c6071c9020055d5 100644
--- a/source/Lib/EncoderLib/CABACWriter.cpp
+++ b/source/Lib/EncoderLib/CABACWriter.cpp
@@ -1523,6 +1523,20 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
     return;
   }
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  if (CU::allowTmrl(cu))
+  {
+    cuTmrlFlag(cu);
+    if (cu.tmrlFlag)
+    {
+      return;
+    }
+  }
+  else
+  {
+    extend_ref_line(cu);
+  }
+#else
 #if JVET_AB0157_TMRL
   cuTmrlFlag(cu);
   if (cu.tmrlFlag)
@@ -1531,6 +1545,7 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
   }
 #else
   extend_ref_line( cu );
+#endif
 #endif
   isp_mode( cu );
 #if ENABLE_DIMD
@@ -1768,6 +1783,20 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
     return;
   }
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  if (CU::allowTmrl(*pu.cu))
+  {
+    cuTmrlFlag(*pu.cu);
+    if (pu.cu->tmrlFlag)
+    {
+      return;
+    }
+  }
+  else
+  {
+    extend_ref_line(pu);
+  }
+#else
 #if JVET_AB0157_TMRL
   cuTmrlFlag(*pu.cu);
   if (pu.cu->tmrlFlag)
@@ -1776,6 +1805,7 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
   }
 #else
   extend_ref_line( pu );
+#endif
 #endif
   isp_mode( *pu.cu );
 #if ENABLE_DIMD
@@ -8023,11 +8053,14 @@ void CABACWriter::amvpMerge_mode( const PredictionUnit& pu )
 #if JVET_AB0157_TMRL
 void CABACWriter::cuTmrlFlag(const CodingUnit& cu)
 {
+#if !JVET_AD0082_TMRL_CONFIG
   if (!CU::allowTmrl(cu))
   {
     return;
   }
+#endif
   const PredictionUnit* pu = cu.firstPU;
+#if !JVET_AD0082_TMRL_CONFIG
 #if JVET_W0123_TIMD_FUSION
   if (cu.timd)
   {
@@ -8043,6 +8076,7 @@ void CABACWriter::cuTmrlFlag(const CodingUnit& cu)
   }
   else
   {
+#endif
 #endif
     int ctxId = 0;
     m_BinEncoder.encodeBin(cu.tmrlFlag, Ctx::TmrlDerive(ctxId++));
@@ -8070,9 +8104,11 @@ void CABACWriter::cuTmrlFlag(const CodingUnit& cu)
       CHECK(pu->multiRefIdx, "?");
     }
     DTRACE(g_trace_ctx, D_SYNTAX, "cu_tmrl_flag() ctx=%d pos=(%d,%d) tmrl=%d\n", 0, cu.lumaPos().x, cu.lumaPos().y, cu.tmrlFlag);
+#if !JVET_AD0082_TMRL_CONFIG
 #if JVET_W0123_TIMD_FUSION
   }
 #endif
+#endif
 }
 #endif
 //! \}
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index 40bacc4f9224d91b1030eb5f6fd797d210bc5458..7a3387b5c71e81a237c1d09aa983cfd08c4bbb70 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -255,6 +255,9 @@ protected:
 #if JVET_AB0155_SGPM
   bool      m_noSgpmConstraintFlag;
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool      m_noTmrlConstraintFlag;
+#endif
 #if ENABLE_OBMC
   bool      m_noObmcConstraintFlag;
 #endif
@@ -473,6 +476,9 @@ protected:
   bool      m_sgpmNoBlend;
 #endif
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool      m_tmrl;
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   int       m_cccm;
 #endif
@@ -1171,6 +1177,10 @@ public:
   bool      getNoSgpmConstraintFlag() const { return m_noSgpmConstraintFlag; }
   void      setNoSgpmConstraintFlag(bool val) { m_noSgpmConstraintFlag = val; }
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  bool      getNoTmrlConstraintFlag() const { return m_noTmrlConstraintFlag; }
+  void      setNoTmrlConstraintFlag(bool val) { m_noTmrlConstraintFlag = val; }
+#endif
 #if ENABLE_OBMC
   bool      getNoObmcConstraintFlag() const { return m_noObmcConstraintFlag; }
   void      setNoObmcConstraintFlag(bool bVal) { m_noObmcConstraintFlag = bVal; }
@@ -1567,6 +1577,10 @@ public:
   bool      getUseSgpmNoBlend            ()         const { return m_sgpmNoBlend; }
 #endif
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  void      setUseTmrl                   (bool b)         { m_tmrl = b; }
+  bool      getUseTmrl                   ()         const { return m_tmrl; }
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   void      setUseCccm                   (int i)          { m_cccm = i; }
   int       getUseCccm                   () const         { return m_cccm; }
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index f467c6abe42842eee93b304e6c6a25ec090c6bb4..a6c3c032826874d5df8bb7e319738fd77a9fcd74 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -1636,6 +1636,9 @@ void EncLib::xInitSPS( SPS& sps )
 #if JVET_AB0155_SGPM
   cinfo->setNoSgpmConstraintFlag(m_noSgpmConstraintFlag);
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  cinfo->setNoTmrlConstraintFlag(m_noTmrlConstraintFlag);
+#endif
 #if ENABLE_OBMC
   cinfo->setNoObmcConstraintFlag(m_noObmcConstraintFlag);
 #endif
@@ -1842,6 +1845,9 @@ void EncLib::xInitSPS( SPS& sps )
 #if JVET_AB0155_SGPM
   sps.setUseSgpm            ( m_sgpm );
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  sps.setUseTmrl            ( m_tmrl );
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   sps.setUseCccm            ( m_cccm );
 #endif
diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp
index 8e957ef4494bfd210704b7e95773d9dabe3e0a99..f7e742a3dfcda02b1e2516584aae328c320cfe16 100644
--- a/source/Lib/EncoderLib/IntraSearch.cpp
+++ b/source/Lib/EncoderLib/IntraSearch.cpp
@@ -767,7 +767,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c
 #endif
         // this should always be true
         CHECK(!pu.Y().valid(), "PU is not valid");
-#if !JVET_AB0157_TMRL
+#if !JVET_AB0157_TMRL || JVET_AD0082_TMRL_CONFIG
         bool isFirstLineOfCtu     = (((pu.block(COMPONENT_Y).y) & ((pu.cs->sps)->getMaxCUWidth() - 1)) == 0);
 #if JVET_Y0116_EXTENDED_MRL_LIST
         int  numOfPassesExtendRef = MRL_NUM_REF_LINES;
@@ -1173,7 +1173,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c
               m_ispCandListHor = uiRdModeList;
             }
 
-#if !JVET_AB0157_TMRL
+#if !JVET_AB0157_TMRL || JVET_AD0082_TMRL_CONFIG
             pu.multiRefIdx    = 1;
 #if SECONDARY_MPM
             const int numMPMs = NUM_PRIMARY_MOST_PROBABLE_MODES;
@@ -1187,9 +1187,14 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c
 #endif
 #endif
 #if JVET_AB0157_TMRL
+#if !JVET_AD0082_TMRL_CONFIG
             cu.tmrlFlag = true;
+#endif
             if (CU::allowTmrl(cu))
             {
+#if JVET_AD0082_TMRL_CONFIG
+              cu.tmrlFlag = true;
+#endif
               for (auto multiRefIdx : EXT_REF_LINE_IDX)
               {
                 pu.multiRefIdx = multiRefIdx;
@@ -1258,8 +1263,16 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c
 #endif
                 }
               }
+#if JVET_AD0082_TMRL_CONFIG
+              cu.tmrlFlag = false;
+#endif
             }
-#else
+#endif
+#if !JVET_AB0157_TMRL || JVET_AD0082_TMRL_CONFIG
+#if JVET_AD0082_TMRL_CONFIG
+            else
+            {
+#endif
             for (int mRefNum = 1; mRefNum < numOfPassesExtendRef; mRefNum++)
             {
               int multiRefIdx = MULTI_REF_LINE_IDX[mRefNum];
@@ -1324,6 +1337,9 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c
                 }
               }
             }
+#if JVET_AD0082_TMRL_CONFIG
+            }
+#endif
 #endif
             CHECKD(uiRdModeList.size() != numModesForFullRD, "Error: RD mode list size");
 
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 4738d519cbee110ca55d22c6d4e36f6b5003d8ae..3801234fe3beb9b7646304a962bf8ce0108cc03e 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -1602,6 +1602,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
 #if JVET_AB0155_SGPM
   WRITE_FLAG(pcSPS->getUseSgpm() ? 1 : 0, "sps_sgpm_enabled_flag");
 #endif
+#if JVET_AD0082_TMRL_CONFIG
+  WRITE_FLAG(pcSPS->getUseTmrl() ? 1 : 0, "sps_tmrl_enabled_flag");
+#endif
 #if JVET_AC0147_CCCM_NO_SUBSAMPLING
   WRITE_UVLC(pcSPS->getUseCccm() , "sps_cccm_cand");
 #endif
@@ -3336,7 +3339,9 @@ void  HLSWriter::codeConstraintInfo  ( const ConstraintInfo* cinfo )
 #if JVET_AB0155_SGPM
     WRITE_FLAG(cinfo->getNoSgpmConstraintFlag() ? 1 : 0, "gci_no_sgpm_constraint_flag");
 #endif
-
+#if JVET_AD0082_TMRL_CONFIG
+    WRITE_FLAG(cinfo->getNoTmrlConstraintFlag() ? 1 : 0, "gci_no_tmrl_constraint_flag");
+#endif
     /* inter */
     WRITE_FLAG(cinfo->getNoRprConstraintFlag() ? 1 : 0, "gci_no_ref_pic_resampling_constraint_flag");
     WRITE_FLAG(cinfo->getNoResChangeInClvsConstraintFlag() ? 1 : 0, "gci_no_res_change_in_clvs_constraint_flag");