diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 082b52f721ed3481d07c70460376535fbaa02120..48c3d920003103dfc5ba9d4fc919213fdf67518c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,11 +47,6 @@ build_ubuntu1804-gcc8:
    tags:
       - ubuntu1804-gcc8
 
-build_vc1900:
-   extends: .build_template
-   tags:
-      - vc1900
-
 build_vc191x:
    extends: .build_template
    tags:
diff --git a/doc/software-manual.pdf b/doc/software-manual.pdf
index 3df23de608f16b769aabdb04e190de273bbdd5e4..15b30980ad3d16d6f81c8393d0241cffca63a11f 100644
Binary files a/doc/software-manual.pdf and b/doc/software-manual.pdf differ
diff --git a/doc/software-manual.tex b/doc/software-manual.tex
index 1533444a276f180536a262c4bb35e0a0a690cbb9..57a86760104d72d421dc0e9b21172dd0dde94671 100644
--- a/doc/software-manual.tex
+++ b/doc/software-manual.tex
@@ -205,7 +205,7 @@ fontsize=\footnotesize}
 \maketitle
 \begin{abstract}
 This document is a user manual describing usage of the VTM reference software
-for the VVC project. It applies to version 6.2 of the software.
+for the VVC project. It applies to version 7.0 of the software.
 \end{abstract}
 
 \tableofcontents
@@ -257,8 +257,8 @@ be available in older compilers.
  \thead{Compiler environment} &
  \thead{Versions} \\
 \hline
-MS Visual Studio  & 2015 and 2017 \\
-GCC               & 5.4 and 7.3 \\
+MS Visual Studio  & 2017 and 2019 \\
+GCC               & 5.4, 7.3 and 8.3\\
 Xcode/clang       & latest \\
 \hline
 \end{tabular}
@@ -1342,10 +1342,10 @@ candidate is not evaluated if the merge skip mode was the best merge
 mode for one of the previous candidates.
 \\
 
-\Option{SBT64RDO} &
+\Option{SBTFast64WidthTh} &
 %\ShortOption{\None} &
-\Default{true} &
-Enables or disables the use of more than 32 SBT in encoder RDO check.  When enabled, more than 32 size SBT is checked in the RDO.
+\Default{1920} &
+Picture width threshold for testing size-64 SBT in RDO (now for HD and above sequences).
 \\
 
 \Option{RDpenalty} &
diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index f79697d9a79129e2f8bd0eaaa360f841061b6f4b..3390dc92ec9b2f8318632983b38764831b42cae5 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -290,7 +290,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setImplicitMTS                                       ( m_MTSImplicit );
   m_cEncLib.setUseSBT                                            ( m_SBT );
 #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
-  m_cEncLib.setUse64SBTRDOCheck                                  (m_SBT64RDOCheck);
+  m_cEncLib.setSBTFast64WidthTh                                  ( m_SBTFast64WidthTh );
 #endif
   m_cEncLib.setUseCompositeRef                                   ( m_compositeRefEnabled );
   m_cEncLib.setUseSMVD                                           ( m_SMVD );
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index 730d0729cb06d44c25f1a2866ede605e1b81cf71..878c48a9dad6eb4219aef9e687081dcf9498f141 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -944,7 +944,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("MTSImplicit",                                     m_MTSImplicit,                                        0, "Enable implicit MTS (when explicit MTS is off)\n")
   ( "SBT",                                            m_SBT,                                            false, "Enable Sub-Block Transform for inter blocks\n" )
 #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
-  ("SBT64RDO",                                        m_SBT64RDOCheck,             true, "Enable more than 32 SBT in encoder RDO check \n")
+  ( "SBTFast64WidthTh",                               m_SBTFast64WidthTh,                                1920, "Picture width threshold for testing size-64 SBT in RDO (now for HD and above sequences)\n")
 #endif
   ( "ISP",                                            m_ISP,                                            false, "Enable Intra Sub-Partitions\n" )
   ("SMVD",                                            m_SMVD,                                           false, "Enable Symmetric MVD\n")
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index a1bbebb3ae99d804c1f411d5fb225e29bc62d460..a4d392e3d80de25b653cff67899deb44dc064393 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -285,7 +285,7 @@ protected:
   int       m_MTSImplicit;
   bool      m_SBT;                                            ///< Sub-Block Transform for inter blocks
 #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
-  bool      m_SBT64RDOCheck;                                            
+  int       m_SBTFast64WidthTh;
 #endif
   bool      m_SMVD;
   bool      m_compositeRefEnabled;
diff --git a/source/Lib/CommonLib/Contexts.cpp b/source/Lib/CommonLib/Contexts.cpp
index b163ad6cc66416e8323dd9445c966cd3d9839deb..3280c087b967de6ece82dac6bf0b424f7e688205 100755
--- a/source/Lib/CommonLib/Contexts.cpp
+++ b/source/Lib/CommonLib/Contexts.cpp
@@ -185,6 +185,768 @@ CtxSet ContextSetCfg::addCtxSet( std::initializer_list<std::initializer_list<uin
 std::vector<std::vector<uint8_t>> ContextSetCfg::sm_InitTables(NUMBER_OF_SLICE_TYPES + 1);
 
 // clang-format off
+#if RETRAIN_CABAC
+const CtxSet ContextSetCfg::SplitFlag = ContextSetCfg::addCtxSet
+({
+  {  18,  27,  15,  18,  28,  30,  19,   7,  23, },
+  {  11,  35,  53,  12,   6,  30,  13,  15,  31, },
+  {  19,  28,  38,  27,  29,  38,  28,  38,  31, },
+  {  12,  13,   8,   8,  13,  12,   5,   9,   9, },
+});
+
+const CtxSet ContextSetCfg::SplitQtFlag = ContextSetCfg::addCtxSet
+({
+  {  26,  36,  38,  33,  34,  21, },
+  {  20,  14,  23,  18,  19,   6, },
+  {  27,   6,  15,  25,  19,  22, },
+  {   0,   8,   8,  12,  12,   9, },
+});
+
+const CtxSet ContextSetCfg::SplitHvFlag = ContextSetCfg::addCtxSet
+({
+  {  43,  42,  37,  35,  44, },
+  {  36,  35,  37,  27,  52, },
+  {  43,  42,  29,  27,  44, },
+  {   9,   8,   9,   8,   8, },
+});
+
+const CtxSet ContextSetCfg::Split12Flag = ContextSetCfg::addCtxSet
+({
+  {  28,  29,  28,  29, },
+  {  43,  37,  21,  22, },
+  {  51,  45,  36,  45, },
+  {  12,  13,  12,  13, },
+});
+
+const CtxSet ContextSetCfg::ModeConsFlag = ContextSetCfg::addCtxSet
+({
+  {  25,  20, },
+  {  25,  12, },
+  { CNU, CNU, },
+  {   1,   0, },
+});
+
+const CtxSet ContextSetCfg::SkipFlag = ContextSetCfg::addCtxSet
+({
+  {  57,  60,  53, },
+  {  57,  59,  45, },
+  {   0,  26,  28, },
+  {   5,   4,   8, },
+});
+
+const CtxSet ContextSetCfg::MergeFlag = ContextSetCfg::addCtxSet
+({
+  {   6, },
+  {   6, },
+  {  26, },
+  {   4, },
+});
+
+const CtxSet ContextSetCfg::RegularMergeFlag = ContextSetCfg::addCtxSet
+({
+  {  46,  15, },
+  {  38,   7, },
+  { CNU, CNU, },
+  {   5,   5, },
+});
+
+const CtxSet ContextSetCfg::MergeIdx = ContextSetCfg::addCtxSet
+({
+  {  33, },
+  {  35, },
+  {  34, },
+  {   4, },
+});
+
+const CtxSet ContextSetCfg::MmvdFlag = ContextSetCfg::addCtxSet
+({
+  {  40, },
+  {  26, },
+  { CNU, },
+  {   4, },
+});
+
+const CtxSet ContextSetCfg::MmvdMergeIdx = ContextSetCfg::addCtxSet
+({
+  {  43, },
+  {  43, },
+  { CNU, },
+  {  10, },
+});
+
+const CtxSet ContextSetCfg::MmvdStepMvpIdx = ContextSetCfg::addCtxSet
+({
+  {  51, },
+  {  60, },
+  { CNU, },
+  {   0, },
+});
+
+const CtxSet ContextSetCfg::PredMode = ContextSetCfg::addCtxSet
+({
+  {  40,  35, },
+  {  40,  35, },
+  { CNU, CNU, },
+  {   5,   1, },
+});
+
+const CtxSet ContextSetCfg::MultiRefLineIdx = ContextSetCfg::addCtxSet
+({
+  {  25,  58, },
+  {  25,  50, },
+  {  25,  59, },
+  {   6,   8, },
+});
+
+const CtxSet ContextSetCfg::IntraLumaMpmFlag = ContextSetCfg::addCtxSet
+({
+  {  29, },
+  {  36, },
+  {  45, },
+  {   6, },
+});
+
+const CtxSet ContextSetCfg::IntraLumaPlanarFlag = ContextSetCfg::addCtxSet
+({
+  {  13,   6, },
+  {  12,  20, },
+  {  13,  28, },
+  {   1,   5, },
+});
+
+const CtxSet ContextSetCfg::CclmModeFlag = ContextSetCfg::addCtxSet
+({
+  {  26, },
+  {  34, },
+  {  59, },
+  {   4, },
+});
+
+#if JVET_P0615_CHROMAMODE_CLEANUP
+const CtxSet ContextSetCfg::CclmModeIdx = ContextSetCfg::addCtxSet
+({
+  {  27, },
+  {  27, },
+  {  27, },
+  {   9, },
+});
+
+const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
+({
+  {  25, },
+  {  18, },
+  {  34, },
+  {   5, },
+});
+#else
+const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
+({
+  {  25, },
+  {  33, },
+  {  19, },
+  {   6, },
+});
+#endif
+
+const CtxSet ContextSetCfg::MipFlag = ContextSetCfg::addCtxSet
+({
+  {  56,  57,  50,  26, },
+  {  41,  57,  58,  26, },
+  {  33,  49,  42,  25, },
+  {   9,  10,   9,   6, },
+});
+
+const CtxSet ContextSetCfg::DeltaQP = ContextSetCfg::addCtxSet
+({
+  { CNU, CNU, },
+  { CNU, CNU, },
+  { CNU, CNU, },
+  { DWS, DWS, },
+});
+
+const CtxSet ContextSetCfg::InterDir = ContextSetCfg::addCtxSet
+({
+#if JVET_P0042_FIX_INTER_DIR_CTX
+  {  14,   6,   5,   4,   3,  40, },
+  {   7,   6,   5,   4,  11,  40, },
+  { CNU, CNU, CNU, CNU, CNU, CNU, },
+  {   0,   0,   1,   4,   1,   0, },
+#else
+  {   6,  13,   5,   4,  25, },
+  {   7,   6,   5,   4,  33, },
+  { CNU, CNU, CNU, CNU, CNU, },
+  {   0,   0,   1,   4,   0, },
+#endif
+});
+
+const CtxSet ContextSetCfg::RefPic = ContextSetCfg::addCtxSet
+({
+  {  20,  20, },
+  {  27,  35, },
+  { CNU, CNU, },
+  {   0,   4, },
+});
+
+const CtxSet ContextSetCfg::SubblockMergeFlag = ContextSetCfg::addCtxSet
+({
+  {  40,  51,  45, },
+  {  48,  57,  44, },
+  { CNU, CNU, CNU, },
+  {   4,   4,   4, },
+});
+
+const CtxSet ContextSetCfg::AffineFlag = ContextSetCfg::addCtxSet
+({
+  {  12,  13,   6, },
+  {  12,  13,   6, },
+  { CNU, CNU, CNU, },
+  {   4,   0,   0, },
+});
+
+const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
+({
+  {  35, },
+  {  35, },
+  { CNU, },
+  {   4, },
+});
+
+const CtxSet ContextSetCfg::AffMergeIdx = ContextSetCfg::addCtxSet
+({
+  {   4, },
+  {   5, },
+  { CNU, },
+  {   0, },
+});
+
+const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
+({
+  {   5, },
+  {   4, },
+  { CNU, },
+  {   0, },
+});
+
+const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
+({
+  {  51,  58, },
+  {  44,  43, },
+  {  14,  45, },
+  {   9,   5, },
+});
+
+const CtxSet ContextSetCfg::BDPCMMode = ContextSetCfg::addCtxSet
+({
+  {  19,  28, },
+  {  40,  36, },
+  {  19,  35, },
+  {   4,   4, },
+});
+
+const CtxSet ContextSetCfg::QtRootCbf = ContextSetCfg::addCtxSet
+({
+  {  12, },
+  {   5, },
+  {   6, },
+  {   4, },
+});
+
+const CtxSet ContextSetCfg::QtCbf[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  15,  13,   5,  14, },
+    {  23,   4,  20,   7, },
+    {   7,  19,   5,   7, },
+    {   5,   1,   8,   9, },
+  }),
+#if JVET_P0059_CHROMA_BDPCM
+  ContextSetCfg::addCtxSet
+  ({
+    {  25, CNU, },
+    {  25, CNU, },
+    {   4, CNU, },
+    {   5, DWS, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {   9,  44, CNU, },
+    {  25,  29, CNU, },
+    {  33,  28, CNU, },
+    {   2,   1, DWS, },
+  })
+#else
+  ContextSetCfg::addCtxSet
+  ({
+    {  25, },
+    {  25, },
+    {  12, },
+    {   5, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {   9,  44, },
+    {  25,  29, },
+    {  33,  21, },
+    {   2,   1, },
+  })
+#endif
+};
+
+const CtxSet ContextSetCfg::SigCoeffGroup[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  25,  45, },
+    {  25,  30, },
+    {  18,  31, },
+    {   8,   5, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  25,  45, },
+    {  25,  52, },
+    {  25,   7, },
+    {   5,   8, },
+  })
+};
+
+const CtxSet ContextSetCfg::SigFlag[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  17,  41,  49,  36,   1,  49,  50,  37,  48,  51,  58,  45, },
+    {  17,  41,  42,  29,  25,  49,  43,  37,  33,  51,  51,  30, },
+    {  25,  19,  28,  14,  25,  20,  29,  30,  19,  37,  30,  38, },
+    {  12,   9,   9,  10,   9,   9,   9,  10,   8,   8,   8,  10, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {   9,  49,  42,  21,  48,  59,  59,  53, },
+    {  17,  19,  20,  29,  41,  59,  60,  38, },
+    {  25,  27,  28,  37,  49,  53,  53,  46, },
+    {   9,   9,   9,  13,   4,   5,   8,   9, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  26,  45,  53,  46,  49,  54,  61,  39,  42,  39,  39,  39, },
+    {  19,  38,  38,  46,  34,  54,  54,  39,   6,  39,  39,  39, },
+    {  11,  38,  46,  54,  27,  39,  39,  39,  36,  39,  39,  39, },
+    {   9,  13,   8,   8,   8,   8,   8,   5,   8,   0,   0,   0, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  34,  45,  38,  31,  58,  39,  39,  39, },
+    {  35,  45,  53,  54,  44,  39,  39,  39, },
+    {  19,  46,  38,  39,  52,  39,  39,  39, },
+    {   8,  12,   8,   8,   4,   0,   0,   0, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  19,  54,  39,  39,  50,  39,  39,  39,   0,  39,  39,  39, },
+    {  19,  39,  54,  39,  19,  39,  39,  39,  56,  39,  39,  39, },
+    {  18,  39,  39,  39,  19,  39,  39,  39,   0,  39,  39,  39, },
+    {   8,   8,   8,   8,   8,   0,   4,   4,   0,   0,   0,   0, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  34,  38,  54,  39,  41,  39,  39,  39, },
+    {  34,  38,  62,  39,  26,  39,  39,  39, },
+    {  26,  39,  39,  39,  19,  39,  39,  39, },
+    {   8,   8,   8,   8,   4,   0,   0,   0, },
+  })
+};
+
+const CtxSet ContextSetCfg::ParFlag[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  33,  40,  25,  41,  26,  42,  25,  33,  26,  34,  27,  25,  41,  42,  42,  35,  33,  27,  35,  42,  43, },
+    {  18,  17,  33,  18,  34,  42,  25,  33,  26,  42,  27,  25,  34,  42,  42,  35,  26,  27,  42,  20,  20, },
+    {  33,  25,  18,  26,  34,  27,  25,  26,  19,  42,  35,  33,  19,  27,  35,  35,  34,  42,  20,  43,  20, },
+    {   8,   9,  12,  13,  13,  13,  10,  13,  13,  13,  13,  13,  13,  13,  13,  13,  10,  13,  13,  13,  13, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  33,  25,  26,  19,  19,  27,  33,  42,  43,  35,  43, },
+    {  25,  25,  26,  11,  19,  27,  33,  42,  50,  20,  43, },
+    {  33,  25,  26,  42,  19,  27,  26,  50,  35,  20,  43, },
+    {   9,  13,  12,  12,  13,  13,  13,  13,  13,  13,  13, },
+  })
+};
+
+const CtxSet ContextSetCfg::GtxFlag[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  25,   0,   0,  17,  25,  18,   0,   9,  25,  33,  19,   0,  25,  33,  26,  20,  25,  33,  34,  35,  29, },
+    {  17,   0,   1,  17,  25,  18,   0,   9,  25,  33,  34,   9,  25,  18,  26,  20,  25,  18,  19,  27,  21, },
+    {  25,   1,  40,  25,  33,  11,  17,  25,  25,  18,   4,  17,  33,  26,  19,   5,  33,  19,  20,  28,  22, },
+    {   1,   5,   9,   9,   9,   6,   5,   9,  10,  10,   9,   9,   9,   9,   9,   9,   6,   8,   9,   9,   9, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  25,   1,  40,  33,  26,   4,  25,  33,  27,  36,  37, },
+    {  17,   9,  25,  10,   3,   4,  17,  33,  19,  28,  29, },
+    {  48,   9,  25,  18,  26,  35,  25,  26,  35,  28,  37, },
+    {   1,   5,   8,   8,   8,   6,   6,   9,   8,   8,  10, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {   0,   0,  33,  34,  35,  36,  25,  34,  35,  28,  29,  40,  42,  43,  36,  30,  56,  43,  44,  45,  38, },
+    {   0,  17,  26,  19,  20,  21,  25,  34,  20,  28,  29,  33,  27,  28,  29,  22,  34,  28,  44,  37,  38, },
+    {  25,  25,  11,  27,  20,  21,  18,  12,  28,  21,  22,  34,  28,  29,  29,  30,  28,  29,  45,  30,  23, },
+    {   9,   5,  10,  13,  13,  10,   9,  10,  13,  13,  13,   9,  10,  10,  10,  13,   8,   9,   9,  10,  13, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {   0,  40,  42,  20,  21,  29,  57,  52,  53,  38,  46, },
+    {   0,  25,  27,  20,  13,   6,  57,  52,  30,  38,  31, },
+    {  40,  33,  27,  28,  21,  37,  51,  37,  53,  38,  46, },
+    {   9,   9,  10,  12,  12,  10,   5,   9,   9,   9,  12, },
+  })
+};
+
+const CtxSet ContextSetCfg::LastX[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  14,   6,   5,   7,  14,   4,   7,   7,   6,  12,  29,   7,   6,   6,  20,  28,   7,  13,  13,  20, },
+    {   6,  13,  12,   6,   6,   4,  14,  14,   5,  12,  29,  14,  13,   5,  36,  28,  14,  13,  20,  19, },
+    {  13,   5,   4,   6,  14,   4,   6,  14,  21,  11,  14,   7,  14,  13,  11,  21,  37,  37,  21,  50, },
+    {   8,   5,   4,   5,   4,   4,   5,   4,   1,   0,   4,   1,   0,   0,   0,   1,   1,   0,   0,   0, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  11,   5,   3, },
+    {  12,   4,  18, },
+    {  12,   4,   3, },
+    {   2,   1,   1, },
+  })
+};
+
+const CtxSet ContextSetCfg::LastY[] =
+{
+  ContextSetCfg::addCtxSet
+  ({
+    {  13,   5,   5,   6,   6,  12,  14,   6,   5,   5,  14,   7,   5,  12,  21,  13,   7,  13,  12,  41, },
+    {   5,   5,  12,   6,   6,  19,   6,  14,   5,  19,  29,   7,  13,   5,  36,  21,   7,  13,   5,  27, },
+    {  13,   5,   4,   6,   6,  11,  14,  14,   5,  11,  14,  22,  14,  12,   3,  21,  37,  52,  28,  34, },
+    {   8,   5,   8,   5,   5,   4,   5,   5,   4,   0,   5,   5,   1,   0,   0,   1,   4,   0,   0,   0, },
+  }),
+  ContextSetCfg::addCtxSet
+  ({
+    {  11,   5,  19, },
+    {  11,   4,  18, },
+    {  12,   4,   3, },
+    {   6,   2,   2, },
+  })
+};
+
+const CtxSet ContextSetCfg::MVPIdx = ContextSetCfg::addCtxSet
+({
+  {  34, },
+  {  34, },
+  {  42, },
+  {  12, },
+});
+
+const CtxSet ContextSetCfg::SmvdFlag = ContextSetCfg::addCtxSet
+({
+  {  50, },
+  {  28, },
+  { CNU, },
+  {   5, },
+});
+
+const CtxSet ContextSetCfg::SaoMergeFlag = ContextSetCfg::addCtxSet
+({
+  {  10, },
+  {  60, },
+  {  52, },
+  {   0, },
+});
+
+const CtxSet ContextSetCfg::SaoTypeIdx = ContextSetCfg::addCtxSet
+({
+  {  10, },
+  {   5, },
+  {   5, },
+  {   0, },
+});
+
+const CtxSet ContextSetCfg::TransquantBypassFlag = ContextSetCfg::addCtxSet
+({
+  { CNU, },
+  { CNU, },
+  { CNU, },
+  { DWS, },
+});
+
+const CtxSet ContextSetCfg::LFNSTIdx = ContextSetCfg::addCtxSet
+({
+#if JVET_P0350_LFNST_IDX_CTX
+  {  52,  37,  33, },
+  {  45,  45,  18, },
+  { CNU,  52,  33, },
+  {   9,   9,   5, },
+#else
+  {  45,  37, },
+  {  38,  45, },
+  { CNU,  45, },
+  {   8,   8, },
+#endif
+});
+
+const CtxSet ContextSetCfg::PLTFlag = ContextSetCfg::addCtxSet
+({
+  { CNU, },
+  { CNU, },
+  { CNU, },
+  { DWS, },
+});
+
+const CtxSet ContextSetCfg::RotationFlag = ContextSetCfg::addCtxSet
+({
+  { CNU, },
+  { CNU, },
+  { CNU, },
+  { DWS, },
+});
+
+const CtxSet ContextSetCfg::RunTypeFlag = ContextSetCfg::addCtxSet
+({
+  { CNU, },
+  { CNU, },
+  { CNU, },
+  { DWS, },
+});
+
+const CtxSet ContextSetCfg::IdxRunModel = ContextSetCfg::addCtxSet
+({
+  { CNU, CNU, CNU, CNU, CNU, },
+  { CNU, CNU, CNU, CNU, CNU, },
+  { CNU, CNU, CNU, CNU, CNU, },
+  { DWS, DWS, DWS, DWS, DWS, },
+});
+
+const CtxSet ContextSetCfg::CopyRunModel = ContextSetCfg::addCtxSet
+({
+  { CNU, CNU, CNU, },
+  { CNU, CNU, CNU, },
+  { CNU, CNU, CNU, },
+  { DWS, DWS, DWS, },
+});
+
+const CtxSet ContextSetCfg::RdpcmFlag = ContextSetCfg::addCtxSet
+({
+  { CNU, CNU, },
+  { CNU, CNU, },
+  { CNU, CNU, },
+  { DWS, DWS, },
+});
+
+const CtxSet ContextSetCfg::RdpcmDir = ContextSetCfg::addCtxSet
+({
+  { CNU, CNU, },
+  { CNU, CNU, },
+  { CNU, CNU, },
+  { DWS, DWS, },
+});
+
+const CtxSet ContextSetCfg::MTSIndex = ContextSetCfg::addCtxSet
+({
+#if JVET_P0058_CHROMA_TS
+  {  37, CNU, CNU, CNU, CNU, CNU,  25,  25,  27,   0, CNU,  17, },
+  {  30, CNU, CNU, CNU, CNU, CNU,  25,  40,  27,   0, CNU,  17, },
+  {  13, CNU, CNU, CNU, CNU, CNU,  25,   0,  35,   0, CNU,   1, },
+  {   8, DWS, DWS, DWS, DWS, DWS,   1,   0,   9,   0, DWS,   1, },
+#else
+  {  29, CNU, CNU, CNU, CNU, CNU,  33,  18,  27,   0, CNU, },
+  {  29, CNU, CNU, CNU, CNU, CNU,  18,  33,  27,   0, CNU, },
+  {  20, CNU, CNU, CNU, CNU, CNU,  33,   0,  42,   0, CNU, },
+  {   8, DWS, DWS, DWS, DWS, DWS,   1,   0,   9,   0, DWS, },
+#endif
+});
+
+const CtxSet ContextSetCfg::ISPMode = ContextSetCfg::addCtxSet
+({
+  {  33,  43, },
+  {  33,  36, },
+  {  33,  43, },
+  {   9,   2, },
+});
+
+const CtxSet ContextSetCfg::SbtFlag = ContextSetCfg::addCtxSet
+({
+  {  49,  50, },
+  {  49,  50, },
+  { CNU, CNU, },
+  {   1,   5, },
+});
+
+const CtxSet ContextSetCfg::SbtQuadFlag = ContextSetCfg::addCtxSet
+({
+  {  42, },
+  {  42, },
+  { CNU, },
+  {  10, },
+});
+
+const CtxSet ContextSetCfg::SbtHorFlag = ContextSetCfg::addCtxSet
+({
+  {  35,  51,  27, },
+  {  20,  43,  12, },
+  { CNU, CNU, CNU, },
+  {   8,   4,   1, },
+});
+
+const CtxSet ContextSetCfg::SbtPosFlag = ContextSetCfg::addCtxSet
+({
+  {  28, },
+  {  28, },
+  { CNU, },
+  {  13, },
+});
+
+const CtxSet ContextSetCfg::CrossCompPred = ContextSetCfg::addCtxSet
+({
+  { CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
+  { CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
+  { CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
+  { DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, DWS, },
+});
+
+const CtxSet ContextSetCfg::ChromaQpAdjFlag = ContextSetCfg::addCtxSet
+({
+  { CNU, },
+  { CNU, },
+  { CNU, },
+  { DWS, },
+});
+
+const CtxSet ContextSetCfg::ChromaQpAdjIdc = ContextSetCfg::addCtxSet
+({
+  { CNU, },
+  { CNU, },
+  { CNU, },
+  { DWS, },
+});
+
+const CtxSet ContextSetCfg::ImvFlag = ContextSetCfg::addCtxSet
+({
+  {  51,  33,  50,  60,  45, },
+  {  59,  48,  58,  60,  60, },
+  { CNU,  34, CNU, CNU, CNU, },
+  {   0,   5,   1,   0,   4, },
+});
+
+const CtxSet ContextSetCfg::ctbAlfFlag = ContextSetCfg::addCtxSet
+({
+  {  26,  52,  46,  18,  61,  54,  18,  61,  54, },
+  {   6,  23,  46,  12,  61,  54,   5,  46,  54, },
+  {  39,  39,  39,  62,  39,  39,  31,  39,  39, },
+  {   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+});
+
+const CtxSet ContextSetCfg::ctbAlfAlternative = ContextSetCfg::addCtxSet
+({
+  {  11,  11, },
+  {  20,  12, },
+  {  28,  28, },
+  {   0,   0, },
+});
+
+#if !JVET_P0162_REMOVE_ALF_CTB_FIRST_USE_APS_FLAG
+const CtxSet ContextSetCfg::AlfUseLatestFilt = ContextSetCfg::addCtxSet
+({
+  {  58, },
+  {  50, },
+  {  31, },
+  {   0, },
+});
+#endif
+
+const CtxSet ContextSetCfg::AlfUseTemporalFilt = ContextSetCfg::addCtxSet
+({
+  {  46, },
+  {  53, },
+  {  46, },
+  {   0, },
+});
+
+const CtxSet ContextSetCfg::MHIntraFlag = ContextSetCfg::addCtxSet
+({
+  {  50, },
+  {  50, },
+  { CNU, },
+  {   1, },
+});
+
+const CtxSet ContextSetCfg::IBCFlag = ContextSetCfg::addCtxSet
+({
+  {   0,  43,  45, },
+  {   0,  42,  37, },
+  {  17,  42,  36, },
+  {   1,   5,   8, },
+});
+
+const CtxSet ContextSetCfg::JointCbCrFlag = ContextSetCfg::addCtxSet
+({
+  {  43,  51,  45, },
+  {  35,  44,  45, },
+  {  35,  29,  51, },
+  {   1,   1,   0, },
+});
+
+const CtxSet ContextSetCfg::TsSigCoeffGroup = ContextSetCfg::addCtxSet
+({
+  {  18,  35,  37, },
+  {  18,  12,  29, },
+  {  18,  20,  38, },
+  {   5,   8,   8, },
+});
+
+const CtxSet ContextSetCfg::TsSigFlag = ContextSetCfg::addCtxSet
+({
+  {  25,  50,  37, },
+  {  40,  35,  44, },
+  {  25,  28,  38, },
+  {  13,  13,   8, },
+});
+
+const CtxSet ContextSetCfg::TsParFlag = ContextSetCfg::addCtxSet
+({
+  {  11, },
+  {   3, },
+  {  11, },
+  {   6, },
+});
+
+const CtxSet ContextSetCfg::TsGtxFlag = ContextSetCfg::addCtxSet
+({
+  { CNU,  10,   4,   4,   5, },
+  { CNU,   2,   3,   3,  11, },
+  { CNU,  10,   3,   3,   3, },
+  { DWS,   1,   1,   1,   1, },
+});
+
+const CtxSet ContextSetCfg::TsLrg1Flag = ContextSetCfg::addCtxSet
+({
+  {  19,  11,   4,   6, },
+  {  18,  11,   4,  28, },
+  {  11,   5,   5,   6, },
+  {   4,   2,   1,   6, },
+});
+
+const CtxSet ContextSetCfg::TsResidualSign = ContextSetCfg::addCtxSet
+({
+  {  28,  25,  53,  28,  33,  30, },
+  {   5,  10,  53,  35,  25,  53, },
+  {  20,  17,  46,  20,  25,  46, },
+  {   1,   4,   4,   8,   8,   8, },
+});
+#else
 const CtxSet ContextSetCfg::SplitFlag = ContextSetCfg::addCtxSet
 ({
   {  18,  27,  15,  11,  28,  30,  19,  22,  23, },
@@ -949,6 +1711,7 @@ const CtxSet ContextSetCfg::TsResidualSign = ContextSetCfg::addCtxSet
   {  20,   2,  46, CNU, CNU, CNU, },
   {   1,   4,   4, DWS, DWS, DWS, },
 });
+#endif
 // clang-format on
 
 const unsigned ContextSetCfg::NumberOfContexts = (unsigned)ContextSetCfg::sm_InitTables[0].size();
diff --git a/source/Lib/CommonLib/LoopFilter.cpp b/source/Lib/CommonLib/LoopFilter.cpp
index a405cf1fcb279c91921dda88d95ccca5ecab695b..64966452bb0baed30165e296f7527f6dd27809a2 100644
--- a/source/Lib/CommonLib/LoopFilter.cpp
+++ b/source/Lib/CommonLib/LoopFilter.cpp
@@ -938,11 +938,19 @@ void LoopFilter::xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edg
       // Derive neighboring PU index
       if (edgeDir == EDGE_VER)
       {
-        CHECK( !isAvailableLeft( cu, cuP, !slice.getLFCrossSliceBoundaryFlag(), !pps.getLoopFilterAcrossBricksEnabledFlag() ), "Neighbour not available" );
+        if (!isAvailableLeft(cu, cuP, !slice.getLFCrossSliceBoundaryFlag(), !pps.getLoopFilterAcrossBricksEnabledFlag()))
+        {
+          m_aapucBS[edgeDir][uiBsAbsIdx] = uiBs = 0;
+          continue;
+        }
       }
       else  // (iDir == EDGE_HOR)
       {
-        CHECK( !isAvailableAbove( cu, cuP, !slice.getLFCrossSliceBoundaryFlag(), !pps.getLoopFilterAcrossBricksEnabledFlag() ), "Neighbour not available" );
+        if (!isAvailableAbove(cu, cuP, !slice.getLFCrossSliceBoundaryFlag(), !pps.getLoopFilterAcrossBricksEnabledFlag()))
+        {
+          m_aapucBS[edgeDir][uiBsAbsIdx] = uiBs = 0;
+          continue;
+        }
       }
 
       iQP = (cuP.qp + cuQ.qp + 1) >> 1;
diff --git a/source/Lib/CommonLib/SampleAdaptiveOffset.cpp b/source/Lib/CommonLib/SampleAdaptiveOffset.cpp
index cacc1ce19ebcb65adca27890337b808422bb4923..ee5d84fbbfaab6008a0a3819f7395225060c35be 100644
--- a/source/Lib/CommonLib/SampleAdaptiveOffset.cpp
+++ b/source/Lib/CommonLib/SampleAdaptiveOffset.cpp
@@ -112,6 +112,7 @@ const SAOBlkParam& SAOBlkParam::operator= (const SAOBlkParam& src)
 
 SampleAdaptiveOffset::SampleAdaptiveOffset()
 {
+  m_numberOfComponents = 0;
 }
 
 
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index f2daa629f1c435543d730a2fc1f3b63ebf54dfc9..bb648125707838c67dededb9b1359ea50cd0f5c5 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -95,6 +95,10 @@ Slice::Slice()
 , m_nextSlice                     ( false )
 , m_sliceBits                     ( 0 )
 , m_bFinalized                    ( false )
+, m_sliceCurStartBrickIdx         ( 0 )
+, m_sliceCurEndBrickIdx           ( 0 )
+, m_sliceNumBricks                ( 0 )
+, m_sliceIdx                      ( 0 )
 , m_bTestWeightPred               ( false )
 , m_bTestWeightBiPred             ( false )
 , m_substreamSizes                ( )
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 06ae1f368dc7fe8052fda404d3779889eaaa5a38..bce5c8be0db62f6748a8734e073169974a64c059 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -50,9 +50,11 @@
 #include <assert.h>
 #include <cassert>
 
+#define RETRAIN_CABAC                                     1 // Retrained CABAC probabilities
+
 #define JVET_P0363_CLEANUP_NUT_TABLE                      1 // JVET-P0363: Clean-up of NAL unit type table
 
-#define JVET_P01034_PRED_1D_SCALING_LIST                  1 // JVET-P1034: 1D Scaling list index and add predictor mode 
+#define JVET_P01034_PRED_1D_SCALING_LIST                  1 // JVET-P1034: 1D Scaling list index and add predictor mode
 
 #define JVET_P0345_LD_GOP_8                               1 // JVET-P0345: low-delay gop size 8
 
diff --git a/source/Lib/CommonLib/version.h b/source/Lib/CommonLib/version.h
index 9cc1b0d4c2306f5378421ad230c53d43f6cee375..32095e41ffd3c72cce9c4b746d226a88ab991985 100644
--- a/source/Lib/CommonLib/version.h
+++ b/source/Lib/CommonLib/version.h
@@ -1,3 +1,3 @@
 #if ! defined( VTM_VERSION )
-#define VTM_VERSION "7.0rc1"
+#define VTM_VERSION "7.0"
 #endif
diff --git a/source/Lib/CommonLib/x86/BufferX86.h b/source/Lib/CommonLib/x86/BufferX86.h
index ae44540199073b88010b619e5d22261730164e0e..7e3c4104f6b70c5d75cf265a70e2fd77fddc00c9 100644
--- a/source/Lib/CommonLib/x86/BufferX86.h
+++ b/source/Lib/CommonLib/x86/BufferX86.h
@@ -458,7 +458,7 @@ void applyPROF_SSE(Pel* dstPel, int dstStride, const Pel* srcPel, int srcStride,
       mm_dI = _mm256_add_epi16(mm_dI, mm_src);
       if (!bi)
       {
-        mm_dI = _mm256_srai_epi16(_mm256_add_epi16(mm_dI, mm_offset), shiftNum);
+        mm_dI = _mm256_srai_epi16(_mm256_adds_epi16(mm_dI, mm_offset), shiftNum);
         mm_dI = _mm256_min_epi16(vibdimax, _mm256_max_epi16(vibdimin, mm_dI));
       }
 
@@ -497,7 +497,7 @@ void applyPROF_SSE(Pel* dstPel, int dstStride, const Pel* srcPel, int srcStride,
       mm_dI = _mm_add_epi16(_mm_unpacklo_epi64(_mm_loadl_epi64((const __m128i *)src), _mm_loadl_epi64((const __m128i *)(src + srcStride))), mm_dI);
       if (!bi)
       {
-        mm_dI = _mm_srai_epi16(_mm_add_epi16(mm_dI, mm_offset), shiftNum);
+        mm_dI = _mm_srai_epi16(_mm_adds_epi16(mm_dI, mm_offset), shiftNum);
         mm_dI = _mm_min_epi16(vibdimax, _mm_max_epi16(vibdimin, mm_dI));
       }
 
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 343f33bd056657a9d24763b36f4a5335a9415cc3..fe2a76f369b2269ed1fbec613994bd6c1a022f74 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -631,11 +631,17 @@ void DecLib::finishPicture(int& poc, PicList*& rpcListPic, MsgLevel msgl )
 
       if( pcSlice->getEnableTMVPFlag() && pcSlice->getColFromL0Flag() == bool(1 - iRefList) && pcSlice->getColRefIdx() == iRefIndex )
       {
-        msg( msgl, "%dc(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
+        if ( scaleRatio.first != 1 << SCALE_RATIO_BITS || scaleRatio.second != 1 << SCALE_RATIO_BITS )
+          msg( msgl, "%dc(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
+        else
+          msg( msgl, "%dc ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ) );
       }
       else
       {
-        msg( msgl, "%d(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
+        if ( scaleRatio.first != 1 << SCALE_RATIO_BITS || scaleRatio.second != 1 << SCALE_RATIO_BITS )
+          msg( msgl, "%d(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
+        else
+          msg( msgl, "%d ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ) );
       }
     }
     msg( msgl, "] ");
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index ba0a37d35e2c0827e52d6984c327561c893e9336..9f7cbf09cacc495b769ba0169827511cfcefa259 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -286,7 +286,7 @@ protected:
   int       m_ImplicitMTS;
   bool      m_SBT;                                ///< Sub-Block Transform for inter blocks
 #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
-  bool     m_SBT64RDOCheck; // Enable more than 32 SBT in encoder RDO check
+  int       m_SBTFast64WidthTh;                   ///< Enable size-64 SBT in encoder RDO check for HD and above sequences
 #endif
 
   bool      m_LFNST;
@@ -910,8 +910,8 @@ public:
   bool      getUseSBT                       ()         const { return m_SBT; }
 
 #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
-  void      setUse64SBTRDOCheck(bool b)                     { m_SBT64RDOCheck = b; }
-  bool      getUse64SBTRDOCheck             ()        const { return m_SBT64RDOCheck; }
+  void      setSBTFast64WidthTh             ( int  b )       { m_SBTFast64WidthTh = b; }
+  int       getSBTFast64WidthTh             ()         const { return m_SBTFast64WidthTh; }
 #endif
 
   void      setUseCompositeRef              (bool b)         { m_compositeRefEnabled = b; }
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 02fe97c21329befd5d6ccf2cffdcb69321ca1f96..414ec2e624d3e34f16ba6a73e6f812d87efd9b08 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -992,6 +992,7 @@ void EncCu::xCompressCU( CodingStructure*& tempCS, CodingStructure*& bestCS, Par
 #endif
   if (bestCS->cus.size() == 1) // no partition
   {
+    CHECK(bestCS->cus[0]->tileIdx != bestCS->picture->brickMap->getBrickIdxRsMap(bestCS->area.lumaPos()), "Wrong tile index!");
     if (bestCS->cus[0]->predMode == MODE_PLT)
     {
       for (int i = compBegin; i < (compBegin + numComp); i++)
@@ -2244,6 +2245,7 @@ void EncCu::xCheckRDCostHashInter( CodingStructure *&tempCS, CodingStructure *&b
 
   partitioner.setCUData(cu);
   cu.slice = tempCS->slice;
+  cu.tileIdx = tempCS->picture->brickMap->getBrickIdxRsMap(tempCS->area.lumaPos());
   cu.skip = false;
   cu.predMode = MODE_INTER;
   cu.transQuantBypass = encTestMode.lossless;
@@ -4318,7 +4320,11 @@ void EncCu::xEncodeInterResidual(   CodingStructure *&tempCS
   const bool mtsAllowed = tempCS->sps->getUseInterMTS() && CU::isInter( *cu ) && partitioner.currArea().lwidth() <= MTS_INTER_MAX_CU_SIZE && partitioner.currArea().lheight() <= MTS_INTER_MAX_CU_SIZE;
   uint8_t sbtAllowed = cu->checkAllowedSbt();
 #if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
-  sbtAllowed = ((cu->lwidth() > 32 || cu->lheight() > 32) && !(m_pcEncCfg->getUse64SBTRDOCheck())) ? 0 : sbtAllowed;
+  //SBT resolution-dependent fast algorithm: not try size-64 SBT in RDO for low-resolution sequences (now resolution below HD)
+  if( tempCS->pps->getPicWidthInLumaSamples() < (uint32_t)m_pcEncCfg->getSBTFast64WidthTh() )
+  {
+    sbtAllowed = ((cu->lwidth() > 32 || cu->lheight() > 32)) ? 0 : sbtAllowed;
+  }
 #endif
   uint8_t numRDOTried = 0;
   Distortion sbtOffDist = 0;
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index 85f895a324f2a75ff386b2959423c31e8e3d0068..d72debe2e17c2687affbab7899d2b43bc2d74c72 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -3993,21 +3993,22 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
       msg( NOTICE, " [L%d ", iRefList );
       for( int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx( RefPicList( iRefList ) ); iRefIndex++ )
       {
-        if( m_pcEncLib->isRPREnabled() )
+        const std::pair<int, int>& scaleRatio = pcSlice->getScalingRatio( RefPicList( iRefList ), iRefIndex );
+        
+        if( pcSlice->getEnableTMVPFlag() && pcSlice->getColFromL0Flag() == bool(1 - iRefList) && pcSlice->getColRefIdx() == iRefIndex )
         {
-          const std::pair<int, int>& scaleRatio = pcSlice->getScalingRatio( RefPicList( iRefList ), iRefIndex );
-
-          if( pcSlice->getEnableTMVPFlag() && pcSlice->getColFromL0Flag() == bool( 1 - iRefList ) && pcSlice->getColRefIdx() == iRefIndex )
-          {
+          if ( scaleRatio.first != 1 << SCALE_RATIO_BITS || scaleRatio.second != 1 << SCALE_RATIO_BITS )
             msg( NOTICE, "%dc(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
-          }
           else
-          {
-            msg( NOTICE, "%d(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
-          }
+            msg( NOTICE, "%dc ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ) );
         }
         else
-        msg( NOTICE, "%d ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ) );
+        {
+          if ( scaleRatio.first != 1 << SCALE_RATIO_BITS || scaleRatio.second != 1 << SCALE_RATIO_BITS )
+            msg( NOTICE, "%d(%1.2lfx, %1.2lfx) ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ), double( scaleRatio.first ) / ( 1 << SCALE_RATIO_BITS ), double( scaleRatio.second ) / ( 1 << SCALE_RATIO_BITS ) );
+          else
+            msg( NOTICE, "%d ", pcSlice->getRefPOC( RefPicList( iRefList ), iRefIndex ) );
+        }
       }
       msg( NOTICE, "]" );
     }
diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp
index 8731e1839168459c5d5b00358c4ee66148a2597d..bb6ed55e62dd324b627cbc62ff09b2e74387e1ef 100644
--- a/source/Lib/EncoderLib/InterSearch.cpp
+++ b/source/Lib/EncoderLib/InterSearch.cpp
@@ -7803,6 +7803,28 @@ bool InterSearch::searchBv(PredictionUnit& pu, int xPos, int yPos, int width, in
     return false;
   }
 
+  unsigned curTileIdx = pu.cs->picture->brickMap->getBrickIdxRsMap(pu.lumaPos());
+  unsigned refTileIdx = pu.cs->picture->brickMap->getBrickIdxRsMap(Position(refLeftX, refTopY));
+  if (curTileIdx != refTileIdx)
+  {
+    return false;
+  }
+  refTileIdx = pu.cs->picture->brickMap->getBrickIdxRsMap(Position(refLeftX, refBottomY));
+  if (curTileIdx != refTileIdx)
+  {
+    return false;
+  }
+  refTileIdx = pu.cs->picture->brickMap->getBrickIdxRsMap(Position(refRightX, refTopY));
+  if (curTileIdx != refTileIdx)
+  {
+    return false;
+  }
+  refTileIdx = pu.cs->picture->brickMap->getBrickIdxRsMap(Position(refRightX, refBottomY));
+  if (curTileIdx != refTileIdx)
+  {
+    return false;
+  }
+
   // in the same CTU line
   int numLeftCTUs = (1 << ((7 - ctuSizeLog2) << 1)) - ((ctuSizeLog2 < 7) ? 1 : 0);
   if ((refRightX >> ctuSizeLog2 <= xPos >> ctuSizeLog2) && (refLeftX >> ctuSizeLog2 >= (xPos >> ctuSizeLog2) - numLeftCTUs))
diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp
index b8d9de76257f9d5ea571d7ead9f9a65052b89c35..1169828082c0bf587ba1afb296d810ddbbef8d89 100644
--- a/source/Lib/EncoderLib/IntraSearch.cpp
+++ b/source/Lib/EncoderLib/IntraSearch.cpp
@@ -3438,10 +3438,35 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
 #endif
 #if JVET_P0058_CHROMA_TS
     // encoder bugfix: Set loadTr to aovid redundant transform process
+#if JVET_AHG14_LOSSLESS
+#if JVET_P0059_CHROMA_BDPCM
+    if (!(m_pcEncCfg->getCostMode() == COST_LOSSLESS_CODING && tu.mtsIdx[compID] == 0) || tu.cu->bdpcmModeChroma != 0)
+#else
+    if (!(m_pcEncCfg->getCostMode() == COST_LOSSLESS_CODING && tu.mtsIdx[compID] == 0))
+#endif
+    {
+        m_pcTrQuant->transformNxN(tu, codeCompId, qpCbCr, uiAbsSum, m_CABACEstimator->getCtx(), loadTr);
+    }
+#else
     m_pcTrQuant->transformNxN(tu, codeCompId, qpCbCr, uiAbsSum, m_CABACEstimator->getCtx(), loadTr);
+#endif
 #else
     m_pcTrQuant->transformNxN(tu, codeCompId, qpCbCr, uiAbsSum, m_CABACEstimator->getCtx());
 #endif
+
+#if JVET_AHG14_LOSSLESS
+#if JVET_P0059_CHROMA_BDPCM
+    if ((m_pcEncCfg->getCostMode() == COST_LOSSLESS_CODING && tu.mtsIdx[compID] == 0) && 0 == tu.cu->bdpcmModeChroma)
+#else
+    if ((m_pcEncCfg->getCostMode() == COST_LOSSLESS_CODING && tu.mtsIdx[compID] == 0))
+#endif
+    {
+        uiAbsSum = 0;
+        tu.getCoeffs(compID).fill(0);
+        TU::setCbfAtDepth(tu, compID, tu.depth, 0);
+    }
+#endif
+
     DTRACE( g_trace_ctx, D_TU_ABS_SUM, "%d: comp=%d, abssum=%d\n", DTRACE_GET_COUNTER( g_trace_ctx, D_TU_ABS_SUM ), codeCompId, uiAbsSum );
     if( uiAbsSum > 0 )
     {