From 7817ad84a7f9212f92750886404e2a3f91848c81 Mon Sep 17 00:00:00 2001
From: Frank Bossen <frank@bossentech.com>
Date: Tue, 16 Jul 2019 00:50:41 +0200
Subject: [PATCH] Remove macros from N meeting cycle and more

---
 source/App/DecoderApp/DecApp.cpp              |   64 -
 source/App/DecoderApp/DecApp.h                |    2 -
 source/App/DecoderApp/DecAppCfg.cpp           |    4 -
 source/App/DecoderApp/DecAppCfg.h             |    2 -
 source/App/EncoderApp/EncApp.cpp              |  120 +-
 source/App/EncoderApp/EncAppCfg.cpp           |  570 ------
 source/App/EncoderApp/EncAppCfg.h             |  100 --
 source/App/Parcat/parcat.cpp                  |  164 --
 source/App/SEIRemovalApp/SEIRemovalApp.cpp    |   14 -
 source/App/StreamMergeApp/StreamMergeApp.cpp  |   19 -
 .../App/StreamMergeApp/StreamMergeAppCfg.cpp  |   56 -
 source/Lib/CommonLib/AdaptiveLoopFilter.cpp   |  694 --------
 source/Lib/CommonLib/AdaptiveLoopFilter.h     |  109 --
 source/Lib/CommonLib/Buffer.cpp               |   11 -
 source/Lib/CommonLib/Buffer.h                 |    4 -
 source/Lib/CommonLib/ChromaFormat.h           |    2 -
 source/Lib/CommonLib/CodingStatistics.h       |   16 -
 source/Lib/CommonLib/CodingStructure.cpp      |   36 +-
 source/Lib/CommonLib/CodingStructure.h        |   18 +-
 source/Lib/CommonLib/Common.h                 |    2 -
 source/Lib/CommonLib/CommonDef.h              |   50 +-
 source/Lib/CommonLib/ContextModelling.cpp     |  101 --
 source/Lib/CommonLib/ContextModelling.h       |   42 -
 source/Lib/CommonLib/Contexts.cpp             |   82 -
 source/Lib/CommonLib/Contexts.h               |   22 -
 source/Lib/CommonLib/DepQuant.cpp             |  316 ----
 source/Lib/CommonLib/Hash.cpp                 |  111 --
 source/Lib/CommonLib/Hash.h                   |   13 -
 source/Lib/CommonLib/IbcHashMap.cpp           |   26 -
 source/Lib/CommonLib/IbcHashMap.h             |    2 -
 source/Lib/CommonLib/InterPrediction.cpp      |  156 --
 source/Lib/CommonLib/InterPrediction.h        |    4 -
 source/Lib/CommonLib/InterpolationFilter.cpp  |   14 -
 source/Lib/CommonLib/InterpolationFilter.h    |    2 -
 source/Lib/CommonLib/IntraPrediction.cpp      |  326 ----
 source/Lib/CommonLib/IntraPrediction.h        |   12 -
 source/Lib/CommonLib/LoopFilter.cpp           |  274 ---
 source/Lib/CommonLib/LoopFilter.h             |   10 -
 source/Lib/CommonLib/MCTS.cpp                 |   14 -
 .../Lib/CommonLib/MatrixIntraPrediction.cpp   |    2 -
 source/Lib/CommonLib/MatrixIntraPrediction.h  |    2 -
 source/Lib/CommonLib/MotionInfo.h             |    5 -
 source/Lib/CommonLib/Mv.cpp                   |   20 -
 source/Lib/CommonLib/Mv.h                     |   31 -
 source/Lib/CommonLib/NAL.h                    |   33 -
 source/Lib/CommonLib/Picture.cpp              |  400 -----
 source/Lib/CommonLib/Picture.h                |   82 -
 source/Lib/CommonLib/Quant.cpp                |  225 ---
 source/Lib/CommonLib/Quant.h                  |   23 -
 source/Lib/CommonLib/QuantRDOQ.cpp            |  232 ---
 source/Lib/CommonLib/QuantRDOQ.h              |   22 -
 source/Lib/CommonLib/RdCost.cpp               |   66 -
 source/Lib/CommonLib/RdCost.h                 |   12 -
 source/Lib/CommonLib/Reshape.cpp              |   21 -
 source/Lib/CommonLib/Rom.cpp                  |  230 ---
 source/Lib/CommonLib/Rom.h                    |   19 -
 source/Lib/CommonLib/RomLFNST.cpp             |    2 -
 source/Lib/CommonLib/SampleAdaptiveOffset.cpp |   34 -
 source/Lib/CommonLib/SampleAdaptiveOffset.h   |    4 -
 source/Lib/CommonLib/Slice.cpp                | 1335 +-------------
 source/Lib/CommonLib/Slice.h                  |  819 +--------
 source/Lib/CommonLib/TrQuant.cpp              |   78 -
 source/Lib/CommonLib/TrQuant.h                |   20 -
 source/Lib/CommonLib/TypeDef.h                |  295 ----
 source/Lib/CommonLib/Unit.cpp                 |   26 -
 source/Lib/CommonLib/Unit.h                   |   14 -
 source/Lib/CommonLib/UnitPartitioner.cpp      |   23 -
 source/Lib/CommonLib/UnitTools.cpp            | 1326 +-------------
 source/Lib/CommonLib/UnitTools.h              |   58 -
 source/Lib/CommonLib/WeightPrediction.cpp     |    4 -
 source/Lib/CommonLib/WeightPrediction.h       |    2 -
 .../Lib/CommonLib/dtrace_blockstatistics.cpp  |   22 -
 source/Lib/CommonLib/dtrace_blockstatistics.h |   26 -
 .../Lib/CommonLib/x86/AdaptiveLoopFilterX86.h |  877 ----------
 source/Lib/CommonLib/x86/BufferX86.h          |    9 -
 .../CommonLib/x86/InterpolationFilterX86.h    |   15 -
 source/Lib/CommonLib/x86/RdCostX86.h          |    6 -
 source/Lib/DecoderLib/CABACReader.cpp         |  456 -----
 source/Lib/DecoderLib/CABACReader.h           |   17 -
 source/Lib/DecoderLib/DecCu.cpp               |   81 -
 source/Lib/DecoderLib/DecLib.cpp              |  357 ----
 source/Lib/DecoderLib/DecLib.h                |   15 -
 source/Lib/DecoderLib/DecSlice.cpp            |   62 -
 source/Lib/DecoderLib/NALread.cpp             |   86 -
 source/Lib/DecoderLib/SEIread.cpp             |   32 -
 source/Lib/DecoderLib/VLCReader.cpp           | 1043 +----------
 source/Lib/DecoderLib/VLCReader.h             |   27 -
 source/Lib/EncoderLib/AnnexBwrite.h           |   16 -
 source/Lib/EncoderLib/CABACWriter.cpp         |  445 -----
 source/Lib/EncoderLib/CABACWriter.h           |   17 -
 .../Lib/EncoderLib/EncAdaptiveLoopFilter.cpp  | 1538 +----------------
 source/Lib/EncoderLib/EncAdaptiveLoopFilter.h |  215 ---
 source/Lib/EncoderLib/EncCfg.h                |  282 ---
 source/Lib/EncoderLib/EncCu.cpp               |  526 ------
 source/Lib/EncoderLib/EncCu.h                 |    8 -
 source/Lib/EncoderLib/EncGOP.cpp              |  520 ------
 source/Lib/EncoderLib/EncGOP.h                |    7 -
 source/Lib/EncoderLib/EncLib.cpp              |  584 +------
 source/Lib/EncoderLib/EncLib.h                |   25 +-
 source/Lib/EncoderLib/EncModeCtrl.cpp         |   59 -
 source/Lib/EncoderLib/EncModeCtrl.h           |   16 -
 source/Lib/EncoderLib/EncReshape.cpp          |   12 -
 .../EncoderLib/EncSampleAdaptiveOffset.cpp    |   28 -
 .../Lib/EncoderLib/EncSampleAdaptiveOffset.h  |    2 -
 source/Lib/EncoderLib/EncSlice.cpp            |  221 ---
 source/Lib/EncoderLib/InterSearch.cpp         |  435 -----
 source/Lib/EncoderLib/InterSearch.h           |   19 -
 source/Lib/EncoderLib/IntraSearch.cpp         |  864 ---------
 source/Lib/EncoderLib/IntraSearch.h           |   35 -
 source/Lib/EncoderLib/NALwrite.cpp            |    7 -
 source/Lib/EncoderLib/SEIEncoder.cpp          |   39 -
 source/Lib/EncoderLib/SEIwrite.cpp            |   27 -
 source/Lib/EncoderLib/VLCWriter.cpp           |  790 +--------
 source/Lib/EncoderLib/VLCWriter.h             |   25 -
 source/Lib/Utilities/VideoIOYuv.cpp           |    2 -
 115 files changed, 102 insertions(+), 18842 deletions(-)

diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp
index 490a28418..6f8adb88d 100644
--- a/source/App/DecoderApp/DecApp.cpp
+++ b/source/App/DecoderApp/DecApp.cpp
@@ -153,11 +153,7 @@ uint32_t DecApp::decode()
     {
       read(nalu);
 
-#if JVET_N0278_HLS
       if ((m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || !isNaluTheTargetLayer(&nalu))
-#else
-      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu)  )
-#endif
       {
         bNewPicture = false;
       }
@@ -237,16 +233,8 @@ uint32_t DecApp::decode()
         m_cDecLib.setNoOutputPriorPicsFlag (false);
       }
       if ( bNewPicture &&
-#if !JVET_M0101_HLS
-           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
-            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
-#else
           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP) )
-#endif
       {
         xFlushOutput( pcListPic );
       }
@@ -256,16 +244,8 @@ uint32_t DecApp::decode()
         m_cDecLib.setFirstSliceInPicture (false);
       }
       // write reconstruction to file -- for additional bumping as defined in C.5.2.3
-#if JVET_N0067_NAL_Unit_Header
       if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL_15)
         || (nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu.m_nalUnitType <= NAL_UNIT_CODED_SLICE_GRA)))
-#else
-#if !JVET_M0101_HLS
-      if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
-#else
-      if (!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL15)
-#endif
-#endif
       {
         xWriteOutput( pcListPic, nalu.m_temporalId );
       }
@@ -313,9 +293,7 @@ void DecApp::xCreateDecLib()
   );
   m_cDecLib.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
 
-#if JVET_N0278_HLS
   m_cDecLib.setTargetDecLayer(m_iTargetLayer);
-#endif
 
   if (!m_outputDecodedSEIMessagesFilename.empty())
   {
@@ -409,9 +387,6 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
         if ( !m_reconFileName.empty() )
         {
           const Window &conf = pcPicTop->cs->sps->getConformanceWindow();
-#if !JVET_N0063_VUI
-          const Window  defDisp = (m_respectDefDispWindow && pcPicTop->cs->sps->getVuiParametersPresentFlag()) ? pcPicTop->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
-#endif
           const bool isTff = pcPicTop->topField;
 
           bool display = true;
@@ -430,17 +405,10 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
             m_cVideoIOYuvReconFile.write( pcPicTop->getRecoBuf(), pcPicBottom->getRecoBuf(),
                                           m_outputColourSpaceConvert,
                                           false, // TODO: m_packedYUVMode,
-#if JVET_N0063_VUI
                                           conf.getWindowLeftOffset(),
                                           conf.getWindowRightOffset(),
                                           conf.getWindowTopOffset(),
                                           conf.getWindowBottomOffset(),
-#else
-                                          conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
-                                          conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
-                                          conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
-                                          conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
-#endif
                                           NUM_CHROMA_FORMAT, isTff );
           }
         }
@@ -484,24 +452,14 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
         if (!m_reconFileName.empty())
         {
           const Window &conf    = pcPic->cs->sps->getConformanceWindow();
-#if !JVET_N0063_VUI
-          const Window  defDisp = (m_respectDefDispWindow && pcPic->cs->sps->getVuiParametersPresentFlag()) ? pcPic->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
-#endif
 
           m_cVideoIOYuvReconFile.write( pcPic->getRecoBuf(),
                                         m_outputColourSpaceConvert,
                                         m_packedYUVMode,
-#if JVET_N0063_VUI
                                         conf.getWindowLeftOffset(),
                                         conf.getWindowRightOffset(),
                                         conf.getWindowTopOffset(),
                                         conf.getWindowBottomOffset(),
-#else
-                                        conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
-                                        conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
-                                        conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
-                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
-#endif
                                         NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
         }
 
@@ -556,25 +514,15 @@ void DecApp::xFlushOutput( PicList* pcListPic )
         if ( !m_reconFileName.empty() )
         {
           const Window &conf    = pcPicTop->cs->sps->getConformanceWindow();
-#if !JVET_N0063_VUI
-          const Window  defDisp = (m_respectDefDispWindow && pcPicTop->cs->sps->getVuiParametersPresentFlag()) ? pcPicTop->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
-#endif
           const bool    isTff   = pcPicTop->topField;
 
           m_cVideoIOYuvReconFile.write( pcPicTop->getRecoBuf(), pcPicBottom->getRecoBuf(),
                                         m_outputColourSpaceConvert,
                                         false, // TODO: m_packedYUVMode,
-#if JVET_N0063_VUI
                                         conf.getWindowLeftOffset(),
                                         conf.getWindowRightOffset(),
                                         conf.getWindowTopOffset(),
                                         conf.getWindowBottomOffset(),
-#else
-                                        conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
-                                        conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
-                                        conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
-                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
-#endif
                                         NUM_CHROMA_FORMAT, isTff );
         }
 
@@ -621,24 +569,14 @@ void DecApp::xFlushOutput( PicList* pcListPic )
         if (!m_reconFileName.empty())
         {
           const Window &conf    = pcPic->cs->sps->getConformanceWindow();
-#if !JVET_N0063_VUI
-          const Window  defDisp = (m_respectDefDispWindow && pcPic->cs->sps->getVuiParametersPresentFlag()) ? pcPic->cs->sps->getVuiParameters()->getDefaultDisplayWindow() : Window();
-#endif
 
           m_cVideoIOYuvReconFile.write( pcPic->getRecoBuf(),
                                         m_outputColourSpaceConvert,
                                         m_packedYUVMode,
-#if JVET_N0063_VUI
                                         conf.getWindowLeftOffset(),
                                         conf.getWindowRightOffset(),
                                         conf.getWindowTopOffset(),
                                         conf.getWindowBottomOffset(),
-#else
-                                        conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
-                                        conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
-                                        conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
-                                        conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(),
-#endif
                                         NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
         }
 
@@ -688,7 +626,6 @@ bool DecApp::isNaluWithinTargetDecLayerIdSet( InputNALUnit* nalu )
   return false;
 }
 
-#if JVET_N0278_HLS
 /** \param nalu Input nalu to check whether its LayerId is the specified target layer
 */
 bool DecApp::isNaluTheTargetLayer(InputNALUnit* nalu)
@@ -698,6 +635,5 @@ bool DecApp::isNaluTheTargetLayer(InputNALUnit* nalu)
 
   return false;
 }
-#endif
 
 //! \}
diff --git a/source/App/DecoderApp/DecApp.h b/source/App/DecoderApp/DecApp.h
index 5ef5e735b..cf9caf947 100644
--- a/source/App/DecoderApp/DecApp.h
+++ b/source/App/DecoderApp/DecApp.h
@@ -81,9 +81,7 @@ private:
   void  xWriteOutput      ( PicList* pcListPic , uint32_t tId); ///< write YUV to file
   void  xFlushOutput      ( PicList* pcListPic ); ///< flush all remaining decoded pictures to file
   bool  isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet
-#if JVET_N0278_HLS
   bool  isNaluTheTargetLayer(InputNALUnit* nalu); ///< check whether given Nalu is within targetDecLayerIdSet
-#endif
 };
 
 //! \}
diff --git a/source/App/DecoderApp/DecAppCfg.cpp b/source/App/DecoderApp/DecAppCfg.cpp
index c32fe2c41..da4685e7e 100644
--- a/source/App/DecoderApp/DecAppCfg.cpp
+++ b/source/App/DecoderApp/DecAppCfg.cpp
@@ -87,9 +87,7 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
   ("OutputBitDepthC,d",         m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0,          "bit depth of YUV output chroma component (default: use luma output bit-depth)")
   ("OutputColourSpaceConvert",  outputColourSpaceConvert,              string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
   ("MaxTemporalLayer,t",        m_iMaxTemporalLayer,                   -1,         "Maximum Temporal Layer to be decoded. -1 to decode all layers")
-#if JVET_N0278_HLS
   ("TargetLayer,p",             m_iTargetLayer,                        -1,         "Target bitstream Layer to be decoded.")
-#endif
   ("SEIDecodedPictureHash,-dph",m_decodedPictureHashSEIEnabled,        1,          "Control handling of decoded picture hash SEI messages\n"
                                                                                    "\t1: check hash in SEI messages if available in the bitstream\n"
                                                                                    "\t0: ignore SEI message")
@@ -225,9 +223,7 @@ DecAppCfg::DecAppCfg()
 , m_iSkipFrame(0)
 // m_outputBitDepth array initialised below
 , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
-#if JVET_N0278_HLS
 , m_iTargetLayer(0)
-#endif
 , m_iMaxTemporalLayer(-1)
 , m_decodedPictureHashSEIEnabled(0)
 , m_decodedNoDisplaySEIEnabled(false)
diff --git a/source/App/DecoderApp/DecAppCfg.h b/source/App/DecoderApp/DecAppCfg.h
index 7a24479d6..d4f01f770 100644
--- a/source/App/DecoderApp/DecAppCfg.h
+++ b/source/App/DecoderApp/DecAppCfg.h
@@ -61,9 +61,7 @@ protected:
   int           m_iSkipFrame;                           ///< counter for frames prior to the random access point to skip
   int           m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
   InputColourSpaceConversion m_outputColourSpaceConvert;
-#if JVET_N0278_HLS
   int           m_iTargetLayer;                       ///< target stream layer to be decoded
-#endif
 
   int           m_iMaxTemporalLayer;                  ///< maximum temporal layer to be decoded
   int           m_decodedPictureHashSEIEnabled;       ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index 2dc3b9ca5..d3a9e4e63 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -85,7 +85,7 @@ void EncApp::xInitLibCfg()
     vps.setMaxDecPicBuffering                                     ( m_maxDecPicBuffering[i], i );
   }
   m_cEncLib.setVPS(&vps);
-#elif JVET_N0278_HLS
+#else
   VPS vps;
 
   vps.setMaxLayers                                               ( 1 );
@@ -98,9 +98,7 @@ void EncApp::xInitLibCfg()
 #endif
   m_cEncLib.setProfile                                           ( m_profile);
   m_cEncLib.setLevel                                             ( m_levelTier, m_level);
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setSubProfile                                        ( m_subProfile );
-#endif
   m_cEncLib.setProgressiveSourceFlag                             ( m_progressiveSourceFlag);
   m_cEncLib.setInterlacedSourceFlag                              ( m_interlacedSourceFlag);
   m_cEncLib.setNonPackedConstraintFlag                           ( m_nonPackedConstraintFlag);
@@ -131,9 +129,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setMaxChromaFormatConstraintIdc                      ( m_chromaFormatConstraint );
   m_cEncLib.setFrameConstraintFlag                               ( m_bFrameConstraintFlag );
   m_cEncLib.setNoQtbttDualTreeIntraConstraintFlag                ( !m_dualTree );
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setNoPartitionConstraintsOverrideConstraintFlag      ( !m_SplitConsOverrideEnabledFlag );
-#endif
   m_cEncLib.setNoSaoConstraintFlag                               ( !m_bUseSAO );
   m_cEncLib.setNoAlfConstraintFlag                               ( !m_alf );
   m_cEncLib.setNoPcmConstraintFlag                               ( !m_usePCM );
@@ -142,31 +138,18 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setNoSbtmvpConstraintFlag                            ( m_SubPuMvpMode ? false : true );
   m_cEncLib.setNoAmvrConstraintFlag                              ( m_bNoAmvrConstraintFlag );
   m_cEncLib.setNoBdofConstraintFlag                              ( !m_BIO );
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setNoDmvrConstraintFlag                              ( !m_DMVR );
-#endif
   m_cEncLib.setNoCclmConstraintFlag                              ( m_LMChroma ? false : true );
   m_cEncLib.setNoMtsConstraintFlag                               ( (m_MTS || m_MTSImplicit) ? false : true );
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setNoSbtConstraintFlag                               ( !m_SBT );
-#endif
   m_cEncLib.setNoAffineMotionConstraintFlag                      ( !m_Affine );
   m_cEncLib.setNoGbiConstraintFlag                               ( !m_GBi );
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setNoIbcConstraintFlag                               ( m_IBCMode ? false : true );
-#endif
   m_cEncLib.setNoMhIntraConstraintFlag                           ( !m_MHIntra );
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setNoFPelMmvdConstraintFlag                          ( !(m_MMVD && m_allowDisFracMMVD) );
-#endif
   m_cEncLib.setNoTriangleConstraintFlag                          ( !m_Triangle );
   m_cEncLib.setNoLadfConstraintFlag                              ( !m_LadfEnabed );
-#if JVET_N0276_CONSTRAINT_FLAGS
   m_cEncLib.setNoTransformSkipConstraintFlag                     ( !m_useTransformSkip );
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  m_cEncLib.setNoCurrPicRefConstraintFlag                        ( !m_IBCMode );
-#endif
   m_cEncLib.setNoQpDeltaConstraintFlag                           ( m_bNoQpDeltaConstraintFlag );
   m_cEncLib.setNoDepQuantConstraintFlag                          ( !m_depQuantEnabledFlag);
   m_cEncLib.setNoSignDataHidingConstraintFlag                    ( !m_signDataHidingEnabledFlag );
@@ -175,19 +158,10 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setIntraPeriod                                       ( m_iIntraPeriod );
   m_cEncLib.setDecodingRefreshType                               ( m_iDecodingRefreshType );
   m_cEncLib.setGOPSize                                           ( m_iGOPSize );
-#if JCTVC_Y0038_PARAMS
   m_cEncLib.setReWriteParamSets                                  ( m_rewriteParamSets );
-#endif
-#if JVET_M0128
   m_cEncLib.setRPLList0                                          ( m_RPLList0);
   m_cEncLib.setRPLList1                                          ( m_RPLList1);
-#endif
-#if !JVET_M0128
-  m_cEncLib.setExtraRPSs                                         ( m_extraRPSs );
-#endif
-#if JVET_N0047_Merge_IDR_Non_IDR
   m_cEncLib.setIDRRefParamListPresent                            ( m_idrRefParamList );
-#endif
   m_cEncLib.setGopList                                           ( m_GOPList );
 
   for(int i = 0; i < MAX_TLAYER; i++)
@@ -245,10 +219,8 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setChromaCrQpOffset                                  ( m_crQpOffset  );
   m_cEncLib.setChromaCbQpOffsetDualTree                          ( m_cbQpOffsetDualTree );
   m_cEncLib.setChromaCrQpOffsetDualTree                          ( m_crQpOffsetDualTree );
-#if JVET_N0054_JOINT_CHROMA
   m_cEncLib.setChromaCbCrQpOffset                                ( m_cbCrQpOffset         );
   m_cEncLib.setChromaCbCrQpOffsetDualTree                        ( m_cbCrQpOffsetDualTree );
-#endif
 #if ER_CHROMA_QP_WCG_PPS
   m_cEncLib.setWCGChromaQpControl                                ( m_wcgChromaQpControl );
 #endif
@@ -291,10 +263,8 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setMinQTSizes                                        ( m_uiMinQT );
   m_cEncLib.setMaxBTDepth                                        ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
   m_cEncLib.setDualITree                                         ( m_dualTree );
-#if JVET_N0193_LFNST
   m_cEncLib.setLFNST                                             ( m_LFNST );
   m_cEncLib.setUseFastLFNST                                      ( m_useFastLFNST );
-#endif
   m_cEncLib.setSubPuMvpMode                                      ( m_SubPuMvpMode );
   m_cEncLib.setAffine                                            ( m_Affine );
   m_cEncLib.setAffineType                                        ( m_AffineType );
@@ -308,9 +278,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setImplicitMTS                                       ( m_MTSImplicit );
   m_cEncLib.setUseSBT                                            ( m_SBT );
   m_cEncLib.setUseCompositeRef                                   ( m_compositeRefEnabled );
-#if JVET_N0235_SMVD_SPS
   m_cEncLib.setUseSMVD                                           ( m_SMVD );
-#endif
   m_cEncLib.setUseGBi                                            ( m_GBi );
   m_cEncLib.setUseGBiFast                                        ( m_GBiFast );
 #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
@@ -333,15 +301,9 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setUseAffineAmvr                                     ( m_AffineAmvr );
   m_cEncLib.setUseAffineAmvrEncOpt                               ( m_AffineAmvrEncOpt );
   m_cEncLib.setDMVR                                              ( m_DMVR );
-#if JVET_N0127_MMVD_SPS_FLAG
   m_cEncLib.setMMVD                                              ( m_MMVD );
-#endif
-#if JVET_N0449_MMVD_SIMP
   m_cEncLib.setMmvdDisNum                                        (m_MmvdDisNum);
-#endif
-#if JVET_N0413_RDPCM
   m_cEncLib.setRDPCM                                              ( m_RdpcmMode );
-#endif
   m_cEncLib.setIBCMode                                           ( m_IBCMode );
   m_cEncLib.setIBCLocalSearchRangeX                              ( m_IBCLocalSearchRangeX );
   m_cEncLib.setIBCLocalSearchRangeY                              ( m_IBCLocalSearchRangeY );
@@ -355,7 +317,6 @@ void EncApp::xInitLibCfg()
 
   // ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   m_cEncLib.setLoopFilterAcrossVirtualBoundariesDisabledFlag     ( m_loopFilterAcrossVirtualBoundariesDisabledFlag );
   m_cEncLib.setNumVerVirtualBoundaries                           ( m_numVerVirtualBoundaries );
   m_cEncLib.setNumHorVirtualBoundaries                           ( m_numHorVirtualBoundaries );
@@ -367,7 +328,6 @@ void EncApp::xInitLibCfg()
   {
     m_cEncLib.setVirtualBoundariesPosY                           ( m_virtualBoundariesPosY[ i ], i );
   }
-#endif
 
   m_cEncLib.setMaxCUWidth                                        ( m_uiCTUSize );
   m_cEncLib.setMaxCUHeight                                       ( m_uiCTUSize );
@@ -388,14 +348,10 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setUseAMaxBT                                         ( m_useAMaxBT );
   m_cEncLib.setUseE0023FastEnc                                   ( m_e0023FastEnc );
   m_cEncLib.setUseContentBasedFastQtbt                           ( m_contentBasedFastQtbt );
-#if JVET_N0242_NON_LINEAR_ALF
   m_cEncLib.setUseNonLinearAlfLuma                               ( m_useNonLinearAlfLuma );
   m_cEncLib.setUseNonLinearAlfChroma                             ( m_useNonLinearAlfChroma );
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   m_cEncLib.setUseMIP                                            ( m_MIP );
   m_cEncLib.setUseFastMIP                                        ( m_useFastMIP );
-#endif
   m_cEncLib.setCrossComponentPredictionEnabledFlag               ( m_crossComponentPredictionEnabledFlag );
   m_cEncLib.setUseReconBasedCrossCPredictionEstimate             ( m_reconBasedCrossCPredictionEstimate );
   m_cEncLib.setLog2SaoOffsetScale                                ( CHANNEL_TYPE_LUMA  , m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA]   );
@@ -433,9 +389,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setPCMLog2MaxSize                                    ( m_pcmLog2MaxSize);
   m_cEncLib.setMaxNumMergeCand                                   ( m_maxNumMergeCand );
   m_cEncLib.setMaxNumAffineMergeCand                             ( m_maxNumAffineMergeCand );
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   m_cEncLib.setMaxNumTriangleCand                                ( m_maxNumTriangleCand );
-#endif
 
   //====== Weighted Prediction ========
   m_cEncLib.setUseWP                                             ( m_useWeightedPred     );
@@ -555,22 +509,15 @@ void EncApp::xInitLibCfg()
     m_cEncLib.setColumnWidth                                     ( m_tileColumnWidth );
     m_cEncLib.setRowHeight                                       ( m_tileRowHeight );
   }
-#if JVET_N0857_TILES_BRICKS
   m_cEncLib.setRectSliceFlag                                     ( m_rectSliceFlag );
   m_cEncLib.setNumSlicesInPicMinus1                              ( m_numSlicesInPicMinus1 );
-#if JVET_N0857_RECT_SLICES
   m_cEncLib.setTopLeftBrickIdx                                   ( m_topLeftBrickIdx );
   m_cEncLib.setBottomRightBrickIdx                               ( m_bottomRightBrickIdx);
-#else
-  m_cEncLib.setTopLeftTileIdx                                    ( m_topLeftTileIdx );
-  m_cEncLib.setBottomRightTileIdx                                ( m_bottomRightTileIdx );
-#endif
   m_cEncLib.setLoopFilterAcrossSlicesEnabledFlag                 ( m_loopFilterAcrossSlicesEnabledFlag );
   m_cEncLib.setSignalledSliceIdFlag                              ( m_signalledSliceIdFlag ),
   m_cEncLib.setSignalledSliceIdLengthMinus1                      ( m_signalledSliceIdLengthMinus1 );
   m_cEncLib.setSliceId                                           ( m_sliceId );
   m_cEncLib.setBrickSplitMap                                     (m_brickSplitMap);
-#endif
 
   m_cEncLib.xCheckGSParameters();
   int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1);
@@ -581,14 +528,10 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setLFCrossTileBoundaryFlag                           ( m_bLFCrossTileBoundaryFlag );
   m_cEncLib.setEntropyCodingSyncEnabledFlag                      ( m_entropyCodingSyncEnabledFlag );
   m_cEncLib.setTMVPModeId                                        ( m_TMVPModeId );
-#if HEVC_USE_SCALING_LISTS
   m_cEncLib.setUseScalingListId                                  ( m_useScalingListId  );
   m_cEncLib.setScalingListFileName                               ( m_scalingListFileName );
-#endif
   m_cEncLib.setDepQuantEnabledFlag                               ( m_depQuantEnabledFlag);
-#if HEVC_USE_SIGN_HIDING
   m_cEncLib.setSignDataHidingEnabledFlag                         ( m_signDataHidingEnabledFlag);
-#endif
   m_cEncLib.setUseRateCtrl                                       ( m_RCEnableRateControl );
   m_cEncLib.setTargetBitrate                                     ( m_RCTargetBitrate );
   m_cEncLib.setKeepHierBit                                       ( m_RCKeepHierarchicalBit );
@@ -605,14 +548,8 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setCUTransquantBypassFlagForceValue                  ( m_CUTransquantBypassFlagForce );
   m_cEncLib.setCostMode                                          ( m_costMode );
   m_cEncLib.setUseRecalculateQPAccordingToLambda                 ( m_recalculateQPAccordingToLambda );
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  m_cEncLib.setUseStrongIntraSmoothing                           ( m_useStrongIntraSmoothing );
-#endif
-#if JVET_N0349_DPS
   m_cEncLib.setDecodingParameterSetEnabled                       ( m_decodingParameterSetEnabled );
-#endif
   m_cEncLib.setActiveParameterSetsSEIEnabled                     ( m_activeParameterSetsSEIEnabled );
-#if JVET_N0063_VUI
   m_cEncLib.setVuiParametersPresentFlag                          ( m_vuiParametersPresentFlag );
   m_cEncLib.setAspectRatioInfoPresentFlag                        ( m_aspectRatioInfoPresentFlag);
   m_cEncLib.setAspectRatioIdc                                    ( m_aspectRatioIdc );
@@ -630,38 +567,6 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setOverscanAppropriateFlag                           ( m_overscanAppropriateFlag );
   m_cEncLib.setVideoSignalTypePresentFlag                        ( m_videoSignalTypePresentFlag );
   m_cEncLib.setVideoFullRangeFlag                                ( m_videoFullRangeFlag );
-#else
-  m_cEncLib.setVuiParametersPresentFlag                          ( m_vuiParametersPresentFlag );
-  m_cEncLib.setAspectRatioInfoPresentFlag                        ( m_aspectRatioInfoPresentFlag);
-  m_cEncLib.setAspectRatioIdc                                    ( m_aspectRatioIdc );
-  m_cEncLib.setSarWidth                                          ( m_sarWidth );
-  m_cEncLib.setSarHeight                                         ( m_sarHeight );
-  m_cEncLib.setOverscanInfoPresentFlag                           ( m_overscanInfoPresentFlag );
-  m_cEncLib.setOverscanAppropriateFlag                           ( m_overscanAppropriateFlag );
-  m_cEncLib.setVideoSignalTypePresentFlag                        ( m_videoSignalTypePresentFlag );
-  m_cEncLib.setVideoFormat                                       ( m_videoFormat );
-  m_cEncLib.setVideoFullRangeFlag                                ( m_videoFullRangeFlag );
-  m_cEncLib.setColourDescriptionPresentFlag                      ( m_colourDescriptionPresentFlag );
-  m_cEncLib.setColourPrimaries                                   ( m_colourPrimaries );
-  m_cEncLib.setTransferCharacteristics                           ( m_transferCharacteristics );
-  m_cEncLib.setMatrixCoefficients                                ( m_matrixCoefficients );
-  m_cEncLib.setChromaLocInfoPresentFlag                          ( m_chromaLocInfoPresentFlag );
-  m_cEncLib.setChromaSampleLocTypeTopField                       ( m_chromaSampleLocTypeTopField );
-  m_cEncLib.setChromaSampleLocTypeBottomField                    ( m_chromaSampleLocTypeBottomField );
-  m_cEncLib.setNeutralChromaIndicationFlag                       ( m_neutralChromaIndicationFlag );
-  m_cEncLib.setDefaultDisplayWindow                              ( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset );
-  m_cEncLib.setFrameFieldInfoPresentFlag                         ( m_frameFieldInfoPresentFlag );
-  m_cEncLib.setPocProportionalToTimingFlag                       ( m_pocProportionalToTimingFlag );
-  m_cEncLib.setNumTicksPocDiffOneMinus1                          ( m_numTicksPocDiffOneMinus1    );
-  m_cEncLib.setBitstreamRestrictionFlag                          ( m_bitstreamRestrictionFlag );
-  m_cEncLib.setTilesFixedStructureFlag                           ( m_tilesFixedStructureFlag );
-  m_cEncLib.setMotionVectorsOverPicBoundariesFlag                ( m_motionVectorsOverPicBoundariesFlag );
-  m_cEncLib.setMinSpatialSegmentationIdc                         ( m_minSpatialSegmentationIdc );
-  m_cEncLib.setMaxBytesPerPicDenom                               ( m_maxBytesPerPicDenom );
-  m_cEncLib.setMaxBitsPerMinCuDenom                              ( m_maxBitsPerMinCuDenom );
-  m_cEncLib.setLog2MaxMvLengthHorizontal                         ( m_log2MaxMvLengthHorizontal );
-  m_cEncLib.setLog2MaxMvLengthVertical                           ( m_log2MaxMvLengthVertical );
-#endif
   m_cEncLib.setEfficientFieldIRAPEnabled                         ( m_bEfficientFieldIRAPEnabled );
   m_cEncLib.setHarmonizeGopFirstFieldCoupleEnabled               ( m_bHarmonizeGopFirstFieldCoupleEnabled );
   m_cEncLib.setSummaryOutFilename                                ( m_summaryOutFilename );
@@ -950,24 +855,6 @@ void EncApp::rateStatsAccum(const AccessUnit& au, const std::vector<uint32_t>& a
   {
     switch ((*it_au)->m_nalUnitType)
     {
-#if !JVET_M0101_HLS
-    case NAL_UNIT_CODED_SLICE_TRAIL_R:
-    case NAL_UNIT_CODED_SLICE_TRAIL_N:
-    case NAL_UNIT_CODED_SLICE_TSA_R:
-    case NAL_UNIT_CODED_SLICE_TSA_N:
-    case NAL_UNIT_CODED_SLICE_STSA_R:
-    case NAL_UNIT_CODED_SLICE_STSA_N:
-    case NAL_UNIT_CODED_SLICE_BLA_W_LP:
-    case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
-    case NAL_UNIT_CODED_SLICE_BLA_N_LP:
-    case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
-    case NAL_UNIT_CODED_SLICE_IDR_N_LP:
-    case NAL_UNIT_CODED_SLICE_CRA:
-    case NAL_UNIT_CODED_SLICE_RADL_N:
-    case NAL_UNIT_CODED_SLICE_RADL_R:
-    case NAL_UNIT_CODED_SLICE_RASL_N:
-    case NAL_UNIT_CODED_SLICE_RASL_R:
-#else
     case NAL_UNIT_CODED_SLICE_TRAIL:
     case NAL_UNIT_CODED_SLICE_STSA:
     case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
@@ -975,13 +862,8 @@ void EncApp::rateStatsAccum(const AccessUnit& au, const std::vector<uint32_t>& a
     case NAL_UNIT_CODED_SLICE_CRA:
     case NAL_UNIT_CODED_SLICE_RADL:
     case NAL_UNIT_CODED_SLICE_RASL:
-#endif
-#if JVET_N0349_DPS
     case NAL_UNIT_DPS:
-#endif
-#if HEVC_VPS || JVET_N0278_HLS
     case NAL_UNIT_VPS:
-#endif
     case NAL_UNIT_SPS:
     case NAL_UNIT_PPS:
     case NAL_UNIT_APS:
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index a22c1d488..18e3d67f0 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -113,9 +113,7 @@ EncAppCfg::EncAppCfg()
 , m_maxChromaFormatConstraintIdc(CHROMA_420)
 , m_bFrameConstraintFlag(false)
 , m_bNoQtbttDualTreeIntraConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
 , m_noPartitionConstraintsOverrideConstraintFlag(false)
-#endif
 , m_bNoSaoConstraintFlag(false)
 , m_bNoAlfConstraintFlag(false)
 , m_bNoPcmConstraintFlag(false)
@@ -124,31 +122,18 @@ EncAppCfg::EncAppCfg()
 , m_bNoSbtmvpConstraintFlag(false)
 , m_bNoAmvrConstraintFlag(false)
 , m_bNoBdofConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
 , m_noDmvrConstraintFlag(false)
-#endif
 , m_bNoCclmConstraintFlag(false)
 , m_bNoMtsConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
 , m_noSbtConstraintFlag(false)
-#endif
 , m_bNoAffineMotionConstraintFlag(false)
 , m_bNoGbiConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
 , m_noIbcConstraintFlag(false)
-#endif
 , m_bNoMhIntraConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
 , m_noFPelMmvdConstraintFlag(false)
-#endif
 , m_bNoTriangleConstraintFlag(false)
 , m_bNoLadfConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
 , m_noTransformSkipConstraintFlag(false)
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-, m_bNoCurrPicRefConstraintFlag(false)
-#endif
 , m_bNoQpDeltaConstraintFlag(false)
 , m_bNoDepQuantConstraintFlag(false)
 , m_bNoSignDataHidingConstraintFlag(false)
@@ -214,7 +199,6 @@ std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry)     //in
   in>>entry.m_tcOffsetDiv2;
   in>>entry.m_betaOffsetDiv2;
   in>>entry.m_temporalId;
-#if JVET_M0128
   in >> entry.m_numRefPicsActive0;
   in >> entry.m_numRefPics0;
   for (int i = 0; i < entry.m_numRefPics0; i++)
@@ -227,32 +211,9 @@ std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry)     //in
   {
     in >> entry.m_deltaRefPics1[i];
   }
-#else
-  in >> entry.m_numRefPicsActive;
-  in>>entry.m_numRefPics;
-  for ( int i = 0; i < entry.m_numRefPics; i++ )
-  {
-    in>>entry.m_referencePics[i];
-  }
-  in>>entry.m_interRPSPrediction;
-  if (entry.m_interRPSPrediction==1)
-  {
-    in>>entry.m_deltaRPS;
-    in>>entry.m_numRefIdc;
-    for ( int i = 0; i < entry.m_numRefIdc; i++ )
-    {
-      in>>entry.m_refIdc[i];
-    }
-  }
-  else if (entry.m_interRPSPrediction==2)
-  {
-    in>>entry.m_deltaRPS;
-  }
-#endif
   return in;
 }
 
-#if JVET_N0857_TILES_BRICKS
 std::istringstream &operator>>(std::istringstream &in, BrickSplit &entry)     //input
 {
   in>>entry.m_tileIdx;
@@ -272,7 +233,6 @@ std::istringstream &operator>>(std::istringstream &in, BrickSplit &entry)     //
   return in;
 }
 
-#endif
 
 bool confirmPara(bool bflag, const char* message);
 
@@ -421,7 +381,6 @@ strToCostMode[] =
   {"mixed_lossless_lossy",      COST_MIXED_LOSSLESS_LOSSY_CODING}
 };
 
-#if HEVC_USE_SCALING_LISTS
 static const struct MapStrToScalingListMode
 {
   const char* str;
@@ -436,7 +395,6 @@ strToScalingListMode[] =
   {"default", SCALING_LIST_DEFAULT},
   {"file",    SCALING_LIST_FILE_READ}
 };
-#endif
 
 template<typename T, typename P>
 static std::string enumToString(P map[], uint32_t mapLen, const T val)
@@ -496,12 +454,10 @@ static inline istream& operator >> (istream &in, CostMode &mode)
   return readStrToEnum(strToCostMode, sizeof(strToCostMode)/sizeof(*strToCostMode), in, mode);
 }
 
-#if HEVC_USE_SCALING_LISTS
 static inline istream& operator >> (istream &in, ScalingListMode &mode)
 {
   return readStrToEnum(strToScalingListMode, sizeof(strToScalingListMode)/sizeof(*strToScalingListMode), in, mode);
 }
-#endif
 
 template <class T>
 struct SMultiValueInput
@@ -743,15 +699,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   SMultiValueInput<int>  cfg_codedPivotValue                 (std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), 0, 1<<16);
   SMultiValueInput<int>  cfg_targetPivotValue                (std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), 0, 1<<16);
 
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0857_RECT_SLICES
   SMultiValueInput<uint32_t> cfg_SliceIdx                    (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
   SMultiValueInput<uint32_t> cfg_SignalledSliceId            (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
-#else
-  SMultiValueInput<uint32_t> cfg_TileGroupIdx                (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
-  SMultiValueInput<uint32_t> cfg_SignalledTileGroupId        (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
-#endif
-#endif
 
   SMultiValueInput<double> cfg_adIntraLambdaModifier         (0, std::numeric_limits<double>::max(), 0, MAX_TLAYER); ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier.
 
@@ -793,10 +742,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   SMultiValueInput<int>  cfg_LadfQpOffset                    ( -MAX_QP, MAX_QP, 2, MAX_LADF_INTERVALS, defaultLadfQpOffset, 3 );
   SMultiValueInput<int>  cfg_LadfIntervalLowerBound          ( 0, std::numeric_limits<int>::max(), 1, MAX_LADF_INTERVALS - 1, defaultLadfIntervalLowerBound, 2 );
 #endif
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   SMultiValueInput<unsigned> cfg_virtualBoundariesPosX       (0, std::numeric_limits<uint32_t>::max(), 0, 3);
   SMultiValueInput<unsigned> cfg_virtualBoundariesPosY       (0, std::numeric_limits<uint32_t>::max(), 0, 3);
-#endif
   int warnUnknowParameter = 0;
 
 #if ENABLE_TRACING
@@ -881,9 +828,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("Profile",                                         extendedProfile,                                   NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none")
   ("Level",                                           m_level,                                    Level::NONE, "Level limit to be used, eg 5.1, or none")
   ("Tier",                                            m_levelTier,                                Level::MAIN, "Tier to use for interpretation of --Level (main or high only)")
-#if JVET_N0276_CONSTRAINT_FLAGS
   ("SubProfile",                                      m_subProfile,                                        0u, "Sub-profile idc")
-#endif
   ("EnableDecodingParameterSet",                      m_decodingParameterSetEnabled,                    false, "Enables writing of Decoding Parameter Set")
   ("MaxBitDepthConstraint",                           m_bitDepthConstraint,                                0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
   ("MaxChromaFormatConstraint",                       tmpConstraintChromaFormat,                            0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
@@ -906,14 +851,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("MaxBTDepthISliceL",                               m_uiMaxBTDepthI,                                     3u, "MaxBTDepthISliceL")
   ("MaxBTDepthISliceC",                               m_uiMaxBTDepthIChroma,                               3u, "MaxBTDepthISliceC")
   ("DualITree",                                       m_dualTree,                                       false, "Use separate QTBT trees for intra slice luma and chroma channel types")
-#if JVET_N0193_LFNST
   ( "LFNST",                                          m_LFNST,                                          false, "Enable LFNST (0:off, 1:on)  [default: off]" )
   ( "FastLFNST",                                      m_useFastLFNST,                                   false, "Fast methods for LFNST" )
-#endif
   ("SubPuMvp",                                       m_SubPuMvpMode,                                       0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:ATMVP, 2:STMVP, 3:ATMVP+STMVP)  [default: off]")
-#if JVET_N0127_MMVD_SPS_FLAG
   ("MMVD",                                           m_MMVD,                                            true, "Enable Merge mode with Motion Vector Difference (0:off, 1:on)  [default: 1]")
-#endif
   ("Affine",                                         m_Affine,                                         false, "Enable affine prediction (0:off, 1:on)  [default: off]")
   ("AffineType",                                     m_AffineType,                                     true,  "Enable affine type prediction (0:off, 1:on)  [default: on]" )
   ("BIO",                                            m_BIO,                                             false, "Enable bi-directional optical flow")
@@ -939,9 +880,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
 #if INCLUDE_ISP_CFG_FLAG
   ( "ISP",                                            m_ISP,                                            false, "Enable Intra Sub-Partitions\n" )
 #endif
-#if JVET_N0235_SMVD_SPS
   ("SMVD",                                            m_SMVD,                                           false, "Enable Symmetric MVD\n")
-#endif
   ("CompositeLTReference",                            m_compositeRefEnabled,                            false, "Enable Composite Long Term Reference Frame")
   ("GBi",                                             m_GBi,                                            false, "Enable Generalized Bi-prediction(GBi)")
   ("GBiFast",                                         m_GBiFast,                                        false, "Fast methods for Generalized Bi-prediction(GBi)\n")
@@ -959,12 +898,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("AffineAmvr",                                      m_AffineAmvr,                                     false, "Eanble AMVR for affine inter mode")
   ("AffineAmvrEncOpt",                                m_AffineAmvrEncOpt,                               false, "Enable encoder optimization of affine AMVR")
   ("DMVR",                                            m_DMVR,                                           false, "Decoder-side Motion Vector Refinement")
-#if JVET_N0449_MMVD_SIMP
   ("MmvdDisNum",                                      m_MmvdDisNum,                                     8,     "Number of MMVD Distance Entries")
-#endif
-#if JVET_N0413_RDPCM
   ( "RDPCM",                                         m_RdpcmMode,                                       false, "RDPCM")
-#endif
   ( "IBC",                                            m_IBCMode,                                           0u, "IBCMode (0x1:enabled, 0x0:disabled)  [default: disabled]")
   ( "IBCLocalSearchRangeX",                           m_IBCLocalSearchRangeX,                            128u, "Search range of IBC local search in x direction")
   ( "IBCLocalSearchRangeY",                           m_IBCLocalSearchRangeY,                            128u, "Search range of IBC local search in y direction")
@@ -977,13 +912,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("WrapAroundOffset",                                m_wrapAroundOffset,                                  0u, "Offset in luma samples used for computing the horizontal wrap-around position")
 
   // ADD_NEW_TOOL : (encoder app) add parsing parameters here
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   ("LoopFilterAcrossVirtualBoundariesDisabledFlag",   m_loopFilterAcrossVirtualBoundariesDisabledFlag,  false, "Disable in-loop filtering operations across the virtual boundaries (0:off, 1:on)  [default: off]")
   ("NumVerVirtualBoundaries",                         m_numVerVirtualBoundaries,                           0u, "Number of vertical virtual boundaries (0-3, inclusive)")
   ("NumHorVirtualBoundaries",                         m_numHorVirtualBoundaries,                           0u, "Number of horizontal virtual boundaries (0-3, inclusive)")
   ("VirtualBoundariesPosX",                           cfg_virtualBoundariesPosX,    cfg_virtualBoundariesPosX, "Locations of the vertical virtual boundaries in units of luma samples")
   ("VirtualBoundariesPosY",                           cfg_virtualBoundariesPosY,    cfg_virtualBoundariesPosY, "Locations of the horizontal virtual boundaries in units of luma samples")
-#endif
   ("EncDbOpt",                                        m_encDbOpt,                                       false, "Encoder optimization with deblocking filter")
   ("LumaReshapeEnable",                               m_lumaReshapeEnable,                              false, "Enable Reshaping for Luma Channel")
   ("ReshapeSignalType",                               m_reshapeSignalType,                                 0u, "Input signal type: 0: SDR, 1:PQ, 2:HLG")
@@ -994,14 +927,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("AMaxBT",                                          m_useAMaxBT,                                      false, "Adaptive maximal BT-size")
   ("E0023FastEnc",                                    m_e0023FastEnc,                                    true, "Fast encoding setting for QTBT (proposal E0023)")
   ("ContentBasedFastQtbt",                            m_contentBasedFastQtbt,                           false, "Signal based QTBT speed-up")
-#if JVET_N0242_NON_LINEAR_ALF
   ("UseNonLinearAlfLuma",                             m_useNonLinearAlfLuma,                             true, "Non-linear adaptive loop filters for Luma Channel")
   ("UseNonLinearAlfChroma",                           m_useNonLinearAlfChroma,                           true, "Non-linear adaptive loop filters for Chroma Channels")
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   ("MIP",                                             m_MIP,                                             true,  "Enable MIP (matrix-based intra prediction)")
   ("FastMIP",                                         m_useFastMIP,                                     false,  "Fast encoder search for MIP (matrix-based intra prediction)")
-#endif
   // Unit definition parameters
   ("MaxCUWidth",                                      m_uiMaxCUWidth,                                     64u)
   ("MaxCUHeight",                                     m_uiMaxCUHeight,                                    64u)
@@ -1018,14 +947,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("IntraPeriod,-ip",                                 m_iIntraPeriod,                                      -1, "Intra period in frames, (-1: only first frame)")
   ("DecodingRefreshType,-dr",                         m_iDecodingRefreshType,                               0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)")
   ("GOPSize,g",                                       m_iGOPSize,                                           1, "GOP size of temporal structure")
-#if JCTVC_Y0038_PARAMS
   ("ReWriteParamSets",                                m_rewriteParamSets,                           false, "Enable rewriting of Parameter sets before every (intra) random access point")
   //Alias with same name as in HM
   ("ReWriteParamSetsFlag",                            m_rewriteParamSets,                           false, "Alias for ReWriteParamSets")
-#endif
-#if JVET_N0047_Merge_IDR_Non_IDR
   ("IDRRefParamList",                                 m_idrRefParamList,                            false, "Enable indication of reference picture list syntax elements in slice headers of IDR pictures")
-#endif
   // motion search options
   ("DisableIntraInInter",                             m_bDisableIntraPUsInInterSlices,                  false, "Flag to disable intra PUs in inter slices")
   ("FastSearch",                                      tmpMotionEstimationSearchMethod,  int(MESEARCH_DIAMOND), "0:Full search 1:Diamond 2:Selective 3:Enhanced Diamond")
@@ -1080,10 +1005,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("CrQpOffset,-crqpofs",                             m_crQpOffset,                                         0, "Chroma Cr QP Offset")
   ("CbQpOffsetDualTree",                              m_cbQpOffsetDualTree,                                 0, "Chroma Cb QP Offset for dual tree")
   ("CrQpOffsetDualTree",                              m_crQpOffsetDualTree,                                 0, "Chroma Cr QP Offset for dual tree")
-#if JVET_N0054_JOINT_CHROMA
   ("CbCrQpOffset,-cbcrqpofs",                         m_cbCrQpOffset,                                      -1, "QP Offset for joint Cb-Cr mode")
   ("CbCrQpOffsetDualTree",                            m_cbCrQpOffsetDualTree,                               0, "QP Offset for joint Cb-Cr mode in dual tree")
-#endif
 #if ER_CHROMA_QP_WCG_PPS
   ("WCGPPSEnable",                                    m_wcgChromaQpControl.enabled,                     false, "1: Enable the WCG PPS chroma modulation scheme. 0 (default) disabled")
   ("WCGPPSCbQpScale",                                 m_wcgChromaQpControl.chromaCbQpScale,               1.0, "WCG PPS Chroma Cb QP Scale")
@@ -1145,11 +1068,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
 #if K0238_SAO_GREEDY_MERGE_ENCODING
   ("SAOGreedyEnc",                                    m_saoGreedyMergeEnc,                              false, "SAO greedy merge encoding algorithm")
 #endif
-#if JVET_N0857_TILES_BRICKS
   ("SliceMode",                                       tmpSliceMode,                            int(NO_SLICES), "0: Disable all Recon slice limits, 1: (deprecated #CTU), 2: (deprecated #bytes), 3:specify tiles per slice, 4: one brick per slice")
-#else
-  ("SliceMode",                                       tmpSliceMode,                            int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
-#endif
   ("SliceArgument",                                   m_sliceArgument,                                      0, "Depending on SliceMode being:"
                                                                                                                "\t1: max number of CTUs per slice"
                                                                                                                "\t2: max number of bytes per slice"
@@ -1173,10 +1092,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("Log2ParallelMergeLevel",                          m_log2ParallelMergeLevel,                            2u, "Parallel merge estimation region")
     //deprecated copies of renamed tile parameters
   ("UniformSpacingIdc",                               m_tileUniformSpacingFlag,                         false,      "deprecated alias of TileUniformSpacing")
-#if !JVET_N0857_TILES_BRICKS
-  ("ColumnWidthArray",                                cfg_ColumnWidth,                        cfg_ColumnWidth, "deprecated alias of TileColumnWidthArray")
-  ("RowHeightArray",                                  cfg_RowHeight,                            cfg_RowHeight, "deprecated alias of TileRowHeightArray")
-#endif
   ("TileUniformSpacing",                              m_tileUniformSpacingFlag,                         false,      "Indicates that tile columns and rows are distributed uniformly")
   ("NumTileColumnsMinus1",                            m_numTileColumnsMinus1,                               0,          "Number of tile columns in a picture minus 1")
   ("NumTileRowsMinus1",                               m_numTileRowsMinus1,                                  0,          "Number of rows in a picture minus 1")
@@ -1185,39 +1100,21 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("LFCrossTileBoundaryFlag",                         m_bLFCrossTileBoundaryFlag,                        true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering")
   ("WaveFrontSynchro",                                m_entropyCodingSyncEnabledFlag,                   false, "0: entropy coding sync disabled; 1 entropy coding sync enabled")
 
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0857_RECT_SLICES
   ("RectSliceFlag",                                   m_rectSliceFlag,                                  true, "Rectangular slice flag")
   ("NumRectSlicesInPicMinus1",                        m_numSlicesInPicMinus1,                              0, "Number slices in pic minus 1")
-#else
-  ("RectTileGroupFlag",                               m_rectSliceFlag,                                  true, "Rectangular tile group flag")
-  ("SlicesInPicMinus1",                               m_numSlicesInPicMinus1,                               0, "Number tile groups in pic minus 1")
-#endif
   ("LoopFilterAcrossTileGroupsEnabledFlag",           m_loopFilterAcrossSlicesEnabledFlag,              false, "Loop Filter Across Tile Groups Flag")
   ("SignalledIdFlag",                                 m_signalledSliceIdFlag,                           false, "Signalled Slice ID Flag")
   ("SignalledSliceIdLengthMinus1",                    m_signalledSliceIdLengthMinus1,                       0, "Signalled Tile Group Length minus 1")
-#if JVET_N0857_RECT_SLICES
   ("RectSlicesBoundaryArray",                         cfg_SliceIdx,                              cfg_SliceIdx, "Rectangular slices boundaries in Pic")
   ("SignalledSliceId",                                cfg_SignalledSliceId,                       cfg_SliceIdx, "Signalled rectangular slice ID")
-#else
-  ("TileGroupsInPic",                                 cfg_TileGroupIdx,                      cfg_TileGroupIdx, "Tile Groups In Pic")
-  ("SignalledTileGroupId",                            cfg_SignalledTileGroupId,              cfg_TileGroupIdx, "Signalled Tile Group ID")
-#endif
-#endif
 
-#if HEVC_USE_SCALING_LISTS
   ("ScalingList",                                     m_useScalingListId,                    SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile")
   ("ScalingListFile",                                 m_scalingListFileName,                       string(""), "Scaling list file name. Use an empty string to produce help.")
-#endif
   ("DepQuant",                                        m_depQuantEnabledFlag,                                          true )
-#if HEVC_USE_SIGN_HIDING
   ("SignHideFlag,-SBH",                               m_signDataHidingEnabledFlag,                                    false )
-#endif
   ("MaxNumMergeCand",                                 m_maxNumMergeCand,                                   5u, "Maximum number of merge candidates")
   ("MaxNumAffineMergeCand",                           m_maxNumAffineMergeCand,                             5u, "Maximum number of affine merge candidates")
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   ("MaxNumTriangleCand",                              m_maxNumTriangleCand,                                5u, "Maximum number of triangle candidates")
-#endif
   /* Misc. */
   ("SEIDecodedPictureHash,-dph",                      tmpDecodedPictureHashSEIMappedType,                   0, "Control generation of decode picture hash SEI messages\n"
                                                                                                                "\t3: checksum\n"
@@ -1247,12 +1144,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("CUTransquantBypassFlagForce",                     m_CUTransquantBypassFlagForce,                    false, "Force transquant bypass mode, when transquant_bypass_enabled_flag is enabled")
   ("CostMode",                                        m_costMode,                         COST_STANDARD_LOSSY, "Use alternative cost functions: choose between 'lossy', 'sequence_level_lossless', 'lossless' (which forces QP to " MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP) ") and 'mixed_lossless_lossy' (which used QP'=" MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME) " for pre-estimates of transquant-bypass blocks).")
   ("RecalculateQPAccordingToLambda",                  m_recalculateQPAccordingToLambda,                 false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case")
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  ("StrongIntraSmoothing,-sis",                       m_useStrongIntraSmoothing,                         true, "Enable strong intra smoothing for 32x32 blocks")
-#endif
   ("SEIActiveParameterSets",                          m_activeParameterSetsSEIEnabled,                      0, "Enable generation of active parameter sets SEI messages");
   opts.addOptions()
-#if JVET_N0063_VUI
   ("VuiParametersPresent,-vui",                       m_vuiParametersPresentFlag,                       false, "Enable generation of vui_parameters()")
   ("AspectRatioInfoPresent",                          m_aspectRatioInfoPresentFlag,                     false, "Signals whether aspect_ratio_idc is present")
   ("AspectRatioIdc",                                  m_aspectRatioIdc,                                     0, "aspect_ratio_idc")
@@ -1270,41 +1163,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("OverscanAppropriate",                             m_overscanAppropriateFlag,                        false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
   ("VideoSignalTypePresent",                          m_videoSignalTypePresentFlag,                     false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present")
   ("VideoFullRange",                                  m_videoFullRangeFlag,                             false, "Indicates the black level and range of luma and chroma signals");
-#else
-  ("VuiParametersPresent,-vui",                       m_vuiParametersPresentFlag,                       false, "Enable generation of vui_parameters()")
-  ("AspectRatioInfoPresent",                          m_aspectRatioInfoPresentFlag,                     false, "Signals whether aspect_ratio_idc is present")
-  ("AspectRatioIdc",                                  m_aspectRatioIdc,                                     0, "aspect_ratio_idc")
-  ("SarWidth",                                        m_sarWidth,                                           0, "horizontal size of the sample aspect ratio")
-  ("SarHeight",                                       m_sarHeight,                                          0, "vertical size of the sample aspect ratio")
-  ("OverscanInfoPresent",                             m_overscanInfoPresentFlag,                        false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
-  ("OverscanAppropriate",                             m_overscanAppropriateFlag,                        false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
-  ("VideoSignalTypePresent",                          m_videoSignalTypePresentFlag,                     false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present")
-  ("VideoFormat",                                     m_videoFormat,                                        5, "Indicates representation of pictures")
-  ("VideoFullRange",                                  m_videoFullRangeFlag,                             false, "Indicates the black level and range of luma and chroma signals")
-  ("ColourDescriptionPresent",                        m_colourDescriptionPresentFlag,                   false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present")
-  ("ColourPrimaries",                                 m_colourPrimaries,                                    2, "Indicates chromaticity coordinates of the source primaries")
-  ("TransferCharacteristics",                         m_transferCharacteristics,                            2, "Indicates the opto-electronic transfer characteristics of the source")
-  ("MatrixCoefficients",                              m_matrixCoefficients,                                 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries")
-  ("ChromaLocInfoPresent",                            m_chromaLocInfoPresentFlag,                       false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present")
-  ("ChromaSampleLocTypeTopField",                     m_chromaSampleLocTypeTopField,                        0, "Specifies the location of chroma samples for top field")
-  ("ChromaSampleLocTypeBottomField",                  m_chromaSampleLocTypeBottomField,                     0, "Specifies the location of chroma samples for bottom field")
-  ("NeutralChromaIndication",                         m_neutralChromaIndicationFlag,                    false, "Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)")
-  ("DefaultDisplayWindowFlag",                        m_defaultDisplayWindowFlag,                       false, "Indicates the presence of the Default Window parameters")
-  ("DefDispWinLeftOffset",                            m_defDispWinLeftOffset,                               0, "Specifies the left offset of the default display window from the conformance window")
-  ("DefDispWinRightOffset",                           m_defDispWinRightOffset,                              0, "Specifies the right offset of the default display window from the conformance window")
-  ("DefDispWinTopOffset",                             m_defDispWinTopOffset,                                0, "Specifies the top offset of the default display window from the conformance window")
-  ("DefDispWinBottomOffset",                          m_defDispWinBottomOffset,                             0, "Specifies the bottom offset of the default display window from the conformance window")
-  ("FrameFieldInfoPresentFlag",                       m_frameFieldInfoPresentFlag,                      false, "Indicates that pic_struct and field coding related values are present in picture timing SEI messages")
-  ("PocProportionalToTimingFlag",                     m_pocProportionalToTimingFlag,                    false, "Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS")
-  ("NumTicksPocDiffOneMinus1",                        m_numTicksPocDiffOneMinus1,                           0, "Number of ticks minus 1 that for a POC difference of one")
-  ("BitstreamRestriction",                            m_bitstreamRestrictionFlag,                       false, "Signals whether bitstream restriction parameters are present")
-  ("TilesFixedStructure",                             m_tilesFixedStructureFlag,                        false, "Indicates that each active picture parameter set has the same values of the syntax elements related to tiles")
-  ("MotionVectorsOverPicBoundaries",                  m_motionVectorsOverPicBoundariesFlag,             false, "Indicates that no samples outside the picture boundaries are used for inter prediction")
-  ("MaxBytesPerPicDenom",                             m_maxBytesPerPicDenom,                                2, "Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with any coded picture")
-  ("MaxBitsPerMinCuDenom",                            m_maxBitsPerMinCuDenom,                               1, "Indicates an upper bound for the number of bits of coding_unit() data")
-  ("Log2MaxMvLengthHorizontal",                       m_log2MaxMvLengthHorizontal,                         15, "Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units")
-  ("Log2MaxMvLengthVertical",                         m_log2MaxMvLengthVertical,                           15, "Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units");
-#endif
   opts.addOptions()
   ("SEIColourRemappingInfoFileRoot,-cri",             m_colourRemapSEIFileRoot,                    string(""), "Colour Remapping Information SEI parameters root file name (wo num ext)")
   ("SEIRecoveryPoint",                                m_recoveryPointSEIEnabled,                        false, "Control generation of recovery point SEI messages")
@@ -1458,20 +1316,17 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry());
   }
 
-#if JVET_N0857_TILES_BRICKS
   for(int i=1; i<MAX_TILES+1; i++)
   {
     std::ostringstream cOSS;
     cOSS<<"BrickSplit"<<i;
     opts.addOptions()(cOSS.str(), m_brickSplits[i-1], BrickSplit());
   }
-#endif
 
   po::setDefaults(opts);
   po::ErrorReporter err;
   const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**) argv, err);
 
-#if JVET_M0128
   for (int i = 0; m_GOPList[i].m_POC != -1 && i < MAX_GOP + 1; i++)
   {
     m_RPLList0[i].m_POC = m_RPLList1[i].m_POC = m_GOPList[i].m_POC;
@@ -1489,20 +1344,12 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     for (int j = 0; j < m_GOPList[i].m_numRefPics1; j++)
       m_RPLList1[i].m_deltaRefPics[j] = m_GOPList[i].m_deltaRefPics1[j];
   }
-#endif
 
   if (m_compositeRefEnabled)
   {
     for (int i = 0; i < m_iGOPSize; i++)
     {
       m_GOPList[i].m_POC *= 2;
-#if !JVET_M0128
-      m_GOPList[i].m_deltaRPS *= 2;
-      for (int j = 0; j < m_GOPList[i].m_numRefPics; j++)
-      {
-        m_GOPList[i].m_referencePics[j] *= 2;
-      }
-#else
       m_RPLList0[i].m_POC *= 2;
       m_RPLList1[i].m_POC *= 2;
       for (int j = 0; j < m_RPLList0[i].m_numRefPics; j++)
@@ -1513,7 +1360,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
       {
         m_RPLList1[i].m_deltaRefPics[j] *= 2;
       }
-#endif
     }
   }
 
@@ -1814,24 +1660,16 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     EXIT( "Error: bad slice mode");
   }
   m_sliceMode = SliceConstraint(tmpSliceMode);
-#if JVET_N0857_TILES_BRICKS
   if (m_sliceMode==FIXED_NUMBER_OF_CTU || m_sliceMode==FIXED_NUMBER_OF_BYTES)
   {
     // note: slice mode 2 can be re-enabled using scan order tiles
     EXIT( "Error: slice mode 1 (fixed number of CTUs) and 2 (fixed number of bytes) are no longer supported");
   }
-#endif
 
 
 
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0857_RECT_SLICES
   m_topLeftBrickIdx.clear();
   m_bottomRightBrickIdx.clear();
-#else
-  m_topLeftTileIdx.clear();
-  m_bottomRightTileIdx.clear();
-#endif
   m_sliceId.clear();
 
   bool singleTileInPicFlag = (m_numTileRowsMinus1 == 0 && m_numTileColumnsMinus1 == 0);
@@ -1841,7 +1679,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     //if (!m_singleBrickPerSliceFlag && m_rectSliceFlag)
     if (m_sliceMode != 0 && m_sliceMode != 4 && m_rectSliceFlag)
     {
-#if JVET_N0857_RECT_SLICES
       int numSlicesInPic = m_numSlicesInPicMinus1 + 1;
 
       if (cfg_SliceIdx.values.size() > numSlicesInPic * 2)
@@ -1852,37 +1689,15 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
       {
         EXIT("Error: The number of slice indices (RectSlicesBoundaryInPic) is less than the NumSlicesInPicMinus1.");
       }
-#else
-      int numTileGroupsInPic = m_numSlicesInPicMinus1 + 1;
-
-      if (cfg_TileGroupIdx.values.size() > numTileGroupsInPic * 2)
-      {
-        EXIT("Error: The number of Tile group indexs are greater than the numTileGroupsInPicMinus1.");
-      }
-      else if (cfg_TileGroupIdx.values.size() < numTileGroupsInPic * 2)
-      {
-        EXIT("Error: The number of Tile group indexs are less than the numTileGroupsInPicMinus1.");
-      }
-#endif
       else
       {
-#if JVET_N0857_RECT_SLICES
         m_topLeftBrickIdx.resize(numSlicesInPic);
         m_bottomRightBrickIdx.resize(numSlicesInPic);
         for (uint32_t i = 0; i < numSlicesInPic; ++i)
         {
           m_topLeftBrickIdx[i] = cfg_SliceIdx.values[i * 2];
           m_bottomRightBrickIdx[i] = cfg_SliceIdx.values[i * 2 + 1];
-#else
-        m_topLeftTileIdx.resize(numTileGroupsInPic);
-        m_bottomRightTileIdx.resize(numTileGroupsInPic);
-        for (uint32_t i = 0; i < numTileGroupsInPic; ++i)
-        {
-          m_topLeftTileIdx[i] = cfg_TileGroupIdx.values[i * 2];
-          m_bottomRightTileIdx[i] = cfg_TileGroupIdx.values[i * 2 + 1];
-#endif
         }
-#if JVET_N0857_RECT_SLICES
         //Validating the correctness of rectangular slice structure
         int **brickToSlice = (int **)malloc(sizeof(int *) * (m_numTileRowsMinus1 + 1));
         for (int i = 0; i <= m_numTileRowsMinus1; i++)
@@ -1952,12 +1767,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
         }
         free(brickToSlice);
         brickToSlice = 0;
-#endif
       }
     }      // (!m_singleBrickPerSliceFlag && m_rectSliceFlag)
   }        // !singleTileInPicFlag
 
-#if JVET_N0857_RECT_SLICES
   if (m_rectSliceFlag && m_signalledSliceIdFlag)
   {
     int numSlicesInPic = m_numSlicesInPicMinus1 + 1;
@@ -1988,30 +1801,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
       m_sliceId[i] = i;
     }
   }
-#else
-  if (m_rectSliceFlag && m_signalledSliceIdFlag)
-  {
-    int numTileGroupsInPic = m_numSlicesInPicMinus1 + 1;
-
-    if (cfg_SignalledTileGroupId.values.size() > numTileGroupsInPic)
-    {
-      EXIT("Error: The number of Tile group Ids are greater than the m_signalledTileGroupIdLengthMinus1.");
-    }
-    else if (cfg_SignalledTileGroupId.values.size() < numTileGroupsInPic)
-    {
-      EXIT("Error: The number of Tile group Ids are less than the m_signalledTileGroupIdLengthMinus1.");
-    }
-    else
-    {
-      m_sliceId.resize(numTileGroupsInPic);
-      for (uint32_t i = 0; i < cfg_SignalledTileGroupId.values.size(); ++i)
-      {
-        m_sliceId[i] = cfg_SignalledTileGroupId.values[i];
-      }
-    }
-  }
-#endif
-#endif
 
   if (tmpDecodedPictureHashSEIMappedType<0 || tmpDecodedPictureHashSEIMappedType>=int(NUMBER_OF_HASHTYPES))
   {
@@ -2112,7 +1901,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   }
 #endif
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   if ( m_loopFilterAcrossVirtualBoundariesDisabledFlag )
   {
     CHECK( m_numVerVirtualBoundaries > 3, "Number of vertical virtual boundaries must be comprised between 0 and 3 included" );
@@ -2148,7 +1936,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
       }
     }
   }
-#endif
 
   // reading external dQP description from file
   if ( !m_dQPFileName.empty() )
@@ -2379,20 +2166,14 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara( m_MTS, "MTS only allowed with NEXT profile" );
     xConfirmPara( m_MTSIntraMaxCand, "MTS only allowed with NEXT profile" );
     xConfirmPara( m_MTSInterMaxCand, "MTS only allowed with NEXT profile" );
-#if JVET_N0235_SMVD_SPS
     xConfirmPara( m_SMVD, "SMVD is only allowed with NEXT profile" );
-#endif
     xConfirmPara( m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile" );
     xConfirmPara( m_GBi, "GBi is only allowed with NEXT profile" );
     xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" );
     xConfirmPara( m_Triangle, "Triangle is only allowed with NEXT profile" );
     xConfirmPara(m_DMVR, "DMVR only allowed with NEXT profile");
-#if JVET_N0449_MMVD_SIMP
     xConfirmPara(m_MmvdDisNum, "Number of distance MMVD entry setting only allowed with NEXT profile");
-#endif
-#if JVET_N0413_RDPCM
     xConfirmPara(m_RdpcmMode, "RDPCM only allowed with NEXT profile");
-#endif
     // ADD_NEW_TOOL : (parameter check) add a check for next tools here
   }
   else
@@ -2400,20 +2181,14 @@ bool EncAppCfg::xCheckParameter()
     if( m_depQuantEnabledFlag )
     {
       xConfirmPara( !m_useRDOQ || !m_useRDOQTS, "RDOQ and RDOQTS must be equal to 1 if dependent quantization is enabled" );
-#if HEVC_USE_SIGN_HIDING
       xConfirmPara( m_signDataHidingEnabledFlag, "SignHideFlag must be equal to 0 if dependent quantization is enabled" );
-#endif
     }
 
   }
 
   if( m_wrapAround )
   {
-#if JVET_N0070_WRAPAROUND
     xConfirmPara( m_wrapAroundOffset <= m_uiCTUSize + (m_uiMaxCUWidth >> m_uiLog2DiffMaxMinCodingBlockSize), "Wrap-around offset must be greater than CtbSizeY + MinCbSize" );
-#else
-    xConfirmPara( m_wrapAroundOffset == 0, "Wrap-around offset must be greater than 0" );
-#endif
     xConfirmPara( m_wrapAroundOffset > m_iSourceWidth, "Wrap-around offset must not be greater than the source picture width" );
     int minCUSize =  m_uiCTUSize >> m_uiLog2DiffMaxMinCodingBlockSize;
     xConfirmPara( m_wrapAroundOffset % minCUSize != 0, "Wrap-around offset must be an integer multiple of the specified minimum CU size" );
@@ -2530,9 +2305,6 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt profiles.");
     xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt profiles.");
   }
-#if !JVET_N0671_CHROMA_FORMAT_422
-  xConfirmPara(m_chromaFormatIDC == CHROMA_422, "4:2:2 chroma sampling format not supported with current compiler setting. Set compiler flag \"JVET_N0671_CHROMA_FORMAT_422\" equal to 1 for enabling 4:2:2.\n\n");
-#endif // !JVET_N0671_CHROMA_FORMAT_422
 
 
   // check range of parameters
@@ -2675,12 +2447,10 @@ bool EncAppCfg::xCheckParameter()
   xConfirmPara( m_cbQpOffsetDualTree >  12,   "Max. Chroma Cb QP Offset for dual tree is  12" );
   xConfirmPara( m_crQpOffsetDualTree < -12,   "Min. Chroma Cr QP Offset for dual tree is -12" );
   xConfirmPara( m_crQpOffsetDualTree >  12,   "Max. Chroma Cr QP Offset for dual tree is  12" );
-#if JVET_N0054_JOINT_CHROMA
   xConfirmPara( m_cbCrQpOffset < -12,         "Min. Joint Cb-Cr QP Offset is -12" );
   xConfirmPara( m_cbCrQpOffset >  12,         "Max. Joint Cb-Cr QP Offset is  12" );
   xConfirmPara( m_cbCrQpOffsetDualTree < -12, "Min. Joint Cb-Cr QP Offset for dual tree is -12" );
   xConfirmPara( m_cbCrQpOffsetDualTree >  12, "Max. Joint Cb-Cr QP Offset for dual tree is  12" );
-#endif
 
   xConfirmPara( m_iQPAdaptationRange <= 0,                                                  "QP Adaptation Range must be more than 0" );
   if (m_iDecodingRefreshType == 2)
@@ -2713,11 +2483,9 @@ bool EncAppCfg::xCheckParameter()
 #endif
   xConfirmPara( m_maxNumMergeCand < 1,  "MaxNumMergeCand must be 1 or greater.");
   xConfirmPara( m_maxNumMergeCand > MRG_MAX_NUM_CANDS, "MaxNumMergeCand must be no more than MRG_MAX_NUM_CANDS." );
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   xConfirmPara( m_maxNumTriangleCand > TRIANGLE_MAX_NUM_UNI_CANDS, "MaxNumTriangleCand must be no more than TRIANGLE_MAX_NUM_UNI_CANDS." );
   xConfirmPara( m_maxNumTriangleCand > m_maxNumMergeCand, "MaxNumTriangleCand must be no more than MaxNumMergeCand." );
   xConfirmPara( 0 < m_maxNumTriangleCand && m_maxNumTriangleCand < 2, "MaxNumTriangleCand must be no less than 2 unless MaxNumTriangleCand is 0." );
-#endif
 
   xConfirmPara( m_maxNumAffineMergeCand < 1, "MaxNumAffineMergeCand must be 1 or greater." );
   xConfirmPara( m_maxNumAffineMergeCand > AFFINE_MRG_MAX_NUM_CANDS, "MaxNumAffineMergeCand must be no more than AFFINE_MRG_MAX_NUM_CANDS." );
@@ -2765,17 +2533,6 @@ bool EncAppCfg::xCheckParameter()
   xConfirmPara( m_confWinTop    % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
   xConfirmPara( m_confWinBottom % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
 
-#if !JVET_N0063_VUI
-  xConfirmPara( m_defaultDisplayWindowFlag && !m_vuiParametersPresentFlag, "VUI needs to be enabled for default display window");
-
-  if (m_defaultDisplayWindowFlag)
-  {
-    xConfirmPara( m_defDispWinLeftOffset   % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Left default display window offset must be an integer multiple of the specified chroma subsampling");
-    xConfirmPara( m_defDispWinRightOffset  % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Right default display window offset must be an integer multiple of the specified chroma subsampling");
-    xConfirmPara( m_defDispWinTopOffset    % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Top default display window offset must be an integer multiple of the specified chroma subsampling");
-    xConfirmPara( m_defDispWinBottomOffset % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling");
-  }
-#endif
 
   // max CU width and height should be power of 2
   uint32_t ui = m_uiMaxCUWidth;
@@ -2806,15 +2563,11 @@ bool EncAppCfg::xCheckParameter()
     m_GOPList[0].m_betaOffsetDiv2 = 0;
     m_GOPList[0].m_tcOffsetDiv2 = 0;
     m_GOPList[0].m_POC = 1;
-#if JVET_M0128
     m_RPLList0[0] = RPLEntry();
     m_RPLList1[0] = RPLEntry();
     m_RPLList0[0].m_POC = m_RPLList1[0].m_POC = 1;
     m_RPLList0[0].m_numRefPicsActive = 4;
     m_GOPList[0].m_numRefPicsActive0 = 4;
-#else
-    m_GOPList[0].m_numRefPicsActive = 4;
-#endif
   }
   else
   {
@@ -2871,7 +2624,6 @@ bool EncAppCfg::xCheckParameter()
   xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1]  + m_crQpOffset ) > 12, "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" );
 #endif
 
-#if JVET_M0128
   int extraRPLs = 0;
   //start looping through frames in coding order until we can verify that the GOP structure is correct.
   while (!verifiedGOP && !errorGOP)
@@ -3114,203 +2866,6 @@ bool EncAppCfg::xCheckParameter()
     checkGOP++;
   }
   xConfirmPara(errorGOP, "Invalid GOP structure given");
-#else
-  m_extraRPSs=0;
-  //start looping through frames in coding order until we can verify that the GOP structure is correct.
-  while(!verifiedGOP&&!errorGOP)
-  {
-    int curGOP = (checkGOP-1)%m_iGOPSize;
-    int curPOC = ((checkGOP - 1) / m_iGOPSize)*m_iGOPSize * multipleFactor + m_GOPList[curGOP].m_POC;
-    if(m_GOPList[curGOP].m_POC<0)
-    {
-      msg( WARNING, "\nError: found fewer Reference Picture Sets than GOPSize\n");
-      errorGOP=true;
-    }
-    else
-    {
-      //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP.
-      bool beforeI = false;
-      for(int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
-      {
-        int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i];
-        if(absPOC < 0)
-        {
-          beforeI=true;
-        }
-        else
-        {
-          bool found=false;
-          for(int j=0; j<numRefs; j++)
-          {
-            if(refList[j]==absPOC)
-            {
-              found=true;
-              for(int k=0; k<m_iGOPSize; k++)
-              {
-                if (absPOC % (m_iGOPSize * multipleFactor) == m_GOPList[k].m_POC % (m_iGOPSize * multipleFactor))
-                {
-                  if(m_GOPList[k].m_temporalId==m_GOPList[curGOP].m_temporalId)
-                  {
-                    m_GOPList[k].m_refPic = true;
-                  }
-                  m_GOPList[curGOP].m_usedByCurrPic[i]=m_GOPList[k].m_temporalId<=m_GOPList[curGOP].m_temporalId;
-                }
-              }
-            }
-          }
-          if(!found)
-          {
-            msg( WARNING, "\nError: ref pic %d is not available for GOP frame %d\n",m_GOPList[curGOP].m_referencePics[i],curGOP+1);
-            errorGOP=true;
-          }
-        }
-      }
-      if(!beforeI&&!errorGOP)
-      {
-        //all ref frames were present
-        if(!isOK[curGOP])
-        {
-          numOK++;
-          isOK[curGOP]=true;
-          if(numOK==m_iGOPSize)
-          {
-            verifiedGOP=true;
-          }
-        }
-      }
-      else
-      {
-        //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0)
-        m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP];
-        int newRefs=0;
-        for(int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
-        {
-          int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i];
-          if(absPOC>=0)
-          {
-            m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
-            m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
-            newRefs++;
-          }
-        }
-        int numPrefRefs = m_GOPList[curGOP].m_numRefPicsActive;
-
-        for(int offset = -1; offset>-checkGOP; offset--)
-        {
-          //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0.
-          int offGOP = (checkGOP-1+offset)%m_iGOPSize;
-          int offPOC = ((checkGOP - 1 + offset) / m_iGOPSize)*(m_iGOPSize * multipleFactor) + m_GOPList[offGOP].m_POC;
-          if(offPOC>=0&&m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId)
-          {
-            bool newRef=false;
-            for(int i=0; i<numRefs; i++)
-            {
-              if(refList[i]==offPOC)
-              {
-                newRef=true;
-              }
-            }
-            for(int i=0; i<newRefs; i++)
-            {
-              if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC)
-              {
-                newRef=false;
-              }
-            }
-            if(newRef)
-            {
-              int insertPoint=newRefs;
-              //this picture can be added, find appropriate place in list and insert it.
-              if(m_GOPList[offGOP].m_temporalId==m_GOPList[curGOP].m_temporalId)
-              {
-                m_GOPList[offGOP].m_refPic = true;
-              }
-              for(int j=0; j<newRefs; j++)
-              {
-                if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0)
-                {
-                  insertPoint = j;
-                  break;
-                }
-              }
-              int prev = offPOC-curPOC;
-              int prevUsed = m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId;
-              for(int j=insertPoint; j<newRefs+1; j++)
-              {
-                int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j];
-                int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j];
-                m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev;
-                m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed;
-                prevUsed=newUsed;
-                prev=newPrev;
-              }
-              newRefs++;
-            }
-          }
-          if(newRefs>=numPrefRefs)
-          {
-            break;
-          }
-        }
-        m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs;
-        m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC;
-        if (m_extraRPSs == 0)
-        {
-          m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0;
-          m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0;
-        }
-        else
-        {
-          int rIdx =  m_iGOPSize + m_extraRPSs - 1;
-          int refPOC = m_GOPList[rIdx].m_POC;
-          int refPics = m_GOPList[rIdx].m_numRefPics;
-          int newIdc=0;
-          for(int i = 0; i<= refPics; i++)
-          {
-            int deltaPOC = ((i != refPics)? m_GOPList[rIdx].m_referencePics[i] : 0);  // check if the reference abs POC is >= 0
-            int absPOCref = refPOC+deltaPOC;
-            int refIdc = 0;
-            for (int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++)
-            {
-              if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j])
-              {
-                if (m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j])
-                {
-                  refIdc = 1;
-                }
-                else
-                {
-                  refIdc = 2;
-                }
-              }
-            }
-            m_GOPList[m_iGOPSize+m_extraRPSs].m_refIdc[newIdc]=refIdc;
-            newIdc++;
-          }
-          m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 1;
-          m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = newIdc;
-          m_GOPList[m_iGOPSize+m_extraRPSs].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs].m_POC;
-        }
-        curGOP=m_iGOPSize+m_extraRPSs;
-        m_extraRPSs++;
-      }
-      numRefs=0;
-      for(int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
-      {
-        int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i];
-        if(absPOC >= 0)
-        {
-          refList[numRefs]=absPOC;
-          numRefs++;
-        }
-      }
-      refList[numRefs]=curPOC;
-      numRefs++;
-    }
-    checkGOP++;
-  }
-  xConfirmPara(errorGOP,"Invalid GOP structure given");
-#endif
 
   m_maxTempLayer = 1;
 
@@ -3329,7 +2884,6 @@ bool EncAppCfg::xCheckParameter()
   }
   for(int i=0; i<m_iGOPSize; i++)
   {
-#if JVET_M0128
     int numRefPic = m_RPLList0[i].m_numRefPics;
     for (int tmp = 0; tmp < m_RPLList1[i].m_numRefPics; tmp++)
     {
@@ -3344,12 +2898,6 @@ bool EncAppCfg::xCheckParameter()
     {
       m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = numRefPic + 1;
     }
-#else
-    if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
-    {
-      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
-    }
-#endif
     int highestDecodingNumberWithLowerPOC = 0;
     for(int j=0; j<m_iGOPSize; j++)
     {
@@ -3398,83 +2946,7 @@ bool EncAppCfg::xCheckParameter()
     m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
   }
 
-#if !JVET_N0063_VUI
-  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
-  {
-    int PicSizeInSamplesY =  m_iSourceWidth * m_iSourceHeight;
-    if(tileFlag)
-    {
-      int maxTileWidth = 0;
-      int maxTileHeight = 0;
-      int widthInCU = (m_iSourceWidth % m_uiMaxCUWidth) ? m_iSourceWidth/m_uiMaxCUWidth + 1: m_iSourceWidth/m_uiMaxCUWidth;
-      int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight;
-      if(m_tileUniformSpacingFlag)
-      {
-        maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_numTileColumnsMinus1)/(m_numTileColumnsMinus1+1));
-        maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_numTileRowsMinus1)/(m_numTileRowsMinus1+1));
-        // if only the last tile-row is one treeblock higher than the others
-        // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others
-        if(!((heightInCU-1)%(m_numTileRowsMinus1+1)))
-        {
-          maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight);
-        }
-        // if only the last tile-column is one treeblock wider than the others
-        // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others
-        if(!((widthInCU-1)%(m_numTileColumnsMinus1+1)))
-        {
-          maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth);
-        }
-      }
-      else // not uniform spacing
-      {
-        if(m_numTileColumnsMinus1<1)
-        {
-          maxTileWidth = m_iSourceWidth;
-        }
-        else
-        {
-          int accColumnWidth = 0;
-          for(int col=0; col<(m_numTileColumnsMinus1); col++)
-          {
-            maxTileWidth = m_tileColumnWidth[col]>maxTileWidth ? m_tileColumnWidth[col]:maxTileWidth;
-            accColumnWidth += m_tileColumnWidth[col];
-          }
-          maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth;
-        }
-        if(m_numTileRowsMinus1<1)
-        {
-          maxTileHeight = m_iSourceHeight;
-        }
-        else
-        {
-          int accRowHeight = 0;
-          for(int row=0; row<(m_numTileRowsMinus1); row++)
-          {
-            maxTileHeight = m_tileRowHeight[row]>maxTileHeight ? m_tileRowHeight[row]:maxTileHeight;
-            accRowHeight += m_tileRowHeight[row];
-          }
-          maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight;
-        }
-      }
-      int maxSizeInSamplesY = maxTileWidth*maxTileHeight;
-      m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/maxSizeInSamplesY-4;
-    }
-    else if(m_entropyCodingSyncEnabledFlag)
-    {
-      m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/((2*m_iSourceHeight+m_iSourceWidth)*m_uiMaxCUHeight)-4;
-    }
-    else if(m_sliceMode == FIXED_NUMBER_OF_CTU)
-    {
-      m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/(m_sliceArgument*m_uiMaxCUWidth*m_uiMaxCUHeight)-4;
-    }
-    else
-    {
-      m_minSpatialSegmentationIdc = 0;
-    }
-  }
-#endif
 
-#if JVET_N0857_TILES_BRICKS
   for (int i=0; i<MAX_TILES; i++)
   {
     if (m_brickSplits[i].m_tileIdx>=0)
@@ -3483,7 +2955,6 @@ bool EncAppCfg::xCheckParameter()
       // ToDo: check that brick dimensions don't exceed tile dimensions
     }
   }
-#endif
 
   if ((m_MCTSEncConstraint) && (m_bLFCrossTileBoundaryFlag))
   {
@@ -3565,17 +3036,6 @@ bool EncAppCfg::xCheckParameter()
   {
     xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" );
   }
-#if !JVET_N0063_VUI
-  if (m_vuiParametersPresentFlag)
-  {
-    xConfirmPara(m_RCTargetBitrate == 0, "A target bit rate is required to be set for VUI/HRD parameters.");
-    if (m_RCCpbSize == 0)
-    {
-      msg( WARNING, "Warning: CPB size is set equal to zero. Adjusting value to be equal to TargetBitrate!\n");
-      m_RCCpbSize = m_RCTargetBitrate;
-    }
-  }
-#endif
 #endif
 
   xConfirmPara(!m_TransquantBypassEnabledFlag && m_CUTransquantBypassFlagForce, "CUTransquantBypassFlagForce cannot be 1 when TransquantBypassEnableFlag is 0");
@@ -3769,9 +3229,7 @@ void EncAppCfg::xPrintParameter()
 
   msg( DETAILS, "Max Num Merge Candidates               : %d\n", m_maxNumMergeCand );
   msg( DETAILS, "Max Num Affine Merge Candidates        : %d\n", m_maxNumAffineMergeCand );
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   msg( DETAILS, "Max Num Triangle Merge Candidates      : %d\n", m_maxNumTriangleCand );
-#endif
   msg( DETAILS, "\n");
 
   msg( VERBOSE, "TOOL CFG: ");
@@ -3821,26 +3279,18 @@ void EncAppCfg::xPrintParameter()
   msg( VERBOSE, "PME:%d ", m_log2ParallelMergeLevel);
   const int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
   msg( VERBOSE, " WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams);
-#if HEVC_USE_SCALING_LISTS
   msg( VERBOSE, " ScalingList:%d ", m_useScalingListId );
-#endif
   msg( VERBOSE, "TMVPMode:%d ", m_TMVPModeId     );
 
   msg( VERBOSE, " DQ:%d ", m_depQuantEnabledFlag);
-#if HEVC_USE_SIGN_HIDING
   msg( VERBOSE, " SignBitHidingFlag:%d ", m_signDataHidingEnabledFlag);
-#endif
   msg( VERBOSE, "RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 );
 
   if( m_profile == Profile::NEXT )
   {
     msg( VERBOSE, "\nNEXT TOOL CFG: " );
-#if JVET_N0193_LFNST
     msg( VERBOSE, "LFNST:%d ", m_LFNST );
-#endif
-#if JVET_N0127_MMVD_SPS_FLAG
     msg( VERBOSE, "MMVD:%d ", m_MMVD);
-#endif
     msg( VERBOSE, "Affine:%d ", m_Affine );
     if ( m_Affine )
     {
@@ -3860,9 +3310,7 @@ void EncAppCfg::xPrintParameter()
 #if INCLUDE_ISP_CFG_FLAG
     msg( VERBOSE, "ISP:%d ", m_ISP );
 #endif
-#if JVET_N0235_SMVD_SPS
     msg( VERBOSE, "SMVD:%d ", m_SMVD );
-#endif
     msg( VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
     msg( VERBOSE, "GBi:%d ", m_GBi );
     msg( VERBOSE, "GBiFast:%d ", m_GBiFast );
@@ -3871,23 +3319,15 @@ void EncAppCfg::xPrintParameter()
 #endif
     msg(VERBOSE, "MHIntra:%d ", m_MHIntra);
     msg( VERBOSE, "Triangle:%d ", m_Triangle );
-#if JVET_N0127_MMVD_SPS_FLAG
     m_allowDisFracMMVD = m_MMVD ? m_allowDisFracMMVD : false;
     if ( m_MMVD )
       msg(VERBOSE, "AllowDisFracMMVD:%d ", m_allowDisFracMMVD);
-#else
-    msg( VERBOSE, "AllowDisFracMMVD:%d ", m_allowDisFracMMVD );
-#endif
     msg( VERBOSE, "AffineAmvr:%d ", m_AffineAmvr );
     m_AffineAmvrEncOpt = m_AffineAmvr ? m_AffineAmvrEncOpt : false;
     msg( VERBOSE, "AffineAmvrEncOpt:%d ", m_AffineAmvrEncOpt );
     msg(VERBOSE, "DMVR:%d ", m_DMVR);
-#if JVET_N0449_MMVD_SIMP
     msg(VERBOSE, "MmvdDisNum:%d ", m_MmvdDisNum);
-#endif
-#if JVET_N0413_RDPCM
     msg(VERBOSE, "RDPCM:%d ", m_RdpcmMode );
-#endif
   }
     msg(VERBOSE, "IBC:%d ", m_IBCMode);
   msg( VERBOSE, "HashME:%d ", m_HashME );
@@ -3897,7 +3337,6 @@ void EncAppCfg::xPrintParameter()
     msg( VERBOSE, "WrapAroundOffset:%d ", m_wrapAroundOffset );
   }
   // ADD_NEW_TOOL (add some output indicating the usage of tools)
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   msg(VERBOSE, "LoopFilterAcrossVirtualBoundaries:%d ", m_loopFilterAcrossVirtualBoundariesDisabledFlag);
   if ( m_loopFilterAcrossVirtualBoundariesDisabledFlag )
   {
@@ -3913,16 +3352,13 @@ void EncAppCfg::xPrintParameter()
     }
     msg(VERBOSE, " ] ");
   }
-#endif
     msg(VERBOSE, "Reshape:%d ", m_lumaReshapeEnable);
     if (m_lumaReshapeEnable)
     {
       msg(VERBOSE, "(Sigal:%s ", m_reshapeSignalType==0? "SDR" : "HDR-PQ");
       msg(VERBOSE, ") ");
     }
-#if JVET_N0217_MATRIX_INTRAPRED
     msg(VERBOSE, "MIP:%d ", m_MIP);
-#endif
     msg(VERBOSE, "EncDbOpt:%d ", m_encDbOpt);
   msg( VERBOSE, "\nFAST TOOL CFG: " );
   msg( VERBOSE, "LCTUFast:%d ", m_useFastLCTU );
@@ -3935,19 +3371,13 @@ void EncAppCfg::xPrintParameter()
 #else
   msg( VERBOSE, "ISPFast:%d ", m_useFastISP );
 #endif
-#if JVET_N0193_LFNST
   if( m_LFNST ) msg( VERBOSE, "FastLFNST:%d ", m_useFastLFNST );
-#endif
   msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
   msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
   msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt );
-#if JVET_N0242_NON_LINEAR_ALF
   msg( VERBOSE, "UseNonLinearALFLuma:%d ", m_useNonLinearAlfLuma );
   msg( VERBOSE, "UseNonLinearALFChroma:%d ", m_useNonLinearAlfChroma );
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   if( m_MIP ) msg(VERBOSE, "FastMIP:%d ", m_useFastMIP);
-#endif
 
   msg( VERBOSE, "NumSplitThreads:%d ", m_numSplitThreads );
   if( m_numSplitThreads > 1 )
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index 1643fe0b8..5c0b86f7e 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -122,9 +122,7 @@ protected:
   uint32_t  m_maxChromaFormatConstraintIdc;
   bool      m_bFrameConstraintFlag;
   bool      m_bNoQtbttDualTreeIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noPartitionConstraintsOverrideConstraintFlag;
-#endif
   bool      m_bNoSaoConstraintFlag;
   bool      m_bNoAlfConstraintFlag;
   bool      m_bNoPcmConstraintFlag;
@@ -133,31 +131,18 @@ protected:
   bool      m_bNoSbtmvpConstraintFlag;
   bool      m_bNoAmvrConstraintFlag;
   bool      m_bNoBdofConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noDmvrConstraintFlag;
-#endif
   bool      m_bNoCclmConstraintFlag;
   bool      m_bNoMtsConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noSbtConstraintFlag;
-#endif
   bool      m_bNoAffineMotionConstraintFlag;
   bool      m_bNoGbiConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noIbcConstraintFlag;
-#endif
   bool      m_bNoMhIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noFPelMmvdConstraintFlag;
-#endif
   bool      m_bNoTriangleConstraintFlag;
   bool      m_bNoLadfConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noTransformSkipConstraintFlag;
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool      m_bNoCurrPicRefConstraintFlag;
-#endif
   bool      m_bNoQpDeltaConstraintFlag;
   bool      m_bNoDepQuantConstraintFlag;
   bool      m_bNoSignDataHidingConstraintFlag;
@@ -166,9 +151,7 @@ protected:
   Profile::Name m_profile;
   Level::Tier   m_levelTier;
   Level::Name   m_level;
-#if JVET_N0276_CONSTRAINT_FLAGS
   uint32_t      m_subProfile;
-#endif
   uint32_t          m_bitDepthConstraint;
   ChromaFormat  m_chromaFormatConstraint;
   bool          m_intraConstraintFlag;
@@ -183,23 +166,13 @@ protected:
   int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
   int       m_iDecodingRefreshType;                           ///< random access type
   int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
-#if JCTVC_Y0038_PARAMS
   bool      m_rewriteParamSets;                              ///< Flag to enable rewriting of parameter sets at random access points
-#endif
-#if JVET_M0128
   RPLEntry  m_RPLList0[MAX_GOP];                               ///< the RPL entries from the config file
   RPLEntry  m_RPLList1[MAX_GOP];                               ///< the RPL entries from the config file
-#else
-  int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
-#endif
-#if JVET_N0047_Merge_IDR_Non_IDR
   bool      m_idrRefParamList;                                ///< indicates if reference picture list syntax elements are present in slice headers of IDR pictures 
-#endif
   GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
-#if JVET_N0857_TILES_BRICKS
   BrickSplit    m_brickSplits[MAX_TILES];
   BrickSplitMap m_brickSplitMap;
-#endif
   int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
   int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
   bool      m_crossComponentPredictionEnabledFlag;            ///< flag enabling the use of cross-component prediction
@@ -241,10 +214,8 @@ protected:
   int       m_crQpOffset;                                     ///< Chroma Cr QP Offset (0:default)
   int       m_cbQpOffsetDualTree;                             ///< Chroma Cb QP Offset for dual tree (overwrite m_cbQpOffset for dual tree)
   int       m_crQpOffsetDualTree;                             ///< Chroma Cr QP Offset for dual tree (overwrite m_crQpOffset for dual tree)
-#if JVET_N0054_JOINT_CHROMA
   int       m_cbCrQpOffset;                                   ///< QP Offset for joint Cb-Cr mode
   int       m_cbCrQpOffsetDualTree;                           ///< QP Offset for joint Cb-Cr mode (overwrite m_cbCrQpOffset for dual tree)
-#endif
 #if ER_CHROMA_QP_WCG_PPS
   WCGChromaQPControl m_wcgChromaQpControl;                    ///< Wide-colour-gamut chroma QP control.
 #endif
@@ -273,10 +244,8 @@ protected:
   unsigned  m_uiMaxBTDepthI;
   unsigned  m_uiMaxBTDepthIChroma;
   bool      m_dualTree;
-#if JVET_N0193_LFNST
   bool      m_LFNST;
   bool      m_useFastLFNST;
-#endif
   int       m_SubPuMvpMode;
   bool      m_Affine;
   bool      m_AffineType;
@@ -289,9 +258,7 @@ protected:
   int       m_MTSImplicit;
   bool      m_SBT;                                            ///< Sub-Block Transform for inter blocks
 
-#if JVET_N0235_SMVD_SPS
   bool      m_SMVD;
-#endif
   bool      m_compositeRefEnabled;
   bool      m_GBi;
   bool      m_GBiFast;
@@ -309,15 +276,9 @@ protected:
   bool      m_AffineAmvr;
   bool      m_AffineAmvrEncOpt;
   bool      m_DMVR;
-#if JVET_N0127_MMVD_SPS_FLAG
   bool      m_MMVD;
-#endif
-#if JVET_N0449_MMVD_SIMP
   int       m_MmvdDisNum;
-#endif
-#if JVET_N0413_RDPCM
   bool      m_RdpcmMode;
-#endif
   unsigned  m_IBCMode;
   unsigned  m_IBCLocalSearchRangeX;
   unsigned  m_IBCLocalSearchRangeY;
@@ -330,13 +291,11 @@ protected:
   unsigned  m_wrapAroundOffset;
 
   // ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool      m_loopFilterAcrossVirtualBoundariesDisabledFlag;
   unsigned  m_numVerVirtualBoundaries;
   unsigned  m_numHorVirtualBoundaries;
   std::vector<unsigned> m_virtualBoundariesPosX;
   std::vector<unsigned> m_virtualBoundariesPosY;
-#endif
   bool      m_lumaReshapeEnable;
   uint32_t  m_reshapeSignalType;
   uint32_t  m_intraCMD;
@@ -354,14 +313,10 @@ protected:
   bool      m_useFastMrg;
   bool      m_e0023FastEnc;
   bool      m_contentBasedFastQtbt;
-#if JVET_N0242_NON_LINEAR_ALF
   bool      m_useNonLinearAlfLuma;
   bool      m_useNonLinearAlfChroma;
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   bool      m_MIP;
   bool      m_useFastMIP;
-#endif
 
 
   int       m_numSplitThreads;
@@ -449,21 +404,14 @@ protected:
   std::vector<int> m_tileRowHeight;
   bool      m_entropyCodingSyncEnabledFlag;
 
-#if JVET_N0857_TILES_BRICKS
   bool      m_rectSliceFlag;
   int       m_numSlicesInPicMinus1;
-#if JVET_N0857_RECT_SLICES
   std::vector<int> m_topLeftBrickIdx;
   std::vector<int> m_bottomRightBrickIdx;
-#else
-  std::vector<int> m_topLeftTileIdx;
-  std::vector<int> m_bottomRightTileIdx;
-#endif
   bool      m_loopFilterAcrossSlicesEnabledFlag;
   bool      m_signalledSliceIdFlag;
   int       m_signalledSliceIdLengthMinus1;
   std::vector<int> m_sliceId;
-#endif
 
   bool      m_bUseConstrainedIntraPred;                       ///< flag for using constrained intra prediction
   bool      m_bFastUDIUseMPMEnabled;
@@ -551,15 +499,11 @@ protected:
   uint32_t      m_log2ParallelMergeLevel;                         ///< Parallel merge estimation region
   uint32_t      m_maxNumMergeCand;                                ///< Max number of merge candidates
   uint32_t      m_maxNumAffineMergeCand;                          ///< Max number of affine merge candidates
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   uint32_t      m_maxNumTriangleCand;
-#endif
 
   int       m_TMVPModeId;
   bool      m_depQuantEnabledFlag;
-#if HEVC_USE_SIGN_HIDING
   bool      m_signDataHidingEnabledFlag;
-#endif
   bool      m_RCEnableRateControl;                ///< enable rate control or not
   int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
   int       m_RCKeepHierarchicalBit;              ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
@@ -572,25 +516,17 @@ protected:
   uint32_t      m_RCCpbSize;                          ///< CPB size
   double    m_RCInitialCpbFullness;               ///< initial CPB fullness
 #endif
-#if HEVC_USE_SCALING_LISTS
   ScalingListMode m_useScalingListId;                         ///< using quantization matrix
   std::string m_scalingListFileName;                          ///< quantization matrix file name
-#endif
   bool      m_TransquantBypassEnabledFlag;                    ///< transquant_bypass_enabled_flag setting in PPS.
   bool      m_CUTransquantBypassFlagForce;                    ///< if transquant_bypass_enabled_flag, then, if true, all CU transquant bypass flags will be set to true.
   CostMode  m_costMode;                                       ///< Cost mode to use
 
   bool      m_recalculateQPAccordingToLambda;                 ///< recalculate QP value according to the lambda value
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  bool      m_useStrongIntraSmoothing;                        ///< enable strong intra smoothing for 32x32 blocks where the reference samples are flat
-#endif
   int       m_activeParameterSetsSEIEnabled;
 
-#if JVET_N0349_DPS
   bool      m_decodingParameterSetEnabled;                   ///< enable decoding parameter set
-#endif
 
-#if JVET_N0063_VUI
   bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
   bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
   int       m_aspectRatioIdc;                                 ///< aspect_ratio_idc
@@ -608,42 +544,6 @@ protected:
   bool      m_overscanAppropriateFlag;                        ///< Indicates whether conformant decoded pictures are suitable for display using overscan
   bool      m_videoSignalTypePresentFlag;                     ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
   bool      m_videoFullRangeFlag;                             ///< Indicates the black level and range of luma and chroma signals
-#else
-  bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
-  bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
-  int       m_aspectRatioIdc;                                 ///< aspect_ratio_idc
-  int       m_sarWidth;                                       ///< horizontal size of the sample aspect ratio
-  int       m_sarHeight;                                      ///< vertical size of the sample aspect ratio
-  bool      m_overscanInfoPresentFlag;                        ///< Signals whether overscan_appropriate_flag is present
-  bool      m_overscanAppropriateFlag;                        ///< Indicates whether conformant decoded pictures are suitable for display using overscan
-  bool      m_videoSignalTypePresentFlag;                     ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
-  int       m_videoFormat;                                    ///< Indicates representation of pictures
-  bool      m_videoFullRangeFlag;                             ///< Indicates the black level and range of luma and chroma signals
-  bool      m_colourDescriptionPresentFlag;                   ///< Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present
-  int       m_colourPrimaries;                                ///< Indicates chromaticity coordinates of the source primaries
-  int       m_transferCharacteristics;                        ///< Indicates the opto-electronic transfer characteristics of the source
-  int       m_matrixCoefficients;                             ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries
-  bool      m_chromaLocInfoPresentFlag;                       ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present
-  int       m_chromaSampleLocTypeTopField;                    ///< Specifies the location of chroma samples for top field
-  int       m_chromaSampleLocTypeBottomField;                 ///< Specifies the location of chroma samples for bottom field
-  bool      m_neutralChromaIndicationFlag;                    ///< Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)
-  bool      m_defaultDisplayWindowFlag;                       ///< Indicates the presence of the default window parameters
-  int       m_defDispWinLeftOffset;                           ///< Specifies the left offset from the conformance window of the default window
-  int       m_defDispWinRightOffset;                          ///< Specifies the right offset from the conformance window of the default window
-  int       m_defDispWinTopOffset;                            ///< Specifies the top offset from the conformance window of the default window
-  int       m_defDispWinBottomOffset;                         ///< Specifies the bottom offset from the conformance window of the default window
-  bool      m_frameFieldInfoPresentFlag;                      ///< Indicates that pic_struct values are present in picture timing SEI messages
-  bool      m_pocProportionalToTimingFlag;                    ///< Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS
-  int       m_numTicksPocDiffOneMinus1;                       ///< Number of ticks minus 1 that for a POC difference of one
-  bool      m_bitstreamRestrictionFlag;                       ///< Signals whether bitstream restriction parameters are present
-  bool      m_tilesFixedStructureFlag;                        ///< Indicates that each active picture parameter set has the same values of the syntax elements related to tiles
-  bool      m_motionVectorsOverPicBoundariesFlag;             ///< Indicates that no samples outside the picture boundaries are used for inter prediction
-  int       m_minSpatialSegmentationIdc;                      ///< Indicates the maximum size of the spatial segments in the pictures in the coded video sequence
-  int       m_maxBytesPerPicDenom;                            ///< Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with any coded picture
-  int       m_maxBitsPerMinCuDenom;                           ///< Indicates an upper bound for the number of bits of coding_unit() data
-  int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
-  int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
-#endif
   int       m_ImvMode;                                        ///< imv mode
   int       m_Imv4PelFast;                                    ///< imv 4-Pel fast mode
   std::string m_colourRemapSEIFileRoot;
diff --git a/source/App/Parcat/parcat.cpp b/source/App/Parcat/parcat.cpp
index da189dbec..7e1a857b5 100644
--- a/source/App/Parcat/parcat.cpp
+++ b/source/App/Parcat/parcat.cpp
@@ -59,9 +59,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
   SPS* sps = NULL;
 
   uint32_t firstSliceSegmentInPic;
-#if !JVET_N0857_RECT_SLICES
-  READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" );
-#endif
   if( isRapPic )
   {
     READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored -- updated already
@@ -74,21 +71,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
   //!KS: need to add error handling code here, if SPS is not available
   CHECK(sps==0, "Invalid SPS");
 
-#if !JVET_N0857_RECT_SLICES
-  int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight());
-  uint32_t sliceSegmentAddress = 0;
-  int bitsSliceSegmentAddress = 0;
-  while(numCTUs>(1<<bitsSliceSegmentAddress))
-  {
-    bitsSliceSegmentAddress++;
-  }
-
-  if(!firstSliceSegmentInPic)
-  {
-    READ_CODE( bitsSliceSegmentAddress, sliceSegmentAddress, "slice_segment_address" );
-  }
-#endif
-#if JVET_N0857_RECT_SLICES
   int bitsSliceAddress = 1;
   if (!pps->getRectSliceFlag())
   {
@@ -128,7 +110,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
   {
     READ_UVLC(uiCode, "num_bricks_in_slice_minus1");
   }
-#endif
   //set uiCode to equal slice start address (or dependent slice start address)
   for (int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++)
   {
@@ -206,7 +187,6 @@ const bool verbose = false;
 
 const char * NALU_TYPE[] =
 {
-#if JVET_N0067_NAL_Unit_Header
     "NAL_UNIT_PPS",
     "NAL_UNIT_ACCESS_UNIT_DELIMITER",
     "NAL_UNIT_PREFIX_SEI",
@@ -239,104 +219,6 @@ const char * NALU_TYPE[] =
     "NAL_UNIT_UNSPECIFIED_29",
     "NAL_UNIT_UNSPECIFIED_30",
     "NAL_UNIT_UNSPECIFIED_31"
-#else
-#if !JVET_M0101_HLS
-    "TRAIL_N",
-    "TRAIL_R",
-    "TSA_N",
-    "TSA_R",
-    "STSA_N",
-    "STSA_R",
-    "RADL_N",
-    "RADL_R",
-    "RASL_N",
-    "RASL_R",
-    "RSV_VCL_N10",
-    "RSV_VCL_N12",
-    "RSV_VCL_N14",
-    "RSV_VCL_R11",
-    "RSV_VCL_R13",
-    "RSV_VCL_R15",
-    "BLA_W_LP",
-    "BLA_W_RADL",
-    "BLA_N_LP",
-    "IDR_W_RADL",
-    "IDR_N_LP",
-    "CRA_NUT",
-    "RSV_IRAP_VCL22",
-    "RSV_IRAP_VCL23",
-    "unk",
-    "unk",
-    "unk",
-    "unk",
-    "unk",
-    "unk",
-    "unk",
-    "unk",
-#if HEVC_VPS
-    "VPS_NUT",
-#elif JVET_N0278_HLS
-    "VPS_NUT",
-#else
-    "unk",
-#endif
-    "SPS_NUT",
-    "PPS_NUT",
-#if JVET_M0132
-    "APS_NUT",
-#endif
-    "AUD_NUT",
-    "EOS_NUT",
-    "EOB_NUT",
-    "FD_NUT",
-    "PREFIX_SEI_NUT",
-    "SUFFIX_SEI_NUT",
-#else
-    "NAL_UNIT_CODED_SLICE_TRAIL",
-    "NAL_UNIT_CODED_SLICE_STSA",
-    "NAL_UNIT_CODED_SLICE_RADL",
-    "NAL_UNIT_CODED_SLICE_RASL",
-    "NAL_UNIT_RESERVED_VCL_4",
-    "NAL_UNIT_RESERVED_VCL_5",
-    "NAL_UNIT_RESERVED_VCL_6",
-    "NAL_UNIT_RESERVED_VCL_7",
-
-    "NAL_UNIT_CODED_SLICE_IDR_W_RADL",
-    "NAL_UNIT_CODED_SLICE_IDR_N_LP",
-    "NAL_UNIT_CODED_SLICE_CRA",
-
-    "NAL_UNIT_RESERVED_IRAP_VCL11",
-    "NAL_UNIT_RESERVED_IRAP_VCL12",
-    "NAL_UNIT_RESERVED_IRAP_VCL13",
-
-    "NAL_UNIT_RESERVED_VCL14",
-
-#if HEVC_VPS || JVET_N0278_HLS
-    "NAL_UNIT_VPS",
-#else
-    "NAL_UNIT_RESERVED_VCL15",
-#endif
-
-    "NAL_UNIT_RESERVED_NVCL16",
-
-    "NAL_UNIT_SPS",
-    "NAL_UNIT_PPS",
-    "NAL_UNIT_APS",
-    "NAL_UNIT_ACCESS_UNIT_DELIMITER",
-    "NAL_UNIT_EOS",
-    "NAL_UNIT_EOB",
-    "NAL_UNIT_PREFIX_SEI",
-    "NAL_UNIT_SUFFIX_SEI",
-    "NAL_UNIT_FILLER_DATA",
-
-    "NAL_UNIT_RESERVED_NVCL26",
-    "NAL_UNIT_RESERVED_NVCL27",
-    "NAL_UNIT_UNSPECIFIED_28",
-    "NAL_UNIT_UNSPECIFIED_29",
-    "NAL_UNIT_UNSPECIFIED_30",
-    "NAL_UNIT_UNSPECIFIED_31"
-#endif
-#endif
 };
 
 int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
@@ -358,15 +240,6 @@ int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
   {
     iPOCmsb = iPrevPOCmsb;
   }
-#if !JVET_M0101_HLS
-  if ( nalu_type == NAL_UNIT_CODED_SLICE_BLA_W_LP
-    || nalu_type == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-    || nalu_type == NAL_UNIT_CODED_SLICE_BLA_N_LP )
-  {
-    // For BLA picture types, POCmsb is set to 0.
-    iPOCmsb = 0;
-  }
-#endif
 
   return iPOCmsb + iPOClsb;
 }
@@ -401,14 +274,10 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
     p += nal_start;
 
     std::vector<uint8_t> nalu(p, p + nal_end - nal_start);
-#if JVET_N0067_NAL_Unit_Header
     int nalu_header = nalu[0];
     bool zeroTidRequiredFlag = (nalu_header & ( 1 << 7 )) >> 7;
     int nalUnitTypeLsb = (((1 << 4) - 1) & nalu_header);
     int nalu_type = ((zeroTidRequiredFlag << 4) + nalUnitTypeLsb);
-#else
-    int nalu_type = nalu[0] >> 1;
-#endif
     int poc = -1;
     int poc_lsb = -1;
     int new_poc = -1;
@@ -433,11 +302,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
     {
       PPS* pps = new PPS();
       HLSReader.setBitstream( &inp_nalu.getBitstream() );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       HLSReader.parsePPS( pps, &parameterSetManager );
-#else
-      HLSReader.parsePPS( pps );
-#endif
       parameterSetManager.storePPS( pps, inp_nalu.getBitstream().getFifo() );
     }
 
@@ -446,25 +311,12 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
       poc = 0;
       new_poc = *poc_base + poc;
     }
-#if JVET_N0067_NAL_Unit_Header
       if((nalu_type > 7 && nalu_type < 15) || nalu_type == NAL_UNIT_CODED_SLICE_CRA)
-#else
-#if !JVET_M0101_HLS
-    if(nalu_type < 32 && nalu_type != NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu_type != NAL_UNIT_CODED_SLICE_IDR_N_LP)
-#else
-      if(nalu_type < 15 && nalu_type != NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu_type != NAL_UNIT_CODED_SLICE_IDR_N_LP)
-#endif
-#endif
     {
       parcatHLSReader.setBitstream( &inp_nalu.getBitstream() );
       bool isRapPic =
         inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
         || inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-#if !JVET_M0101_HLS
-        || inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
-        || inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-        || inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
-#endif
         || inp_nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA;
 
       // beginning of slice header parsing, taken from VLCReader
@@ -506,25 +358,9 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
     }
 
 #if HEVC_VPS
-#if JVET_N0349_DPS
     if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP )) || ((idx>1 && !idr_found) && ( nalu_type == NAL_UNIT_DPS || nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS))
 #else
-    if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP )) || ((idx>1 && !idr_found) && ( nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS))
-#endif
-#else
-#if JVET_N0349_DPS
-#if JVET_N0278_HLS
     if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_DPS || nalu_type == NAL_UNIT_VPS ||nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
-#else
-    if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_DPS ||nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
-#endif
-#else
-#if JVET_N0278_HLS
-    if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
-#else
-    if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
-#endif
-#endif
 #endif
       || (nalu_type == NAL_UNIT_SUFFIX_SEI && skip_next_sei))
     {
diff --git a/source/App/SEIRemovalApp/SEIRemovalApp.cpp b/source/App/SEIRemovalApp/SEIRemovalApp.cpp
index a5bf76915..3fae3d532 100644
--- a/source/App/SEIRemovalApp/SEIRemovalApp.cpp
+++ b/source/App/SEIRemovalApp/SEIRemovalApp.cpp
@@ -72,7 +72,6 @@ void read2(InputNALUnit& nalu)
 {
   InputBitstream& bs = nalu.getBitstream();
 
-  #if JVET_N0067_NAL_Unit_Header
   bool zeroTidRequiredFlag = bs.read(1);              // zero_tid_required_flag
   nalu.m_temporalId = bs.read(3) - 1;                 // nuh_temporal_id_plus1
   CHECK(nalu.m_temporalId < 0, "Temporal ID is negative.");
@@ -89,19 +88,6 @@ void read2(InputNALUnit& nalu)
   CHECK((nalu.m_nuhLayerId < 0) || (nalu.m_nuhLayerId > 126), "Layer ID out of range");
   uint32_t nuh_reserved_zero_bit = bs.read(1);        // nuh_reserved_zero_bit
   CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
-#else
-  bool forbidden_zero_bit = bs.read(1);           // forbidden_zero_bit
-  if(forbidden_zero_bit != 0) { THROW( "Forbidden zero-bit not '0'" );}
-#if JVET_N0278_HLS
-  nalu.m_nalUnitType = (NalUnitType) bs.read(6);  // nal_unit_type
-  nalu.m_temporalId = bs.read(3) - 1;             // nuh_temporal_id_plus1
-  nalu.m_nuhLayerId = bs.read(6);                 // nuh_layer_id
-#else
-  nalu.m_nalUnitType = (NalUnitType) bs.read(6);  // nal_unit_type
-  nalu.m_nuhLayerId = bs.read(6);                 // nuh_layer_id
-  nalu.m_temporalId = bs.read(3) - 1;             // nuh_temporal_id_plus1
-#endif
-#endif
 }
 
 uint32_t SEIRemovalApp::decode()
diff --git a/source/App/StreamMergeApp/StreamMergeApp.cpp b/source/App/StreamMergeApp/StreamMergeApp.cpp
index 557fa56b9..546669f45 100644
--- a/source/App/StreamMergeApp/StreamMergeApp.cpp
+++ b/source/App/StreamMergeApp/StreamMergeApp.cpp
@@ -73,7 +73,6 @@ void read2(InputNALUnit& nalu)
 {
   InputBitstream& bs = nalu.getBitstream();
 
-#if JVET_N0067_NAL_Unit_Header
   bool zeroTidRequiredFlag = bs.read(1);              // zero_tid_required_flag
   nalu.m_temporalId = bs.read(3) - 1;                 // nuh_temporal_id_plus1
   CHECK(nalu.m_temporalId < 0, "Temporal ID is negative.");
@@ -90,13 +89,6 @@ void read2(InputNALUnit& nalu)
   CHECK((nalu.m_nuhLayerId < 0) || (nalu.m_nuhLayerId > 126), "Layer ID out of range");
   uint32_t nuh_reserved_zero_bit = bs.read(1);        // nuh_reserved_zero_bit
   CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
-#else
-  bool forbidden_zero_bit = bs.read(1);           // forbidden_zero_bit
-  if (forbidden_zero_bit != 0) { THROW("Forbidden zero-bit not '0'"); }
-  nalu.m_nalUnitType = (NalUnitType)bs.read(6);  // nal_unit_type
-  nalu.m_temporalId = bs.read(3) - 1;             // nuh_temporal_id_plus1
-  nalu.m_nuhLayerId = bs.read(6);                 // nuh_layer_id
-#endif
 }
 
 static void
@@ -246,7 +238,6 @@ void StreamMergeApp::writeNewVPS(ostream& out, int nLayerId, int nTemporalId)
   OutputBitstream bsNALUHeader;
   static const uint8_t start_code_prefix[] = { 0,0,0,1 };
 
-#if JVET_N0067_NAL_Unit_Header
   bsNALUHeader.write(1, 1);    		       // zero_tid_required_flag
   bsNALUHeader.write(nTemporalId + 1, 3);                // nuh_temporal_id_plus1
   uint32_t nalUnitTypeLsb = NAL_UNIT_VPS - (1 << 4);
@@ -257,12 +248,6 @@ void StreamMergeApp::writeNewVPS(ostream& out, int nLayerId, int nTemporalId)
   bsNALUHeader.write(nLayerId, 7);         // nuh_layer_id
 #endif
   bsNALUHeader.write(0, 1);                // nuh_reserved_zero_bit
-#else
-  bsNALUHeader.write(0, 1);                // forbidden_zero_bit
-  bsNALUHeader.write(NAL_UNIT_VPS, 6);     // nal_unit_type
-  bsNALUHeader.write(1, 3);                // nuh_temporal_id_plus1
-  bsNALUHeader.write(nLayerId, 6);         // nuh_layer_id
-#endif
 
   out.write(reinterpret_cast<const char*>(start_code_prefix), 4);
   out.write(reinterpret_cast<const char*>(bsNALUHeader.getByteStream()), bsNALUHeader.getByteStreamLength());
@@ -356,15 +341,11 @@ uint32_t StreamMergeApp::mergeStreams()
 
         //update the nul_layer_id
         uint8_t *p = (uint8_t*)nalu.getBitstream().getFifo().data();
-#if JVET_N0067_NAL_Unit_Header
 #if EMULATION_PREVENTION_FIX
         p[1] = ((layerId + 1) << 1) & 0xff;
 #else
         p[1] = (layerId << 1) & 0xff;
 #endif
-#else
-        p[1] = (p[1] & 0xc0) | layerId;
-#endif
 
         bitstreamFileOut.write((const char*)p, nalu.getBitstream().getFifo().size());
 
diff --git a/source/App/StreamMergeApp/StreamMergeAppCfg.cpp b/source/App/StreamMergeApp/StreamMergeAppCfg.cpp
index 900dc4488..feac8cb48 100644
--- a/source/App/StreamMergeApp/StreamMergeAppCfg.cpp
+++ b/source/App/StreamMergeApp/StreamMergeAppCfg.cpp
@@ -56,7 +56,6 @@ namespace po = df::program_options_lite;
  */
 bool StreamMergeAppCfg::parseCfg(int argc, char* argv[])
 {
-#if 1
   int i;
 
   m_numInputStreams = argc - 2;
@@ -67,61 +66,6 @@ bool StreamMergeAppCfg::parseCfg(int argc, char* argv[])
   }
 
   m_bitstreamFileNameOut = argv[i + 1];
-#else
-  bool do_help = false;
-  int warnUnknowParameter = 0;
-  po::Options opts;
-  opts.addOptions()
-
-  ("help", do_help, false, "this help text")
-  ("BitstreamFileIn0,-a", m_bitstreamFileNameIn[0], string(""), "bitstream input file name")
-  ("BitstreamFileIn1,-b", m_bitstreamFileNameIn[1], string(""), "bitstream input file name")
-  ("BitstreamFileOut,o", m_bitstreamFileNameOut, string(""), "bitstream output file name")
-  ;
-
-  po::setDefaults(opts);
-  po::ErrorReporter err;
-  const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**)argv, err);
-
-  for (list<const char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
-  {
-    std::cerr << "Unhandled argument ignored: " << *it << std::endl;
-  }
-
-  if (argc == 1 || do_help)
-  {
-    po::doHelp(cout, opts);
-    return false;
-  }
-
-  if (err.is_errored)
-  {
-    if (!warnUnknowParameter)
-    {
-      /* errors have already been reported to stderr */
-      return false;
-    }
-  }
-
-  m_numInputStreams = 0;
-  for (int i = 0; i < MAX_VPS_LAYERS; i++)
-  {
-    if (!m_bitstreamFileNameIn[i].empty())
-      m_numInputStreams++;
-  }
-
-  if (m_numInputStreams < 2)
-  {
-    std::cerr << "Need at least two input bitstreams, aborting" << std::endl;
-    return false;
-  }
-
-  if (m_bitstreamFileNameOut.empty())
-  {
-    std::cerr << "No output file specified, aborting" << std::endl;
-    return false;
-  }
-#endif
 
   return true;
 }
diff --git a/source/Lib/CommonLib/AdaptiveLoopFilter.cpp b/source/Lib/CommonLib/AdaptiveLoopFilter.cpp
index b53b5b80f..9e6ffdb9d 100644
--- a/source/Lib/CommonLib/AdaptiveLoopFilter.cpp
+++ b/source/Lib/CommonLib/AdaptiveLoopFilter.cpp
@@ -39,14 +39,10 @@
 
 #include "CodingStructure.h"
 #include "Picture.h"
-#if JVET_N0242_NON_LINEAR_ALF
 #include <array>
 #include <cmath>
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
 constexpr int AdaptiveLoopFilter::AlfNumClippingValues[];
-#endif
 
 AdaptiveLoopFilter::AdaptiveLoopFilter()
   : m_classifier( nullptr )
@@ -72,7 +68,6 @@ AdaptiveLoopFilter::AdaptiveLoopFilter()
 #endif
 }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 bool AdaptiveLoopFilter::isCrossedByVirtualBoundaries( const int xPos, const int yPos, const int width, const int height, bool& clipTop, bool& clipBottom, bool& clipLeft, bool& clipRight, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps)
 {
   clipTop = false; clipBottom = false; clipLeft = false; clipRight = false;
@@ -112,10 +107,7 @@ bool AdaptiveLoopFilter::isCrossedByVirtualBoundaries( const int xPos, const int
   }
   return numHorVirBndry > 0 || numVerVirBndry > 0 || clipTop || clipBottom || clipLeft || clipRight;
 }
-#endif
 
-#if JVET_N0415_CTB_ALF
-#if JVET_N0242_NON_LINEAR_ALF
 const int AdaptiveLoopFilter::m_fixedFilterSetCoeff[ALF_FIXED_FILTER_NUM][MAX_NUM_ALF_LUMA_COEFF] =
 {
   { 0,   0,   2,  -3,   1,  -4,   1,   7,  -1,   1,  -1,   5, 0 },
@@ -183,75 +175,6 @@ const int AdaptiveLoopFilter::m_fixedFilterSetCoeff[ALF_FIXED_FILTER_NUM][MAX_NU
   { 0,   1,   2,  -8,   2,  -6,   5,  15,   0,   2,  -7,   9,  0 },
   { 1,  -1,  12, -15,  -7,  -2,   3,   6,   6,  -1,   7,  30,  0 },
 };
-#else
-const int AdaptiveLoopFilter::m_fixedFilterSetCoeff[ALF_FIXED_FILTER_NUM][MAX_NUM_ALF_LUMA_COEFF] =
-{
-  { 0,   0,   2,  -3,   1,  -4,   1,   7,  -1,   1,  -1,   5, 112 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   0,   0,   0,  -1,   0,   1,   0,   0,  -1,   2, 126 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   0,   0,   0,   0,   0,   1,   0,   0,   0,   0, 126 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  -1,   1, 128 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   2,  -7,  -3,   0,  -5,  13,  22,  12,  -3,  -3,  17,  34 - (1 << (m_NUM_BITS - 1)) },
-  { -1,   0,   6,  -8,   1,  -5,   1,  23,   0,   2,  -5,  10,  80 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,  -1,  -1,   0,  -1,   2,   1,   0,   0,  -1,   4, 122 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   3, -11,   1,   0,  -1,  35,   5,   2,  -9,   9,  60 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   8,  -8,  -2,  -7,   4,   4,   2,   1,  -1,  25,  76 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   1,  -1,   0,  -3,   1,   3,  -1,   1,  -1,   3, 122 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   3,  -3,   0,  -6,   5,  -1,   2,   1,  -4,  21,  92 - (1 << (m_NUM_BITS - 1)) },
-  { -7,   1,   5,   4,  -3,   5,  11,  13,  12,  -8,  11,  12,  16 - (1 << (m_NUM_BITS - 1)) },
-  { -5,  -3,   6,  -2,  -3,   8,  14,  15,   2,  -7,  11,  16,  24 - (1 << (m_NUM_BITS - 1)) },
-  { 2,  -1,  -6,  -5,  -2,  -2,  20,  14,  -4,   0,  -3,  25,  52 - (1 << (m_NUM_BITS - 1)) },
-  { 3,   1,  -8,  -4,   0,  -8,  22,   5,  -3,   2, -10,  29,  70 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   1,  -7,  -1,   2, -11,  23,  -5,   0,   2, -10,  29,  78 - (1 << (m_NUM_BITS - 1)) },
-  { -6,  -3,   8,   9,  -4,   8,   9,   7,  14,  -2,   8,   9,  14 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   1,  -4,  -7,   0,  -8,  17,  22,   1,  -1,  -4,  23,  44 - (1 << (m_NUM_BITS - 1)) },
-  { 3,   0,  -5,  -7,   0,  -7,  15,  18,  -5,   0,  -5,  27,  60 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   0,   0,  -7,   1, -10,  13,  13,  -4,   2,  -7,  24,  74 - (1 << (m_NUM_BITS - 1)) },
-  { 3,   3, -13,   4,  -2,  -5,   9,  21,  25,  -2,  -3,  12,  24 - (1 << (m_NUM_BITS - 1)) },
-  { -5,  -2,   7,  -3,  -7,   9,   8,   9,  16,  -2,  15,  12,  14 - (1 << (m_NUM_BITS - 1)) },
-  { 0,  -1,   0,  -7,  -5,   4,  11,  11,   8,  -6,  12,  21,  32 - (1 << (m_NUM_BITS - 1)) },
-  { 3,  -2,  -3,  -8,  -4,  -1,  16,  15,  -2,  -3,   3,  26,  48 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   1,  -5,  -4,  -1,  -8,  16,   4,  -2,   1,  -7,  33,  68 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   1,  -4,  -2,   1, -10,  17,  -2,   0,   2, -11,  33,  74 - (1 << (m_NUM_BITS - 1)) },
-  { 1,  -2,   7, -15, -16,  10,   8,   8,  20,  11,  14,  11,  14 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   2,   3, -13, -13,   4,   8,  12,   2,  -3,  16,  24,  40 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   4,   0,  -7,  -8,  -4,   9,   9,  -2,  -2,   8,  29,  54 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   1,   2,  -4,  -1,  -6,   6,   3,  -1,  -1,  -3,  30,  74 - (1 << (m_NUM_BITS - 1)) },
-  { -7,   3,   2,  10,  -2,   3,   7,  11,  19,  -7,   8,  10,  14 - (1 << (m_NUM_BITS - 1)) },
-  { 0,  -2,  -5,  -3,  -2,   4,  20,  15,  -1,  -3,  -1,  22,  40 - (1 << (m_NUM_BITS - 1)) },
-  { 3,  -1,  -8,  -4,  -1,  -4,  22,   8,  -4,   2,  -8,  28,  62 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   3, -14,   3,   0,   1,  19,  17,   8,  -3,  -7,  20,  34 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   2,  -1,  -8,   3,  -6,   5,  21,   1,   1,  -9,  13,  84 - (1 << (m_NUM_BITS - 1)) },
-  { -4,  -2,   8,  20,  -2,   2,   3,   5,  21,   4,   6,   1,   4 - (1 << (m_NUM_BITS - 1)) },
-  { 2,  -2,  -3,  -9,  -4,   2,  14,  16,   3,  -6,   8,  24,  38 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   1,   5, -16,  -7,   2,   3,  11,  15,  -3,  11,  22,  36 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   2,   3, -11,  -2,  -5,   4,   8,   9,  -3,  -2,  26,  68 - (1 << (m_NUM_BITS - 1)) },
-  { 0,  -1,  10,  -9,  -1,  -8,   2,   3,   4,   0,   0,  29,  70 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   2,   0,  -5,   1,  -9,   9,   3,   0,   1,  -7,  20,  96 - (1 << (m_NUM_BITS - 1)) },
-  { -2,   8,  -6,  -4,   3,  -9,  -8,  45,  14,   2, -13,   7,  54 - (1 << (m_NUM_BITS - 1)) },
-  { 1,  -1,  16, -19,  -8,  -4,  -3,   2,  19,   0,   4,  30,  54 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   1,  -3,   0,   2, -11,  15,  -5,   1,   2,  -9,  24,  92 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,  -2,   0,   1,  -4,   4,   0,   0,   1,  -4,   7, 120 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,   2,  -5,   1,  -6,   4,  10,  -2,   1,  -4,  10, 104 - (1 << (m_NUM_BITS - 1)) },
-  { 3,   0,  -3,  -6,  -2,  -6,  14,   8,  -1,  -1,  -3,  31,  60 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,   0,  -2,   1,  -6,   5,   1,   0,   1,  -5,  13, 110 - (1 << (m_NUM_BITS - 1)) },
-  { 3,   1,   9, -19, -21,   9,   7,   6,  13,   5,  15,  21,  30 - (1 << (m_NUM_BITS - 1)) },
-  { 2,   4,   3, -12, -13,   1,   7,   8,   3,   0,  12,  26,  46 - (1 << (m_NUM_BITS - 1)) },
-  { 3,   1,  -8,  -2,   0,  -6,  18,   2,  -2,   3, -10,  23,  84 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   1,  -4,  -1,   1,  -5,   8,   1,  -1,   2,  -5,  10, 112 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,  -1,   0,   0,  -2,   2,   0,   0,   1,  -2,   3, 124 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   1,  -2,  -7,   1,  -7,  14,  18,   0,   0,  -7,  21,  62 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,   0,  -2,   0,  -7,   8,   1,  -2,   0,  -3,  24,  88 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,   1,  -2,   2, -10,  10,   0,  -2,   1,  -7,  23,  94 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   2,   2, -11,   2,  -4,  -3,  39,   7,   1, -10,   9,  60 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   0,  13, -16,  -5,  -6,  -1,   8,   6,   0,   6,  29,  58 - (1 << (m_NUM_BITS - 1)) },
-  { 1,   3,   1,  -6,  -4,  -7,   9,   6,  -3,  -2,   3,  33,  60 - (1 << (m_NUM_BITS - 1)) },
-  { 4,   0, -17,  -1,  -1,   5,  26,   8,  -2,   3, -15,  30,  48 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,  -2,   0,   2,  -8,  12,  -6,   1,   1,  -6,  16, 106 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   0,   0,  -1,   1,  -4,   4,   0,   0,   0,  -3,  11, 112 - (1 << (m_NUM_BITS - 1)) },
-  { 0,   1,   2,  -8,   2,  -6,   5,  15,   0,   2,  -7,   9,  98 - (1 << (m_NUM_BITS - 1)) },
-  { 1,  -1,  12, -15,  -7,  -2,   3,   6,   6,  -1,   7,  30,  50 - (1 << (m_NUM_BITS - 1)) },
-};
-#endif
 const int AdaptiveLoopFilter::m_classToFilterMapping[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES] =
 {
   { 8,   2,   2,   2,   3,   4,  53,   9,   9,  52,   4,   4,   5,   9,   2,   8,  10,   9,   1,   3,  39,  39,  10,   9,  52 },
@@ -271,27 +194,14 @@ const int AdaptiveLoopFilter::m_classToFilterMapping[NUM_FIXED_FILTER_SETS][MAX_
   { 33,  34,  51,  51,  52,  41,  41,  34,  62,   0,  41,  41,  56,   7,   5,  56,  38,  38,  40,  44,  37,  42,  57,  39,  10 },
   { 16,  31,  32,  15,  60,  30,   4,  17,  19,  25,  22,  20,   4,  53,  19,  21,  22,  46,  25,  55,  26,  48,  63,  58,  55 },
 };
-#endif
 
-#if JVET_N0415_CTB_ALF
 void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
-#else
-void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSliceParam )
-#endif
 {
-#if JVET_N0415_CTB_ALF
   if (!cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Y) && !cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Cb) && !cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Cr))
-#else
-  if( !alfSliceParam.enabledFlag[COMPONENT_Y] && !alfSliceParam.enabledFlag[COMPONENT_Cb] && !alfSliceParam.enabledFlag[COMPONENT_Cr] )
-#endif
   {
     return;
   }
 
-#if !JVET_N0415_CTB_ALF
-  // set available filter shapes
-  alfSliceParam.filterShapes = m_filterShapes;
-#endif
 
   // set clipping range
   m_clpRngs = cs.slice->getClpRngs();
@@ -301,16 +211,8 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
   {
     m_ctuEnableFlag[compIdx] = cs.picture->getAlfCtuEnableFlag( compIdx );
   }
-#if JVET_N0415_CTB_ALF
   reconstructCoeffAPSs(cs, true, cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Cb) || cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Cr), false);
   short* alfCtuFilterIndex = cs.slice->getPic()->getAlfCtbFilterIndex();
-#else
-  reconstructCoeff( alfSliceParam, CHANNEL_TYPE_LUMA );
-#if JVET_N0242_NON_LINEAR_ALF
-  if( alfSliceParam.enabledFlag[COMPONENT_Cb] || alfSliceParam.enabledFlag[COMPONENT_Cr] )
-#endif
-  reconstructCoeff( alfSliceParam, CHANNEL_TYPE_CHROMA );
-#endif
 
   PelUnitBuf recYuv = cs.getRecoBuf();
   m_tempBuf.copyFrom( recYuv );
@@ -320,19 +222,16 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
   const PreCalcValues& pcv = *cs.pcv;
 
   int ctuIdx = 0;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool clipTop = false, clipBottom = false, clipLeft = false, clipRight = false;
   int numHorVirBndry = 0, numVerVirBndry = 0;
   int horVirBndryPos[] = { 0, 0, 0 };
   int verVirBndryPos[] = { 0, 0, 0 };
-#endif
   for( int yPos = 0; yPos < pcv.lumaHeight; yPos += pcv.maxCUHeight )
   {
     for( int xPos = 0; xPos < pcv.lumaWidth; xPos += pcv.maxCUWidth )
     {
       const int width = ( xPos + pcv.maxCUWidth > pcv.lumaWidth ) ? ( pcv.lumaWidth - xPos ) : pcv.maxCUWidth;
       const int height = ( yPos + pcv.maxCUHeight > pcv.lumaHeight ) ? ( pcv.lumaHeight - yPos ) : pcv.maxCUHeight;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       bool ctuEnableFlag = m_ctuEnableFlag[COMPONENT_Y][ctuIdx];
       for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
       {
@@ -370,66 +269,23 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
               deriveClassification( m_classifier, buf.get(COMPONENT_Y), blkDst, blkSrc );
               const Area blkPCM( xStart, yStart, w, h );
               resetPCMBlkClassInfo( cs, m_classifier, buf.get(COMPONENT_Y), blkPCM );
-#if JVET_N0415_CTB_ALF
               short filterSetIndex = alfCtuFilterIndex[ctuIdx];
               short *coeff;
-#if JVET_N0242_NON_LINEAR_ALF
               short *clip;
-#endif
               if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
               {
                 coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#if JVET_N0242_NON_LINEAR_ALF
                 clip = m_clippApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#endif
               }
               else
               {
                 coeff = m_fixedFilterSetCoeffDec[filterSetIndex];
-#if JVET_N0242_NON_LINEAR_ALF
                 clip = m_clipDefault;
-#endif
               }
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
               m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
                 , m_alfVBLumaCTUHeight
                 , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
               );
-#else
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-              );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif
-#else
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, m_coeffFinal, m_clippFinal, m_clpRngs.comp[COMPONENT_Y], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-              );
-#else
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-              );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, m_coeffFinal, m_clippFinal, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-              m_filter7x7Blk(m_classifier, recYuv, buf, blkDst, blkSrc, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif
-#endif
             }
 
             for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
@@ -442,47 +298,9 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
               {
                 const Area blkSrc( 0, 0, w >> chromaScaleX, h >> chromaScaleY );
                 const Area blkDst( xStart >> chromaScaleX, yStart >> chromaScaleY, w >> chromaScaleX, h >> chromaScaleY );
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
                 m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
                   , m_alfVBChmaCTUHeight
                   , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos));
-#else
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, alfSliceParam.chromaCoeff, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
-                  , m_alfVBChmaCTUHeight
-                  , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-                );
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs
-                  , m_alfVBChmaCTUHeight
-                  , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-                );
-#else
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs
-                  , m_alfVBChmaCTUHeight
-                  , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-                );
-#endif
-#endif
-#else
-
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#else
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, alfSliceParam.chromaCoeff, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs);
-#else
-                m_filter5x5Blk(m_classifier, recYuv, buf, blkDst, blkSrc, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-#endif
               }
             }
 
@@ -494,122 +312,30 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
       }
       else
       {
-#endif
       const UnitArea area( cs.area.chromaFormat, Area( xPos, yPos, width, height ) );
       if( m_ctuEnableFlag[COMPONENT_Y][ctuIdx] )
       {
         Area blk( xPos, yPos, width, height );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk, blk );
-#else
-        deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk );
-#endif
         Area blkPCM(xPos, yPos, width, height);
         resetPCMBlkClassInfo(cs, m_classifier, tmpYuv.get(COMPONENT_Y), blkPCM);
-#if JVET_N0415_CTB_ALF
         short filterSetIndex = alfCtuFilterIndex[ctuIdx];
         short *coeff;
-#if JVET_N0242_NON_LINEAR_ALF
         short *clip;
-#endif
         if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
         {
           coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#if JVET_N0242_NON_LINEAR_ALF
           clip = m_clippApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#endif
         }
         else
         {
           coeff = m_fixedFilterSetCoeffDec[filterSetIndex];
-#if JVET_N0242_NON_LINEAR_ALF
           clip = m_clipDefault;
-#endif
         }
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
           , m_alfVBLumaCTUHeight
           , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
         );
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif
-#endif
-#else
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, m_coeffFinal, m_clippFinal, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clippFinal, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight+4 : m_alfVBLumaPos)
-        );
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight+4 : m_alfVBLumaPos)
-        );
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, m_coeffFinal, m_clippFinal, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clippFinal, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-        m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif
-#endif
-#endif
       }
 
       for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
@@ -621,108 +347,21 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
         if( m_ctuEnableFlag[compIdx][ctuIdx] )
         {
           Area blk( xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
           m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
             , m_alfVBChmaCTUHeight
             , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos));
-#else
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, alfSliceParam.chromaCoeff, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#else
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#else
-          m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, blk, compID, alfSliceParam.chromaCoeff, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs);
-#else
-          m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, blk, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-#endif
-#else
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs, m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos));
-#else
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, compID, alfSliceParam.chromaCoeff, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#else
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#endif
-#endif
-#else
-
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#else
-          m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, compID, alfSliceParam.chromaCoeff, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs );
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-          m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs);
-#else
-          m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs );
-#endif
-#endif
-#endif
-#endif
         }
       }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       }
-#endif
       ctuIdx++;
     }
   }
 }
 
-#if JVET_N0415_CTB_ALF
 void AdaptiveLoopFilter::reconstructCoeffAPSs(CodingStructure& cs, bool luma, bool chroma, bool isRdo)
 {
   //luma
-#if  JVET_N0805_APS_LMCS
   APS** aps = cs.slice->getAlfAPSs();
-#else
-  APS** aps = cs.slice->getAPSs();
-#endif
   AlfSliceParam alfSliceParamTmp;
   APS* curAPS;
   if (luma)
@@ -735,9 +374,7 @@ void AdaptiveLoopFilter::reconstructCoeffAPSs(CodingStructure& cs, bool luma, bo
       alfSliceParamTmp = curAPS->getAlfAPSParam();
       reconstructCoeff(alfSliceParamTmp, CHANNEL_TYPE_LUMA, isRdo, true);
       memcpy(m_coeffApsLuma[i], m_coeffFinal, sizeof(m_coeffFinal));
-#if JVET_N0242_NON_LINEAR_ALF
       memcpy(m_clippApsLuma[i], m_clippFinal, sizeof(m_clippFinal));
-#endif
     }
   }
 
@@ -750,28 +387,17 @@ void AdaptiveLoopFilter::reconstructCoeffAPSs(CodingStructure& cs, bool luma, bo
     reconstructCoeff(alfSliceParamTmp, CHANNEL_TYPE_CHROMA, isRdo, true);
   }
 }
-#endif
 
-#if JVET_N0415_CTB_ALF
 void AdaptiveLoopFilter::reconstructCoeff( AlfSliceParam& alfSliceParam, ChannelType channel, const bool isRdo, const bool isRedo )
-#else
-void AdaptiveLoopFilter::reconstructCoeff( AlfSliceParam& alfSliceParam, ChannelType channel, const bool isRedo )
-#endif
 {
-#if JVET_N0415_CTB_ALF
   int factor = isRdo ? 0 : (1 << (m_NUM_BITS - 1));
-#else
-  int factor = ( 1 << ( m_NUM_BITS - 1 ) );
-#endif
   AlfFilterType filterType = isLuma( channel ) ? ALF_FILTER_7 : ALF_FILTER_5;
   int numClasses = isLuma( channel ) ? MAX_NUM_ALF_CLASSES : 1;
   int numCoeff = filterType == ALF_FILTER_5 ? 7 : 13;
   int numCoeffMinus1 = numCoeff - 1;
   int numFilters = isLuma( channel ) ? alfSliceParam.numLumaFilters : 1;
   short* coeff = isLuma( channel ) ? alfSliceParam.lumaCoeff : alfSliceParam.chromaCoeff;
-#if JVET_N0242_NON_LINEAR_ALF
   short* clipp = isLuma( channel ) ? alfSliceParam.lumaClipp : alfSliceParam.chromaClipp;
-#endif
 
   if( alfSliceParam.alfLumaCoeffDeltaPredictionFlag && isLuma( channel ) )
   {
@@ -786,45 +412,19 @@ void AdaptiveLoopFilter::reconstructCoeff( AlfSliceParam& alfSliceParam, Channel
 
   for( int filterIdx = 0; filterIdx < numFilters; filterIdx++ )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     coeff[filterIdx* MAX_NUM_ALF_LUMA_COEFF + numCoeffMinus1] = factor;
-#else
-    int sum = 0;
-    for( int i = 0; i < numCoeffMinus1; i++ )
-    {
-      sum += ( coeff[filterIdx* MAX_NUM_ALF_LUMA_COEFF + i] << 1 );
-    }
-    coeff[filterIdx* MAX_NUM_ALF_LUMA_COEFF + numCoeffMinus1] = factor - sum;
-#endif
   }
 
   if( isChroma( channel ) )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     for( int coeffIdx = 0; coeffIdx < numCoeffMinus1; ++coeffIdx )
     {
-#if JVET_N0415_CTB_ALF
       m_chromaCoeffFinal[coeffIdx] = alfSliceParam.chromaCoeff[coeffIdx];
       int clipIdx = alfSliceParam.nonLinearFlag[channel] ? clipp[coeffIdx] : 0;
       m_chromaClippFinal[coeffIdx] = isRdo ? clipIdx : m_alfClippingValues[channel][clipIdx];
-#else
-      m_chromaClippFinal[coeffIdx] = alfSliceParam.nonLinearFlag[channel] ? m_alfClippingValues[channel][clipp[coeffIdx]] : m_alfClippingValues[channel][0];
-#endif
     }
-#elif JVET_N0415_CTB_ALF
-    int sum = 0;
-    for (int coeffIdx = 0; coeffIdx < numCoeffMinus1; ++coeffIdx)
-    {
-      m_chromaCoeffFinal[coeffIdx] = alfSliceParam.chromaCoeff[coeffIdx];
-      sum += (m_chromaCoeffFinal[coeffIdx] << 1);
-    }
-#endif
-#if JVET_N0415_CTB_ALF && JVET_N0242_NON_LINEAR_ALF
     m_chromaCoeffFinal[numCoeffMinus1] = factor;
     m_chromaClippFinal[numCoeffMinus1] = isRdo ? 0 : m_alfClippingValues[channel][0];
-#elif JVET_N0415_CTB_ALF
-    m_chromaCoeffFinal[numCoeffMinus1] = factor - sum;
-#endif
 
     return;
   }
@@ -832,10 +432,6 @@ void AdaptiveLoopFilter::reconstructCoeff( AlfSliceParam& alfSliceParam, Channel
   for( int classIdx = 0; classIdx < numClasses; classIdx++ )
   {
     int filterIdx = alfSliceParam.filterCoeffDeltaIdx[classIdx];
-#if JVET_N0415_CTB_ALF
-#if !JVET_N0242_NON_LINEAR_ALF
-    int sum = 0;
-#endif
     int fixedFilterIdx = alfSliceParam.fixedFilterSetIndex;
     if (fixedFilterIdx > 0 && alfSliceParam.fixedFilterIdx[classIdx] > 0)
     {
@@ -853,32 +449,14 @@ void AdaptiveLoopFilter::reconstructCoeff( AlfSliceParam& alfSliceParam, Channel
       {
         m_coeffFinal[classIdx * MAX_NUM_ALF_LUMA_COEFF + coeffIdx] += m_fixedFilterSetCoeff[fixedFilterIdx][coeffIdx];
       }
-#if !JVET_N0242_NON_LINEAR_ALF
-      sum += (m_coeffFinal[classIdx* MAX_NUM_ALF_LUMA_COEFF + coeffIdx] << 1);
-#endif
     }
-#if JVET_N0242_NON_LINEAR_ALF
     m_coeffFinal[classIdx* MAX_NUM_ALF_LUMA_COEFF + numCoeffMinus1] = factor;
-#else
-    m_coeffFinal[classIdx* MAX_NUM_ALF_LUMA_COEFF + numCoeffMinus1] = factor - sum;
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
     m_clippFinal[classIdx* MAX_NUM_ALF_LUMA_COEFF + numCoeffMinus1] = isRdo ? 0 : m_alfClippingValues[channel][0];
-#endif
-#else
-    memcpy( m_coeffFinal + classIdx * MAX_NUM_ALF_LUMA_COEFF, coeff + filterIdx * MAX_NUM_ALF_LUMA_COEFF, sizeof( short ) * numCoeff );
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
     for( int coeffIdx = 0; coeffIdx < numCoeffMinus1; ++coeffIdx )
     {
-#if JVET_N0415_CTB_ALF
       int clipIdx = alfSliceParam.nonLinearFlag[channel] ? (clipp + filterIdx * MAX_NUM_ALF_LUMA_COEFF)[coeffIdx] : 0;
       (m_clippFinal + classIdx * MAX_NUM_ALF_LUMA_COEFF)[coeffIdx] = isRdo ? clipIdx : m_alfClippingValues[channel][clipIdx];
-#else
-      (m_clippFinal + classIdx * MAX_NUM_ALF_LUMA_COEFF)[coeffIdx] = alfSliceParam.nonLinearFlag[channel] ? m_alfClippingValues[channel][(clipp + filterIdx * MAX_NUM_ALF_LUMA_COEFF)[coeffIdx]] : m_alfClippingValues[channel][0];
-#endif
     }
-#endif
   }
 
   if(isRedo && alfSliceParam.alfLumaCoeffDeltaPredictionFlag )
@@ -908,15 +486,12 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
   m_numCTUsInPic = m_numCTUsInHeight * m_numCTUsInWidth;
   m_filterShapes[CHANNEL_TYPE_LUMA].push_back( AlfFilterShape( 7 ) );
   m_filterShapes[CHANNEL_TYPE_CHROMA].push_back( AlfFilterShape( 5 ) );
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
   m_alfVBLumaPos = m_maxCUHeight - ALF_VB_POS_ABOVE_CTUROW_LUMA;
   m_alfVBChmaPos = (m_maxCUHeight >> ((m_chromaFormat == CHROMA_420) ? 1 : 0)) - ALF_VB_POS_ABOVE_CTUROW_CHMA;
 
   m_alfVBLumaCTUHeight = m_maxCUHeight;
   m_alfVBChmaCTUHeight = (m_maxCUHeight >> ((m_chromaFormat == CHROMA_420) ? 1 : 0));
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   static_assert( AlfNumClippingValues[CHANNEL_TYPE_LUMA] > 0, "AlfNumClippingValues[CHANNEL_TYPE_LUMA] must be at least one" );
   for( int i = 0; i < AlfNumClippingValues[CHANNEL_TYPE_LUMA]; ++i )
   {
@@ -939,21 +514,16 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
             + 8. * ( AlfNumClippingValues[CHANNEL_TYPE_CHROMA] - i - 1 ) / ( AlfNumClippingValues[CHANNEL_TYPE_CHROMA] - 1 )
           ) );
   }
-#endif
 
-#if JVET_N0415_CTB_ALF
   if (m_created)
   {
     return;
   }
-#endif
 
   m_tempBuf.destroy();
   m_tempBuf.create( format, Area( 0, 0, picWidth, picHeight ), maxCUWidth, MAX_ALF_FILTER_LENGTH >> 1, 0, false );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   m_tempBuf2.destroy();
   m_tempBuf2.create( format, Area( 0, 0, maxCUWidth + (MAX_ALF_PADDING_SIZE << 1), maxCUHeight + (MAX_ALF_PADDING_SIZE << 1) ), maxCUWidth, MAX_ALF_PADDING_SIZE, 0, false );
-#endif
 
   // Laplacian based activity
   for( int i = 0; i < NUM_DIRECTIONS; i++ )
@@ -979,47 +549,31 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
     }
   }
 
-#if JVET_N0415_CTB_ALF
   for (int filterSetIndex = 0; filterSetIndex < NUM_FIXED_FILTER_SETS; filterSetIndex++)
   {
     for (int classIdx = 0; classIdx < MAX_NUM_ALF_CLASSES; classIdx++)
     {
       int fixedFilterIdx = m_classToFilterMapping[filterSetIndex][classIdx];
-#if !JVET_N0242_NON_LINEAR_ALF
-      int sum = 0;
-#endif
       for (int i = 0; i < MAX_NUM_ALF_LUMA_COEFF - 1; i++)
       {
-#if !JVET_N0242_NON_LINEAR_ALF
-       sum += (m_fixedFilterSetCoeff[fixedFilterIdx][i]<<1);
-#endif
        m_fixedFilterSetCoeffDec[filterSetIndex][classIdx * MAX_NUM_ALF_LUMA_COEFF + i] = m_fixedFilterSetCoeff[fixedFilterIdx][i];
       }
-#if JVET_N0242_NON_LINEAR_ALF
       m_fixedFilterSetCoeffDec[filterSetIndex][classIdx * MAX_NUM_ALF_LUMA_COEFF + MAX_NUM_ALF_LUMA_COEFF - 1] = (1 << (m_NUM_BITS - 1));
-#else
-      m_fixedFilterSetCoeffDec[filterSetIndex][classIdx * MAX_NUM_ALF_LUMA_COEFF + MAX_NUM_ALF_LUMA_COEFF - 1] = (1 << (m_NUM_BITS - 1)) - sum;
-#endif
     }
   }
-#if JVET_N0242_NON_LINEAR_ALF
   for (int i = 0; i < MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES; i++)
   {
     m_clipDefault[i] = m_alfClippingValues[CHANNEL_TYPE_LUMA][0];
   }
-#endif
   m_created = true;
-#endif
 }
 
 void AdaptiveLoopFilter::destroy()
 {
-#if JVET_N0415_CTB_ALF
   if (!m_created)
   {
     return;
   }
-#endif
   for( int i = 0; i < NUM_DIRECTIONS; i++ )
   {
     if( m_laplacian[i] )
@@ -1048,20 +602,12 @@ void AdaptiveLoopFilter::destroy()
   }
 
   m_tempBuf.destroy();
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   m_tempBuf2.destroy();
-#endif
 
-#if JVET_N0415_CTB_ALF
   m_created = false;
-#endif
 }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 void AdaptiveLoopFilter::deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blkDst, const Area& blk )
-#else
-void AdaptiveLoopFilter::deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk )
-#endif
 {
   int height = blk.pos().y + blk.height;
   int width = blk.pos().x + blk.width;
@@ -1073,25 +619,10 @@ void AdaptiveLoopFilter::deriveClassification( AlfClassifier** classifier, const
     for( int j = blk.pos().x; j < width; j += m_CLASSIFICATION_BLK_SIZE )
     {
       int nWidth = std::min( j + m_CLASSIFICATION_BLK_SIZE, width ) - j;
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       m_deriveClassificationBlk(classifier, m_laplacian, srcLuma, Area( j - blk.pos().x + blkDst.pos().x, i - blk.pos().y + blkDst.pos().y, nWidth, nHeight ), Area(j, i, nWidth, nHeight), m_inputBitDepth[CHANNEL_TYPE_LUMA] + 4
         , m_alfVBLumaCTUHeight
         , ((i - blk.pos().y + blkDst.pos().y + nHeight >= m_picHeight) ? m_picHeight : m_alfVBLumaPos)
       );
-#else
-      m_deriveClassificationBlk(classifier, m_laplacian, srcLuma, Area(j, i, nWidth, nHeight), m_inputBitDepth[CHANNEL_TYPE_LUMA] + 4
-        , m_alfVBLumaCTUHeight
-        , ((i + nHeight >= m_picHeight) ? m_picHeight+4 : m_alfVBLumaPos)
-      );
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-      m_deriveClassificationBlk(classifier, m_laplacian, srcLuma, Area(j - blk.pos().x + blkDst.pos().x, i - blk.pos().y + blkDst.pos().y, nWidth, nHeight), Area(j, i, nWidth, nHeight), m_inputBitDepth[CHANNEL_TYPE_LUMA] + 4);
-#else
-      m_deriveClassificationBlk(classifier, m_laplacian, srcLuma, Area(j, i, nWidth, nHeight), m_inputBitDepth[CHANNEL_TYPE_LUMA] + 4);
-#endif
-#endif
     }
   }
 }
@@ -1145,19 +676,7 @@ void AdaptiveLoopFilter::resetPCMBlkClassInfo(CodingStructure & cs,  AlfClassifi
   }
 }
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift,  int vbCTUHeight, int vbPos)
-#else
-void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift,  int vbCTUHeight, int vbPos)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift)
-#else
-void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift)
-#endif
-#endif
 {
   static const int th[16] = { 0, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4 };
   const int stride = srcLuma.stride;
@@ -1184,24 +703,14 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
     const Pel *src1 = &src[yoffset];
     const Pel *src2 = &src[yoffset + stride];
     const Pel *src3 = &src[yoffset + stride * 2];
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
     if (((blkDst.pos().y - 2 + i) > 0) && ((blkDst.pos().y - 2 + i) % vbCTUHeight) == (vbPos - 2))
-#else
-    if (((posY - 2 + i) > 0) && ((posY - 2 + i) % vbCTUHeight) == (vbPos - 2))
-#endif
     {
       src3 = &src[yoffset + stride];
     }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
     else if (((blkDst.pos().y - 2 + i) > 0) && ((blkDst.pos().y - 2 + i) % vbCTUHeight) == vbPos)
-#else
-    else if (((posY - 2 + i) > 0) && ((posY - 2 + i) % vbCTUHeight) == vbPos)
-#endif
     {
       src0 = &src[yoffset];
     }
-#endif
     int* pYver = laplacian[VER][i];
     int* pYhor = laplacian[HOR][i];
     int* pYdig0 = laplacian[DIAG0][i];
@@ -1265,24 +774,15 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
 
     for( int j = 0; j < blk.width; j += clsSizeX )
     {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
       int sumV = 0; int sumH = 0; int sumD0 = 0; int sumD1 = 0;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       if (((i + blkDst.pos().y) % vbCTUHeight) == (vbPos - 4))
-#else
-      if (((i + posY) % vbCTUHeight) == (vbPos - 4))
-#endif
       {
         sumV = pYver[j] + pYver2[j] + pYver4[j];
         sumH = pYhor[j] + pYhor2[j] + pYhor4[j];
         sumD0 = pYdig0[j] + pYdig02[j] + pYdig04[j];
         sumD1 = pYdig1[j] + pYdig12[j] + pYdig14[j];
       }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       else if (((i + blkDst.pos().y) % vbCTUHeight) == vbPos)
-#else
-      else if (((i + posY) % vbCTUHeight) == vbPos)
-#endif
       {
         sumV = pYver2[j] + pYver4[j] + pYver6[j];
         sumH = pYhor2[j] + pYhor4[j] + pYhor6[j];
@@ -1296,21 +796,10 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
         sumD0 = pYdig0[j] + pYdig02[j] + pYdig04[j] + pYdig06[j];
         sumD1 = pYdig1[j] + pYdig12[j] + pYdig14[j] + pYdig16[j];
       }
-#else
-      int sumV = pYver[j] + pYver2[j] + pYver4[j] + pYver6[j];
-      int sumH = pYhor[j] + pYhor2[j] + pYhor4[j] + pYhor6[j];
-      int sumD0 = pYdig0[j] + pYdig02[j] + pYdig04[j] + pYdig06[j];
-      int sumD1 = pYdig1[j] + pYdig12[j] + pYdig14[j] + pYdig16[j];
-#endif
 
       int tempAct = sumV + sumH;
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
       int activity = 0;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       if ((((i + blkDst.pos().y) % vbCTUHeight) == (vbPos - 4)) || (((i + blkDst.pos().y) % vbCTUHeight) == vbPos))
-#else
-      if ((((i + posY) % vbCTUHeight) == (vbPos - 4)) || (((i + posY) % vbCTUHeight) == vbPos))
-#endif
       {
         activity = (Pel)Clip3<int>(0, maxActivity, (tempAct * 96) >> shift);
       }
@@ -1318,9 +807,6 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
       {
         activity = (Pel)Clip3<int>(0, maxActivity, (tempAct * 64) >> shift);
       }
-#else
-      int activity = (Pel)Clip3<int>(0, maxActivity, (tempAct * 64) >> shift);
-#endif
       int classIdx = th[activity];
 
       int hv1, hv0, d1, d0, hvd1, hvd0;
@@ -1382,13 +868,8 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
       static const int transposeTable[8] = { 0, 1, 0, 2, 2, 3, 1, 3 };
       int transposeIdx = transposeTable[mainDirection * 2 + ( secondaryDirection >> 1 )];
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       int yOffset = i + blkDst.pos().y;
       int xOffset = j + blkDst.pos().x;
-#else
-      int yOffset = i + posY;
-      int xOffset = j + posX;
-#endif
 
       AlfClassifier *cl0 = classifier[yOffset] + xOffset;
       AlfClassifier *cl1 = classifier[yOffset + 1] + xOffset;
@@ -1400,35 +881,7 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
 }
 
 template<AlfFilterType filtType>
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#else
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#else
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs)
-#else
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs)
-#else
-void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs)
-#endif
-#endif
-#endif
 {
   const bool bChroma = isChroma( compId );
   if( bChroma )
@@ -1452,19 +905,13 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
   const int endWidth = blk.x + blk.width;
 
   const Pel* src = srcLuma.buf;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   Pel* dst = dstLuma.buf + blkDst.y * dstStride;
-#else
-  Pel* dst = dstLuma.buf + startHeight * dstStride;
-#endif
 
   const Pel *pImgYPad0, *pImgYPad1, *pImgYPad2, *pImgYPad3, *pImgYPad4, *pImgYPad5, *pImgYPad6;
   const Pel *pImg0, *pImg1, *pImg2, *pImg3, *pImg4, *pImg5, *pImg6;
 
   short *coef = filterSet;
-#if JVET_N0242_NON_LINEAR_ALF
   short *clip = fClipSet;
-#endif
 
   const int shift = m_NUM_BITS - 1;
 
@@ -1486,12 +933,8 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
   int dstStride2 = dstStride * clsSizeY;
   int srcStride2 = srcStride * clsSizeY;
 
-#if JVET_N0242_NON_LINEAR_ALF
   std::array<int, MAX_NUM_ALF_LUMA_COEFF> filterCoeff;
   std::array<int, MAX_NUM_ALF_LUMA_COEFF> filterClipp;
-#else
-  std::vector<Pel> filterCoeff( MAX_NUM_ALF_LUMA_COEFF );
-#endif
 
   pImgYPad0 = src + startHeight * srcStride + startWidth;
   pImgYPad1 = pImgYPad0 + srcStride;
@@ -1501,22 +944,14 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
   pImgYPad5 = pImgYPad3 + srcStride;
   pImgYPad6 = pImgYPad4 - srcStride;
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   Pel* pRec0 = dst + blkDst.x;
-#else
-  Pel* pRec0 = dst + startWidth;
-#endif
   Pel* pRec1 = pRec0 + dstStride;
 
   for( int i = 0; i < endHeight - startHeight; i += clsSizeY )
   {
     if( !bChroma )
     {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       pClass = classifier[blkDst.y + i] + blkDst.x;
-#else
-      pClass = classifier[startHeight + i] + startWidth;
-#endif
     }
 
     for( int j = 0; j < endWidth - startWidth; j += clsSizeX )
@@ -1530,9 +965,7 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
           continue;
         }
         coef = filterSet + cl.classIdx * MAX_NUM_ALF_LUMA_COEFF;
-#if JVET_N0242_NON_LINEAR_ALF
         clip = fClipSet + cl.classIdx * MAX_NUM_ALF_LUMA_COEFF;
-#endif
       }
       else if( isPCMFilterDisabled )
       {
@@ -1545,11 +978,7 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
         {
           for( blkX=0; blkX<4; blkX+=2 )
           {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             Position pos(j + blkDst.x + blkX, i + blkDst.y + blkY);
-#else
-            Position pos(j+startWidth+blkX, i+startHeight+blkY);
-#endif
             CodingUnit* cu = isDualTree ? cs.getCU(pos, CH_C) : cs.getCU(recalcPosition(nChromaFormat, CH_C, CH_L, pos), CH_L);
             *flags++ = cu->ipcm ? 1 : 0;
           }
@@ -1568,30 +997,22 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
         if( transposeIdx == 1 )
         {
           filterCoeff = { coef[9], coef[4], coef[10], coef[8], coef[1], coef[5], coef[11], coef[7], coef[3], coef[0], coef[2], coef[6], coef[12] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[9], clip[4], clip[10], clip[8], clip[1], clip[5], clip[11], clip[7], clip[3], clip[0], clip[2], clip[6], clip[12] };
-#endif
         }
         else if( transposeIdx == 2 )
         {
           filterCoeff = { coef[0], coef[3], coef[2], coef[1], coef[8], coef[7], coef[6], coef[5], coef[4], coef[9], coef[10], coef[11], coef[12] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[0], clip[3], clip[2], clip[1], clip[8], clip[7], clip[6], clip[5], clip[4], clip[9], clip[10], clip[11], clip[12] };
-#endif
         }
         else if( transposeIdx == 3 )
         {
           filterCoeff = { coef[9], coef[8], coef[10], coef[4], coef[3], coef[7], coef[11], coef[5], coef[1], coef[0], coef[2], coef[6], coef[12] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[9], clip[8], clip[10], clip[4], clip[3], clip[7], clip[11], clip[5], clip[1], clip[0], clip[2], clip[6], clip[12] };
-#endif
         }
         else
         {
           filterCoeff = { coef[0], coef[1], coef[2], coef[3], coef[4], coef[5], coef[6], coef[7], coef[8], coef[9], coef[10], coef[11], coef[12] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[0], clip[1], clip[2], clip[3], clip[4], clip[5], clip[6], clip[7], clip[8], clip[9], clip[10], clip[11], clip[12] };
-#endif
         }
       }
       else
@@ -1599,30 +1020,22 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
         if( transposeIdx == 1 )
         {
           filterCoeff = { coef[4], coef[1], coef[5], coef[3], coef[0], coef[2], coef[6] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[4], clip[1], clip[5], clip[3], clip[0], clip[2], clip[6] };
-#endif
         }
         else if( transposeIdx == 2 )
         {
           filterCoeff = { coef[0], coef[3], coef[2], coef[1], coef[4], coef[5], coef[6] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[0], clip[3], clip[2], clip[1], clip[4], clip[5], clip[6] };
-#endif
         }
         else if( transposeIdx == 3 )
         {
           filterCoeff = { coef[4], coef[3], coef[5], coef[1], coef[0], coef[2], coef[6] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[4], clip[3], clip[5], clip[1], clip[0], clip[2], clip[6] };
-#endif
         }
         else
         {
           filterCoeff = { coef[0], coef[1], coef[2], coef[3], coef[4], coef[5], coef[6] };
-#if JVET_N0242_NON_LINEAR_ALF
           filterClipp = { clip[0], clip[1], clip[2], clip[3], clip[4], clip[5], clip[6] };
-#endif
         }
       }
 
@@ -1638,8 +1051,6 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
 
         pRec1 = pRec0 + j + ii * dstStride;
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if ((blkDst.y + i + ii) % vbCTUHeight < vbPos && ((blkDst.y + i + ii) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
         {
           pImg1 = ((blkDst.y + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
@@ -1660,29 +1071,6 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
           pImg3 = ((blkDst.y + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
           pImg5 = ((blkDst.y + i + ii) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
         }
-#else
-        if ((startHeight + i + ii) % vbCTUHeight < vbPos && ((startHeight + i + ii) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((startHeight + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 3) ? pImg3 : pImg5;
-
-          pImg2 = ((startHeight + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-          pImg6 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 3) ? pImg4 : pImg6;
-        }
-        else if ((startHeight + i + ii) % vbCTUHeight >= vbPos && ((startHeight + i + ii) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((startHeight + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-          pImg6 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 2) ? pImg4 : pImg6;
-
-          pImg1 = ((startHeight + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
-        }
-#endif
-#endif
 
         for( int jj = 0; jj < clsSizeX; jj++ )
         {
@@ -1704,121 +1092,39 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier** classifier, const PelUnitBuf
           }
 
           int sum = 0;
-#if JVET_N0242_NON_LINEAR_ALF
           const Pel curr = pImg0[+0];
-#endif
           if( filtType == ALF_FILTER_7 )
           {
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[0] * ( pImg5[0] + pImg6[0] );
-#else
             sum += filterCoeff[0] * ( clipALF(filterClipp[0], curr, pImg5[+0], pImg6[+0]) );
-#endif
 
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[1] * ( pImg3[+1] + pImg4[-1] );
-#else
             sum += filterCoeff[1] * ( clipALF(filterClipp[1], curr, pImg3[+1], pImg4[-1]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[2] * ( pImg3[+0] + pImg4[+0] );
-#else
             sum += filterCoeff[2] * ( clipALF(filterClipp[2], curr, pImg3[+0], pImg4[+0]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[3] * ( pImg3[-1] + pImg4[+1] );
-#else
             sum += filterCoeff[3] * ( clipALF(filterClipp[3], curr, pImg3[-1], pImg4[+1]) );
-#endif
 
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[4] * ( pImg1[+2] + pImg2[-2] );
-#else
             sum += filterCoeff[4] * ( clipALF(filterClipp[4], curr, pImg1[+2], pImg2[-2]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[5] * ( pImg1[+1] + pImg2[-1] );
-#else
             sum += filterCoeff[5] * ( clipALF(filterClipp[5], curr, pImg1[+1], pImg2[-1]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[6] * ( pImg1[+0] + pImg2[+0] );
-#else
             sum += filterCoeff[6] * ( clipALF(filterClipp[6], curr, pImg1[+0], pImg2[+0]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[7] * ( pImg1[-1] + pImg2[+1] );
-#else
             sum += filterCoeff[7] * ( clipALF(filterClipp[7], curr, pImg1[-1], pImg2[+1]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[8] * ( pImg1[-2] + pImg2[+2] );
-#else
             sum += filterCoeff[8] * ( clipALF(filterClipp[8], curr, pImg1[-2], pImg2[+2]) );
-#endif
 
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[9] * ( pImg0[+3] + pImg0[-3] );
-#else
             sum += filterCoeff[9] * ( clipALF(filterClipp[9], curr, pImg0[+3], pImg0[-3]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[10] * ( pImg0[+2] + pImg0[-2] );
-#else
             sum += filterCoeff[10] * ( clipALF(filterClipp[10], curr, pImg0[+2], pImg0[-2]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[11] * ( pImg0[+1] + pImg0[-1] );
-#else
             sum += filterCoeff[11] * ( clipALF(filterClipp[11], curr, pImg0[+1], pImg0[-1]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[12] * ( pImg0[+0] );
-#endif
           }
           else
           {
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[0] * ( pImg3[+0] + pImg4[+0] );
-#else
             sum += filterCoeff[0] * ( clipALF(filterClipp[0], curr, pImg3[+0], pImg4[+0]) );
-#endif
 
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[1] * ( pImg1[+1] + pImg2[-1] );
-#else
             sum += filterCoeff[1] * ( clipALF(filterClipp[1], curr, pImg1[+1], pImg2[-1]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[2] * ( pImg1[+0] + pImg2[+0] );
-#else
             sum += filterCoeff[2] * ( clipALF(filterClipp[2], curr, pImg1[+0], pImg2[+0]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[3] * ( pImg1[-1] + pImg2[+1] );
-#else
             sum += filterCoeff[3] * ( clipALF(filterClipp[3], curr, pImg1[-1], pImg2[+1]) );
-#endif
 
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[4] * ( pImg0[+2] + pImg0[-2] );
-#else
             sum += filterCoeff[4] * ( clipALF(filterClipp[4], curr, pImg0[+2], pImg0[-2]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[5] * ( pImg0[+1] + pImg0[-1] );
-#else
             sum += filterCoeff[5] * ( clipALF(filterClipp[5], curr, pImg0[+1], pImg0[-1]) );
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF
-            sum += filterCoeff[6] * ( pImg0[+0] );
-#endif
           }
 
           sum = ( sum + offset ) >> shift;
-#if JVET_N0242_NON_LINEAR_ALF
           sum += curr;
-#endif
           pRec1[jj] = ClipPel( sum, clpRng );
 
           pImg0++;
diff --git a/source/Lib/CommonLib/AdaptiveLoopFilter.h b/source/Lib/CommonLib/AdaptiveLoopFilter.h
index a391309cf..3ccb7ce9a 100644
--- a/source/Lib/CommonLib/AdaptiveLoopFilter.h
+++ b/source/Lib/CommonLib/AdaptiveLoopFilter.h
@@ -67,7 +67,6 @@ enum Direction
 class AdaptiveLoopFilter
 {
 public:
-#if JVET_N0242_NON_LINEAR_ALF
   static inline int clipALF(const int clip, const short ref, const short val0, const short val1)
   {
     return Clip3<int>(-clip, +clip, val0-ref) + Clip3<int>(-clip, +clip, val1-ref);
@@ -76,7 +75,6 @@ public:
   static constexpr int AlfNumClippingValues[MAX_NUM_CHANNEL_TYPE] = { 4, 4 };
   static constexpr int MaxAlfNumClippingValues = 4;
 
-#endif
   static constexpr int   m_NUM_BITS = 8;
   static constexpr int   m_CLASSIFICATION_BLK_SIZE = 32;  //non-normative, local buffer size
   static constexpr int m_ALF_UNUSED_CLASSIDX = 255;
@@ -84,118 +82,25 @@ public:
 
   AdaptiveLoopFilter();
   virtual ~AdaptiveLoopFilter() {}
-#if JVET_N0415_CTB_ALF
   void reconstructCoeffAPSs(CodingStructure& cs, bool luma, bool chroma, bool isRdo);
   void reconstructCoeff(AlfSliceParam& alfSliceParam, ChannelType channel, const bool isRdo, const bool isRedo = false);
   void ALFProcess(CodingStructure& cs);
-#else
-  void reconstructCoeff(AlfSliceParam& alfSliceParam, ChannelType channel, const bool isRedo = false);
-  void ALFProcess( CodingStructure& cs, AlfSliceParam& alfSliceParam );
-#endif
   void create( const int picWidth, const int picHeight, const ChromaFormat format, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE] );
   void destroy();
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
   static void deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift, int vbCTUHeight, int vbPos);
-#else
-  static void deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift);
-#endif
   void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blkDst, const Area& blk );
-#else
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-  static void deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift, int vbCTUHeight, int vbPos);
-#else
-  static void deriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift);
-#endif
-  void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk );
-#endif
   void resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk);
   template<AlfFilterType filtType>
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#else
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#else
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs);
-#else
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs);
-#else
-  static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs);
-#endif
-#endif
-#endif
   inline static int getMaxGolombIdx( AlfFilterType filterType )
   {
     return filterType == ALF_FILTER_5 ? 2 : 3;
   }
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void(*m_deriveClassificationBlk)(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift, int vbCTUHeight, int vbPos);
-#else
-  void(*m_deriveClassificationBlk)(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift, int vbCTUHeight, int vbPos);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void(*m_deriveClassificationBlk)(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift);
-#else
-  void(*m_deriveClassificationBlk)(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift);
-#endif
-#endif
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
   void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#else
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#else
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs);
-#else
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs);
-#else
-  void(*m_filter5x5Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs);
-  void(*m_filter7x7Blk)(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs);
-#endif
-#endif
-#endif
 
 #ifdef TARGET_SIMD_X86
   void initAdaptiveLoopFilterX86();
@@ -204,37 +109,25 @@ public:
 #endif
 
 protected:
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool isCrossedByVirtualBoundaries( const int xPos, const int yPos, const int width, const int height, bool& clipTop, bool& clipBottom, bool& clipLeft, bool& clipRight, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps );
-#endif
-#if JVET_N0415_CTB_ALF
   static const int             m_classToFilterMapping[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES];
   static const int             m_fixedFilterSetCoeff[ALF_FIXED_FILTER_NUM][MAX_NUM_ALF_LUMA_COEFF];
   short                        m_fixedFilterSetCoeffDec[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
   short                        m_coeffApsLuma[6][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
-#if JVET_N0242_NON_LINEAR_ALF
   short                        m_clippApsLuma[6][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
   short                        m_clipDefault[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
-#endif
   bool                         m_created = false;
   short                        m_chromaCoeffFinal[MAX_NUM_ALF_LUMA_COEFF];
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
   Pel                          m_alfClippingValues[MAX_NUM_CHANNEL_TYPE][MaxAlfNumClippingValues];
-#endif
   std::vector<AlfFilterShape>  m_filterShapes[MAX_NUM_CHANNEL_TYPE];
   AlfClassifier**              m_classifier;
   short                        m_coeffFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
-#if JVET_N0242_NON_LINEAR_ALF
   short                        m_clippFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
   short                        m_chromaClippFinal[MAX_NUM_ALF_LUMA_COEFF];
-#endif
   int**                        m_laplacian[NUM_DIRECTIONS];
   uint8_t*                     m_ctuEnableFlag[MAX_NUM_COMPONENT];
   PelStorage                   m_tempBuf;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   PelStorage                   m_tempBuf2;
-#endif
   int                          m_inputBitDepth[MAX_NUM_CHANNEL_TYPE];
   int                          m_picWidth;
   int                          m_picHeight;
@@ -244,12 +137,10 @@ protected:
   int                          m_numCTUsInWidth;
   int                          m_numCTUsInHeight;
   int                          m_numCTUsInPic;
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
   int                          m_alfVBLumaPos;
   int                          m_alfVBChmaPos;
   int                          m_alfVBLumaCTUHeight;
   int                          m_alfVBChmaCTUHeight;
-#endif
   ChromaFormat                 m_chromaFormat;
   ClpRngs                      m_clpRngs;
 };
diff --git a/source/Lib/CommonLib/Buffer.cpp b/source/Lib/CommonLib/Buffer.cpp
index 95eafa85d..663d34dd0 100644
--- a/source/Lib/CommonLib/Buffer.cpp
+++ b/source/Lib/CommonLib/Buffer.cpp
@@ -91,11 +91,7 @@ void gradFilterCore(Pel* pSrc, int srcStride, int width, int height, int gradStr
   Pel* srcTmp = pSrc + srcStride + 1;
   Pel* gradXTmp = gradX + gradStride + 1;
   Pel* gradYTmp = gradY + gradStride + 1;
-#if JVET_N0325_BDOF
   int  shift1 = std::max<int>(6, (bitDepth - 6));
-#else
-  int  shift1 = std::max<int>(2, (IF_INTERNAL_PREC - bitDepth));
-#endif
 
   for (int y = 0; y < (height - 2 * BIO_EXTEND_SIZE); y++)
   {
@@ -132,13 +128,8 @@ void gradFilterCore(Pel* pSrc, int srcStride, int width, int height, int gradStr
 
 void calcBIOParCore(const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, const int bitDepth)
 {
-#if JVET_N0325_BDOF
   int shift4 = std::max<int>(4, (bitDepth - 8));
   int shift5 = std::max<int>(1, (bitDepth - 11));
-#else
-  int shift4 = std::min<int>(8, (bitDepth - 4));
-  int shift5 = std::min<int>(5, (bitDepth - 7));
-#endif
   for (int y = 0; y < heightG; y++)
   {
     for (int x = 0; x < widthG; x++)
@@ -408,9 +399,7 @@ void AreaBuf<Pel>::scaleSignal(const int scale, const bool dir, const ClpRng& cl
     {
       for (unsigned x = 0; x < width; x++)
       {
-#if JVET_N0220_LMCS_SIMPLIFICATION
         src[x] = (Pel)Clip3((Pel)(-maxAbsclipBD - 1), (Pel)maxAbsclipBD, src[x]);
-#endif
         sign = src[x] >= 0 ? 1 : -1;
         absval = sign * src[x];
         int val = sign * ((absval * scale + (1 << (CSCALE_FP_PREC - 1))) >> CSCALE_FP_PREC);
diff --git a/source/Lib/CommonLib/Buffer.h b/source/Lib/CommonLib/Buffer.h
index 10a9788b4..d7a10b1fd 100644
--- a/source/Lib/CommonLib/Buffer.h
+++ b/source/Lib/CommonLib/Buffer.h
@@ -111,10 +111,8 @@ struct AreaBuf : public Size
   void copyClip             ( const AreaBuf<const T> &src, const ClpRng& clpRng);
 
   void subtract             ( const AreaBuf<const T> &other );
-#if JVET_N0054_JOINT_CHROMA
   void copyAndNegate        ( const AreaBuf<const T> &other );
   void subtractAndHalve     ( const AreaBuf<const T> &other );
-#endif
   void extendSingleBorderPel();
   void extendBorderPel      (  unsigned margin );
   void addWeightedAvg       ( const AreaBuf<const T> &other1, const AreaBuf<const T> &other2, const ClpRng& clpRng, const int8_t gbiIdx);
@@ -359,7 +357,6 @@ void AreaBuf<T>::subtract( const AreaBuf<const T> &other )
 #undef SUBS_INC
 }
 
-#if JVET_N0054_JOINT_CHROMA
 template<typename T>
 void AreaBuf<T>::copyAndNegate( const AreaBuf<const T> &other )
 {
@@ -401,7 +398,6 @@ void AreaBuf<T>::subtractAndHalve( const AreaBuf<const T> &other )
 #undef SUBS_OP
 #undef SUBS_INC
 }
-#endif
 
 template<typename T>
 void AreaBuf<T>::copyClip( const AreaBuf<const T> &src, const ClpRng& clpRng )
diff --git a/source/Lib/CommonLib/ChromaFormat.h b/source/Lib/CommonLib/ChromaFormat.h
index ca13e2ea5..a6b827f93 100644
--- a/source/Lib/CommonLib/ChromaFormat.h
+++ b/source/Lib/CommonLib/ChromaFormat.h
@@ -122,7 +122,6 @@ static inline int getScaledChromaQP(int unscaledChromaQP, const ChromaFormat chF
 }
 
 
-#if HEVC_USE_SCALING_LISTS
 //======================================================================================================================
 //Scaling lists  =======================================================================================================
 //======================================================================================================================
@@ -131,6 +130,5 @@ static inline int getScalingListType(const PredMode predMode, const ComponentID
 {
   return ((predMode != MODE_INTER) ? 0 : MAX_NUM_COMPONENT) + MAP_CHROMA(compID);
 }
-#endif
 
 #endif
diff --git a/source/Lib/CommonLib/CodingStatistics.h b/source/Lib/CommonLib/CodingStatistics.h
index 26d7617f9..10499642f 100644
--- a/source/Lib/CommonLib/CodingStatistics.h
+++ b/source/Lib/CommonLib/CodingStatistics.h
@@ -76,9 +76,7 @@ enum CodingStatisticsType
   STATS__CABAC_BITS__CHROMA_QP_ADJUSTMENT,
   STATS__CABAC_BITS__QT_CBF,
   STATS__CABAC_BITS__CROSS_COMPONENT_PREDICTION,
-#if JVET_N0054_JOINT_CHROMA
   STATS__CABAC_BITS__JOINT_CB_CR,
-#endif
   STATS__CABAC_BITS__MTS_FLAGS,
   STATS__CABAC_BITS__LAST_SIG_X_Y,
   STATS__CABAC_BITS__SIG_COEFF_GROUP_FLAG,
@@ -91,9 +89,7 @@ enum CodingStatisticsType
   STATS__CABAC_BITS__SAO,
   STATS__CABAC_BITS__ALF,
   STATS__CABAC_TRM_BITS,
-#if JVET_N0193_LFNST
   STATS__CABAC_BITS__LFNST,
-#endif
   STATS__CABAC_FIXED_BITS,
   STATS__CABAC_PCM_ALIGN_BITS,
   STATS__CABAC_PCM_CODE_BITS,
@@ -113,15 +109,11 @@ enum CodingStatisticsType
   STATS__CABAC_BITS__TRIANGLE_INDEX,
   STATS__CABAC_BITS__MULTI_REF_LINE,
   STATS__CABAC_BITS__SYMMVD_FLAG,
-#if JVET_N0413_RDPCM
   STATS__CABAC_BITS__BDPCM_MODE,
-#endif
   STATS__TOOL_TOTAL_FRAME,// This is a special case and is not included in the report.
   STATS__TOOL_AFF,
   STATS__TOOL_EMT,
-#if JVET_N0193_LFNST
   STATS__TOOL_LFNST,
-#endif
   STATS__TOOL_TOTAL,
   STATS__NUM_STATS
 };
@@ -169,9 +161,7 @@ static inline const char* getName(CodingStatisticsType name)
     "CABAC_BITS__CHROMA_QP_ADJUSTMENT",
     "CABAC_BITS__QT_CBF",
     "CABAC_BITS__CROSS_COMPONENT_PREDICTION",
-#if JVET_N0054_JOINT_CHROMA
     "CABAC_BITS__JOINT_CB_CR",
-#endif
     "CABAC_BITS__MTS_FLAGS",
     "CABAC_BITS__LAST_SIG_X_Y",
     "CABAC_BITS__SIG_COEFF_GROUP_FLAG",
@@ -182,9 +172,7 @@ static inline const char* getName(CodingStatisticsType name)
     "CABAC_BITS__SIGN_BIT",
     "CABAC_BITS__ESCAPE_BITS",
     "CABAC_BITS__SAO",
-#if JVET_N0193_LFNST
     "CABAC_BITS__LFNST",
-#endif
     "CABAC_BITS__ALF",
     "CABAC_TRM_BITS",
     "CABAC_FIXED_BITS",
@@ -206,15 +194,11 @@ static inline const char* getName(CodingStatisticsType name)
     "CABAC_BITS__TRIANGLE_INDEX",
     "CABAC_BITS__MULTI_REF_LINE",
     "CABAC_BITS__SYMMVD_FLAG",
-#if JVET_N0413_RDPCM
     "CABAC_BITS__BDPCM_MODE",
-#endif
     "TOOL_FRAME",
     "TOOL_AFFINE",
     "TOOL_EMT",
-#if JVET_N0193_LFNST
     "TOOL_LFNST",
-#endif
     "TOOL_TOTAL"
   };
   CHECK( STATS__NUM_STATS != sizeof( statNames ) / sizeof( char* ) || name >= STATS__NUM_STATS, "stats out of range" );
diff --git a/source/Lib/CommonLib/CodingStructure.cpp b/source/Lib/CommonLib/CodingStructure.cpp
index 96b21c75d..a807329c7 100644
--- a/source/Lib/CommonLib/CodingStructure.cpp
+++ b/source/Lib/CommonLib/CodingStructure.cpp
@@ -286,11 +286,7 @@ TransformUnit* CodingStructure::getTU( const Position &pos, const ChannelType ef
           }
           else
           {
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
             while( !tus[idx - 1 + extraIdx]->blocks[getFirstComponentOfChannel( effChType )].contains( pos ) )
-#else
-            while( pos != tus[idx - 1 + extraIdx]->blocks[getFirstComponentOfChannel( effChType )].pos() )
-#endif
             {
               extraIdx++;
             }
@@ -774,23 +770,13 @@ void CodingStructure::initSubStructure( CodingStructure& subStruct, const Channe
   subStruct.sps       = sps;
 #if HEVC_VPS
   subStruct.vps       = vps;
-#elif JVET_N0278_HLS
+#else
   subStruct.vps       = vps; 
 #endif
   subStruct.pps       = pps;
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   memcpy(subStruct.alfApss, alfApss, sizeof(alfApss));
-#else
-  memcpy(subStruct.apss, apss, sizeof(apss));
-#endif
-#else
-  subStruct.aps       = aps;
-#endif
 
-#if JVET_N0805_APS_LMCS
   subStruct.lmcsAps = lmcsAps;
-#endif
 
   subStruct.slice     = slice;
   subStruct.baseQP    = baseQP;
@@ -1359,16 +1345,12 @@ const CodingUnit* CodingStructure::getCURestricted( const Position &pos, const C
   const CodingUnit* cu = getCU( pos, _chType );
   // exists       same slice and tile                  cu precedes curCu in encoding order
   //                                                  (thus, is either from parent CS in RD-search or its index is lower)
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const bool wavefrontsEnabled = curCu.slice->getPPS()->getEntropyCodingSyncEnabledFlag();
   int ctuSizeBit = g_aucLog2[curCu.cs->sps->getMaxCUWidth()];
   int xNbY  = pos.x << getChannelTypeScaleX( _chType, curCu.chromaFormat );
   int xCurr = curCu.blocks[_chType].x << getChannelTypeScaleX( _chType, curCu.chromaFormat );
   bool addCheck = (wavefrontsEnabled && (xNbY >> ctuSizeBit) >= (xCurr >> ctuSizeBit) + 1 ) ? false : true;
   if( cu && CU::isSameSliceAndTile( *cu, curCu ) && ( cu->cs != curCu.cs || cu->idx <= curCu.idx ) && addCheck)
-#else
-  if( cu && CU::isSameSliceAndTile( *cu, curCu ) && ( cu->cs != curCu.cs || cu->idx <= curCu.idx ) )
-#endif
   {
     return cu;
   }
@@ -1378,23 +1360,15 @@ const CodingUnit* CodingStructure::getCURestricted( const Position &pos, const C
   }
 }
 
-#if JVET_N0150_ONE_CTU_DELAY_WPP
 const CodingUnit* CodingStructure::getCURestricted( const Position &pos, const Position curPos, const unsigned curSliceIdx, const unsigned curTileIdx, const ChannelType _chType ) const
-#else
-const CodingUnit* CodingStructure::getCURestricted( const Position &pos, const unsigned curSliceIdx, const unsigned curTileIdx, const ChannelType _chType ) const
-#endif
 {
   const CodingUnit* cu = getCU( pos, _chType );
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const bool wavefrontsEnabled = this->slice->getPPS()->getEntropyCodingSyncEnabledFlag();
   int ctuSizeBit = g_aucLog2[this->sps->getMaxCUWidth()];
   int xNbY  = pos.x << getChannelTypeScaleX( _chType, this->area.chromaFormat );
   int xCurr = curPos.x << getChannelTypeScaleX( _chType, this->area.chromaFormat );
   bool addCheck = (wavefrontsEnabled && (xNbY >> ctuSizeBit) >= (xCurr >> ctuSizeBit) + 1 ) ? false : true;
   return ( cu && cu->slice->getIndependentSliceIdx() == curSliceIdx && cu->tileIdx == curTileIdx && addCheck ) ? cu : nullptr;
-#else
-  return ( cu && cu->slice->getIndependentSliceIdx() == curSliceIdx && cu->tileIdx == curTileIdx ) ? cu : nullptr;
-#endif
 }
 
 const PredictionUnit* CodingStructure::getPURestricted( const Position &pos, const PredictionUnit& curPu, const ChannelType _chType ) const
@@ -1402,16 +1376,12 @@ const PredictionUnit* CodingStructure::getPURestricted( const Position &pos, con
   const PredictionUnit* pu = getPU( pos, _chType );
   // exists       same slice and tile                  pu precedes curPu in encoding order
   //                                                  (thus, is either from parent CS in RD-search or its index is lower)
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const bool wavefrontsEnabled = curPu.cu->slice->getPPS()->getEntropyCodingSyncEnabledFlag();
   int ctuSizeBit = g_aucLog2[curPu.cs->sps->getMaxCUWidth()];
   int xNbY  = pos.x << getChannelTypeScaleX( _chType, curPu.chromaFormat );
   int xCurr = curPu.blocks[_chType].x << getChannelTypeScaleX( _chType, curPu.chromaFormat );
   bool addCheck = (wavefrontsEnabled && (xNbY >> ctuSizeBit) >= (xCurr >> ctuSizeBit) + 1 ) ? false : true;
   if( pu && CU::isSameSliceAndTile( *pu->cu, *curPu.cu ) && ( pu->cs != curPu.cs || pu->idx <= curPu.idx ) && addCheck )
-#else
-  if( pu && CU::isSameSliceAndTile( *pu->cu, *curPu.cu ) && ( pu->cs != curPu.cs || pu->idx <= curPu.idx ) )
-#endif
   {
     return pu;
   }
@@ -1426,16 +1396,12 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons
   const TransformUnit* tu = getTU( pos, _chType );
   // exists       same slice and tile                  tu precedes curTu in encoding order
   //                                                  (thus, is either from parent CS in RD-search or its index is lower)
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const bool wavefrontsEnabled = curTu.cu->slice->getPPS()->getEntropyCodingSyncEnabledFlag();
   int ctuSizeBit = g_aucLog2[curTu.cs->sps->getMaxCUWidth()];
   int xNbY  = pos.x << getChannelTypeScaleX( _chType, curTu.chromaFormat );
   int xCurr = curTu.blocks[_chType].x << getChannelTypeScaleX( _chType, curTu.chromaFormat );
   bool addCheck = (wavefrontsEnabled && (xNbY >> ctuSizeBit) >= (xCurr >> ctuSizeBit) + 1 ) ? false : true;
   if( tu && CU::isSameSliceAndTile( *tu->cu, *curTu.cu ) && ( tu->cs != curTu.cs || tu->idx <= curTu.idx ) && addCheck )
-#else
-  if( tu && CU::isSameSliceAndTile( *tu->cu, *curTu.cu ) && ( tu->cs != curTu.cs || tu->idx <= curTu.idx ) )
-#endif
   {
     return tu;
   }
diff --git a/source/Lib/CommonLib/CodingStructure.h b/source/Lib/CommonLib/CodingStructure.h
index dc77086d7..81356aed5 100644
--- a/source/Lib/CommonLib/CodingStructure.h
+++ b/source/Lib/CommonLib/CodingStructure.h
@@ -95,21 +95,11 @@ public:
   bool        isLossless;
   const SPS *sps;
   const PPS *pps;
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   APS*       alfApss[MAX_NUM_APS];
-#else
-  APS*       apss[MAX_NUM_APS];
-#endif
-#else
-  APS *      aps;
-#endif
-#if JVET_N0805_APS_LMCS
   APS *      lmcsAps;
-#endif
 #if HEVC_VPS
   const VPS *vps;
-#elif JVET_N0278_HLS
+#else
   const VPS *vps;
 #endif
   const PreCalcValues* pcv;
@@ -151,11 +141,7 @@ public:
   PredictionUnit *getPU(const ChannelType &_chType ) { return getPU(area.blocks[_chType].pos(), _chType); }
   TransformUnit  *getTU(const ChannelType &_chType ) { return getTU(area.blocks[_chType].pos(), _chType); }
 
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const CodingUnit     *getCURestricted(const Position &pos, const Position curPos, const unsigned curSliceIdx, const unsigned curTileIdx, const ChannelType _chType) const;
-#else
-  const CodingUnit     *getCURestricted(const Position &pos, const unsigned curSliceIdx, const unsigned curTileIdx, const ChannelType _chType) const;
-#endif
   const CodingUnit     *getCURestricted(const Position &pos, const CodingUnit& curCu,                               const ChannelType _chType) const;
   const PredictionUnit *getPURestricted(const Position &pos, const PredictionUnit& curPu,                           const ChannelType _chType) const;
   const TransformUnit  *getTURestricted(const Position &pos, const TransformUnit& curTu,                            const ChannelType _chType) const;
@@ -275,9 +261,7 @@ public:
   const CPelBuf       getRecoBuf(const CompArea &blk) const;
          PelUnitBuf   getRecoBuf(const UnitArea &unit);
   const CPelUnitBuf   getRecoBuf(const UnitArea &unit) const;
-#if JVET_N0415_CTB_ALF
          PelUnitBuf&  getRecoBufRef() { return m_reco; }
-#endif
 
          PelBuf       getOrgResiBuf(const CompArea &blk);
   const CPelBuf       getOrgResiBuf(const CompArea &blk) const;
diff --git a/source/Lib/CommonLib/Common.h b/source/Lib/CommonLib/Common.h
index 2d40a5364..a67e696ba 100644
--- a/source/Lib/CommonLib/Common.h
+++ b/source/Lib/CommonLib/Common.h
@@ -259,7 +259,6 @@ public:
   }
 };
 
-#if JVET_N0217_MATRIX_INTRAPRED
 struct AvailableInfo
 {
   int  maxPosTop;
@@ -268,7 +267,6 @@ struct AvailableInfo
   AvailableInfo() : maxPosTop(0), maxPosLeft(0) {}
   AvailableInfo(const int top, const int left) : maxPosTop(top), maxPosLeft(left) {}
 };
-#endif
 
 
 #endif
diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h
index d836f63f8..3f2a69f7b 100644
--- a/source/Lib/CommonLib/CommonDef.h
+++ b/source/Lib/CommonLib/CommonDef.h
@@ -143,10 +143,8 @@ static const int MAX_NUM_REF =                                     16; ///< max.
 static const int MAX_QP =                                          63;
 static const int NOT_VALID =                                       -1;
 
-#if JVET_N0857_TILES_BRICKS
 static const int MAX_TILES =                                      128; ///< max. number of tiles for which a brick configuration can be read
 static const int MAX_NUM_BRICKS_PER_TILE =                          8; ///< max. number brick per tile, for which a configuration can be read
-#endif
 
 static const int AMVP_MAX_NUM_CANDS =                               2; ///< AMVP: advanced motion vector prediction - max number of final candidates
 static const int AMVP_MAX_NUM_CANDS_MEM =                           3; ///< AMVP: advanced motion vector prediction - max number of candidates
@@ -173,7 +171,7 @@ static const int MAX_NESTING_NUM_LAYER =                           64;
 static const int MAX_VPS_NUM_HRD_PARAMETERS =                       1;
 static const int MAX_VPS_OP_SETS_PLUS1 =                         1024;
 static const int MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 =         1;
-#elif JVET_N0278_HLS
+#else
 static const int MAX_VPS_NUM_HRD_PARAMETERS =                       1;
 static const int MAX_VPS_LAYERS =                                 256;
 #endif
@@ -181,21 +179,15 @@ static const int MAX_VPS_LAYERS =                                 256;
 static const int MAXIMUM_INTRA_FILTERED_WIDTH =                    16;
 static const int MAXIMUM_INTRA_FILTERED_HEIGHT =                   16;
 
-#if JVET_N0217_MATRIX_INTRAPRED
 static const int MIP_MAX_WIDTH =                                   64;
 static const int MIP_MAX_HEIGHT =                                  64;
-#endif
 
-#if JVET_N0415_CTB_ALF
 static const int ALF_FIXED_FILTER_NUM        =                     64;
 static const int ALF_CTB_MAX_NUM_APS         =                      6;
 static const int NUM_FIXED_FILTER_SETS       =                     16;
 static const int NUM_TOTAL_FILTER_SETS       =                     NUM_FIXED_FILTER_SETS + ALF_CTB_MAX_NUM_APS;
-#endif
 
-#if JVET_N0178_IMPLICIT_BDOF_SPLIT
 static const int MAX_BDOF_APPLICATION_REGION =                     16;
-#endif
 
 static const int MAX_CPB_CNT =                                     32; ///< Upper bound of (cpb_cnt_minus1 + 1)
 static const int MAX_NUM_LAYER_IDS =                               64;
@@ -213,19 +205,13 @@ static const int MAX_NUM_DPS =                                     16;
 static const int MAX_NUM_SPS =                                     16;
 static const int MAX_NUM_PPS =                                     64;
 static const int MAX_NUM_APS =                                     32;  //Currently APS ID has 5 bits
-#if JVET_N0805_APS_LMCS
 static const int NUM_APS_TYPE_LEN =                                 3;  //Currently APS Type has 3 bits
 static const int MAX_NUM_APS_TYPE =                                 8;  //Currently APS Type has 3 bits so the max type is 8
-#endif
 
 static const int MLS_GRP_NUM =                                   1024; ///< Max number of coefficient groups, max(16, 256)
 
 static const int MLS_CG_SIZE =                                      4; ///< Coefficient group size of 4x4; = MLS_CG_LOG2_WIDTH + MLS_CG_LOG2_HEIGHT
 
-#if !JVET_N0246_MODIFIED_QUANTSCALES
-static const int ADJ_QUANT_SHIFT =                                  7;
-static const int ADJ_DEQUANT_SHIFT =            ( ADJ_QUANT_SHIFT + 1 );
-#endif
 
 static const int RVM_VCEGAM10_M =                                   4;
 
@@ -237,9 +223,7 @@ static const int NUM_LUMA_MODE =                                   67; ///< Plan
 static const int NUM_LMC_MODE =                                    1 + 2; ///< LMC + MDLM_T + MDLM_L
 static const int NUM_INTRA_MODE = (NUM_LUMA_MODE + NUM_LMC_MODE);
 
-#if JVET_N0193_LFNST
 static const int NUM_EXT_LUMA_MODE =                               28;
-#endif
 
 static const int NUM_DIR =           (((NUM_LUMA_MODE - 3) >> 2) + 1);
 static const int PLANAR_IDX =                                       0; ///< index for intra PLANAR mode
@@ -248,9 +232,7 @@ static const int HOR_IDX =                    (1 * (NUM_DIR - 1) + 2); ///< inde
 static const int DIA_IDX =                    (2 * (NUM_DIR - 1) + 2); ///< index for intra DIAGONAL   mode
 static const int VER_IDX =                    (3 * (NUM_DIR - 1) + 2); ///< index for intra VERTICAL   mode
 static const int VDIA_IDX =                   (4 * (NUM_DIR - 1) + 2); ///< index for intra VDIAGONAL  mode
-#if JVET_N0413_RDPCM
 static const int BDPCM_IDX =                  (5 * (NUM_DIR - 1) + 2); ///< index for intra VDIAGONAL  mode
-#endif
 static const int NOMODE_IDX =                               MAX_UCHAR; ///< indicating uninitialized elements
 
 static const int NUM_CHROMA_MODE = (5 + NUM_LMC_MODE); ///< total number of chroma modes
@@ -265,26 +247,18 @@ static const uint32_t  NUM_TRAFO_MODES_MTS =                            6; ///<
 static const uint32_t  MTS_INTRA_MAX_CU_SIZE =                         32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
 static const uint32_t  MTS_INTER_MAX_CU_SIZE =                         32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
 static const int NUM_MOST_PROBABLE_MODES = 6;
-#if JVET_N0217_MATRIX_INTRAPRED
 static const int NUM_MPM_MIP =                                      3; ///< number of most probable modes for MIP
-#endif
 static const int LM_SYMBOL_NUM = (1 + NUM_LMC_MODE);
 
-#if JVET_N0217_MATRIX_INTRAPRED
 static const int MAX_NUM_MIP_MODE =                                35; ///< maximum number of MIP modes
 static const int FAST_UDI_MAX_RDMODE_NUM = (NUM_LUMA_MODE + MAX_NUM_MIP_MODE); ///< maximum number of RD comparison in fast-UDI estimation loop
-#else
-static const int FAST_UDI_MAX_RDMODE_NUM =              NUM_LUMA_MODE; ///< maximum number of RD comparison in fast-UDI estimation loop
-#endif
 
-#if JVET_N0193_LFNST
 static const int MAX_LFNST_COEF_NUM =                              16;
 
 static const int LFNST_SIG_NZ_LUMA =                                1;
 static const int LFNST_SIG_NZ_CHROMA =                              1;
 
 static const int NUM_LFNST_NUM_PER_SET =                            3;
-#endif
 
 static const int MDCS_ANGLE_LIMIT =                                 9; ///< 0 = Horizontal/vertical only, 1 = Horizontal/vertical +/- 1, 2 = Horizontal/vertical +/- 2 etc...
 
@@ -339,11 +313,7 @@ static const int QUANT_SHIFT =                                     14; ///< Q(4)
 static const int IQUANT_SHIFT =                                     6;
 static const int SCALE_BITS =                                      15; ///< Precision for fractional bit estimates
 
-#if JVET_N0847_SCALING_LISTS
 static const int SCALING_LIST_NUM = MAX_NUM_COMPONENT * (NUMBER_OF_PREDICTION_MODES - 1); ///< list number for quantization matrix
-#else
-static const int SCALING_LIST_NUM = MAX_NUM_COMPONENT * NUMBER_OF_PREDICTION_MODES; ///< list number for quantization matrix
-#endif
 
 static const int SCALING_LIST_START_VALUE =                         8; ///< start value for dpcm mode
 static const int MAX_MATRIX_COEF_NUM =                             64; ///< max coefficient number for quantization matrix
@@ -380,10 +350,8 @@ static const int GBI_SIZE_CONSTRAINT =                            256; ///< disa
 static const int MAX_NUM_HMVP_CANDS =                              (MRG_MAX_NUM_CANDS-1); ///< maximum number of HMVP candidates to be stored and used in merge list
 static const int MAX_NUM_HMVP_AVMPCANDS =                          4; ///< maximum number of HMVP candidates to be used in AMVP list
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
 static const int ALF_VB_POS_ABOVE_CTUROW_LUMA = 4;
 static const int ALF_VB_POS_ABOVE_CTUROW_CHMA = 2;
-#endif
 
 #if W0038_DB_OPT
 static const int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS =           8 ;
@@ -399,9 +367,7 @@ static const int DMVR_SUBCU_WIDTH_LOG2 = 4;
 static const int DMVR_SUBCU_HEIGHT_LOG2 = 4;
 static const int MAX_NUM_SUBCU_DMVR = ((MAX_CU_SIZE * MAX_CU_SIZE) >> (DMVR_SUBCU_WIDTH_LOG2 + DMVR_SUBCU_HEIGHT_LOG2));
 static const int DMVR_NUM_ITERATION = 2;
-#if JVET_N0413_RDPCM
 static const int BDPCM_MAX_CU_SIZE = 32;      ///<  maximum CU size for RDPCM mode
-#endif
 
 //QTBT high level parameters
 //for I slice luma CTB configuration para.
@@ -419,10 +385,8 @@ static const int    MAX_BT_DEPTH_C      =                           0;      ///<
 static const int    MAX_BT_SIZE_C       =                          64;      ///< [1<<MIN_QT_SIZE_C, 1<<CTU_LOG2], in luma samples
 
 static const int    MAX_TT_SIZE_INTER  =                           64;      ///< for initialization, [1<<MIN_CU_LOG2, 64]
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
 static const int    MIN_DUALTREE_CHROMA_WIDTH  =                    4;
 static const int    MIN_DUALTREE_CHROMA_SIZE   =                   16;
-#endif
 static const SplitSeries SPLIT_BITS         =                       5;
 static const SplitSeries SPLIT_DMULT        =                       5;
 static const SplitSeries SPLIT_MASK         =                      31;      ///< = (1 << SPLIT_BITS) - 1
@@ -459,17 +423,9 @@ static const int MAX_LADF_INTERVALS       =                         5; /// max n
 static const int NTAPS_BILINEAR           =                         2; ///< Number of taps for bilinear filter
 
 static const int ATMVP_SUB_BLOCK_SIZE =                             3; ///< sub-block size for ATMVP
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
 static const int TRIANGLE_MAX_NUM_UNI_CANDS =                       6;
-#else
-static const int TRIANGLE_MAX_NUM_UNI_CANDS =                       5;
-#endif
 static const int TRIANGLE_MAX_NUM_CANDS_MEM =                       7;
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
 static const int TRIANGLE_MAX_NUM_CANDS = TRIANGLE_MAX_NUM_UNI_CANDS * (TRIANGLE_MAX_NUM_UNI_CANDS - 1) * 2;
-#else
-static const int TRIANGLE_MAX_NUM_CANDS =                          40;
-#endif
 static const int TRIANGLE_MAX_NUM_SATD_CANDS =                      3;
 static const int TRIANGLE_MIN_SIZE =                            8 * 8;
 
@@ -495,11 +451,7 @@ static constexpr int MV_MIN =                 -(1 << (MV_BITS - 1));
 
 static const int PIC_ANALYZE_CW_BINS =                           32;
 static const int PIC_CODE_CW_BINS =                              16;
-#if JVET_N0220_LMCS_SIMPLIFICATION
 static const int FP_PREC =                                       11;
-#else
-static const int FP_PREC =                                       14;
-#endif
 static const int CSCALE_FP_PREC =                                11;
 // ====================================================================================================================
 // Macro functions
diff --git a/source/Lib/CommonLib/ContextModelling.cpp b/source/Lib/CommonLib/ContextModelling.cpp
index d7e2f77bf..4ef4a5522 100644
--- a/source/Lib/CommonLib/ContextModelling.cpp
+++ b/source/Lib/CommonLib/ContextModelling.cpp
@@ -41,49 +41,25 @@
 #include "Picture.h"
 
 
-#if HEVC_USE_SIGN_HIDING
-#if JVET_N0413_RDPCM
 CoeffCodingContext::CoeffCodingContext( const TransformUnit& tu, ComponentID component, bool signHide, bool bdpcm )
-#else
-CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID component, bool signHide)
-#endif
-#else
-CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID component )
-#endif
   : m_compID                    (component)
   , m_chType                    (toChannelType(m_compID))
   , m_width                     (tu.block(m_compID).width)
   , m_height                    (tu.block(m_compID).height)
-#if JVET_N0103_CGSIZE_HARMONIZATION
   , m_log2CGWidth               ( g_log2SbbSize[ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][0] )
   , m_log2CGHeight              ( g_log2SbbSize[ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][1] )
-#else
-  , m_log2CGWidth               ( g_log2SbbSize[m_chType][ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][0] )
-  , m_log2CGHeight              ( g_log2SbbSize[m_chType][ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][1] )
-#endif
   , m_log2CGSize                (m_log2CGWidth + m_log2CGHeight)
   , m_widthInGroups(std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_width) >> m_log2CGWidth)
   , m_heightInGroups(std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_height) >> m_log2CGHeight)
   , m_log2BlockWidth            (g_aucLog2[m_width])
   , m_log2BlockHeight           (g_aucLog2[m_height])
   , m_maxNumCoeff               (m_width * m_height)
-#if HEVC_USE_SIGN_HIDING
   , m_signHiding                (signHide)
-#endif
   , m_extendedPrecision         (tu.cs->sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag())
   , m_maxLog2TrDynamicRange     (tu.cs->sps->getMaxLog2TrDynamicRange(m_chType))
-#if HEVC_USE_MDCS
-  , m_scanType                  (CoeffScanType(TU::getCoefScanIdx( tu, m_compID)))
-#else
   , m_scanType                  (SCAN_DIAG)
-#endif
-#if JVET_N0103_CGSIZE_HARMONIZATION
   , m_scan                      (g_scanOrder     [SCAN_GROUPED_4x4][m_scanType][gp_sizeIdxInfo->idxFrom(m_width        )][gp_sizeIdxInfo->idxFrom(m_height        )])
   , m_scanCG                    (g_scanOrder     [SCAN_UNGROUPED  ][m_scanType][gp_sizeIdxInfo->idxFrom(m_widthInGroups)][gp_sizeIdxInfo->idxFrom(m_heightInGroups)])
-#else
-  , m_scan                      (g_scanOrder     [m_chType][SCAN_GROUPED_4x4][m_scanType][gp_sizeIdxInfo->idxFrom(m_width        )][gp_sizeIdxInfo->idxFrom(m_height        )])
-  , m_scanCG                    (g_scanOrder     [m_chType][SCAN_UNGROUPED  ][m_scanType][gp_sizeIdxInfo->idxFrom(m_widthInGroups)][gp_sizeIdxInfo->idxFrom(m_heightInGroups)])
-#endif
   , m_CtxSetLastX               (Ctx::LastX[m_chType])
   , m_CtxSetLastY               (Ctx::LastY[m_chType])
   , m_maxLastPosX(g_uiGroupIdx[std::min<unsigned>(JVET_C0024_ZERO_OUT_TH, m_width) - 1])
@@ -106,36 +82,20 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID comp
   , m_sigFlagCtxSet             { Ctx::SigFlag[m_chType], Ctx::SigFlag[m_chType+2], Ctx::SigFlag[m_chType+4] }
   , m_parFlagCtxSet             ( Ctx::ParFlag[m_chType] )
   , m_gtxFlagCtxSet             { Ctx::GtxFlag[m_chType], Ctx::GtxFlag[m_chType+2] }
-#if JVET_N0280_RESIDUAL_CODING_TS
   , m_sigGroupCtxIdTS           (-1)
   , m_tsSigFlagCtxSet           ( Ctx::TsSigFlag )
   , m_tsParFlagCtxSet           ( Ctx::TsParFlag )
   , m_tsGtxFlagCtxSet           ( Ctx::TsGtxFlag )
-#endif
   , m_sigCoeffGroupFlag         ()
-#if JVET_N0413_RDPCM
   , m_bdpcm                     (bdpcm)
-#endif
 {
   // LOGTODO
   unsigned log2sizeX = m_log2BlockWidth;
   unsigned log2sizeY = m_log2BlockHeight;
-#if HEVC_USE_MDCS
-  if (m_scanType == SCAN_VER)
-  {
-    std::swap(log2sizeX, log2sizeY);
-    std::swap(const_cast<unsigned&>(m_maxLastPosX), const_cast<unsigned&>(m_maxLastPosY));
-  }
-#endif
   if (m_chType == CHANNEL_TYPE_CHROMA)
   {
-#if HEVC_USE_MDCS
-    const_cast<int&>(m_lastShiftX) = Clip3( 0, 2, int( ( m_scanType == SCAN_VER ? m_height : m_width  ) >> 3) );
-    const_cast<int&>(m_lastShiftY) = Clip3( 0, 2, int( ( m_scanType == SCAN_VER ? m_width  : m_height ) >> 3) );
-#else
     const_cast<int&>(m_lastShiftX) = Clip3( 0, 2, int( m_width  >> 3) );
     const_cast<int&>(m_lastShiftY) = Clip3( 0, 2, int( m_height >> 3) );
-#endif
   }
   else
   {
@@ -164,11 +124,9 @@ void CoeffCodingContext::initSubblock( int SubsetId, bool sigGroupFlag )
   unsigned  sigRight  = unsigned( ( CGPosX + 1 ) < m_widthInGroups  ? m_sigCoeffGroupFlag[ m_subSetPos + 1               ] : false );
   unsigned  sigLower  = unsigned( ( CGPosY + 1 ) < m_heightInGroups ? m_sigCoeffGroupFlag[ m_subSetPos + m_widthInGroups ] : false );
   m_sigGroupCtxId     = Ctx::SigCoeffGroup[m_chType]( sigRight | sigLower );
-#if JVET_N0280_RESIDUAL_CODING_TS
   unsigned  sigLeft   = unsigned( CGPosX > 0 ? m_sigCoeffGroupFlag[m_subSetPos - 1              ] : false );
   unsigned  sigAbove  = unsigned( CGPosY > 0 ? m_sigCoeffGroupFlag[m_subSetPos - m_widthInGroups] : false );
   m_sigGroupCtxIdTS   = Ctx::TsSigCoeffGroup( sigLeft  + sigAbove );
-#endif
 }
 
 
@@ -179,25 +137,13 @@ void DeriveCtx::CtxSplit( const CodingStructure& cs, Partitioner& partitioner, u
 {
   const Position pos         = partitioner.currArea().blocks[partitioner.chType];
   const unsigned curSliceIdx = cs.slice->getIndependentSliceIdx();
-#if JVET_N0857_TILES_BRICKS
   const unsigned curTileIdx  = cs.picture->brickMap->getBrickIdxRsMap( partitioner.currArea().lumaPos() );
-#else
-  const unsigned curTileIdx  = cs.picture->tileMap->getTileIdxMap( partitioner.currArea().lumaPos() );
-#endif
 
   // get left depth
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const CodingUnit* cuLeft = cs.getCURestricted( pos.offset( -1, 0 ), pos, curSliceIdx, curTileIdx, partitioner.chType );
-#else
-  const CodingUnit* cuLeft = cs.getCURestricted( pos.offset( -1, 0 ), curSliceIdx, curTileIdx, partitioner.chType );
-#endif
 
   // get above depth
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const CodingUnit* cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), pos, curSliceIdx, curTileIdx, partitioner.chType );
-#else
-  const CodingUnit* cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), curSliceIdx, curTileIdx, partitioner.chType );
-#endif
 
   bool canSplit[6];
 
@@ -307,11 +253,7 @@ unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const unsigned trDepth,
 
 unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
 {
-#if JVET_N0462_FIX_CTX_MODELING
   return ( 7 - ((g_aucLog2[pu.lumaSize().width] + g_aucLog2[pu.lumaSize().height] + 1) >> 1) );
-#else
-  return Clip3( 0, 3, 7 - ( ( g_aucLog2[pu.lumaSize().width] + g_aucLog2[pu.lumaSize().height] + 1 ) >> 1 ) );    // VG-ASYMM DONE
-#endif
 }
 
 unsigned DeriveCtx::CtxAffineFlag( const CodingUnit& cu )
@@ -344,37 +286,6 @@ unsigned DeriveCtx::CtxSkipFlag( const CodingUnit& cu )
 }
 
 
-#if !JVET_N600_AMVR_TPM_CTX_REDUCTION
-unsigned DeriveCtx::CtxIMVFlag( const CodingUnit& cu )
-{
-  const CodingStructure *cs = cu.cs;
-  unsigned ctxId = 0;
-
-  // Get BCBP of left PU
-  const CodingUnit *cuLeft = cs->getCURestricted( cu.lumaPos().offset( -1, 0 ), cu, CH_L );
-  ctxId = ( cuLeft && cuLeft->imv ) ? 1 : 0;
-
-  // Get BCBP of above PU
-  const CodingUnit *cuAbove = cs->getCURestricted( cu.lumaPos().offset( 0, -1 ), cu, CH_L );
-  ctxId += ( cuAbove && cuAbove->imv ) ? 1 : 0;
-
-  return ctxId;
-}
-
-unsigned DeriveCtx::CtxTriangleFlag( const CodingUnit& cu )
-{
-  const CodingStructure *cs = cu.cs;
-  unsigned ctxId = 0;
-
-  const CodingUnit *cuLeft = cs->getCURestricted( cu.lumaPos().offset( -1, 0 ), cu, CH_L );
-  ctxId = ( cuLeft && cuLeft->triangle ) ? 1 : 0;
-
-  const CodingUnit *cuAbove = cs->getCURestricted( cu.lumaPos().offset( 0, -1 ), cu, CH_L );
-  ctxId += ( cuAbove && cuAbove->triangle ) ? 1 : 0;
-
-  return ctxId;
-}
-#endif
 
 unsigned DeriveCtx::CtxPredModeFlag( const CodingUnit& cu )
 {
@@ -402,9 +313,7 @@ unsigned DeriveCtx::CtxIBCFlag(const CodingUnit& cu)
 void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
 {
   CHECK( candIdx >= numValidMergeCand, "Merge candidate does not exist" );
-#if JVET_N0324_REGULAR_MRG_FLAG
   pu.regularMergeFlag        = !(pu.mhIntraFlag || pu.cu->triangle);
-#endif
   pu.mergeFlag               = true;
   pu.mmvdMergeFlag = false;
   pu.interDir                = interDirNeighbours[candIdx];
@@ -486,7 +395,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
     {
       const int scale = PU::getDistScaleFactor(currPoc, poc0, currPoc, poc1);
       tempMv[1] = tempMv[0];
-#if JVET_N0332_LTRP_MMVD_FIX
       const bool isL0RefLongTerm = slice.getRefPic(REF_PIC_LIST_0, refList0)->longTerm;
       const bool isL1RefLongTerm = slice.getRefPic(REF_PIC_LIST_1, refList1)->longTerm;
       if (isL0RefLongTerm || isL1RefLongTerm)
@@ -501,13 +409,11 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
         }
       }
       else
-#endif
       tempMv[0] = tempMv[1].scaleMv(scale);
     }
     else
     {
       const int scale = PU::getDistScaleFactor(currPoc, poc1, currPoc, poc0);
-#if JVET_N0332_LTRP_MMVD_FIX
       const bool isL0RefLongTerm = slice.getRefPic(REF_PIC_LIST_0, refList0)->longTerm;
       const bool isL1RefLongTerm = slice.getRefPic(REF_PIC_LIST_1, refList1)->longTerm;
       if (isL0RefLongTerm || isL1RefLongTerm)
@@ -522,7 +428,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
         }
       }
       else
-#endif
       tempMv[1] = tempMv[0].scaleMv(scale);
     }
 
@@ -584,9 +489,7 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
   pu.mmvdMergeFlag = true;
   pu.mmvdMergeIdx = candIdx;
   pu.mergeFlag = true;
-#if JVET_N0324_REGULAR_MRG_FLAG
   pu.regularMergeFlag = false;
-#endif
   pu.mergeIdx = candIdx;
   pu.mergeType = MRG_TYPE_DEFAULT_N;
   pu.mvd[REF_PIC_LIST_0] = Mv();
@@ -598,7 +501,6 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
 
   pu.cu->GBiIdx = (interDirNeighbours[fPosBaseIdx] == 3) ? GBiIdx[fPosBaseIdx] : GBI_DEFAULT;
 
-#if JVET_N0334_MVCLIPPING
   for (int refList = 0; refList < 2; refList++)
   {
     if (pu.refIdx[refList] >= 0)
@@ -606,13 +508,11 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
       pu.mv[refList].clipToStorageBitDepth();
     }
   }
-#endif
 
 
   PU::restrictBiPredMergeCandsOne(pu);
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 unsigned DeriveCtx::CtxMipFlag( const CodingUnit& cu )
 {
   const CodingStructure *cs = cu.cs;
@@ -628,4 +528,3 @@ unsigned DeriveCtx::CtxMipFlag( const CodingUnit& cu )
 
   return ctxId;
 }
-#endif
diff --git a/source/Lib/CommonLib/ContextModelling.h b/source/Lib/CommonLib/ContextModelling.h
index 1a6a67bbe..18e2654ac 100644
--- a/source/Lib/CommonLib/ContextModelling.h
+++ b/source/Lib/CommonLib/ContextModelling.h
@@ -51,26 +51,16 @@
 struct CoeffCodingContext
 {
 public:
-#if HEVC_USE_SIGN_HIDING
-#if JVET_N0413_RDPCM
   CoeffCodingContext( const TransformUnit& tu, ComponentID component, bool signHide, bool bdpcm = false );
-#else
-  CoeffCodingContext( const TransformUnit& tu, ComponentID component, bool signHide);
-#endif
-#else
-  CoeffCodingContext( const TransformUnit& tu, ComponentID component );
-#endif
 public:
   void  initSubblock     ( int SubsetId, bool sigGroupFlag = false );
 public:
   void  resetSigGroup   ()                      { m_sigCoeffGroupFlag.reset( m_subSetPos ); }
   void  setSigGroup     ()                      { m_sigCoeffGroupFlag.set( m_subSetPos ); }
-#if JVET_N0280_RESIDUAL_CODING_TS
   bool  noneSigGroup    ()                      { return m_sigCoeffGroupFlag.none(); }
   int   lastSubSet      ()                      { return ( maxNumCoeff() - 1 ) >> log2CGSize(); }
   bool  isLastSubSet    ()                      { return lastSubSet() == m_subSetId; }
   bool  only1stSigGroup ()                      { return m_sigCoeffGroupFlag.count()-m_sigCoeffGroupFlag[lastSubSet()]==0; }
-#endif
   void  setScanPosLast  ( int       posLast )   { m_scanPosLast = posLast; }
 public:
   ComponentID     compID          ()                        const { return m_compID; }
@@ -93,11 +83,9 @@ public:
   bool            isNotFirst      ()                        const { return ( m_subSetId != 0 ); }
   bool            isSigGroup(int scanPosCG) const { return m_sigCoeffGroupFlag[m_scanCG[scanPosCG].idx]; }
   bool            isSigGroup      ()                        const { return m_sigCoeffGroupFlag[ m_subSetPos ]; }
-#if HEVC_USE_SIGN_HIDING
   bool            signHiding      ()                        const { return m_signHiding; }
   bool            hideSign        ( int       posFirst,
                                     int       posLast   )   const { return ( m_signHiding && ( posLast - posFirst >= SBH_THRESHOLD ) ); }
-#endif
   CoeffScanType   scanType        ()                        const { return m_scanType; }
   unsigned        blockPos(int scanPos) const { return m_scan[scanPos].idx; }
   unsigned        posX(int scanPos) const { return m_scan[scanPos].x; }
@@ -106,17 +94,11 @@ public:
   unsigned        maxLastPosY     ()                        const { return m_maxLastPosY; }
   unsigned        lastXCtxId      ( unsigned  posLastX  )   const { return m_CtxSetLastX( m_lastOffsetX + ( posLastX >> m_lastShiftX ) ); }
   unsigned        lastYCtxId      ( unsigned  posLastY  )   const { return m_CtxSetLastY( m_lastOffsetY + ( posLastY >> m_lastShiftY ) ); }
-#if JVET_N0280_RESIDUAL_CODING_TS
   bool            isContextCoded  ()                              { return --m_remainingContextBins >= 0; }
   int             numCtxBins      ()                        const { return   m_remainingContextBins;      }
   void            setNumCtxBins   ( int n )                       {          m_remainingContextBins  = n; }
   unsigned        sigGroupCtxId   ( bool ts = false     )   const { return ts ? m_sigGroupCtxIdTS : m_sigGroupCtxId; }
-#else
-  unsigned        sigGroupCtxId   ()                        const { return m_sigGroupCtxId; }
-#endif
-#if JVET_N0413_RDPCM
   bool            bdpcm           ()                        const { return m_bdpcm; }
-#endif
   unsigned sigCtxIdAbs( int scanPos, const TCoeff* coeff, const int state )
   {
     const uint32_t posY      = m_scan[scanPos].y;
@@ -171,11 +153,7 @@ public:
   unsigned parityCtxIdAbs   ( uint8_t offset )  const { return m_parFlagCtxSet   ( offset ); }
   unsigned greater1CtxIdAbs ( uint8_t offset )  const { return m_gtxFlagCtxSet[1]( offset ); }
   unsigned greater2CtxIdAbs ( uint8_t offset )  const { return m_gtxFlagCtxSet[0]( offset ); }
-#if JVET_N0188_UNIFY_RICEPARA
   unsigned templateAbsSum( int scanPos, const TCoeff* coeff, int baseLevel )
-#else
-  unsigned templateAbsSum( int scanPos, const TCoeff* coeff )
-#endif
   {
     const uint32_t  posY  = m_scan[scanPos].y;
     const uint32_t  posX  = m_scan[scanPos].x;
@@ -201,14 +179,9 @@ public:
         sum += abs(pData[m_width << 1]);
       }
     }
-#if JVET_N0188_UNIFY_RICEPARA
     return std::max(std::min(sum - 5 * baseLevel, 31), 0);
-#else
-    return std::min(sum, 31);
-#endif
   }
 
-#if JVET_N0280_RESIDUAL_CODING_TS
   unsigned sigCtxIdAbsTS( int scanPos, const TCoeff* coeff )
   {
     const uint32_t  posY   = m_scan[scanPos].y;
@@ -257,7 +230,6 @@ public:
 
     return auiGoRicePars[ std::min(sum, 31) ];
   }
-#endif
 
 private:
   // constant
@@ -273,9 +245,7 @@ private:
   const unsigned            m_log2BlockWidth;
   const unsigned            m_log2BlockHeight;
   const unsigned            m_maxNumCoeff;
-#if HEVC_USE_SIGN_HIDING
   const bool                m_signHiding;
-#endif
   const bool                m_extendedPrecision;
   const int                 m_maxLog2TrDynamicRange;
   CoeffScanType             m_scanType;
@@ -304,17 +274,13 @@ private:
   CtxSet                    m_sigFlagCtxSet[3];
   CtxSet                    m_parFlagCtxSet;
   CtxSet                    m_gtxFlagCtxSet[2];
-#if JVET_N0280_RESIDUAL_CODING_TS
   unsigned                  m_sigGroupCtxIdTS;
   CtxSet                    m_tsSigFlagCtxSet;
   CtxSet                    m_tsParFlagCtxSet;
   CtxSet                    m_tsGtxFlagCtxSet;
   int                       m_remainingContextBins;
-#endif
   std::bitset<MLS_GRP_NUM>  m_sigCoeffGroupFlag;
-#if JVET_N0413_RDPCM
   const bool                m_bdpcm;
-#endif
 };
 
 
@@ -380,18 +346,10 @@ void     CtxSplit     ( const CodingStructure& cs, Partitioner& partitioner, uns
 unsigned CtxQtCbf     ( const ComponentID compID, const unsigned trDepth, const bool prevCbCbf = false, const int ispIdx = 0 );
 unsigned CtxInterDir  ( const PredictionUnit& pu );
 unsigned CtxSkipFlag  ( const CodingUnit& cu );
-#if !JVET_N600_AMVR_TPM_CTX_REDUCTION
-unsigned CtxIMVFlag   ( const CodingUnit& cu );
-#endif
 unsigned CtxAffineFlag( const CodingUnit& cu );
-#if !JVET_N600_AMVR_TPM_CTX_REDUCTION
-unsigned CtxTriangleFlag( const CodingUnit& cu );
-#endif
 unsigned CtxPredModeFlag( const CodingUnit& cu );
 unsigned CtxIBCFlag(const CodingUnit& cu);
-#if JVET_N0217_MATRIX_INTRAPRED
 unsigned CtxMipFlag   ( const CodingUnit& cu );
-#endif
 }
 
 #endif // __CONTEXTMODELLING__
diff --git a/source/Lib/CommonLib/Contexts.cpp b/source/Lib/CommonLib/Contexts.cpp
index 314fecd67..6f68221e9 100644
--- a/source/Lib/CommonLib/Contexts.cpp
+++ b/source/Lib/CommonLib/Contexts.cpp
@@ -245,7 +245,6 @@ const CtxSet ContextSetCfg::MergeFlag = ContextSetCfg::addCtxSet
   {   5, },
 });
 
-#if JVET_N0324_REGULAR_MRG_FLAG
 const CtxSet ContextSetCfg::RegularMergeFlag = ContextSetCfg::addCtxSet
 ({
   { 142, 125, },
@@ -253,7 +252,6 @@ const CtxSet ContextSetCfg::RegularMergeFlag = ContextSetCfg::addCtxSet
   { CNU, CNU, },
   {   4,   4, },
 });
-#endif
 
 const CtxSet ContextSetCfg::MergeIdx = ContextSetCfg::addCtxSet
 ({
@@ -311,7 +309,6 @@ const CtxSet ContextSetCfg::IntraLumaMpmFlag = ContextSetCfg::addCtxSet
   {   6, },
 });
 
-#if JVET_N0185_UNIFIED_MPM
 const CtxSet ContextSetCfg::IntraLumaPlanarFlag = ContextSetCfg::addCtxSet
 ({
   { 125, 125, },
@@ -319,7 +316,6 @@ const CtxSet ContextSetCfg::IntraLumaPlanarFlag = ContextSetCfg::addCtxSet
   { 110, 154, },
   {   4,   5, },
 });
-#endif
 
 const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
 ({
@@ -329,7 +325,6 @@ const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
   {   5,   8,   8, },
 });
 
-#if JVET_N0217_MATRIX_INTRAPRED
 const CtxSet ContextSetCfg::MipFlag = ContextSetCfg::addCtxSet
 ({
   { 181, 182, 183, 152, },
@@ -345,7 +340,6 @@ const CtxSet ContextSetCfg::MipMode = ContextSetCfg::addCtxSet
   { 182, },
   {   9, },
 });
-#endif
 
 const CtxSet ContextSetCfg::DeltaQP = ContextSetCfg::addCtxSet
 ({
@@ -397,18 +391,10 @@ const CtxSet ContextSetCfg::AffMergeIdx = ContextSetCfg::addCtxSet
 
 const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
 ({
-#if JVET_N0286_SIMPLIFIED_GBI_IDX
   { 228, },
   { 228, },
   { CNU, },
   {   4, },
-#else
-  // 4 ctx for 1st bin; 1 ctx for each of rest bins
-  { 228, CNU, CNU, CNU, 125, 155, 175, },
-  { 242, CNU, CNU, CNU, 154, 170, 237, },
-  { CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
-  { 4, DWS, DWS, DWS, 4, 0, 0, },
-#endif
 });
 
 const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
@@ -419,7 +405,6 @@ const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
   {   9,   5, },
 });
 
-#if JVET_N0413_RDPCM
 const CtxSet ContextSetCfg::BDPCMMode = ContextSetCfg::addCtxSet
 ({
   { 148, 154, },
@@ -427,7 +412,6 @@ const CtxSet ContextSetCfg::BDPCMMode = ContextSetCfg::addCtxSet
   {  40, 169, },
   {   1,   4, },
 });
-#endif
 
 const CtxSet ContextSetCfg::QtRootCbf = ContextSetCfg::addCtxSet
 ({
@@ -439,7 +423,6 @@ const CtxSet ContextSetCfg::QtRootCbf = ContextSetCfg::addCtxSet
 
 const CtxSet ContextSetCfg::QtCbf[] =
 {
-#if JVET_N0413_RDPCM
   ContextSetCfg::addCtxSet
   ({
     { 142, 127, 124, 140, 111, },
@@ -447,15 +430,6 @@ const CtxSet ContextSetCfg::QtCbf[] =
     { CNU, 126, 124, 111, 138, },
     {   1,   5,   8,   8,   1, },
   }),
-#else
-  ContextSetCfg::addCtxSet
-  ({
-    { 141, 127, 139, 140, },
-    { 142, 127, 139, 140, },
-    { CNU, 111, 124, 111, },
-    { 1, 5, 9, 8, },
-  }),
-#endif
   ContextSetCfg::addCtxSet
   ({
     { 163, 135, },
@@ -662,22 +636,13 @@ const CtxSet ContextSetCfg::TransquantBypassFlag = ContextSetCfg::addCtxSet
   { DWS, },
 });
 
-#if JVET_N0193_LFNST
 const CtxSet ContextSetCfg::LFNSTIdx = ContextSetCfg::addCtxSet
 ( {
-#if JVET_N0105_LFNST_CTX_MODELLING
   { 184, CNU, },
   { 155, CNU, },
   { 169, 155, },
   {   8,   8, },
-#else
-  { 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, },
-#endif
 } );
-#endif
 
 const CtxSet ContextSetCfg::RdpcmFlag = ContextSetCfg::addCtxSet
 ({
@@ -769,17 +734,10 @@ const CtxSet ContextSetCfg::ChromaQpAdjIdc = ContextSetCfg::addCtxSet
 
 const CtxSet ContextSetCfg::ImvFlag = ContextSetCfg::addCtxSet
 ({
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
   { 212, 180, 183, 242, },
   { 213, 166, 198, 244, },
   { CNU, 182, CNU, CNU, },
   {   1,   5,   1,   0, },
-#else
-  { 212, 199, 215, 180, 183, 242, },
-  { 213, 229, 244, 166, 198, 244, },
-  { CNU, CNU, CNU, 152, CNU, CNU, },
-  { 1, 4, 4, 5, 1, 0, },
-#endif
 });
 
 const CtxSet ContextSetCfg::ctbAlfFlag = ContextSetCfg::addCtxSet
@@ -790,7 +748,6 @@ const CtxSet ContextSetCfg::ctbAlfFlag = ContextSetCfg::addCtxSet
   {   0,   0,   0,   0,   0,   0,   0,   0,   0, },
 });
 
-#if JVET_N0415_CTB_ALF
 const CtxSet ContextSetCfg::AlfUseLatestFilt = ContextSetCfg::addCtxSet
 ({
   { 169, },
@@ -806,7 +763,6 @@ const CtxSet ContextSetCfg::AlfUseTemporalFilt = ContextSetCfg::addCtxSet
   { CNU, },
   {   0, },
 });
-#endif
 
 const CtxSet ContextSetCfg::MHIntraFlag = ContextSetCfg::addCtxSet
 ({
@@ -816,32 +772,7 @@ const CtxSet ContextSetCfg::MHIntraFlag = ContextSetCfg::addCtxSet
   {   0, },
 });
 
-#if !JVET_N0302_SIMPLFIED_CIIP
-const CtxSet ContextSetCfg::MHIntraPredMode = ContextSetCfg::addCtxSet
-({
-  { 156, CNU, CNU, CNU, },
-  { 156, CNU, CNU, CNU, },
-  { CNU, CNU, CNU, CNU, },
-  { 9, DWS, DWS, DWS, },
-});
-#endif
 
-#if !JVET_N0324_REGULAR_MRG_FLAG
-const CtxSet ContextSetCfg::TriangleFlag = ContextSetCfg::addCtxSet
-({
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
-  { CNU, },
-  { CNU, },
-  { CNU, },
-  { DWS, },
-#else
-  { 149, 123, 123, },
-  { 151, 152, 138, },
-  { CNU, CNU, CNU, },
-  { 8, 12, 9, },
-#endif
-});
-#endif
 
 const CtxSet ContextSetCfg::IBCFlag = ContextSetCfg::addCtxSet
 ({
@@ -851,7 +782,6 @@ const CtxSet ContextSetCfg::IBCFlag = ContextSetCfg::addCtxSet
   {   1,   5,   8, },
 });
 
-#if JVET_N0054_JOINT_CHROMA
 const CtxSet ContextSetCfg::JointCbCrFlag = ContextSetCfg::addCtxSet
 ({
   { 156, },
@@ -859,9 +789,7 @@ const CtxSet ContextSetCfg::JointCbCrFlag = ContextSetCfg::addCtxSet
   { 184, },
   {   1, },
 });
-#endif
 
-#if JVET_N0280_RESIDUAL_CODING_TS
 const CtxSet ContextSetCfg::TsSigCoeffGroup = ContextSetCfg::addCtxSet
 ({
   { 123, 139, 155, },
@@ -898,20 +826,12 @@ const CtxSet ContextSetCfg::TsResidualSign =
 {
   ContextSetCfg::addCtxSet
   ({
-#if JVET_N0413_RDPCM
     { 154, 154, },
     { 139, 154, },
     { 124, 139, },
     {   1,   2, },
-#else
-    {  CNU,  },
-    {  CNU,  },
-    {  CNU,  },
-    {  DWS,  },
-#endif
    }),
 };
-#endif
 // clang-format on
 
 const unsigned ContextSetCfg::NumberOfContexts = (unsigned)ContextSetCfg::sm_InitTables[0].size();
@@ -920,9 +840,7 @@ const unsigned ContextSetCfg::NumberOfContexts = (unsigned)ContextSetCfg::sm_Ini
 // combined sets
 const CtxSet ContextSetCfg::Sao = { ContextSetCfg::SaoMergeFlag, ContextSetCfg::SaoTypeIdx };
 
-#if JVET_N0415_CTB_ALF
 const CtxSet ContextSetCfg::Alf = { ContextSetCfg::ctbAlfFlag, ContextSetCfg::AlfUseLatestFilt, ContextSetCfg::AlfUseTemporalFilt };
-#endif
 
 template <class BinProbModel>
 CtxStore<BinProbModel>::CtxStore()
diff --git a/source/Lib/CommonLib/Contexts.h b/source/Lib/CommonLib/Contexts.h
index 842899bd4..db3d89db5 100644
--- a/source/Lib/CommonLib/Contexts.h
+++ b/source/Lib/CommonLib/Contexts.h
@@ -201,21 +201,15 @@ public:
   static const CtxSet   Split12Flag;
   static const CtxSet   SkipFlag;
   static const CtxSet   MergeFlag;
-#if JVET_N0324_REGULAR_MRG_FLAG
   static const CtxSet   RegularMergeFlag;
-#endif
   static const CtxSet   MergeIdx;
   static const CtxSet   PredMode;
   static const CtxSet   MultiRefLineIdx;
   static const CtxSet   IntraLumaMpmFlag;
-#if JVET_N0185_UNIFIED_MPM
   static const CtxSet   IntraLumaPlanarFlag;
-#endif
   static const CtxSet   IntraChromaPredMode;
-#if JVET_N0217_MATRIX_INTRAPRED
   static const CtxSet   MipFlag;
   static const CtxSet   MipMode;
-#endif
   static const CtxSet   DeltaQP;
   static const CtxSet   InterDir;
   static const CtxSet   RefPic;
@@ -226,9 +220,7 @@ public:
   static const CtxSet   AffineType;
   static const CtxSet   AffMergeIdx;
   static const CtxSet   Mvd;
-#if JVET_N0413_RDPCM
   static const CtxSet   BDPCMMode;
-#endif
   static const CtxSet   QtRootCbf;
   static const CtxSet   QtCbf           [3];    // [ channel ]
   static const CtxSet   SigCoeffGroup   [2];    // [ ChannelType ]
@@ -237,21 +229,17 @@ public:
   static const CtxSet   SigFlag         [6];    // [ ChannelType + State ]
   static const CtxSet   ParFlag         [2];    // [ ChannelType ]
   static const CtxSet   GtxFlag         [4];    // [ ChannelType + x ]
-#if JVET_N0280_RESIDUAL_CODING_TS
   static const CtxSet   TsSigCoeffGroup;
   static const CtxSet   TsSigFlag;
   static const CtxSet   TsParFlag;
   static const CtxSet   TsGtxFlag;
   static const CtxSet   TsResidualSign;
-#endif
   static const CtxSet   MVPIdx;
   static const CtxSet   SaoMergeFlag;
   static const CtxSet   SaoTypeIdx;
   static const CtxSet   MTSIndex;
   static const CtxSet   TransquantBypassFlag;
-#if JVET_N0193_LFNST
   static const CtxSet   LFNSTIdx;
-#endif
   static const CtxSet   RdpcmFlag;
   static const CtxSet   RdpcmDir;
   static const CtxSet   SbtFlag;
@@ -264,24 +252,14 @@ public:
   static const CtxSet   ImvFlag;
   static const CtxSet   GBiIdx;
   static const CtxSet   ctbAlfFlag;
-#if JVET_N0415_CTB_ALF
   static const CtxSet   AlfUseLatestFilt;
   static const CtxSet   AlfUseTemporalFilt;
   static const CtxSet   Alf;
-#endif
   static const CtxSet   MHIntraFlag;
-#if !JVET_N0302_SIMPLFIED_CIIP
-  static const CtxSet   MHIntraPredMode;
-#endif
-#if !JVET_N0324_REGULAR_MRG_FLAG
-  static const CtxSet   TriangleFlag;
-#endif
   static const CtxSet   SmvdFlag;
   static const CtxSet   IBCFlag;
   static const CtxSet   ISPMode;
-#if JVET_N0054_JOINT_CHROMA
   static const CtxSet   JointCbCrFlag;
-#endif
   static const unsigned NumberOfContexts;
 
   // combined sets for less complex copying
diff --git a/source/Lib/CommonLib/DepQuant.cpp b/source/Lib/CommonLib/DepQuant.cpp
index 5bd804176..a682bad02 100644
--- a/source/Lib/CommonLib/DepQuant.cpp
+++ b/source/Lib/CommonLib/DepQuant.cpp
@@ -128,13 +128,8 @@ namespace DQIntern
     Rom() : m_scansInitialized(false) {}
     ~Rom() { xUninitScanArrays(); }
     void                init        ()                       { xInitScanArrays(); }
-#if JVET_N0103_CGSIZE_HARMONIZATION
     const NbInfoSbb*    getNbInfoSbb( int hd, int vd ) const { return m_scanId2NbInfoSbbArray[hd][vd]; }
     const NbInfoOut*    getNbInfoOut( int hd, int vd ) const { return m_scanId2NbInfoOutArray[hd][vd]; }
-#else
-    const NbInfoSbb*    getNbInfoSbb( int hd, int vd, int ch ) const { return m_scanId2NbInfoSbbArray[hd][vd][ch]; }
-    const NbInfoOut*    getNbInfoOut( int hd, int vd, int ch ) const { return m_scanId2NbInfoOutArray[hd][vd][ch]; }
-#endif
     const TUParameters* getTUPars   ( const CompArea& area, const ComponentID compID ) const
     {
       return m_tuParameters[g_aucLog2[area.width]][g_aucLog2[area.height]][toChannelType(compID)];
@@ -144,13 +139,8 @@ namespace DQIntern
     void  xUninitScanArrays ();
   private:
     bool          m_scansInitialized;
-#if JVET_N0103_CGSIZE_HARMONIZATION
     NbInfoSbb*    m_scanId2NbInfoSbbArray[ MAX_CU_DEPTH+1 ][ MAX_CU_DEPTH+1 ];
     NbInfoOut*    m_scanId2NbInfoOutArray[ MAX_CU_DEPTH+1 ][ MAX_CU_DEPTH+1 ];
-#else
-    NbInfoSbb*    m_scanId2NbInfoSbbArray[ MAX_CU_DEPTH+1 ][ MAX_CU_DEPTH+1 ][ MAX_NUM_CHANNEL_TYPE ];
-    NbInfoOut*    m_scanId2NbInfoOutArray[ MAX_CU_DEPTH+1 ][ MAX_CU_DEPTH+1 ][ MAX_NUM_CHANNEL_TYPE ];
-#endif
     TUParameters* m_tuParameters         [ MAX_CU_DEPTH+1 ][ MAX_CU_DEPTH+1 ][ MAX_NUM_CHANNEL_TYPE ];
   };
 
@@ -167,10 +157,6 @@ namespace DQIntern
     uint32_t raster2id[ MAX_CU_SIZE * MAX_CU_SIZE ];
     ::memset(raster2id, 0, sizeof(raster2id));
 
-#if !JVET_N0103_CGSIZE_HARMONIZATION
-    for( int ch = 0; ch < MAX_NUM_CHANNEL_TYPE; ch++ )
-    {
-#endif
     for( int hd = 0; hd <= MAX_CU_DEPTH; hd++ )
     {
       for( int vd = 0; vd <= MAX_CU_DEPTH; vd++ )
@@ -181,28 +167,17 @@ namespace DQIntern
         }
         const uint32_t      blockWidth    = (1 << hd);
         const uint32_t      blockHeight   = (1 << vd);
-#if JVET_N0103_CGSIZE_HARMONIZATION
         const uint32_t      log2CGWidth   = g_log2SbbSize[hd][vd][0];
         const uint32_t      log2CGHeight  = g_log2SbbSize[hd][vd][1];
-#else
-        const uint32_t      log2CGWidth   = g_log2SbbSize[ch][hd][vd][0];
-        const uint32_t      log2CGHeight  = g_log2SbbSize[ch][hd][vd][1];
-#endif
         const uint32_t      groupWidth    = 1 << log2CGWidth;
         const uint32_t      groupHeight   = 1 << log2CGHeight;
         const uint32_t      groupSize     = groupWidth * groupHeight;
         const CoeffScanType scanType      = SCAN_DIAG;
         const SizeType      blkWidthIdx   = gp_sizeIdxInfo->idxFrom( blockWidth  );
         const SizeType      blkHeightIdx  = gp_sizeIdxInfo->idxFrom( blockHeight );
-#if JVET_N0103_CGSIZE_HARMONIZATION
         const ScanElement * scanId2RP     = g_scanOrder[SCAN_GROUPED_4x4][scanType][blkWidthIdx][blkHeightIdx];
         NbInfoSbb*&         sId2NbSbb     = m_scanId2NbInfoSbbArray[hd][vd];
         NbInfoOut*&         sId2NbOut     = m_scanId2NbInfoOutArray[hd][vd];
-#else
-        const ScanElement * scanId2RP     = g_scanOrder[ch][SCAN_GROUPED_4x4][scanType][blkWidthIdx][blkHeightIdx];
-        NbInfoSbb*&         sId2NbSbb     = m_scanId2NbInfoSbbArray[hd][vd][ch];
-        NbInfoOut*&         sId2NbOut     = m_scanId2NbInfoOutArray[hd][vd][ch];
-#endif
         // consider only non-zero-out region
         const uint32_t      blkWidthNZOut = std::min<unsigned>( JVET_C0024_ZERO_OUT_TH, blockWidth  );
         const uint32_t      blkHeightNZOut= std::min<unsigned>( JVET_C0024_ZERO_OUT_TH, blockHeight );
@@ -312,19 +287,12 @@ namespace DQIntern
           nbOut.maxDist -= scanId;
         }
 
-#if JVET_N0103_CGSIZE_HARMONIZATION
         for( int chId = 0; chId < MAX_NUM_CHANNEL_TYPE; chId++ )
         {
           m_tuParameters[hd][vd][chId] = new TUParameters( *this, blockWidth, blockHeight, ChannelType(chId) );
         }
-#else
-        m_tuParameters[hd][vd][ch] = new TUParameters( *this, blockWidth, blockHeight, ChannelType(ch) );
-#endif
       }
     }
-#if !JVET_N0103_CGSIZE_HARMONIZATION
-    }
-#endif
     m_scansInitialized = true;
   }
 
@@ -334,7 +302,6 @@ namespace DQIntern
     {
       return;
     }
-#if JVET_N0103_CGSIZE_HARMONIZATION
     for( int hd = 0; hd <= MAX_CU_DEPTH; hd++ )
     {
       for( int vd = 0; vd <= MAX_CU_DEPTH; vd++ )
@@ -359,32 +326,6 @@ namespace DQIntern
         }
       }
     }
-#else
-    for( int hd = 0; hd <= MAX_CU_DEPTH; hd++ )
-    {
-      for( int vd = 0; vd <= MAX_CU_DEPTH; vd++ )
-      {
-        for( int ch = 0; ch < 2; ch++ )
-        {
-          NbInfoSbb*&     sId2NbSbb = m_scanId2NbInfoSbbArray[hd][vd][ch];
-          NbInfoOut*&     sId2NbOut = m_scanId2NbInfoOutArray[hd][vd][ch];
-          TUParameters*&  tuPars    = m_tuParameters         [hd][vd][ch];
-          if( sId2NbSbb )
-          {
-            delete [] sId2NbSbb;
-          }
-          if( sId2NbOut )
-          {
-            delete [] sId2NbOut;
-          }
-          if( tuPars )
-          {
-            delete tuPars;
-          }
-        }
-      }
-    }
-#endif
     m_scansInitialized = false;
   }
 
@@ -400,44 +341,25 @@ namespace DQIntern
     const uint32_t nonzeroWidth  = std::min<uint32_t>(JVET_C0024_ZERO_OUT_TH, m_width);
     const uint32_t nonzeroHeight = std::min<uint32_t>(JVET_C0024_ZERO_OUT_TH, m_height);
     m_numCoeff                   = nonzeroWidth * nonzeroHeight;
-#if JVET_N0103_CGSIZE_HARMONIZATION
     m_log2SbbWidth        = g_log2SbbSize[ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][0];
     m_log2SbbHeight       = g_log2SbbSize[ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][1];
-#else
-    m_log2SbbWidth        = g_log2SbbSize[m_chType][ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][0];
-    m_log2SbbHeight       = g_log2SbbSize[m_chType][ g_aucLog2[m_width] ][ g_aucLog2[m_height] ][1];
-#endif
     m_log2SbbSize         = m_log2SbbWidth + m_log2SbbHeight;
     m_sbbSize             = ( 1 << m_log2SbbSize );
     m_sbbMask             = m_sbbSize - 1;
     m_widthInSbb  = nonzeroWidth >> m_log2SbbWidth;
     m_heightInSbb = nonzeroHeight >> m_log2SbbHeight;
     m_numSbb              = m_widthInSbb * m_heightInSbb;
-#if HEVC_USE_MDCS
-#error "MDCS is not supported" // use different function...
-    //  m_scanType            = CoeffScanType( TU::getCoefScanIdx( tu, m_compID ) );
-#else
     m_scanType            = SCAN_DIAG;
-#endif
     SizeType        hsbb  = gp_sizeIdxInfo->idxFrom( m_widthInSbb  );
     SizeType        vsbb  = gp_sizeIdxInfo->idxFrom( m_heightInSbb );
     SizeType        hsId  = gp_sizeIdxInfo->idxFrom( m_width  );
     SizeType        vsId  = gp_sizeIdxInfo->idxFrom( m_height );
-#if JVET_N0103_CGSIZE_HARMONIZATION
     m_scanSbbId2SbbPos    = g_scanOrder     [ SCAN_UNGROUPED   ][ m_scanType ][ hsbb ][ vsbb ];
     m_scanId2BlkPos       = g_scanOrder     [ SCAN_GROUPED_4x4 ][ m_scanType ][ hsId ][ vsId ];
     int log2W             = g_aucLog2[ m_width  ];
     int log2H             = g_aucLog2[ m_height ];
     m_scanId2NbInfoSbb    = rom.getNbInfoSbb( log2W, log2H );
     m_scanId2NbInfoOut    = rom.getNbInfoOut( log2W, log2H );
-#else
-    m_scanSbbId2SbbPos    = g_scanOrder     [ chType ][ SCAN_UNGROUPED   ][ m_scanType ][ hsbb ][ vsbb ];
-    m_scanId2BlkPos       = g_scanOrder     [ chType ][ SCAN_GROUPED_4x4 ][ m_scanType ][ hsId ][ vsId ];
-    int log2W             = g_aucLog2[ m_width  ];
-    int log2H             = g_aucLog2[ m_height ];
-    m_scanId2NbInfoSbb    = rom.getNbInfoSbb( log2W, log2H, chType );
-    m_scanId2NbInfoOut    = rom.getNbInfoOut( log2W, log2H, chType );
-#endif
     m_scanInfo            = new ScanInfo[ m_numCoeff ];
     for( int scanIdx = 0; scanIdx < m_numCoeff; scanIdx++ )
     {
@@ -594,11 +516,7 @@ namespace DQIntern
       int32_t*            lastBits    = ( xy ? m_lastBitsY : m_lastBitsX );
       const unsigned      size        = ( xy ? tuPars.m_height : tuPars.m_width );
       const unsigned      log2Size    = g_aucNextLog2[ size ];
-#if HEVC_USE_MDCS
-      const bool          useYCtx     = ( m_scanType == SCAN_VER ? ( xy == 0 ) : ( xy != 0 ) );
-#else
       const bool          useYCtx     = ( xy != 0 );
-#endif
       const CtxSet&       ctxSetLast  = ( useYCtx ? Ctx::LastY : Ctx::LastX )[ chType ];
       const unsigned      lastShift   = ( compID == COMPONENT_Y ? (log2Size+1)>>2 : Clip3<unsigned>(0,2,size>>3) );
       const unsigned      lastOffset  = ( compID == COMPONENT_Y ? ( prefixCtx[log2Size] ) : 0 );
@@ -702,21 +620,13 @@ namespace DQIntern
   {
   public:
     Quantizer() {}
-#if JVET_N0847_SCALING_LISTS
     void  dequantBlock         ( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, CoeffBuf& recCoeff, bool enableScalingLists, int* piDequantCoef ) const;
     void  initQuantBlock       ( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, const double lambda, int gValue );
     inline void   preQuantCoeff( const TCoeff absCoeff, PQData *pqData, int quanCoeff ) const;
-#else
-    void  dequantBlock         ( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, CoeffBuf& recCoeff) const;
-    void  initQuantBlock( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, const double lambda  );
-   inline void   preQuantCoeff(const TCoeff absCoeff, PQData *pqData) const;
-#endif   
     inline TCoeff getLastThreshold() const { return m_thresLast; }
     inline TCoeff getSSbbThreshold() const { return m_thresSSbb; }
 
-#if JVET_N0847_SCALING_LISTS
     inline int64_t getQScale()       const { return m_QScale; }
-#endif
   private:
     // quantization
     int               m_QShift;
@@ -746,15 +656,8 @@ namespace DQIntern
     }
     return y;
   }
-#if JVET_N0847_SCALING_LISTS
   void Quantizer::initQuantBlock(const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, const double lambda, int gValue = -1)
-#else
-  void Quantizer::initQuantBlock( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, const double lambda )
-#endif
   {
-#if HEVC_USE_SCALING_LISTS && !JVET_N0847_SCALING_LISTS
-    CHECK ( tu.cs->sps->getScalingListFlag(), "Scaling lists not supported" );
-#endif
     CHECKD( lambda <= 0.0, "Lambda must be greater than 0" );
 
     const int         qpDQ                  = cQP.Qp + 1;
@@ -767,54 +670,21 @@ namespace DQIntern
     const int         maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange( chType );
     const int         nomTransformShift     = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange );
     const bool        clipTransformShift    = ( tu.mtsIdx==MTS_SKIP && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
-#if JVET_N0246_MODIFIED_QUANTSCALES
     const bool    needsSqrt2ScaleAdjustment = TU::needsSqrt2Scale(tu, compID);
     const int         transformShift        = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift ) + (needsSqrt2ScaleAdjustment?-1:0);
-#else
-    const int         transformShift        = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift );
-#endif
     // quant parameters
     m_QShift                    = QUANT_SHIFT  - 1 + qpPer + transformShift;
     m_QAdd                      = -( ( 3 << m_QShift ) >> 1 );
-#if JVET_N0246_MODIFIED_QUANTSCALES
     Intermediate_Int  invShift  = IQUANT_SHIFT + 1 - qpPer - transformShift;
     m_QScale                    = g_quantScales[needsSqrt2ScaleAdjustment?1:0][ qpRem ];
-#else // JVET_N0246_MODIFIED_QUANTSCALES
-#if HM_QTBT_AS_IN_JEM_QUANT
-    Intermediate_Int  invShift  = IQUANT_SHIFT + 1 - qpPer - transformShift + ( TU::needsBlockSizeTrafoScale( tu, compID ) ? ADJ_DEQUANT_SHIFT : 0 );
-    m_QScale                    = ( TU::needsSqrt2Scale( tu, compID ) ? ( g_quantScales[ qpRem ] * 181 ) >> 7 : g_quantScales[ qpRem ] );
-#else
-    Intermediate_Int  invShift  = IQUANT_SHIFT + 1 - qpPer - transformShift;
-    m_QScale                    = g_quantScales   [ qpRem ];
-#endif
-#endif // JVET_N0246_MODIFIED_QUANTSCALES
     const unsigned    qIdxBD    = std::min<unsigned>( maxLog2TrDynamicRange + 1, 8*sizeof(Intermediate_Int) + invShift - IQUANT_SHIFT - 1 );
     m_maxQIdx                   = ( 1 << (qIdxBD-1) ) - 4;
-#if JVET_N0847_SCALING_LISTS 
     m_thresLast                 = TCoeff((int64_t(3) << m_QShift));
     m_thresSSbb                 = TCoeff((int64_t(3) << m_QShift));
-#else
-    m_thresLast                 = TCoeff( ( int64_t(3) << m_QShift ) / ( 4 * m_QScale ) );
-    m_thresSSbb                 = TCoeff( ( int64_t(3) << m_QShift ) / ( 4 * m_QScale ) );
-#endif
     // distortion calculation parameters
-#if JVET_N0246_MODIFIED_QUANTSCALES
-#if JVET_N0847_SCALING_LISTS
     const int64_t qScale        = (gValue==-1) ? m_QScale : gValue;
-#else
-    const int64_t qScale        = m_QScale;
-#endif
     const int nomDShift =
       SCALE_BITS - 2 * (nomTransformShift + DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth)) + m_QShift + (needsSqrt2ScaleAdjustment ? 1 : 0);
-#else // JVET_N0246_MODIFIED_QUANTSCALES
-    const int64_t qScale        = g_quantScales[ qpRem ];
-#if HM_QTBT_AS_IN_JEM_QUANT
-    const int nomDShift = SCALE_BITS - 2 * (nomTransformShift + DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth)) + m_QShift;
-#else
-    const int nomDShift = SCALE_BITS - 2 * (nomTransformShift + DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth))
-                          + m_QShift + (TU::needsQP3Offset(tu, compID) ? 1 : 0);
-#endif
-#endif // JVET_N0246_MODIFIED_QUANTSCALES
     const double  qScale2       = double( qScale * qScale );
     const double  nomDistFactor = ( nomDShift < 0 ? 1.0/(double(int64_t(1)<<(-nomDShift))*qScale2*lambda) : double(int64_t(1)<<nomDShift)/(qScale2*lambda) );
     const int64_t pow2dfShift   = (int64_t)( nomDistFactor * qScale2 ) + 1;
@@ -825,31 +695,16 @@ namespace DQIntern
     m_DistOrgFact               = (int64_t)( nomDistFactor * double(int64_t(1)<<(m_DistShift+1       )) + .5 );
   }
 
-#if JVET_N0847_SCALING_LISTS
   void Quantizer::dequantBlock( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, CoeffBuf& recCoeff, bool enableScalingLists, int* piDequantCoef) const
-#else
-  void Quantizer::dequantBlock( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, CoeffBuf& recCoeff ) const
-#endif
   {
-#if HEVC_USE_SCALING_LISTS && !JVET_N0847_SCALING_LISTS
-    CHECK ( tu.cs->sps->getScalingListFlag(), "Scaling lists not supported" );
-#endif
 
     //----- set basic parameters -----
     const CompArea&     area      = tu.blocks[ compID ];
     const int           numCoeff  = area.area();
     const SizeType      hsId      = gp_sizeIdxInfo->idxFrom( area.width  );
     const SizeType      vsId      = gp_sizeIdxInfo->idxFrom( area.height );
-#if HEVC_USE_MDCS
-    const CoeffScanType scanType  = CoeffScanType( TU::getCoefScanIdx( tu, compID ) );
-#else
     const CoeffScanType scanType  = SCAN_DIAG;
-#endif
-#if JVET_N0103_CGSIZE_HARMONIZATION
     const ScanElement *scan       = g_scanOrder[SCAN_GROUPED_4x4][scanType][hsId][vsId];
-#else
-    const ScanElement *scan = g_scanOrder[toChannelType(compID)][SCAN_GROUPED_4x4][scanType][hsId][vsId];
-#endif
     const TCoeff*       qCoeff    = tu.getCoeffs( compID ).buf;
           TCoeff*       tCoeff    = recCoeff.buf;
 
@@ -881,36 +736,11 @@ namespace DQIntern
     const TCoeff      maxTCoeff             =  ( 1 << maxLog2TrDynamicRange ) - 1;
     const int         nomTransformShift     = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange );
     const bool        clipTransformShift    = ( tu.mtsIdx==MTS_SKIP && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
-#if JVET_N0246_MODIFIED_QUANTSCALES
     const bool    needsSqrt2ScaleAdjustment = TU::needsSqrt2Scale(tu, compID);
     const int         transformShift        = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift ) + (needsSqrt2ScaleAdjustment?-1:0);
-#if JVET_N0847_SCALING_LISTS 
     Intermediate_Int  shift                 = IQUANT_SHIFT + 1 - qpPer - transformShift + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
-#else
-    Intermediate_Int  shift                 = IQUANT_SHIFT + 1 - qpPer - transformShift;
-#endif
     Intermediate_Int  invQScale             = g_invQuantScales[needsSqrt2ScaleAdjustment?1:0][ qpRem ];
-#else // JVET_N0246_MODIFIED_QUANTSCALES
-    const int         transformShift        = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift );
-#if HM_QTBT_AS_IN_JEM_QUANT
-    Intermediate_Int  shift                 = IQUANT_SHIFT + 1 - qpPer - transformShift + ( TU::needsBlockSizeTrafoScale( tu, compID ) ? ADJ_DEQUANT_SHIFT : 0 );
-    Intermediate_Int  invQScale             = g_invQuantScales[ qpRem ] * ( TU::needsSqrt2Scale( tu, compID ) ? 181 : 1 );
-#else
-    Intermediate_Int  shift                 = IQUANT_SHIFT + 1 - qpPer - transformShift;
-    Intermediate_Int  invQScale             = g_invQuantScales[ qpRem ];
-#endif
-#endif // JVET_N0246_MODIFIED_QUANTSCALES
-#if JVET_N0847_SCALING_LISTS
     Intermediate_Int  add = (shift < 0) ? 0 : ((1 << shift) >> 1);
-#else
-    if( shift < 0 )
-    {
-      invQScale <<= -shift;
-      shift       = 0;
-    }
-    Intermediate_Int  add       = ( 1 << shift ) >> 1;
-
-#endif
     //----- dequant coefficients -----
     for( int state = 0, scanIdx = lastScanIdx; scanIdx >= 0; scanIdx-- )
     {
@@ -918,7 +748,6 @@ namespace DQIntern
       const TCoeff&   level     = qCoeff[ rasterPos ];
       if( level )
       {
-#if JVET_N0847_SCALING_LISTS
         if (enableScalingLists)
           invQScale = piDequantCoef[rasterPos];//scalingfactor*levelScale
         if (shift < 0)
@@ -927,7 +756,6 @@ namespace DQIntern
           shift = 0;
           //add = (1 << shift) >> 1;
         }
-#endif
         Intermediate_Int  qIdx      = ( level << 1 ) + ( level > 0 ? -(state>>1) : (state>>1) );
         Intermediate_Int  nomTCoeff = ( qIdx * invQScale + add ) >> shift;
         tCoeff[ rasterPos ]         = (TCoeff)Clip3<Intermediate_Int>( minTCoeff, maxTCoeff, nomTCoeff );
@@ -936,17 +764,9 @@ namespace DQIntern
     }
   }
 
-#if JVET_N0847_SCALING_LISTS
   inline void Quantizer::preQuantCoeff(const TCoeff absCoeff, PQData *pqData, int quanCoeff) const
-#else
-  inline void Quantizer::preQuantCoeff(const TCoeff absCoeff, PQData *pqData) const
-#endif
   {
-#if JVET_N0847_SCALING_LISTS
     int64_t scaledOrg = int64_t( absCoeff ) * quanCoeff;
-#else
-    int64_t scaledOrg = int64_t( absCoeff ) * m_QScale;
-#endif
     TCoeff  qIdx      = std::max<TCoeff>( 1, std::min<TCoeff>( m_maxQIdx, TCoeff( ( scaledOrg + m_QAdd ) >> m_QShift ) ) );
     int64_t scaledAdd = qIdx * m_DistStepAdd - scaledOrg * m_DistOrgFact;
     PQData& pq_a      = pqData[ qIdx & 3 ];
@@ -1050,17 +870,12 @@ namespace DQIntern
       m_goRiceZero    = 0;
     }
 
-#if JVET_N0193_LFNST
     void checkRdCosts( const ScanPosType spt, const PQData& pqDataA, const PQData& pqDataB, Decision& decisionA, Decision& decisionB, bool zeroOut ) const
-#else
-    void checkRdCosts( const ScanPosType spt, const PQData& pqDataA, const PQData& pqDataB, Decision& decisionA, Decision& decisionB) const
-#endif
     {
       const int32_t*  goRiceTab = g_goRiceBits[m_goRicePar];
       int64_t         rdCostA   = m_rdCost + pqDataA.deltaDist;
       int64_t         rdCostB   = m_rdCost + pqDataB.deltaDist;
       int64_t         rdCostZ   = m_rdCost;
-#if JVET_N0193_LFNST
       if( zeroOut )
       {
         rdCostZ = m_rdCost;
@@ -1096,7 +911,6 @@ namespace DQIntern
       }
       else
       {
-#endif
         if( m_remRegBins >= 4 )
         {
           if( pqDataA.absLevel < 4 )
@@ -1160,9 +974,7 @@ namespace DQIntern
           decisionB.absLevel = pqDataB.absLevel;
           decisionB.prevId = m_stateId;
         }
-#if JVET_N0193_LFNST
       }
-#endif
     }
 
     inline void checkRdCostStart(int32_t lastOffset, const PQData &pqData, Decision &decision) const
@@ -1249,13 +1061,6 @@ namespace DQIntern
         m_goRicePar             = prvState->m_goRicePar;
         if( m_remRegBins >= 4 )
         {
-#if !JVET_N0188_UNIFY_RICEPARA
-          TCoeff rem = (decision.absLevel - 4) >> 1;
-          if( m_goRicePar < 3 && rem > (3<<m_goRicePar)-1 )
-          {
-            m_goRicePar++;
-          }
-#endif
           m_remRegBins -= (decision.absLevel < 2 ? decision.absLevel : 3);
         }
         ::memcpy( m_absLevelsAndCtxInit, prvState->m_absLevelsAndCtxInit, 48*sizeof(uint8_t) );
@@ -1272,9 +1077,6 @@ namespace DQIntern
         {
           m_remRegBins = MAX_NUM_REG_BINS_4x4SUBBLOCK - (decision.absLevel < 2 ? decision.absLevel : 3);
         }
-#if !JVET_N0188_UNIFY_RICEPARA
-        m_goRicePar     = ( ((decision.absLevel - 4) >> 1) > (3<<0)-1 ? 1 : 0 );
-#endif
         ::memset( m_absLevelsAndCtxInit, 0, 48*sizeof(uint8_t) );
       }
 
@@ -1322,7 +1124,6 @@ namespace DQIntern
         m_sigFracBits = m_sigFracBitsArray[scanInfo.sigCtxOffsetNext + (sumAbs1 < 5 ? sumAbs1 : 5)];
         m_coeffFracBits = m_gtxFracBitsArray[scanInfo.gtxCtxOffsetNext + (sumGt1 < 4 ? sumGt1 : 4)];
 
-#if JVET_N0188_UNIFY_RICEPARA
         TCoeff  sumAbs = m_absLevelsAndCtxInit[8 + scanInfo.nextInsidePos] >> 8;
 #define UPDATE(k) {TCoeff t=levels[scanInfo.nextNbInfoSbb.inPos[k]]; sumAbs+=t; }
         if (numIPos == 1)
@@ -1358,7 +1159,6 @@ namespace DQIntern
 #undef UPDATE
         int sumAll = std::max(std::min(31, (int)sumAbs - 4 * 5), 0);
         m_goRicePar = g_auiGoRiceParsCoeff[sumAll];
-#endif
       }
       else
       {
@@ -1523,22 +1323,12 @@ namespace DQIntern
   public:
     DepQuant();
 
-#if JVET_N0847_SCALING_LISTS
     void    quant   ( TransformUnit& tu, const CCoeffBuf& srcCoeff, const ComponentID compID, const QpParam& cQP, const double lambda, const Ctx& ctx, TCoeff& absSum, bool enableScalingLists, int* quantCoeff );
     void    dequant ( const TransformUnit& tu, CoeffBuf& recCoeff, const ComponentID compID, const QpParam& cQP, bool enableScalingLists, int* quantCoeff );
-#else
-    void    quant   ( TransformUnit& tu, const CCoeffBuf& srcCoeff, const ComponentID compID, const QpParam& cQP, const double lambda, const Ctx& ctx, TCoeff& absSum );
-    void    dequant ( const TransformUnit& tu,  CoeffBuf& recCoeff, const ComponentID compID, const QpParam& cQP )  const;
-#endif
 
   private:
-#if JVET_N0847_SCALING_LISTS
     void    xDecideAndUpdate  ( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut, int quantCoeff);
     void    xDecide           ( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut, int quantCoeff );
-#else
-    void    xDecideAndUpdate  ( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut );
-    void    xDecide           ( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut );
-#endif
 
   private:
     CommonCtx   m_commonCtx;
@@ -1565,17 +1355,9 @@ namespace DQIntern
 #undef TINIT
 
 
-#if JVET_N0847_SCALING_LISTS
   void DepQuant::dequant( const TransformUnit& tu,  CoeffBuf& recCoeff, const ComponentID compID, const QpParam& cQP, bool enableScalingLists, int* piDequantCoef )
-#else
-  void DepQuant::dequant( const TransformUnit& tu,  CoeffBuf& recCoeff, const ComponentID compID, const QpParam& cQP ) const
-#endif
   {
-#if JVET_N0847_SCALING_LISTS
     m_quant.dequantBlock( tu, compID, cQP, recCoeff, enableScalingLists, piDequantCoef );
-#else
-    m_quant.dequantBlock( tu, compID, cQP, recCoeff );
-#endif
   }
 
 
@@ -1584,48 +1366,19 @@ namespace DQIntern
 #undef  DINIT
 
 
-#if JVET_N0847_SCALING_LISTS
   void DepQuant::xDecide( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut, int quanCoeff)
-#else
-  void DepQuant::xDecide( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut)
-#endif
   {
     ::memcpy( decisions, startDec, 8*sizeof(Decision) );
 
-#if !JVET_N0193_LFNST
-    if( zeroOut )
-    {
-      if( spt==SCAN_EOCSBB )
-      {
-        m_skipStates[0].checkRdCostSkipSbbZeroOut( decisions[0] );
-        m_skipStates[1].checkRdCostSkipSbbZeroOut( decisions[1] );
-        m_skipStates[2].checkRdCostSkipSbbZeroOut( decisions[2] );
-        m_skipStates[3].checkRdCostSkipSbbZeroOut( decisions[3] );
-      }
-      return;
-    }
-#endif
 
     PQData  pqData[4];
-#if JVET_N0847_SCALING_LISTS
     m_quant.preQuantCoeff( absCoeff, pqData, quanCoeff );
-#else
-    m_quant.preQuantCoeff( absCoeff, pqData );
-#endif
-#if JVET_N0193_LFNST
     m_prevStates[0].checkRdCosts( spt, pqData[0], pqData[2], decisions[0], decisions[2], zeroOut );
     m_prevStates[1].checkRdCosts( spt, pqData[0], pqData[2], decisions[2], decisions[0], zeroOut );
     m_prevStates[2].checkRdCosts( spt, pqData[3], pqData[1], decisions[1], decisions[3], zeroOut );
     m_prevStates[3].checkRdCosts( spt, pqData[3], pqData[1], decisions[3], decisions[1], zeroOut );
-#else
-    m_prevStates[0].checkRdCosts( spt, pqData[0], pqData[2], decisions[0], decisions[2]);
-    m_prevStates[1].checkRdCosts( spt, pqData[0], pqData[2], decisions[2], decisions[0]);
-    m_prevStates[2].checkRdCosts( spt, pqData[3], pqData[1], decisions[1], decisions[3]);
-    m_prevStates[3].checkRdCosts( spt, pqData[3], pqData[1], decisions[3], decisions[1]);
-#endif
     if( spt==SCAN_EOCSBB )
     {
-#if JVET_N0193_LFNST
       if( zeroOut )
       {
         m_skipStates[0].checkRdCostSkipSbbZeroOut( decisions[0] );
@@ -1635,41 +1388,26 @@ namespace DQIntern
       }
       else
       {
-#endif
         m_skipStates[0].checkRdCostSkipSbb( decisions[0] );
         m_skipStates[1].checkRdCostSkipSbb( decisions[1] );
         m_skipStates[2].checkRdCostSkipSbb( decisions[2] );
         m_skipStates[3].checkRdCostSkipSbb( decisions[3] );
-#if JVET_N0193_LFNST
       }
-#endif
     }
-#if JVET_N0193_LFNST
     if( !zeroOut )
     {
-#endif
     m_startState.checkRdCostStart( lastOffset, pqData[0], decisions[0] );
     m_startState.checkRdCostStart( lastOffset, pqData[2], decisions[2] );
-#if JVET_N0193_LFNST
     }
-#endif
   }
 
-#if JVET_N0847_SCALING_LISTS
   void DepQuant::xDecideAndUpdate( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut, int quantCoeff )
-#else
-  void DepQuant::xDecideAndUpdate( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut )
-#endif
   {
     Decision* decisions = m_trellis[ scanInfo.scanIdx ];
 
     std::swap( m_prevStates, m_currStates );
 
-#if JVET_N0847_SCALING_LISTS
     xDecide( scanInfo.spt, absCoeff, lastOffset(scanInfo.scanIdx), decisions, zeroOut, quantCoeff );
-#else
-    xDecide( scanInfo.spt, absCoeff, lastOffset(scanInfo.scanIdx), decisions, zeroOut );
-#endif
 
     if( scanInfo.scanIdx )
     {
@@ -1682,11 +1420,7 @@ namespace DQIntern
         m_currStates[3].updateStateEOS( scanInfo, m_prevStates, m_skipStates, decisions[3] );
         ::memcpy( decisions+4, decisions, 4*sizeof(Decision) );
       }
-#if !JVET_N0193_LFNST
-      else if( !zeroOut )
-#else
       else
-#endif
       {
         switch( scanInfo.nextNbInfoSbb.num )
         {
@@ -1736,11 +1470,7 @@ namespace DQIntern
   }
 
 
-#if JVET_N0847_SCALING_LISTS
   void DepQuant::quant( TransformUnit& tu, const CCoeffBuf& srcCoeff, const ComponentID compID, const QpParam& cQP, const double lambda, const Ctx& ctx, TCoeff& absSum, bool enableScalingLists, int* quantCoeff )
-#else
-  void DepQuant::quant( TransformUnit& tu, const CCoeffBuf& srcCoeff, const ComponentID compID, const QpParam& cQP, const double lambda, const Ctx& ctx, TCoeff& absSum )
-#endif
   {
     CHECKD( tu.cs->sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag(), "ext precision is not supported" );
 
@@ -1753,13 +1483,10 @@ namespace DQIntern
     ::memset( tu.getCoeffs( compID ).buf, 0x00, numCoeff*sizeof(TCoeff) );
     absSum          = 0;
 
-#if JVET_N0193_LFNST
     const CompArea& area     = tu.blocks[ compID ];
     const uint32_t  width    = area.width;
     const uint32_t  height   = area.height;
     const uint32_t  lfnstIdx = tu.cu->lfnstIdx;
-#endif
-#if JVET_N0847_SCALING_LISTS
     //===== scaling matrix ====
     //const int         qpDQ = cQP.Qp + 1;
     //const int         qpPer = qpDQ / 6;
@@ -1776,22 +1503,16 @@ namespace DQIntern
       zeroOut = (effHeight < tuPars.m_height || effWidth < tuPars.m_width);
     }
     zeroOutforThres = zeroOut || (32 < tuPars.m_height || 32 < tuPars.m_width);
-#endif
     //===== find first test position =====
     int firstTestPos = numCoeff - 1;
-#if JVET_N0193_LFNST
     if( lfnstIdx > 0 && tu.mtsIdx != MTS_SKIP && ( ( width == 4 && height == 4 ) || ( width == 8 && height == 8 ) ) )
     {
       firstTestPos = 7;
     }
-#endif
-#if JVET_N0847_SCALING_LISTS 
     const TCoeff defaultQuantisationCoefficient = (TCoeff)m_quant.getQScale();
-#endif
     const TCoeff thres = m_quant.getLastThreshold();
     for( ; firstTestPos >= 0; firstTestPos-- )
     {
-#if JVET_N0847_SCALING_LISTS 
       if (zeroOutforThres && (tuPars.m_scanId2BlkPos[firstTestPos].x >= ((tuPars.m_width == 32 && zeroOut) ? 16 : 32)
 			                     || tuPars.m_scanId2BlkPos[firstTestPos].y >= ((tuPars.m_height == 32 && zeroOut) ? 16 : 32))) 
         continue;
@@ -1799,9 +1520,6 @@ namespace DQIntern
 			                                       : TCoeff(thres / (4 * defaultQuantisationCoefficient));
 
       if (abs(tCoeff[tuPars.m_scanId2BlkPos[firstTestPos].idx]) > thresTmp)
-#else
-      if (abs(tCoeff[tuPars.m_scanId2BlkPos[firstTestPos].idx]) > thres)
-#endif
       {
         break;
       }
@@ -1820,25 +1538,13 @@ namespace DQIntern
     }
     m_startState.init();
 
-#if !JVET_N0847_SCALING_LISTS 
-    int effWidth = tuPars.m_width, effHeight = tuPars.m_height;
-    bool zeroOut = false;
-    if( ( tu.mtsIdx > MTS_SKIP || ( tu.cu->sbtInfo != 0 && tuPars.m_height <= 32 && tuPars.m_width <= 32 ) ) && !tu.cu->transQuantBypass && compID == COMPONENT_Y )
-    {
-      effHeight = ( tuPars.m_height == 32 ) ? 16 : tuPars.m_height;
-      effWidth = ( tuPars.m_width == 32 ) ? 16 : tuPars.m_width;
-      zeroOut  = ( effHeight < tuPars.m_height || effWidth < tuPars.m_width );
-    }
-#endif
 
     //===== populate trellis =====
     for( int scanIdx = firstTestPos; scanIdx >= 0; scanIdx-- )
     {
       const ScanInfo& scanInfo = tuPars.m_scanInfo[ scanIdx ];
-#if JVET_N0193_LFNST
       bool lfnstZeroOut = lfnstIdx > 0 && tu.mtsIdx != MTS_SKIP && width >= 4 && height >= 4 &&
         ( ( ( ( width >= 8 && height >= 8 ) && scanIdx >= 16 ) || ( ( ( width == 4 && height == 4 ) || ( width == 8 && height == 8 ) ) && scanIdx >= 8 ) ) && scanIdx < 48 );
-#if JVET_N0847_SCALING_LISTS
       if (enableScalingLists)
       {
         m_quant.initQuantBlock(tu, compID, cQP, lambda, quantCoeff[scanInfo.rasterPos]);
@@ -1846,12 +1552,6 @@ namespace DQIntern
 	    }
       else
         xDecideAndUpdate( abs( tCoeff[scanInfo.rasterPos]), scanInfo, (zeroOut && (scanInfo.posX >= effWidth || scanInfo.posY >= effHeight)) || lfnstZeroOut, defaultQuantisationCoefficient );
-#else
-      xDecideAndUpdate( abs( tCoeff[ scanInfo.rasterPos ] ), scanInfo, ( zeroOut && ( scanInfo.posX >= effWidth || scanInfo.posY >= effHeight ) ) || lfnstZeroOut );
-#endif
-#else
-      xDecideAndUpdate( abs( tCoeff[ scanInfo.rasterPos ] ), scanInfo, zeroOut && ( scanInfo.posX >= effWidth || scanInfo.posY >= effHeight ) );
-#endif
     }
 
     //===== find best path =====
@@ -1902,13 +1602,8 @@ DepQuant::~DepQuant()
 
 void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx )
 {
-#if JVET_N0280_RESIDUAL_CODING_TS
   if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx != MTS_SKIP || !isLuma(compID)) )
-#else
-  if( tu.cs->slice->getDepQuantEnabledFlag() )
-#endif
   {
-#if JVET_N0847_SCALING_LISTS
     //===== scaling matrix ====
     const int         qpDQ            = cQP.Qp + 1;
     const int         qpPer           = qpDQ / 6;
@@ -1922,9 +1617,6 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff
     const uint32_t    log2TrHeight    = g_aucLog2[height];
     const bool        enableScalingLists = getUseScalingList(width, height, tu.mtsIdx == MTS_SKIP);
     static_cast<DQIntern::DepQuant*>(p)->quant( tu, pSrc, compID, cQP, Quant::m_dLambda, ctx, uiAbsSum, enableScalingLists, Quant::getQuantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
-#else
-    static_cast<DQIntern::DepQuant*>(p)->quant( tu, pSrc, compID, cQP, Quant::m_dLambda, ctx, uiAbsSum );
-#endif
   }
   else
   {
@@ -1934,13 +1626,8 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff
 
 void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const ComponentID &compID, const QpParam &cQP )
 {
-#if JVET_N0280_RESIDUAL_CODING_TS
   if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx != MTS_SKIP || !isLuma(compID)) )
-#else
-  if( tu.cs->slice->getDepQuantEnabledFlag() )
-#endif
   {
-#if JVET_N0847_SCALING_LISTS
     const int         qpDQ            = cQP.Qp + 1;
     const int         qpPer           = qpDQ / 6;
     const int         qpRem           = qpDQ - 6 * qpPer;
@@ -1954,9 +1641,6 @@ void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const Compo
 
     const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx == MTS_SKIP));
     static_cast<DQIntern::DepQuant*>(p)->dequant( tu, dstCoeff, compID, cQP, enableScalingLists, Quant::getDequantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
-#else
-    static_cast<DQIntern::DepQuant*>(p)->dequant( tu, dstCoeff, compID, cQP );
-#endif
   }
   else
   {
diff --git a/source/Lib/CommonLib/Hash.cpp b/source/Lib/CommonLib/Hash.cpp
index 86806b62c..27b64987e 100644
--- a/source/Lib/CommonLib/Hash.cpp
+++ b/source/Lib/CommonLib/Hash.cpp
@@ -109,12 +109,10 @@ TComHash::TComHash()
 {
   m_lookupTable = NULL;
   tableHasContent = false;
-#if JVET_N0247_HASH_IMPROVE
   for (int i = 0; i < 5; i++)
   {
     hashPic[i] = NULL;
   }
-#endif
 }
 
 TComHash::~TComHash()
@@ -126,7 +124,6 @@ TComHash::~TComHash()
     m_lookupTable = NULL;
   }
 }
-#if JVET_N0247_HASH_IMPROVE
 void TComHash::create(int picWidth, int picHeight)
 {
   if (m_lookupTable)
@@ -144,15 +141,6 @@ void TComHash::create(int picWidth, int picHeight)
   {
     return;
   }
-#else
-void TComHash::create()
-{
-  if (m_lookupTable != NULL)
-  {
-    clearAll();
-    return;
-  }
-#endif
   int maxAddr = 1 << (m_CRCBits + m_blockSizeBits);
   m_lookupTable = new std::vector<BlockHash>*[maxAddr];
   memset(m_lookupTable, 0, sizeof(std::vector<BlockHash>*) * maxAddr);
@@ -161,7 +149,6 @@ void TComHash::create()
 
 void TComHash::clearAll()
 {
-#if JVET_N0247_HASH_IMPROVE
   if (hashPic[0])
   {
     for (int k = 0; k < 5; k++)
@@ -170,7 +157,6 @@ void TComHash::clearAll()
       hashPic[k] = NULL;
     }
   }
-#endif
   tableHasContent = false;
   if (m_lookupTable == NULL)
   {
@@ -286,85 +272,6 @@ void TComHash::generateBlock2x2HashValue(const PelUnitBuf &curPicBuf, int picWid
 
   delete[] p;
 }
-#if !JVET_N0247_HASH_IMPROVE
-void TComHash::generateRectangleHashValue(int picWidth, int picHeight, int width, int height, uint32_t* srcPicBlockHash[2], uint32_t* dstPicBlockHash[2], bool* srcPicBlockSameInfo[3], bool* dstPicBlockSameInfo[3])
-{
-  //at present, only support 1:2(2:1) retangle hash value
-  CHECK(width != (height << 1) && (width << 1) != height, "Wrong")
-  bool isHorizontal = width == (height << 1) ? true : false;
-
-  int xEnd = picWidth - width + 1;
-  int yEnd = picHeight - height + 1;
-
-  int srcWidth = width >> 1;
-  int quadWidth = width >> 2;
-  int srcHeight = height >> 1;
-  int quadHeight = height >> 2;
-
-  int length = 2 * sizeof(uint32_t);
-  uint32_t* p = new uint32_t[2];
-  int pos = 0;
-  if (isHorizontal)
-  {
-    for (int yPos = 0; yPos < yEnd; yPos++)
-    {
-      for (int xPos = 0; xPos < xEnd; xPos++)
-      {
-        p[0] = srcPicBlockHash[0][pos];
-        p[1] = srcPicBlockHash[0][pos + srcWidth];
-        dstPicBlockHash[0][pos] = TComHash::getCRCValue1((unsigned char*)p, length);
-
-        p[0] = srcPicBlockHash[1][pos];
-        p[1] = srcPicBlockHash[1][pos + srcWidth];
-        dstPicBlockHash[1][pos] = TComHash::getCRCValue2((unsigned char*)p, length);
-
-        dstPicBlockSameInfo[0][pos] = srcPicBlockSameInfo[0][pos] && srcPicBlockSameInfo[0][pos + quadWidth] && srcPicBlockSameInfo[0][pos + srcWidth];
-        dstPicBlockSameInfo[1][pos] = srcPicBlockSameInfo[1][pos] && srcPicBlockSameInfo[1][pos + srcWidth];
-        pos++;
-      }
-      pos += width - 1;
-    }
-  }
-  else
-  {
-    for (int yPos = 0; yPos < yEnd; yPos++)
-    {
-      for (int xPos = 0; xPos < xEnd; xPos++)
-      {
-        p[0] = srcPicBlockHash[0][pos];
-        p[1] = srcPicBlockHash[0][pos + srcHeight * picWidth];
-        dstPicBlockHash[0][pos] = TComHash::getCRCValue1((unsigned char*)p, length);
-
-        p[0] = srcPicBlockHash[1][pos];
-        p[1] = srcPicBlockHash[1][pos + srcHeight * picWidth];
-        dstPicBlockHash[1][pos] = TComHash::getCRCValue2((unsigned char*)p, length);
-
-        dstPicBlockSameInfo[0][pos] = srcPicBlockSameInfo[0][pos] && srcPicBlockSameInfo[0][pos + srcHeight * picWidth];
-        dstPicBlockSameInfo[1][pos] = srcPicBlockSameInfo[1][pos] && srcPicBlockSameInfo[1][pos + quadHeight * picWidth] && srcPicBlockSameInfo[1][pos + srcHeight * picWidth];
-
-        pos++;
-      }
-      pos += width - 1;
-    }
-  }
-
-  int widthMinus1 = width - 1;
-  int heightMinus1 = height - 1;
-  pos = 0;
-
-  for (int yPos = 0; yPos < yEnd; yPos++)
-  {
-    for (int xPos = 0; xPos < xEnd; xPos++)
-    {
-      dstPicBlockSameInfo[2][pos] = (!dstPicBlockSameInfo[0][pos] && !dstPicBlockSameInfo[1][pos]) || (((xPos & widthMinus1) == 0) && ((yPos & heightMinus1) == 0));
-      pos++;
-    }
-    pos += width - 1;
-  }
-
-  delete[] p;
-}
-#endif
 
 void TComHash::generateBlockHashValue(int picWidth, int picHeight, int width, int height, uint32_t* srcPicBlockHash[2], uint32_t* dstPicBlockHash[2], bool* srcPicBlockSameInfo[3], bool* dstPicBlockSameInfo[3])
 {
@@ -409,21 +316,13 @@ void TComHash::generateBlockHashValue(int picWidth, int picHeight, int width, in
 
   if (width >= 4)
   {
-#if !JVET_N0247_HASH_IMPROVE
-    int widthMinus1 = width - 1;
-    int heightMinus1 = height - 1;
-#endif
     pos = 0;
 
     for (int yPos = 0; yPos < yEnd; yPos++)
     {
       for (int xPos = 0; xPos < xEnd; xPos++)
       {
-#if JVET_N0247_HASH_IMPROVE
         dstPicBlockSameInfo[2][pos] = (!dstPicBlockSameInfo[0][pos] && !dstPicBlockSameInfo[1][pos]);
-#else
-        dstPicBlockSameInfo[2][pos] = (!dstPicBlockSameInfo[0][pos] && !dstPicBlockSameInfo[1][pos]) || (((xPos & widthMinus1) == 0) && ((yPos & heightMinus1) == 0));
-#endif
         pos++;
       }
       pos += width - 1;
@@ -447,18 +346,14 @@ void TComHash::addToHashMapByRowWithPrecalData(uint32_t* picHash[2], bool* picIs
   addValue <<= m_CRCBits;
   int crcMask = 1 << m_CRCBits;
   crcMask -= 1;
-#if JVET_N0247_HASH_IMPROVE
   int blockIdx = g_aucLog2[width] - 2;
-#endif
 
   for (int xPos = 0; xPos < xEnd; xPos++)
   {
     for (int yPos = 0; yPos < yEnd; yPos++)
     {
       int pos = yPos * picWidth + xPos;
-#if JVET_N0247_HASH_IMPROVE
       hashPic[blockIdx][pos] = (uint16_t)(srcHash[1][pos] & crcMask);
-#endif
       //valid data
       if (srcIsAdded[pos])
       {
@@ -606,7 +501,6 @@ bool TComHash::isBlock2x2ColSameValue(unsigned char* p, bool includeAllComponent
 
   return true;
 }
-#if JVET_N0247_HASH_IMPROVE
 bool TComHash::isHorizontalPerfectLuma(const Pel* srcPel, int stride, int width, int height)
 {
   for (int i = 0; i < height; i++)
@@ -637,7 +531,6 @@ bool TComHash::isVerticalPerfectLuma(const Pel* srcPel, int stride, int width, i
   }
   return true;
 }
-#endif
 bool TComHash::getBlockHashValue(const PelUnitBuf &curPicBuf, int width, int height, int xStart, int yStart, const BitDepths bitDepths, uint32_t& hashValue1, uint32_t& hashValue2)
 {
   int addValue = m_blockSizeToIndex[width][height];
@@ -792,10 +685,6 @@ void TComHash::initBlockSizeToIndex()
   m_blockSizeToIndex[32][32] = 2;
   m_blockSizeToIndex[64][64] = 3;
   m_blockSizeToIndex[4][4] = 4;
-#if !JVET_N0247_HASH_IMPROVE
-  m_blockSizeToIndex[4][8] = 5;
-  m_blockSizeToIndex[8][4] = 6;
-#endif
 }
 
 uint32_t TComHash::getCRCValue1(unsigned char* p, int length)
diff --git a/source/Lib/CommonLib/Hash.h b/source/Lib/CommonLib/Hash.h
index b86322d90..502c25753 100644
--- a/source/Lib/CommonLib/Hash.h
+++ b/source/Lib/CommonLib/Hash.h
@@ -91,11 +91,7 @@ struct TComHash
 public:
   TComHash();
   ~TComHash();
-#if JVET_N0247_HASH_IMPROVE
   void create(int picWidth, int picHeight);
-#else
-  void create();
-#endif
   void clearAll();
   void addToTable(uint32_t hashValue, const BlockHash& blockHash);
   int count(uint32_t hashValue);
@@ -106,15 +102,10 @@ public:
 
   void generateBlock2x2HashValue(const PelUnitBuf &curPicBuf, int picWidth, int picHeight, const BitDepths bitDepths, uint32_t* picBlockHash[2], bool* picBlockSameInfo[3]);
   void generateBlockHashValue(int picWidth, int picHeight, int width, int height, uint32_t* srcPicBlockHash[2], uint32_t* dstPicBlockHash[2], bool* srcPicBlockSameInfo[3], bool* dstPicBlockSameInfo[3]);
-#if !JVET_N0247_HASH_IMPROVE
-  void generateRectangleHashValue(int picWidth, int picHeight, int width, int height, uint32_t* srcPicBlockHash[2], uint32_t* dstPicBlockHash[2], bool* srcPicBlockSameInfo[3], bool* dstPicBlockSameInfo[3]);
-#endif
   void addToHashMapByRowWithPrecalData(uint32_t* srcHash[2], bool* srcIsSame, int picWidth, int picHeight, int width, int height);
   bool isInitial() { return tableHasContent; }
   void setInitial() { tableHasContent = true; }
-#if JVET_N0247_HASH_IMPROVE
   uint16_t* getHashPic(int baseSize) const { return hashPic[g_aucLog2[baseSize] - 2]; }
-#endif
 
 
 public:
@@ -125,17 +116,13 @@ public:
   static bool isBlock2x2ColSameValue(unsigned char* p, bool includeAllComponent = true);
   static bool getBlockHashValue(const PelUnitBuf &curPicBuf, int width, int height, int xStart, int yStart, const BitDepths bitDepths, uint32_t& hashValue1, uint32_t& hashValue2);
   static void initBlockSizeToIndex();
-#if JVET_N0247_HASH_IMPROVE
   static bool isHorizontalPerfectLuma(const Pel* srcPel, int stride, int width, int height);
   static bool isVerticalPerfectLuma(const Pel* srcPel, int stride, int width, int height);
-#endif
 
 private:
   std::vector<BlockHash>** m_lookupTable;
   bool tableHasContent;
-#if JVET_N0247_HASH_IMPROVE
   uint16_t* hashPic[5];//4x4 ~ 64x64
-#endif
 
 private:
   static const int m_CRCBits = 16;
diff --git a/source/Lib/CommonLib/IbcHashMap.cpp b/source/Lib/CommonLib/IbcHashMap.cpp
index 376f70a1b..9111bdbae 100644
--- a/source/Lib/CommonLib/IbcHashMap.cpp
+++ b/source/Lib/CommonLib/IbcHashMap.cpp
@@ -274,9 +274,7 @@ bool IbcHashMap::ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand,
   // find the block with least candidates
   size_t minSize = MAX_UINT;
   unsigned int targetHashOneBlock = 0;
-#if JVET_N0329_IBC_SEARCH_IMP
   Position targetBlockOffsetInCu(0, 0);
-#endif
   for (SizeType y = 0; y < lumaArea.height && minSize > 1; y += MIN_PU_SIZE)
   {
     for (SizeType x = 0; x < lumaArea.width && minSize > 1; x += MIN_PU_SIZE)
@@ -286,9 +284,7 @@ bool IbcHashMap::ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand,
       {
         minSize = m_hash2Pos[hash].size();
         targetHashOneBlock = hash;
-#if JVET_N0329_IBC_SEARCH_IMP
         targetBlockOffsetInCu.repositionTo(Position(x, y));
-#endif
       }
     }
   }
@@ -300,20 +296,12 @@ bool IbcHashMap::ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand,
     // check whether whole block match
     for (std::vector<Position>::iterator refBlockPos = candOneBlock.begin(); refBlockPos != candOneBlock.end(); refBlockPos++)
     {
-#if JVET_N0329_IBC_SEARCH_IMP
       Position topLeft = refBlockPos->offset(-targetBlockOffsetInCu.x, -targetBlockOffsetInCu.y);
       Position bottomRight = topLeft.offset(lumaArea.width - 1, lumaArea.height - 1);
-#else
-      Position bottomRight = refBlockPos->offset(lumaArea.width - 1, lumaArea.height - 1);
-#endif
       bool wholeBlockMatch = true;
       if (lumaArea.width > MIN_PU_SIZE || lumaArea.height > MIN_PU_SIZE)
       {
-#if JVET_N0329_IBC_SEARCH_IMP
         if (!cs.isDecomp(bottomRight, CHANNEL_TYPE_LUMA) || bottomRight.x >= m_picWidth || bottomRight.y >= m_picHeight || topLeft.x < 0 || topLeft.y < 0)
-#else
-        if (!cs.isDecomp(bottomRight, cs.chType) || bottomRight.x >= m_picWidth || bottomRight.y >= m_picHeight)
-#endif
         {
           continue;
         }
@@ -322,33 +310,21 @@ bool IbcHashMap::ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand,
           for (SizeType x = 0; x < lumaArea.width && wholeBlockMatch; x += MIN_PU_SIZE)
           {
             // whether the reference block and current block has the same hash
-#if JVET_N0329_IBC_SEARCH_IMP
             wholeBlockMatch &= (m_pos2Hash[lumaArea.pos().y + y][lumaArea.pos().x + x] == m_pos2Hash[topLeft.y + y][topLeft.x + x]);
-#else
-            wholeBlockMatch &= (m_pos2Hash[lumaArea.pos().y + y][lumaArea.pos().x + x] == m_pos2Hash[refBlockPos->y + y][refBlockPos->x + x]);
-#endif
           }
         }
       }
       else
       {
-#if JVET_N0329_IBC_SEARCH_IMP
         CHECK(topLeft != *refBlockPos, "4x4 target block should not have offset!");
         if (abs(topLeft.x - lumaArea.x) > searchRange4SmallBlk || abs(topLeft.y - lumaArea.y) > searchRange4SmallBlk || !cs.isDecomp(bottomRight, CHANNEL_TYPE_LUMA))
-#else
-        if (abs(refBlockPos->x - lumaArea.x) > searchRange4SmallBlk || abs(refBlockPos->y - lumaArea.y) > searchRange4SmallBlk || !cs.isDecomp(bottomRight, cs.chType))
-#endif
         {
           continue;
         }
       }
       if (wholeBlockMatch)
       {
-#if JVET_N0329_IBC_SEARCH_IMP
         cand.push_back(topLeft);
-#else
-        cand.push_back(*refBlockPos);
-#endif
         if (cand.size() > maxCand)
         {
           break;
@@ -377,7 +353,6 @@ int IbcHashMap::getHashHitRatio(const Area& lumaArea)
   return 100 * hit / total;
 }
 
-#if JVET_N0329_IBC_SEARCH_IMP
 int IbcHashMap::calHashBlkMatchPerc(const Area& lumaArea)
 {
   int maxX = std::min((int)(lumaArea.x + lumaArea.width), m_picWidth);
@@ -456,5 +431,4 @@ int IbcHashMap::calHashBlkMatchPerc(const Area& lumaArea)
     return 100 * hit / total;
   }
 }
-#endif
 //! \}
diff --git a/source/Lib/CommonLib/IbcHashMap.h b/source/Lib/CommonLib/IbcHashMap.h
index 46074a4b8..205af65ff 100644
--- a/source/Lib/CommonLib/IbcHashMap.h
+++ b/source/Lib/CommonLib/IbcHashMap.h
@@ -82,9 +82,7 @@ public:
   bool    ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk);
   int     getHashHitRatio(const Area& lumaArea);
 
-#if JVET_N0329_IBC_SEARCH_IMP
   int     calHashBlkMatchPerc(const Area& lumaArea);
-#endif
 
 #ifdef TARGET_SIMD_X86
   void    initIbcHashMapX86();
diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp
index e7e6cb5f1..11593f595 100644
--- a/source/Lib/CommonLib/InterPrediction.cpp
+++ b/source/Lib/CommonLib/InterPrediction.cpp
@@ -330,7 +330,6 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R
 
   pu.cu->affine = isAffine;
 }
-#if JVET_N0178_IMPLICIT_BDOF_SPLIT
 void InterPrediction::xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList /*= REF_PIC_LIST_X*/)
 {
   // compute the location of the current PU
@@ -373,7 +372,6 @@ void InterPrediction::xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const R
     }
   }
 }
-#endif
 void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
 {
   // separated tree, chroma
@@ -413,9 +411,7 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
   int iRefIdx = pu.refIdx[eRefPicList];
   Mv mv[3];
   bool isIBC = false;
-#if JVET_N0266_SMALL_BLOCKS
   CHECK( !CU::isIBC( *pu.cu ) && pu.lwidth() == 4 && pu.lheight() == 4, "invalid 4x4 inter blocks" );
-#endif
   if (CU::isIBC(*pu.cu))
   {
     isIBC = true;
@@ -471,17 +467,13 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
 {
   const PPS   &pps   = *pu.cs->pps;
   const Slice &slice = *pu.cs->slice;
-#if JVET_N0266_SMALL_BLOCKS
   CHECK( !pu.cu->affine && pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0 && ( pu.lwidth() + pu.lheight() == 12 ), "invalid 4x8/8x4 bi-predicted blocks" );
-#endif
-#if JVET_N0146_DMVR_BDOF_CONDITION
   WPScalingParam *wp0;
   WPScalingParam *wp1;
   int refIdx0 = pu.refIdx[REF_PIC_LIST_0];
   int refIdx1 = pu.refIdx[REF_PIC_LIST_1];
   pu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
   pu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
-#endif
 
   bool bioApplied = false;
   if (pu.cs->sps->getBDOFEnabledFlag())
@@ -492,20 +484,12 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
     }
     else
     {
-#if JVET_N0146_DMVR_BDOF_CONDITION
       const bool biocheck0 = !((wp0[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag) && slice.getSliceType() == B_SLICE);
-#else
-      const bool biocheck0 = !(pps.getWPBiPred() && slice.getSliceType() == B_SLICE);
-#endif
       const bool biocheck1 = !(pps.getUseWP() && slice.getSliceType() == P_SLICE);
       if (biocheck0
         && biocheck1
         && PU::isBiPredFromDifferentDir(pu)
-#if JVET_N0266_SMALL_BLOCKS
         && pu.Y().height != 4
-#else
-        && !(pu.Y().height == 4 || (pu.Y().width == 4 && pu.Y().height == 8))
-#endif
        )
       {
         bioApplied = true;
@@ -572,7 +556,6 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
       }
     }
   }
-#if JVET_N0146_DMVR_BDOF_CONDITION
   CPelUnitBuf srcPred0 = ( pu.chromaFormat == CHROMA_400 ?
                            CPelUnitBuf(pu.chromaFormat, PelBuf(m_acYuvPred[0][0], pcYuvPred.Y())) :
                            CPelUnitBuf(pu.chromaFormat, PelBuf(m_acYuvPred[0][0], pcYuvPred.Y()), PelBuf(m_acYuvPred[0][1], pcYuvPred.Cb()), PelBuf(m_acYuvPred[0][2], pcYuvPred.Cr())) );
@@ -598,35 +581,6 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
       xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), bioApplied );
     }
   }
-#else
-  if (dmvrApplied)
-  {
-    xProcessDMVR(pu, pcYuvPred, slice.clpRngs(), bioApplied);
-  }
-
-
-  CPelUnitBuf srcPred0 = ( pu.chromaFormat == CHROMA_400 ?
-                           CPelUnitBuf(pu.chromaFormat, PelBuf(m_acYuvPred[0][0], pcYuvPred.Y())) :
-                           CPelUnitBuf(pu.chromaFormat, PelBuf(m_acYuvPred[0][0], pcYuvPred.Y()), PelBuf(m_acYuvPred[0][1], pcYuvPred.Cb()), PelBuf(m_acYuvPred[0][2], pcYuvPred.Cr())) );
-  CPelUnitBuf srcPred1 = ( pu.chromaFormat == CHROMA_400 ?
-                           CPelUnitBuf(pu.chromaFormat, PelBuf(m_acYuvPred[1][0], pcYuvPred.Y())) :
-                           CPelUnitBuf(pu.chromaFormat, PelBuf(m_acYuvPred[1][0], pcYuvPred.Y()), PelBuf(m_acYuvPred[1][1], pcYuvPred.Cb()), PelBuf(m_acYuvPred[1][2], pcYuvPred.Cr())) );
-  if( pps.getWPBiPred() && slice.getSliceType() == B_SLICE )
-  {
-    xWeightedPredictionBi( pu, srcPred0, srcPred1, pcYuvPred, m_maxCompIDToPred );
-  }
-  else if( pps.getUseWP() && slice.getSliceType() == P_SLICE )
-  {
-    xWeightedPredictionUni( pu, srcPred0, REF_PIC_LIST_0, pcYuvPred, -1, m_maxCompIDToPred );
-  }
-  else
-  {
-    if (dmvrApplied == false)
-    {
-    xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), bioApplied );
-    }
-  }
-#endif
 }
 
 void InterPrediction::xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng
@@ -646,7 +600,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
   int shiftHor = MV_FRACTIONAL_BITS_INTERNAL + ::getComponentScaleX(compID, chFmt);
   int shiftVer = MV_FRACTIONAL_BITS_INTERNAL + ::getComponentScaleY(compID, chFmt);
 
-#if JVET_N0070_WRAPAROUND
   bool  wrapRef = false;
   Mv    mv(_mv);
   if( !isIBC && pu.cs->sps->getWrapAroundEnabledFlag() ) 
@@ -655,10 +608,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
   }
   int xFrac = mv.hor & ((1 << shiftHor) - 1);
   int yFrac = mv.ver & ((1 << shiftVer) - 1);
-#else
-  int xFrac = _mv.hor & ((1 << shiftHor) - 1);
-  int yFrac = _mv.ver & ((1 << shiftVer) - 1);
-#endif
   if (isIBC)
   {
     xFrac = yFrac = 0;
@@ -671,25 +620,13 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
 
   CPelBuf refBuf;
   {
-#if JVET_N0070_WRAPAROUND
     Position offset = pu.blocks[compID].pos().offset( mv.getHor() >> shiftHor, mv.getVer() >> shiftVer );
-#else
-    Position offset = pu.blocks[compID].pos().offset( _mv.getHor() >> shiftHor, _mv.getVer() >> shiftVer );
-#endif
     if (dmvrWidth)
     {
-#if JVET_N0070_WRAPAROUND
       refBuf = refPic->getRecoBuf(CompArea(compID, chFmt, offset, Size(dmvrWidth, dmvrHeight)), wrapRef);
-#else
-      refBuf = refPic->getRecoBuf(CompArea(compID, chFmt, offset, Size(dmvrWidth, dmvrHeight)));
-#endif
     }
     else
-#if JVET_N0070_WRAPAROUND
     refBuf = refPic->getRecoBuf( CompArea( compID, chFmt, offset, pu.blocks[compID].size() ), wrapRef);
-#else
-    refBuf = refPic->getRecoBuf( CompArea( compID, chFmt, offset, pu.blocks[compID].size() ) );
-#endif
   }
 
   if (NULL != srcPadBuf)
@@ -783,7 +720,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
   }
 }
 
-#if JVET_N0068_AFFINE_MEM_BW
 bool InterPrediction::isSubblockVectorSpreadOverLimit( int a, int b, int c, int d, int predType )
 {
   int s4 = ( 4 << 11 );
@@ -823,23 +759,8 @@ bool InterPrediction::isSubblockVectorSpreadOverLimit( int a, int b, int c, int
   }
   return false;
 }
-#endif
 void InterPrediction::xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng )
 {
-#if !JVET_N0196_SIX_TAP_FILTERS
-  if ( (pu.cu->affineType == AFFINEMODEL_6PARAM && _mv[0] == _mv[1] && _mv[0] == _mv[2])
-    || (pu.cu->affineType == AFFINEMODEL_4PARAM && _mv[0] == _mv[1])
-    )
-  {
-    Mv mvTemp = _mv[0];
-    clipMv( mvTemp, pu.cu->lumaPos(), pu.cu->lumaSize(), *pu.cs->sps );
-    xPredInterBlk( compID, pu, refPic, mvTemp, dstPic, bi, clpRng
-                  , false
-                  , false
-                  );
-    return;
-  }
-#endif
 
   JVET_J0090_SET_REF_PICTURE( refPic, compID );
   const ChromaFormat chFmt = pu.chromaFormat;
@@ -858,11 +779,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
   int blockHeight = AFFINE_MIN_BLOCK_SIZE;
 
   CHECK(blockWidth  > (width >> iScaleX ), "Sub Block width  > Block width");
-#if JVET_N0671_AFFINE
   CHECK(blockHeight > (height >> iScaleY), "Sub Block height > Block height");
-#else
-  CHECK(blockHeight > (height >> iScaleX), "Sub Block height > Block height");
-#endif //JVET_N0671_AFFINE
   const int MVBUFFER_SIZE = MAX_CU_SIZE / MIN_PU_SIZE;
 
   const int cxWidth  = width  >> iScaleX;
@@ -899,12 +816,8 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
   const int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA;
 
   const int shift = iBit - 4 + MV_FRACTIONAL_BITS_INTERNAL;
-#if JVET_N0070_WRAPAROUND
   bool      wrapRef = false;
-#endif
-#if JVET_N0068_AFFINE_MEM_BW
   const bool subblkMVSpreadOverLimit = isSubblockVectorSpreadOverLimit( iDMvHorX, iDMvHorY, iDMvVerX, iDMvVerY, pu.interDir );
-#endif
 
   // get prediction block by block
   for ( int h = 0; h < cxHeight; h += blockHeight )
@@ -913,26 +826,18 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
     {
 
       int iMvScaleTmpHor, iMvScaleTmpVer;
-#if JVET_N0671_AFFINE
       if (compID == COMPONENT_Y || pu.chromaFormat == CHROMA_444)
-#else
-      if(compID == COMPONENT_Y)
-#endif //JVET_N0671_AFFINE
       {
-#if JVET_N0068_AFFINE_MEM_BW
         if ( !subblkMVSpreadOverLimit )
         {
-#endif
           iMvScaleTmpHor = iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h);
           iMvScaleTmpVer = iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h);
-#if JVET_N0068_AFFINE_MEM_BW
         }
         else
         {
           iMvScaleTmpHor = iMvScaleHor + iDMvHorX * ( cxWidth >> 1 ) + iDMvVerX * ( cxHeight >> 1 );
           iMvScaleTmpVer = iMvScaleVer + iDMvHorY * ( cxWidth >> 1 ) + iDMvVerY * ( cxHeight >> 1 );
         }
-#endif
         roundAffineMv(iMvScaleTmpHor, iMvScaleTmpVer, shift);
         Mv tmpMv(iMvScaleTmpHor, iMvScaleTmpVer);
         tmpMv.clipToStorageBitDepth();
@@ -944,19 +849,13 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
         {
           m_storedMv[h / AFFINE_MIN_BLOCK_SIZE * MVBUFFER_SIZE + w / AFFINE_MIN_BLOCK_SIZE].set(iMvScaleTmpHor, iMvScaleTmpVer);
           Mv tmpMv(iMvScaleTmpHor, iMvScaleTmpVer);
-#if JVET_N0070_WRAPAROUND
           wrapRef = wrapClipMv( tmpMv, Position(pu.Y().x + w, pu.Y().y + h), Size(blockWidth, blockHeight), &sps);
-#else
-          clipMv(tmpMv, Position(pu.Y().x + w, pu.Y().y + h), Size(blockWidth, blockHeight), sps);
-#endif
           iMvScaleTmpHor = tmpMv.getHor();
           iMvScaleTmpVer = tmpMv.getVer();
         }
         else
         {
-#if JVET_N0070_WRAPAROUND
           wrapRef = false;
-#endif
           m_storedMv[h / AFFINE_MIN_BLOCK_SIZE * MVBUFFER_SIZE + w / AFFINE_MIN_BLOCK_SIZE].set(iMvScaleTmpHor, iMvScaleTmpVer);
           iMvScaleTmpHor = std::min<int>(iHorMax, std::max<int>(iHorMin, iMvScaleTmpHor));
           iMvScaleTmpVer = std::min<int>(iVerMax, std::max<int>(iVerMin, iMvScaleTmpVer));
@@ -965,25 +864,15 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
       else
       {
         Mv curMv = m_storedMv[((h << iScaleY) / AFFINE_MIN_BLOCK_SIZE) * MVBUFFER_SIZE + ((w << iScaleX) / AFFINE_MIN_BLOCK_SIZE)] +
-#if JVET_N0671_AFFINE
           m_storedMv[((h << iScaleY) / AFFINE_MIN_BLOCK_SIZE + iScaleY)* MVBUFFER_SIZE + ((w << iScaleX) / AFFINE_MIN_BLOCK_SIZE + iScaleX)];
-#else
-          m_storedMv[((h << iScaleY) / AFFINE_MIN_BLOCK_SIZE + 1)* MVBUFFER_SIZE + ((w << iScaleX) / AFFINE_MIN_BLOCK_SIZE + 1)];
-#endif
         roundAffineMv(curMv.hor, curMv.ver, 1);
         if (sps.getWrapAroundEnabledFlag())
         {
-#if JVET_N0070_WRAPAROUND
           wrapRef = wrapClipMv( curMv, Position(pu.Y().x + (w << iScaleX), pu.Y().y + (h << iScaleY)), Size(blockWidth << iScaleX, blockHeight << iScaleY), &sps);
-#else
-          clipMv(curMv, Position(pu.Y().x + (w << iScaleX), pu.Y().y + (h << iScaleY)), Size(blockWidth << iScaleX, blockHeight << iScaleY), sps);
-#endif
         }
         else
         {
-#if JVET_N0070_WRAPAROUND
           wrapRef = false;
-#endif
           curMv.hor = std::min<int>(iHorMax, std::max<int>(iHorMin, curMv.hor));
           curMv.ver = std::min<int>(iVerMax, std::max<int>(iVerMin, curMv.ver));
         }
@@ -1014,11 +903,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
         yFrac = iMvScaleTmpVer & 31;
       }
 
-#if JVET_N0070_WRAPAROUND
       const CPelBuf refBuf = refPic->getRecoBuf( CompArea( compID, chFmt, pu.blocks[compID].offset(xInt + w, yInt + h), pu.blocks[compID] ), wrapRef );
-#else
-      const CPelBuf refBuf = refPic->getRecoBuf( CompArea( compID, chFmt, pu.blocks[compID].offset(xInt + w, yInt + h), pu.blocks[compID] ) );
-#endif
       PelBuf &dstBuf = dstPic.bufs[compID];
 
       if ( yFrac == 0 )
@@ -1105,11 +990,7 @@ void InterPrediction::applyBiOptFlow(const PredictionUnit &pu, const CPelUnitBuf
   const int   bitDepth = clipBitDepths.recon[toChannelType(COMPONENT_Y)];
   const int   shiftNum = IF_INTERNAL_PREC + 1 - bitDepth;
   const int   offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;
-#if JVET_N0325_BDOF
   const int   limit = (1<<(std::max<int>(5, bitDepth - 7)));
-#else
-  const int   limit = (bitDepth>12)? 2 : ((int)1 << (4 + IF_INTERNAL_PREC - bitDepth - 5));
-#endif
 
   int*     dotProductTemp1 = m_dotProduct1;
   int*     dotProductTemp2 = m_dotProduct2;
@@ -1264,7 +1145,6 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
         pcYuvDst.bufs[0].addAvg(CPelBuf(pSrcY0, src0Stride, pu.lumaSize()), CPelBuf(pSrcY1, src1Stride, pu.lumaSize()), clpRngs.comp[0]);
       }
     }
-#if JVET_N0146_DMVR_BDOF_CONDITION
     if (pu.cs->pps->getWPBiPred())
     {
       const int iRefIdx0 = pu.refIdx[0];
@@ -1283,9 +1163,6 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
     {
       pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, bioApplied);
     }
-#else
-    pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, bioApplied);
-#endif
   }
   else if( iRefIdx0 >= 0 && iRefIdx1 < 0 )
   {
@@ -1353,18 +1230,13 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
   else
   {
 
-#if JVET_N0178_IMPLICIT_BDOF_SPLIT
-#if JVET_N0266_SMALL_BLOCKS
     CHECK( !pu.cu->affine && pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0 && ( pu.lwidth() + pu.lheight() == 12 ), "invalid 4x8/8x4 bi-predicted blocks" );
-#endif
-#if JVET_N0146_DMVR_BDOF_CONDITION
     WPScalingParam *wp0;
     WPScalingParam *wp1;
     int refIdx0 = pu.refIdx[REF_PIC_LIST_0];
     int refIdx1 = pu.refIdx[REF_PIC_LIST_1];
     pu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
     pu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
-#endif
     bool bioApplied = false;
     const Slice &slice = *pu.cs->slice;
     if (pu.cs->sps->getBDOFEnabledFlag())
@@ -1376,20 +1248,12 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
       }
       else
       {
-#if JVET_N0146_DMVR_BDOF_CONDITION
         const bool biocheck0 = !((wp0[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag) && slice.getSliceType() == B_SLICE);
-#else
-        const bool biocheck0 = !(pps.getWPBiPred() && slice.getSliceType() == B_SLICE);
-#endif
         const bool biocheck1 = !(pps.getUseWP() && slice.getSliceType() == P_SLICE);
         if (biocheck0
           && biocheck1
           && PU::isBiPredFromDifferentDir(pu)
-#if JVET_N0266_SMALL_BLOCKS
           && pu.Y().height != 4
-#else
-          && !(pu.Y().height == 4 || (pu.Y().width == 4 && pu.Y().height == 8))
-#endif
           )
         {
           bioApplied = true;
@@ -1416,7 +1280,6 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
       xSubPuBio(pu, predBuf, eRefPicList);
     }
     else
-#endif
     if (pu.mergeType != MRG_TYPE_DEFAULT_N && pu.mergeType != MRG_TYPE_IBC)
     {
       xSubPuMC( pu, predBuf, eRefPicList );
@@ -1551,11 +1414,7 @@ void InterPrediction::xWeightedTriangleBlk( const PredictionUnit &pu, const uint
   const int32_t ratioWH           = (width > height) ? (width / height) : 1;
   const int32_t ratioHW           = (width > height) ? 1 : (height / width);
 
-#if JVET_N0671_INTRA_TPM_ALIGNWITH420
   const bool    longWeight        = (compIdx == COMPONENT_Y);
-#else
-  const bool    longWeight        = (compIdx == COMPONENT_Y) || ( predDst.chromaFormat == CHROMA_444 );
-#endif
   const int32_t weightedLength    = longWeight ? 7 : 3;
         int32_t weightedStartPos  = ( splitDir == 0 ) ? ( 0 - (weightedLength >> 1) * ratioWH ) : ( width - ((weightedLength + 1) >> 1) * ratioWH );
         int32_t weightedEndPos    = weightedStartPos + weightedLength * ratioWH - 1;
@@ -1631,7 +1490,6 @@ void InterPrediction::xPrefetchPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPic
     height += (filtersize - 1);
     cMv += Mv(-(((filtersize >> 1) - 1) << mvshiftTemp),
       -(((filtersize >> 1) - 1) << mvshiftTemp));
-#if JVET_N0070_WRAPAROUND
     bool wrapRef = false;
     if( pu.cs->sps->getWrapAroundEnabledFlag() ) 
     {
@@ -1640,18 +1498,11 @@ void InterPrediction::xPrefetchPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPic
     else {
       clipMv(cMv, pu.lumaPos(), pu.lumaSize(),*pu.cs->sps);
     }
-#else
-    clipMv(cMv, pu.lumaPos(), pu.lumaSize(),*pu.cs->sps);
-#endif
     /* Pre-fetch similar to HEVC*/
     {
       CPelBuf refBuf;
       Position Rec_offset = pu.blocks[compID].pos().offset(cMv.getHor() >> mvshiftTemp, cMv.getVer() >> mvshiftTemp);
-#if JVET_N0070_WRAPAROUND
       refBuf = refPic->getRecoBuf(CompArea((ComponentID)compID, pu.chromaFormat, Rec_offset, pu.blocks[compID].size()), wrapRef);
-#else
-      refBuf = refPic->getRecoBuf(CompArea((ComponentID)compID, pu.chromaFormat, Rec_offset, pu.blocks[compID].size()));
-#endif
       PelBuf &dstBuf = pcPad.bufs[compID];
       g_pelBufOP.copyBuffer((Pel *)refBuf.buf, refBuf.stride, ((Pel *)dstBuf.buf) + offset, dstBuf.stride, width, height);
 #if JVET_J0090_MEMORY_BANDWITH_MEASURE
@@ -2055,19 +1906,13 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con
 
         subPu.mv[0] = mergeMv[REF_PIC_LIST_0] + pu.mvdL0SubPu[num];
         subPu.mv[1] = mergeMv[REF_PIC_LIST_1] - pu.mvdL0SubPu[num];
-#if JVET_N0334_MVCLIPPING
         subPu.mv[0].clipToStorageBitDepth();
         subPu.mv[1].clipToStorageBitDepth();
-#endif
         m_cYuvRefBuffSubCuDMVRL0 = m_cYuvRefBuffDMVRL0.subBuf(UnitAreaRelative(pu, subPu));
         m_cYuvRefBuffSubCuDMVRL1 = m_cYuvRefBuffDMVRL1.subBuf(UnitAreaRelative(pu, subPu));
         xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, bioApplied, mergeMv);
 
         subPredBuf.bufs[COMPONENT_Y].buf  = pcYuvDst.bufs[COMPONENT_Y].buf + xStart + yStart * dstStride[COMPONENT_Y];
-#if !JVET_N0671_DMVR
-        subPredBuf.bufs[COMPONENT_Cb].buf = pcYuvDst.bufs[COMPONENT_Cb].buf + (xStart >> 1) + ((yStart >> 1) * dstStride[COMPONENT_Cb]);
-        subPredBuf.bufs[COMPONENT_Cr].buf = pcYuvDst.bufs[COMPONENT_Cr].buf + (xStart >> 1) + ((yStart >> 1) * dstStride[COMPONENT_Cr]);
-#else
         int scaleX = getComponentScaleX(COMPONENT_Cb, pu.chromaFormat);
         int scaleY =  getComponentScaleY(COMPONENT_Cb, pu.chromaFormat);
         subPredBuf.bufs[COMPONENT_Cb].buf = pcYuvDst.bufs[COMPONENT_Cb].buf + (xStart >> scaleX) + ((yStart >> scaleY) * dstStride[COMPONENT_Cb]);
@@ -2075,7 +1920,6 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con
         scaleX =  getComponentScaleX(COMPONENT_Cr, pu.chromaFormat);
         scaleY =  getComponentScaleY(COMPONENT_Cr, pu.chromaFormat);
         subPredBuf.bufs[COMPONENT_Cr].buf = pcYuvDst.bufs[COMPONENT_Cr].buf + (xStart >> scaleX) + ((yStart >> scaleY) * dstStride[COMPONENT_Cr]);
-#endif // !JVET_N0671_DMVR
 
         xWeightedAverage(subPu, srcPred0, srcPred1, subPredBuf, subPu.cu->slice->getSPS()->getBitDepths(), subPu.cu->slice->clpRngs(), bioApplied);
         num++;
diff --git a/source/Lib/CommonLib/InterPrediction.h b/source/Lib/CommonLib/InterPrediction.h
index 4b8a0a018..7aba3b9a9 100644
--- a/source/Lib/CommonLib/InterPrediction.h
+++ b/source/Lib/CommonLib/InterPrediction.h
@@ -144,9 +144,7 @@ protected:
   static bool xCheckIdenticalMotion( const PredictionUnit& pu );
 
   void xSubPuMC(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X);
-#if JVET_N0178_IMPLICIT_BDOF_SPLIT
   void xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X);
-#endif
   void destroy();
 
 
@@ -190,9 +188,7 @@ public:
 #if ENABLE_SPLIT_PARALLELISM
   int     getShareState() const { return m_shareState; }
 #endif
-#if JVET_N0068_AFFINE_MEM_BW
   static bool isSubblockVectorSpreadOverLimit( int a, int b, int c, int d, int predType );
-#endif
 };
 
 //! \}
diff --git a/source/Lib/CommonLib/InterpolationFilter.cpp b/source/Lib/CommonLib/InterpolationFilter.cpp
index 0b82e1573..373980494 100644
--- a/source/Lib/CommonLib/InterpolationFilter.cpp
+++ b/source/Lib/CommonLib/InterpolationFilter.cpp
@@ -54,7 +54,6 @@ CacheModel* InterpolationFilter::m_cacheModel;
 // ====================================================================================================================
 // Tables
 // ====================================================================================================================
-#if JVET_N0196_SIX_TAP_FILTERS
 const TFilterCoeff InterpolationFilter::m_lumaFilter4x4[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
 {
   {  0, 0,   0, 64,  0,   0,  0,  0 },
@@ -74,7 +73,6 @@ const TFilterCoeff InterpolationFilter::m_lumaFilter4x4[LUMA_INTERPOLATION_FILTE
   {  0, 1,  -3,  8, 62,  -5,  1,  0 },
   {  0, 1,  -2,  4, 63,  -3,  1,  0 }
 };
-#endif
 
 const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
 {
@@ -247,11 +245,7 @@ void InterpolationFilter::filterCopy( const ClpRng& clpRng, const Pel *src, int
     {
       for (col = 0; col < width; col++)
       {
-#if HM_JEM_CLIP_PEL
         dst[col] = src[col];
-#else
-        dst[col] = ClipPel( src[col], clpRng );
-#endif
         JVET_J0090_CACHE_ACCESS( &src[col], __FILE__, __LINE__ );
       }
 
@@ -595,18 +589,14 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
     }
     else
     {
-#if JVET_N0196_SIX_TAP_FILTERS
       if ((width == 4 && height == 4) || (width == 4 && height == (4 + NTAPS_LUMA - 1)))
       {
         filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter4x4[frac], biMCForDMVR);
       }
       else
       {
-#endif
       filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac], biMCForDMVR);
-#if JVET_N0196_SIX_TAP_FILTERS
       }
-#endif
     }
   }
   else
@@ -649,18 +639,14 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
     }
     else
     {
-#if JVET_N0196_SIX_TAP_FILTERS
       if (width == 4 && height == 4)
       {
         filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter4x4[frac], biMCForDMVR);
       }
       else
       {
-#endif
       filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac], biMCForDMVR);
-#if JVET_N0196_SIX_TAP_FILTERS
       }
-#endif
     }
   }
   else
diff --git a/source/Lib/CommonLib/InterpolationFilter.h b/source/Lib/CommonLib/InterpolationFilter.h
index 8e9f96e87..bb0d4120f 100644
--- a/source/Lib/CommonLib/InterpolationFilter.h
+++ b/source/Lib/CommonLib/InterpolationFilter.h
@@ -55,9 +55,7 @@
  */
 class InterpolationFilter
 {
-#if JVET_N0196_SIX_TAP_FILTERS
   static const TFilterCoeff m_lumaFilter4x4[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA];
-#endif
   static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps
   static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
   static const TFilterCoeff m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_BILINEAR]; ///< bilinear filter taps
diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp
index 964c7a911..dc2e88902 100644
--- a/source/Lib/CommonLib/IntraPrediction.cpp
+++ b/source/Lib/CommonLib/IntraPrediction.cpp
@@ -294,11 +294,7 @@ void IntraPrediction::predIntraAng( const ComponentID compId, PelBuf &piPred, co
   const ChannelType    channelType  = toChannelType( compID );
   const int            iWidth       = piPred.width;
   const int            iHeight      = piPred.height;
-#if JVET_N0413_RDPCM
   const uint32_t       uiDirMode    = isLuma( compId ) && pu.cu->bdpcmMode ? BDPCM_IDX : PU::getFinalIntraMode( pu, channelType );
-#else
-  const uint32_t       uiDirMode    = PU::getFinalIntraMode( pu, channelType );
-#endif
 
   CHECK( g_aucLog2[iWidth] < 2 && pu.cs->pcv->noChroma2x2, "Size not allowed" );
   CHECK( g_aucLog2[iWidth] > 7, "Size not allowed" );
@@ -317,9 +313,7 @@ void IntraPrediction::predIntraAng( const ComponentID compId, PelBuf &piPred, co
   {
     case(PLANAR_IDX): xPredIntraPlanar(srcBuf, piPred); break;
     case(DC_IDX):     xPredIntraDc(srcBuf, piPred, channelType, false); break;
-#if JVET_N0413_RDPCM
     case(BDPCM_IDX):  xPredIntraBDPCM(srcBuf, piPred, pu.cu->bdpcmMode, clpRng); break;
-#endif
     default:          xPredIntraAng(srcBuf, piPred, channelType, clpRng); break;
   }
 
@@ -519,11 +513,7 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
 
   // high level conditions and DC intra prediction
   if(   sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()
-#if JVET_N0671_INTRA_TPM_ALIGNWITH420
     || !isLuma( chType )
-#else
-    || ( !isLuma( chType ) && pu.chromaFormat != CHROMA_444 )
-#endif
     || useISP
     || m_ipaParam.multiRefIndex
     || DC_IDX == dirMode
@@ -534,12 +524,10 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
       m_ipaParam.interpolationFlag = (m_ipaParam.isModeVer ? puSize.width : puSize.height) > 8 ? true : false ;
     }
   }
-#if JVET_N0413_RDPCM
   else if (isLuma( chType ) && pu.cu->bdpcmMode) // BDPCM
   {
     m_ipaParam.refFilterFlag = false;
   }
-#endif
   else if (dirMode == PLANAR_IDX) // Planar intra prediction
   {
     m_ipaParam.refFilterFlag = puSize.width * puSize.height > 32 ? true : false;
@@ -564,11 +552,7 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
     if (filterFlag)
     {
       const bool isRefFilter       =  isIntegerSlope(absAng);
-#if JVET_N0435_WAIP_HARMONIZATION
       m_ipaParam.refFilterFlag = isRefFilter && puSize.width * puSize.height > 32;
-#else
-      m_ipaParam.refFilterFlag     =  isRefFilter;
-#endif
       m_ipaParam.interpolationFlag = !isRefFilter;
     }
   }
@@ -792,7 +776,6 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch
   }
 }
 
-#if JVET_N0413_RDPCM
 void IntraPrediction::xPredIntraBDPCM(const CPelBuf &pSrc, PelBuf &pDst, const uint32_t dirMode, const ClpRng& clpRng )
 {
   const int wdt = pDst.width;
@@ -829,14 +812,12 @@ void IntraPrediction::xPredIntraBDPCM(const CPelBuf &pSrc, PelBuf &pDst, const u
     }
   }
 }
-#endif
 
 bool IntraPrediction::useDPCMForFirstPassIntraEstimation(const PredictionUnit &pu, const uint32_t &uiDirMode)
 {
   return CU::isRDPCMEnabled(*pu.cu) && pu.cu->transQuantBypass && (uiDirMode == HOR_IDX || uiDirMode == VER_IDX);
 }
 
-#if JVET_N0302_SIMPLFIED_CIIP
 void IntraPrediction::geneWeightedPred(const ComponentID compId, PelBuf &pred, const PredictionUnit &pu, Pel *srcBuf)
 {
   const int            width = pred.width;
@@ -877,90 +858,6 @@ void IntraPrediction::geneWeightedPred(const ComponentID compId, PelBuf &pred, c
     }
   }
 }
-#else
-void IntraPrediction::geneWeightedPred(const ComponentID compId, PelBuf &pred, const PredictionUnit &pu, Pel *srcBuf)
-{
-  const int            width = pred.width;
-  const int            height = pred.height;
-  const int            srcStride = width;
-  const int            dstStride = pred.stride;
-
-  const uint32_t       dirMode = PU::getFinalIntraMode(pu, toChannelType(compId));
-  const ClpRng&        clpRng(pu.cu->cs->slice->clpRng(compId));
-  Pel*                 dstBuf = pred.buf;
-  int                  k, l;
-
-  bool                 modeDC = (dirMode <= DC_IDX);
-  Pel                  wIntra1 = 6, wInter1 = 2, wIntra2 = 5, wInter2 = 3, wIntra3 = 3, wInter3 = 5, wIntra4 = 2, wInter4 = 6;
-
-  if (modeDC || width < 4 || height < 4)
-  {
-    for (k = 0; k<height; k++)
-    {
-      for (l = 0; l<width; l++)
-      {
-        dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * 4) + (srcBuf[k*srcStride + l] * 4)) >> 3), clpRng);
-      }
-    }
-  }
-  else
-  {
-    if (dirMode <= DIA_IDX)
-    {
-      int interval = (width >> 2);
-
-      for (k = 0; k<height; k++)
-      {
-        for (l = 0; l<width; l++)
-        {
-          if (l<interval)
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter1) + (srcBuf[k*srcStride + l] * wIntra1)) >> 3), clpRng);
-          }
-          else if (l >= interval && l < (2 * interval))
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter2) + (srcBuf[k*srcStride + l] * wIntra2)) >> 3), clpRng);
-          }
-          else if (l >= (interval * 2) && l < (3 * interval))
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter3) + (srcBuf[k*srcStride + l] * wIntra3)) >> 3), clpRng);
-          }
-          else
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter4) + (srcBuf[k*srcStride + l] * wIntra4)) >> 3), clpRng);
-          }
-        }
-      }
-    }
-    else
-    {
-      int interval = (height >> 2);
-      for (k = 0; k<height; k++)
-      {
-        for (l = 0; l<width; l++)
-        {
-          if (k<interval)
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter1) + (srcBuf[k*srcStride + l] * wIntra1)) >> 3), clpRng);
-          }
-          else if (k >= interval && k < (2 * interval))
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter2) + (srcBuf[k*srcStride + l] * wIntra2)) >> 3), clpRng);
-          }
-          else if (k >= (interval * 2) && k < (3 * interval))
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter3) + (srcBuf[k*srcStride + l] * wIntra3)) >> 3), clpRng);
-          }
-          else
-          {
-            dstBuf[k*dstStride + l] = ClipPel((((dstBuf[k*dstStride + l] * wInter4) + (srcBuf[k*srcStride + l] * wIntra4)) >> 3), clpRng);
-          }
-        }
-      }
-    }
-  }
-}
-#endif
 void IntraPrediction::switchBuffer(const PredictionUnit &pu, ComponentID compID, PelBuf srcBuff, Pel *dst)
 {
   Pel  *src = srcBuff.bufAt(0, 0);
@@ -1293,43 +1190,6 @@ void IntraPrediction::xFilterReferenceSamples( const Pel* refBufUnfiltered, Pel*
   const int  predStride = predSize + 1;
 
 
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  // Strong intra smoothing
-  ChannelType chType = toChannelType( area.compID );
-  if( sps.getUseStrongIntraSmoothing() && isLuma( chType ) )
-  {
-    const Pel bottomLeft = refBufUnfiltered[predStride * predHSize];
-    const Pel topLeft    = refBufUnfiltered[0];
-    const Pel topRight   = refBufUnfiltered[predSize];
-
-    const int  threshold     = 1 << (sps.getBitDepth( chType ) - 5);
-    const bool bilinearLeft  = abs( (bottomLeft + topLeft)  - (2 * refBufUnfiltered[predStride * tuHeight]) ) < threshold; //difference between the
-    const bool bilinearAbove = abs( (topLeft    + topRight) - (2 * refBufUnfiltered[             tuWidth ]) ) < threshold; //ends and the middle
-
-    if( tuWidth >= 32 && tuHeight >= 32 && bilinearLeft && bilinearAbove )
-#if !HEVC_USE_INTRA_SMOOTHING_T32
-    if( tuWidth > 32 && tuHeight > 32 )
-#endif
-#if !HEVC_USE_INTRA_SMOOTHING_T64
-    if( tuWidth < 64 && tuHeight < 64 )
-#endif
-    {
-      Pel *piDestPtr = refBufFiltered + (predStride * predHSize); // bottom left
-
-      // apply strong intra smoothing
-      for (int i = 0; i < predHSize; i++, piDestPtr -= predStride) //left column (bottom to top)
-      {
-        *piDestPtr = (((predHSize - i) * bottomLeft) + (i * topLeft) + predHSize / 2) / predHSize;
-      }
-      for( uint32_t i = 0; i <= predSize; i++, piDestPtr++ )            //full top row (left-to-right)
-      {
-        *piDestPtr = (((predSize - i) * topLeft) + (i * topRight) + predSize / 2) / predSize;
-      }
-
-      return;
-    }
-  }
-#endif
 
   // Regular reference sample filter
   const Pel *piSrcPtr  = refBufUnfiltered + (predStride * predHSize); // bottom left
@@ -1516,13 +1376,8 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
   //assert 420 chroma subsampling
   CompArea lumaArea = CompArea( COMPONENT_Y, pu.chromaFormat, chromaArea.lumaPos(), recalcSize( pu.chromaFormat, CHANNEL_TYPE_CHROMA, CHANNEL_TYPE_LUMA, chromaArea.size() ) );//needed for correct pos/size (4x4 Tus)
 
-#if JVET_N0671_CCLM
   CHECK(lumaArea.width == chromaArea.width && CHROMA_444 != pu.chromaFormat, "");
   CHECK(lumaArea.height == chromaArea.height && CHROMA_444 != pu.chromaFormat && CHROMA_422 != pu.chromaFormat, "");
-#else
-  CHECK( lumaArea.width  == chromaArea.width, "" );
-  CHECK( lumaArea.height == chromaArea.height, "" );
-#endif //JVET_N0671_CCLM
 
   const SizeType uiCWidth = chromaArea.width;
   const SizeType uiCHeight = chromaArea.height;
@@ -1530,15 +1385,11 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
   const CPelBuf Src = pu.cs->picture->getRecoBuf( lumaArea );
   Pel const* pRecSrc0   = Src.bufAt( 0, 0 );
   int iRecStride        = Src.stride;
-#if JVET_N0671_CCLM
   int logSubWidthC  = getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, pu.chromaFormat);
   int logSubHeightC = getChannelTypeScaleY(CHANNEL_TYPE_CHROMA, pu.chromaFormat);
 
   int iRecStride2       = iRecStride << logSubHeightC;
   const int mult        =          1 << logSubWidthC ;
-#else //!JVET_N0671_CCLM
-  int iRecStride2       = iRecStride << 1;
-#endif //JVET_N0671_CCLM
 
   const CodingUnit& lumaCU = isChroma( pu.chType ) ? *pu.cs->picture->cs->getCU( lumaArea.pos(), CH_L ) : *pu.cu;
   const CodingUnit&     cu = *pu.cu;
@@ -1551,22 +1402,14 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
   int iBaseUnitSize = ( 1 << MIN_CU_LOG2 );
 
   const int  iUnitWidth       = iBaseUnitSize >> getComponentScaleX( area.compID, area.chromaFormat );
-#if JVET_N0671_CHROMA_FORMAT_422
   const int  iUnitHeight = iBaseUnitSize >> getComponentScaleY(area.compID, area.chromaFormat);
-#else
-  const int  iUnitHeight = iBaseUnitSize >> getComponentScaleX(area.compID, area.chromaFormat);
-#endif // JVET_REXT_CLEANUP_CCLM_422
 
   const int  iTUWidthInUnits = uiTuWidth / iUnitWidth;
   const int  iTUHeightInUnits = uiTuHeight / iUnitHeight;
   const int  iAboveUnits      = iTUWidthInUnits;
   const int  iLeftUnits       = iTUHeightInUnits;
   const int  chromaUnitWidth = iBaseUnitSize >> getComponentScaleX(COMPONENT_Cb, area.chromaFormat);
-#if JVET_N0671_CHROMA_FORMAT_422
   const int  chromaUnitHeight = iBaseUnitSize >> getComponentScaleY(COMPONENT_Cb, area.chromaFormat);
-#else
-  const int  chromaUnitHeight = iBaseUnitSize >> getComponentScaleX(COMPONENT_Cb, area.chromaFormat);
-#endif // JVET_REXT_CLEANUP_CCLM_422
   const int  topTemplateSampNum = 2 * uiCWidth; // for MDLM, the number of template samples is 2W or 2H.
   const int  leftTemplateSampNum = 2 * uiCHeight;
   assert(m_topRefLength >= topTemplateSampNum);
@@ -1607,7 +1450,6 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
   Pel const* piSrc = nullptr;
 
   bool isFirstRowOfCtu = ((pu.block(COMPONENT_Cb).y)&(((pu.cs->sps)->getMaxCUWidth() >> 1) - 1)) == 0;
-#if JVET_N0671_CCLM
   const int strOffset = (CHROMA_444 == pu.chromaFormat) ? 0 : iRecStride;
 
   int c0_2tap = 1, c1_2tap = 1,                                                     offset_2tap = 1, shift_2tap = 1; //sum = 2
@@ -1617,14 +1459,12 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
 
   switch (pu.chromaFormat)
   {
-#if JVET_N0671_CHROMA_FORMAT_422
     case CHROMA_422: //overwrite filter coefficient values for 422
       c0_2tap = 1, c1_2tap = 0,                                                     offset_2tap = 0, shift_2tap = 0; //sum = 1
       c0_3tap = 2, c1_3tap = 1, c2_3tap = 1,                                        offset_3tap = 2, shift_3tap = 2; //sum = 4
       c0_5tap = 0, c1_5tap = 1, c2_5tap = 0, c3_5tap = 0, c4_5tap = 0,              offset_5tap = 0, shift_5tap = 0; //sum = 1
       c0_6tap = 2, c1_6tap = 1, c2_6tap = 1, c3_6tap = 0, c4_6tap = 0, c5_6tap = 0, offset_6tap = 2, shift_6tap = 2; //sum = 4
       break;
-#endif //JVET_N0671_CHROMA_FORMAT_422
 
     case CHROMA_444:  //overwrite filter coefficient values for 422
       c0_2tap = 1, c1_2tap = 0,                                                     offset_2tap = 0, shift_2tap = 0; //sum = 1
@@ -1636,7 +1476,6 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
     default:
       break;
   }
-#endif //JVET_N0671_CCLM
 
   if( bAboveAvaillable )
   {
@@ -1652,85 +1491,44 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
       {
         piSrc = pRecSrc0 - iRecStride;
 
-#if JVET_N0671_CCLM
         if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth + addedAboveRight - 1 + logSubWidthC))
-#else //!JVET_N0671_CCLM
-        if (i == 0 && !bLeftAvaillable)
-#endif //JVET_N0671_CCLM
         {
-#if JVET_N0671_CCLM
           pDst[i] = piSrc[mult * i];
-#else //!JVET_N0671_CCLM
-          pDst[i] = piSrc[2 * i];
-#endif //JVET_N0671_CCLM
         }
         else
         {
-#if JVET_N0671_CCLM
           pDst[i] = (piSrc[mult * i] * c0_3tap + piSrc[mult * i - 1] * c1_3tap + piSrc[mult * i + 1] * c2_3tap + offset_3tap) >> shift_3tap;
-#else //!JVET_N0671_CCLM
-          pDst[i] = ( piSrc[2 * i] * 2 + piSrc[2 * i - 1] + piSrc[2 * i + 1] + 2 ) >> 2;
-#endif //JVET_N0671_CCLM
         }
       }
       else if( pu.cs->sps->getCclmCollocatedChromaFlag() )
       {
         piSrc = pRecSrc0 - iRecStride2;
 
-#if JVET_N0671_CCLM
         if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth + addedAboveRight - 1 + logSubWidthC))
-#else //!JVET_N0671_CCLM
-        if( i == 0 && !bLeftAvaillable )
-#endif //JVET_N0671_CCLM
         {
-#if JVET_N0671_CCLM
           pDst[i] = (piSrc[mult * i] * c0_3tap + piSrc[mult * i - strOffset] * c1_3tap + piSrc[mult * i + strOffset] * c2_3tap + offset_3tap) >> shift_3tap;
-#else //!JVET_N0671_CCLM
-          pDst[i] = ( piSrc[2 * i] * 2 + piSrc[2 * i - iRecStride] + piSrc[2 * i + iRecStride] + 2 ) >> 2;
-#endif //JVET_N0671_CCLM
         }
         else
         {
-#if JVET_N0671_CCLM
           pDst[i] = (piSrc[mult * i - strOffset] * c0_5tap
                   +  piSrc[mult * i]             * c1_5tap + piSrc[mult * i - 1] * c2_5tap + piSrc[mult * i + 1] * c3_5tap
                   +  piSrc[mult * i + strOffset] * c4_5tap
                   +  offset_5tap) >> shift_5tap;
-#else //!JVET_N0671_CCLM
-          pDst[i] = ( piSrc[2 * i - iRecStride]
-                    + piSrc[2 * i             ] * 4 + piSrc[2 * i - 1] + piSrc[2 * i + 1]
-                    + piSrc[2 * i + iRecStride]
-                    + 4 ) >> 3;
-#endif //JVET_N0671_CCLM
         }
       }
       else
       {
         piSrc = pRecSrc0 - iRecStride2;
 
-#if JVET_N0671_CCLM
         if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth + addedAboveRight - 1 + logSubWidthC))
-#else //!JVET_N0671_CCLM
-        if (i == 0 && !bLeftAvaillable)
-#endif //JVET_N0671_CCLM
         {
-#if JVET_N0671_CCLM
           pDst[i] = (piSrc[mult * i] * c0_2tap + piSrc[mult * i + strOffset] * c1_2tap + offset_2tap) >> shift_2tap;
-#else //!JVET_N0671_CCLM
-          pDst[i] = ( piSrc[2 * i] + piSrc[2 * i + iRecStride] + 1 ) >> 1;
-#endif //JVET_N0671_CCLM
         }
         else
         {
-#if JVET_N0671_CCLM
           pDst[i] = ((piSrc[mult * i]            * c0_6tap + piSrc[mult * i - 1]             * c1_6tap + piSrc[mult * i + 1]             * c2_6tap)
                   + (piSrc[mult * i + strOffset] * c3_6tap + piSrc[mult * i - 1 + strOffset] * c4_6tap + piSrc[mult * i + 1 + strOffset] * c5_6tap)
                   + offset_6tap) >> shift_6tap;
-#else //!JVET_N0671_CCLM
-          pDst[i] = ( ( ( piSrc[2 * i             ] * 2 ) + piSrc[2 * i - 1             ] + piSrc[2 * i + 1             ] )
-                    + ( ( piSrc[2 * i + iRecStride] * 2 ) + piSrc[2 * i - 1 + iRecStride] + piSrc[2 * i + 1 + iRecStride] )
-                    + 4 ) >> 3;
-#endif //JVET_N0671_CCLM
         }
       }
     }
@@ -1740,11 +1538,7 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
   {
     pDst  = pDst0    - 1;
 
-#if JVET_N0671_CCLM
     piSrc = pRecSrc0 - 2 - logSubWidthC;
-#else //!JVET_N0671_CCLM
-    piSrc = pRecSrc0 - 3;
-#endif //JVET_N0671_CCLM
 
     int addedLeftBelow = 0;
     if ((curChromaMode == MDLM_L_IDX) || (curChromaMode == MDLM_T_IDX))
@@ -1756,42 +1550,23 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
     {
       if( pu.cs->sps->getCclmCollocatedChromaFlag() )
       {
-#if JVET_N0671_CCLM
         if ((j == 0 && !bAboveAvaillable) || (j == uiCHeight + addedLeftBelow - 1 + logSubWidthC))
         {
           pDst[0] = ( piSrc[1] * c0_3tap + piSrc[0] * c1_3tap + piSrc[2] * c2_3tap + offset_3tap) >> shift_3tap;
-#else //!JVET_N0671_CCLM
-        if ( j == 0 && !bAboveAvaillable )
-        {
-          pDst[0] = ( piSrc[1] * 2 + piSrc[0] + piSrc[2] + 2 ) >> 2;
-#endif //JVET_N0671_CCLM
         }
         else
         {
-#if JVET_N0671_CCLM
           pDst[0] = ( piSrc[1 - strOffset] * c0_5tap
                     + piSrc[1            ] * c1_5tap + piSrc[0] * c2_5tap + piSrc[2] * c3_5tap
                     + piSrc[1 + strOffset] * c4_5tap
                     + offset_5tap ) >> shift_5tap;
-#else //!JVET_N0671_CCLM
-          pDst[0] = ( piSrc[1 - iRecStride]
-                    + piSrc[1             ] * 4 + piSrc[0] + piSrc[2]
-                    + piSrc[1 + iRecStride]
-                    + 4 ) >> 3;
-#endif //JVET_N0671_CCLM
         }
       }
       else
       {
-#if JVET_N0671_CCLM
         pDst[0] = ((piSrc[1]             * c0_6tap + piSrc[0]         * c1_6tap + piSrc[2]             * c2_6tap)
                 +  (piSrc[1 + strOffset] * c3_6tap + piSrc[strOffset] * c4_6tap + piSrc[2 + strOffset] * c5_6tap)
                 +   offset_6tap) >> shift_6tap;
-#else //!JVET_N0671_CCLM
-        pDst[0] = ( ( piSrc[1             ] * 2 + piSrc[0         ] + piSrc[2             ] )
-                  + ( piSrc[1 + iRecStride] * 2 + piSrc[iRecStride] + piSrc[2 + iRecStride] )
-                  + 4 ) >> 3;
-#endif //JVET_N0671_CCLM
       }
 
       piSrc += iRecStride2;
@@ -1810,74 +1585,37 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
         {
           if ( j == 0 && !bAboveAvaillable )
           {
-#if JVET_N0671_CCLM
             pDst0[i] = pRecSrc0[mult * i];
-#else //!JVET_N0671_CCLM
-            pDst0[i] = pRecSrc0[2 * i];
-#endif //JVET_N0671_CCLM
           }
           else
           {
-#if JVET_N0671_CCLM
             pDst0[i] = (pRecSrc0[mult * i] * c0_3tap + pRecSrc0[mult * i - strOffset] * c1_3tap + pRecSrc0[mult * i + strOffset] * c2_3tap + offset_3tap) >> shift_3tap;
-#else //!JVET_N0671_CCLM
-            pDst0[i] = ( pRecSrc0[2 * i] * 2 + pRecSrc0[2 * i - iRecStride] + pRecSrc0[2 * i + iRecStride] + 2 ) >> 2;
-#endif //JVET_N0671_CCLM
           }
         }
-#if JVET_N0671_CCLM
-        else if ( j == 0 && !bAboveAvaillable )
-#else //JVET_N0671_CCLM
         else if ( j == 0 && !bAboveAvaillable )
-#endif //JVET_N0671_CCLM
         {
-#if JVET_N0671_CCLM
           pDst0[i] = (pRecSrc0[mult * i] * c0_3tap + pRecSrc0[mult * i - 1] * c1_3tap + pRecSrc0[mult * i + 1] * c2_3tap + offset_3tap) >> shift_3tap;
-#else //!JVET_N0671_CCLM
-          pDst0[i] = ( pRecSrc0[2 * i] * 2 + pRecSrc0[2 * i - 1] + pRecSrc0[2 * i + 1] + 2 ) >> 2;
-#endif //JVET_N0671_CCLM
         }
         else
         {
-#if JVET_N0671_CCLM
           pDst0[i] = (pRecSrc0[mult * i - strOffset] * c0_5tap
                    +  pRecSrc0[mult * i]             * c1_5tap + pRecSrc0[mult * i - 1] * c2_5tap + pRecSrc0[mult * i + 1] * c3_5tap
                    +  pRecSrc0[mult * i + strOffset] * c4_5tap
                    +  offset_5tap) >> shift_5tap;
-#else //!JVET_N0671_CCLM
-          pDst0[i] = ( pRecSrc0[2 * i - iRecStride]
-                     + pRecSrc0[2 * i             ] * 4 + pRecSrc0[2 * i - 1] + pRecSrc0[2 * i + 1]
-                     + pRecSrc0[2 * i + iRecStride]
-                     + 4 ) >> 3;
-#endif //JVET_N0671_CCLM
         }
       }
       else
       {
 
-#if JVET_N0671_CCLM
         if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth - 1 + logSubWidthC))
-#else //JVET_N0671_CCLM
-        if ( i == 0 && !bLeftAvaillable )
-#endif //JVET_N0671_CCLM
         {
-#if JVET_N0671_CCLM
           pDst0[i] = (pRecSrc0[mult * i] * c0_2tap + pRecSrc0[mult * i + strOffset] * c1_2tap + offset_2tap) >> shift_2tap;
-#else //!JVET_N0671_CCLM
-          pDst0[i] = ( pRecSrc0[2 * i] + pRecSrc0[2 * i + iRecStride] + 1 ) >> 1;
-#endif //JVET_N0671_CCLM
         }
         else
         {
-#if JVET_N0671_CCLM
           pDst0[i] = (pRecSrc0[mult * i]             * c0_6tap + pRecSrc0[mult * i + 1]             * c1_6tap + pRecSrc0[mult * i - 1]             * c2_6tap
                     + pRecSrc0[mult * i + strOffset] * c3_6tap + pRecSrc0[mult * i + 1 + strOffset] * c4_6tap + pRecSrc0[mult * i - 1 + strOffset] * c5_6tap
                     + offset_6tap) >> shift_6tap;
-#else //!JVET_N0671_CCLM
-          pDst0[i] = ( pRecSrc0[2 * i             ] * 2 + pRecSrc0[2 * i + 1             ] + pRecSrc0[2 * i - 1             ]
-                     + pRecSrc0[2 * i + iRecStride] * 2 + pRecSrc0[2 * i + 1 + iRecStride] + pRecSrc0[2 * i - 1 + iRecStride]
-                     + 4 ) >> 3;
-#endif //JVET_N0671_CCLM
         }
       }
     }
@@ -1980,43 +1718,25 @@ void IntraPrediction::xGetLMParameters(const PredictionUnit &pu, const Component
 
   Pel *src = srcColor0 - srcStride;
   Pel *cur = curChroma0 - curStride;
-#if !JVET_N0271_SIMPLFIED_CCLM
-  int minDim = 1;
-#endif
   int actualTopTemplateSampNum = 0;
   int actualLeftTemplateSampNum = 0;
   if (curChromaMode == MDLM_T_IDX)
   {
     leftAvailable = 0;
-#if JVET_N0271_SIMPLFIED_CCLM
     avaiAboveRightUnits = avaiAboveRightUnits > (cHeight/unitWidth) ?  cHeight/unitWidth : avaiAboveRightUnits;
-#endif
     actualTopTemplateSampNum = unitWidth*(avaiAboveUnits + avaiAboveRightUnits);
-#if !JVET_N0271_SIMPLFIED_CCLM
-    minDim = actualTopTemplateSampNum;
-#endif
   }
   else if (curChromaMode == MDLM_L_IDX)
   {
     aboveAvailable = 0;
-#if JVET_N0271_SIMPLFIED_CCLM
     avaiLeftBelowUnits = avaiLeftBelowUnits > (cWidth/unitHeight) ? cWidth/unitHeight : avaiLeftBelowUnits;
-#endif
     actualLeftTemplateSampNum = unitHeight*(avaiLeftUnits + avaiLeftBelowUnits);
-#if !JVET_N0271_SIMPLFIED_CCLM
-    minDim = actualLeftTemplateSampNum;
-#endif
   }
   else if (curChromaMode == LM_CHROMA_IDX)
   {
     actualTopTemplateSampNum = cWidth;
     actualLeftTemplateSampNum = cHeight;
-#if !JVET_N0271_SIMPLFIED_CCLM
-    minDim = leftAvailable && aboveAvailable ? 1 << g_aucPrevLog2[std::min(actualLeftTemplateSampNum, actualTopTemplateSampNum)]
-      : 1 << g_aucPrevLog2[leftAvailable ? actualLeftTemplateSampNum : actualTopTemplateSampNum];
-#endif
   }
-#if JVET_N0271_SIMPLFIED_CCLM
   int startPos[2]; //0:Above, 1: Left
   int pickStep[2];
 
@@ -2081,50 +1801,6 @@ void IntraPrediction::xGetLMParameters(const PredictionUnit &pu, const Component
   minLuma[1] = (selectChromaPix[tmpMinGrp[0]] + selectChromaPix[tmpMinGrp[1]] + 1) >> 1;
   maxLuma[0] = (selectLumaPix[tmpMaxGrp[0]] + selectLumaPix[tmpMaxGrp[1]] + 1 )>>1;
   maxLuma[1] = (selectChromaPix[tmpMaxGrp[0]] + selectChromaPix[tmpMaxGrp[1]] + 1) >> 1;
-#else
-  int numSteps = minDim;
-
-  if (aboveAvailable)
-  {
-    for (int j = 0; j < numSteps; j++)
-    {
-      int idx = (j * actualTopTemplateSampNum) / minDim;
-
-      if (minLuma[0] > src[idx])
-      {
-        minLuma[0] = src[idx];
-        minLuma[1] = cur[idx];
-      }
-      if (maxLuma[0] < src[idx])
-      {
-        maxLuma[0] = src[idx];
-        maxLuma[1] = cur[idx];
-      }
-    }
-  }
-
-  if (leftAvailable)
-  {
-    src = srcColor0 - 1;
-    cur = curChroma0 - 1;
-
-    for (int i = 0; i < numSteps; i++)
-    {
-      int idx = (i * actualLeftTemplateSampNum) / minDim;
-
-      if (minLuma[0] > src[srcStride * idx])
-      {
-        minLuma[0] = src[srcStride * idx];
-        minLuma[1] = cur[curStride * idx];
-      }
-      if (maxLuma[0] < src[srcStride * idx])
-      {
-        maxLuma[0] = src[srcStride * idx];
-        maxLuma[1] = cur[curStride * idx];
-      }
-    }
-  }
-#endif
 
   if (leftAvailable || aboveAvailable)
   {
@@ -2169,7 +1845,6 @@ void IntraPrediction::xGetLMParameters(const PredictionUnit &pu, const Component
   }
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 void IntraPrediction::initIntraMip( const PredictionUnit &pu )
 {
   CHECK( pu.lwidth() > MIP_MAX_WIDTH || pu.lheight() > MIP_MAX_HEIGHT, "Error: block size not supported for MIP" );
@@ -2191,6 +1866,5 @@ void IntraPrediction::predIntraMip( const ComponentID compId, PelBuf &piPred, co
   const int bitDepth = pu.cu->slice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
   m_matrixIntraPred.predBlock( pu.Y(), pu.intraDir[CHANNEL_TYPE_LUMA], piPred, bitDepth );
 }
-#endif
 
 //! \}
diff --git a/source/Lib/CommonLib/IntraPrediction.h b/source/Lib/CommonLib/IntraPrediction.h
index 668fdc8f8..2d29ec29b 100644
--- a/source/Lib/CommonLib/IntraPrediction.h
+++ b/source/Lib/CommonLib/IntraPrediction.h
@@ -44,9 +44,7 @@
 #include "Buffer.h"
 #include "Picture.h"
 
-#if JVET_N0217_MATRIX_INTRAPRED
 #include "MatrixIntraPrediction.h"
-#endif
 
 //! \ingroup CommonLib
 //! \{
@@ -105,9 +103,7 @@ private:
 
   Pel* m_piTemp;
   Pel* m_pMdlmTemp; // for MDLM mode
-#if JVET_N0217_MATRIX_INTRAPRED
   MatrixIntraPrediction m_matrixIntraPred;
-#endif
 
 protected:
 
@@ -122,15 +118,9 @@ protected:
 
   void initPredIntraParams        ( const PredictionUnit & pu,  const CompArea compArea, const SPS& sps );
 
-#if JVET_N0435_WAIP_HARMONIZATION
   static bool isIntegerSlope(const int absAng) { return (0 == (absAng & 0x1F)); }
-#else
-  static bool isIntegerSlope      ( const int absAng ) { return (0 == (absAng & 0x1F)) && absAng <=32; }  //  integer-slope modes 2, DIA_IDX and VDIA_IDX.  "absAng <=32" restricts wide-angle integer modes
-#endif
 
-#if JVET_N0413_RDPCM
   void xPredIntraBDPCM            ( const CPelBuf &pSrc, PelBuf &pDst, const uint32_t dirMode, const ClpRng& clpRng );
-#endif
   Pel  xGetPredValDc              ( const CPelBuf &pSrc, const Size &dstSize );
 
   void xFillReferenceSamples      ( const CPelBuf &recoBuf,      Pel* refBufUnfiltered, const CompArea &area, const CodingUnit &cu );
@@ -160,11 +150,9 @@ public:
   /// set parameters from CU data for accessing intra data
   void initIntraPatternChType     (const CodingUnit &cu, const CompArea &area, const bool forceRefFilterFlag = false); // use forceRefFilterFlag to get both filtered and unfiltered buffers
 
-#if JVET_N0217_MATRIX_INTRAPRED
   // Matrix-based intra prediction
   void initIntraMip               (const PredictionUnit &pu);
   void predIntraMip               (const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu);
-#endif
 
   static bool useDPCMForFirstPassIntraEstimation(const PredictionUnit &pu, const uint32_t &uiDirMode);
 
diff --git a/source/Lib/CommonLib/LoopFilter.cpp b/source/Lib/CommonLib/LoopFilter.cpp
index 2e3ed1c99..88925c202 100644
--- a/source/Lib/CommonLib/LoopFilter.cpp
+++ b/source/Lib/CommonLib/LoopFilter.cpp
@@ -148,10 +148,8 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
                                 )
 {
   const PreCalcValues& pcv = *cs.pcv;
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
   m_shiftHor = ::getComponentScaleX( COMPONENT_Cb, cs.pcv->chrFormat );
   m_shiftVer = ::getComponentScaleY( COMPONENT_Cb, cs.pcv->chrFormat );
-#endif
 
   DTRACE_UPDATE( g_trace_ctx, ( std::make_pair( "poc", cs.slice->getPOC() ) ) );
 #if ENABLE_TRACING
@@ -172,13 +170,11 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
     {
       memset( m_aapucBS       [EDGE_VER].data(), 0,     m_aapucBS       [EDGE_VER].byte_size() );
       memset( m_aapbEdgeFilter[EDGE_VER].data(), false, m_aapbEdgeFilter[EDGE_VER].byte_size() );
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
       memset( m_maxFilterLengthP, 0, sizeof(m_maxFilterLengthP) );
       memset( m_maxFilterLengthQ, 0, sizeof(m_maxFilterLengthQ) );
       memset( m_transformEdge, false, sizeof(m_transformEdge) );
       m_ctuXLumaSamples = x << pcv.maxCUWidthLog2;
       m_ctuYLumaSamples = y << pcv.maxCUHeightLog2;
-#endif
 
       const UnitArea ctuArea( pcv.chrFormat, Area( x << pcv.maxCUWidthLog2, y << pcv.maxCUHeightLog2, pcv.maxCUWidth, pcv.maxCUWidth ) );
 
@@ -192,11 +188,9 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
       {
         memset( m_aapucBS       [EDGE_VER].data(), 0,     m_aapucBS       [EDGE_VER].byte_size() );
         memset( m_aapbEdgeFilter[EDGE_VER].data(), false, m_aapbEdgeFilter[EDGE_VER].byte_size() );
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
         memset( m_maxFilterLengthP, 0, sizeof(m_maxFilterLengthP) );
         memset( m_maxFilterLengthQ, 0, sizeof(m_maxFilterLengthQ) );
         memset( m_transformEdge, false, sizeof(m_transformEdge) );
-#endif
 
         for( auto &currCU : cs.traverseCUs( CS::getArea( cs, ctuArea, CH_C ), CH_C ) )
         {
@@ -213,13 +207,11 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
     {
       memset( m_aapucBS       [EDGE_HOR].data(), 0,     m_aapucBS       [EDGE_HOR].byte_size() );
       memset( m_aapbEdgeFilter[EDGE_HOR].data(), false, m_aapbEdgeFilter[EDGE_HOR].byte_size() );
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
       memset( m_maxFilterLengthP, 0, sizeof(m_maxFilterLengthP) );
       memset( m_maxFilterLengthQ, 0, sizeof(m_maxFilterLengthQ) );
       memset( m_transformEdge, false, sizeof(m_transformEdge) );
       m_ctuXLumaSamples = x << pcv.maxCUWidthLog2;
       m_ctuYLumaSamples = y << pcv.maxCUHeightLog2;
-#endif
 
       const UnitArea ctuArea( pcv.chrFormat, Area( x << pcv.maxCUWidthLog2, y << pcv.maxCUHeightLog2, pcv.maxCUWidth, pcv.maxCUWidth ) );
 
@@ -233,11 +225,9 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
       {
         memset( m_aapucBS       [EDGE_HOR].data(), 0,     m_aapucBS       [EDGE_HOR].byte_size() );
         memset( m_aapbEdgeFilter[EDGE_HOR].data(), false, m_aapbEdgeFilter[EDGE_HOR].byte_size() );
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
         memset( m_maxFilterLengthP, 0, sizeof(m_maxFilterLengthP) );
         memset( m_maxFilterLengthQ, 0, sizeof(m_maxFilterLengthQ) );
         memset( m_transformEdge, false, sizeof(m_transformEdge) );
-#endif
 
         for( auto &currCU : cs.traverseCUs( CS::getArea( cs, ctuArea, CH_C ), CH_C ) )
         {
@@ -271,38 +261,19 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
   const PreCalcValues& pcv = *cu.cs->pcv;
   const Area area          = cu.Y().valid() ? cu.Y() : Area( recalcPosition( cu.chromaFormat, cu.chType, CHANNEL_TYPE_LUMA, cu.blocks[cu.chType].pos() ), recalcSize( cu.chromaFormat, cu.chType, CHANNEL_TYPE_LUMA, cu.blocks[cu.chType].size() ) );
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool horEdgeFilter = false, verEdgeFilter = false;
   int  numHorVirBndry = 0, numVerVirBndry = 0;
   int  horVirBndryPos[] = { 0, 0, 0 };
   int  verVirBndryPos[] = { 0, 0, 0 };
 
   bool isCuCrossedByVirtualBoundaries = isCrossedByVirtualBoundaries( area.x, area.y, area.width, area.height, numHorVirBndry, numVerVirBndry, horVirBndryPos, verVirBndryPos, cu.cs->slice->getPPS() );
-#endif
 
   xSetLoopfilterParam( cu );
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
   static_vector<int, 2*MAX_CU_SIZE> edgeIdx;
   edgeIdx.clear();
-#else
-  bool implicitTU = false;
-#endif
   for( auto &currTU : CU::traverseTUs( cu ) )
   {
     const Area& areaTu    = cu.Y().valid() ? currTU.block( COMPONENT_Y ) : area;
-#if !JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-    const bool xOff = currTU.blocks[cu.chType].x != cu.blocks[cu.chType].x;
-    const bool yOff = currTU.blocks[cu.chType].y != cu.blocks[cu.chType].y;
-    if ((yOff != 0) && (edgeDir == EDGE_HOR))
-    {
-      implicitTU = true;
-    }
-    if ((xOff != 0) && (edgeDir == EDGE_VER))
-    {
-      implicitTU = true;
-    }
-#endif
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND 
     verEdgeFilter = m_stLFCUParam.internalEdge;
     horEdgeFilter = m_stLFCUParam.internalEdge;
     if( isCuCrossedByVirtualBoundaries )
@@ -311,14 +282,8 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
     }
     xSetEdgefilterMultiple( cu, EDGE_VER, areaTu, verEdgeFilter );
     xSetEdgefilterMultiple( cu, EDGE_HOR, areaTu, horEdgeFilter );
-#else
-    xSetEdgefilterMultiple( cu, EDGE_VER, areaTu, m_stLFCUParam.internalEdge );
-    xSetEdgefilterMultiple( cu, EDGE_HOR, areaTu, m_stLFCUParam.internalEdge );
-#endif
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
     xSetMaxFilterLengthPQFromTransformSizes( edgeDir, cu, currTU );
     edgeIdx.push_back( ( edgeDir == EDGE_HOR ) ? ( currTU.blocks[cu.chType].y - cu.blocks[cu.chType].y ) / 4 : ( currTU.blocks[cu.chType].x - cu.blocks[cu.chType].x ) / 4 );
-#endif
   }
 
   bool mvSubBlocks = false;
@@ -329,7 +294,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
     const bool xOff    = currPU.blocks[cu.chType].x != cu.blocks[cu.chType].x;
     const bool yOff    = currPU.blocks[cu.chType].y != cu.blocks[cu.chType].y;
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND 
     verEdgeFilter = (xOff ? m_stLFCUParam.internalEdge : m_stLFCUParam.leftEdge);
     horEdgeFilter = (yOff ? m_stLFCUParam.internalEdge : m_stLFCUParam.topEdge);
     if( isCuCrossedByVirtualBoundaries )
@@ -339,13 +303,7 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
 
     xSetEdgefilterMultiple( cu, EDGE_VER, areaPu, verEdgeFilter, xOff );
     xSetEdgefilterMultiple( cu, EDGE_HOR, areaPu, horEdgeFilter, yOff );
-#else
-    xSetEdgefilterMultiple( cu, EDGE_VER, areaPu, (xOff ? m_stLFCUParam.internalEdge : m_stLFCUParam.leftEdge), xOff );
-    xSetEdgefilterMultiple( cu, EDGE_HOR, areaPu, (yOff ? m_stLFCUParam.internalEdge : m_stLFCUParam.topEdge),  yOff );
-#endif	
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
     edgeIdx.push_back( ( edgeDir == EDGE_HOR ) ? ( currPU.blocks[cu.chType].y - cu.blocks[cu.chType].y ) / 4 : ( currPU.blocks[cu.chType].x - cu.blocks[cu.chType].x ) / 4 );
-#endif
 
     if ((currPU.mergeFlag && (currPU.mergeType == MRG_TYPE_SUBPU_ATMVP)) || cu.affine)
     {
@@ -355,7 +313,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
         for (uint32_t off = subBlockSize; off < areaPu.height; off += subBlockSize)
         {
           const Area mvBlockH(cu.Y().x, cu.Y().y + off, cu.Y().width, pcv.minCUHeight);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND 
           horEdgeFilter = m_stLFCUParam.internalEdge;
           if( isCuCrossedByVirtualBoundaries )
           {
@@ -363,12 +320,7 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
           }
 
           xSetEdgefilterMultiple(cu, EDGE_HOR, mvBlockH, horEdgeFilter, 1);
-#else
-          xSetEdgefilterMultiple(cu, EDGE_HOR, mvBlockH, m_stLFCUParam.internalEdge, 1);
-#endif
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
           edgeIdx.push_back( ( currPU.blocks[cu.chType].y + off - cu.blocks[cu.chType].y ) / 4 );
-#endif
         }
       }
       else
@@ -376,7 +328,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
         for (uint32_t off = subBlockSize; off < areaPu.width; off += subBlockSize)
         {
           const Area mvBlockV(cu.Y().x + off, cu.Y().y, pcv.minCUWidth, cu.Y().height);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND 
           verEdgeFilter = m_stLFCUParam.internalEdge;
           if( isCuCrossedByVirtualBoundaries )
           {
@@ -384,80 +335,13 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
           }
 
           xSetEdgefilterMultiple(cu, EDGE_VER, mvBlockV, verEdgeFilter, 1);
-#else
-          xSetEdgefilterMultiple(cu, EDGE_VER, mvBlockV, m_stLFCUParam.internalEdge, 1);
-#endif
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
           edgeIdx.push_back( ( currPU.blocks[cu.chType].x + off - cu.blocks[cu.chType].x ) / 4 );
-#endif
-        }
-      }
-    }
-
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-    xSetMaxFilterLengthPQForCodingSubBlocks( edgeDir, cu, currPU, mvSubBlocks, subBlockSize, areaPu );
-#endif
-  }
-#if !JVET_N0302_SIMPLFIED_CIIP
-  if (cu.firstPU->mhIntraFlag)
-  {
-    const uint32_t dirMode = PU::getFinalIntraMode(*(cu.firstPU), cu.chType);
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-    edgeIdx.push_back( 0 );
-#endif
-    if (edgeDir == EDGE_VER && dirMode == HOR_IDX)
-    {
-      mvSubBlocks = true;
-      subBlockSize = std::max(8u, (area.width >> 2));
-      for (uint32_t off = subBlockSize; off < area.width; off += subBlockSize)
-      {
-        const Area mvBlockV(cu.Y().x + off, cu.Y().y, pcv.minCUWidth, cu.Y().height);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND 
-        verEdgeFilter = m_stLFCUParam.internalEdge;
-        if( isCuCrossedByVirtualBoundaries )
-        {
-          xDeriveEdgefilterParam( mvBlockV.x, mvBlockV.y, numVerVirBndry, 0, verVirBndryPos, horVirBndryPos, verEdgeFilter, horEdgeFilter );
         }
-
-        xSetEdgefilterMultiple(cu, EDGE_VER, mvBlockV, verEdgeFilter, 1);
-#else
-        xSetEdgefilterMultiple(cu, EDGE_VER, mvBlockV, m_stLFCUParam.internalEdge, 1);
-#endif
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-        edgeIdx.push_back( off / 4 );
-#endif
       }
     }
-    else if (edgeDir == EDGE_HOR && dirMode == VER_IDX)
-    {
-      mvSubBlocks = true;
-      subBlockSize = std::max(8u, (area.height >> 2));
-      for (uint32_t off = subBlockSize; off < area.height; off += subBlockSize)
-      {
-        const Area mvBlockH(cu.Y().x, cu.Y().y + off, cu.Y().width, pcv.minCUHeight);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND 
-        horEdgeFilter = m_stLFCUParam.internalEdge;
-        if( isCuCrossedByVirtualBoundaries )
-        {
-          xDeriveEdgefilterParam( mvBlockH.x, mvBlockH.y, 0, numHorVirBndry, verVirBndryPos, horVirBndryPos, verEdgeFilter, horEdgeFilter );
-        }
 
-        xSetEdgefilterMultiple(cu, EDGE_HOR, mvBlockH, horEdgeFilter, 1);
-#else
-        xSetEdgefilterMultiple(cu, EDGE_HOR, mvBlockH, m_stLFCUParam.internalEdge, 1);
-#endif
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-        edgeIdx.push_back( off / 4 );
-#endif
-      }
-    }
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-    const PredictionUnit& currPU = *cu.firstPU;
-    const Area& areaPu = cu.Y().valid() ? currPU.block( COMPONENT_Y ) : area;
     xSetMaxFilterLengthPQForCodingSubBlocks( edgeDir, cu, currPU, mvSubBlocks, subBlockSize, areaPu );
-#endif
   }
-#endif
 
   const unsigned uiPelsInPart = pcv.minCUWidth;
 
@@ -488,7 +372,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
   }
 
 
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
   std::sort( edgeIdx.begin(), edgeIdx.end() );
   int prevEdgeIdx = -1;
   for ( const int& edge : edgeIdx )
@@ -511,115 +394,8 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
       }
     }
   }
-#else
-  unsigned int orthogonalLength = 1;
-  unsigned int orthogonalIncrement = 1;
-#if FIX_DB_MAX_TRANSFORM_SIZE
-#if MAX_TB_SIZE_SIGNALLING
-  const int maxTsize = cu.slice->getSPS()->getMaxTbSize();
-#else
-  const int maxTsize = MAX_TB_SIZEY;
-#endif
-#endif
-#if FIX_DB_MAX_TRANSFORM_SIZE
-  int maxFilterLengthQ = 7;
-  int maxFilterLengthP = 7;
-  if (implicitTU && maxTsize < 32)
-  {
-    maxFilterLengthQ = 3;
-    maxFilterLengthP = 3;
-  }
-#else
-  int maxFilterLength = 7;
-#endif
-  if (cu.blocks[COMPONENT_Y].valid())
-  {
-    if (mvSubBlocks)
-    {
-#if FIX_DB_MAX_TRANSFORM_SIZE
-      maxFilterLengthQ = std::min(maxFilterLengthQ, 5);
-#else
-      maxFilterLength = 5;
-#endif
-      orthogonalIncrement = subBlockSize / 4;
-      orthogonalLength = (edgeDir == EDGE_HOR) ? cu.blocks[COMPONENT_Y].height / 4 : cu.blocks[COMPONENT_Y].width / 4;
-    }
-#if FIX_DB_MAX_TRANSFORM_SIZE
-    if ((cu.blocks[COMPONENT_Y].height > maxTsize) && (edgeDir == EDGE_HOR) && !mvSubBlocks)
-    {
-      orthogonalIncrement = maxTsize / 4;
-      orthogonalLength = cu.blocks[COMPONENT_Y].height / 4;
-    }
-    if ((cu.blocks[COMPONENT_Y].width > maxTsize) && (edgeDir == EDGE_VER) && !mvSubBlocks)
-    {
-      orthogonalIncrement = maxTsize / 4;
-      orthogonalLength = cu.blocks[COMPONENT_Y].width / 4;
-
-    }
-#else
-    if ((cu.blocks[COMPONENT_Y].height > 64) && (edgeDir == EDGE_HOR) && !mvSubBlocks)
-    {
-      orthogonalIncrement = 64 / 4;
-      orthogonalLength = cu.blocks[COMPONENT_Y].height / 4;
-    }
-    if ((cu.blocks[COMPONENT_Y].width > 64) && (edgeDir == EDGE_VER) && !mvSubBlocks)
-    {
-      orthogonalIncrement = 64 / 4;
-      orthogonalLength = cu.blocks[COMPONENT_Y].width / 4;
-
-    }
-#endif
-  }
-
-  for (int edge = 0; edge < orthogonalLength; edge += orthogonalIncrement)
-  {
-    if (cu.blocks[COMPONENT_Y].valid())
-    {
-      if (edge == 0)
-      {
-#if FIX_DB_MAX_TRANSFORM_SIZE
-        xEdgeFilterLuma(cu, edgeDir, edge, maxFilterLengthP, maxFilterLengthQ);
-#else
-        xEdgeFilterLuma(cu, edgeDir, edge, 7, maxFilterLength);
-#endif
-      }
-      else
-      {
-#if FIX_DB_MAX_TRANSFORM_SIZE
-        if (implicitTU && ((edge % (maxTsize / 4)) == 0))
-#else
-        if ( implicitTU && (edge == (64 / 4)) )
-#endif
-        {
-#if FIX_DB_MAX_TRANSFORM_SIZE
-          xEdgeFilterLuma(cu, edgeDir, edge, maxFilterLengthQ, maxFilterLengthQ);
-#else
-          xEdgeFilterLuma(cu, edgeDir, edge, maxFilterLength, maxFilterLength);
-#endif
-        }
-#if FIX_DB_MAX_TRANSFORM_SIZE
-        else if ((edge == 2 || edge == (orthogonalLength - 2)) || (implicitTU && (((edge - 2) % ((maxTsize) / 4) == 0) || ((edge + 2) % ((maxTsize) / 4) == 0))))
-#else
-        else if ( (edge == 2 || edge == (orthogonalLength - 2)) || (implicitTU && (edge == (56 / 4) || edge == (72 / 4))) )
-#endif
-        {
-          xEdgeFilterLuma(cu, edgeDir, edge, 2, 2);
-        }
-        else
-        {
-          xEdgeFilterLuma(cu, edgeDir, edge, 3, 3);
-        }
-      }
-    }
-    if (cu.blocks[COMPONENT_Cb].valid() && pcv.chrFormat != CHROMA_400)
-    {
-      xEdgeFilterChroma(cu, edgeDir, edge);
-    }
-  }
-#endif
 }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 inline bool LoopFilter::isCrossedByVirtualBoundaries(const int xPos, const int yPos, const int width, const int height, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps)
 {
   numHorVirBndry = 0; numVerVirBndry = 0;
@@ -663,9 +439,7 @@ inline void LoopFilter::xDeriveEdgefilterParam( const int xPos, const int yPos,
     }
   }
 }
-#endif
 
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
 void LoopFilter::xSetMaxFilterLengthPQFromTransformSizes( const DeblockEdgeDir edgeDir, const CodingUnit& cu, const TransformUnit& currTU )
 {
   const TransformUnit& tuQ = currTU;
@@ -810,7 +584,6 @@ void LoopFilter::xSetMaxFilterLengthPQForCodingSubBlocks( const DeblockEdgeDir e
     }
   }
 }
-#endif
 
 void LoopFilter::xSetEdgefilterMultiple( const CodingUnit&    cu,
                                          const DeblockEdgeDir edgeDir,
@@ -850,9 +623,6 @@ void LoopFilter::xSetLoopfilterParam( const CodingUnit& cu )
   m_stLFCUParam.internalEdge = true;
   m_stLFCUParam.leftEdge     = ( 0 < pos.x ) && isAvailableLeft ( cu, *cu.cs->getCU( pos.offset( -1,  0 ), cu.chType ), !slice.getLFCrossSliceBoundaryFlag(), !pps.getLoopFilterAcrossBricksEnabledFlag() );
   m_stLFCUParam.topEdge      = ( 0 < pos.y ) && isAvailableAbove( cu, *cu.cs->getCU( pos.offset(  0, -1 ), cu.chType ), !slice.getLFCrossSliceBoundaryFlag(), !pps.getLoopFilterAcrossBricksEnabledFlag() );
-#if !JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
-  m_stLFCUParam.internalEdge &= !cu.ispMode;
-#endif
 }
 
 unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const DeblockEdgeDir edgeDir, const Position& localPos ) const
@@ -869,12 +639,10 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
   const CodingUnit& cuQ = cu;
   const CodingUnit& cuP = *cu.cs->getCU( posP, cu.chType );
 
-#if JVET_N0413_RDPCM
   if( ( MODE_INTRA == cuP.predMode && cuP.bdpcmMode ) && ( MODE_INTRA == cuQ.predMode && cuQ.bdpcmMode ) )
   {
     return 0;
   }
-#endif
 
   //-- Set BS for Intra MB : BS = 4 or 3
   if( ( MODE_INTRA == cuP.predMode ) || ( MODE_INTRA == cuQ.predMode ) )
@@ -1028,11 +796,7 @@ void LoopFilter::deriveLADFShift( const Pel* src, const int stride, int& shift,
 }
 #endif
 
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
 void LoopFilter::xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edgeDir, const int iEdge )
-#else
-void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edgeDir, const int iEdge, const int initialMaxFilterLengthP, const int initialMaxFilterLengthQ)
-#endif
 {
   const CompArea&  lumaArea = cu.block(COMPONENT_Y);
   const PreCalcValues& pcv = *cu.cs->pcv;
@@ -1090,7 +854,6 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
     pos.x += xoffset;
     pos.y += yoffset;
 
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
     // Deblock luma boundaries on 8x8 grid only
     if ( edgeDir == EDGE_HOR && ( pos.y % 8 ) != 0 )
     {
@@ -1100,7 +863,6 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
     {
       continue;
     }
-#endif
 
     uiBsAbsIdx = getRasterIdx( pos, pcv );
     uiBs = BsGet(m_aapucBS[edgeDir][uiBsAbsIdx], COMPONENT_Y);
@@ -1132,37 +894,15 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
 
       bool sidePisLarge   = false;
       bool sideQisLarge   = false;
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
       int maxFilterLengthP = m_maxFilterLengthP[COMPONENT_Y][pos.x-m_ctuXLumaSamples][pos.y-m_ctuYLumaSamples];
       int maxFilterLengthQ = m_maxFilterLengthQ[COMPONENT_Y][pos.x-m_ctuXLumaSamples][pos.y-m_ctuYLumaSamples];
-#else
-      int maxFilterLengthP = initialMaxFilterLengthP;
-      int maxFilterLengthQ = initialMaxFilterLengthQ;
-#endif
       if (maxFilterLengthP > 3)
       {
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
         sidePisLarge = true;
         if ( maxFilterLengthP > 5 )
-#else
-        sidePisLarge = (edgeDir == EDGE_VER && cuP.block(COMPONENT_Y).width >= 32)
-          || (edgeDir == EDGE_HOR && cuP.block(COMPONENT_Y).height >= 32);
-
-        if (sidePisLarge && maxFilterLengthP > 5)
-#endif
         {
           // restrict filter length if sub-blocks are used (e.g affine or ATMVP)
-#if JVET_N0302_SIMPLFIED_CIIP
           if (cuP.affine)
-#else
-          bool ciipSubBlock = false;
-          if (cuP.firstPU->mhIntraFlag)
-          {
-            const uint32_t dirMode = PU::getFinalIntraMode(*(cuP.firstPU), cuP.chType);
-            ciipSubBlock = edgeDir == EDGE_HOR ? dirMode == VER_IDX : dirMode == HOR_IDX;
-          }
-          if (cuP.affine || ciipSubBlock)
-#endif
           {
             maxFilterLengthP = std::min(maxFilterLengthP, 5);
           }
@@ -1170,12 +910,7 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
       }
       if (maxFilterLengthQ > 3)
       {
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
         sideQisLarge = true;
-#else
-        sideQisLarge = (edgeDir == EDGE_VER && cuQ.block(COMPONENT_Y).width >= 32)
-          || (edgeDir == EDGE_HOR && cuQ.block(COMPONENT_Y).height >= 32);
-#endif
       }
 
       if (edgeDir == EDGE_HOR && pos.y % slice.getSPS()->getCTUSize() == 0)
@@ -1422,7 +1157,6 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
         bPartQNoFilter = bPartQNoFilter || cuQ.transQuantBypass;
       }
 
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
       const int maxFilterLengthP = m_maxFilterLengthP[COMPONENT_Cb][(pos.x-m_ctuXLumaSamples)>>m_shiftHor][(pos.y-m_ctuYLumaSamples)>>m_shiftVer];
       const int maxFilterLengthQ = m_maxFilterLengthQ[COMPONENT_Cb][(pos.x-m_ctuXLumaSamples)>>m_shiftHor][(pos.y-m_ctuYLumaSamples)>>m_shiftVer];
       bool largeBoundary         = false;
@@ -1430,14 +1164,6 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
       {
         largeBoundary = true;
       }
-#else
-      const unsigned cuPWidth  = cuP.block(COMPONENT_Cb).width;
-      const unsigned cuPHeight = cuP.block(COMPONENT_Cb).height;
-      const unsigned cuQWidth  = cuQ.block(COMPONENT_Cb).width;
-      const unsigned cuQHeight = cuQ.block(COMPONENT_Cb).height;
-
-      bool largeBoundary = ((edgeDir == EDGE_VER && cuPWidth >= 8 && cuQWidth >= 8) || (edgeDir == EDGE_HOR && cuPHeight >= 8 && cuQHeight >= 8));
-#endif
 
       if (edgeDir == EDGE_HOR && pos.y % cuP.slice->getSPS()->getCTUSize() == 0)
       {
diff --git a/source/Lib/CommonLib/LoopFilter.h b/source/Lib/CommonLib/LoopFilter.h
index b7e16d9ca..3495d709c 100644
--- a/source/Lib/CommonLib/LoopFilter.h
+++ b/source/Lib/CommonLib/LoopFilter.h
@@ -58,13 +58,11 @@ private:
   static_vector<char, MAX_NUM_PARTS_IN_CTU> m_aapucBS       [NUM_EDGE_DIR];         ///< Bs for [Ver/Hor][Y/U/V][Blk_Idx]
   static_vector<bool, MAX_NUM_PARTS_IN_CTU> m_aapbEdgeFilter[NUM_EDGE_DIR];
   LFCUParam m_stLFCUParam;                   ///< status structure
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
   int     m_ctuXLumaSamples, m_ctuYLumaSamples;                            // location of left-edge and top-edge of CTU
   int     m_shiftHor, m_shiftVer;                                          // shift values to convert location from luma sample units to chroma sample units
   uint8_t m_maxFilterLengthP[MAX_NUM_COMPONENT][MAX_CU_SIZE][MAX_CU_SIZE]; // maxFilterLengthP for [component][luma/chroma sample distance from left edge of CTU][luma/chroma sample distance from top edge of CTU]
   uint8_t m_maxFilterLengthQ[MAX_NUM_COMPONENT][MAX_CU_SIZE][MAX_CU_SIZE]; // maxFilterLengthQ for [component][luma/chroma sample distance from left edge of CTU][luma/chroma sample distance from top edge of CTU]
   bool    m_transformEdge[MAX_NUM_COMPONENT][MAX_CU_SIZE][MAX_CU_SIZE];    // transform edge flag for [component][luma/chroma sample distance from left edge of CTU][luma/chroma sample distance from top edge of CTU]
-#endif
   PelStorage                   m_encPicYuvBuffer;
   bool                         m_enc;
 private:
@@ -81,20 +79,14 @@ private:
                                     const Area&           area,
                                     const bool            bValue,
                                     const bool            EdgeIdx = false );
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
   void xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edgeDir, const int iEdge );
-#else
-  void xEdgeFilterLuma            ( const CodingUnit& cu, const DeblockEdgeDir edgeDir, const int iEdge, const int initialMaxFilterLengthP, const int initialMaxFilterLengthQ );
-#endif
   void xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir edgeDir, const int iEdge);
 
 #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
   void deriveLADFShift( const Pel* src, const int stride, int& shift, const DeblockEdgeDir edgeDir, const SPS sps );
 #endif
-#if JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES
   void xSetMaxFilterLengthPQFromTransformSizes( const DeblockEdgeDir edgeDir, const CodingUnit& cu, const TransformUnit& currTU );
   void xSetMaxFilterLengthPQForCodingSubBlocks( const DeblockEdgeDir edgeDir, const CodingUnit& cu, const PredictionUnit& currPU, const bool& mvSubBlocks, const int& subBlockSize, const Area& areaPu );
-#endif
 
   inline void xBilinearFilter     ( Pel* srcP, Pel* srcQ, int offset, int refMiddle, int refP, int refQ, int numberPSide, int numberQSide, const int* dbCoeffsP, const int* dbCoeffsQ, int tc ) const;
   inline void xFilteringPandQ     ( Pel* src, int offset, int numberPSide, int numberQSide, int tc ) const;
@@ -104,10 +96,8 @@ private:
   inline unsigned BsSet(unsigned val, const ComponentID compIdx) const;
   inline unsigned BsGet(unsigned val, const ComponentID compIdx) const;
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   inline bool isCrossedByVirtualBoundaries ( const int xPos, const int yPos, const int width, const int height, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps );
   inline void xDeriveEdgefilterParam       ( const int xPos, const int yPos, const int numVerVirBndry, const int numHorVirBndry, const int verVirBndryPos[], const int horVirBndryPos[], bool &verEdgeFilter, bool &horEdgeFilter );
-#endif
 
   inline int xCalcDP              ( Pel* piSrc, const int iOffset ) const;
   inline int xCalcDQ              ( Pel* piSrc, const int iOffset ) const;
diff --git a/source/Lib/CommonLib/MCTS.cpp b/source/Lib/CommonLib/MCTS.cpp
index 1c8aaca66..a8eb00149 100644
--- a/source/Lib/CommonLib/MCTS.cpp
+++ b/source/Lib/CommonLib/MCTS.cpp
@@ -90,31 +90,17 @@ void MCTSHelper::clipMvToArea( Mv& rcMv, const Area& block, const Area& clipArea
 
 Area MCTSHelper::getTileArea( const CodingStructure* cs, const int ctuAddr )
 {
-#if JVET_N0857_TILES_BRICKS
   const BrickMap* tileMap = cs->picture->brickMap;
   const int       tileIdx = tileMap->getBrickIdxRsMap( ctuAddr );
-#else
-  const TileMap* tileMap = cs->picture->tileMap;
-  const int      tileIdx = tileMap->getTileIdxMap( ctuAddr );
-#endif
-#if JVET_N0857_TILES_BRICKS
   const Brick&  currentTile = tileMap->bricks[tileIdx];
-#else
-  const Tile&    currentTile = tileMap->tiles[tileIdx];
-#endif
 
   const int      frameWidthInCtus = cs->pcv->widthInCtus;
   const int  firstCtuRsAddrOfTile = currentTile.getFirstCtuRsAddr();
 
   const int tileXPosInCtus = firstCtuRsAddrOfTile % frameWidthInCtus;
   const int tileYPosInCtus = firstCtuRsAddrOfTile / frameWidthInCtus;
-#if JVET_N0857_TILES_BRICKS
   const int tileWidthtInCtus = currentTile.getWidthInCtus();
   const int tileHeightInCtus = currentTile.getHeightInCtus();
-#else
-  const int tileWidthtInCtus = currentTile.getTileWidthInCtus();
-  const int tileHeightInCtus = currentTile.getTileHeightInCtus();
-#endif
 
   const int  maxCUWidth  = cs->pcv->maxCUWidth;
   const int  maxCUHeight = cs->pcv->maxCUHeight;
diff --git a/source/Lib/CommonLib/MatrixIntraPrediction.cpp b/source/Lib/CommonLib/MatrixIntraPrediction.cpp
index 13e9d57be..edfbe21f6 100644
--- a/source/Lib/CommonLib/MatrixIntraPrediction.cpp
+++ b/source/Lib/CommonLib/MatrixIntraPrediction.cpp
@@ -38,7 +38,6 @@
 #include "MatrixIntraPrediction.h"
 #include "dtrace_next.h"
 
-#if JVET_N0217_MATRIX_INTRAPRED
 #include "UnitTools.h"
 #include "MipData.h"
 
@@ -544,4 +543,3 @@ void MatrixIntraPrediction::predBlock( const Size &puSize, const int intraMode,
   }
 }
 
-#endif
diff --git a/source/Lib/CommonLib/MatrixIntraPrediction.h b/source/Lib/CommonLib/MatrixIntraPrediction.h
index 6fc06880e..24229f878 100644
--- a/source/Lib/CommonLib/MatrixIntraPrediction.h
+++ b/source/Lib/CommonLib/MatrixIntraPrediction.h
@@ -41,7 +41,6 @@
 
 #include "Unit.h"
 
-#if JVET_N0217_MATRIX_INTRAPRED
 static const int MIP_MAX_INPUT_SIZE             =  8;
 static const int MIP_MAX_REDUCED_OUTPUT_SAMPLES = 64;
 
@@ -106,6 +105,5 @@ public:
   void predBlock( const Size &puSize, const int modeIdx, PelBuf &dst, const int bitDepth );
 };
 
-#endif // JVET_N0217_MATRIX_INTRAPRED
 
 #endif //__MATRIXINTRAPPREDICTION__
diff --git a/source/Lib/CommonLib/MotionInfo.h b/source/Lib/CommonLib/MotionInfo.h
index 4f226261c..83bb07cff 100644
--- a/source/Lib/CommonLib/MotionInfo.h
+++ b/source/Lib/CommonLib/MotionInfo.h
@@ -221,16 +221,11 @@ struct LutMotionCand
 {
   static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lut;
   static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutIbc;
-#if !JVET_N0266_SMALL_BLOCKS
-  static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutShare;
-#endif
   static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutShareIbc;
 };
-#if JVET_N0329_IBC_SEARCH_IMP
 struct PatentBvCand
 {
   Mv m_bvCands[IBC_NUM_CANDIDATES];
   int currCnt;
 };
-#endif
 #endif // __MOTIONINFO__
diff --git a/source/Lib/CommonLib/Mv.cpp b/source/Lib/CommonLib/Mv.cpp
index 8c58ee257..981ba6a02 100644
--- a/source/Lib/CommonLib/Mv.cpp
+++ b/source/Lib/CommonLib/Mv.cpp
@@ -47,13 +47,8 @@ const MvPrecision Mv::m_amvrPrecIbc[3] = { MV_PRECISION_INT, MV_PRECISION_INT, M
 void roundAffineMv( int& mvx, int& mvy, int nShift )
 {
   const int nOffset = 1 << (nShift - 1);
-#if JVET_N0335_N0085_MV_ROUNDING
   mvx = (mvx + nOffset - (mvx >= 0)) >> nShift;
   mvy = (mvy + nOffset - (mvy >= 0)) >> nShift;
-#else
-  mvx = mvx >= 0 ? (mvx + nOffset) >> nShift : -((-mvx + nOffset) >> nShift);
-  mvy = mvy >= 0 ? (mvy + nOffset) >> nShift : -((-mvy + nOffset) >> nShift);
-#endif
 }
 
 void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS& sps )
@@ -68,19 +63,6 @@ void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS&
 
   if( sps.getWrapAroundEnabledFlag() )
   {
-#if !JVET_N0070_WRAPAROUND
-    int iHorMax = ( sps.getPicWidthInLumaSamples() + sps.getMaxCUWidth() - size.width + iOffset - ( int ) pos.x - 1 ) << iMvShift;
-    int iHorMin = ( -( int ) sps.getMaxCUWidth()                                      - iOffset - ( int ) pos.x + 1 ) << iMvShift;
-    int mvX = rcMv.getHor();
-    while( mvX > iHorMax ) {
-      mvX -= ( sps.getWrapAroundOffset() << iMvShift );
-    }
-    while( mvX < iHorMin ) {
-      mvX += ( sps.getWrapAroundOffset() << iMvShift );
-    }
-    rcMv.setHor( mvX );
-    rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
-#endif
     return;
   }
 
@@ -88,7 +70,6 @@ void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS&
   rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
 }
 
-#if JVET_N0070_WRAPAROUND
 bool wrapClipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS *sps )
 {
   bool wrapRef = true;
@@ -117,6 +98,5 @@ bool wrapClipMv( Mv& rcMv, const Position& pos, const struct Size& size, const S
   rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
   return wrapRef;
 }
-#endif
 
 //! \}
diff --git a/source/Lib/CommonLib/Mv.h b/source/Lib/CommonLib/Mv.h
index df4a468fc..5d714d1c0 100644
--- a/source/Lib/CommonLib/Mv.h
+++ b/source/Lib/CommonLib/Mv.h
@@ -65,10 +65,8 @@ private:
   static const MvPrecision m_amvrPrecAffine[3];
   static const MvPrecision m_amvrPrecIbc[3];
 
-#if JVET_N0334_MVCLIPPING
   static const int mvClipPeriod = (1 << MV_BITS);
   static const int halMvClipPeriod = (1 << (MV_BITS - 1));
-#endif
 
 public:
   int   hor;     ///< horizontal component of motion vector
@@ -129,22 +127,12 @@ public:
   //! shift right with rounding
   void divideByPowerOf2 (const int i)
   {
-#if JVET_N0335_N0085_MV_ROUNDING
     if (i != 0)
     {
       const int offset = (1 << (i - 1));
       hor = (hor + offset - (hor >= 0)) >> i;
       ver = (ver + offset - (ver >= 0)) >> i;
     }
-#else
-#if ME_ENABLE_ROUNDING_OF_MVS
-    const int offset = (i == 0) ? 0 : 1 << (i - 1);
-    hor += offset;
-    ver += offset;
-#endif
-    hor >>= i;
-    ver >>= i;
-#endif
   }
 
   const Mv& operator<<= (const int i)
@@ -156,17 +144,12 @@ public:
 
   const Mv& operator>>= ( const int i )
   {
-#if JVET_N0335_N0085_MV_ROUNDING
     if (i != 0)
     {
       const int offset = (1 << (i - 1));
       hor = (hor + offset - (hor >= 0)) >> i;
       ver = (ver + offset - (ver >= 0)) >> i;
     }
-#else
-    hor >>= i;
-    ver >>= i;
-#endif
     return  *this;
   }
 
@@ -192,13 +175,8 @@ public:
 
   const Mv scaleMv( int iScale ) const
   {
-#if JVET_N0335_N0085_MV_ROUNDING
     const int mvx = Clip3(MV_MIN, MV_MAX, (iScale * getHor() + 128 - (iScale * getHor() >= 0)) >> 8);
     const int mvy = Clip3(MV_MIN, MV_MAX, (iScale * getVer() + 128 - (iScale * getVer() >= 0)) >> 8);
-#else
-    const int mvx = Clip3(MV_MIN, MV_MAX, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8);
-    const int mvy = Clip3(MV_MIN, MV_MAX, (iScale * getVer() + 127 + (iScale * getVer() < 0)) >> 8);
-#endif
     return Mv( mvx, mvy );
   }
 
@@ -213,13 +191,8 @@ public:
     {
       const int rightShift = -shift;
       const int nOffset = 1 << (rightShift - 1);
-#if JVET_N0335_N0085_MV_ROUNDING
       hor = hor >= 0 ? (hor + nOffset - 1) >> rightShift : (hor + nOffset) >> rightShift;
       ver = ver >= 0 ? (ver + nOffset - 1) >> rightShift : (ver + nOffset) >> rightShift;
-#else
-      hor = hor >= 0 ? (hor + nOffset) >> rightShift : -((-hor + nOffset) >> rightShift);
-      ver = ver >= 0 ? (ver + nOffset) >> rightShift : -((-ver + nOffset) >> rightShift);
-#endif
     }
   }
 
@@ -288,7 +261,6 @@ public:
     hor = Clip3( -(1 << 17), (1 << 17) - 1, hor );
     ver = Clip3( -(1 << 17), (1 << 17) - 1, ver );
   }
-#if JVET_N0334_MVCLIPPING
   void mvCliptoStorageBitDepth()  // periodic clipping
   {
     hor = (hor + mvClipPeriod) & (mvClipPeriod - 1);
@@ -296,7 +268,6 @@ public:
     ver = (ver + mvClipPeriod) & (mvClipPeriod - 1);
     ver = (ver >= halMvClipPeriod) ? (ver - mvClipPeriod) : ver;
   }
-#endif
 };// END CLASS DEFINITION MV
 
 namespace std
@@ -314,11 +285,9 @@ void clipMv ( Mv& rcMv, const struct Position& pos,
               const struct Size& size,
               const class SPS& sps );
 
-#if JVET_N0070_WRAPAROUND
 bool wrapClipMv( Mv& rcMv, const Position& pos, 
                  const struct Size& size, 
                  const SPS *sps );
-#endif
 
 void roundAffineMv( int& mvx, int& mvy, int nShift );
 
diff --git a/source/Lib/CommonLib/NAL.h b/source/Lib/CommonLib/NAL.h
index e119e11d6..475b1d79a 100644
--- a/source/Lib/CommonLib/NAL.h
+++ b/source/Lib/CommonLib/NAL.h
@@ -74,7 +74,6 @@ struct NALUnit
   /** returns true if the NALunit is a slice NALunit */
   bool isSlice()
   {
-#if JVET_N0067_NAL_Unit_Header
     return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
@@ -83,34 +82,6 @@ struct NALUnit
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_GRA
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL;
-#else
-#if JVET_M0101_HLS
-    return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL;
-#else
-    return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
-        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
-#endif
-#endif
   }
   bool isSei()
   {
@@ -120,7 +91,6 @@ struct NALUnit
 
   bool isVcl()
   {
-#if JVET_N0067_NAL_Unit_Header
     return m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL
@@ -130,9 +100,6 @@ struct NALUnit
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
         || m_nalUnitType == NAL_UNIT_CODED_SLICE_GRA;
 
-#else
-    return ( (uint32_t)m_nalUnitType < 32 );
-#endif
   }
 };
 
diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp
index 9f1d36a54..eed0193bf 100644
--- a/source/Lib/CommonLib/Picture.cpp
+++ b/source/Lib/CommonLib/Picture.cpp
@@ -436,7 +436,6 @@ bool Scheduler::getNextCtu( Position& pos, int ctuLine, int offset)
 // picture methods
 // ---------------------------------------------------------------------------
 
-#if JVET_N0857_TILES_BRICKS
 
 Brick::Brick()
 : m_widthInCtus     (0)
@@ -451,284 +450,7 @@ Brick::~Brick()
 {
 }
 
-#else
-Tile::Tile()
-: m_tileWidthInCtus     (0)
-, m_tileHeightInCtus    (0)
-, m_rightEdgePosInCtus  (0)
-, m_bottomEdgePosInCtus (0)
-, m_firstCtuRsAddr      (0)
-{
-}
-
-Tile::~Tile()
-{
-}
-#endif
-
-#if !JVET_N0857_TILES_BRICKS
-
-TileMap::TileMap()
-  : pcv(nullptr)
-  , tiles(0)
-  , numTiles(0)
-  , numTileColumns(0)
-  , numTileRows(0)
-  , tileIdxMap(nullptr)
-  , ctuTsToRsAddrMap(nullptr)
-  , ctuRsToTsAddrMap(nullptr)
-{
-}
-
-void TileMap::create( const SPS& sps, const PPS& pps )
-{
-  pcv = pps.pcv;
-
-  numTileColumns = pps.getNumTileColumnsMinus1() + 1;
-  numTileRows    = pps.getNumTileRowsMinus1() + 1;
-  numTiles       = numTileColumns * numTileRows;
-  tiles.resize( numTiles );
-
-  const uint32_t numCtusInFrame = pcv->sizeInCtus;
-  tileIdxMap       = new uint32_t[numCtusInFrame];
-  ctuTsToRsAddrMap = new uint32_t[numCtusInFrame+1];
-  ctuRsToTsAddrMap = new uint32_t[numCtusInFrame+1];
-
-  initTileMap( sps, pps );
-  initCtuTsRsAddrMap();
-}
-
-void TileMap::destroy()
-{
-  tiles.clear();
-
-  if ( tileIdxMap )
-  {
-    delete[] tileIdxMap;
-    tileIdxMap = nullptr;
-  }
-
-  if ( ctuTsToRsAddrMap )
-  {
-    delete[] ctuTsToRsAddrMap;
-    ctuTsToRsAddrMap = nullptr;
-  }
-
-  if ( ctuRsToTsAddrMap )
-  {
-    delete[] ctuRsToTsAddrMap;
-    ctuRsToTsAddrMap = nullptr;
-  }
-}
-
-void TileMap::initTileMap( const SPS& sps, const PPS& pps )
-{
-  const uint32_t frameWidthInCtus  = pcv->widthInCtus;
-  const uint32_t frameHeightInCtus = pcv->heightInCtus;
-
-  if( pps.getUniformTileSpacingFlag() )
-  {
-    //set width and height for each (uniform) tile
-    for(int row=0; row < numTileRows; row++)
-    {
-      for(int col=0; col < numTileColumns; col++)
-      {
-        const int tileIdx = row * numTileColumns + col;
-        tiles[tileIdx].setTileWidthInCtus(  (col+1)*frameWidthInCtus/numTileColumns - (col*frameWidthInCtus)/numTileColumns );
-        tiles[tileIdx].setTileHeightInCtus( (row+1)*frameHeightInCtus/numTileRows   - (row*frameHeightInCtus)/numTileRows );
-      }
-    }
-  }
-  else
-  {
-    //set the width for each tile
-    for(int row=0; row < numTileRows; row++)
-    {
-      int cumulativeTileWidth = 0;
-      for(int col=0; col < numTileColumns - 1; col++)
-      {
-        tiles[row * numTileColumns + col].setTileWidthInCtus( pps.getTileColumnWidth(col) );
-        cumulativeTileWidth += pps.getTileColumnWidth(col);
-      }
-      tiles[row * numTileColumns + numTileColumns - 1].setTileWidthInCtus( frameWidthInCtus-cumulativeTileWidth );
-    }
-
-    //set the height for each tile
-    for(int col=0; col < numTileColumns; col++)
-    {
-      int cumulativeTileHeight = 0;
-      for(int row=0; row < numTileRows - 1; row++)
-      {
-        tiles[row * numTileColumns + col].setTileHeightInCtus( pps.getTileRowHeight(row) );
-        cumulativeTileHeight += pps.getTileRowHeight(row);
-      }
-      tiles[(numTileRows - 1) * numTileColumns + col].setTileHeightInCtus( frameHeightInCtus-cumulativeTileHeight );
-    }
-  }
-
-  // Tile size check
-  int minWidth  = 1;
-  int minHeight = 1;
-#if !JVET_M0101_HLS
-  const int profileIdc = sps.getPTL()->getGeneralPTL()->getProfileIdc();
-#else
-  const int profileIdc = sps.getProfileTierLevel()->getProfileIdc();
-#endif
-  if (  profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10)
-  {
-    if (pps.getTilesEnabledFlag())
-    {
-      minHeight = 64  / sps.getMaxCUHeight();
-      minWidth  = 256 / sps.getMaxCUWidth();
-    }
-  }
-  for(int row=0; row < numTileRows; row++)
-  {
-    for(int col=0; col < numTileColumns; col++)
-    {
-      const int tileIdx = row * numTileColumns + col;
-      if(tiles[tileIdx].getTileWidthInCtus() < minWidth)   { THROW("Invalid tile size"); }
-      if(tiles[tileIdx].getTileHeightInCtus() < minHeight) { THROW("Invalid tile size"); }
-    }
-  }
-
-  //initialize each tile of the current picture
-  for( int row=0; row < numTileRows; row++ )
-  {
-    for( int col=0; col < numTileColumns; col++ )
-    {
-      const int tileIdx = row * numTileColumns + col;
-
-      //initialize the RightEdgePosInCU for each tile
-      int rightEdgePosInCTU = 0;
-      for( int i=0; i <= col; i++ )
-      {
-        rightEdgePosInCTU += tiles[row * numTileColumns + i].getTileWidthInCtus();
-      }
-      tiles[tileIdx].setRightEdgePosInCtus(rightEdgePosInCTU-1);
-
-      //initialize the BottomEdgePosInCU for each tile
-      int bottomEdgePosInCTU = 0;
-      for( int i=0; i <= row; i++ )
-      {
-        bottomEdgePosInCTU += tiles[i * numTileColumns + col].getTileHeightInCtus();
-      }
-      tiles[tileIdx].setBottomEdgePosInCtus(bottomEdgePosInCTU-1);
-
-      //initialize the FirstCUAddr for each tile
-      tiles[tileIdx].setFirstCtuRsAddr( (tiles[tileIdx].getBottomEdgePosInCtus() - tiles[tileIdx].getTileHeightInCtus() + 1) * frameWidthInCtus +
-                                         tiles[tileIdx].getRightEdgePosInCtus()  - tiles[tileIdx].getTileWidthInCtus()  + 1);
-    }
-  }
-
-  int  columnIdx = 0;
-  int  rowIdx = 0;
-
-  //initialize the TileIdxMap
-  const uint32_t numCtusInFrame = pcv->sizeInCtus;
-  for( int i=0; i<numCtusInFrame; i++)
-  {
-    for( int col=0; col < numTileColumns; col++)
-    {
-      if(i % frameWidthInCtus <= tiles[col].getRightEdgePosInCtus())
-      {
-        columnIdx = col;
-        break;
-      }
-    }
-    for(int row=0; row < numTileRows; row++)
-    {
-      if(i / frameWidthInCtus <= tiles[row*numTileColumns].getBottomEdgePosInCtus())
-      {
-        rowIdx = row;
-        break;
-      }
-    }
-    tileIdxMap[i] = rowIdx * numTileColumns + columnIdx;
-  }
-}
-
-void TileMap::initCtuTsRsAddrMap()
-{
-  //generate the Coding Order Map and Inverse Coding Order Map
-  const uint32_t numCtusInFrame = pcv->sizeInCtus;
-  for(int ctuTsAddr=0, ctuRsAddr=0; ctuTsAddr<numCtusInFrame; ctuTsAddr++, ctuRsAddr = calculateNextCtuRSAddr(ctuRsAddr))
-  {
-    ctuTsToRsAddrMap[ctuTsAddr] = ctuRsAddr;
-    ctuRsToTsAddrMap[ctuRsAddr] = ctuTsAddr;
-  }
-  ctuTsToRsAddrMap[numCtusInFrame] = numCtusInFrame;
-  ctuRsToTsAddrMap[numCtusInFrame] = numCtusInFrame;
-}
-
-uint32_t TileMap::calculateNextCtuRSAddr( const uint32_t currCtuRsAddr ) const
-{
-  const uint32_t frameWidthInCtus = pcv->widthInCtus;
-  uint32_t  nextCtuRsAddr;
-
-  //get the tile index for the current CTU
-  const uint32_t uiTileIdx = getTileIdxMap(currCtuRsAddr);
-
-  //get the raster scan address for the next CTU
-  if( currCtuRsAddr % frameWidthInCtus == tiles[uiTileIdx].getRightEdgePosInCtus() && currCtuRsAddr / frameWidthInCtus == tiles[uiTileIdx].getBottomEdgePosInCtus() )
-  //the current CTU is the last CTU of the tile
-  {
-    if(uiTileIdx+1 == numTiles)
-    {
-      nextCtuRsAddr = pcv->sizeInCtus;
-    }
-    else
-    {
-      nextCtuRsAddr = tiles[uiTileIdx+1].getFirstCtuRsAddr();
-    }
-  }
-  else //the current CTU is not the last CTU of the tile
-  {
-    if( currCtuRsAddr % frameWidthInCtus == tiles[uiTileIdx].getRightEdgePosInCtus() )  //the current CTU is on the rightmost edge of the tile
-    {
-      nextCtuRsAddr = currCtuRsAddr + frameWidthInCtus - tiles[uiTileIdx].getTileWidthInCtus() + 1;
-    }
-    else
-    {
-      nextCtuRsAddr = currCtuRsAddr + 1;
-    }
-  }
-
-  return nextCtuRsAddr;
-}
-
-uint32_t TileMap::getSubstreamForCtuAddr(const uint32_t ctuAddr, const bool bAddressInRaster, Slice *pcSlice) const
-{
-  const bool bWPPEnabled = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag();
-  uint32_t subStrm;
 
-  if( (bWPPEnabled && pcv->heightInCtus > 1) || (numTiles > 1) ) // wavefronts, and possibly tiles being used.
-  {
-    const uint32_t ctuRsAddr = bAddressInRaster ? ctuAddr : getCtuTsToRsAddrMap(ctuAddr);
-    const uint32_t tileIndex = getTileIdxMap(ctuRsAddr);
-
-    if (bWPPEnabled)
-    {
-      const uint32_t firstCtuRsAddrOfTile     = tiles[tileIndex].getFirstCtuRsAddr();
-      const uint32_t tileYInCtus              = firstCtuRsAddrOfTile / pcv->widthInCtus;
-      const uint32_t ctuLine                  = ctuRsAddr / pcv->widthInCtus;
-      const uint32_t startingSubstreamForTile = (tileYInCtus * numTileColumns) + (tiles[tileIndex].getTileHeightInCtus() * (tileIndex % numTileColumns));
-
-      subStrm = startingSubstreamForTile + (ctuLine - tileYInCtus);
-    }
-    else
-    {
-      subStrm = tileIndex;
-    }
-  }
-  else
-  {
-    subStrm = 0;
-  }
-  return subStrm;
-}
-
-#else
 BrickMap::BrickMap()
   : pcv(nullptr)
   , numTiles(0)
@@ -999,15 +721,10 @@ uint32_t BrickMap::getSubstreamForCtuAddr(const uint32_t ctuAddr, const bool add
   return subStrm;
 }
 
-#endif
 
 Picture::Picture()
 {
-#if JVET_N0857_TILES_BRICKS
   brickMap             = nullptr;
-#else
-  tileMap              = nullptr;
-#endif
   cs                   = nullptr;
   m_bIsBorderExtended  = false;
   usedByCurr           = false;
@@ -1032,9 +749,7 @@ void Picture::create(const ChromaFormat &_chromaFormat, const Size &size, const
   margin            =  _margin;
   const Area a      = Area( Position(), size );
   M_BUFS( 0, PIC_RECONSTRUCTION ).create( _chromaFormat, a, _maxCUSize, _margin, MEMORY_ALIGN_DEF_SIZE );
-#if JVET_N0070_WRAPAROUND
   M_BUFS( 0, PIC_RECON_WRAP ).create( _chromaFormat, a, _maxCUSize, _margin, MEMORY_ALIGN_DEF_SIZE );
-#endif
 
   if( !_decoder )
   {
@@ -1081,21 +796,12 @@ void Picture::destroy()
   }
   SEIs.clear();
 
-#if JVET_N0857_TILES_BRICKS
   if ( brickMap )
   {
     brickMap->destroy();
     delete brickMap;
     brickMap = nullptr;
   }
-#else
-  if ( tileMap )
-  {
-    tileMap->destroy();
-    delete tileMap;
-    tileMap = nullptr;
-  }
-#endif
   if (m_spliceIdx)
   {
     delete[] m_spliceIdx;
@@ -1168,7 +874,6 @@ const CPelBuf     Picture::getResiBuf(const CompArea &blk)  const { return getBu
        PelUnitBuf Picture::getResiBuf(const UnitArea &unit)       { return getBuf(unit, PIC_RESIDUAL); }
 const CPelUnitBuf Picture::getResiBuf(const UnitArea &unit) const { return getBuf(unit, PIC_RESIDUAL); }
 
-#if JVET_N0070_WRAPAROUND
        PelBuf     Picture::getRecoBuf(const ComponentID compID, bool wrap)       { return getBuf(compID,                    wrap ? PIC_RECON_WRAP : PIC_RECONSTRUCTION); }
 const CPelBuf     Picture::getRecoBuf(const ComponentID compID, bool wrap) const { return getBuf(compID,                    wrap ? PIC_RECON_WRAP : PIC_RECONSTRUCTION); }
        PelBuf     Picture::getRecoBuf(const CompArea &blk, bool wrap)            { return getBuf(blk,                       wrap ? PIC_RECON_WRAP : PIC_RECONSTRUCTION); }
@@ -1177,26 +882,8 @@ const CPelBuf     Picture::getRecoBuf(const CompArea &blk, bool wrap)      const
 const CPelUnitBuf Picture::getRecoBuf(const UnitArea &unit, bool wrap)     const { return getBuf(unit,                      wrap ? PIC_RECON_WRAP : PIC_RECONSTRUCTION); }
        PelUnitBuf Picture::getRecoBuf(bool wrap)                                 { return M_BUFS(scheduler.getSplitPicId(), wrap ? PIC_RECON_WRAP : PIC_RECONSTRUCTION); }
 const CPelUnitBuf Picture::getRecoBuf(bool wrap)                           const { return M_BUFS(scheduler.getSplitPicId(), wrap ? PIC_RECON_WRAP : PIC_RECONSTRUCTION); }
-#else
-       PelBuf     Picture::getRecoBuf(const ComponentID compID)       { return getBuf(compID,                    PIC_RECONSTRUCTION); }
-const CPelBuf     Picture::getRecoBuf(const ComponentID compID) const { return getBuf(compID,                    PIC_RECONSTRUCTION); }
-       PelBuf     Picture::getRecoBuf(const CompArea &blk)            { return getBuf(blk,                       PIC_RECONSTRUCTION); }
-const CPelBuf     Picture::getRecoBuf(const CompArea &blk)      const { return getBuf(blk,                       PIC_RECONSTRUCTION); }
-       PelUnitBuf Picture::getRecoBuf(const UnitArea &unit)           { return getBuf(unit,                      PIC_RECONSTRUCTION); }
-const CPelUnitBuf Picture::getRecoBuf(const UnitArea &unit)     const { return getBuf(unit,                      PIC_RECONSTRUCTION); }
-       PelUnitBuf Picture::getRecoBuf()                               { return M_BUFS(scheduler.getSplitPicId(), PIC_RECONSTRUCTION); }
-const CPelUnitBuf Picture::getRecoBuf()                         const { return M_BUFS(scheduler.getSplitPicId(), PIC_RECONSTRUCTION); }
-#endif
 
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS   
 void Picture::finalInit(const SPS& sps, const PPS& pps, APS** alfApss, APS& lmcsAps)
-#else
-void Picture::finalInit(const SPS& sps, const PPS& pps, APS** apss)
-#endif
-#else
-void Picture::finalInit(const SPS& sps, const PPS& pps, APS& aps)
-#endif
 {
   for( auto &sei : SEIs )
   {
@@ -1205,21 +892,12 @@ void Picture::finalInit(const SPS& sps, const PPS& pps, APS& aps)
   SEIs.clear();
   clearSliceBuffer();
 
-#if JVET_N0857_TILES_BRICKS
   if( brickMap )
   {
     brickMap->destroy();
     delete brickMap;
     brickMap = nullptr;
   }
-#else
-  if( tileMap )
-  {
-    tileMap->destroy();
-    delete tileMap;
-    tileMap = nullptr;
-  }
-#endif
 
   const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
   const int          iWidth = sps.getPicWidthInLumaSamples();
@@ -1239,31 +917,16 @@ void Picture::finalInit(const SPS& sps, const PPS& pps, APS& aps)
   cs->picture = this;
   cs->slice   = nullptr;  // the slices for this picture have not been set at this point. update cs->slice after swapSliceObject()
   cs->pps     = &pps;
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS  
   memcpy(cs->alfApss, alfApss, sizeof(cs->alfApss));   
-#else
-  memcpy(cs->apss, apss, sizeof(cs->apss));
-#endif
-#else
-  cs->aps = &aps;
-#endif
-#if JVET_N0805_APS_LMCS  
   cs->lmcsAps = &lmcsAps;
-#endif
 
 #if HEVC_VPS
   cs->vps     = nullptr;
 #endif
   cs->pcv     = pps.pcv;
 
-#if JVET_N0857_TILES_BRICKS
   brickMap = new BrickMap;
   brickMap->create( sps, pps );
-#else
-  tileMap = new TileMap;
-  tileMap->create( sps, pps );
-#endif
   if (m_spliceIdx == NULL)
   {
     m_ctuNums = cs->pcv->sizeInCtus;
@@ -1276,19 +939,9 @@ void Picture::allocateNewSlice()
 {
   slices.push_back(new Slice);
   Slice& slice = *slices.back();
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   memcpy(slice.getAlfAPSs(), cs->alfApss, sizeof(cs->alfApss));
-#else
-  memcpy(slice.getAPSs(), cs->apss, sizeof(cs->apss));
-#endif
-#else
-  slice.setAPS(cs->aps);
-#endif
 
-#if JVET_N0805_APS_LMCS
   slice.setLmcsAPS(cs->lmcsAps);
-#endif
 
   slice.setPPS( cs->pps);
   slice.setSPS( cs->sps);
@@ -1303,37 +956,17 @@ Slice *Picture::swapSliceObject(Slice * p, uint32_t i)
 {
   p->setSPS(cs->sps);
   p->setPPS(cs->pps);
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   p->setAlfAPSs(cs->alfApss);
-#else
-  p->setAPSs(cs->apss);
-#endif
-#else
-  p->setAPS(cs->aps);
-#endif
 
-#if JVET_N0805_APS_LMCS
   p->setLmcsAPS(cs->lmcsAps);
-#endif
 
   Slice * pTmp = slices[i];
   slices[i] = p;
   pTmp->setSPS(0);
   pTmp->setPPS(0);
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   memset(pTmp->getAlfAPSs(), 0, sizeof(*pTmp->getAlfAPSs())*MAX_NUM_APS);
-#else
-  memset(pTmp->getAPSs(), 0, sizeof(*pTmp->getAPSs())*MAX_NUM_APS);
-#endif
-#else
-  pTmp->setAPS(0);
-#endif
 
-#if JVET_N0805_APS_LMCS
   pTmp->setLmcsAPS(0);
-#endif
   return pTmp;
 }
 
@@ -1397,23 +1030,6 @@ void Picture::extendPicBorder()
 
     Pel*  pi = piTxt;
     // do left and right margins
- #if !JVET_N0070_WRAPAROUND  
-    if (cs->sps->getWrapAroundEnabledFlag())
-    {
-      int xoffset = cs->sps->getWrapAroundOffset() >> getComponentScaleX( compID, cs->area.chromaFormat );
-      for (int y = 0; y < p.height; y++)
-      {
-        for (int x = 0; x < xmargin; x++ )
-        {
-          pi[ -x - 1       ] = pi[ -x - 1       + xoffset ];
-          pi[  p.width + x ] = pi[  p.width + x - xoffset ];
-        }
-        pi += p.stride;
-      }
-    }
-    else
-    {
-#endif
       for (int y = 0; y < p.height; y++)
       {
         for (int x = 0; x < xmargin; x++ )
@@ -1423,9 +1039,6 @@ void Picture::extendPicBorder()
         }
         pi += p.stride;
       }
- #if !JVET_N0070_WRAPAROUND  
-    }
-#endif
 
     // pi is now the (0,height) (bottom left of image within bigger picture
     pi -= (p.stride + xmargin);
@@ -1443,7 +1056,6 @@ void Picture::extendPicBorder()
       ::memcpy( pi - (y+1)*p.stride, pi, sizeof(Pel)*(p.width + (xmargin<<1)) );
     }
     
-#if JVET_N0070_WRAPAROUND  
     // reference picture with horizontal wrapped boundary
     if (cs->sps->getWrapAroundEnabledFlag())
     {
@@ -1480,7 +1092,6 @@ void Picture::extendPicBorder()
         ::memcpy( pi - (y+1)*p.stride, pi, sizeof(Pel)*(p.width + (xmargin<<1)) );
       }
     }
-#endif
   }
 
   m_bIsBorderExtended = true;
@@ -1618,21 +1229,10 @@ void Picture::addPictureToHashMapForInter()
       bIsBlockSame[i][j] = new bool[picWidth*picHeight];
     }
   }
-#if JVET_N0247_HASH_IMPROVE
   m_hashMap.create(picWidth, picHeight);
-#else
-  m_hashMap.create();
-#endif
   m_hashMap.generateBlock2x2HashValue(getOrigBuf(), picWidth, picHeight, slices[0]->getSPS()->getBitDepths(), blockHashValues[0], bIsBlockSame[0]);//2x2
   m_hashMap.generateBlockHashValue(picWidth, picHeight, 4, 4, blockHashValues[0], blockHashValues[1], bIsBlockSame[0], bIsBlockSame[1]);//4x4
   m_hashMap.addToHashMapByRowWithPrecalData(blockHashValues[1], bIsBlockSame[1][2], picWidth, picHeight, 4, 4);
-#if !JVET_N0247_HASH_IMPROVE
-  m_hashMap.generateRectangleHashValue(picWidth, picHeight, 8, 4, blockHashValues[1], blockHashValues[0], bIsBlockSame[1], bIsBlockSame[0]);//8x4
-  m_hashMap.addToHashMapByRowWithPrecalData(blockHashValues[0], bIsBlockSame[0][2], picWidth, picHeight, 8, 4);
-
-  m_hashMap.generateRectangleHashValue(picWidth, picHeight, 4, 8, blockHashValues[1], blockHashValues[0], bIsBlockSame[1], bIsBlockSame[0]);//4x8
-  m_hashMap.addToHashMapByRowWithPrecalData(blockHashValues[0], bIsBlockSame[0][2], picWidth, picHeight, 4, 8);
-#endif
 
   m_hashMap.generateBlockHashValue(picWidth, picHeight, 8, 8, blockHashValues[1], blockHashValues[0], bIsBlockSame[1], bIsBlockSame[0]);//8x8
   m_hashMap.addToHashMapByRowWithPrecalData(blockHashValues[0], bIsBlockSame[0][2], picWidth, picHeight, 8, 8);
diff --git a/source/Lib/CommonLib/Picture.h b/source/Lib/CommonLib/Picture.h
index 750117d6e..4ccb3ee85 100644
--- a/source/Lib/CommonLib/Picture.h
+++ b/source/Lib/CommonLib/Picture.h
@@ -115,7 +115,6 @@ class AQpLayer;
 
 typedef std::list<SEI*> SEIMessages;
 
-#if JVET_N0857_TILES_BRICKS
 
 class Brick
 {
@@ -143,62 +142,7 @@ public:
   uint32_t  getFirstCtuRsAddr      () const                  { return m_firstCtuRsAddr; }
 };
 
-#else
-class Tile
-{
-private:
-  uint32_t      m_tileWidthInCtus;
-  uint32_t      m_tileHeightInCtus;
-  uint32_t      m_rightEdgePosInCtus;
-  uint32_t      m_bottomEdgePosInCtus;
-  uint32_t      m_firstCtuRsAddr;
-
-public:
-  Tile();
-  virtual ~Tile();
-
-  void      setTileWidthInCtus     ( uint32_t i )            { m_tileWidthInCtus = i; }
-  uint32_t      getTileWidthInCtus     () const              { return m_tileWidthInCtus; }
-  void      setTileHeightInCtus    ( uint32_t i )            { m_tileHeightInCtus = i; }
-  uint32_t      getTileHeightInCtus    () const              { return m_tileHeightInCtus; }
-  void      setRightEdgePosInCtus  ( uint32_t i )            { m_rightEdgePosInCtus = i; }
-  uint32_t      getRightEdgePosInCtus  () const              { return m_rightEdgePosInCtus; }
-  void      setBottomEdgePosInCtus ( uint32_t i )            { m_bottomEdgePosInCtus = i; }
-  uint32_t      getBottomEdgePosInCtus () const              { return m_bottomEdgePosInCtus; }
-  void      setFirstCtuRsAddr      ( uint32_t i )            { m_firstCtuRsAddr = i; }
-  uint32_t      getFirstCtuRsAddr      () const              { return m_firstCtuRsAddr; }
-};
-#endif
 
-#if !JVET_N0857_TILES_BRICKS
-struct TileMap
-{
-  TileMap();
-
-  void create( const SPS& sps, const PPS& pps );
-  void destroy();
-
-  uint32_t getTileIdxMap( uint32_t ctuRsAddr )       const { return *(tileIdxMap + ctuRsAddr); }
-  uint32_t getTileIdxMap( const Position& pos )  const { return getTileIdxMap( ( pos.x / pcv->maxCUWidth ) + ( pos.y / pcv->maxCUHeight ) * pcv->widthInCtus ); };
-  uint32_t getCtuTsToRsAddrMap( uint32_t ctuTsAddr ) const { return *(ctuTsToRsAddrMap + (ctuTsAddr>=pcv->sizeInCtus ? pcv->sizeInCtus : ctuTsAddr)); }
-  uint32_t getCtuRsToTsAddrMap( uint32_t ctuRsAddr ) const { return *(ctuRsToTsAddrMap + (ctuRsAddr>=pcv->sizeInCtus ? pcv->sizeInCtus : ctuRsAddr)); }
-  uint32_t getSubstreamForCtuAddr(const uint32_t ctuAddr, const bool bAddressInRaster, Slice *pcSlice) const;
-
-  const PreCalcValues* pcv;
-  std::vector<Tile> tiles;
-  uint32_t  numTiles;
-  uint32_t  numTileColumns;
-  uint32_t  numTileRows;
-  uint32_t* tileIdxMap;
-  uint32_t* ctuTsToRsAddrMap;
-  uint32_t* ctuRsToTsAddrMap;
-
-  void initTileMap( const SPS& sps, const PPS& pps );
-  void initCtuTsRsAddrMap();
-  uint32_t calculateNextCtuRSAddr( const uint32_t currCtuRsAddr ) const;
-};
-
-#else
 struct BrickMap
 {
   BrickMap();
@@ -231,7 +175,6 @@ struct BrickMap
   void initBrickMap( const SPS& sps, const PPS& pps );
   void initCtuBsRsAddrMap();
 };
-#endif
 
 #if ENABLE_SPLIT_PARALLELISM
 #define M_BUFS(JID,PID) m_bufs[JID][PID]
@@ -273,7 +216,6 @@ struct Picture : public UnitArea
          PelUnitBuf getResiBuf(const UnitArea &unit);
   const CPelUnitBuf getResiBuf(const UnitArea &unit) const;
 
-#if JVET_N0070_WRAPAROUND
          PelBuf     getRecoBuf(const ComponentID compID, bool wrap=false);
   const CPelBuf     getRecoBuf(const ComponentID compID, bool wrap=false) const;
          PelBuf     getRecoBuf(const CompArea &blk, bool wrap=false);
@@ -282,16 +224,6 @@ struct Picture : public UnitArea
   const CPelUnitBuf getRecoBuf(const UnitArea &unit, bool wrap=false) const;
          PelUnitBuf getRecoBuf(bool wrap=false);
   const CPelUnitBuf getRecoBuf(bool wrap=false) const;
-#else
-         PelBuf     getRecoBuf(const ComponentID compID);
-  const CPelBuf     getRecoBuf(const ComponentID compID) const;
-         PelBuf     getRecoBuf(const CompArea &blk);
-  const CPelBuf     getRecoBuf(const CompArea &blk) const;
-         PelUnitBuf getRecoBuf(const UnitArea &unit);
-  const CPelUnitBuf getRecoBuf(const UnitArea &unit) const;
-         PelUnitBuf getRecoBuf();
-  const CPelUnitBuf getRecoBuf() const;
-#endif
 
          PelBuf     getBuf(const ComponentID compID, const PictureType &type);
   const CPelBuf     getBuf(const ComponentID compID, const PictureType &type) const;
@@ -301,15 +233,7 @@ struct Picture : public UnitArea
   const CPelUnitBuf getBuf(const UnitArea &unit,     const PictureType &type) const;
 
   void extendPicBorder();
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS  
   void finalInit(const SPS& sps, const PPS& pps, APS** alfApss, APS& lmcsAps);
-#else
-  void finalInit(const SPS& sps, const PPS& pps, APS** apss);
-#endif
-#else
-  void finalInit(const SPS& sps, const PPS& pps, APS& aps);
-#endif
 
   int  getPOC()                               const { return poc; }
   void setBorderExtension( bool bFlag)              { m_bIsBorderExtended = bFlag;}
@@ -361,11 +285,7 @@ public:
   Slice        *swapSliceObject(Slice * p, uint32_t i);
   void         clearSliceBuffer();
 
-#if !JVET_N0857_TILES_BRICKS
-  TileMap*     tileMap;
-#else
   BrickMap*     brickMap;
-#endif
   MCTSInfo     mctsInfo;
   std::vector<AQpLayer*> aqlayer;
 
@@ -412,7 +332,6 @@ public:
       std::fill( m_alfCtuEnableFlag[compIdx].begin(), m_alfCtuEnableFlag[compIdx].end(), 0 );
     }
   }
-#if JVET_N0415_CTB_ALF
   std::vector<short> m_alfCtbFilterIndex;
   short* getAlfCtbFilterIndex() { return m_alfCtbFilterIndex.data(); }
   std::vector<short>& getAlfCtbFilterIndexVec() { return m_alfCtbFilterIndex; }
@@ -424,7 +343,6 @@ public:
       m_alfCtbFilterIndex[i] = 0;
     }
   }
-#endif
 };
 
 int calcAndPrintHashStatus(const CPelUnitBuf& pic, const class SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths, const MsgLevel msgl);
diff --git a/source/Lib/CommonLib/Quant.cpp b/source/Lib/CommonLib/Quant.cpp
index 8950a4adc..faffc57c5 100644
--- a/source/Lib/CommonLib/Quant.cpp
+++ b/source/Lib/CommonLib/Quant.cpp
@@ -103,21 +103,12 @@ QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int
 
   if (isChroma(compID))
   {
-#if JVET_N0054_JOINT_CHROMA
     chromaQpOffset += tu.cs->pps->getQpOffset            ( tu.jointCbCr ? JOINT_CbCr : compID );
     chromaQpOffset += tu.cs->slice->getSliceChromaQpDelta( tu.jointCbCr ? JOINT_CbCr : compID );
-#else
-    chromaQpOffset += tu.cs->pps->getQpOffset( compID );
-    chromaQpOffset += tu.cs->slice->getSliceChromaQpDelta( compID );
-#endif
     chromaQpOffset += tu.cs->pps->getPpsRangeExtension().getChromaQpOffsetListEntry( tu.cu->chromaQpAdj ).u.offset[int( compID ) - 1];
   }
 
-#if HM_QTBT_AS_IN_JEM_QUANT
   int dqp = 0;
-#else
-  int dqp = ( TU::needsQP3Offset(tu, compID) ? -3 : 0 );
-#endif
 
   *this = QpParam(QP <= -MAX_INT ? tu.cu->qp : QP, toChannelType(compID), tu.cs->sps->getQpBDOffset(toChannelType(compID)), chromaQpOffset, tu.chromaFormat, dqp);
 }
@@ -129,19 +120,14 @@ QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int
 
 Quant::Quant( const Quant* other )
 {
-#if HEVC_USE_SCALING_LISTS
   xInitScalingList( other );
-#endif
 }
 
 Quant::~Quant()
 {
-#if HEVC_USE_SCALING_LISTS
   xDestroyScalingList();
-#endif
 }
 
-#if JVET_N0413_RDPCM
 void invResDPCM( const TransformUnit &tu, const ComponentID &compID, CoeffBuf &dstBuf )
 {
   const CompArea &rect = tu.blocks[compID];
@@ -220,9 +206,7 @@ void fwdResDPCM( TransformUnit &tu, const ComponentID &compID )
     }
   }
 }
-#endif
 
-#if HEVC_USE_SIGN_HIDING
 // To minimize the distortion only. No rate is considered.
 void Quant::xSignBitHidingHDQ( TCoeff* pQCoef, const TCoeff* pCoef, TCoeff* deltaU, const CoeffCodingContext& cctx, const int maxLog2TrDynamicRange )
 {
@@ -357,7 +341,6 @@ void Quant::xSignBitHidingHDQ( TCoeff* pQCoef, const TCoeff* pCoef, TCoeff* delt
 
   return;
 }
-#endif
 
 void Quant::dequant(const TransformUnit &tu,
                              CoeffBuf      &dstCoeff,
@@ -368,22 +351,16 @@ void Quant::dequant(const TransformUnit &tu,
   const CompArea       &area               = tu.blocks[compID];
   const uint32_t            uiWidth            = area.width;
   const uint32_t            uiHeight           = area.height;
-#if !JVET_N0413_RDPCM
-  const TCoeff   *const piQCoef            = tu.getCoeffs(compID).buf;
-#endif
         TCoeff   *const piCoef             = dstCoeff.buf;
   const uint32_t            numSamplesInBlock  = uiWidth * uiHeight;
   const int             maxLog2TrDynamicRange = sps->getMaxLog2TrDynamicRange(toChannelType(compID));
   const TCoeff          transformMinimum   = -(1 << maxLog2TrDynamicRange);
   const TCoeff          transformMaximum   =  (1 << maxLog2TrDynamicRange) - 1;
-#if HEVC_USE_SCALING_LISTS
   const bool            isTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
   const bool            enableScalingLists = getUseScalingList(uiWidth, uiHeight, isTransformSkip);
   const int             scalingListType    = getScalingListType(tu.cu->predMode, compID);
-#endif
   const int             channelBitDepth    = sps->getBitDepth(toChannelType(compID));
 
-#if JVET_N0413_RDPCM
   const TCoeff          *coef;
   if( tu.cu->bdpcmMode && isLuma(compID) )
   {
@@ -395,50 +372,20 @@ void Quant::dequant(const TransformUnit &tu,
     coef = tu.getCoeffs(compID).buf;
   }
   const TCoeff          *const piQCoef = coef;
-#endif
-#if HEVC_USE_SCALING_LISTS
   CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
-#endif
   CHECK(uiWidth > m_uiMaxTrSize, "Unsupported transformation size");
 
   // Represents scaling through forward transform
   const bool bClipTransformShiftTo0 = tu.mtsIdx!=MTS_SKIP && sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag();
   const int  originalTransformShift = getTransformShift(channelBitDepth, area.size(), maxLog2TrDynamicRange);
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool needSqrtAdjustment     = TU::needsBlockSizeTrafoScale( tu, compID );
   const int  iTransformShift        = (bClipTransformShiftTo0 ? std::max<int>(0, originalTransformShift) : originalTransformShift) + (needSqrtAdjustment?-1:0);
-#else
-  const int  iTransformShift        = bClipTransformShiftTo0 ? std::max<int>(0, originalTransformShift) : originalTransformShift;
-#endif
 
   const int QP_per = cQP.per;
   const int QP_rem = cQP.rem;
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
-#if HEVC_USE_SCALING_LISTS
   const int  rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
-#else
-  const int  rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per));
-#endif
-#else
-#if HM_QTBT_AS_IN_JEM_QUANT
-  const bool needsScalingCorrection = TU::needsBlockSizeTrafoScale( tu, compID );
-  const int  NEScale    = TU::needsSqrt2Scale( tu, compID ) ? 181 : 1;
-#if HEVC_USE_SCALING_LISTS
-  const int  rightShift = (needsScalingCorrection ?   8 : 0 ) + (IQUANT_SHIFT - (iTransformShift + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
-#else
-  const int  rightShift = (needsScalingCorrection ?   8 : 0 ) + (IQUANT_SHIFT - (iTransformShift + QP_per));
-#endif
-#else
-#if HEVC_USE_SCALING_LISTS
-  const int  rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
-#else
-  const int  rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per));
-#endif
-#endif
-#endif // JVET_N0246_MODIFIED_QUANTSCALES
 
-#if HEVC_USE_SCALING_LISTS
   if(enableScalingLists)
   {
     //from the dequantization equation:
@@ -461,11 +408,7 @@ void Quant::dequant(const TransformUnit &tu,
       for( int n = 0; n < numSamplesInBlock; n++ )
       {
         const TCoeff           clipQCoef = TCoeff(Clip3<Intermediate_Int>(inputMinimum, inputMaximum, piQCoef[n]));
-#if HM_QTBT_AS_IN_JEM_QUANT && !JVET_N0246_MODIFIED_QUANTSCALES
-        const Intermediate_Int iCoeffQ   = ((Intermediate_Int(clipQCoef) * piDequantCoef[n] * NEScale) + iAdd ) >> rightShift;
-#else
         const Intermediate_Int iCoeffQ   = ((Intermediate_Int(clipQCoef) * piDequantCoef[n]) + iAdd ) >> rightShift;
-#endif
 
         piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
       }
@@ -477,11 +420,7 @@ void Quant::dequant(const TransformUnit &tu,
       for( int n = 0; n < numSamplesInBlock; n++ )
       {
         const TCoeff           clipQCoef = TCoeff(Clip3<Intermediate_Int>(inputMinimum, inputMaximum, piQCoef[n]));
-#if HM_QTBT_AS_IN_JEM_QUANT && !JVET_N0246_MODIFIED_QUANTSCALES
-        const Intermediate_Int iCoeffQ   = (Intermediate_Int(clipQCoef) * piDequantCoef[n] * NEScale) << leftShift;
-#else
         const Intermediate_Int iCoeffQ   = (Intermediate_Int(clipQCoef) * piDequantCoef[n]) << leftShift;
-#endif
 
         piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
       }
@@ -489,16 +428,7 @@ void Quant::dequant(const TransformUnit &tu,
   }
   else
   {
-#endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
     const int scale     = g_invQuantScales[needSqrtAdjustment?1:0][QP_rem];
-#else
-#if HM_QTBT_AS_IN_JEM_QUANT
-    const int scale     = g_invQuantScales[QP_rem] * NEScale;
-#else
-    const int scale     = g_invQuantScales[QP_rem];
-#endif
-#endif
     const int scaleBits = ( IQUANT_SHIFT + 1 );
 
     //from the dequantisation equation:
@@ -532,9 +462,7 @@ void Quant::dequant(const TransformUnit &tu,
         piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
       }
     }
-#if HEVC_USE_SCALING_LISTS
   }
-#endif
 }
 
 void Quant::init( uint32_t uiMaxTrSize,
@@ -565,7 +493,6 @@ void Quant::copyState( const Quant& other )
 }
 #endif
 
-#if HEVC_USE_SCALING_LISTS
 /** set quantized matrix coefficient for encode
  * \param scalingList            quantized matrix address
  * \param format                 chroma format
@@ -577,18 +504,12 @@ void Quant::setScalingList(ScalingList *scalingList, const int maxLog2TrDynamicR
   const int minimumQp = 0;
   const int maximumQp = SCALING_LIST_REM_NUM;
 
-#if JVET_N0847_SCALING_LISTS
   for(uint32_t size = SCALING_LIST_FIRST_CODED; size <= SCALING_LIST_LAST_CODED; size++) //2x2->64x64
-#else
-  for(uint32_t size = 0; size < SCALING_LIST_SIZE_NUM; size++)
-#endif
   {
     for(uint32_t list = 0; list < SCALING_LIST_NUM; list++)
     {
-#if JVET_N0847_SCALING_LISTS  
       if (size == SCALING_LIST_2x2 && list % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0) //skip 2x2 luma
         continue;
-#endif
       for(int qp = minimumQp; qp < maximumQp; qp++)
       {
         xSetScalingListEnc(scalingList,list,size,qp);
@@ -596,7 +517,6 @@ void Quant::setScalingList(ScalingList *scalingList, const int maxLog2TrDynamicR
       }
     }
   }
-#if JVET_N0847_SCALING_LISTS
   //based on square result and apply downsample technology
   for (uint32_t sizew = 0; sizew <= SCALING_LIST_LAST_CODED; sizew++) //7
   {
@@ -613,7 +533,6 @@ void Quant::setScalingList(ScalingList *scalingList, const int maxLog2TrDynamicR
       }
     }
   }
-#endif
 }
 /** set quantized matrix coefficient for decode
  * \param scalingList quantized matrix address
@@ -624,25 +543,18 @@ void Quant::setScalingListDec(const ScalingList &scalingList)
   const int minimumQp = 0;
   const int maximumQp = SCALING_LIST_REM_NUM;
 
-#if JVET_N0847_SCALING_LISTS
   for (uint32_t size = SCALING_LIST_FIRST_CODED; size <= SCALING_LIST_LAST_CODED; size++)
-#else
-  for(uint32_t size = 0; size < SCALING_LIST_SIZE_NUM; size++)
-#endif
   {
     for(uint32_t list = 0; list < SCALING_LIST_NUM; list++)
     {
-#if JVET_N0847_SCALING_LISTS 
       if (size == SCALING_LIST_2x2 && list % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0) //skip 2x2 luma
         continue;
-#endif
       for(int qp = minimumQp; qp < maximumQp; qp++)
       {
         xSetScalingListDec(scalingList,list,size,qp);
       }
     }
   }
-#if JVET_N0847_SCALING_LISTS
   //based on square result and apply downsample technology
   //based on square result and apply downsample technology
   for (uint32_t sizew = 0; sizew <= SCALING_LIST_LAST_CODED; sizew++) //7
@@ -659,7 +571,6 @@ void Quant::setScalingListDec(const ScalingList &scalingList)
       }
     }
   }
-#endif
 }
 
 
@@ -679,12 +590,8 @@ void Quant::xSetScalingListEnc(ScalingList *scalingList, uint32_t listId, uint32
   int *coeff  = scalingList->getScalingListAddress(sizeId,listId);
   quantcoeff  = getQuantCoeff(listId, qp, sizeId, sizeId);
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool blockIsNotPowerOf4 = ((g_aucLog2[width] + g_aucLog2[height]) & 1) == 1;
   int quantScales = g_quantScales[blockIsNotPowerOf4?1:0][qp];
-#else
-  int quantScales = g_quantScales[qp];
-#endif
 
   processScalingListEnc(coeff,
                         quantcoeff,
@@ -711,12 +618,8 @@ void Quant::xSetScalingListDec(const ScalingList &scalingList, uint32_t listId,
 
   dequantcoeff = getDequantCoeff(listId, qp, sizeId, sizeId);
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool blockIsNotPowerOf4 = ((g_aucLog2[width] + g_aucLog2[height]) & 1) == 1;
   int invQuantScale = g_invQuantScales[blockIsNotPowerOf4?1:0][qp];
-#else
-  int invQuantScale = g_invQuantScales[qp];
-#endif
 
   processScalingListDec(coeff,
                         dequantcoeff,
@@ -726,7 +629,6 @@ void Quant::xSetScalingListDec(const ScalingList &scalingList, uint32_t listId,
                         scalingList.getScalingListDC(sizeId,listId));
 }
 
-#if JVET_N0847_SCALING_LISTS
 /** set quantized matrix coefficient for encode
 * \param scalingList quantized matrix address
 * \param listId List index
@@ -781,7 +683,6 @@ void Quant::xSetRecScalingListDec(const ScalingList &scalingList, uint32_t listI
                         (largeSideId >= 3 ? 8 : 4),
                         scalingList.getScalingListDC(largeSideId, listId));
 }
-#endif
 /** set flat matrix value to quantized coefficient
  */
 void Quant::setFlatScalingList(const int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths)
@@ -816,14 +717,9 @@ void Quant::xSetFlatScalingList(uint32_t list, uint32_t sizeX, uint32_t sizeY, i
   int *quantcoeff;
   int *dequantcoeff;
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool blockIsNotPowerOf4 = ((g_aucLog2[g_scalingListSizeX[sizeX]] + g_aucLog2[g_scalingListSizeX[sizeY]]) & 1) == 1;
   int quantScales    = g_quantScales   [blockIsNotPowerOf4?1:0][qp];
   int invQuantScales = g_invQuantScales[blockIsNotPowerOf4?1:0][qp] << 4;
-#else
-  int quantScales    = g_quantScales   [qp];
-  int invQuantScales = g_invQuantScales[qp] << 4;
-#endif
 
   quantcoeff   = getQuantCoeff(list, qp, sizeX, sizeY);
   dequantcoeff = getDequantCoeff(list, qp, sizeX, sizeY);
@@ -847,7 +743,6 @@ void Quant::xSetFlatScalingList(uint32_t list, uint32_t sizeX, uint32_t sizeY, i
  */
 void Quant::processScalingListEnc( int *coeff, int *quantcoeff, int quantScales, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc)
 {
-#if JVET_N0847_SCALING_LISTS
   if (height != width)
   {
     for (uint32_t j = 0; j<height; j++)
@@ -879,7 +774,6 @@ void Quant::processScalingListEnc( int *coeff, int *quantcoeff, int quantScales,
     }
     return;
   }
-#endif
   for(uint32_t j=0;j<height;j++)
   {
     for(uint32_t i=0;i<width;i++)
@@ -906,7 +800,6 @@ void Quant::processScalingListEnc( int *coeff, int *quantcoeff, int quantScales,
  */
 void Quant::processScalingListDec( const int *coeff, int *dequantcoeff, int invQuantScales, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc)
 {
-#if JVET_N0847_SCALING_LISTS
   if (height != width)
   {
     for (uint32_t j = 0; j<height; j++)
@@ -937,7 +830,6 @@ void Quant::processScalingListDec( const int *coeff, int *dequantcoeff, int invQ
     }
     return;
   }
-#endif
   for(uint32_t j=0;j<height;j++)
   {
     for(uint32_t i=0;i<width;i++)
@@ -1009,16 +901,13 @@ void Quant::xDestroyScalingList()
     }
   }
 }
-#endif
 
 void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx)
 {
   const SPS &sps            = *tu.cs->sps;
   const CompArea &rect      = tu.blocks[compID];
-#if HEVC_USE_SCALING_LISTS
   const uint32_t uiWidth        = rect.width;
   const uint32_t uiHeight       = rect.height;
-#endif
   const int channelBitDepth = sps.getBitDepth(toChannelType(compID));
 
   const CCoeffBuf &piCoef   = pSrc;
@@ -1028,19 +917,12 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
   const int  maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
 
   {
-#if HEVC_USE_SIGN_HIDING
     CoeffCodingContext cctx(tu, compID, tu.cs->slice->getSignDataHidingEnabledFlag());
-#else
-    CoeffCodingContext cctx(tu, compID);
-#endif
 
     const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
     const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
 
-#if HEVC_USE_SIGN_HIDING
     TCoeff deltaU[MAX_TB_SIZEY * MAX_TB_SIZEY];
-#endif
-#if HEVC_USE_SCALING_LISTS
     int scalingListType = getScalingListType(tu.cu->predMode, compID);
     CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
     const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth];
@@ -1048,8 +930,6 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
     int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth-1, uiLog2TrHeight-1);
 
     const bool enableScalingLists             = getUseScalingList(uiWidth, uiHeight, useTransformSkip);
-#endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
 
     // for blocks that where width*height != 4^N, the effective scaling applied during transformation cannot be
     // compensated by a bit-shift (the quantised result will be sqrt(2) * larger than required).
@@ -1057,77 +937,38 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
     const bool needSqrtAdjustment= TU::needsBlockSizeTrafoScale( tu, compID );
     const int defaultQuantisationCoefficient    = g_quantScales[needSqrtAdjustment?1:0][cQP.rem];
     int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange) + ( needSqrtAdjustment?-1:0);
-#else
-    const int  defaultQuantisationCoefficient = g_quantScales[cQP.rem];
-
-    /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
-     * implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
-     * uiLog2TrSize applied in iTransformShift, such that the result is 1/sqrt(2) the required result (i.e. smaller)
-     * Then a QP+3 (sqrt(2)) or QP-3 (1/sqrt(2)) method could be used to get the required result
-     */
-    // Represents scaling through forward transform
-    int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
-#endif
 
     if (useTransformSkip && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag())
     {
       iTransformShift = std::max<int>(0, iTransformShift);
     }
 
-#if !JVET_N0246_MODIFIED_QUANTSCALES
-    int iWHScale = 1;
-#if HM_QTBT_AS_IN_JEM_QUANT
-    if( TU::needsBlockSizeTrafoScale( tu, compID ) )
-    {
-      iTransformShift += ADJ_QUANT_SHIFT;
-      iWHScale = 181;
-    }
-#endif
-#endif
 
     const int iQBits = QUANT_SHIFT + cQP.per + iTransformShift;
     // QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset
 
     const int64_t iAdd = int64_t(tu.cs->slice->isIRAP() ? 171 : 85) << int64_t(iQBits - 9);
-#if HEVC_USE_SIGN_HIDING
     const int qBits8 = iQBits - 8;
-#endif
 
     for (int uiBlockPos = 0; uiBlockPos < piQCoef.area(); uiBlockPos++)
     {
       const TCoeff iLevel   = piCoef.buf[uiBlockPos];
       const TCoeff iSign    = (iLevel < 0 ? -1: 1);
 
-#if HEVC_USE_SCALING_LISTS
       const int64_t  tmpLevel = (int64_t)abs(iLevel) * (enableScalingLists ? piQuantCoeff[uiBlockPos] : defaultQuantisationCoefficient);
-#else
-      const int64_t  tmpLevel = (int64_t)abs(iLevel) * defaultQuantisationCoefficient;
-#endif
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
       const TCoeff quantisedMagnitude = TCoeff((tmpLevel + iAdd ) >> iQBits);
-#if HEVC_USE_SIGN_HIDING
       deltaU[uiBlockPos] = (TCoeff)((tmpLevel - ((int64_t)quantisedMagnitude<<iQBits) )>> qBits8);
-#endif
-#else
-      const TCoeff quantisedMagnitude = TCoeff((tmpLevel * iWHScale + iAdd ) >> iQBits);
-#if HEVC_USE_SIGN_HIDING
-      deltaU[uiBlockPos] = (TCoeff)((tmpLevel * iWHScale - ((int64_t)quantisedMagnitude<<iQBits) )>> qBits8);
-#endif
-#endif
 
       uiAbsSum += quantisedMagnitude;
       const TCoeff quantisedCoefficient = quantisedMagnitude * iSign;
 
       piQCoef.buf[uiBlockPos] = Clip3<TCoeff>( entropyCodingMinimum, entropyCodingMaximum, quantisedCoefficient );
     } // for n
-#if JVET_N0413_RDPCM
     if( tu.cu->bdpcmMode && isLuma(compID) )
     {
       fwdResDPCM( tu, compID );
     }
-#endif
-#if HEVC_USE_SIGN_HIDING
     if( cctx.signHiding() )
     {
       if(uiAbsSum >= 2) //this prevents TUs with only one coefficient of value 1 from being tested
@@ -1135,7 +976,6 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
         xSignBitHidingHDQ(piQCoef.buf, piCoef.buf, deltaU, cctx, maxLog2TrDynamicRange);
       }
     }
-#endif
   } //if RDOQ
   //return;
 }
@@ -1144,10 +984,8 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
 {
   const SPS &sps            = *tu.cs->sps;
   const CompArea &rect      = tu.blocks[compID];
-#if HEVC_USE_SCALING_LISTS
   const uint32_t uiWidth        = rect.width;
   const uint32_t uiHeight       = rect.height;
-#endif
   const int channelBitDepth = sps.getBitDepth(toChannelType(compID));
 
   const CCoeffBuf piCoef    = pSrc;
@@ -1155,7 +993,6 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
   const bool useTransformSkip      = tu.mtsIdx==MTS_SKIP;
   const int  maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
 
-#if HEVC_USE_SCALING_LISTS
   int scalingListType = getScalingListType(tu.cu->predMode, compID);
   CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
 
@@ -1164,8 +1001,6 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
   int *piQuantCoeff         = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth-1, uiLog2TrHeight-1);
 
   const bool enableScalingLists             = getUseScalingList(uiWidth, uiHeight, (useTransformSkip != 0));
-#endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
 
   /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
     * implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
@@ -1175,39 +1010,15 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
   const bool needSqrtAdjustment= TU::needsBlockSizeTrafoScale( tu, compID );
   const int defaultQuantisationCoefficient    = g_quantScales[needSqrtAdjustment?1:0][cQP.rem];
   int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange) + (needSqrtAdjustment?-1:0);
-#else
-  const int  defaultQuantisationCoefficient = g_quantScales[cQP.rem];
-
-  /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
-    * implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
-    * uiLog2TrSize applied in iTransformShift, such that the result is 1/sqrt(2) the required result (i.e. smaller)
-    * Then a QP+3 (sqrt(2)) or QP-3 (1/sqrt(2)) method could be used to get the required result
-    */
-
-  // Represents scaling through forward transform
-  int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
-#endif
 
   if (useTransformSkip && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag())
   {
     iTransformShift = std::max<int>(0, iTransformShift);
   }
 
-#if !JVET_N0246_MODIFIED_QUANTSCALES
-  int iWHScale = 1;
-#if HM_QTBT_AS_IN_JEM_QUANT
-  if( TU::needsBlockSizeTrafoScale( tu, compID ) )
-  {
-    iTransformShift += ADJ_QUANT_SHIFT;
-    iWHScale = 181;
-  }
-#endif
-#endif
 
   const int iQBits = QUANT_SHIFT + cQP.per + iTransformShift;
-#if JVET_N0246_MODIFIED_QUANTSCALES
   assert(iQBits>=0);
-#endif
   // QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset
 
   // iAdd is different from the iAdd used in normal quantization
@@ -1216,16 +1027,8 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
   for (int uiBlockPos = 0; uiBlockPos < rect.area(); uiBlockPos++)
   {
     const TCoeff iLevel   = piCoef.buf[uiBlockPos];
-#if HEVC_USE_SCALING_LISTS
     const int64_t  tmpLevel = (int64_t)abs(iLevel) * (enableScalingLists ? piQuantCoeff[uiBlockPos] : defaultQuantisationCoefficient);
-#else
-    const int64_t  tmpLevel = (int64_t)abs(iLevel) * defaultQuantisationCoefficient;
-#endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
     const TCoeff quantisedMagnitude = TCoeff((tmpLevel + iAdd ) >> iQBits);
-#else
-    const TCoeff quantisedMagnitude = TCoeff((tmpLevel * iWHScale + iAdd ) >> iQBits);
-#endif
 
     if (quantisedMagnitude != 0)
     {
@@ -1240,30 +1043,20 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co
 {
   const SPS           &sps = *tu.cs->sps;
   const CompArea      &rect                           = tu.blocks[compID];
-#if HEVC_USE_SCALING_LISTS
   const uint32_t           uiWidth                        = rect.width;
   const uint32_t           uiHeight                       = rect.height;
-#endif
   const int            maxLog2TrDynamicRange          = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
   const int            channelBitDepth                = sps.getBitDepth(toChannelType(compID));
   const int            iTransformShift                = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
-#if HEVC_USE_SCALING_LISTS
   const int            scalingListType                = getScalingListType(tu.cu->predMode, compID);
   const bool           enableScalingLists             = getUseScalingList(uiWidth, uiHeight, true);
-#endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const int            defaultQuantisationCoefficient = g_quantScales[0][cQP.rem];
-#else
-  const int            defaultQuantisationCoefficient = g_quantScales[cQP.rem];
-#endif
 
-#if HEVC_USE_SCALING_LISTS
   CHECK( scalingListType >= SCALING_LIST_NUM, "Invalid scaling list" );
 
   const uint32_t uiLog2TrWidth      = g_aucLog2[uiWidth];
   const uint32_t uiLog2TrHeight     = g_aucLog2[uiHeight];
   const int *const piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth-1, uiLog2TrHeight-1);
-#endif
 
   /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
   * implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
@@ -1291,13 +1084,9 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co
   // quantization
   const TCoeff iSign = (transformedCoefficient < 0 ? -1: 1);
 
-#if HEVC_USE_SCALING_LISTS
   const int quantisationCoefficient = enableScalingLists ? piQuantCoeff[uiPos] : defaultQuantisationCoefficient;
 
   const int64_t tmpLevel = (int64_t)abs(transformedCoefficient) * quantisationCoefficient;
-#else
-  const int64_t tmpLevel = (int64_t)abs(transformedCoefficient) * defaultQuantisationCoefficient;
-#endif
 
   const TCoeff quantisedCoefficient = (TCoeff((tmpLevel + iAdd ) >> iQBits)) * iSign;
 
@@ -1310,25 +1099,19 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
 {
   const SPS           &sps                    = *tu.cs->sps;
   const CompArea      &rect                   = tu.blocks[compID];
-#if HEVC_USE_SCALING_LISTS
   const uint32_t           uiWidth                = rect.width;
   const uint32_t           uiHeight               = rect.height;
-#endif
   const int            QP_per                 = cQP.per;
   const int            QP_rem                 = cQP.rem;
   const int            maxLog2TrDynamicRange  = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
   const int            channelBitDepth        = sps.getBitDepth(toChannelType(compID));
   const int            iTransformShift        = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
-#if HEVC_USE_SCALING_LISTS
   const int            scalingListType        = getScalingListType(tu.cu->predMode, compID);
   const bool           enableScalingLists     = getUseScalingList(uiWidth, uiHeight, true);
 
   CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
 
   const int rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
-#else
-  const int rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per));
-#endif
 
   const TCoeff transformMinimum = -(1 << maxLog2TrDynamicRange);
   const TCoeff transformMaximum =  (1 << maxLog2TrDynamicRange) - 1;
@@ -1337,7 +1120,6 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
 
   TCoeff dequantisedSample;
 
-#if HEVC_USE_SCALING_LISTS
   if (enableScalingLists)
   {
     const uint32_t             dequantCoefBits = 1 + IQUANT_SHIFT + SCALING_LIST_BITS;
@@ -1369,12 +1151,7 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
   }
   else
   {
-#endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
     const int scale = g_invQuantScales[0][QP_rem];
-#else
-    const int scale = g_invQuantScales[QP_rem];
-#endif
     const int scaleBits = (IQUANT_SHIFT + 1);
 
     const uint32_t             targetInputBitDepth = std::min<uint32_t>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - scaleBits));
@@ -1397,9 +1174,7 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
 
       dequantisedSample = TCoeff(Clip3<Intermediate_Int>(transformMinimum, transformMaximum, iCoeffQ));
     }
-#if HEVC_USE_SCALING_LISTS
   }
-#endif
 
   // Inverse transform-skip
 
diff --git a/source/Lib/CommonLib/Quant.h b/source/Lib/CommonLib/Quant.h
index 134c54578..b53de50b4 100644
--- a/source/Lib/CommonLib/Quant.h
+++ b/source/Lib/CommonLib/Quant.h
@@ -58,13 +58,11 @@
 // ====================================================================================================================
 // Class definition
 // ====================================================================================================================
-#if JVET_N0413_RDPCM
 struct TrQuantParams
 {
   int     rightShift;
   int     qScale;
 };
-#endif
 
 /// QP struct
 struct QpParam
@@ -117,32 +115,19 @@ public:
   void   setLambda               ( const double dLambda )                      { m_dLambda = dLambda; }
   double getLambda               () const                                      { return m_dLambda; }
 
-#if HEVC_USE_SCALING_LISTS
   int* getQuantCoeff             ( uint32_t list, int qp, uint32_t sizeX, uint32_t sizeY ) { return m_quantCoef            [sizeX][sizeY][list][qp]; };  //!< get Quant Coefficent
   int* getDequantCoeff           ( uint32_t list, int qp, uint32_t sizeX, uint32_t sizeY ) { return m_dequantCoef          [sizeX][sizeY][list][qp]; };  //!< get DeQuant Coefficent
 
   void setUseScalingList         ( bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; };
-#if JVET_N0847_SCALING_LISTS
   bool getUseScalingList         ( const uint32_t width, const uint32_t height, const bool isTransformSkip) { return (m_scalingListEnabledFlag && !isTransformSkip); };
-#else
-  bool getUseScalingList         ( const uint32_t width, const uint32_t height, const bool isTransformSkip) { return (m_scalingListEnabledFlag && (!isTransformSkip || ((width == 4) && (height == 4)))); };
-#endif
   void setScalingListDec         ( const ScalingList &scalingList);
-#if JVET_N0246_MODIFIED_QUANTSCALES
   void processScalingListEnc     ( int *coeff, int *quantcoeff, int qpMod6, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc);
   void processScalingListDec     ( const int *coeff, int *dequantcoeff, int qpMod6, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc);
-#else
-  void processScalingListEnc     ( int *coeff, int *quantcoeff, int quantScales, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc);
-  void processScalingListDec     ( const int *coeff, int *dequantcoeff, int invQuantScales, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc);
-#endif
 
-#if JVET_N0847_SCALING_LISTS
   void  processRecScalingListEnc ( int *coeff, int *quantcoeff, int quantScales, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc);
   void  processRecScalingListDec ( const int *coeff, int *dequantcoeff, int invQuantScales, uint32_t height, uint32_t width, uint32_t ratio, int sizuNum, uint32_t dc);
-#endif
   virtual void setFlatScalingList( const int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths);
   virtual void setScalingList    ( ScalingList *scalingList, const int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths);
-#endif
 
   // quantization
   virtual void quant             ( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx );
@@ -166,34 +151,26 @@ protected:
 #if T0196_SELECTIVE_RDOQ
   bool     m_useSelectiveRDOQ;
 #endif
-#if HEVC_USE_SCALING_LISTS
 private:
   void xInitScalingList   ( const Quant* other );
   void xDestroyScalingList();
   void xSetFlatScalingList( uint32_t list, uint32_t sizeX, uint32_t sizeY, int qp );
   void xSetScalingListEnc ( ScalingList *scalingList, uint32_t list, uint32_t size, int qp );
   void xSetScalingListDec ( const ScalingList &scalingList, uint32_t list, uint32_t size, int qp );
-#if JVET_N0847_SCALING_LISTS
   void xSetRecScalingListEnc( ScalingList *scalingList, uint32_t list, uint32_t sizew, uint32_t sizeh, int qp );
   void xSetRecScalingListDec( const ScalingList &scalingList, uint32_t list, uint32_t sizew, uint32_t sizeh, int qp );
-#endif
-#endif
-#if HEVC_USE_SIGN_HIDING
 private:
   void xSignBitHidingHDQ  (TCoeff* pQCoef, const TCoeff* pCoef, TCoeff* deltaU, const CoeffCodingContext& cctx, const int maxLog2TrDynamicRange);
-#endif
 
 private:
 #if RDOQ_CHROMA_LAMBDA
   double   m_lambdas[MAX_NUM_COMPONENT];
 #endif
-#if HEVC_USE_SCALING_LISTS
   bool     m_scalingListEnabledFlag;
   bool     m_isScalingListOwner;
 
   int      *m_quantCoef            [SCALING_LIST_SIZE_NUM][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM]; ///< array of quantization matrix coefficient 4x4
   int      *m_dequantCoef          [SCALING_LIST_SIZE_NUM][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM]; ///< array of dequantization matrix coefficient 4x4
-#endif
 };// END CLASS DEFINITION Quant
 
 
diff --git a/source/Lib/CommonLib/QuantRDOQ.cpp b/source/Lib/CommonLib/QuantRDOQ.cpp
index 3f79f9581..82039dd61 100644
--- a/source/Lib/CommonLib/QuantRDOQ.cpp
+++ b/source/Lib/CommonLib/QuantRDOQ.cpp
@@ -82,16 +82,12 @@ QuantRDOQ::QuantRDOQ( const Quant* other ) : Quant( other )
 
   const QuantRDOQ *rdoq = dynamic_cast<const QuantRDOQ*>( other );
   CHECK( other && !rdoq, "The RDOQ cast must be successfull!" );
-#if HEVC_USE_SCALING_LISTS
   xInitScalingList( rdoq );
-#endif
 }
 
 QuantRDOQ::~QuantRDOQ()
 {
-#if HEVC_USE_SCALING_LISTS
   xDestroyScalingList();
-#endif
 }
 
 
@@ -347,7 +343,6 @@ inline double QuantRDOQ::xGetIEPRate      (
 
 
 
-#if HEVC_USE_SCALING_LISTS
 /** set quantized matrix coefficient for encode
  * \param scalingList            quantized matrix address
  * \param format                 chroma format
@@ -377,7 +372,6 @@ void QuantRDOQ::setScalingList(ScalingList *scalingList, const int maxLog2TrDyna
 
 
 
-#if JVET_N0847_SCALING_LISTS
 double QuantRDOQ::xGetErrScaleCoeff(const bool needsSqrt2, SizeType width, SizeType height, int qp, const int maxLog2TrDynamicRange, const int channelBitDepth)
 {
   const int iTransformShift = getTransformShift(channelBitDepth, Size(width, height), maxLog2TrDynamicRange);
@@ -388,45 +382,9 @@ double QuantRDOQ::xGetErrScaleCoeff(const bool needsSqrt2, SizeType width, SizeT
   double    finalErrScale = dErrScale / QStep / QStep / (1 << (DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth) << 1));
   return    finalErrScale;
 }
-#endif
-#if HM_QTBT_AS_IN_JEM_QUANT
-#endif
-#else
-
-#if JVET_N0246_MODIFIED_QUANTSCALES
-double QuantRDOQ::xGetErrScaleCoeff( const bool needsSqrt2, SizeType width, SizeType height, int qp, const int maxLog2TrDynamicRange, const int channelBitDepth )
-{
-  const int iTransformShift = getTransformShift(channelBitDepth, Size(width, height), maxLog2TrDynamicRange);
-  double    dErrScale       = (double)( 1 << SCALE_BITS );                                // Compensate for scaling of bitcount in Lagrange cost function
-  double    dTransShift     = (double)iTransformShift + ( needsSqrt2 ? -0.5 : 0.0 );
-  dErrScale                 = dErrScale*pow( 2.0, ( -2.0*dTransShift ) );                     // Compensate for scaling through forward transform
-  const int  QStep          = g_quantScales[needsSqrt2?1:0][qp];
-  double    finalErrScale = dErrScale / QStep / QStep / (1 << (DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth) << 1));
-  return    finalErrScale;
-}
-#else
-double QuantRDOQ::xGetErrScaleCoeff( const bool needsSqrt2, SizeType width, SizeType height, int qp, const int maxLog2TrDynamicRange, const int channelBitDepth )
-{
-  const int iTransformShift = getTransformShift(channelBitDepth, Size(width, height), maxLog2TrDynamicRange);
-#if HM_QTBT_AS_IN_JEM_QUANT
-  double    dErrScale       = (double)( 1 << SCALE_BITS );                                // Compensate for scaling of bitcount in Lagrange cost function
-  double    dTransShift     = (double)iTransformShift + ( needsSqrt2 ? -0.5 : 0.0 );
-  dErrScale                 = dErrScale*pow( 2.0, ( -2.0*dTransShift ) );                     // Compensate for scaling through forward transform
-  int       QStep           = ( needsSqrt2 ? ( ( g_quantScales[qp] * 181 ) >> 7 ) : g_quantScales[qp] );
-  double    finalErrScale = dErrScale / QStep / QStep / (1 << (DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth) << 1));
-#else
-  int errShift = SCALE_BITS - ((iTransformShift + DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth)) << 1);
-  double    dErrScale       = exp2( double( errShift ) );
-  double    finalErrScale   = dErrScale / double( g_quantScales[qp] * g_quantScales[qp] );
-#endif
-  return    finalErrScale;
-}
-#endif
-#endif
 
 
 
-#if HEVC_USE_SCALING_LISTS
 /** set error scale coefficients
  * \param list                   list ID
  * \param size
@@ -446,20 +404,11 @@ void QuantRDOQ::xSetErrScaleCoeff( uint32_t list, uint32_t sizeX, uint32_t sizeY
   int *piQuantcoeff;
   double *pdErrScale;
   piQuantcoeff = getQuantCoeff( list, qp, sizeX, sizeY );
-#if JVET_N0847_SCALING_LISTS
   pdErrScale   = xGetErrScaleCoeffSL( list, sizeX, sizeY, qp);
-#else
-  pdErrScale   = xGetErrScaleCoeff( list, sizeX, sizeY, qp );
-#endif
 
-#if HM_QTBT_AS_IN_JEM_QUANT
   double dErrScale = (double)( 1 << SCALE_BITS );                                // Compensate for scaling of bitcount in Lagrange cost function
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool needsSqrt2 = ((g_aucLog2[width] + g_aucLog2[height]) & 1) == 1;
-#else // !JVET_N0246_MODIFIED_QUANTSCALES
-  bool   needsSqrt2 = TU::needsBlockSizeTrafoScale( Size( g_scalingListSizeX[sizeX], g_scalingListSizeX[sizeY] ) );// ( ( (sizeX+sizeY) & 1 ) !=0 );
-#endif // JVET_N0246_MODIFIED_QUANTSCALES
   double dTransShift = (double)iTransformShift + ( needsSqrt2 ? -0.5 : 0.0 );
   dErrScale = dErrScale*pow( 2.0, ( -2.0*dTransShift ) );                     // Compensate for scaling through forward transform
 
@@ -469,23 +418,10 @@ void QuantRDOQ::xSetErrScaleCoeff( uint32_t list, uint32_t sizeX, uint32_t sizeY
                     / (1 << (DISTORTION_PRECISION_ADJUSTMENT(bitDepths.recon[channelType]) << 1));
   }
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   int QStep = g_quantScales[needsSqrt2][qp];
-#else
-  int QStep = ( needsSqrt2 ? ( ( g_quantScales[qp] * 181 ) >> 7 ) : g_quantScales[qp] );
-#endif
 
   xGetErrScaleCoeffNoScalingList(list, sizeX, sizeY, qp) =
     dErrScale / QStep / QStep / (1 << (DISTORTION_PRECISION_ADJUSTMENT(bitDepths.recon[channelType]) << 1));
-#else
-  int errShift = SCALE_BITS - ((iTransformShift + DISTORTION_PRECISION_ADJUSTMENT(bitDepths.recon[channelType])) << 1);
-  double dErrScale = exp2( double( errShift ) );
-  for( i = 0; i < uiMaxNumCoeff; i++ )
-  {
-    pdErrScale[i] = dErrScale / double( piQuantcoeff[i] * piQuantcoeff[i] );
-  }
-  xGetErrScaleCoeffNoScalingList( list, sizeX, sizeY, qp ) = dErrScale / double( g_quantScales[qp] * g_quantScales[qp] );
-#endif
 }
 
 /** set flat matrix value to quantized coefficient
@@ -564,7 +500,6 @@ void QuantRDOQ::xDestroyScalingList()
   }
 //   Quant::destroyScalingList();
 }
-#endif
 
 
 void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx)
@@ -592,10 +527,8 @@ void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeff
     if (!m_useSelectiveRDOQ || xNeedRDOQ(tu, compID, piCoef, cQP))
     {
 #endif
-#if JVET_N0280_RESIDUAL_CODING_TS
       if( isLuma( compID ) && useTransformSkip )
       {
-#if JVET_N0413_RDPCM
         if( tu.cu->bdpcmMode && isLuma(compID) )
         {
           forwardRDPCM( tu, compID, pSrc, uiAbsSum, cQP, ctx );
@@ -604,17 +537,11 @@ void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeff
         {
           xRateDistOptQuantTS( tu, compID, pSrc, uiAbsSum, cQP, ctx );
         }
-#else
-        xRateDistOptQuantTS( tu, compID, pSrc, uiAbsSum, cQP, ctx );
-#endif
       }
       else
       {
         xRateDistOptQuant( tu, compID, pSrc, uiAbsSum, cQP, ctx );
       }
-#else
-      xRateDistOptQuant( tu, compID, pSrc, uiAbsSum, cQP, ctx );
-#endif
 #if T0196_SELECTIVE_RDOQ
     }
     else
@@ -663,18 +590,14 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
 
   double     d64BlockUncodedCost               = 0;
   const uint32_t uiLog2BlockWidth                  = g_aucLog2[uiWidth];
-#if HEVC_USE_SCALING_LISTS
   const uint32_t uiLog2BlockHeight                 = g_aucLog2[uiHeight];
-#endif
   const uint32_t uiMaxNumCoeff                     = rect.area();
 
   CHECK(compID >= MAX_NUM_TBLOCKS, "Invalid component ID");
 
-#if HEVC_USE_SCALING_LISTS
   int scalingListType = getScalingListType(tu.cu->predMode, compID);
 
   CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
-#endif
 
   const TCoeff *plSrcCoeff = pSrc.buf;
         TCoeff *piDstCoeff = tu.getCoeffs(compID).buf;
@@ -682,82 +605,34 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
   double *pdCostCoeff  = m_pdCostCoeff;
   double *pdCostSig    = m_pdCostSig;
   double *pdCostCoeff0 = m_pdCostCoeff0;
-#if HEVC_USE_SIGN_HIDING
   int    *rateIncUp    = m_rateIncUp;
   int    *rateIncDown  = m_rateIncDown;
   int    *sigRateDelta = m_sigRateDelta;
   TCoeff *deltaU       = m_deltaU;
-#endif
 
   memset(piDstCoeff, 0, sizeof(*piDstCoeff) * uiMaxNumCoeff);
   memset( m_pdCostCoeff,  0, sizeof( double ) *  uiMaxNumCoeff );
   memset( m_pdCostSig,    0, sizeof( double ) *  uiMaxNumCoeff );
-#if HEVC_USE_SIGN_HIDING
   memset( m_rateIncUp,    0, sizeof( int    ) *  uiMaxNumCoeff );
   memset( m_rateIncDown,  0, sizeof( int    ) *  uiMaxNumCoeff );
   memset( m_sigRateDelta, 0, sizeof( int    ) *  uiMaxNumCoeff );
   memset( m_deltaU,       0, sizeof( TCoeff ) *  uiMaxNumCoeff );
-#endif
 
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool needSqrtAdjustment= TU::needsBlockSizeTrafoScale( tu, compID );
-#if HEVC_USE_SCALING_LISTS
-#if JVET_N0847_SCALING_LISTS
   const double *const pdErrScale = xGetErrScaleCoeffSL(scalingListType, (uiLog2BlockWidth - 1), (uiLog2BlockHeight - 1), cQP.rem);
-#else
-  const double *const pdErrScale = xGetErrScaleCoeff(scalingListType, (uiLog2BlockWidth-1), (uiLog2BlockHeight-1), cQP.rem);
-#endif
   const int    *const piQCoef    = getQuantCoeff(scalingListType, cQP.rem, (uiLog2BlockWidth-1), (uiLog2BlockHeight-1));
   const bool   isTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
   const bool   enableScalingLists             = getUseScalingList(uiWidth, uiHeight, isTransformSkip);
   const int    defaultQuantisationCoefficient = g_quantScales[ needSqrtAdjustment ?1:0][cQP.rem];
   const double defaultErrorScale              = xGetErrScaleCoeffNoScalingList(scalingListType, (uiLog2BlockWidth-1), (uiLog2BlockHeight-1), cQP.rem);
   const int iQBits = QUANT_SHIFT + cQP.per + iTransformShift + (needSqrtAdjustment?-1:0);                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
-#else
-  const int quantisationCoefficient    = g_quantScales[needSqrtAdjustment?1:0][cQP.rem];
-  const double errorScale = xGetErrScaleCoeff( TU::needsSqrt2Scale( tu, compID ), uiWidth, uiHeight, cQP.rem, maxLog2TrDynamicRange, channelBitDepth );
-  const int iQBits = QUANT_SHIFT + cQP.per + iTransformShift + (needSqrtAdjustment?-1:0);                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
-#endif // HEVC_USE_SCALING_LISTS
-#else // JVET_N0246_MODIFIED_QUANTSCALES
-  const int iQBits = QUANT_SHIFT + cQP.per + iTransformShift;                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
-
-#if HEVC_USE_SCALING_LISTS
-  const double *const pdErrScale = xGetErrScaleCoeff(scalingListType, (uiLog2BlockWidth-1), (uiLog2BlockHeight-1), cQP.rem);
-  const int    *const piQCoef    = getQuantCoeff(scalingListType, cQP.rem, (uiLog2BlockWidth-1), (uiLog2BlockHeight-1));
-
-  const bool   enableScalingLists             = getUseScalingList(uiWidth, uiHeight, tu.transformSkip[compID]);
-#if HM_QTBT_AS_IN_JEM_QUANT
-  const int    defaultQuantisationCoefficient = ( TU::needsSqrt2Scale( rect, tu.transformSkip[compID] ) ? ( g_quantScales[cQP.rem] * 181 ) >> 7 : g_quantScales[cQP.rem] );
-  const double defaultErrorScale              = xGetErrScaleCoeffNoScalingList(scalingListType, (uiLog2BlockWidth-1), (uiLog2BlockHeight-1), cQP.rem);
-#else
-  const double blkErrScale                    = ( TU::needsQP3Offset( tu, compID ) ? 2.0 : 1.0 );
-  const int    defaultQuantisationCoefficient = g_quantScales[cQP.rem];
-  const double defaultErrorScale              = blkErrScale * xGetErrScaleCoeffNoScalingList( scalingListType, ( uiLog2BlockWidth - 1 ), ( uiLog2BlockHeight - 1 ), cQP.rem );
-#endif
-#else //HEVC_USE_SCALING_LISTS
-#if HM_QTBT_AS_IN_JEM_QUANT
-  const int    quantisationCoefficient = ( TU::needsSqrt2Scale( tu, compID ) ? ( g_quantScales[cQP.rem] * 181 ) >> 7 : g_quantScales[cQP.rem] );
-  const double errorScale              = xGetErrScaleCoeff( TU::needsSqrt2Scale( tu, compID ), uiWidth, uiHeight, cQP.rem, maxLog2TrDynamicRange, channelBitDepth );
-#else
-  const double blkErrScale             = ( TU::needsQP3Offset( tu, compID ) ? 2.0 : 1.0 );
-  const int    quantisationCoefficient = g_quantScales[cQP.rem];
-  const double errorScale              = blkErrScale * xGetErrScaleCoeff( uiWidth, uiHeight, cQP.rem, maxLog2TrDynamicRange, channelBitDepth );
-#endif
-#endif//HEVC_USE_SCALING_LISTS
-#endif // JVET_N0246_MODIFIED_QUANTSCALES
 
 
-#if HEVC_USE_SIGN_HIDING
   const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
-#endif
   const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
 
-#if HEVC_USE_SIGN_HIDING
   CoeffCodingContext cctx(tu, compID, tu.cs->slice->getSignDataHidingEnabledFlag());
-#else
-  CoeffCodingContext cctx(tu, compID);
-#endif
   const int    iCGSizeM1      = (1 << cctx.log2CGSize()) - 1;
 
   int     iCGLastScanPos      = -1;
@@ -779,26 +654,21 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
   DTRACE( g_trace_ctx, D_RDOQ, "%d: %3d, %3d, %dx%d, comp=%d\n", DTRACE_GET_COUNTER( g_trace_ctx, D_RDOQ ), rect.x, rect.y, rect.width, rect.height, compID );
 #endif
 
-#if JVET_N0193_LFNST
   const uint32_t lfnstIdx = tu.cu->lfnstIdx;
-#endif
 
 
   for (int subSetId = iCGNum - 1; subSetId >= 0; subSetId--)
   {
     cctx.initSubblock( subSetId );
 
-#if JVET_N0193_LFNST
     uint32_t maxNonZeroPosInCG = iCGSizeM1;
     if( lfnstIdx > 0 && ( ( uiWidth == 4 && uiHeight == 4 ) || ( uiWidth == 8 && uiHeight == 8 && cctx.cgPosX() == 0 && cctx.cgPosY() == 0 ) ) )
     {
       maxNonZeroPosInCG = 7;
     }
-#endif
 
     memset( &rdStats, 0, sizeof (coeffGroupRDStats));
 
-#if JVET_N0193_LFNST
     for( int iScanPosinCG = iCGSizeM1; iScanPosinCG > maxNonZeroPosInCG; iScanPosinCG-- )
     {
       iScanPos = cctx.minSubPos() + iScanPosinCG;
@@ -806,23 +676,14 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
       piDstCoeff[ blkPos ] = 0;
     }
     for( int iScanPosinCG = maxNonZeroPosInCG; iScanPosinCG >= 0; iScanPosinCG-- )
-#else
-    for (int iScanPosinCG = iCGSizeM1; iScanPosinCG >= 0; iScanPosinCG--)
-#endif
     {
       iScanPos = cctx.minSubPos() + iScanPosinCG;
       //===== quantization =====
       uint32_t    uiBlkPos          = cctx.blockPos(iScanPos);
 
       // set coeff
-#if HEVC_USE_SCALING_LISTS
       const int    quantisationCoefficient = (enableScalingLists) ? piQCoef   [uiBlkPos]               : defaultQuantisationCoefficient;
-#if HM_QTBT_AS_IN_JEM_QUANT
       const double errorScale              = (enableScalingLists) ? pdErrScale[uiBlkPos]               : defaultErrorScale;
-#else
-      const double errorScale              = (enableScalingLists) ? pdErrScale[uiBlkPos] * blkErrScale : defaultErrorScale;
-#endif
-#endif
       const int64_t  tmpLevel                = int64_t(abs(plSrcCoeff[ uiBlkPos ])) * quantisationCoefficient;
 
       const Intermediate_Int lLevelDouble  = (Intermediate_Int)std::min<int64_t>(tmpLevel, std::numeric_limits<Intermediate_Int>::max() - (Intermediate_Int(1) << (iQBits - 1)));
@@ -864,11 +725,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
         uint32_t    goRiceZero    = 0;
         if( remRegBins < 4 )
         {
-#if JVET_N0188_UNIFY_RICEPARA
           unsigned  sumAbs = cctx.templateAbsSum( iScanPos, piDstCoeff, 0 );
-#else
-          unsigned  sumAbs        = cctx.templateAbsSum( iScanPos, piDstCoeff );
-#endif
           goRiceParam             = g_auiGoRiceParsCoeff   [ sumAbs ];
           goRiceZero              = g_auiGoRicePosCoeff0[0][ sumAbs ];
         }
@@ -889,16 +746,13 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
           const BinFracBits fracBitsSig = fracBits.getFracBitsArray( ctxIdSig );
           uiLevel = xGetCodedLevel( pdCostCoeff[ iScanPos ], pdCostCoeff0[ iScanPos ], pdCostSig[ iScanPos ],
                                     lLevelDouble, uiMaxAbsLevel, &fracBitsSig, fracBitsPar, fracBitsGt1, fracBitsGt2, remGt2Bins, remRegBins, goRiceZero, goRiceParam, iQBits, errorScale, 0, extendedPrecision, maxLog2TrDynamicRange );
-#if HEVC_USE_SIGN_HIDING
           sigRateDelta[ uiBlkPos ] = ( remRegBins < 4 ? 0 : fracBitsSig.intBits[1] - fracBitsSig.intBits[0] );
-#endif
         }
 
         DTRACE( g_trace_ctx, D_RDOQ, " Lev=%d \n", uiLevel );
         DTRACE_COND( ( uiMaxAbsLevel != 0 ), g_trace_ctx, D_RDOQ, " CostC0=%d\n", (int64_t)( pdCostCoeff0[iScanPos] ) );
         DTRACE_COND( ( uiMaxAbsLevel != 0 ), g_trace_ctx, D_RDOQ, " CostC =%d\n", (int64_t)( pdCostCoeff[iScanPos] ) );
 
-#if HEVC_USE_SIGN_HIDING
         deltaU[ uiBlkPos ]        = TCoeff((lLevelDouble - (Intermediate_Int(uiLevel) << iQBits)) >> (iQBits-8));
 
         if( uiLevel > 0 )
@@ -919,7 +773,6 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
             rateIncUp [ uiBlkPos ] = fracBitsGt1.intBits[ 0 ];
           }
         }
-#endif
         piDstCoeff[ uiBlkPos ] = uiLevel;
         d64BaseCost           += pdCostCoeff [ iScanPos ];
 
@@ -931,16 +784,8 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
         }
         else if( remRegBins >= 4 )
         {
-#if JVET_N0188_UNIFY_RICEPARA
           int  sumAll = cctx.templateAbsSum(iScanPos, piDstCoeff, 4);
           goRiceParam = g_auiGoRiceParsCoeff[sumAll];
-#else
-          const uint32_t baseLevel = 4;
-          if( goRiceParam < 3 && ((uiLevel-baseLevel)>>1) > (3<<goRiceParam)-1 )
-          {
-            goRiceParam++;
-          }
-#endif
           remRegBins -= (uiLevel < 2 ? uiLevel : 3) + (iScanPos != iLastScanPos);
         }
       }
@@ -1011,11 +856,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
                 pdCostCoeffGroupSig[ cctx.subSetId() ] = xGetRateSigCoeffGroup(fracBitsSigGroup,0);
               }
               // reset coeffs to 0 in this block
-#if JVET_N0193_LFNST
               for( int iScanPosinCG = maxNonZeroPosInCG; iScanPosinCG >= 0; iScanPosinCG-- )
-#else
-              for (int iScanPosinCG = iCGSizeM1; iScanPosinCG >= 0; iScanPosinCG--)
-#endif
               {
                 iScanPos      = cctx.minSubPos() + iScanPosinCG;
                 uint32_t uiBlkPos = cctx.blockPos( iScanPos );
@@ -1098,13 +939,8 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
   int lastBitsX[LAST_SIGNIFICANT_GROUPS] = { 0 };
   int lastBitsY[LAST_SIGNIFICANT_GROUPS] = { 0 };
   {
-#if HEVC_USE_MDCS
-    int dim1  = ( cctx.scanType() == SCAN_VER ? uiHeight : uiWidth  );
-    int dim2  = ( cctx.scanType() == SCAN_VER ? uiWidth  : uiHeight );
-#else
     int dim1 = std::min<int>(JVET_C0024_ZERO_OUT_TH, uiWidth);
     int dim2 = std::min<int>(JVET_C0024_ZERO_OUT_TH, uiHeight);
-#endif
     int bitsX = 0;
     int bitsY = 0;
     int ctxId;
@@ -1133,16 +969,12 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
     d64BaseCost -= pdCostCoeffGroupSig [ iCGScanPos ];
     if (cctx.isSigGroup( iCGScanPos ) )
     {
-#if JVET_N0193_LFNST
       uint32_t maxNonZeroPosInCG = iCGSizeM1;
       if( lfnstIdx > 0 && ( ( uiWidth == 4 && uiHeight == 4 ) || ( uiWidth == 8 && uiHeight == 8 && cctx.cgPosX() == 0 && cctx.cgPosY() == 0 ) ) )
       {
         maxNonZeroPosInCG = 7;
       }
       for( int iScanPosinCG = maxNonZeroPosInCG; iScanPosinCG >= 0; iScanPosinCG-- )
-#else
-      for (int iScanPosinCG = iCGSizeM1; iScanPosinCG >= 0; iScanPosinCG--)
-#endif
       {
         iScanPos = iCGScanPos * (iCGSizeM1 + 1) + iScanPosinCG;
 
@@ -1156,11 +988,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
         {
           uint32_t   uiPosY = uiBlkPos >> uiLog2BlockWidth;
           uint32_t   uiPosX = uiBlkPos - ( uiPosY << uiLog2BlockWidth );
-#if HEVC_USE_MDCS
-          double d64CostLast  = ( cctx.scanType() == SCAN_VER ? xGetRateLast( lastBitsX, lastBitsY, uiPosY, uiPosX ) : xGetRateLast( lastBitsX, lastBitsY, uiPosX, uiPosY ) );
-#else
           double d64CostLast  = xGetRateLast( lastBitsX, lastBitsY, uiPosX, uiPosY );
-#endif
 
           double totalCost = d64BaseCost + d64CostLast - pdCostSig[ iScanPos ];
 
@@ -1208,20 +1036,11 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
     piDstCoeff[ cctx.blockPos( scanPos ) ] = 0;
   }
 
-#if HEVC_USE_SIGN_HIDING
   if( cctx.signHiding() && uiAbsSum>=2)
   {
-#if JVET_N0246_MODIFIED_QUANTSCALES
     const double inverseQuantScale = double(g_invQuantScales[0][cQP.rem]);
-#else
-    const double inverseQuantScale = double(g_invQuantScales[cQP.rem]);
-#endif
     int64_t rdFactor = (int64_t)(inverseQuantScale * inverseQuantScale * (1 << (2 * cQP.per)) / m_dLambda / 16
                                / (1 << (2 * DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth)))
-#if HM_QTBT_AS_IN_JEM_QUANT
-#else
-                              * blkErrScale
-#endif
                              + 0.5);
 
     int lastCG = -1;
@@ -1347,10 +1166,8 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
       }
     }
   }
-#endif
 }
 
-#if JVET_N0280_RESIDUAL_CODING_TS
 void QuantRDOQ::xRateDistOptQuantTS( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &coeffs, TCoeff &absSum, const QpParam &qp, const Ctx &ctx )
 {
   const FracBitsAccess& fracBits = ctx.getFracBitsAcess();
@@ -1373,17 +1190,12 @@ void QuantRDOQ::xRateDistOptQuantTS( TransformUnit &tu, const ComponentID &compI
   }
 
         double   blockUncodedCost                   = 0;
-#if HEVC_USE_SCALING_LISTS && !JVET_N0847_SCALING_LISTS
-  const uint32_t log2BlockHeight                    = g_aucLog2[height];
-#endif
   const uint32_t maxNumCoeff                        = rect.area();
 
   CHECK( compID >= MAX_NUM_TBLOCKS, "Invalid component ID" );
 
-#if HEVC_USE_SCALING_LISTS
   int scalingListType = getScalingListType( tu.cu->predMode, compID );
   CHECK( scalingListType >= SCALING_LIST_NUM, "Invalid scaling list" );
-#endif
 
   const TCoeff *srcCoeff = coeffs.buf;
         TCoeff *dstCoeff = tu.getCoeffs( compID ).buf;
@@ -1395,32 +1207,14 @@ void QuantRDOQ::xRateDistOptQuantTS( TransformUnit &tu, const ComponentID &compI
   memset( m_pdCostCoeff,  0, sizeof( double ) *  maxNumCoeff );
   memset( m_pdCostSig,    0, sizeof( double ) *  maxNumCoeff );
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool   needsSqrt2Scale = TU::needsSqrt2Scale( tu, compID );  // should always be false - transform-skipped blocks don't require sqrt(2) compensation.
   const int    qBits = QUANT_SHIFT + qp.per + transformShift + (needsSqrt2Scale?-1:0);  // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
   const int    quantisationCoefficient = g_quantScales[needsSqrt2Scale?1:0][qp.rem];
   const double errorScale              = xGetErrScaleCoeff( TU::needsSqrt2Scale( tu, compID ), width, height, qp.rem, maxLog2TrDynamicRange, channelBitDepth );
-#else
-
-  const int qBits = QUANT_SHIFT + qp.per + transformShift;                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
-
-#if HM_QTBT_AS_IN_JEM_QUANT
-  const int    quantisationCoefficient = ( TU::needsSqrt2Scale( tu, compID ) ? ( g_quantScales[qp.rem] * 181 ) >> 7 : g_quantScales[qp.rem] );
-  const double errorScale              = xGetErrScaleCoeff( TU::needsSqrt2Scale( tu, compID ), width, height, qp.rem, maxLog2TrDynamicRange, channelBitDepth );
-#else
-  const double blkErrScale             = ( TU::needsQP3Offset( tu, compID ) ? 2.0 : 1.0 );
-  const int    quantisationCoefficient = g_quantScales[qp.rem];
-  const double errorScale              = blkErrScale * xGetErrScaleCoeff( width, height, qp.rem, maxLog2TrDynamicRange, channelBitDepth );
-#endif
-#endif
 
   const TCoeff entropyCodingMaximum = ( 1 << maxLog2TrDynamicRange ) - 1;
 
-#if HEVC_USE_SIGN_HIDING
   CoeffCodingContext cctx( tu, compID, tu.cs->slice->getSignDataHidingEnabledFlag() );
-#else
-  CoeffCodingContext cctx( tu, compID );
-#endif
   const int sbSizeM1    = ( 1 << cctx.log2CGSize() ) - 1;
   double    baseCost    = 0;
   uint32_t  goRiceParam = 0;
@@ -1551,7 +1345,6 @@ void QuantRDOQ::xRateDistOptQuantTS( TransformUnit &tu, const ComponentID &compI
   }
 }
 
-#if JVET_N0413_RDPCM
 void QuantRDOQ::forwardRDPCM( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &coeffs, TCoeff &absSum, const QpParam &qp, const Ctx &ctx )
 {
   const FracBitsAccess& fracBits = ctx.getFracBitsAcess();
@@ -1575,17 +1368,12 @@ void QuantRDOQ::forwardRDPCM( TransformUnit &tu, const ComponentID &compID, cons
   }
 
   double   blockUncodedCost = 0;
-#if HEVC_USE_SCALING_LISTS && !JVET_N0847_SCALING_LISTS
-  const uint32_t log2BlockHeight = g_aucLog2[height];
-#endif
   const uint32_t maxNumCoeff = rect.area();
 
   CHECK(compID >= MAX_NUM_TBLOCKS, "Invalid component ID");
 
-#if HEVC_USE_SCALING_LISTS
   int scalingListType = getScalingListType(tu.cu->predMode, compID);
   CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
-#endif
 
   const TCoeff *srcCoeff = coeffs.buf;
   TCoeff *dstCoeff = tu.getCoeffs(compID).buf;
@@ -1598,7 +1386,6 @@ void QuantRDOQ::forwardRDPCM( TransformUnit &tu, const ComponentID &compID, cons
   memset(m_pdCostSig, 0, sizeof(double) *  maxNumCoeff);
   memset(m_fullCoeff, 0, sizeof(TCoeff) * maxNumCoeff);
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
   const bool   needsSqrt2Scale = TU::needsSqrt2Scale(tu, compID);  // should always be false - transform-skipped blocks don't require sqrt(2) compensation.
   const int    qBits = QUANT_SHIFT + qp.per + transformShift + (needsSqrt2Scale ? -1 : 0);  // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
   const int    quantisationCoefficient = g_quantScales[needsSqrt2Scale ? 1 : 0][qp.rem];
@@ -1607,27 +1394,10 @@ void QuantRDOQ::forwardRDPCM( TransformUnit &tu, const ComponentID &compID, cons
   TrQuantParams trQuantParams;
   trQuantParams.rightShift = (IQUANT_SHIFT - (transformShift + qp.per));
   trQuantParams.qScale = g_invQuantScales[needsSqrt2Scale ? 1 : 0][qp.rem];
-#else
-
-  const int qBits = QUANT_SHIFT + qp.per + transformShift;                   // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
-
-#if HM_QTBT_AS_IN_JEM_QUANT
-  const int    quantisationCoefficient = (TU::needsSqrt2Scale(tu, compID) ? (g_quantScales[qp.rem] * 181) >> 7 : g_quantScales[qp.rem]);
-  const double errorScale = xGetErrScaleCoeff(TU::needsSqrt2Scale(tu, compID), width, height, qp.rem, maxLog2TrDynamicRange, channelBitDepth);
-#else
-  const double blkErrScale = (TU::needsQP3Offset(tu, compID) ? 2.0 : 1.0);
-  const int    quantisationCoefficient = g_quantScales[qp.rem];
-  const double errorScale = blkErrScale * xGetErrScaleCoeff(width, height, qp.rem, maxLog2TrDynamicRange, channelBitDepth);
-#endif
-#endif
 
   const TCoeff entropyCodingMaximum = (1 << maxLog2TrDynamicRange) - 1;
 
-#if HEVC_USE_SIGN_HIDING
   CoeffCodingContext cctx(tu, compID, tu.cs->slice->getSignDataHidingEnabledFlag());
-#else
-  CoeffCodingContext cctx(tu, compID);
-#endif
   const int sbSizeM1 = (1 << cctx.log2CGSize()) - 1;
   double    baseCost = 0;
   uint32_t  goRiceParam = 0;
@@ -1790,7 +1560,6 @@ void QuantRDOQ::xDequantSample(TCoeff& pRes, TCoeff& coeff, const TrQuantParams&
     pRes = TCoeff((Intermediate_Int(coeff) * trQuantParams.qScale) << -trQuantParams.rightShift);
   }
 }
-#endif
 inline uint32_t QuantRDOQ::xGetCodedLevelTS(       double&             codedCost,
                                                    double&             codedCost0,
                                                    double&             codedCostSig,
@@ -1932,6 +1701,5 @@ inline int QuantRDOQ::xGetICRateTS( const uint32_t            absLevel,
   }
   return rate;
 }
-#endif
 
 //! \}
diff --git a/source/Lib/CommonLib/QuantRDOQ.h b/source/Lib/CommonLib/QuantRDOQ.h
index ecc45551c..213089850 100644
--- a/source/Lib/CommonLib/QuantRDOQ.h
+++ b/source/Lib/CommonLib/QuantRDOQ.h
@@ -61,34 +61,20 @@ public:
   ~QuantRDOQ();
 
 public:
-#if HEVC_USE_SCALING_LISTS
   void setFlatScalingList   ( const int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths );
   void setScalingList       ( ScalingList *scalingList, const int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths);
-#endif
   // quantization
   void quant                ( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx );
-#if JVET_N0413_RDPCM
   void forwardRDPCM         ( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx &ctx );
-#endif
 
 private:
-#if HEVC_USE_SCALING_LISTS
-#if JVET_N0847_SCALING_LISTS
   double* xGetErrScaleCoeffSL            ( uint32_t list, uint32_t sizeX, uint32_t sizeY, int qp ) { return m_errScale[sizeX][sizeY][list][qp]; };  //!< get Error Scale Coefficent
   double  xGetErrScaleCoeff              ( const bool needsSqrt2, SizeType width, SizeType height, int qp, const int maxLog2TrDynamicRange, const int channelBitDepth);
-#else
-  double* xGetErrScaleCoeff              ( uint32_t list, uint32_t sizeX, uint32_t sizeY, int qp ) { return m_errScale             [sizeX][sizeY][list][qp]; };  //!< get Error Scale Coefficent
-#endif
   double& xGetErrScaleCoeffNoScalingList ( uint32_t list, uint32_t sizeX, uint32_t sizeY, int qp ) { return m_errScaleNoScalingList[sizeX][sizeY][list][qp]; };  //!< get Error Scale Coefficent
   void    xInitScalingList               ( const QuantRDOQ* other );
   void    xDestroyScalingList            ();
   void    xSetErrScaleCoeff              ( uint32_t list, uint32_t sizeX, uint32_t sizeY, int qp, const int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths );
-#else
-  double  xGetErrScaleCoeff              ( const bool needsSqrt2, SizeType width, SizeType height, int qp, const int maxLog2TrDynamicRange, const int channelBitDepth);
-#endif
-#if JVET_N0413_RDPCM
   void    xDequantSample                 ( TCoeff& pRes, TCoeff& coeff, const TrQuantParams& trQuantParams );
-#endif
   // RDOQ functions
   void xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx &ctx);
 
@@ -130,7 +116,6 @@ private:
   inline double xGetICost            ( double dRate                                                      ) const;
   inline double xGetIEPRate          (                                                                   ) const;
 
-#if JVET_N0280_RESIDUAL_CODING_TS
   void xRateDistOptQuantTS( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &coeffs, TCoeff &absSum, const QpParam &qp, const Ctx &ctx );
 
   inline uint32_t xGetCodedLevelTS(       double&             codedCost,
@@ -160,28 +145,21 @@ private:
                               const uint16_t            ricePar,
                               const bool                useLimitedPrefixLength,
                               const int                 maxLog2TrDynamicRange  ) const;
-#endif
 private:
-#if HEVC_USE_SCALING_LISTS
   bool    m_isErrScaleListOwner;
 
   double *m_errScale             [SCALING_LIST_SIZE_NUM][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM]; ///< array of quantization matrix coefficient 4x4
   double  m_errScaleNoScalingList[SCALING_LIST_SIZE_NUM][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][SCALING_LIST_REM_NUM]; ///< array of quantization matrix coefficient 4x4
-#endif
   // temporary buffers for RDOQ
   double m_pdCostCoeff        [MAX_TB_SIZEY * MAX_TB_SIZEY];
   double m_pdCostSig          [MAX_TB_SIZEY * MAX_TB_SIZEY];
   double m_pdCostCoeff0       [MAX_TB_SIZEY * MAX_TB_SIZEY];
   double m_pdCostCoeffGroupSig[(MAX_TB_SIZEY * MAX_TB_SIZEY) >> MLS_CG_SIZE]; // even if CG size is 2 (if one of the sides is 2) instead of 4, there should be enough space
-#if HEVC_USE_SIGN_HIDING
   int    m_rateIncUp          [MAX_TB_SIZEY * MAX_TB_SIZEY];
   int    m_rateIncDown        [MAX_TB_SIZEY * MAX_TB_SIZEY];
   int    m_sigRateDelta       [MAX_TB_SIZEY * MAX_TB_SIZEY];
   TCoeff m_deltaU             [MAX_TB_SIZEY * MAX_TB_SIZEY];
-#if JVET_N0413_RDPCM
   TCoeff m_fullCoeff          [MAX_TB_SIZEY * MAX_TB_SIZEY];
-#endif
-#endif
 };// END CLASS DEFINITION QuantRDOQ
 
 //! \}
diff --git a/source/Lib/CommonLib/RdCost.cpp b/source/Lib/CommonLib/RdCost.cpp
index 179eca8e0..5118b933f 100644
--- a/source/Lib/CommonLib/RdCost.cpp
+++ b/source/Lib/CommonLib/RdCost.cpp
@@ -380,10 +380,8 @@ Distortion RdCost::getDistPart( const CPelBuf &org, const CPelBuf &cur, int bitD
 #if WCG_EXT
   if( orgLuma )
   {
-#if JVET_N0671_RDCOST_FIX
     cDtParam.cShiftX = getComponentScaleX(compID,  m_cf);
     cDtParam.cShiftY = getComponentScaleY(compID,  m_cf);
-#endif
     if( isChroma(compID) )
     {
       cDtParam.orgLuma  = *orgLuma;
@@ -3028,12 +3026,8 @@ Distortion RdCost::xGetSSE_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const int  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
 
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
@@ -3046,11 +3040,7 @@ Distortion RdCost::xGetSSE_WTD( const DistParam &rcDtParam )
     piOrg += iStrideOrg;
     piCur += iStrideCur;
 
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3070,12 +3060,8 @@ Distortion RdCost::xGetSSE2_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma           = rcDtParam.orgLuma.buf;
   const size_t  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
 
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
@@ -3085,11 +3071,7 @@ Distortion RdCost::xGetSSE2_WTD( const DistParam &rcDtParam )
     uiSum += getWeightedMSE(rcDtParam.compID, piOrg[1  ], piCur[1  ], uiShift, piOrgLuma[size_t(1)<<cShift]);   // piOrg[1] - piCur[1]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift);
     piOrg += iStrideOrg;
     piCur += iStrideCur;
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3109,12 +3091,8 @@ Distortion RdCost::xGetSSE4_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const size_t  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
 
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
@@ -3126,11 +3104,7 @@ Distortion RdCost::xGetSSE4_WTD( const DistParam &rcDtParam )
     uiSum += getWeightedMSE(rcDtParam.compID, piOrg[3  ], piCur[3  ], uiShift, piOrgLuma[size_t(3)<<cShift] );   // piOrg[3] - piCur[3]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift);
     piOrg += iStrideOrg;
     piCur += iStrideCur;
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3150,12 +3124,8 @@ Distortion RdCost::xGetSSE8_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const size_t  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
 
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
@@ -3171,11 +3141,7 @@ Distortion RdCost::xGetSSE8_WTD( const DistParam &rcDtParam )
     uiSum += getWeightedMSE(rcDtParam.compID, piOrg[7  ], piCur[7  ], uiShift, piOrgLuma[size_t(7)<<cShift  ]);  // piOrg[7] - piCur[7]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift);
     piOrg += iStrideOrg;
     piCur += iStrideCur;
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3194,12 +3160,8 @@ Distortion RdCost::xGetSSE16_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const size_t  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
   for( ; iRows != 0; iRows-- )
@@ -3223,11 +3185,7 @@ Distortion RdCost::xGetSSE16_WTD( const DistParam &rcDtParam )
     piOrg += iStrideOrg;
     piCur += iStrideCur;
 
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3246,12 +3204,8 @@ Distortion RdCost::xGetSSE16N_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const size_t  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
   for( ; iRows != 0; iRows-- )
@@ -3277,11 +3231,7 @@ Distortion RdCost::xGetSSE16N_WTD( const DistParam &rcDtParam )
     }
     piOrg += iStrideOrg;
     piCur += iStrideCur;
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3300,12 +3250,8 @@ Distortion RdCost::xGetSSE32_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const size_t  iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
 
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth) << 1;
@@ -3345,11 +3291,7 @@ Distortion RdCost::xGetSSE32_WTD( const DistParam &rcDtParam )
     uiSum += getWeightedMSE(rcDtParam.compID, piOrg[31], piCur[31], uiShift, piOrgLuma[size_t(31)<<cShift ]);  //  iTemp = piOrg[31] - piCur[31]; uiSum += Distortion(( iTemp * iTemp ) >> uiShift);
     piOrg += iStrideOrg;
     piCur += iStrideCur;
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
@@ -3368,12 +3310,8 @@ Distortion RdCost::xGetSSE64_WTD( const DistParam &rcDtParam )
   const int  iStrideOrg = rcDtParam.org.stride;
   const Pel* piOrgLuma        = rcDtParam.orgLuma.buf;
   const size_t iStrideOrgLuma   = rcDtParam.orgLuma.stride;
-#if JVET_N0671_RDCOST_FIX
   const size_t  cShift  = rcDtParam.cShiftX;
   const size_t  cShiftY = rcDtParam.cShiftY;
-#else
-  const size_t  cShift          = (rcDtParam.compID==COMPONENT_Y) ? 0 : 1; // assume 420, could use getComponentScaleX, getComponentScaleY
-#endif
 
   Distortion uiSum   = 0;
   uint32_t uiShift = DISTORTION_PRECISION_ADJUSTMENT((rcDtParam.bitDepth)) << 1;
@@ -3446,11 +3384,7 @@ Distortion RdCost::xGetSSE64_WTD( const DistParam &rcDtParam )
     piOrg += iStrideOrg;
     piCur += iStrideCur;
 
-#if JVET_N0671_RDCOST_FIX
     piOrgLuma += iStrideOrgLuma<<cShiftY;
-#else
-    piOrgLuma += iStrideOrgLuma<<cShift;
-#endif
   }
   return ( uiSum );
 }
diff --git a/source/Lib/CommonLib/RdCost.h b/source/Lib/CommonLib/RdCost.h
index dac46775d..9e7b16df6 100644
--- a/source/Lib/CommonLib/RdCost.h
+++ b/source/Lib/CommonLib/RdCost.h
@@ -87,15 +87,11 @@ public:
   // (vertical) subsampling shift (for reducing complexity)
   // - 0 = no subsampling, 1 = even rows, 2 = every 4th, etc.
   int                   subShift;
-#if JVET_N0671_RDCOST_FIX
   int                   cShiftX;
   int                   cShiftY;
-#endif
   DistParam() :
   org(), cur(), step( 1 ), bitDepth( 0 ), useMR( false ), applyWeight( false ), isBiPred( false ), wpCur( nullptr ), compID( MAX_NUM_COMPONENT ), maximumDistortionForEarlyExit( std::numeric_limits<Distortion>::max() ), subShift( 0 )
-#if JVET_N0671_RDCOST_FIX
   , cShiftX(-1), cShiftY(-1)
-#endif
   { }
 };
 
@@ -117,9 +113,7 @@ private:
   static uint32_t         m_signalType;
   static double           m_chromaWeight;
   static int              m_lumaBD;
-#if JVET_N0671_RDCOST_FIX
   ChromaFormat            m_cf;
-#endif // JVET_N0671_RDCOST_FIX
 #endif
   double                  m_DistScale;
   double                  m_dLambdaMotionSAD[2 /* 0=standard, 1=for transquant bypass when mixed-lossless cost evaluation enabled*/];
@@ -136,9 +130,7 @@ public:
   virtual ~RdCost();
 
 #if WCG_EXT
-#if JVET_N0671_RDCOST_FIX
   void          setChromaFormat       ( const ChromaFormat & _cf) { m_cf = _cf; }
-#endif
   double        calcRdCost            ( uint64_t fracBits, Distortion distortion, bool useUnadjustedLambda = true );
 #else
   double        calcRdCost            ( uint64_t fracBits, Distortion distortion );
@@ -190,11 +182,7 @@ public:
 
   inline Distortion getBvCostMultiplePreds(int x, int y, bool useIMV)
   {
-#if JVET_N0329_IBC_SEARCH_IMP
     return Distortion(m_dCost * getBitsMultiplePreds(x, y, useIMV));
-#else
-    return Distortion((m_dCost * getBitsMultiplePreds(x, y, useIMV)) / 65536.0);
-#endif
   }
 
   unsigned int    getBitsMultiplePreds(int x, int y, bool useIMV)
diff --git a/source/Lib/CommonLib/Reshape.cpp b/source/Lib/CommonLib/Reshape.cpp
index 9d5cd9f2f..e870641ba 100644
--- a/source/Lib/CommonLib/Reshape.cpp
+++ b/source/Lib/CommonLib/Reshape.cpp
@@ -110,19 +110,10 @@ void Reshape::reverseLUT(std::vector<Pel>& inputLUT, std::vector<Pel>& outputLUT
   for (i = m_reshapePivot[m_sliceReshapeInfo.reshaperModelMaxBinIdx + 1]; i < m_reshapeLUTSize; i++)
     outputLUT[i] = outputLUT[m_reshapePivot[m_sliceReshapeInfo.reshaperModelMaxBinIdx + 1]];
 
-#if JVET_N0220_LMCS_SIMPLIFICATION
   for (i = 0; i < lutSize; i++)
   {
     outputLUT[i] = Clip3((Pel)0, (Pel)((1<<m_lumaBD)-1), outputLUT[i]);
   }
-#else
-  bool clipRange = ((m_sliceReshapeInfo.reshaperModelMinBinIdx > 0) && (m_sliceReshapeInfo.reshaperModelMaxBinIdx < (PIC_CODE_CW_BINS - 1)));
-  for (i = 0; i < lutSize; i++)
-  {
-    if (clipRange) outputLUT[i] = Clip3((Pel)(16<<(m_lumaBD-8)), (Pel)(235<<(m_lumaBD-8)), outputLUT[i]);
-    else           outputLUT[i] = Clip3((Pel)0, (Pel)((1<<m_lumaBD)-1), outputLUT[i]);
-  }
-#endif
 }
 
 
@@ -224,7 +215,6 @@ void Reshape::constructReshaper()
 */
 void Reshape::updateChromaScaleLUT()
 {
-#if JVET_N0220_LMCS_SIMPLIFICATION
   for (int i = 0; i < PIC_CODE_CW_BINS; i++)
   {
     if (m_binCW[i] == 0)
@@ -232,17 +222,6 @@ void Reshape::updateChromaScaleLUT()
     else
       m_chromaAdjHelpLUT[i] = m_initCW * (1 << CSCALE_FP_PREC) / m_binCW[i];
   }
-#else
-  const int16_t  CW_bin_SC_LUT[2 * PIC_ANALYZE_CW_BINS] = { 16384, 16384, 16384, 16384, 16384, 16384, 16384, 8192, 8192, 8192, 8192, 5461, 5461, 5461, 5461, 4096, 4096, 4096, 4096, 3277, 3277, 3277, 3277, 2731, 2731, 2731, 2731, 2341, 2341, 2341, 2048, 2048, 2048, 1820, 1820, 1820, 1638, 1638, 1638, 1638, 1489, 1489, 1489, 1489, 1365, 1365, 1365, 1365, 1260, 1260, 1260, 1260, 1170, 1170, 1170, 1170, 1092, 1092, 1092, 1092, 1024, 1024, 1024, 1024 }; //p=11
-  for (int i = 0; i < PIC_CODE_CW_BINS; i++)
-  {
-    uint16_t binCW = m_lumaBD > 10 ? (m_binCW[i] >> (m_lumaBD - 10)) : m_lumaBD < 10 ? (m_binCW[i] << (10 -m_lumaBD)): m_binCW[i];
-    if ((i < m_sliceReshapeInfo.reshaperModelMinBinIdx) || (i > m_sliceReshapeInfo.reshaperModelMaxBinIdx))
-      m_chromaAdjHelpLUT[i] = 1 << CSCALE_FP_PREC;
-    else
-      m_chromaAdjHelpLUT[i] = CW_bin_SC_LUT[Clip3((uint16_t)1, (uint16_t)64, (uint16_t)(binCW >> 1)) - 1];
-  }
-#endif
 }
 
 
diff --git a/source/Lib/CommonLib/Rom.cpp b/source/Lib/CommonLib/Rom.cpp
index 2c7215771..43f3a68a9 100644
--- a/source/Lib/CommonLib/Rom.cpp
+++ b/source/Lib/CommonLib/Rom.cpp
@@ -63,7 +63,6 @@ const char* nalUnitTypeToString(NalUnitType type)
 {
   switch (type)
   {
-#if JVET_N0067_NAL_Unit_Header
   case NAL_UNIT_PPS:                    return "PPS";
   case NAL_UNIT_ACCESS_UNIT_DELIMITER:  return "AUD";
   case NAL_UNIT_PREFIX_SEI:             return "Prefix SEI";
@@ -83,60 +82,6 @@ const char* nalUnitTypeToString(NalUnitType type)
   case NAL_UNIT_CODED_SLICE_CRA:        return "CRA"; 
   case NAL_UNIT_CODED_SLICE_GRA:        return "GRA";
   default:                              return "UNK";
-#else
-#if JVET_M0101_HLS
-  case NAL_UNIT_CODED_SLICE_TRAIL:      return "TRAIL";
-  case NAL_UNIT_CODED_SLICE_STSA:       return "STSA";
-  case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL";
-  case NAL_UNIT_CODED_SLICE_IDR_N_LP:   return "IDR_N_LP";
-  case NAL_UNIT_CODED_SLICE_CRA:        return "CRA";
-  case NAL_UNIT_CODED_SLICE_RADL:       return "RADL";
-  case NAL_UNIT_CODED_SLICE_RASL:       return "RASL";
-#if HEVC_VPS || JVET_N0278_HLS
-  case NAL_UNIT_VPS:                    return "VPS";
-#endif
-  case NAL_UNIT_SPS:                    return "SPS";
-  case NAL_UNIT_PPS:                    return "PPS";
-  case NAL_UNIT_APS:                    return "APS";
-  case NAL_UNIT_ACCESS_UNIT_DELIMITER:  return "AUD";
-  case NAL_UNIT_EOS:                    return "EOS";
-  case NAL_UNIT_EOB:                    return "EOB";
-  case NAL_UNIT_FILLER_DATA:            return "FILLER";
-  case NAL_UNIT_PREFIX_SEI:             return "Prefix SEI";
-  case NAL_UNIT_SUFFIX_SEI:             return "Suffix SEI";
-  default:                              return "UNK";
-#else
-  case NAL_UNIT_CODED_SLICE_TRAIL_R:    return "TRAIL_R";
-  case NAL_UNIT_CODED_SLICE_TRAIL_N:    return "TRAIL_N";
-  case NAL_UNIT_CODED_SLICE_TSA_R:      return "TSA_R";
-  case NAL_UNIT_CODED_SLICE_TSA_N:      return "TSA_N";
-  case NAL_UNIT_CODED_SLICE_STSA_R:     return "STSA_R";
-  case NAL_UNIT_CODED_SLICE_STSA_N:     return "STSA_N";
-  case NAL_UNIT_CODED_SLICE_BLA_W_LP:   return "BLA_W_LP";
-  case NAL_UNIT_CODED_SLICE_BLA_W_RADL: return "BLA_W_RADL";
-  case NAL_UNIT_CODED_SLICE_BLA_N_LP:   return "BLA_N_LP";
-  case NAL_UNIT_CODED_SLICE_IDR_W_RADL: return "IDR_W_RADL";
-  case NAL_UNIT_CODED_SLICE_IDR_N_LP:   return "IDR_N_LP";
-  case NAL_UNIT_CODED_SLICE_CRA:        return "CRA";
-  case NAL_UNIT_CODED_SLICE_RADL_R:     return "RADL_R";
-  case NAL_UNIT_CODED_SLICE_RADL_N:     return "RADL_N";
-  case NAL_UNIT_CODED_SLICE_RASL_R:     return "RASL_R";
-  case NAL_UNIT_CODED_SLICE_RASL_N:     return "RASL_N";
-#if HEVC_VPS || JVET_N0278_HLS
-  case NAL_UNIT_VPS:                    return "VPS";
-#endif
-  case NAL_UNIT_SPS:                    return "SPS";
-  case NAL_UNIT_PPS:                    return "PPS";
-  case NAL_UNIT_APS:                    return "APS";
-  case NAL_UNIT_ACCESS_UNIT_DELIMITER:  return "AUD";
-  case NAL_UNIT_EOS:                    return "EOS";
-  case NAL_UNIT_EOB:                    return "EOB";
-  case NAL_UNIT_FILLER_DATA:            return "FILLER";
-  case NAL_UNIT_PREFIX_SEI:             return "Prefix SEI";
-  case NAL_UNIT_SUFFIX_SEI:             return "Suffix SEI";
-  default:                              return "UNK";
-#endif
-#endif
   }
 }
 
@@ -185,37 +130,6 @@ public:
         }
         break;
 
-#if HEVC_USE_MDCS
-      //------------------------------------------------
-      case SCAN_HOR:
-
-        if (m_column == m_blockWidth - 1)
-        {
-          m_line++;
-          m_column = 0;
-        }
-        else
-        {
-          m_column++;
-        }
-        break;
-
-      //------------------------------------------------
-
-      case SCAN_VER:
-
-        if (m_line == m_blockHeight - 1)
-        {
-          m_column++;
-          m_line = 0;
-        }
-        else
-        {
-          m_line++;
-        }
-        break;
-
-#endif
       //------------------------------------------------
 
       default:
@@ -291,7 +205,6 @@ uint32_t deriveWeightIdxBits(uint8_t gbiIdx) // Note: align this with TEncSbac::
   return numBits;
 }
 
-#if JVET_N0103_CGSIZE_HARMONIZATION
 uint32_t g_log2SbbSize[MAX_CU_DEPTH + 1][MAX_CU_DEPTH + 1][2] =
 //===== luma/chroma =====
 {
@@ -304,33 +217,6 @@ uint32_t g_log2SbbSize[MAX_CU_DEPTH + 1][MAX_CU_DEPTH + 1][2] =
   { { 4,0 },{ 3,1 },{ 2,2 },{ 2,2 },{ 2,2 },{ 2,2 },{ 2,2 },{ 2,2 } },
   { { 4,0 },{ 3,1 },{ 2,2 },{ 2,2 },{ 2,2 },{ 2,2 },{ 2,2 },{ 2,2 } }
 };
-#else
-uint32_t g_log2SbbSize[2][MAX_CU_DEPTH+1][MAX_CU_DEPTH+1][2] =
-{
-  //===== luma =====
-  {
-    { {0,0}, {0,1}, {0,2}, {0,3}, {0,4}, {0,4}, {0,4}, {0,4} },
-    { {1,0}, {1,1}, {1,2}, {1,3}, {1,3}, {1,3}, {1,3}, {1,3} },
-    { {2,0}, {2,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {3,0}, {3,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {4,0}, {3,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {4,0}, {3,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {4,0}, {3,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {4,0}, {3,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} }
-  },
-  //===== chroma =====
-  {
-    { {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0} },
-    { {0,0}, {1,1}, {1,1}, {1,1}, {1,1}, {1,1}, {1,1}, {1,1} },
-    { {0,0}, {1,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {0,0}, {1,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {0,0}, {1,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {0,0}, {1,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {0,0}, {1,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} },
-    { {0,0}, {1,1}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2}, {2,2} }
-  },
-};
-#endif
 // initialize ROM variables
 void initROM()
 {
@@ -362,10 +248,6 @@ void initROM()
   SizeIndexInfoLog2 sizeInfo;
   sizeInfo.init(MAX_CU_SIZE);
 
-#if !JVET_N0103_CGSIZE_HARMONIZATION
-  for( int ch = 0; ch < MAX_NUM_CHANNEL_TYPE; ch++ )
-  {
-#endif
   // initialize scan orders
   for (uint32_t blockHeightIdx = 0; blockHeightIdx < sizeInfo.numAllHeights(); blockHeightIdx++)
   {
@@ -389,11 +271,7 @@ void initROM()
           scan = new ScanElement[totalValues];
         }
 
-#if JVET_N0103_CGSIZE_HARMONIZATION
         g_scanOrder[SCAN_UNGROUPED][scanType][blockWidthIdx][blockHeightIdx] = scan;
-#else
-        g_scanOrder[ch][SCAN_UNGROUPED][scanType][blockWidthIdx][blockHeightIdx] = scan;
-#endif
 
         if (scan == nullptr)
         {
@@ -417,11 +295,7 @@ void initROM()
       //--------------------------------------------------------------------------------------------------
 
       //grouped scan orders
-#if JVET_N0103_CGSIZE_HARMONIZATION
       const uint32_t* log2Sbb        = g_log2SbbSize[g_aucLog2[blockWidth]][g_aucLog2[blockHeight]];
-#else
-      const uint32_t* log2Sbb        = g_log2SbbSize[ch][ g_aucLog2[blockWidth] ][ g_aucLog2[blockHeight] ];
-#endif
       const uint32_t  log2CGWidth    = log2Sbb[0];
       const uint32_t  log2CGHeight   = log2Sbb[1];
 
@@ -439,11 +313,7 @@ void initROM()
 
         ScanElement *scan = new ScanElement[totalValues];
 
-#if JVET_N0103_CGSIZE_HARMONIZATION
         g_scanOrder[SCAN_GROUPED_4x4][scanType][blockWidthIdx][blockHeightIdx] = scan;
-#else
-        g_scanOrder[ch][SCAN_GROUPED_4x4][scanType][blockWidthIdx][blockHeightIdx] = scan;
-#endif
 
         if ( blockWidth > JVET_C0024_ZERO_OUT_TH || blockHeight > JVET_C0024_ZERO_OUT_TH )
         {
@@ -485,11 +355,7 @@ void initROM()
       //--------------------------------------------------------------------------------------------------
     }
   }
-#if !JVET_N0103_CGSIZE_HARMONIZATION
-  }
-#endif
 
-#if JVET_N0193_LFNST
   // initialize CoefTopLeftDiagScan8x8 for LFNST
   for( uint32_t blockWidthIdx = 0; blockWidthIdx < sizeInfo.numAllWidths(); blockWidthIdx++ )
   {
@@ -513,7 +379,6 @@ void initROM()
       g_coefTopLeftDiagScan8x8[ blockWidthIdx ][ i ].y   = g_auiXYDiagScan8x8[ i ][ 1 ];
     }
   }
-#endif
 
   for( int idxH = MAX_CU_DEPTH - MIN_CU_LOG2; idxH >= 0; --idxH )
   {
@@ -543,7 +408,6 @@ void destroyROM()
   unsigned numWidths = gp_sizeIdxInfo->numAllWidths();
   unsigned numHeights = gp_sizeIdxInfo->numAllHeights();
 
-#if JVET_N0103_CGSIZE_HARMONIZATION
   for (uint32_t groupTypeIndex = 0; groupTypeIndex < SCAN_NUMBER_OF_GROUP_TYPES; groupTypeIndex++)
   {
     for (uint32_t scanOrderIndex = 0; scanOrderIndex < SCAN_NUMBER_OF_TYPES; scanOrderIndex++)
@@ -558,25 +422,6 @@ void destroyROM()
       }
     }
   }
-#else
-  for( uint32_t ch = 0; ch < MAX_NUM_CHANNEL_TYPE; ch++ )
-  {
-    for( uint32_t groupTypeIndex = 0; groupTypeIndex < SCAN_NUMBER_OF_GROUP_TYPES; groupTypeIndex++ )
-    {
-      for( uint32_t scanOrderIndex = 0; scanOrderIndex < SCAN_NUMBER_OF_TYPES; scanOrderIndex++ )
-      {
-        for( uint32_t blockWidthIdx = 0; blockWidthIdx <= numWidths; blockWidthIdx++ )
-        {
-          for( uint32_t blockHeightIdx = 0; blockHeightIdx <= numHeights; blockHeightIdx++ )
-          {
-            delete[] g_scanOrder[ch][groupTypeIndex][scanOrderIndex][blockWidthIdx][blockHeightIdx];
-            g_scanOrder[ch][groupTypeIndex][scanOrderIndex][blockWidthIdx][blockHeightIdx] = nullptr;
-          }
-        }
-      }
-    }
-  }
-#endif
 
   delete gp_sizeIdxInfo;
   gp_sizeIdxInfo = nullptr;
@@ -586,7 +431,6 @@ void destroyROM()
 // Data structure related table & variable
 // ====================================================================================================================
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
 const int g_quantScales[2][SCALING_LIST_REM_NUM] = // can be represented as a 9 element table
 {
     { 26214,23302,20560,18396,16384,14564 },
@@ -598,17 +442,6 @@ const int g_invQuantScales[2][SCALING_LIST_REM_NUM] = // can be represented as a
   { 40,45,51,57,64,72 },
   { 57,64,72,80,90,102 } // Note: last 3 values of second row == double of the first 3 values of the first row
 };
-#else
-const int g_quantScales[SCALING_LIST_REM_NUM] =
-{
-  26214,23302,20560,18396,16384,14564
-};
-
-const int g_invQuantScales[SCALING_LIST_REM_NUM] =
-{
-  40,45,51,57,64,72
-};
-#endif
 
 //--------------------------------------------------------------------------------------------------
 //structures
@@ -665,7 +498,6 @@ const uint8_t g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE] =
 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, DM
 { 0, 1, 2, 2, 2, 2, 2, 2, 2, 3,  4,  6,  8, 10, 12, 13, 14, 16, 18, 20, 22, 23, 24, 26, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 44, 44, 45, 46, 46, 46, 47, 48, 48, 48, 49, 50, 51, 52, 52, 52, 53, 54, 54, 54, 55, 56, 56, 56, 57, 58, 59, 60, DM_CHROMA_IDX };
 
-#if JVET_N0217_MATRIX_INTRAPRED
 extern const uint8_t  g_intraMode65to33AngMapping[NUM_INTRA_MODE] =
 //                                                               H                                                               D                                                               V
 //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, DM
@@ -690,7 +522,6 @@ const int g_sortedMipMpms[3][NUM_MPM_MIP] =
   {  0,  7, 16 },
   {  1,  4,  6 },
 };
-#endif
 
 
 
@@ -710,14 +541,8 @@ UnitScale g_miScaling( MIN_CU_LOG2, MIN_CU_LOG2 );
 // ====================================================================================================================
 
 // scanning order table
-#if JVET_N0103_CGSIZE_HARMONIZATION
 ScanElement *g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_SIZE / 2 + 1][MAX_CU_SIZE / 2 + 1];
-#else
-ScanElement *g_scanOrder[2][SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_SIZE / 2 + 1][MAX_CU_SIZE / 2 + 1];
-#endif
-#if JVET_N0193_LFNST
 ScanElement  g_coefTopLeftDiagScan8x8[ MAX_CU_SIZE / 2 + 1 ][ 64 ];
-#endif
 
 const uint32_t g_uiMinInGroup[LAST_SIGNIFICANT_GROUPS] = { 0,1,2,3,4,6,8,12,16,24,32,48,64,96 };
 const uint32_t g_uiGroupIdx[MAX_TB_SIZEY] = { 0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 };
@@ -732,10 +557,8 @@ const uint32_t g_auiGoRicePosCoeff0[3][32] =
   {1, 1, 2, 2, 2, 3, 4,    4, 4, 6, 6, 6, 8, 8,    8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16,    16, 16, 16, 16}
 };
 
-#if HEVC_USE_SCALING_LISTS
 const char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
 {
-#if JVET_N0847_SCALING_LISTS
   {
     "INTRA1X1_LUMA",
     "INTRA1X1_CHROMAU",
@@ -744,7 +567,6 @@ const char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
     "INTER1X1_CHROMAU",
     "INTER1X1_CHROMAV"
 	},
-#endif
   {
     "INTRA2X2_LUMA",
     "INTRA2X2_CHROMAU",
@@ -777,7 +599,6 @@ const char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
     "INTER16X16_CHROMAU",
     "INTER16X16_CHROMAV"
   },
-#if JVET_N0847_SCALING_LISTS
   {
     "INTRA32X32_LUMA",
     "INTRA32X32_CHROMAU",
@@ -796,24 +617,12 @@ const char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
   },
   {
   },
-#else
-  {
-    "INTRA32X32_LUMA",
-    "INTRA32X32_CHROMAU_FROM16x16_CHROMAU",
-    "INTRA32X32_CHROMAV_FROM16x16_CHROMAV",
-    "INTER32X32_LUMA",
-    "INTER32X32_CHROMAU_FROM16x16_CHROMAU",
-    "INTER32X32_CHROMAV_FROM16x16_CHROMAV"
-  },
-#endif
 };
 
 const char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
 {
-#if JVET_N0847_SCALING_LISTS
   {  //1x1
   },
-#endif
   {
   },
   {
@@ -828,7 +637,6 @@ const char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
     "INTER16X16_CHROMAU_DC",
     "INTER16X16_CHROMAV_DC"
   },
-#if JVET_N0847_SCALING_LISTS
   {
     "INTRA32X32_LUMA_DC",
     "INTRA32X32_CHROMAU_DC",
@@ -847,16 +655,6 @@ const char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =
   },
   {
   },
-#else
-  {
-    "INTRA32X32_LUMA_DC",
-    "INTRA32X32_CHROMAU_DC_FROM16x16_CHROMAU",
-    "INTRA32X32_CHROMAV_DC_FROM16x16_CHROMAV",
-    "INTER32X32_LUMA_DC",
-    "INTER32X32_CHROMAU_DC_FROM16x16_CHROMAU",
-    "INTER32X32_CHROMAV_DC_FROM16x16_CHROMAV"
-  },
-#endif
 };
 
 const int g_quantTSDefault4x4[4 * 4] =
@@ -869,7 +667,6 @@ const int g_quantTSDefault4x4[4 * 4] =
 
 const int g_quantIntraDefault8x8[8 * 8] =
 {
-#if JVET_N0847_SCALING_LISTS
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16,
@@ -878,21 +675,10 @@ const int g_quantIntraDefault8x8[8 * 8] =
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16
-#else
-  16,16,16,16,17,18,21,24,
-  16,16,16,16,17,19,22,25,
-  16,16,17,18,20,22,25,29,
-  16,16,18,21,24,27,31,36,
-  17,17,20,24,30,35,41,47,
-  18,19,22,27,35,44,54,65,
-  21,22,25,31,41,54,70,88,
-  24,25,29,36,47,65,88,115
-#endif
 };
 
 const int g_quantInterDefault8x8[8 * 8] =
 {
-#if JVET_N0847_SCALING_LISTS
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16,
@@ -901,26 +687,10 @@ const int g_quantInterDefault8x8[8 * 8] =
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16,
   16,16,16,16,16,16,16,16
-#else
-  16,16,16,16,17,18,20,24,
-  16,16,16,17,18,20,24,25,
-  16,16,17,18,20,24,25,28,
-  16,17,18,20,24,25,28,33,
-  17,18,20,24,25,28,33,41,
-  18,20,24,25,28,33,41,54,
-  20,24,25,28,33,41,54,71,
-  24,25,28,33,41,54,71,91
-#endif
 };
 
-#if JVET_N0847_SCALING_LISTS
 const uint32_t g_scalingListSize [SCALING_LIST_SIZE_NUM] = { 1, 4, 16, 64, 256, 1024, 4096, 16384 };
 const uint32_t g_scalingListSizeX[SCALING_LIST_SIZE_NUM] = { 1, 2,  4,  8,  16,   32,   64,   128 };
-#else
-const uint32_t g_scalingListSize [SCALING_LIST_SIZE_NUM] = { 4, 16, 64, 256, 1024, 4096, 16384 };
-const uint32_t g_scalingListSizeX[SCALING_LIST_SIZE_NUM] = { 2,  4,  8,  16,   32,   64,   128 };
-#endif
-#endif
 
 
 uint8_t g_triangleMvStorage[TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG2 + 1][MAX_CU_DEPTH - MIN_CU_LOG2 + 1][MAX_CU_SIZE >> MIN_CU_LOG2][MAX_CU_SIZE >> MIN_CU_LOG2];
diff --git a/source/Lib/CommonLib/Rom.h b/source/Lib/CommonLib/Rom.h
index b35701dc1..01cbe66d8 100644
--- a/source/Lib/CommonLib/Rom.h
+++ b/source/Lib/CommonLib/Rom.h
@@ -67,36 +67,21 @@ struct ScanElement
   uint16_t y;
 };
 
-#if JVET_N0103_CGSIZE_HARMONIZATION
 extern       uint32_t   g_log2SbbSize[MAX_CU_DEPTH + 1][MAX_CU_DEPTH + 1][2];
 extern ScanElement
   *g_scanOrder[SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_SIZE / 2 + 1][MAX_CU_SIZE / 2 + 1];
-#else
-extern       uint32_t   g_log2SbbSize   [2][MAX_CU_DEPTH+1][MAX_CU_DEPTH+1][2];
-extern ScanElement
-  *g_scanOrder[2][SCAN_NUMBER_OF_GROUP_TYPES][SCAN_NUMBER_OF_TYPES][MAX_CU_SIZE / 2 + 1][MAX_CU_SIZE / 2 + 1];
-#endif
-#if JVET_N0193_LFNST
 extern       ScanElement   g_coefTopLeftDiagScan8x8[ MAX_CU_SIZE / 2 + 1 ][ 64 ];
-#endif
 
-#if JVET_N0246_MODIFIED_QUANTSCALES
 extern const int g_quantScales   [2/*0=4^n blocks, 1=2*4^n blocks*/][SCALING_LIST_REM_NUM];          // Q(QP%6)
 extern const int g_invQuantScales[2/*0=4^n blocks, 1=2*4^n blocks*/][SCALING_LIST_REM_NUM];          // IQ(QP%6)
-#else
-extern const int g_quantScales   [SCALING_LIST_REM_NUM];          // Q(QP%6)
-extern const int g_invQuantScales[SCALING_LIST_REM_NUM];          // IQ(QP%6)
-#endif
 
 static const int g_numTransformMatrixSizes = 6;
 static const int g_transformMatrixShift[TRANSFORM_NUMBER_OF_DIRECTIONS] = {  6, 6 };
 
-#if JVET_N0217_MATRIX_INTRAPRED
 extern const uint8_t g_intraMode65to33AngMapping[NUM_INTRA_MODE];
 extern const uint8_t g_mapMipToAngular65[3][MAX_NUM_MIP_MODE];
 extern const uint8_t g_mapAngular33ToMip[3][35];
 extern const int     g_sortedMipMpms    [3][NUM_MPM_MIP];
-#endif
 
 // ====================================================================================================================
 // Luma QP to Chroma QP mapping
@@ -148,12 +133,10 @@ extern const TMatrixCoeff g_trCoreDST7P8  [TRANSFORM_NUMBER_OF_DIRECTIONS][  8][
 extern const TMatrixCoeff g_trCoreDST7P16 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 16][ 16];
 extern const TMatrixCoeff g_trCoreDST7P32 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 32][ 32];
 
-#if JVET_N0193_LFNST
 extern const     int8_t   g_lfnst8x8[ 4 ][ 2 ][ 16 ][ 48 ];
 extern const     int8_t   g_lfnst4x4[ 4 ][ 2 ][ 16 ][ 16 ];
 
 extern const     uint8_t  g_lfnstLut[ NUM_INTRA_MODE + NUM_EXT_LUMA_MODE - 1 ];
-#endif
 
 // ====================================================================================================================
 // Misc.
@@ -193,7 +176,6 @@ extern CDTrace* g_trace_ctx;
 
 const char* nalUnitTypeToString(NalUnitType type);
 
-#if HEVC_USE_SCALING_LISTS
 extern const char *MatrixType   [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
 extern const char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
 
@@ -203,7 +185,6 @@ extern const int g_quantInterDefault8x8[8*8];
 
 extern const uint32_t g_scalingListSize [SCALING_LIST_SIZE_NUM];
 extern const uint32_t g_scalingListSizeX[SCALING_LIST_SIZE_NUM];
-#endif
 
 extern MsgLevel g_verbosity;
 
diff --git a/source/Lib/CommonLib/RomLFNST.cpp b/source/Lib/CommonLib/RomLFNST.cpp
index 74a42528e..43d9ebe10 100644
--- a/source/Lib/CommonLib/RomLFNST.cpp
+++ b/source/Lib/CommonLib/RomLFNST.cpp
@@ -37,7 +37,6 @@
 
 #include "Rom.h"
 
-#if JVET_N0193_LFNST
 
 #include <memory.h>
 #include <stdlib.h>
@@ -364,5 +363,4 @@ const int8_t g_lfnst4x4[ 4 ][ 2 ][ 16 ][ 16 ] = {
  }
 };
 
-#endif
 //--------------------------------------------------------------------------------------------------
diff --git a/source/Lib/CommonLib/SampleAdaptiveOffset.cpp b/source/Lib/CommonLib/SampleAdaptiveOffset.cpp
index 481bfdd2c..4c97ae136 100644
--- a/source/Lib/CommonLib/SampleAdaptiveOffset.cpp
+++ b/source/Lib/CommonLib/SampleAdaptiveOffset.cpp
@@ -292,9 +292,7 @@ void SampleAdaptiveOffset::xReconstructBlkSAOParams(CodingStructure& cs, SAOBlkP
 void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng& clpRng, int typeIdx, int* offset
                                           , const Pel* srcBlk, Pel* resBlk, int srcStride, int resStride,  int width, int height
                                           , bool isLeftAvail,  bool isRightAvail, bool isAboveAvail, bool isBelowAvail, bool isAboveLeftAvail, bool isAboveRightAvail, bool isBelowLeftAvail, bool isBelowRightAvail
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                                           , bool isCtuCrossedByVirtualBoundaries, int horVirBndryPos[], int verVirBndryPos[], int numHorVirBndry, int numVerVirBndry
-#endif
   )
 {
   int x,y, startX, startY, endX, endY, edgeType;
@@ -317,13 +315,11 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
         for (x=startX; x< endX; x++)
         {
           signRight = (int8_t)sgn(srcLine[x] - srcLine[x+1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, numVerVirBndry, 0, verVirBndryPos, horVirBndryPos))
           {
             signLeft = -signRight;
             continue;
           }
-#endif
           edgeType =  signRight + signLeft;
           signLeft  = -signRight;
 
@@ -362,13 +358,11 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
         for (x=0; x< width; x++)
         {
           signDown  = (int8_t)sgn(srcLine[x] - srcLineBelow[x]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, 0, numHorVirBndry, verVirBndryPos, horVirBndryPos))
           {
             signUpLine[x] = -signDown;
             continue;
           }
-#endif
           edgeType = signDown + signUpLine[x];
           signUpLine[x]= -signDown;
 
@@ -404,12 +398,10 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
       firstLineEndX   = isAboveAvail? endX: 1;
       for(x= firstLineStartX; x< firstLineEndX; x++)
       {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, 0, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
         {
           continue;
         }
-#endif
         edgeType  =  sgn(srcLine[x] - srcLineAbove[x- 1]) - signUpLine[x+1];
 
         resLine[x] = ClipPel<int>( srcLine[x] + offset[edgeType], clpRng);
@@ -426,13 +418,11 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
         for (x=startX; x<endX; x++)
         {
           signDown =  (int8_t)sgn(srcLine[x] - srcLineBelow[x+ 1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
           {
             signDownLine[x + 1] = -signDown;
             continue;
           }
-#endif
           edgeType =  signDown + signUpLine[x];
           resLine[x] = ClipPel<int>( srcLine[x] + offset[edgeType], clpRng);
 
@@ -454,12 +444,10 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
       lastLineEndX   = isBelowRightAvail ? width : (width -1);
       for(x= lastLineStartX; x< lastLineEndX; x++)
       {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, height - 1, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
         {
           continue;
         }
-#endif
         edgeType =  sgn(srcLine[x] - srcLineBelow[x+ 1]) + signUpLine[x];
         resLine[x] = ClipPel<int>( srcLine[x] + offset[edgeType], clpRng);
 
@@ -488,12 +476,10 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
       firstLineEndX   = isAboveRightAvail ? width : (width-1);
       for(x= firstLineStartX; x< firstLineEndX; x++)
       {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, 0, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
         {
           continue;
         }
-#endif
         edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) -signUpLine[x-1];
         resLine[x] = ClipPel<int>(srcLine[x] + offset[edgeType], clpRng);
       }
@@ -508,13 +494,11 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
         for(x= startX; x< endX; x++)
         {
           signDown =  (int8_t)sgn(srcLine[x] - srcLineBelow[x-1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
           {
             signUpLine[x - 1] = -signDown;
             continue;
           }
-#endif
           edgeType =  signDown + signUpLine[x];
           resLine[x] = ClipPel<int>(srcLine[x] + offset[edgeType], clpRng);
           signUpLine[x-1] = -signDown;
@@ -530,12 +514,10 @@ void SampleAdaptiveOffset::offsetBlock(const int channelBitDepth, const ClpRng&
       lastLineEndX   = isBelowAvail ? endX : 1;
       for(x= lastLineStartX; x< lastLineEndX; x++)
       {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, height - 1, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
         {
           continue;
         }
-#endif
         edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + signUpLine[x];
         resLine[x] = ClipPel<int>(srcLine[x] + offset[edgeType], clpRng);
 
@@ -591,14 +573,12 @@ void SampleAdaptiveOffset::offsetCTU( const UnitArea& area, const CPelUnitBuf& s
     m_signLineBuf2.resize(lineBufferSize);
   }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   int numHorVirBndry = 0, numVerVirBndry = 0;
   int horVirBndryPos[] = { -1,-1,-1 };
   int verVirBndryPos[] = { -1,-1,-1 };
   int horVirBndryPosComp[] = { -1,-1,-1 };
   int verVirBndryPosComp[] = { -1,-1,-1 };
   bool isCtuCrossedByVirtualBoundaries = isCrossedByVirtualBoundaries(area.Y().x, area.Y().y, area.Y().width, area.Y().height, numHorVirBndry, numVerVirBndry, horVirBndryPos, verVirBndryPos, cs.slice->getPPS());
-#endif
   for(int compIdx = 0; compIdx < numberOfComponents; compIdx++)
   {
     const ComponentID compID = ComponentID(compIdx);
@@ -611,7 +591,6 @@ void SampleAdaptiveOffset::offsetCTU( const UnitArea& area, const CPelUnitBuf& s
       const Pel* srcBlk = src.get(compID).bufAt(compArea);
       int  resStride    = res.get(compID).stride;
       Pel* resBlk       = res.get(compID).bufAt(compArea);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       for (int i = 0; i < numHorVirBndry; i++)
       {
         horVirBndryPosComp[i] = (horVirBndryPos[i] >> ::getComponentScaleY(compID, area.chromaFormat)) - compArea.y;
@@ -620,7 +599,6 @@ void SampleAdaptiveOffset::offsetCTU( const UnitArea& area, const CPelUnitBuf& s
       {
         verVirBndryPosComp[i] = (verVirBndryPos[i] >> ::getComponentScaleX(compID, area.chromaFormat)) - compArea.x;
       }
-#endif
 
       offsetBlock( cs.sps->getBitDepth(toChannelType(compID)),
                    cs.slice->clpRng(compID),
@@ -630,9 +608,7 @@ void SampleAdaptiveOffset::offsetCTU( const UnitArea& area, const CPelUnitBuf& s
                   , isAboveAvail, isBelowAvail
                   , isAboveLeftAvail, isAboveRightAvail
                   , isBelowLeftAvail, isBelowRightAvail
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                   , isCtuCrossedByVirtualBoundaries, horVirBndryPosComp, verVirBndryPosComp, numHorVirBndry, numVerVirBndry
-#endif
                   );
     }
   } //compIdx
@@ -753,11 +729,7 @@ void SampleAdaptiveOffset::xPCMSampleRestoration(CodingUnit& cu, const Component
              PelBuf dstBuf  = cu.cs->getRecoBuf( currTU.block(compID) );
 
       dstBuf.copyFrom( pcmBuf );
-#if JVET_N0805_APS_LMCS
       if (cu.slice->getLmcsEnabledFlag() && isLuma(compID))
-#else
-      if (cu.slice->getReshapeInfo().getUseSliceReshaper() && isLuma(compID))
-#endif
       {
         dstBuf.rspSignal(m_pcReshape->getInvLUT());
       }
@@ -779,11 +751,7 @@ void SampleAdaptiveOffset::xPCMSampleRestoration(CodingUnit& cu, const Component
       dstBuf.at(x,y) = (pcmBuf.at(x,y) << uiPcmLeftShiftBit);
     }
   }
-#if JVET_N0805_APS_LMCS
   if (cu.slice->getLmcsEnabledFlag()&& isLuma(compID))
-#else
-  if (cu.slice->getReshapeInfo().getUseSliceReshaper() && isLuma(compID))
-#endif
   {
     dstBuf.rspSignal(m_pcReshape->getInvLUT());
   }
@@ -864,7 +832,6 @@ void SampleAdaptiveOffset::deriveLoopFilterBoundaryAvailibility(CodingStructure&
   }
 }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 bool SampleAdaptiveOffset::isCrossedByVirtualBoundaries(const int xPos, const int yPos, const int width, const int height, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps)
 {
   numHorVirBndry = 0; numVerVirBndry = 0;
@@ -887,5 +854,4 @@ bool SampleAdaptiveOffset::isCrossedByVirtualBoundaries(const int xPos, const in
   }
   return numHorVirBndry > 0 || numVerVirBndry > 0 ;
 }
-#endif
 //! \}
diff --git a/source/Lib/CommonLib/SampleAdaptiveOffset.h b/source/Lib/CommonLib/SampleAdaptiveOffset.h
index a00e527f4..c314eb6f6 100644
--- a/source/Lib/CommonLib/SampleAdaptiveOffset.h
+++ b/source/Lib/CommonLib/SampleAdaptiveOffset.h
@@ -85,9 +85,7 @@ protected:
 
   void offsetBlock(const int channelBitDepth, const ClpRng& clpRng, int typeIdx, int* offset, const Pel* srcBlk, Pel* resBlk, int srcStride, int resStride,  int width, int height
                   , bool isLeftAvail, bool isRightAvail, bool isAboveAvail, bool isBelowAvail, bool isAboveLeftAvail, bool isAboveRightAvail, bool isBelowLeftAvail, bool isBelowRightAvail
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                   , bool isCtuCrossedByVirtualBoundaries, int horVirBndryPos[], int verVirBndryPos[], int numHorVirBndry, int numVerVirBndry
-#endif
     );
   void invertQuantOffsets(ComponentID compIdx, int typeIdc, int typeAuxInfo, int* dstOffsets, int* srcOffsets);
   void reconstructBlkSAOParam(SAOBlkParam& recParam, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES]);
@@ -97,7 +95,6 @@ protected:
   void xPCMCURestoration(CodingStructure& cs, const UnitArea &ctuArea);
   void xPCMSampleRestoration(CodingUnit& cu, const ComponentID compID);
   void xReconstructBlkSAOParams(CodingStructure& cs, SAOBlkParam* saoBlkParams);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool isCrossedByVirtualBoundaries(const int xPos, const int yPos, const int width, const int height, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps);
   inline bool isProcessDisabled(int xPos, int yPos, int numVerVirBndry, int numHorVirBndry, int verVirBndryPos[], int horVirBndryPos[])
   {
@@ -120,7 +117,6 @@ protected:
     }
     return bDisabledFlag;
   }
-#endif
   Reshape* m_pcReshape;
 protected:
   uint32_t m_offsetStepLog2[MAX_NUM_COMPONENT]; //offset step
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index ef03c18ec..ede292b45 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -53,15 +53,8 @@ Slice::Slice()
 , m_iLastIDR                      ( 0 )
 , m_iAssociatedIRAP               ( 0 )
 , m_iAssociatedIRAPType           ( NAL_UNIT_INVALID )
-#if JVET_M0128
 , m_rpl0Idx                       ( -1 )
 , m_rpl1Idx                       ( -1 )
-#else
-, m_pRPS                          ( 0 )
-, m_localRPS                      ( )
-, m_rpsIdx                        ( 0 )
-, m_RefPicListModification        ( )
-#endif
 , m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR_W_RADL )
 , m_eSliceType                    ( I_SLICE )
 , m_iSliceQp                      ( 0 )
@@ -72,9 +65,7 @@ Slice::Slice()
 , m_deblockingFilterTcOffsetDiv2  ( 0 )
 , m_pendingRasInit                ( false )
 , m_depQuantEnabledFlag           ( false )
-#if HEVC_USE_SIGN_HIDING
 , m_signDataHidingEnabledFlag     ( false )
-#endif
 , m_bCheckLDC                     ( false )
 , m_biDirPred                    ( false )
 , m_iSliceQpDelta                 ( 0 )
@@ -82,9 +73,7 @@ Slice::Slice()
 #if HEVC_VPS
 , m_pcVPS                         ( NULL )
 #endif
-#if JVET_N0349_DPS
 , m_dps                           ( nullptr )
-#endif
 , m_pcSPS                         ( NULL )
 , m_pcPPS                         ( NULL )
 , m_pcPic                         ( NULL )
@@ -95,9 +84,7 @@ Slice::Slice()
 , m_colRefIdx                     ( 0 )
 , m_maxNumMergeCand               ( 0 )
 , m_maxNumAffineMergeCand         ( 0 )
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
 , m_maxNumTriangleCand            ( 0 )
-#endif
 , m_disFracMMVD                   ( false )
 , m_uiTLayer                      ( 0 )
 , m_bTLayerSwitchingFlag          ( false )
@@ -114,9 +101,6 @@ Slice::Slice()
 , m_substreamSizes                ( )
 , m_cabacInitFlag                 ( false )
 , m_bLMvdL1Zero                   ( false )
-#if !JVET_M0101_HLS
-, m_temporalLayerNonReferenceFlag ( false )
-#endif
 , m_LFCrossSliceBoundaryFlag      ( false )
 , m_enableTMVPFlag                ( true )
 , m_encCABACTableIdx              (I_SLICE)
@@ -131,16 +115,10 @@ Slice::Slice()
 , m_uiMaxBTSizeIChroma            ( 0 )
 , m_uiMaxTTSizeIChroma            ( 0 )
 , m_uiMaxBTSize                   ( 0 )
-#if !JVET_N0415_CTB_ALF
-, m_apsId                        ( -1 )
-, m_aps                          (NULL)
-#endif
-#if  JVET_N0805_APS_LMCS
 , m_lmcsApsId                    ( -1 )
 , m_lmcsAps                      (nullptr)
 , m_tileGroupLmcsEnabledFlag     (false)
 , m_tileGroupLmcsChromaResidualScaleFlag (false)
-#endif
 {
   for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++)
   {
@@ -152,9 +130,7 @@ Slice::Slice()
     m_lambdas            [component] = 0.0;
     m_iSliceChromaQpDelta[component] = 0;
   }
-#if JVET_N0054_JOINT_CHROMA
   m_iSliceChromaQpDelta[JOINT_CbCr] = 0;
-#endif
 
   initEqualRef();
 
@@ -180,21 +156,7 @@ Slice::Slice()
     m_saoEnabledFlag[ch] = false;
   }
 
-#if !JVET_N0805_APS_LMCS
-  m_sliceReshapeInfo.setUseSliceReshaper(false);
-  m_sliceReshapeInfo.setSliceReshapeModelPresentFlag(false);
-  m_sliceReshapeInfo.setSliceReshapeChromaAdj(0);
-  m_sliceReshapeInfo.reshaperModelMinBinIdx = 0;
-  m_sliceReshapeInfo.reshaperModelMaxBinIdx = PIC_CODE_CW_BINS - 1;
-  memset(m_sliceReshapeInfo.reshaperModelBinCWDelta, 0, PIC_CODE_CW_BINS * sizeof(int));
-#endif
-#if JVET_N0415_CTB_ALF
-#if  JVET_N0805_APS_LMCS
   memset(m_alfApss, 0, sizeof(m_alfApss));
-#else
-  memset(m_apss, 0, sizeof(m_apss));
-#endif
-#endif
 }
 
 Slice::~Slice()
@@ -223,9 +185,7 @@ void Slice::initSlice()
   {
     m_iSliceChromaQpDelta[component] = 0;
   }
-#if JVET_N0054_JOINT_CHROMA
   m_iSliceChromaQpDelta[JOINT_CbCr] = 0;
-#endif
 
   m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
   m_maxNumAffineMergeCand = AFFINE_MRG_MAX_NUM_CANDS;
@@ -255,11 +215,6 @@ bool Slice::getRapPicFlag() const
 {
   return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
       || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
-#if !JVET_M0101_HLS
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-#endif
     || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
 }
 
@@ -392,7 +347,6 @@ void Slice::setList1IdxToList0Idx()
   }
 }
 
-#if JVET_M0128
 void Slice::constructRefPicList(PicList& rcListPic)
 {
   ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
@@ -451,184 +405,6 @@ void Slice::constructRefPicList(PicList& rcListPic)
     m_bIsUsedAsLongTerm[REF_PIC_LIST_1][ii] = pcRefPic->longTerm;
   }
 }
-#else
-void Slice::setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr, bool bCopyL0toL1ErrorCase )
-{
-  if ( m_eSliceType == I_SLICE)
-  {
-    ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
-    ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
-
-    if (!checkNumPocTotalCurr)
-    {
-      return;
-    }
-  }
-
-  Picture*  pcRefPic= NULL;
-  static const uint32_t MAX_NUM_NEGATIVE_PICTURES=16;
-  Picture*  RefPicSetStCurr0[MAX_NUM_NEGATIVE_PICTURES];
-  Picture*  RefPicSetStCurr1[MAX_NUM_NEGATIVE_PICTURES];
-  Picture*  RefPicSetLtCurr[MAX_NUM_NEGATIVE_PICTURES];
-  uint32_t NumPicStCurr0 = 0;
-  uint32_t NumPicStCurr1 = 0;
-  uint32_t NumPicLtCurr = 0;
-  int i;
-
-  for(i=0; i < m_pRPS->getNumberOfNegativePictures(); i++)
-  {
-    if(m_pRPS->getUsed(i))
-    {
-      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pRPS->getDeltaPOC(i));
-      pcRefPic->longTerm = false;
-      pcRefPic->extendPicBorder();
-      RefPicSetStCurr0[NumPicStCurr0] = pcRefPic;
-      NumPicStCurr0++;
-    }
-  }
-
-  for(; i < m_pRPS->getNumberOfNegativePictures()+m_pRPS->getNumberOfPositivePictures(); i++)
-  {
-    if(m_pRPS->getUsed(i))
-    {
-      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pRPS->getDeltaPOC(i));
-      pcRefPic->longTerm = false;
-      pcRefPic->extendPicBorder();
-      RefPicSetStCurr1[NumPicStCurr1] = pcRefPic;
-      NumPicStCurr1++;
-    }
-  }
-
-  for(i = m_pRPS->getNumberOfNegativePictures()+m_pRPS->getNumberOfPositivePictures()+m_pRPS->getNumberOfLongtermPictures()-1; i > m_pRPS->getNumberOfNegativePictures()+m_pRPS->getNumberOfPositivePictures()-1 ; i--)
-  {
-    if(m_pRPS->getUsed(i))
-    {
-      pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i));
-      pcRefPic->longTerm = true;
-      pcRefPic->extendPicBorder();
-      RefPicSetLtCurr[NumPicLtCurr] = pcRefPic;
-      NumPicLtCurr++;
-    }
-    if(pcRefPic==NULL)
-    {
-      pcRefPic = xGetLongTermRefPic(rcListPic, m_pRPS->getPOC(i), m_pRPS->getCheckLTMSBPresent(i));
-    }
-  }
-  // ref_pic_list_init
-  Picture*  rpsCurrList0[MAX_NUM_REF+1];
-  Picture*  rpsCurrList1[MAX_NUM_REF+1];
-  int numPicTotalCurr = NumPicStCurr0 + NumPicStCurr1 + NumPicLtCurr;
-
-  if (checkNumPocTotalCurr)
-  {
-    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
-    // - If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
-    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
-    if (getRapPicFlag())
-    {
-        CHECK(numPicTotalCurr != 0, "Invalid state");
-    }
-
-    if (m_eSliceType == I_SLICE)
-    {
-      return;
-    }
-
-    CHECK(numPicTotalCurr == 0, "Invalid state");
-    // general tier and level limit:
-    CHECK(numPicTotalCurr > 8, "Invalid state");
-  }
-
-  int cIdx = 0;
-  for ( i=0; i<NumPicStCurr0; i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
-  }
-  for ( i=0; i<NumPicStCurr1; i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
-  }
-  for ( i=0; i<NumPicLtCurr;  i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
-  }
-  CHECK(cIdx != numPicTotalCurr, "Invalid state");
-
-  if (m_eSliceType==B_SLICE)
-  {
-    cIdx = 0;
-    for ( i=0; i<NumPicStCurr1; i++, cIdx++)
-    {
-      rpsCurrList1[cIdx] = RefPicSetStCurr1[i];
-    }
-    for ( i=0; i<NumPicStCurr0; i++, cIdx++)
-    {
-      rpsCurrList1[cIdx] = RefPicSetStCurr0[i];
-    }
-    for ( i=0; i<NumPicLtCurr;  i++, cIdx++)
-    {
-      rpsCurrList1[cIdx] = RefPicSetLtCurr[i];
-    }
-    CHECK(cIdx != numPicTotalCurr, "Invalid state");
-  }
-
-  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
-
-  for (int rIdx = 0; rIdx < m_aiNumRefIdx[REF_PIC_LIST_0]; rIdx ++)
-  {
-    cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPicTotalCurr;
-    CHECK(cIdx < 0 || cIdx >= numPicTotalCurr, "Invalid state");
-    m_apcRefPicList[REF_PIC_LIST_0][rIdx] = rpsCurrList0[ cIdx ];
-    m_bIsUsedAsLongTerm[REF_PIC_LIST_0][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
-  }
-  if ( m_eSliceType != B_SLICE )
-  {
-    m_aiNumRefIdx[REF_PIC_LIST_1] = 0;
-    ::memset( m_apcRefPicList[REF_PIC_LIST_1], 0, sizeof(m_apcRefPicList[REF_PIC_LIST_1]));
-  }
-  else
-  {
-    for (int rIdx = 0; rIdx < m_aiNumRefIdx[REF_PIC_LIST_1]; rIdx ++)
-    {
-      cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPicTotalCurr;
-      CHECK(cIdx < 0 || cIdx >= numPicTotalCurr, "Invalid state");
-      m_apcRefPicList[REF_PIC_LIST_1][rIdx] = rpsCurrList1[ cIdx ];
-      m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
-    }
-  }
-    // For generalized B
-  // note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
-  if( bCopyL0toL1ErrorCase && isInterB() && getNumRefIdx(REF_PIC_LIST_1) == 0)
-  {
-    int iNumRefIdx = getNumRefIdx(REF_PIC_LIST_0);
-    setNumRefIdx( REF_PIC_LIST_1, iNumRefIdx );
-
-    for (int iRefIdx = 0; iRefIdx < iNumRefIdx; iRefIdx++)
-    {
-      m_apcRefPicList[REF_PIC_LIST_1][iRefIdx] = m_apcRefPicList[REF_PIC_LIST_0] [iRefIdx];
-    }
-  }
-}
-
-
-int Slice::getNumRpsCurrTempList() const
-{
-  int numRpsCurrTempList = 0;
-
-  if (m_eSliceType == I_SLICE)
-  {
-    return 0;
-  }
-  for(uint32_t i=0; i < m_pRPS->getNumberOfNegativePictures()+ m_pRPS->getNumberOfPositivePictures() + m_pRPS->getNumberOfLongtermPictures(); i++)
-  {
-    if(m_pRPS->getUsed(i))
-    {
-      numRpsCurrTempList++;
-    }
-  }
-    return numRpsCurrTempList;
-}
-#endif
 
 void Slice::initEqualRef()
 {
@@ -668,7 +444,6 @@ void Slice::checkColRefIdx(uint32_t curSliceSegmentIdx, const Picture* pic)
   }
 }
 
-#if JVET_M0128
 void Slice::checkCRA(const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1, int& pocCRA, NalUnitType& associatedIRAPType, PicList& rcListPic)
 {
   if (pocCRA < MAX_UINT && getPOC() > pocCRA)
@@ -708,61 +483,7 @@ void Slice::checkCRA(const ReferencePictureList *pRPL0, const ReferencePictureLi
     pocCRA = getPOC();
     associatedIRAPType = getNalUnitType();
   }
-#if !JVET_M0101_HLS
-  else if (getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP) // BLA picture found
-  {
-    pocCRA = getPOC();
-    associatedIRAPType = getNalUnitType();
-  }
-#endif
 }
-#else
-void Slice::checkCRA(const ReferencePictureSet *pReferencePictureSet, int& pocCRA, NalUnitType& associatedIRAPType, PicList& rcListPic)
-{
-  for(int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
-  {
-    if(pocCRA < MAX_UINT && getPOC() > pocCRA)
-    {
-      CHECK(getPOC()+pReferencePictureSet->getDeltaPOC(i) < pocCRA, "Invalid state");
-    }
-  }
-  for(int i = pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i < pReferencePictureSet->getNumberOfPictures(); i++)
-  {
-    if(pocCRA < MAX_UINT && getPOC() > pocCRA)
-    {
-      if (!pReferencePictureSet->getCheckLTMSBPresent(i))
-      {
-        CHECK(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() < pocCRA, "Invalid state");
-      }
-      else
-      {
-        CHECK(pReferencePictureSet->getPOC(i) < pocCRA, "Invalid state");
-      }
-    }
-  }
-  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
-  {
-    pocCRA = getPOC();
-    associatedIRAPType = getNalUnitType();
-  }
-  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
-  {
-    pocCRA = getPOC();
-    associatedIRAPType = getNalUnitType();
-  }
-#if !JVET_M0101_HLS
-  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found
-  {
-    pocCRA = getPOC();
-    associatedIRAPType = getNalUnitType();
-  }
-#endif
-}
-#endif
 
 /** Function for marking the reference pictures when an IDR/CRA/CRANT/BLA/BLANT is encountered.
  * \param pocCRA POC of the CRA/CRANT/BLA/BLANT picture
@@ -787,16 +508,8 @@ void Slice::decodingRefreshMarking(int& pocCRA, bool& bRefreshPending, PicList&
   Picture* rpcPic;
   int      pocCurr = getPOC();
 
-#if !JVET_M0101_HLS
-  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )  // IDR or BLA picture
-#else
   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP)  // IDR picture
-#endif
   {
     // mark all pictures as not used for reference
     PicList::iterator        iterPic       = rcListPic.begin();
@@ -810,14 +523,6 @@ void Slice::decodingRefreshMarking(int& pocCRA, bool& bRefreshPending, PicList&
       }
       iterPic++;
     }
-#if !JVET_M0101_HLS
-    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
-    {
-      pocCRA = pocCurr;
-    }
-#endif
     if (bEfficientFieldIRAPEnabled)
     {
       bRefreshPending = true;
@@ -907,9 +612,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
   {
     m_iSliceChromaQpDelta[component] = pSrc->m_iSliceChromaQpDelta[component];
   }
-#if JVET_N0054_JOINT_CHROMA
   m_iSliceChromaQpDelta[JOINT_CbCr] = pSrc->m_iSliceChromaQpDelta[JOINT_CbCr];
-#endif
 
   for (i = 0; i < NUM_REF_PIC_LIST_01; i++)
   {
@@ -924,12 +627,8 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
   if( cpyAlmostAll ) m_iDepth = pSrc->m_iDepth;
 
   // access channel
-#if JVET_M0128
   if (cpyAlmostAll) m_pRPL0 = pSrc->m_pRPL0;
   if (cpyAlmostAll) m_pRPL1 = pSrc->m_pRPL1;
-#else
-  if( cpyAlmostAll ) m_pRPS   = pSrc->m_pRPS;
-#endif
   m_iLastIDR             = pSrc->m_iLastIDR;
 
   if( cpyAlmostAll ) m_pcPic  = pSrc->m_pcPic;
@@ -976,33 +675,19 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
   }
 
   m_cabacInitFlag                 = pSrc->m_cabacInitFlag;
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS 
   memcpy(m_alfApss, pSrc->m_alfApss, sizeof(m_alfApss)); // this might be quite unsafe
-#else
-  memcpy(m_apss, pSrc->m_apss, sizeof(m_apss)); // this might be quite unsafe
-#endif
   memcpy( m_tileGroupAlfEnabledFlag, pSrc->m_tileGroupAlfEnabledFlag, sizeof(m_tileGroupAlfEnabledFlag));
   m_tileGroupNumAps               = pSrc->m_tileGroupNumAps;
   m_tileGroupLumaApsId            = pSrc->m_tileGroupLumaApsId;
   m_tileGroupChromaApsId          = pSrc->m_tileGroupChromaApsId;
-#else
-  m_apsId                         = pSrc->m_apsId;
-  m_aps                           = pSrc->m_aps;
-  m_tileGroupAlfEnabledFlag       = pSrc->m_tileGroupAlfEnabledFlag;
-#endif
-#if JVET_N0329_IBC_SEARCH_IMP 
   m_disableSATDForRd              = pSrc->m_disableSATDForRd;
-#endif
 
   m_bLMvdL1Zero                   = pSrc->m_bLMvdL1Zero;
   m_LFCrossSliceBoundaryFlag      = pSrc->m_LFCrossSliceBoundaryFlag;
   m_enableTMVPFlag                = pSrc->m_enableTMVPFlag;
   m_maxNumMergeCand               = pSrc->m_maxNumMergeCand;
   m_maxNumAffineMergeCand         = pSrc->m_maxNumAffineMergeCand;
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   m_maxNumTriangleCand            = pSrc->m_maxNumTriangleCand;
-#endif
   m_disFracMMVD                   = pSrc->m_disFracMMVD;
   if( cpyAlmostAll ) m_encCABACTableIdx  = pSrc->m_encCABACTableIdx;
   m_splitConsOverrideFlag         = pSrc->m_splitConsOverrideFlag;
@@ -1018,14 +703,10 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
   m_depQuantEnabledFlag           = pSrc->m_depQuantEnabledFlag;
   m_signDataHidingEnabledFlag     = pSrc->m_signDataHidingEnabledFlag;
 
-#if JVET_N0805_APS_LMCS 
   m_tileGroupLmcsEnabledFlag = pSrc->m_tileGroupLmcsEnabledFlag;
   m_tileGroupLmcsChromaResidualScaleFlag = pSrc->m_tileGroupLmcsChromaResidualScaleFlag;
   m_lmcsAps = pSrc->m_lmcsAps;
   m_lmcsApsId = pSrc->m_lmcsApsId;
-#else
-  m_sliceReshapeInfo              = pSrc->m_sliceReshapeInfo;
-#endif
 }
 
 
@@ -1077,64 +758,25 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
   if(this->getAssociatedIRAPPOC() > this->getPOC())
   {
     // Do not check IRAP pictures since they may get a POC lower than their associated IRAP
-#if JVET_N0067_NAL_Unit_Header
     if (nalUnitType < NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
         nalUnitType > NAL_UNIT_CODED_SLICE_CRA)
-#else
-#if !JVET_M0101_HLS
-    if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP ||
-       nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23)
-#else
-    if (nalUnitType < NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
-        nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL13)
-#endif
-#endif
     {
-#if !JVET_M0101_HLS
-      CHECK( nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N &&
-             nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R &&
-             nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N &&
-             nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R, "Invalid NAL unit type");
-#else
       CHECK(nalUnitType != NAL_UNIT_CODED_SLICE_RASL &&
             nalUnitType != NAL_UNIT_CODED_SLICE_RADL, "Invalid NAL unit type");
-#endif
     }
   }
 
   // When a picture is a trailing picture, it shall not be a RADL or RASL picture.
   if(this->getAssociatedIRAPPOC() < this->getPOC())
   {
-#if !JVET_M0101_HLS
-    CHECK( nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
-           nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
-           nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
-           nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R, "Invalid NAL unit type" );
-#else
     CHECK(nalUnitType == NAL_UNIT_CODED_SLICE_RASL ||
           nalUnitType == NAL_UNIT_CODED_SLICE_RADL, "Invalid NAL unit type");
-#endif
   }
 
-#if !JVET_M0101_HLS
-  // No RASL pictures shall be present in the bitstream that are associated
-  // with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP.
-  if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
-     nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
-  {
-    CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
-           this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP, "Invalid NAL unit type");
-  }
-#endif
 
   // No RASL pictures shall be present in the bitstream that are associated with
   // an IDR picture.
-#if !JVET_M0101_HLS
-  if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
-     nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
-#else
   if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
-#endif
   {
     CHECK( this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP   ||
            this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL, "Invalid NAL unit type");
@@ -1143,19 +785,9 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
   // No RADL pictures shall be present in the bitstream that are associated with
   // a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated
   // with an IDR picture having nal_unit_type equal to IDR_N_LP.
-#if !JVET_M0101_HLS
-  if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
-     nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
-#else
   if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
-#endif
   {
-#if !JVET_M0101_HLS
-    CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
-           this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP, "Invalid NAL unit type");
-#else
     CHECK (this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP, "Invalid NAL unit type");
-#endif
   }
 
   // loop through all pictures in the reference picture buffer
@@ -1178,18 +810,9 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
     // (Note that any picture following in output order would be present in the DPB)
     if(pcSlice->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag())
     {
-#if !JVET_M0101_HLS
-      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP    ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL  ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_CRA         ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP    ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
-#else
       if (nalUnitType == NAL_UNIT_CODED_SLICE_CRA ||
           nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP ||
           nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
-#endif
       {
         CHECK(pcPic->poc >= this->getPOC(), "Invalid POC");
       }
@@ -1198,564 +821,71 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
     // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture
     // in decoding order shall precede any RADL picture associated with the IRAP
     // picture in output order.
-    if(pcSlice->getPicOutputFlag() == 1)
-    {
-#if !JVET_M0101_HLS
-      if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
-          nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R))
-#else
-      if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
-#endif
-      {
-        // rpcPic precedes the IRAP in decoding order
-        if(this->getAssociatedIRAPPOC() > pcSlice->getAssociatedIRAPPOC())
-        {
-          // rpcPic must not be the IRAP picture
-          if(this->getAssociatedIRAPPOC() != pcPic->poc)
-          {
-            CHECK( pcPic->poc >= this->getPOC(), "Invalid POC");
-          }
-        }
-      }
-    }
-
-    // When a picture is a leading picture, it shall precede, in decoding order,
-    // all trailing pictures that are associated with the same IRAP picture.
-#if !JVET_M0101_HLS
-    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
-         nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
-#else
-    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL ||
-        nalUnitType == NAL_UNIT_CODED_SLICE_RADL )
-#endif
-      {
-        if(pcSlice->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC())
-        {
-          // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB
-          // rpcPic would violate the constraint if it was a trailing picture
-          CHECK( pcPic->poc > this->getAssociatedIRAPPOC(), "Invalid POC");
-        }
-      }
-
-    // Any RASL picture associated with a CRA or BLA picture shall precede any
-    // RADL picture associated with the CRA or BLA picture in output order
-#if !JVET_M0101_HLS
-    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
-       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
-#else
-    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
-#endif
-    {
-#if !JVET_M0101_HLS
-      if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
-          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   ||
-          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
-          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
-#else
-      if ((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
-#endif
-          this->getAssociatedIRAPPOC() == pcSlice->getAssociatedIRAPPOC())
-      {
-#if !JVET_M0101_HLS
-        if(pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ||
-           pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R)
-#else
-        if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL)
-#endif
-        {
-          CHECK( pcPic->poc <= this->getPOC(), "Invalid POC");
-        }
-      }
-    }
-
-    // Any RASL picture associated with a CRA picture shall follow, in output
-    // order, any IRAP picture that precedes the CRA picture in decoding order.
-#if !JVET_M0101_HLS
-    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
-       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
-#else
-    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
-#endif
-    {
-      if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)
-      {
-        if(pcSlice->getPOC() < this->getAssociatedIRAPPOC() &&
-          (
-#if !JVET_M0101_HLS
-            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
-            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   ||
-            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
-#endif
-            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP   ||
-            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
-            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))
-        {
-          CHECK(this->getPOC() <= pcSlice->getPOC(), "Invalid POC");
-        }
-      }
-    }
-  }
-}
-
-
-
-#if !JVET_M0128
-/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
-*/
-void Slice::applyReferencePictureSet( PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet) const
-{
-  int i, isReference;
-
-  checkLeadingPictureRestrictions(rcListPic);
-
-  // loop through all pictures in the reference picture buffer
-  PicList::iterator iterPic = rcListPic.begin();
-  while ( iterPic != rcListPic.end())
-  {
-    Picture* pcPic = *(iterPic++);
-
-    if( ! pcPic->referenced)
-    {
-#if JVET_N0247_HASH_IMPROVE
-      pcPic->getHashMap()->clearAll();
-#endif
-      continue;
-    }
-
-    isReference = 0;
-    // loop through all pictures in the Reference Picture Set
-    // to see if the picture should be kept as reference picture
-    for(i=0;i<pReferencePictureSet->getNumberOfPositivePictures()+pReferencePictureSet->getNumberOfNegativePictures();i++)
-    {
-      if( ! pcPic->longTerm && pcPic->poc == this->getPOC() + pReferencePictureSet->getDeltaPOC(i))
-      {
-        isReference = 1;
-        pcPic->usedByCurr = pReferencePictureSet->getUsed(i);
-        pcPic->longTerm = false;
-      }
-    }
-    for(;i<pReferencePictureSet->getNumberOfPictures();i++)
-    {
-      if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
-      {
-        if( pcPic->longTerm && pcPic->poc == pReferencePictureSet->getPOC(i))
-        {
-          isReference = 1;
-          pcPic->usedByCurr = pReferencePictureSet->getUsed(i);
-        }
-      }
-      else
-      {
-        int pocCycle = 1 << pcPic->cs->sps->getBitsForPOC();
-        int curPoc = pcPic->poc & (pocCycle-1);
-        int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1);
-        if( pcPic->longTerm && curPoc == refPoc)
-        {
-          isReference = 1;
-          pcPic->usedByCurr = pReferencePictureSet->getUsed(i);
-        }
-      }
-    }
-    // mark the picture as "unused for reference" if it is not in
-    // the Reference Picture Set
-    if( pcPic->poc != this->getPOC() && isReference == 0)
-    {
-      pcPic->referenced = false;
-      pcPic->usedByCurr = false;
-      pcPic->longTerm   = false;
-      pcPic->getHashMap()->clearAll();
-    }
-
-    // sanity checks
-    if( pcPic->referenced)
-    {
-      //check that pictures of higher temporal layers are not used
-      CHECK( pcPic->usedByCurr && !(pcPic->layer<=this->getTLayer()), "Invalid state");
-      //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture
-#if !JVET_M0101_HLS
-      if( this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
-      {
-        CHECK( !(pcPic->layer<this->getTLayer()), "Invalid state");
-      }
-#endif
-#if !JVET_M0101_HLS
-      //check that pictures marked as temporal layer non-reference pictures are not used for reference
-      if( pcPic->poc != this->getPOC() && (pcPic->layer == this->getTLayer()))
-      {
-        CHECK( pcPic->usedByCurr && pcPic->slices[0]->getTemporalLayerNonReferenceFlag(), "Invalid state");
-      }
-#endif
-    }
-  }
-}
-
-/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
-*/
-int Slice::checkThatAllRefPicsAreAvailable( PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool printErrors, int pocRandomAccess, bool bUseRecoveryPoint) const
-{
-  int atLeastOneUnabledByRecoveryPoint = 0;
-  int atLeastOneFlushedByPreviousIDR = 0;
-  Picture* rpcPic;
-  int i, isAvailable;
-  int atLeastOneLost = 0;
-  int atLeastOneRemoved = 0;
-  int iPocLost = 0;
-
-  // loop through all long-term pictures in the Reference Picture Set
-  // to see if the picture should be kept as reference picture
-  for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++)
-  {
-    isAvailable = 0;
-    // loop through all pictures in the reference picture buffer
-    PicList::iterator iterPic = rcListPic.begin();
-    while ( iterPic != rcListPic.end())
-    {
-      rpcPic = *(iterPic++);
-      if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
-      {
-        if(rpcPic->longTerm && (rpcPic->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->referenced)
-        {
-          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
-          {
-            isAvailable = 0;
-          }
-          else
-          {
-            isAvailable = 1;
-          }
-        }
-      }
-      else
-      {
-        int pocCycle = 1<<rpcPic->cs->sps->getBitsForPOC();
-        int curPoc = rpcPic->getPOC() & (pocCycle-1);
-        int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1);
-        if(rpcPic->longTerm && curPoc == refPoc && rpcPic->referenced)
-        {
-          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
-          {
-            isAvailable = 0;
-          }
-          else
-          {
-            isAvailable = 1;
-          }
-        }
-      }
-    }
-    // if there was no such long-term check the short terms
-    if(!isAvailable)
-    {
-      iterPic = rcListPic.begin();
-      while ( iterPic != rcListPic.end())
-      {
-        rpcPic = *(iterPic++);
-
-        int pocCycle = 1 << rpcPic->cs->sps->getBitsForPOC();
-        int curPoc = rpcPic->getPOC();
-        int refPoc = pReferencePictureSet->getPOC(i);
-        if (!pReferencePictureSet->getCheckLTMSBPresent(i))
-        {
-          curPoc = curPoc & (pocCycle - 1);
-          refPoc = refPoc & (pocCycle - 1);
-        }
-
-        if (rpcPic->referenced && curPoc == refPoc)
-        {
-          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
-          {
-            isAvailable = 0;
-          }
-          else
-          {
-            isAvailable = 1;
-            rpcPic->longTerm = true;
-            break;
-          }
-        }
-      }
-    }
-    // report that a picture is lost if it is in the Reference Picture Set
-    // but not available as reference picture
-    if(isAvailable == 0)
-    {
-      if (this->getPOC() + pReferencePictureSet->getDeltaPOC(i) >= pocRandomAccess)
-      {
-        if(!pReferencePictureSet->getUsed(i) )
-        {
-          if(printErrors)
-          {
-            msg( ERROR, "\nLong-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
-          }
-          atLeastOneRemoved = 1;
-        }
-        else
-        {
-          if(printErrors)
-          {
-            msg( ERROR, "\nLong-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
-          }
-          atLeastOneLost = 1;
-          iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i);
-        }
-      }
-      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
-      {
-        atLeastOneUnabledByRecoveryPoint = 1;
-      }
-      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
-      {
-        atLeastOneFlushedByPreviousIDR = 1;
-      }
-    }
-  }
-  // loop through all short-term pictures in the Reference Picture Set
-  // to see if the picture should be kept as reference picture
-  for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++)
-  {
-    isAvailable = 0;
-    // loop through all pictures in the reference picture buffer
-    PicList::iterator iterPic = rcListPic.begin();
-    while ( iterPic != rcListPic.end())
-    {
-      rpcPic = *(iterPic++);
-
-      if( ! rpcPic->longTerm && rpcPic->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->referenced)
-      {
-        if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
-        {
-          isAvailable = 0;
-        }
-        else
-        {
-          isAvailable = 1;
-        }
-      }
-    }
-    // report that a picture is lost if it is in the Reference Picture Set
-    // but not available as reference picture
-    if(isAvailable == 0)
-    {
-      if (this->getPOC() + pReferencePictureSet->getDeltaPOC(i) >= pocRandomAccess)
-      {
-        if(!pReferencePictureSet->getUsed(i) )
-        {
-          if(printErrors)
-          {
-            msg( ERROR, "\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
-          }
-          atLeastOneRemoved = 1;
-        }
-        else
-        {
-          if(printErrors)
-          {
-            msg( ERROR, "\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
-          }
-          atLeastOneLost = 1;
-          iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i);
-        }
-      }
-      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
-      {
-        atLeastOneUnabledByRecoveryPoint = 1;
-      }
-      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
-      {
-        atLeastOneFlushedByPreviousIDR = 1;
-      }
-    }
-  }
-
-  if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR)
-  {
-    return -1;
-  }
-  if(atLeastOneLost)
-  {
-    return iPocLost+1;
-  }
-  if(atLeastOneRemoved)
-  {
-    return -2;
-  }
-  else
-  {
-    return 0;
-  }
-}
-
-/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
-*/
-void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool isRAP, int pocRandomAccess, bool bUseRecoveryPoint, const bool bEfficientFieldIRAPEnabled
-                                                         , bool isEncodeLtRef, bool isCompositeRefEnable
-)
-{
-  Picture* rpcPic;
-  int i, j;
-  int k = 0;
-  int nrOfNegativePictures = 0;
-  int nrOfPositivePictures = 0;
-  ReferencePictureSet* pLocalRPS = this->getLocalRPS();
-  (*pLocalRPS)=ReferencePictureSet();
-
-  bool irapIsInRPS = false; // Used when bEfficientFieldIRAPEnabled==true
-
-  // loop through all pictures in the Reference Picture Set
-  for(i=0;i<pReferencePictureSet->getNumberOfPictures();i++)
-  {
-    j = 0;
-    // loop through all pictures in the reference picture buffer
-    PicList::iterator iterPic = rcListPic.begin();
-    while ( iterPic != rcListPic.end())
+    if(pcSlice->getPicOutputFlag() == 1)
     {
-      j++;
-      rpcPic = *(iterPic++);
-
-      if(rpcPic->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->referenced)
+      if (nalUnitType == NAL_UNIT_CODED_SLICE_RADL)
       {
-        // This picture exists as a reference picture
-        // and should be added to the explicit Reference Picture Set
-        pLocalRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
-        pLocalRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
-        if (bEfficientFieldIRAPEnabled)
-        {
-          pLocalRPS->setUsed(k, pLocalRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
-        }
-
-        if(pLocalRPS->getDeltaPOC(k) < 0)
-        {
-          nrOfNegativePictures++;
-        }
-        else
+        // rpcPic precedes the IRAP in decoding order
+        if(this->getAssociatedIRAPPOC() > pcSlice->getAssociatedIRAPPOC())
         {
-          if (bEfficientFieldIRAPEnabled && rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC() + (isCompositeRefEnable ? 2 : 1))
+          // rpcPic must not be the IRAP picture
+          if(this->getAssociatedIRAPPOC() != pcPic->poc)
           {
-            irapIsInRPS = true;
+            CHECK( pcPic->poc >= this->getPOC(), "Invalid POC");
           }
-          nrOfPositivePictures++;
         }
-        k++;
       }
     }
-  }
 
-  bool useNewRPS = false;
-  // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS.
-  if(bEfficientFieldIRAPEnabled && m_pcPic->fieldPic && !irapIsInRPS)
-  {
-    PicList::iterator iterPic = rcListPic.begin();
-    while ( iterPic != rcListPic.end())
-    {
-      rpcPic = *(iterPic++);
-      if (rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC() + (isCompositeRefEnable ? 2 : 1))
+    // When a picture is a leading picture, it shall precede, in decoding order,
+    // all trailing pictures that are associated with the same IRAP picture.
+    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL ||
+        nalUnitType == NAL_UNIT_CODED_SLICE_RADL )
       {
-        pLocalRPS->setDeltaPOC(k, 1);
-        pLocalRPS->setUsed(k, true);
-        nrOfPositivePictures++;
-        k ++;
-        useNewRPS = true;
+        if(pcSlice->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC())
+        {
+          // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB
+          // rpcPic would violate the constraint if it was a trailing picture
+          CHECK( pcPic->poc > this->getAssociatedIRAPPOC(), "Invalid POC");
+        }
       }
-    }
-  }
-  if (isCompositeRefEnable && isEncodeLtRef)
-  {
-    useNewRPS = true;
-    nrOfNegativePictures = 0;
-    nrOfPositivePictures = 0;
-    for (i = 0; i<pReferencePictureSet->getNumberOfPictures(); i++)
-    {
-      j = 0;
-      k = 0;
 
-      // loop through all pictures in the reference picture buffer
-      PicList::iterator iterPic = rcListPic.begin();
-      while (iterPic != rcListPic.end())
+    // Any RASL picture associated with a CRA or BLA picture shall precede any
+    // RADL picture associated with the CRA or BLA picture in output order
+    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
+    {
+      if ((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA) &&
+          this->getAssociatedIRAPPOC() == pcSlice->getAssociatedIRAPPOC())
       {
-        j++;
-        rpcPic = *(iterPic++);
-
-        if (rpcPic->getPOC() == this->getPOC() + 1 + pReferencePictureSet->getDeltaPOC(i) && rpcPic->referenced)
+        if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL)
         {
-          // This picture exists as a reference picture
-          // and should be added to the explicit Reference Picture Set
-          pLocalRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i) + 1);
-          pLocalRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
-          if (bEfficientFieldIRAPEnabled)
-          {
-            pLocalRPS->setUsed(k, pLocalRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) + 1 < pocRandomAccess));
-          }
-
-          if (pLocalRPS->getDeltaPOC(k) < 0)
-          {
-            nrOfNegativePictures++;
-          }
-          else
-          {
-            if (bEfficientFieldIRAPEnabled && rpcPic->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC() + 2)
-            {
-              irapIsInRPS = true;
-            }
-            nrOfPositivePictures++;
-          }
-          k++;
+          CHECK( pcPic->poc <= this->getPOC(), "Invalid POC");
         }
       }
     }
-  }
-  pLocalRPS->setNumberOfNegativePictures(nrOfNegativePictures);
-  pLocalRPS->setNumberOfPositivePictures(nrOfPositivePictures);
-  pLocalRPS->setNumberOfPictures(nrOfNegativePictures+nrOfPositivePictures);
-  // This is a simplistic inter rps example. A smarter encoder will look for a better reference RPS to do the
-  // inter RPS prediction with.  Here we just use the reference used by pReferencePictureSet.
-  // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled.
-  if (!pReferencePictureSet->getInterRPSPrediction() || useNewRPS )
-  {
-    pLocalRPS->setInterRPSPrediction(false);
-    pLocalRPS->setNumRefIdc(0);
-  }
-  else
-  {
-    int rIdx =  this->getRPSidx() - pReferencePictureSet->getDeltaRIdxMinus1() - 1;
-    int deltaRPS = pReferencePictureSet->getDeltaRPS();
-    const ReferencePictureSet* pcRefRPS = this->getSPS()->getRPSList()->getReferencePictureSet(rIdx);
-    int iRefPics = pcRefRPS->getNumberOfPictures();
-    int iNewIdc=0;
-    for(i=0; i<= iRefPics; i++)
+
+    // Any RASL picture associated with a CRA picture shall follow, in output
+    // order, any IRAP picture that precedes the CRA picture in decoding order.
+    if (nalUnitType == NAL_UNIT_CODED_SLICE_RASL)
     {
-      int deltaPOC = ((i != iRefPics)? pcRefRPS->getDeltaPOC(i) : 0);  // check if the reference abs POC is >= 0
-      int iRefIdc = 0;
-      for (j=0; j < pLocalRPS->getNumberOfPictures(); j++) // loop through the  pictures in the new RPS
+      if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)
       {
-        if ( (deltaPOC + deltaRPS) == pLocalRPS->getDeltaPOC(j))
+        if(pcSlice->getPOC() < this->getAssociatedIRAPPOC() &&
+          (
+            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP   ||
+            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
+            pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))
         {
-          if (pLocalRPS->getUsed(j))
-          {
-            iRefIdc = 1;
-          }
-          else
-          {
-            iRefIdc = 2;
-          }
+          CHECK(this->getPOC() <= pcSlice->getPOC(), "Invalid POC");
         }
       }
-      pLocalRPS->setRefIdc(i, iRefIdc);
-      iNewIdc++;
     }
-    pLocalRPS->setInterRPSPrediction(true);
-    pLocalRPS->setNumRefIdc(iNewIdc);
-    pLocalRPS->setDeltaRPS(deltaRPS);
-    pLocalRPS->setDeltaRIdxMinus1(pReferencePictureSet->getDeltaRIdxMinus1() + this->getSPS()->getRPSList()->getNumberOfReferencePictureSets() - this->getRPSidx());
   }
-
-  this->setRPS(pLocalRPS);
-  this->setRPSidx(-1);
 }
-#endif
 
-#if JVET_M0128
+
+
+
 //Function for applying picture marking based on the Reference Picture List
 void Slice::applyReferencePictureListBasedMarking(PicList& rcListPic, const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1) const
 {
@@ -2076,7 +1206,6 @@ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, c
   this->setRPL1idx(-1);
   this->setRPL1(pLocalRPL1);
 }
-#endif
 
 //! get AC and DC values for weighted pred
 void  Slice::getWpAcDcParam(const WPACDCParam *&wp) const
@@ -2181,11 +1310,7 @@ unsigned Slice::getMinPictureDistance() const
     {
       for (int refIdx = 0; refIdx < getNumRefIdx(REF_PIC_LIST_1); refIdx++)
       {
-#if JVET_M0128          //[HD] Please check if this is correct. Seems like a software bug to me.
         minPicDist = std::min(minPicDist, std::abs(currPOC - getRefPic(REF_PIC_LIST_1, refIdx)->getPOC()));
-#else
-        minPicDist = std::min( minPicDist, std::abs(currPOC - getRefPic(REF_PIC_LIST_0, refIdx)->getPOC()));
-#endif
       }
     }
   }
@@ -2219,7 +1344,7 @@ VPS::VPS()
 VPS::~VPS()
 {
 }
-#elif JVET_N0278_HLS
+#else
 // ------------------------------------------------------------------------------------------------
 // Video parameter set (VPS)
 // ------------------------------------------------------------------------------------------------
@@ -2261,60 +1386,10 @@ SPSRExt::SPSRExt()
 
 SPS::SPS()
 : m_SPSId                     (  0)
-#if JVET_N0349_DPS
 , m_decodingParameterSetId    (  0 )
-#endif
-#if !JVET_M0101_HLS
-, m_bIntraOnlyConstraintFlag  (false)
-, m_maxBitDepthConstraintIdc  (  0)
-, m_maxChromaFormatConstraintIdc(CHROMA_420)
-, m_bFrameConstraintFlag      (false)
-, m_bNoQtbttDualTreeIntraConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
-, m_noPartitionConstraintsOverrideConstraintFlag(false)
-#endif
-, m_bNoSaoConstraintFlag      (false)
-, m_bNoAlfConstraintFlag      (false)
-, m_bNoPcmConstraintFlag      (false)
-, m_bNoRefWraparoundConstraintFlag(false)
-, m_bNoTemporalMvpConstraintFlag(false)
-, m_bNoSbtmvpConstraintFlag   (false)
-, m_bNoAmvrConstraintFlag     (false)
-, m_bNoBdofConstraintFlag     (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
-, m_noDmvrConstraintFlag      (false)
-#endif
-, m_bNoCclmConstraintFlag     (false)
-, m_bNoMtsConstraintFlag      (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
-, m_noSbtConstraintFlag       (false)
-#endif
-, m_bNoAffineMotionConstraintFlag(false)
-, m_bNoGbiConstraintFlag      (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
-, m_noIbcConstraintFlag       (false)
-#endif
-, m_bNoMhIntraConstraintFlag  (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
-, m_noFPelMmvdConstraintFlag  (false)
-#endif
-, m_bNoTriangleConstraintFlag (false)
-, m_bNoLadfConstraintFlag     (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
-, m_noTransformSkipConstraintFlag(false)
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-, m_bNoCurrPicRefConstraintFlag(false)
-#endif
-, m_bNoQpDeltaConstraintFlag  (false)
-, m_bNoDepQuantConstraintFlag (false)
-, m_bNoSignDataHidingConstraintFlag(false)
-#endif
 , m_affineAmvrEnabledFlag     ( false )
 , m_DMVR                      ( false )
-#if JVET_N0127_MMVD_SPS_FLAG
 , m_MMVD                      ( false )
-#endif
 , m_SBT                       ( false )
 , m_MaxSbtSize                ( 32 )
 #if INCLUDE_ISP_CFG_FLAG
@@ -2338,13 +1413,11 @@ SPS::SPS()
 , m_uiMaxCUWidth              ( 32)
 , m_uiMaxCUHeight             ( 32)
 , m_uiMaxCodingDepth          (  3)
-#if JVET_M0128
 , m_numRPL0                   ( 0 )
 , m_numRPL1                   ( 0 )
 , m_rpl1CopyFromRpl0Flag      ( false )
 , m_rpl1IdxPresentFlag        ( false )
 , m_allRplEntriesHasSameSignFlag ( true )
-#endif
 , m_bLongTermRefsPresent      (false)
 // Tool list
 , m_pcmEnabledFlag            (false)
@@ -2361,12 +1434,7 @@ SPS::SPS()
 #endif
 , m_saoEnabledFlag            (false)
 , m_bTemporalIdNestingFlag    (false)
-#if HEVC_USE_SCALING_LISTS
 , m_scalingListEnabledFlag    (false)
-#endif
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-, m_useStrongIntraSmoothing   (false)
-#endif
 , m_vuiParametersPresentFlag  (false)
 , m_vuiParameters             ()
 , m_wrapAroundEnabledFlag     (false)
@@ -2378,9 +1446,7 @@ SPS::SPS()
 , m_cclmCollocatedChromaFlag  ( false )
 , m_IntraMTS                  ( false )
 , m_InterMTS                  ( false )
-#if JVET_N0193_LFNST
 , m_LFNST                     ( false )
-#endif
 , m_Affine                    ( false )
 , m_AffineType                ( false )
 , m_MHIntra                   ( false )
@@ -2391,9 +1457,7 @@ SPS::SPS()
 , m_LadfQpOffset              { 0 }
 , m_LadfIntervalLowerBound    { 0 }
 #endif
-#if JVET_N0217_MATRIX_INTRAPRED
 , m_MIP                       ( false )
-#endif
 {
   for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
   {
@@ -2415,12 +1479,8 @@ SPS::SPS()
 
 SPS::~SPS()
 {
-#if !JVET_M0128
-  m_RPSList.destroy();
-#endif
 }
 
-#if JVET_M0128
 void  SPS::createRPLList0(int numRPL)
 {
   m_RPLList0.destroy();
@@ -2436,13 +1496,6 @@ void  SPS::createRPLList1(int numRPL)
 
   m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false;
 }
-#else
-void  SPS::createRPSList( int numRPS )
-{
-  m_RPSList.destroy();
-  m_RPSList.create(numRPS);
-}
-#endif
 
 
 const int SPS::m_winUnitX[]={1,2,2,1};
@@ -2474,25 +1527,17 @@ PPS::PPS()
 , m_cuQpDeltaSubdiv                  (0)
 , m_chromaCbQpOffset                 (0)
 , m_chromaCrQpOffset                 (0)
-#if JVET_N0054_JOINT_CHROMA
 , m_chromaCbCrQpOffset               (0)
-#endif
 , m_numRefIdxL0DefaultActive         (1)
 , m_numRefIdxL1DefaultActive         (1)
-#if JVET_M0128
 , m_rpl1IdxPresentFlag               (false)
-#endif
 , m_TransquantBypassEnabledFlag      (false)
 , m_useTransformSkip                 (false)
-#if !JVET_N0857_TILES_BRICKS
-, m_tilesEnabledFlag                 (false)
-#endif
 , m_entropyCodingSyncEnabledFlag     (false)
 , m_loopFilterAcrossBricksEnabledFlag (true)
 , m_uniformTileSpacingFlag           (false)
 , m_numTileColumnsMinus1             (0)
 , m_numTileRowsMinus1                (0)
-#if JVET_N0857_TILES_BRICKS
 , m_singleTileInPicFlag              (true)
 , m_tileColsWidthMinus1              (0)
 , m_tileRowsHeightMinus1             (0)
@@ -2500,30 +1545,23 @@ PPS::PPS()
 , m_singleBrickPerSliceFlag          (true)
 , m_rectSliceFlag                    (true)
 , m_numSlicesInPicMinus1             (0)
-#if JVET_N0857_RECT_SLICES
 , m_numTilesInPic                    (1)
 , m_numBricksInPic                   (1)
-#endif
 , m_signalledSliceIdFlag             (false)
 ,m_signalledSliceIdLengthMinus1      (0)
-#endif
 , m_cabacInitPresentFlag             (false)
 , m_sliceHeaderExtensionPresentFlag  (false)
 , m_loopFilterAcrossSlicesEnabledFlag(false)
 , m_listsModificationPresentFlag     (0)
 , m_numExtraSliceHeaderBits          (0)
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 , m_loopFilterAcrossVirtualBoundariesDisabledFlag(false)
 , m_numVerVirtualBoundaries          (0)
 , m_numHorVirtualBoundaries          (0)
-#endif
 , m_ppsRangeExtension                ()
 , pcv                                (NULL)
 {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   ::memset(m_virtualBoundariesPosX, 0, sizeof(m_virtualBoundariesPosX));
   ::memset(m_virtualBoundariesPosY, 0, sizeof(m_virtualBoundariesPosY));
-#endif
 }
 
 PPS::~PPS()
@@ -2540,166 +1578,7 @@ APS::~APS()
 {
 }
 
-#if !JVET_M0128
-ReferencePictureSet::ReferencePictureSet()
-: m_numberOfPictures (0)
-, m_numberOfNegativePictures (0)
-, m_numberOfPositivePictures (0)
-, m_numberOfLongtermPictures (0)
-, m_interRPSPrediction (0)
-, m_deltaRIdxMinus1 (0)
-, m_deltaRPS (0)
-, m_numRefIdc (0)
-{
-  ::memset( m_deltaPOC, 0, sizeof(m_deltaPOC) );
-  ::memset( m_POC, 0, sizeof(m_POC) );
-  ::memset( m_used, 0, sizeof(m_used) );
-  ::memset( m_refIdc, 0, sizeof(m_refIdc) );
-  ::memset( m_bCheckLTMSB, 0, sizeof(m_bCheckLTMSB) );
-  ::memset( m_pocLSBLT, 0, sizeof(m_pocLSBLT) );
-  ::memset( m_deltaPOCMSBCycleLT, 0, sizeof(m_deltaPOCMSBCycleLT) );
-  ::memset( m_deltaPocMSBPresentFlag, 0, sizeof(m_deltaPocMSBPresentFlag) );
-}
-
-ReferencePictureSet::~ReferencePictureSet()
-{
-}
-
-void ReferencePictureSet::setUsed(int bufferNum, bool used)
-{
-  m_used[bufferNum] = used;
-}
-
-void ReferencePictureSet::setDeltaPOC(int bufferNum, int deltaPOC)
-{
-  m_deltaPOC[bufferNum] = deltaPOC;
-}
-
-void ReferencePictureSet::setNumberOfPictures(int numberOfPictures)
-{
-  m_numberOfPictures = numberOfPictures;
-}
-
-int ReferencePictureSet::getUsed(int bufferNum) const
-{
-  return m_used[bufferNum];
-}
-
-int ReferencePictureSet::getDeltaPOC(int bufferNum) const
-{
-  return m_deltaPOC[bufferNum];
-}
-
-int ReferencePictureSet::getNumberOfPictures() const
-{
-  return m_numberOfPictures;
-}
-
-int ReferencePictureSet::getPOC(int bufferNum) const
-{
-  return m_POC[bufferNum];
-}
-
-void ReferencePictureSet::setPOC(int bufferNum, int POC)
-{
-  m_POC[bufferNum] = POC;
-}
-
-bool ReferencePictureSet::getCheckLTMSBPresent(int bufferNum) const
-{
-  return m_bCheckLTMSB[bufferNum];
-}
-
-void ReferencePictureSet::setCheckLTMSBPresent(int bufferNum, bool b)
-{
-  m_bCheckLTMSB[bufferNum] = b;
-}
-
-//! set the reference idc value at uiBufferNum entry to the value of iRefIdc
-void ReferencePictureSet::setRefIdc(int bufferNum, int refIdc)
-{
-  m_refIdc[bufferNum] = refIdc;
-}
-
-//! get the reference idc value at uiBufferNum
-int  ReferencePictureSet::getRefIdc(int bufferNum) const
-{
-  return m_refIdc[bufferNum];
-}
-
-/** Sorts the deltaPOC and Used by current values in the RPS based on the deltaPOC values.
- *  deltaPOC values are sorted with -ve values before the +ve values.  -ve values are in decreasing order.
- *  +ve values are in increasing order.
- * \returns void
- */
-void ReferencePictureSet::sortDeltaPOC()
-{
-  // sort in increasing order (smallest first)
-  for(int j=1; j < getNumberOfPictures(); j++)
-  {
-    int deltaPOC = getDeltaPOC(j);
-    bool used = getUsed(j);
-    for (int k=j-1; k >= 0; k--)
-    {
-      int temp = getDeltaPOC(k);
-      if (deltaPOC < temp)
-      {
-        setDeltaPOC(k+1, temp);
-        setUsed(k+1, getUsed(k));
-        setDeltaPOC(k, deltaPOC);
-        setUsed(k, used);
-      }
-    }
-  }
-  // flip the negative values to largest first
-  int numNegPics = getNumberOfNegativePictures();
-  for(int j=0, k=numNegPics-1; j < numNegPics>>1; j++, k--)
-  {
-    int deltaPOC = getDeltaPOC(j);
-    bool used = getUsed(j);
-    setDeltaPOC(j, getDeltaPOC(k));
-    setUsed(j, getUsed(k));
-    setDeltaPOC(k, deltaPOC);
-    setUsed(k, used);
-  }
-}
-
-/** Prints the deltaPOC and RefIdc (if available) values in the RPS.
- *  A "*" is added to the deltaPOC value if it is Used bu current.
- * \returns void
- */
-void ReferencePictureSet::printDeltaPOC() const
-{
-  DTRACE( g_trace_ctx, D_RPSINFO, "DeltaPOC = { " );
-  for(int j=0; j < getNumberOfPictures(); j++)
-  {
-    DTRACE( g_trace_ctx, D_RPSINFO, "%d%s ", getDeltaPOC( j ), ( getUsed( j ) == 1 ) ? "*" : "" );
-  }
-  if (getInterRPSPrediction())
-  {
-    DTRACE( g_trace_ctx, D_RPSINFO, "}, RefIdc = { " );
-    for(int j=0; j < getNumRefIdc(); j++)
-    {
-      DTRACE( g_trace_ctx, D_RPSINFO, "%d ", getRefIdc( j ) );
-    }
-  }
-  DTRACE( g_trace_ctx, D_RPSINFO, "}\n" );
-}
-
-RefPicListModification::RefPicListModification()
-: m_refPicListModificationFlagL0 (false)
-, m_refPicListModificationFlagL1 (false)
-{
-  ::memset( m_RefPicSetIdxL0, 0, sizeof(m_RefPicSetIdxL0) );
-  ::memset( m_RefPicSetIdxL1, 0, sizeof(m_RefPicSetIdxL1) );
-}
-
-RefPicListModification::~RefPicListModification()
-{
-}
-#endif
 
-#if JVET_M0128
 ReferencePictureList::ReferencePictureList()
   : m_numberOfShorttermPictures(0)
   , m_numberOfLongtermPictures(0)
@@ -2787,9 +1666,7 @@ void ReferencePictureList::printRefPicInfo() const
   //DTRACE(g_trace_ctx, D_RPSINFO, "}\n");
   printf("}\n");
 }
-#endif
 
-#if HEVC_USE_SCALING_LISTS
 ScalingList::ScalingList()
 {
   for(uint32_t sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
@@ -2818,42 +1695,26 @@ void ScalingList::setDefaultScalingList()
 */
 bool ScalingList::checkDefaultScalingList()
 {
-#if JVET_N0847_SCALING_LISTS
   bool isAllDefault = true;
   for ( uint32_t sizeId = SCALING_LIST_2x2; sizeId <= SCALING_LIST_64x64; sizeId++)
-#else
-  uint32_t defaultCounter=0;
-
-  for( uint32_t sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++ )
-#endif
   {
     for(uint32_t listId=0;listId<SCALING_LIST_NUM;listId++)
     {
-#if JVET_N0847_SCALING_LISTS
       if (((sizeId == SCALING_LIST_64x64) && (listId % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) != 0))
        || ((sizeId == SCALING_LIST_2x2) && (listId % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0)))
       {
         continue;
       }
-#endif
       if( !::memcmp(getScalingListAddress(sizeId,listId), getScalingListDefaultAddress(sizeId, listId),sizeof(int)*std::min(MAX_MATRIX_COEF_NUM,(int)g_scalingListSize[sizeId])) // check value of matrix
          && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == 16))) // check DC value
       {
-#if JVET_N0847_SCALING_LISTS
         isAllDefault = false;
         break;
-#else
-        defaultCounter++;
-#endif
       }
     }
   }
 
-#if JVET_N0847_SCALING_LISTS
   return !isAllDefault;
-#else
-  return (defaultCounter == (SCALING_LIST_NUM * SCALING_LIST_SIZE_NUM )) ? false : true;
-#endif
 }
 
 /** get scaling matrix from RefMatrixID
@@ -2868,18 +1729,10 @@ void ScalingList::processRefMatrix( uint32_t sizeId, uint32_t listId , uint32_t
 
 void ScalingList::checkPredMode(uint32_t sizeId, uint32_t listId)
 {
-#if JVET_N0847_SCALING_LISTS
   for (int predListIdx = (int)listId; predListIdx >= 0; predListIdx--)
-#else
-  int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
-
-  for(int predListIdx = (int)listId ; predListIdx >= 0; predListIdx-=predListStep)
-#endif
   {
-#if JVET_N0847_SCALING_LISTS
     if ((sizeId == SCALING_LIST_64x64 && (listId % 3) != 0) || (sizeId == SCALING_LIST_2x2 && (listId % 3) == 0))
       continue;
-#endif
     if( !::memcmp(getScalingListAddress(sizeId,listId),((listId == predListIdx) ?
       getScalingListDefaultAddress(sizeId, predListIdx): getScalingListAddress(sizeId, predListIdx)),sizeof(int)*std::min(MAX_MATRIX_COEF_NUM,(int)g_scalingListSize[sizeId])) // check value of matrix
       && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value
@@ -2910,21 +1763,11 @@ static void outputScalingListHelp(std::ostream &os)
          "  <value>\n";
 
   os << "The permitted matrix names are:\n";
-#if JVET_N0847_SCALING_LISTS
   for (uint32_t sizeIdc = SCALING_LIST_2x2; sizeIdc <= SCALING_LIST_64x64; sizeIdc++)
   {
     for (uint32_t listIdc = 0; listIdc < SCALING_LIST_NUM; listIdc++)
-#else
-  for(uint32_t sizeIdc = 0; sizeIdc < SCALING_LIST_SIZE_NUM; sizeIdc++)
-  {
-    for(uint32_t listIdc = 0; listIdc < SCALING_LIST_NUM; listIdc++)
-#endif
     {
-#if JVET_N0847_SCALING_LISTS 
       if (!(((sizeIdc == SCALING_LIST_64x64) && (listIdc % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) != 0)) || ((sizeIdc == SCALING_LIST_2x2) && (listIdc % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0))))
-#else
-      if ((sizeIdc!=SCALING_LIST_32x32) || (listIdc%(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) == 0))
-#endif
       {
         os << "  " << MatrixType[sizeIdc][listIdc] << '\n';
       }
@@ -2934,24 +1777,12 @@ static void outputScalingListHelp(std::ostream &os)
 
 void ScalingList::outputScalingLists(std::ostream &os) const
 {
-#if JVET_N0847_SCALING_LISTS
   for (uint32_t sizeIdc = SCALING_LIST_2x2; sizeIdc <= SCALING_LIST_64x64; sizeIdc++)
-#else
-  for(uint32_t sizeIdc = 0; sizeIdc < SCALING_LIST_SIZE_NUM; sizeIdc++)
-#endif
   {
-#if JVET_N0847_SCALING_LISTS
     const uint32_t size = (sizeIdc == 1) ? 2 : ((sizeIdc == 2) ? 4 : 8);
-#else
-    const uint32_t size = std::min(8,4<<(sizeIdc));
-#endif
     for(uint32_t listIdc = 0; listIdc < SCALING_LIST_NUM; listIdc++)
     {
-#if JVET_N0847_SCALING_LISTS
       if (!(((sizeIdc == SCALING_LIST_64x64) && (listIdc % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) != 0)) || ((sizeIdc == SCALING_LIST_2x2) && (listIdc % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0))))
-#else
-      if ((sizeIdc!=SCALING_LIST_32x32) || (listIdc%(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) == 0))
-#endif
       {
         const int *src = getScalingListAddress(sizeIdc, listIdc);
         os << (MatrixType[sizeIdc][listIdc]) << " =\n  ";
@@ -2993,11 +1824,7 @@ bool ScalingList::xParseScalingList(const std::string &fileName)
     return true;
   }
 
-#if JVET_N0847_SCALING_LISTS
   for (uint32_t sizeIdc = SCALING_LIST_2x2; sizeIdc <= SCALING_LIST_64x64; sizeIdc++)//2x2-128x128
-#else
-  for(uint32_t sizeIdc = SCALING_LIST_FIRST_CODED; sizeIdc < SCALING_LIST_SIZE_NUM; sizeIdc++)
-#endif
   {
     const uint32_t size = std::min(MAX_MATRIX_COEF_NUM,(int)g_scalingListSize[sizeIdc]);
 
@@ -3005,22 +1832,10 @@ bool ScalingList::xParseScalingList(const std::string &fileName)
     {
       int * const src = getScalingListAddress(sizeIdc, listIdc);
 
-#if JVET_N0847_SCALING_LISTS
       if (((sizeIdc == SCALING_LIST_64x64) && (listIdc % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) != 0)) || ((sizeIdc == SCALING_LIST_2x2) && (listIdc % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0)))
       {
         continue;
       }
-#else
-      if ((sizeIdc==SCALING_LIST_32x32) && (listIdc%(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) != 0)) // derive chroma32x32 from chroma16x16
-      {
-        const int *srcNextSmallerSize = getScalingListAddress(sizeIdc-1, listIdc);
-        for(uint32_t i=0; i<size; i++)
-        {
-          src[i] = srcNextSmallerSize[i];
-        }
-        setScalingListDC(sizeIdc,listIdc,(sizeIdc > SCALING_LIST_8x8) ? getScalingListDC(sizeIdc-1, listIdc) : src[0]);
-      }
-#endif
       else
       {
         {
@@ -3117,9 +1932,7 @@ const int* ScalingList::getScalingListDefaultAddress(uint32_t sizeId, uint32_t l
   const int *src = 0;
   switch(sizeId)
   {
-#if JVET_N0847_SCALING_LISTS
     case SCALING_LIST_1x1:
-#endif
     case SCALING_LIST_2x2:
     case SCALING_LIST_4x4:
       src = g_quantTSDefault4x4;
@@ -3129,11 +1942,7 @@ const int* ScalingList::getScalingListDefaultAddress(uint32_t sizeId, uint32_t l
     case SCALING_LIST_32x32:
     case SCALING_LIST_64x64:
     case SCALING_LIST_128x128:
-#if JVET_N0847_SCALING_LISTS
       src = (listId < (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1))) ? g_quantIntraDefault8x8 : g_quantInterDefault8x8;
-#else
-      src = (listId < (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) ) ? g_quantIntraDefault8x8 : g_quantInterDefault8x8;
-#endif
       break;
     default:
       THROW( "Invalid scaling list" );
@@ -3169,7 +1978,6 @@ void ScalingList::checkDcOfMatrix()
     }
   }
 }
-#endif
 
 ParameterSetManager::ParameterSetManager()
 #if HEVC_VPS
@@ -3179,20 +1987,12 @@ ParameterSetManager::ParameterSetManager()
 : m_spsMap(MAX_NUM_SPS)
 #endif
 , m_ppsMap(MAX_NUM_PPS)
-#if JVET_N0805_APS_LMCS
 , m_apsMap(MAX_NUM_APS * MAX_NUM_APS_TYPE)
-#else
-, m_apsMap(MAX_NUM_APS)
-#endif
-#if JVET_N0349_DPS
 , m_dpsMap(MAX_NUM_DPS)
-#endif
 #if HEVC_VPS
 , m_activeVPSId(-1)
 #endif
-#if JVET_N0349_DPS
 , m_activeDPSId(-1)
-#endif
 , m_activeSPSId(-1)
 {
 }
@@ -3250,7 +2050,6 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
       SPS *sps = m_spsMap.getPS(spsId);
       if (sps)
       {
-#if JVET_N0349_DPS
         int dpsId = sps->getDecodingParameterSetId();
         if ((m_activeDPSId!=-1) && (dpsId != m_activeDPSId ))
         {
@@ -3278,7 +2077,6 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
             m_dpsMap.setActive(dpsId);
           }
         }
-#endif
 
 #if HEVC_VPS
         int vpsId = sps->getVPSId();
@@ -3289,9 +2087,7 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
         else
         {
 #endif
-#if JVET_N0415_CTB_ALF
           m_spsMap.clear();
-#endif
           m_spsMap.setActive(spsId);
 #if HEVC_VPS
           VPS *vps =m_vpsMap.getPS(vpsId);
@@ -3309,9 +2105,7 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
         }
 #else
         m_activeSPSId = spsId;
-#if JVET_N0415_CTB_ALF
         m_ppsMap.clear();
-#endif
         m_ppsMap.setActive(ppsId);
         return true;
 #endif
@@ -3332,13 +2126,10 @@ bool ParameterSetManager::activatePPS(int ppsId, bool isIRAP)
 #if HEVC_VPS
   m_activeVPSId=-1;
 #endif
-#if JVET_N0349_DPS
   m_activeDPSId=-1;
-#endif
   return false;
 }
 
-#if JVET_N0805_APS_LMCS
 bool ParameterSetManager::activateAPS(int apsId, int apsType)
 {
   APS *aps = m_apsMap.getPS((apsId << NUM_APS_TYPE_LEN) + apsType);
@@ -3353,22 +2144,6 @@ bool ParameterSetManager::activateAPS(int apsId, int apsType)
   }
   return false;
 }
-#else
-bool ParameterSetManager::activateAPS(int apsId)
-{
-  APS *aps = m_apsMap.getPS(apsId);
-  if (aps)
-  {
-    m_apsMap.setActive(apsId);
-    return true;
-  }
-  else
-  {
-    msg(WARNING, "Warning: tried to activate non-existing APS.");
-  }
-  return false;
-}
-#endif
 
 template <>
 void ParameterSetMap<APS>::setID(APS* parameterSet, const int psId)
@@ -3387,41 +2162,15 @@ void ParameterSetMap<SPS>::setID(SPS* parameterSet, const int psId)
   parameterSet->setSPSId(psId);
 }
 
-#if !JVET_M0101_HLS
-ProfileTierLevel::ProfileTierLevel()
-  : m_profileSpace    (0)
-  , m_tierFlag        (Level::MAIN)
-  , m_profileIdc      (Profile::NONE)
-#if JVET_N0276_CONSTRAINT_FLAGS
-  , m_subProfileIdc   (0)
-#endif
-  , m_levelIdc        (Level::NONE)
-  , m_progressiveSourceFlag  (false)
-  , m_interlacedSourceFlag   (false)
-  , m_nonPackedConstraintFlag(false)
-  , m_frameOnlyConstraintFlag(false)
-{
-  ::memset(m_profileCompatibilityFlag, 0, sizeof(m_profileCompatibilityFlag));
-}
-
-PTL::PTL()
-{
-  ::memset(m_subLayerProfilePresentFlag, 0, sizeof(m_subLayerProfilePresentFlag));
-  ::memset(m_subLayerLevelPresentFlag,   0, sizeof(m_subLayerLevelPresentFlag  ));
-}
-#else
 ProfileTierLevel::ProfileTierLevel()
   : m_tierFlag        (Level::MAIN)
   , m_profileIdc      (Profile::NONE)
-#if JVET_N0276_CONSTRAINT_FLAGS
   , m_subProfileIdc   (0)
-#endif
   , m_levelIdc        (Level::NONE)
 {
   ::memset(m_subLayerLevelPresentFlag,   0, sizeof(m_subLayerLevelPresentFlag  ));
   ::memset(m_subLayerLevelIdc, Level::NONE, sizeof(m_subLayerLevelIdc          ));
 }
-#endif
 
 void calculateParameterSetChangedFlag(bool &bChanged, const std::vector<uint8_t> *pOldData, const std::vector<uint8_t> *pNewData)
 {
@@ -3500,19 +2249,15 @@ uint32_t PreCalcValues::getMinQtSize( const Slice &slice, const ChannelType chTy
 }
 
 #if ENABLE_TRACING
-#if HEVC_VPS || JVET_N0278_HLS
 void xTraceVPSHeader()
 {
   DTRACE( g_trace_ctx, D_HEADER, "=========== Video Parameter Set     ===========\n" );
 }
-#endif
 
-#if JVET_N0349_DPS
 void xTraceDPSHeader()
 {
   DTRACE( g_trace_ctx, D_HEADER, "=========== Decoding Parameter Set     ===========\n" );
 }
-#endif
 
 void xTraceSPSHeader()
 {
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 1bad46234..542ef3ed9 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -69,94 +69,7 @@ typedef std::list<Picture*> PicList;
 // Class definition
 // ====================================================================================================================
 
-#if !JVET_M0128
-/// Reference Picture Set class
-class ReferencePictureSet
-{
-private:
-  int  m_numberOfPictures;
-  int  m_numberOfNegativePictures;
-  int  m_numberOfPositivePictures;
-  int  m_numberOfLongtermPictures;
-  int  m_deltaPOC[MAX_NUM_REF_PICS];
-  int  m_POC[MAX_NUM_REF_PICS];
-  bool m_used[MAX_NUM_REF_PICS];
-  bool m_interRPSPrediction;
-  int  m_deltaRIdxMinus1;
-  int  m_deltaRPS;
-  int  m_numRefIdc;
-  int  m_refIdc[MAX_NUM_REF_PICS+1];
-  bool m_bCheckLTMSB[MAX_NUM_REF_PICS];
-  int  m_pocLSBLT[MAX_NUM_REF_PICS];
-  int  m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS];
-  bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS];
-
-public:
-          ReferencePictureSet();
-  virtual ~ReferencePictureSet();
-  int     getPocLSBLT(int i) const                     { return m_pocLSBLT[i];               }
-  void    setPocLSBLT(int i, int x)                    { m_pocLSBLT[i] = x;                  }
-  int     getDeltaPocMSBCycleLT(int i) const           { return m_deltaPOCMSBCycleLT[i];     }
-  void    setDeltaPocMSBCycleLT(int i, int x)          { m_deltaPOCMSBCycleLT[i] = x;        }
-  bool    getDeltaPocMSBPresentFlag(int i) const       { return m_deltaPocMSBPresentFlag[i]; }
-  void    setDeltaPocMSBPresentFlag(int i, bool x)     { m_deltaPocMSBPresentFlag[i] = x;    }
-  void    setUsed(int bufferNum, bool used);
-  void    setDeltaPOC(int bufferNum, int deltaPOC);
-  void    setPOC(int bufferNum, int deltaPOC);
-  void    setNumberOfPictures(int numberOfPictures);
-  void    setCheckLTMSBPresent(int bufferNum, bool b );
-  bool    getCheckLTMSBPresent(int bufferNum) const;
-
-  int     getUsed(int bufferNum) const;
-  int     getDeltaPOC(int bufferNum) const;
-  int     getPOC(int bufferNum) const;
-  int     getNumberOfPictures() const;
-
-  void    setNumberOfNegativePictures(int number)      { m_numberOfNegativePictures = number; }
-  int     getNumberOfNegativePictures() const          { return m_numberOfNegativePictures;   }
-  void    setNumberOfPositivePictures(int number)      { m_numberOfPositivePictures = number; }
-  int     getNumberOfPositivePictures() const          { return m_numberOfPositivePictures;   }
-  void    setNumberOfLongtermPictures(int number)      { m_numberOfLongtermPictures = number; }
-  int     getNumberOfLongtermPictures() const          { return m_numberOfLongtermPictures;   }
-
-  void    setInterRPSPrediction(bool flag)             { m_interRPSPrediction = flag;         }
-  bool    getInterRPSPrediction() const                { return m_interRPSPrediction;         }
-  void    setDeltaRIdxMinus1(int x)                    { m_deltaRIdxMinus1 = x;               }
-  int     getDeltaRIdxMinus1() const                   { return m_deltaRIdxMinus1;            }
-  void    setDeltaRPS(int x)                           { m_deltaRPS = x;                      }
-  int     getDeltaRPS() const                          { return m_deltaRPS;                   }
-  void    setNumRefIdc(int x)                          { m_numRefIdc = x;                     }
-  int     getNumRefIdc() const                         { return m_numRefIdc;                  }
-
-  void    setRefIdc(int bufferNum, int refIdc);
-  int     getRefIdc(int bufferNum) const ;
-
-  void    sortDeltaPOC();
-  void    printDeltaPOC() const;
-};
-
-/// Reference Picture Set set class
-class RPSList
-{
-private:
-  std::vector<ReferencePictureSet> m_referencePictureSets;
-
-public:
-                                 RPSList()                                            { }
-  virtual                        ~RPSList()                                           { }
-
-  void                           create  (int numberOfEntries)                            { m_referencePictureSets.resize(numberOfEntries);         }
-  void                           destroy ()                                               { }
 
-
-  ReferencePictureSet*       getReferencePictureSet(int referencePictureSetNum)       { return &m_referencePictureSets[referencePictureSetNum]; }
-  const ReferencePictureSet* getReferencePictureSet(int referencePictureSetNum) const { return &m_referencePictureSets[referencePictureSetNum]; }
-
-  int                            getNumberOfReferencePictureSets() const                  { return int(m_referencePictureSets.size());              }
-};
-#endif
-
-#if JVET_M0128
 class ReferencePictureList
 {
 private:
@@ -216,9 +129,7 @@ public:
 
   int                            getNumberOfReferencePictureLists() const { return int(m_referencePictureLists.size()); }
 };
-#endif
 
-#if HEVC_USE_SCALING_LISTS
 /// SCALING_LIST class
 class ScalingList
 {
@@ -254,9 +165,7 @@ private:
   uint32_t             m_refMatrixId                   [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID
   std::vector<int> m_scalingListCoef               [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
 };
-#endif
 
-#if JVET_M0101_HLS
 class ConstraintInfo
 {
   bool              m_progressiveSourceFlag;
@@ -270,9 +179,7 @@ class ConstraintInfo
   bool              m_lowerBitRateConstraintFlag;
 
   bool              m_noQtbttDualTreeIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool              m_noPartitionConstraintsOverrideConstraintFlag;
-#endif
   bool              m_noSaoConstraintFlag;
   bool              m_noAlfConstraintFlag;
   bool              m_noPcmConstraintFlag;
@@ -281,31 +188,18 @@ class ConstraintInfo
   bool              m_noSbtmvpConstraintFlag;
   bool              m_noAmvrConstraintFlag;
   bool              m_noBdofConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool              m_noDmvrConstraintFlag;
-#endif
   bool              m_noCclmConstraintFlag;
   bool              m_noMtsConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool              m_noSbtConstraintFlag;
-#endif
   bool              m_noAffineMotionConstraintFlag;
   bool              m_noGbiConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool              m_noIbcConstraintFlag;
-#endif
   bool              m_noMhIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool              m_noFPelMmvdConstraintFlag;
-#endif
   bool              m_noTriangleConstraintFlag;
   bool              m_noLadfConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool              m_noTransformSkipConstraintFlag;
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noCurrPicRefConstraintFlag;
-#endif
   bool              m_noQpDeltaConstraintFlag;
   bool              m_noDepQuantConstraintFlag;
   bool              m_noSignDataHidingConstraintFlag;
@@ -320,9 +214,7 @@ public:
     , m_maxBitDepthConstraintIdc  (  0)
     , m_maxChromaFormatConstraintIdc(CHROMA_420)
     , m_noQtbttDualTreeIntraConstraintFlag(false)
-#if JVET_N0276_CONSTRAINT_FLAGS
     , m_noPartitionConstraintsOverrideConstraintFlag(false)
-#endif
     , m_noSaoConstraintFlag      (false)
     , m_noAlfConstraintFlag      (false)
     , m_noPcmConstraintFlag      (false)
@@ -331,31 +223,18 @@ public:
     , m_noSbtmvpConstraintFlag   (false)
     , m_noAmvrConstraintFlag     (false)
     , m_noBdofConstraintFlag     (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
     , m_noDmvrConstraintFlag     (false)
-#endif
     , m_noCclmConstraintFlag     (false)
     , m_noMtsConstraintFlag      (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
     , m_noSbtConstraintFlag      (false)
-#endif
     , m_noAffineMotionConstraintFlag(false)
     , m_noGbiConstraintFlag      (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
     , m_noIbcConstraintFlag      (false)
-#endif
     , m_noMhIntraConstraintFlag  (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
     , m_noFPelMmvdConstraintFlag (false)
-#endif
     , m_noTriangleConstraintFlag (false)
     , m_noLadfConstraintFlag     (false)
-#if JVET_N0276_CONSTRAINT_FLAGS
     , m_noTransformSkipConstraintFlag(false)
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-    , m_noCurrPicRefConstraintFlag(false)
-#endif
     , m_noQpDeltaConstraintFlag  (false)
     , m_noDepQuantConstraintFlag (false)
     , m_noSignDataHidingConstraintFlag(false)
@@ -390,10 +269,8 @@ public:
 
   bool          getNoQtbttDualTreeIntraConstraintFlag() const { return m_noQtbttDualTreeIntraConstraintFlag; }
   void          setNoQtbttDualTreeIntraConstraintFlag(bool bVal) { m_noQtbttDualTreeIntraConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool          getNoPartitionConstraintsOverrideConstraintFlag() const { return m_noPartitionConstraintsOverrideConstraintFlag; }
   void          setNoPartitionConstraintsOverrideConstraintFlag(bool bVal) { m_noPartitionConstraintsOverrideConstraintFlag = bVal; }
-#endif
   bool          getNoSaoConstraintFlag() const { return m_noSaoConstraintFlag; }
   void          setNoSaoConstraintFlag(bool bVal) { m_noSaoConstraintFlag = bVal; }
   bool          getNoAlfConstraintFlag() const { return m_noAlfConstraintFlag; }
@@ -410,44 +287,30 @@ public:
   void          setNoAmvrConstraintFlag(bool bVal) { m_noAmvrConstraintFlag = bVal; }
   bool          getNoBdofConstraintFlag() const { return m_noBdofConstraintFlag; }
   void          setNoBdofConstraintFlag(bool bVal) { m_noBdofConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool          getNoDmvrConstraintFlag() const { return m_noDmvrConstraintFlag; }
   void          setNoDmvrConstraintFlag(bool bVal) { m_noDmvrConstraintFlag = bVal; }
-#endif
   bool          getNoCclmConstraintFlag() const { return m_noCclmConstraintFlag; }
   void          setNoCclmConstraintFlag(bool bVal) { m_noCclmConstraintFlag = bVal; }
   bool          getNoMtsConstraintFlag() const { return m_noMtsConstraintFlag; }
   void          setNoMtsConstraintFlag(bool bVal) { m_noMtsConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool          getNoSbtConstraintFlag() const { return m_noSbtConstraintFlag; }
   void          setNoSbtConstraintFlag(bool bVal) { m_noSbtConstraintFlag = bVal; }
-#endif
   bool          getNoAffineMotionConstraintFlag() const { return m_noAffineMotionConstraintFlag; }
   void          setNoAffineMotionConstraintFlag(bool bVal) { m_noAffineMotionConstraintFlag = bVal; }
   bool          getNoGbiConstraintFlag() const { return m_noGbiConstraintFlag; }
   void          setNoGbiConstraintFlag(bool bVal) { m_noGbiConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool          getNoIbcConstraintFlag() const { return m_noIbcConstraintFlag; }
   void          setNoIbcConstraintFlag(bool bVal) { m_noIbcConstraintFlag = bVal; }
-#endif
   bool          getNoMhIntraConstraintFlag() const { return m_noMhIntraConstraintFlag; }
   void          setNoMhIntraConstraintFlag(bool bVal) { m_noMhIntraConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool          getNoFPelMmvdConstraintFlag() const { return m_noFPelMmvdConstraintFlag; }
   void          setNoFPelMmvdConstraintFlag(bool bVal) { m_noFPelMmvdConstraintFlag = bVal; }
-#endif
   bool          getNoTriangleConstraintFlag() const { return m_noTriangleConstraintFlag; }
   void          setNoTriangleConstraintFlag(bool bVal) { m_noTriangleConstraintFlag = bVal; }
   bool          getNoLadfConstraintFlag() const { return m_noLadfConstraintFlag; }
   void          setNoLadfConstraintFlag(bool bVal) { m_noLadfConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool          getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
   void          setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; }
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool          getNoCurrPicRefConstraintFlag() const { return m_noCurrPicRefConstraintFlag; }
-  void          setNoCurrPicRefConstraintFlag(bool bVal) { m_noCurrPicRefConstraintFlag = bVal; }
-#endif
   bool          getNoQpDeltaConstraintFlag() const { return m_noQpDeltaConstraintFlag; }
   void          setNoQpDeltaConstraintFlag(bool bVal) { m_noQpDeltaConstraintFlag = bVal; }
   bool          getNoDepQuantConstraintFlag() const { return m_noDepQuantConstraintFlag; }
@@ -455,45 +318,20 @@ public:
   bool          getNoSignDataHidingConstraintFlag() const { return m_noSignDataHidingConstraintFlag; }
   void          setNoSignDataHidingConstraintFlag(bool bVal) { m_noSignDataHidingConstraintFlag = bVal; }
 };
-#endif
 
 class ProfileTierLevel
 {
-#if !JVET_M0101_HLS
-  int               m_profileSpace;
-#endif
   Level::Tier       m_tierFlag;
   Profile::Name     m_profileIdc;
-#if !JVET_M0101_HLS
-  bool              m_profileCompatibilityFlag[32];
-#endif
-#if JVET_N0276_CONSTRAINT_FLAGS
   uint32_t          m_subProfileIdc;
-#endif
   Level::Name       m_levelIdc;
 
-#if !JVET_M0101_HLS
-  bool              m_progressiveSourceFlag;
-  bool              m_interlacedSourceFlag;
-  bool              m_nonPackedConstraintFlag;
-  bool              m_frameOnlyConstraintFlag;
-  uint32_t              m_bitDepthConstraintValue;
-  ChromaFormat      m_chromaFormatConstraintValue;
-  bool              m_intraConstraintFlag;
-  bool              m_onePictureOnlyConstraintFlag;
-  bool              m_lowerBitRateConstraintFlag;
-#else
   ConstraintInfo    m_constraintInfo;
   bool              m_subLayerLevelPresentFlag[MAX_TLAYER - 1];
   Level::Name       m_subLayerLevelIdc[MAX_TLAYER - 1];
-#endif
 
 public:
                 ProfileTierLevel();
-#if !JVET_M0101_HLS
-  int           getProfileSpace() const                     { return m_profileSpace;                }
-  void          setProfileSpace(int x)                      { m_profileSpace = x;                   }
-#endif
 
   Level::Tier   getTierFlag() const                         { return m_tierFlag;                    }
   void          setTierFlag(Level::Tier x)                  { m_tierFlag = x;                       }
@@ -501,49 +339,14 @@ public:
   Profile::Name getProfileIdc() const                       { return m_profileIdc;                  }
   void          setProfileIdc(Profile::Name x)              { m_profileIdc = x;                     }
 
-#if JVET_N0276_CONSTRAINT_FLAGS
   uint32_t      getSubProfileIdc() const                    { return m_subProfileIdc;               }
   void          setSubProfileIdc(uint32_t x)                { m_subProfileIdc = x;                  }
-#endif
 
-#if !JVET_M0101_HLS
-  bool          getProfileCompatibilityFlag(int i) const    { return m_profileCompatibilityFlag[i]; }
-  void          setProfileCompatibilityFlag(int i, bool x)  { m_profileCompatibilityFlag[i] = x;    }
-#endif
 
   Level::Name   getLevelIdc() const                         { return m_levelIdc;                    }
   void          setLevelIdc(Level::Name x)                  { m_levelIdc = x;                       }
 
-#if !JVET_M0101_HLS
-  bool          getProgressiveSourceFlag() const            { return m_progressiveSourceFlag;       }
-  void          setProgressiveSourceFlag(bool b)            { m_progressiveSourceFlag = b;          }
-
-  bool          getInterlacedSourceFlag() const             { return m_interlacedSourceFlag;        }
-  void          setInterlacedSourceFlag(bool b)             { m_interlacedSourceFlag = b;           }
-
-  bool          getNonPackedConstraintFlag() const          { return m_nonPackedConstraintFlag;     }
-  void          setNonPackedConstraintFlag(bool b)          { m_nonPackedConstraintFlag = b;        }
-
-  bool          getFrameOnlyConstraintFlag() const          { return m_frameOnlyConstraintFlag;     }
-  void          setFrameOnlyConstraintFlag(bool b)          { m_frameOnlyConstraintFlag = b;        }
 
-  uint32_t          getBitDepthConstraint() const               { return m_bitDepthConstraintValue;     }
-  void          setBitDepthConstraint(uint32_t bitDepth)        { m_bitDepthConstraintValue=bitDepth;   }
-
-  ChromaFormat  getChromaFormatConstraint() const           { return m_chromaFormatConstraintValue; }
-  void          setChromaFormatConstraint(ChromaFormat fmt) { m_chromaFormatConstraintValue=fmt;    }
-
-  bool          getIntraConstraintFlag() const              { return m_intraConstraintFlag;         }
-  void          setIntraConstraintFlag(bool b)              { m_intraConstraintFlag = b;            }
-
-  bool          getOnePictureOnlyConstraintFlag() const     { return m_onePictureOnlyConstraintFlag;}
-  void          setOnePictureOnlyConstraintFlag(bool b)     { m_onePictureOnlyConstraintFlag = b;   }
-
-  bool          getLowerBitRateConstraintFlag() const       { return m_lowerBitRateConstraintFlag;  }
-  void          setLowerBitRateConstraintFlag(bool b)       { m_lowerBitRateConstraintFlag = b;     }
-#endif
-
-#if JVET_M0101_HLS
   ConstraintInfo*         getConstraintInfo()              { return &m_constraintInfo; }
   const ConstraintInfo*   getConstraintInfo() const        { return &m_constraintInfo; }
 
@@ -552,33 +355,10 @@ public:
 
   Level::Name             getSubLayerLevelIdc(int i) const             { return m_subLayerLevelIdc[i];   }
   void                    setSubLayerLevelIdc(int i, Level::Name x)    { m_subLayerLevelIdc[i] = x;      }
-#endif
 
 };
 
 
-#if !JVET_M0101_HLS
-class PTL
-{
-  ProfileTierLevel m_generalPTL;
-  ProfileTierLevel m_subLayerPTL    [MAX_TLAYER-1];      // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6)
-  bool m_subLayerProfilePresentFlag [MAX_TLAYER-1];
-  bool m_subLayerLevelPresentFlag   [MAX_TLAYER-1];
-
-public:
-                          PTL();
-  bool                    getSubLayerProfilePresentFlag(int i) const   { return m_subLayerProfilePresentFlag[i]; }
-  void                    setSubLayerProfilePresentFlag(int i, bool x) { m_subLayerProfilePresentFlag[i] = x;    }
-
-  bool                    getSubLayerLevelPresentFlag(int i) const     { return m_subLayerLevelPresentFlag[i];   }
-  void                    setSubLayerLevelPresentFlag(int i, bool x)   { m_subLayerLevelPresentFlag[i] = x;      }
-
-  ProfileTierLevel*       getGeneralPTL()                              { return &m_generalPTL;                   }
-  const ProfileTierLevel* getGeneralPTL() const                        { return &m_generalPTL;                   }
-  ProfileTierLevel*       getSubLayerPTL(int i)                        { return &m_subLayerPTL[i];               }
-  const ProfileTierLevel* getSubLayerPTL(int i) const                  { return &m_subLayerPTL[i];               }
-};
-#endif
 
 class SliceReshapeInfo
 {
@@ -622,7 +402,6 @@ struct ChromaQpAdj
   } u;
 };
 
-#if JVET_N0349_DPS
 
 class DPS
 {
@@ -648,7 +427,6 @@ public:
   const ProfileTierLevel& getProfileTierLevel() const            { return m_profileTierLevel; }
 };
 
-#endif
 
 
 #if HEVC_VPS
@@ -731,7 +509,7 @@ public:
   TimingInfo*       getTimingInfo()                                      { return &m_timingInfo;                                            }
   const TimingInfo* getTimingInfo() const                                { return &m_timingInfo;                                            }
 };
-#elif JVET_N0278_HLS
+#else
 class VPS
 {
 private:
@@ -801,7 +579,6 @@ public:
 class VUI
 {
 private:
-#if JVET_N0063_VUI
   bool       m_aspectRatioInfoPresentFlag;
   int        m_aspectRatioIdc;
   int        m_sarWidth;
@@ -819,43 +596,8 @@ private:
   bool       m_overscanAppropriateFlag;
   bool       m_videoSignalTypePresentFlag;
   bool       m_videoFullRangeFlag;
-#else
-  bool       m_aspectRatioInfoPresentFlag;
-  int        m_aspectRatioIdc;
-  int        m_sarWidth;
-  int        m_sarHeight;
-  bool       m_overscanInfoPresentFlag;
-  bool       m_overscanAppropriateFlag;
-  bool       m_videoSignalTypePresentFlag;
-  int        m_videoFormat;
-  bool       m_videoFullRangeFlag;
-  bool       m_colourDescriptionPresentFlag;
-  int        m_colourPrimaries;
-  int        m_transferCharacteristics;
-  int        m_matrixCoefficients;
-  bool       m_chromaLocInfoPresentFlag;
-  int        m_chromaSampleLocTypeTopField;
-  int        m_chromaSampleLocTypeBottomField;
-  bool       m_neutralChromaIndicationFlag;
-  bool       m_fieldSeqFlag;
-  Window     m_defaultDisplayWindow;
-  bool       m_frameFieldInfoPresentFlag;
-  bool       m_hrdParametersPresentFlag;
-  bool       m_bitstreamRestrictionFlag;
-  bool       m_tilesFixedStructureFlag;
-  bool       m_motionVectorsOverPicBoundariesFlag;
-  bool       m_restrictedRefPicListsFlag;
-  int        m_minSpatialSegmentationIdc;
-  int        m_maxBytesPerPicDenom;
-  int        m_maxBitsPerMinCuDenom;
-  int        m_log2MaxMvLengthHorizontal;
-  int        m_log2MaxMvLengthVertical;
-  HRDParameters m_hrdParameters;
-  TimingInfo    m_timingInfo;
-#endif
 
 public:
-#if JVET_N0063_VUI
   VUI()
     : m_aspectRatioInfoPresentFlag        (false) //TODO: This initialiser list contains magic numbers
     , m_aspectRatioIdc                    (0)
@@ -875,43 +617,9 @@ public:
     , m_videoSignalTypePresentFlag        (false)
     , m_videoFullRangeFlag                (false)
   {}
-#else
-  VUI()
-    : m_aspectRatioInfoPresentFlag        (false) //TODO: This initialiser list contains magic numbers
-    , m_aspectRatioIdc                    (0)
-    , m_sarWidth                          (0)
-    , m_sarHeight                         (0)
-    , m_overscanInfoPresentFlag           (false)
-    , m_overscanAppropriateFlag           (false)
-    , m_videoSignalTypePresentFlag        (false)
-    , m_videoFormat                       (5)
-    , m_videoFullRangeFlag                (false)
-    , m_colourDescriptionPresentFlag      (false)
-    , m_colourPrimaries                   (2)
-    , m_transferCharacteristics           (2)
-    , m_matrixCoefficients                (2)
-    , m_chromaLocInfoPresentFlag          (false)
-    , m_chromaSampleLocTypeTopField       (0)
-    , m_chromaSampleLocTypeBottomField    (0)
-    , m_neutralChromaIndicationFlag       (false)
-    , m_fieldSeqFlag                      (false)
-    , m_frameFieldInfoPresentFlag         (false)
-    , m_hrdParametersPresentFlag          (false)
-    , m_bitstreamRestrictionFlag          (false)
-    , m_tilesFixedStructureFlag           (false)
-    , m_motionVectorsOverPicBoundariesFlag(true)
-    , m_restrictedRefPicListsFlag         (1)
-    , m_minSpatialSegmentationIdc         (0)
-    , m_maxBytesPerPicDenom               (2)
-    , m_maxBitsPerMinCuDenom              (1)
-    , m_log2MaxMvLengthHorizontal         (15)
-    , m_log2MaxMvLengthVertical           (15)
-  {}
-#endif
 
   virtual           ~VUI() {}
 
-#if JVET_N0063_VUI
   bool              getAspectRatioInfoPresentFlag() const                  { return m_aspectRatioInfoPresentFlag;           }
   void              setAspectRatioInfoPresentFlag(bool i)                  { m_aspectRatioInfoPresentFlag = i;              }
 
@@ -963,104 +671,6 @@ public:
   bool              getVideoFullRangeFlag() const                          { return m_videoFullRangeFlag;                   }
   void              setVideoFullRangeFlag(bool i)                          { m_videoFullRangeFlag = i;                      }
 
-#else
-  bool              getAspectRatioInfoPresentFlag() const                  { return m_aspectRatioInfoPresentFlag;           }
-  void              setAspectRatioInfoPresentFlag(bool i)                  { m_aspectRatioInfoPresentFlag = i;              }
-
-  int               getAspectRatioIdc() const                              { return m_aspectRatioIdc;                       }
-  void              setAspectRatioIdc(int i)                               { m_aspectRatioIdc = i;                          }
-
-  int               getSarWidth() const                                    { return m_sarWidth;                             }
-  void              setSarWidth(int i)                                     { m_sarWidth = i;                                }
-
-  int               getSarHeight() const                                   { return m_sarHeight;                            }
-  void              setSarHeight(int i)                                    { m_sarHeight = i;                               }
-
-  bool              getOverscanInfoPresentFlag() const                     { return m_overscanInfoPresentFlag;              }
-  void              setOverscanInfoPresentFlag(bool i)                     { m_overscanInfoPresentFlag = i;                 }
-
-  bool              getOverscanAppropriateFlag() const                     { return m_overscanAppropriateFlag;              }
-  void              setOverscanAppropriateFlag(bool i)                     { m_overscanAppropriateFlag = i;                 }
-
-  bool              getVideoSignalTypePresentFlag() const                  { return m_videoSignalTypePresentFlag;           }
-  void              setVideoSignalTypePresentFlag(bool i)                  { m_videoSignalTypePresentFlag = i;              }
-
-  int               getVideoFormat() const                                 { return m_videoFormat;                          }
-  void              setVideoFormat(int i)                                  { m_videoFormat = i;                             }
-
-  bool              getVideoFullRangeFlag() const                          { return m_videoFullRangeFlag;                   }
-  void              setVideoFullRangeFlag(bool i)                          { m_videoFullRangeFlag = i;                      }
-
-  bool              getColourDescriptionPresentFlag() const                { return m_colourDescriptionPresentFlag;         }
-  void              setColourDescriptionPresentFlag(bool i)                { m_colourDescriptionPresentFlag = i;            }
-
-  int               getColourPrimaries() const                             { return m_colourPrimaries;                      }
-  void              setColourPrimaries(int i)                              { m_colourPrimaries = i;                         }
-
-  int               getTransferCharacteristics() const                     { return m_transferCharacteristics;              }
-  void              setTransferCharacteristics(int i)                      { m_transferCharacteristics = i;                 }
-
-  int               getMatrixCoefficients() const                          { return m_matrixCoefficients;                   }
-  void              setMatrixCoefficients(int i)                           { m_matrixCoefficients = i;                      }
-
-  bool              getChromaLocInfoPresentFlag() const                    { return m_chromaLocInfoPresentFlag;             }
-  void              setChromaLocInfoPresentFlag(bool i)                    { m_chromaLocInfoPresentFlag = i;                }
-
-  int               getChromaSampleLocTypeTopField() const                 { return m_chromaSampleLocTypeTopField;          }
-  void              setChromaSampleLocTypeTopField(int i)                  { m_chromaSampleLocTypeTopField = i;             }
-
-  int               getChromaSampleLocTypeBottomField() const              { return m_chromaSampleLocTypeBottomField;       }
-  void              setChromaSampleLocTypeBottomField(int i)               { m_chromaSampleLocTypeBottomField = i;          }
-
-  bool              getNeutralChromaIndicationFlag() const                 { return m_neutralChromaIndicationFlag;          }
-  void              setNeutralChromaIndicationFlag(bool i)                 { m_neutralChromaIndicationFlag = i;             }
-
-  bool              getFieldSeqFlag() const                                { return m_fieldSeqFlag;                         }
-  void              setFieldSeqFlag(bool i)                                { m_fieldSeqFlag = i;                            }
-
-  bool              getFrameFieldInfoPresentFlag() const                   { return m_frameFieldInfoPresentFlag;            }
-  void              setFrameFieldInfoPresentFlag(bool i)                   { m_frameFieldInfoPresentFlag = i;               }
-
-  Window&           getDefaultDisplayWindow()                              { return m_defaultDisplayWindow;                 }
-  const Window&     getDefaultDisplayWindow() const                        { return m_defaultDisplayWindow;                 }
-  void              setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; }
-
-  bool              getHrdParametersPresentFlag() const                    { return m_hrdParametersPresentFlag;             }
-  void              setHrdParametersPresentFlag(bool i)                    { m_hrdParametersPresentFlag = i;                }
-
-  bool              getBitstreamRestrictionFlag() const                    { return m_bitstreamRestrictionFlag;             }
-  void              setBitstreamRestrictionFlag(bool i)                    { m_bitstreamRestrictionFlag = i;                }
-
-  bool              getTilesFixedStructureFlag() const                     { return m_tilesFixedStructureFlag;              }
-  void              setTilesFixedStructureFlag(bool i)                     { m_tilesFixedStructureFlag = i;                 }
-
-  bool              getMotionVectorsOverPicBoundariesFlag() const          { return m_motionVectorsOverPicBoundariesFlag;   }
-  void              setMotionVectorsOverPicBoundariesFlag(bool i)          { m_motionVectorsOverPicBoundariesFlag = i;      }
-
-  bool              getRestrictedRefPicListsFlag() const                   { return m_restrictedRefPicListsFlag;            }
-  void              setRestrictedRefPicListsFlag(bool b)                   { m_restrictedRefPicListsFlag = b;               }
-
-  int               getMinSpatialSegmentationIdc() const                   { return m_minSpatialSegmentationIdc;            }
-  void              setMinSpatialSegmentationIdc(int i)                    { m_minSpatialSegmentationIdc = i;               }
-
-  int               getMaxBytesPerPicDenom() const                         { return m_maxBytesPerPicDenom;                  }
-  void              setMaxBytesPerPicDenom(int i)                          { m_maxBytesPerPicDenom = i;                     }
-
-  int               getMaxBitsPerMinCuDenom() const                        { return m_maxBitsPerMinCuDenom;                 }
-  void              setMaxBitsPerMinCuDenom(int i)                         { m_maxBitsPerMinCuDenom = i;                    }
-
-  int               getLog2MaxMvLengthHorizontal() const                   { return m_log2MaxMvLengthHorizontal;            }
-  void              setLog2MaxMvLengthHorizontal(int i)                    { m_log2MaxMvLengthHorizontal = i;               }
-
-  int               getLog2MaxMvLengthVertical() const                     { return m_log2MaxMvLengthVertical;              }
-  void              setLog2MaxMvLengthVertical(int i)                      { m_log2MaxMvLengthVertical = i;                 }
-
-  HRDParameters*       getHrdParameters()                                  { return &m_hrdParameters;                       }
-  const HRDParameters* getHrdParameters()  const                           { return &m_hrdParameters;                       }
-
-  TimingInfo*       getTimingInfo()                                        { return &m_timingInfo;                          }
-  const TimingInfo* getTimingInfo() const                                  { return &m_timingInfo;                          }
-#endif
 };
 
 /// SPS RExt class
@@ -1124,61 +734,11 @@ class SPS
 {
 private:
   int               m_SPSId;
-#if JVET_N0349_DPS
   int               m_decodingParameterSetId;
-#endif
-#if !JVET_M0101_HLS
-  bool              m_bIntraOnlyConstraintFlag;
-  uint32_t          m_maxBitDepthConstraintIdc;
-  uint32_t          m_maxChromaFormatConstraintIdc;
-  bool              m_bFrameConstraintFlag;
-  bool              m_bNoQtbttDualTreeIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noPartitionConstraintsOverrideConstraintFlag;
-#endif
-  bool              m_bNoSaoConstraintFlag;
-  bool              m_bNoAlfConstraintFlag;
-  bool              m_bNoPcmConstraintFlag;
-  bool              m_bNoRefWraparoundConstraintFlag;
-  bool              m_bNoTemporalMvpConstraintFlag;
-  bool              m_bNoSbtmvpConstraintFlag;
-  bool              m_bNoAmvrConstraintFlag;
-  bool              m_bNoBdofConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noDmvrConstraintFlag;
-#endif
-  bool              m_bNoCclmConstraintFlag;
-  bool              m_bNoMtsConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noSbtConstraintFlag;
-#endif
-  bool              m_bNoAffineMotionConstraintFlag;
-  bool              m_bNoGbiConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noIbcConstraintFlag;
-#endif
-  bool              m_bNoMhIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noFPelMmvdConstraintFlag;
-#endif
-  bool              m_bNoTriangleConstraintFlag;
-  bool              m_bNoLadfConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_noTransformSkipConstraintFlag;
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool              m_bNoCurrPicRefConstraintFlag;
-#endif
-  bool              m_bNoQpDeltaConstraintFlag;
-  bool              m_bNoDepQuantConstraintFlag;
-  bool              m_bNoSignDataHidingConstraintFlag;
-#endif
 
   bool              m_affineAmvrEnabledFlag;
   bool              m_DMVR;
-#if JVET_N0127_MMVD_SPS_FLAG
   bool              m_MMVD;
-#endif
   bool              m_SBT;
   uint8_t           m_MaxSbtSize;
 #if INCLUDE_ISP_CFG_FLAG
@@ -1203,9 +763,7 @@ private:
   unsigned    m_maxBTDepth[3];
   unsigned    m_maxBTSize[3];
   unsigned    m_maxTTSize[3];
-#if JVET_N0047_Merge_IDR_Non_IDR
   bool        m_idrRefParamList;
-#endif
   unsigned    m_dualITree;
   uint32_t              m_uiMaxCUWidth;
   uint32_t              m_uiMaxCUHeight;
@@ -1213,7 +771,6 @@ private:
 
   Window            m_conformanceWindow;
 
-#if JVET_M0128
   RPLList           m_RPLList0;
   RPLList           m_RPLList1;
   uint32_t          m_numRPL0;
@@ -1221,9 +778,6 @@ private:
   bool              m_rpl1CopyFromRpl0Flag;
   bool              m_rpl1IdxPresentFlag;
   bool              m_allRplEntriesHasSameSignFlag;
-#else
-  RPSList           m_RPSList;
-#endif
   bool              m_bLongTermRefsPresent;
   bool              m_SPSTemporalMVPEnabledFlag;
   int               m_numReorderPics[MAX_TLAYER];
@@ -1254,23 +808,16 @@ private:
 
   bool              m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
 
-#if HEVC_USE_SCALING_LISTS
   bool              m_scalingListEnabledFlag;
   bool              m_scalingListPresentFlag;
   ScalingList       m_scalingList;
-#endif
   uint32_t              m_uiMaxDecPicBuffering[MAX_TLAYER];
   uint32_t              m_uiMaxLatencyIncreasePlus1[MAX_TLAYER];
 
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  bool              m_useStrongIntraSmoothing;
-#endif
 
-#if JVET_N0063_VUI
   TimingInfo        m_timingInfo;
   bool              m_hrdParametersPresentFlag;
   HRDParameters     m_hrdParameters;
-#endif
 
   bool              m_vuiParametersPresentFlag;
   VUI               m_vuiParameters;
@@ -1279,11 +826,7 @@ private:
 
   static const int  m_winUnitX[NUM_CHROMA_FORMAT];
   static const int  m_winUnitY[NUM_CHROMA_FORMAT];
-#if !JVET_M0101_HLS
-  PTL               m_pcPTL;
-#else
   ProfileTierLevel  m_profileTierLevel;
-#endif
 
   bool              m_alfEnabledFlag;
 
@@ -1298,12 +841,8 @@ private:
   bool              m_MTS;
   bool              m_IntraMTS;                   // 18
   bool              m_InterMTS;                   // 19
-#if JVET_N0193_LFNST
   bool              m_LFNST;
-#endif
-#if JVET_N0235_SMVD_SPS
   bool              m_SMVD;
-#endif
   bool              m_Affine;
   bool              m_AffineType;
   bool              m_GBi;                        //
@@ -1315,9 +854,7 @@ private:
   int               m_LadfQpOffset[MAX_LADF_INTERVALS];
   int               m_LadfIntervalLowerBound[MAX_LADF_INTERVALS];
 #endif
-#if JVET_N0217_MATRIX_INTRAPRED
   bool              m_MIP;
-#endif
 
 public:
 
@@ -1327,89 +864,11 @@ public:
 #if HEVC_VPS
   int                     getVPSId() const                                                                { return m_VPSId;                                                      }
   void                    setVPSId(int i)                                                                 { m_VPSId = i;                                                         }
-#endif
-#if !JVET_M0101_HLS
-  bool                    getIntraOnlyConstraintFlag() const                                              { return m_bIntraOnlyConstraintFlag;                                   }
-  void                    setIntraOnlyConstraintFlag(bool bVal)                                           { m_bIntraOnlyConstraintFlag = bVal;                                   }
-  uint32_t                getMaxBitDepthConstraintIdc() const                                             { return m_maxBitDepthConstraintIdc;                                   }
-  void                    setMaxBitDepthConstraintIdc(uint32_t u)                                         { m_maxBitDepthConstraintIdc = u;                                      }
-  uint32_t                getMaxChromaFormatConstraintIdc() const                                         { return m_maxChromaFormatConstraintIdc;                               }
-  void                    setMaxChromaFormatConstraintIdc(uint32_t u)                                     { m_maxChromaFormatConstraintIdc = u;                                  }
-  bool                    getFrameConstraintFlag() const                                                  { return m_bFrameConstraintFlag;                                       }
-  void                    setFrameConstraintFlag(bool bVal)                                               { m_bFrameConstraintFlag = bVal;                                       }
-  bool                    getNoQtbttDualTreeIntraConstraintFlag() const                                   { return m_bNoQtbttDualTreeIntraConstraintFlag;                        }
-  void                    setNoQtbttDualTreeIntraConstraintFlag(bool bVal)                                { m_bNoQtbttDualTreeIntraConstraintFlag = bVal;                        }
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoPartitionConstraintsOverrideConstraintFlag() const                         { return m_noPartitionConstraintsOverrideConstraintFlag; }
-  void                    setNoPartitionConstraintsOverrideConstraintFlag(bool bVal)                      { m_noPartitionConstraintsOverrideConstraintFlag = bVal; }
-#endif
-  bool                    getNoSaoConstraintFlag() const                                                  { return m_bNoSaoConstraintFlag;                                       }
-  void                    setNoSaoConstraintFlag(bool bVal)                                               { m_bNoSaoConstraintFlag = bVal;                                       }
-  bool                    getNoAlfConstraintFlag() const                                                  { return m_bNoAlfConstraintFlag;                                       }
-  void                    setNoAlfConstraintFlag(bool bVal)                                               { m_bNoAlfConstraintFlag = bVal;                                       }
-  bool                    getNoPcmConstraintFlag() const                                                  { return m_bNoPcmConstraintFlag;                                       }
-  void                    setNoPcmConstraintFlag(bool bVal)                                               { m_bNoPcmConstraintFlag = bVal;                                       }
-  bool                    getNoRefWraparoundConstraintFlag() const                                        { return m_bNoRefWraparoundConstraintFlag;                             }
-  void                    setNoRefWraparoundConstraintFlag(bool bVal)                                     { m_bNoRefWraparoundConstraintFlag= bVal;                              }
-  bool                    getNoTemporalMvpConstraintFlag() const                                          { return m_bNoTemporalMvpConstraintFlag;                               }
-  void                    setNoTemporalMvpConstraintFlag(bool bVal)                                       { m_bNoTemporalMvpConstraintFlag = bVal;                               }
-  bool                    getNoSbtmvpConstraintFlag() const                                               { return m_bNoSbtmvpConstraintFlag;                                    }
-  void                    setNoSbtmvpConstraintFlag(bool bVal)                                            { m_bNoSbtmvpConstraintFlag = bVal;                                    }
-  bool                    getNoAmvrConstraintFlag() const                                                 { return m_bNoAmvrConstraintFlag;                                      }
-  void                    setNoAmvrConstraintFlag(bool bVal)                                              { m_bNoAmvrConstraintFlag = bVal;                                      }
-  bool                    getNoBdofConstraintFlag() const                                                 { return m_bNoBdofConstraintFlag;                                      }
-  void                    setNoBdofConstraintFlag(bool bVal)                                              { m_bNoBdofConstraintFlag = bVal;                                      }
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoDmvrConstraintFlag() const                                                 { return m_noDmvrConstraintFlag; }
-  void                    setNoDmvrConstraintFlag(bool bVal)                                              { m_noDmvrConstraintFlag = bVal; }
-#endif 
-  bool                    getNoCclmConstraintFlag() const                                                 { return m_bNoCclmConstraintFlag;                                      }
-  void                    setNoCclmConstraintFlag(bool bVal)                                              { m_bNoCclmConstraintFlag = bVal;                                      }
-  bool                    getNoMtsConstraintFlag() const                                                  { return m_bNoMtsConstraintFlag;                                       }
-  void                    setNoMtsConstraintFlag(bool bVal)                                               { m_bNoMtsConstraintFlag = bVal;                                       }
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoSbtConstraintFlag() const                                                  { return m_noSbtConstraintFlag; }
-  void                    setNoSbtConstraintFlag(bool bVal)                                               { m_noSbtConstraintFlag = bVal; }
-#endif
-  bool                    getNoAffineMotionConstraintFlag() const                                         { return m_bNoAffineMotionConstraintFlag;                              }
-  void                    setNoAffineMotionConstraintFlag(bool bVal)                                      { m_bNoAffineMotionConstraintFlag = bVal;                              }
-  bool                    getNoGbiConstraintFlag() const                                                  { return m_bNoGbiConstraintFlag;                                       }
-  void                    setNoGbiConstraintFlag(bool bVal)                                               { m_bNoGbiConstraintFlag = bVal;                                       }
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoIbcConstraintFlag() const                                                  { return m_noIbcConstraintFlag; }
-  void                    setNoIbcConstraintFlag(bool bVal)                                               { m_noIbcConstraintFlag = bVal; }
-#endif
-  bool                    getNoMhIntraConstraintFlag() const                                              { return m_bNoMhIntraConstraintFlag;                                   }
-  void                    setNoMhIntraConstraintFlag(bool bVal)                                           { m_bNoMhIntraConstraintFlag = bVal;                                   }
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoFPelMmvdConstraintFlag() const                                             { return m_noFPelMmvdConstraintFlag; }
-  void                    setNoFPelMmvdConstraintFlag(bool bVal)                                          { m_noFPelMmvdConstraintFlag = bVal; }
-#endif
-  bool                    getNoTriangleConstraintFlag() const                                             { return m_bNoTriangleConstraintFlag;                                  }
-  void                    setNoTriangleConstraintFlag(bool bVal)                                          { m_bNoTriangleConstraintFlag = bVal;                                  }
-  bool                    getNoLadfConstraintFlag() const                                                 { return m_bNoLadfConstraintFlag;                                      }
-  void                    setNoLadfConstraintFlag(bool bVal)                                              { m_bNoLadfConstraintFlag = bVal;                                      }
-#if JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoTransformSkipConstraintFlag() const                                        { return m_noTransformSkipConstraintFlag; }
-  void                    setNoTransformSkipConstraintFlag(bool bVal)                                     { m_noTransformSkipConstraintFlag = bVal; }
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool                    getNoCurrPicRefConstraintFlag() const                                           { return m_bNoCurrPicRefConstraintFlag;                                }
-  void                    setNoCurrPicRefConstraintFlag(bool bVal)                                        { m_bNoCurrPicRefConstraintFlag = bVal;                                }
-#endif
-  bool                    getNoQpDeltaConstraintFlag() const                                              { return m_bNoQpDeltaConstraintFlag;                                   }
-  void                    setNoQpDeltaConstraintFlag(bool bVal)                                           { m_bNoQpDeltaConstraintFlag = bVal;                                   }
-  bool                    getNoDepQuantConstraintFlag() const                                             { return m_bNoDepQuantConstraintFlag;                                  }
-  void                    setNoDepQuantConstraintFlag(bool bVal)                                          { m_bNoDepQuantConstraintFlag = bVal;                                  }
-  bool                    getNoSignDataHidingConstraintFlag() const                                       { return m_bNoSignDataHidingConstraintFlag;                            }
-  void                    setNoSignDataHidingConstraintFlag(bool bVal)                                    { m_bNoSignDataHidingConstraintFlag = bVal;                            }
 #endif
   int                     getSPSId() const                                                                { return m_SPSId;                                                      }
   void                    setSPSId(int i)                                                                 { m_SPSId = i;                                                         }
-#if JVET_N0349_DPS
   void                    setDecodingParameterSetId(int val)                                              { m_decodingParameterSetId = val; }
   int                     getDecodingParameterSetId() const                                               { return m_decodingParameterSetId; }
-#endif
   ChromaFormat            getChromaFormatIdc () const                                                     { return m_chromaFormatIdc;                                            }
   void                    setChromaFormatIdc (ChromaFormat i)                                             { m_chromaFormatIdc = i;                                               }
 
@@ -1468,10 +927,8 @@ public:
   unsigned                getMaxTTSize()                                                            const { return m_maxTTSize[1]; }
   unsigned                getMaxTTSizeI()                                                           const { return m_maxTTSize[0]; }
   unsigned                getMaxTTSizeIChroma()                                                     const { return m_maxTTSize[2]; }
-#if JVET_N0047_Merge_IDR_Non_IDR
   void                    setIDRRefParamListPresent(bool b)                             { m_idrRefParamList = b; }
   bool                    getIDRRefParamListPresent()                             const { return m_idrRefParamList; }
-#endif
   void                    setUseDualITree(bool b) { m_dualITree = b; }
   bool                    getUseDualITree()                                      const { return m_dualITree; }
 
@@ -1491,7 +948,6 @@ public:
   uint32_t                    getBitsForPOC() const                                                           { return m_uiBitsForPOC;                                               }
   void                    setNumReorderPics(int i, uint32_t tlayer)                                           { m_numReorderPics[tlayer] = i;                                        }
   int                     getNumReorderPics(uint32_t tlayer) const                                            { return m_numReorderPics[tlayer];                                     }
-#if JVET_M0128
   void                    createRPLList0(int numRPL);
   void                    createRPLList1(int numRPL);
   const RPLList*          getRPLList0() const                                                                 { return &m_RPLList0;                                                  }
@@ -1505,11 +961,6 @@ public:
   bool                    getRPL1IdxPresentFlag() const                                                       { return m_rpl1IdxPresentFlag;                                         }
   void                    setAllActiveRplEntriesHasSameSignFlag(bool isAllSame)                               { m_allRplEntriesHasSameSignFlag = isAllSame;                          }
   bool                    getAllActiveRplEntriesHasSameSignFlag() const                                       { return m_allRplEntriesHasSameSignFlag;                               }
-#else
-  void                    createRPSList( int numRPS );
-  const RPSList*          getRPSList() const                                                              { return &m_RPSList;                                                   }
-  RPSList*                getRPSList()                                                                    { return &m_RPSList;                                                   }
-#endif
   bool                    getLongTermRefsPresent() const                                                  { return m_bLongTermRefsPresent;                                       }
   void                    setLongTermRefsPresent(bool b)                                                  { m_bLongTermRefsPresent=b;                                            }
   bool                    getSPSTemporalMVPEnabledFlag() const                                            { return m_SPSTemporalMVPEnabledFlag;                                  }
@@ -1545,10 +996,8 @@ public:
   void                    setFpelMmvdEnabledFlag( bool b )                                                { m_fpelMmvdEnabledFlag = b;    }
   bool                    getUseDMVR()const                                                               { return m_DMVR; }
   void                    setUseDMVR(bool b)                                                              { m_DMVR = b;    }
-#if JVET_N0127_MMVD_SPS_FLAG
   bool                    getUseMMVD()const                                                               { return m_MMVD; }
   void                    setUseMMVD(bool b)                                                              { m_MMVD = b;    }
-#endif
   uint32_t                getMaxTLayers() const                                                           { return m_uiMaxTLayers; }
   void                    setMaxTLayers( uint32_t uiMaxTLayers )                                          { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; }
 
@@ -1559,45 +1008,31 @@ public:
   void                    setPCMFilterDisableFlag( bool bValue )                                          { m_bPCMFilterDisableFlag = bValue;                                    }
   bool                    getPCMFilterDisableFlag() const                                                 { return m_bPCMFilterDisableFlag;                                      }
 
-#if HEVC_USE_SCALING_LISTS
   bool                    getScalingListFlag() const                                                      { return m_scalingListEnabledFlag;                                     }
   void                    setScalingListFlag( bool b )                                                    { m_scalingListEnabledFlag  = b;                                       }
   bool                    getScalingListPresentFlag() const                                               { return m_scalingListPresentFlag;                                     }
   void                    setScalingListPresentFlag( bool b )                                             { m_scalingListPresentFlag  = b;                                       }
   ScalingList&            getScalingList()                                                                { return m_scalingList; }
   const ScalingList&      getScalingList() const                                                          { return m_scalingList; }
-#endif
   uint32_t                    getMaxDecPicBuffering(uint32_t tlayer) const                                        { return m_uiMaxDecPicBuffering[tlayer];                               }
   void                    setMaxDecPicBuffering( uint32_t ui, uint32_t tlayer )                                   { CHECK(tlayer >= MAX_TLAYER, "Invalid T-layer"); m_uiMaxDecPicBuffering[tlayer] = ui;    }
   uint32_t                    getMaxLatencyIncreasePlus1(uint32_t tlayer) const                                   { return m_uiMaxLatencyIncreasePlus1[tlayer];                          }
   void                    setMaxLatencyIncreasePlus1( uint32_t ui , uint32_t tlayer)                              { m_uiMaxLatencyIncreasePlus1[tlayer] = ui;                            }
 
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  void                    setUseStrongIntraSmoothing(bool bVal)                                           { m_useStrongIntraSmoothing = bVal;                                    }
-  bool                    getUseStrongIntraSmoothing() const                                              { return m_useStrongIntraSmoothing;                                    }
-
-#endif
   void                    setAffineAmvrEnabledFlag( bool val )                                            { m_affineAmvrEnabledFlag = val;                                       }
   bool                    getAffineAmvrEnabledFlag() const                                                { return m_affineAmvrEnabledFlag;                                      }
-#if JVET_N0063_VUI
   TimingInfo*             getTimingInfo()                                                                 { return &m_timingInfo; }
   const TimingInfo*       getTimingInfo() const                                                           { return &m_timingInfo; }
   bool                    getHrdParametersPresentFlag() const                                             { return m_hrdParametersPresentFlag; }
   void                    setHrdParametersPresentFlag(bool b)                                             { m_hrdParametersPresentFlag = b; }
   HRDParameters*          getHrdParameters()                                                              { return &m_hrdParameters; }
   const HRDParameters*    getHrdParameters() const                                                        { return &m_hrdParameters; }
-#endif
   bool                    getVuiParametersPresentFlag() const                                             { return m_vuiParametersPresentFlag;                                   }
   void                    setVuiParametersPresentFlag(bool b)                                             { m_vuiParametersPresentFlag = b;                                      }
   VUI*                    getVuiParameters()                                                              { return &m_vuiParameters;                                             }
   const VUI*              getVuiParameters() const                                                        { return &m_vuiParameters;                                             }
-#if !JVET_M0101_HLS
-  const PTL*              getPTL() const                                                                  { return &m_pcPTL;                                                     }
-  PTL*                    getPTL()                                                                        { return &m_pcPTL;                                                     }
-#else
   const ProfileTierLevel* getProfileTierLevel() const                                                     { return &m_profileTierLevel; }
   ProfileTierLevel*       getProfileTierLevel()                                                           { return &m_profileTierLevel; }
-#endif
 
   const SPSRExt&          getSpsRangeExtension() const                                                    { return m_spsRangeExtension;                                          }
   SPSRExt&                getSpsRangeExtension()                                                          { return m_spsRangeExtension;                                          }
@@ -1636,14 +1071,10 @@ public:
   bool      getUseIntraMTS        ()                                      const     { return m_IntraMTS; }
   void      setUseInterMTS        ( bool b )                                        { m_InterMTS = b; }
   bool      getUseInterMTS        ()                                      const     { return m_InterMTS; }
-#if JVET_N0193_LFNST
   void      setUseLFNST           ( bool b )                                        { m_LFNST = b; }
   bool      getUseLFNST           ()                                      const     { return m_LFNST; }
-#endif
-#if JVET_N0235_SMVD_SPS
   void      setUseSMVD(bool b)                                                      { m_SMVD = b; }
   bool      getUseSMVD()                                                  const     { return m_SMVD; }
-#endif
   void      setUseGBi             ( bool b )                                        { m_GBi = b; }
   bool      getUseGBi             ()                                      const     { return m_GBi; }
 #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
@@ -1661,37 +1092,12 @@ public:
   bool      getUseMHIntra         ()                                      const     { return m_MHIntra; }
   void      setUseTriangle        ( bool b )                                        { m_Triangle = b; }
   bool      getUseTriangle        ()                                      const     { return m_Triangle; }
-#if JVET_N0217_MATRIX_INTRAPRED
   void      setUseMIP             ( bool b )                                        { m_MIP = b; }
   bool      getUseMIP             ()                                      const     { return m_MIP; }
-#endif
 };
 
 
 /// Reference Picture Lists class
-#if !JVET_M0128
-class RefPicListModification
-{
-private:
-  bool m_refPicListModificationFlagL0;
-  bool m_refPicListModificationFlagL1;
-  uint32_t m_RefPicSetIdxL0[REF_PIC_LIST_NUM_IDX];
-  uint32_t m_RefPicSetIdxL1[REF_PIC_LIST_NUM_IDX];
-
-public:
-          RefPicListModification();
-  virtual ~RefPicListModification();
-
-  bool    getRefPicListModificationFlagL0() const        { return m_refPicListModificationFlagL0;                                  }
-  void    setRefPicListModificationFlagL0(bool flag)     { m_refPicListModificationFlagL0 = flag;                                  }
-  bool    getRefPicListModificationFlagL1() const        { return m_refPicListModificationFlagL1;                                  }
-  void    setRefPicListModificationFlagL1(bool flag)     { m_refPicListModificationFlagL1 = flag;                                  }
-  uint32_t    getRefPicSetIdxL0(uint32_t idx) const              { CHECK(idx>=REF_PIC_LIST_NUM_IDX, "Invalid ref-pic-list index"); return m_RefPicSetIdxL0[idx];         }
-  void    setRefPicSetIdxL0(uint32_t idx, uint32_t refPicSetIdx) { CHECK(idx>=REF_PIC_LIST_NUM_IDX, "Invalid ref-pic-list index"); m_RefPicSetIdxL0[idx] = refPicSetIdx; }
-  uint32_t    getRefPicSetIdxL1(uint32_t idx) const              { CHECK(idx>=REF_PIC_LIST_NUM_IDX, "Invalid ref-pic-list index"); return m_RefPicSetIdxL1[idx];         }
-  void    setRefPicSetIdxL1(uint32_t idx, uint32_t refPicSetIdx) { CHECK(idx>=REF_PIC_LIST_NUM_IDX, "Invalid ref-pic-list index"); m_RefPicSetIdxL1[idx] = refPicSetIdx; }
-};
-#endif
 
 
 /// PPS RExt class
@@ -1771,25 +1177,18 @@ private:
 
   int              m_chromaCbQpOffset;
   int              m_chromaCrQpOffset;
-#if JVET_N0054_JOINT_CHROMA
   int              m_chromaCbCrQpOffset;
-#endif
 
   uint32_t             m_numRefIdxL0DefaultActive;
   uint32_t             m_numRefIdxL1DefaultActive;
 
-#if JVET_M0128
   bool             m_rpl1IdxPresentFlag;
-#endif
 
   bool             m_bUseWeightPred;                    //!< Use of Weighting Prediction (P_SLICE)
   bool             m_useWeightedBiPred;                 //!< Use of Weighting Bi-Prediction (B_SLICE)
   bool             m_OutputFlagPresentFlag;             //!< Indicates the presence of output_flag in slice header
   bool             m_TransquantBypassEnabledFlag;       //!< Indicates presence of cu_transquant_bypass_flag in CUs.
   bool             m_useTransformSkip;
-#if !JVET_N0857_TILES_BRICKS
-  bool             m_tilesEnabledFlag;                  //!< Indicates the presence of tiles
-#endif
   bool             m_entropyCodingSyncEnabledFlag;      //!< Indicates the presence of wavefronts
 
   bool             m_loopFilterAcrossBricksEnabledFlag;
@@ -1799,7 +1198,6 @@ private:
   std::vector<int> m_tileColumnWidth;
   std::vector<int> m_tileRowHeight;
 
-#if JVET_N0857_TILES_BRICKS
   bool             m_singleTileInPicFlag;
   int              m_tileColsWidthMinus1;
   int              m_tileRowsHeightMinus1;
@@ -1812,20 +1210,14 @@ private:
   bool             m_singleBrickPerSliceFlag;
   bool             m_rectSliceFlag;
   int              m_numSlicesInPicMinus1;
-#if JVET_N0857_RECT_SLICES
   std::vector<int> m_topLeftBrickIdx;
   std::vector<int> m_bottomRightBrickIdx;
 
   int              m_numTilesInPic;
   int              m_numBricksInPic;
-#else
-  std::vector<int> m_topLeftTileIdx;
-  std::vector<int> m_bottomRightTileIdx;
-#endif
   bool             m_signalledSliceIdFlag;
   int              m_signalledSliceIdLengthMinus1;
   std::vector<int> m_sliceId;
-#endif
 
   bool             m_cabacInitPresentFlag;
 
@@ -1836,21 +1228,17 @@ private:
   bool             m_ppsDeblockingFilterDisabledFlag;
   int              m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
   int              m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
-#if HEVC_USE_SCALING_LISTS
   bool             m_scalingListPresentFlag;
   ScalingList      m_scalingList;                       //!< ScalingList class
-#endif
   bool             m_listsModificationPresentFlag;
   uint32_t             m_log2ParallelMergeLevelMinus2;
   int              m_numExtraSliceHeaderBits;
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool             m_loopFilterAcrossVirtualBoundariesDisabledFlag;
   unsigned         m_numVerVirtualBoundaries;
   unsigned         m_numHorVirtualBoundaries;
   unsigned         m_virtualBoundariesPosX[3];
   unsigned         m_virtualBoundariesPosY[3];
-#endif
 
   PPSRExt          m_ppsRangeExtension;
 
@@ -1888,12 +1276,10 @@ public:
     {
       m_chromaCrQpOffset = i;
     }
-#if JVET_N0054_JOINT_CHROMA
     else if (compID==JOINT_CbCr)
     {
       m_chromaCbCrQpOffset = i;
     }
-#endif
     else
     {
       THROW( "Invalid chroma QP offset" );
@@ -1901,11 +1287,7 @@ public:
   }
   int                    getQpOffset(ComponentID compID) const
   {
-#if JVET_N0054_JOINT_CHROMA
     return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : compID==COMPONENT_Cr ? m_chromaCrQpOffset : m_chromaCbCrQpOffset );
-#else
-    return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset );
-#endif
   }
 
   void                   setNumRefIdxL0DefaultActive(uint32_t ui)                             { m_numRefIdxL0DefaultActive=ui;                }
@@ -1913,10 +1295,8 @@ public:
   void                   setNumRefIdxL1DefaultActive(uint32_t ui)                             { m_numRefIdxL1DefaultActive=ui;                }
   uint32_t                   getNumRefIdxL1DefaultActive() const                              { return m_numRefIdxL1DefaultActive;            }
 
-#if JVET_M0128
   void                   setRpl1IdxPresentFlag(bool isPresent)                            { m_rpl1IdxPresentFlag = isPresent;             }
   uint32_t               getRpl1IdxPresentFlag() const                                    { return m_rpl1IdxPresentFlag;                  }
-#endif
 
   bool                   getUseWP() const                                                 { return m_bUseWeightPred;                      }
   bool                   getWPBiPred() const                                              { return m_useWeightedBiPred;                   }
@@ -1933,10 +1313,6 @@ public:
 
   void                   setLoopFilterAcrossBricksEnabledFlag(bool b)                     { m_loopFilterAcrossBricksEnabledFlag = b;      }
   bool                   getLoopFilterAcrossBricksEnabledFlag() const                     { return m_loopFilterAcrossBricksEnabledFlag;   }
-#if !JVET_N0857_TILES_BRICKS
-  void                   setTilesEnabledFlag(bool val)                                    { m_tilesEnabledFlag = val;                     }
-  bool                   getTilesEnabledFlag() const                                      { return m_tilesEnabledFlag;                    }
-#endif
   bool                   getEntropyCodingSyncEnabledFlag() const                          { return m_entropyCodingSyncEnabledFlag;        }
   void                   setEntropyCodingSyncEnabledFlag(bool val)                        { m_entropyCodingSyncEnabledFlag = val;         }
 
@@ -1951,7 +1327,6 @@ public:
   void                   setTileRowHeight(const std::vector<int>& rowHeight)              { m_tileRowHeight = rowHeight;                  }
   uint32_t               getTileRowHeight(uint32_t rowIdx) const                          { return m_tileRowHeight[rowIdx];               }
 
-#if JVET_N0857_TILES_BRICKS               
   bool                   getSingleTileInPicFlag() const                                   { return m_singleTileInPicFlag;                 }
   void                   setSingleTileInPicFlag(bool val)                                 { m_singleTileInPicFlag = val;                  }
   int                    getTileColsWidthMinus1() const                                   { return m_tileColsWidthMinus1;                 }
@@ -1976,7 +1351,6 @@ public:
   void                   setRectSliceFlag(bool val)                                       { m_rectSliceFlag = val;                        }
   int                    getNumSlicesInPicMinus1() const                                  { return m_numSlicesInPicMinus1;                }
   void                   setNumSlicesInPicMinus1(int val)                                 { m_numSlicesInPicMinus1 = val;                 }
-#if JVET_N0857_RECT_SLICES
   int                    getTopLeftBrickIdx(uint32_t columnIdx) const                     { return  m_topLeftBrickIdx[columnIdx];         }
   void                   setTopLeftBrickIdx(const std::vector<int>& val)                  { m_topLeftBrickIdx = val;                      }
   int                    getBottomRightBrickIdx(uint32_t columnIdx) const                 { return  m_bottomRightBrickIdx[columnIdx];     }
@@ -1985,19 +1359,12 @@ public:
   void                   setNumTilesInPic(int val)                                        { m_numTilesInPic = val;                        }
   int                    getNumBricksInPic() const                                        { return m_numBricksInPic;                      }
   void                   setNumBricksInPic(int val)                                       { m_numBricksInPic = val;                       }
-#else
-  int                    getTopLeftTileIdx(uint32_t columnIdx) const                      { return  m_topLeftTileIdx[columnIdx];          }
-  void                   setTopLeftTileIdx(const std::vector<int>& val)                   { m_topLeftTileIdx = val;                       }
-  int                    getBottomeRightTileIdx(uint32_t columnIdx) const                 { return  m_bottomRightTileIdx[columnIdx];      }
-  void                   setBottomRightTileIdx(const std::vector<int>& val)               { m_bottomRightTileIdx = val;                   }
-#endif
   bool                   getSignalledSliceIdFlag() const                                  { return m_signalledSliceIdFlag;                }
   void                   setSignalledSliceIdFlag(bool val)                                { m_signalledSliceIdFlag = val;                 }
   int                    getSignalledSliceIdLengthMinus1() const                          { return m_signalledSliceIdLengthMinus1;        }
   void                   setSignalledSliceIdLengthMinus1(int val)                         { m_signalledSliceIdLengthMinus1 = val;         }
   int                    getSliceId(uint32_t columnIdx) const                             { return  m_sliceId[columnIdx];                 }
   void                   setSliceId(const std::vector<int>& val)                          { m_sliceId = val;                              }
-#endif
 
   void                   setCabacInitPresentFlag( bool flag )                             { m_cabacInitPresentFlag = flag;                }
   bool                   getCabacInitPresentFlag() const                                  { return m_cabacInitPresentFlag;                }
@@ -2011,12 +1378,10 @@ public:
   int                    getDeblockingFilterBetaOffsetDiv2() const                        { return m_deblockingFilterBetaOffsetDiv2;      } //!< get beta offset for deblocking filter
   void                   setDeblockingFilterTcOffsetDiv2(int val)                         { m_deblockingFilterTcOffsetDiv2 = val;         } //!< set tc offset for deblocking filter
   int                    getDeblockingFilterTcOffsetDiv2() const                          { return m_deblockingFilterTcOffsetDiv2;        } //!< get tc offset for deblocking filter
-#if HEVC_USE_SCALING_LISTS
   bool                   getScalingListPresentFlag() const                                { return m_scalingListPresentFlag;              }
   void                   setScalingListPresentFlag( bool b )                              { m_scalingListPresentFlag  = b;                }
   ScalingList&           getScalingList()                                                 { return m_scalingList;                         }
   const ScalingList&     getScalingList() const                                           { return m_scalingList;                         }
-#endif
   bool                   getListsModificationPresentFlag() const                          { return m_listsModificationPresentFlag;        }
   void                   setListsModificationPresentFlag( bool b )                        { m_listsModificationPresentFlag = b;           }
   uint32_t                   getLog2ParallelMergeLevelMinus2() const                          { return m_log2ParallelMergeLevelMinus2;        }
@@ -2028,7 +1393,6 @@ public:
   bool                   getSliceHeaderExtensionPresentFlag() const                       { return m_sliceHeaderExtensionPresentFlag;     }
   void                   setSliceHeaderExtensionPresentFlag(bool val)                     { m_sliceHeaderExtensionPresentFlag = val;      }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void                   setLoopFilterAcrossVirtualBoundariesDisabledFlag(bool b)         { m_loopFilterAcrossVirtualBoundariesDisabledFlag = b; }
   bool                   getLoopFilterAcrossVirtualBoundariesDisabledFlag() const         { return m_loopFilterAcrossVirtualBoundariesDisabledFlag; }
   void                   setNumVerVirtualBoundaries(unsigned u)                           { m_numVerVirtualBoundaries = u;                }
@@ -2039,7 +1403,6 @@ public:
   unsigned               getVirtualBoundariesPosX(unsigned idx) const                     { return m_virtualBoundariesPosX[idx];          }
   void                   setVirtualBoundariesPosY(unsigned u, unsigned idx)               { m_virtualBoundariesPosY[idx] = u;             }
   unsigned               getVirtualBoundariesPosY(unsigned idx) const                     { return m_virtualBoundariesPosY[idx];          }
-#endif
 
   const PPSRExt&         getPpsRangeExtension() const                                     { return m_ppsRangeExtension;                   }
   PPSRExt&               getPpsRangeExtension()                                           { return m_ppsRangeExtension;                   }
@@ -2049,13 +1412,9 @@ class APS
 {
 private:
   int                    m_APSId;                    // adaptation_parameter_set_id
-#if JVET_N0805_APS_LMCS
   int                    m_APSType;                  // aps_params_type
-#endif
   AlfSliceParam          m_alfAPSParam;
-#if JVET_N0805_APS_LMCS
   SliceReshapeInfo       m_reshapeAPSInfo;
-#endif
 
 public:
   APS();
@@ -2064,24 +1423,16 @@ public:
   int                    getAPSId() const                                                 { return m_APSId;                               }
   void                   setAPSId(int i)                                                  { m_APSId = i;                                  }
 
-#if JVET_N0805_APS_LMCS
   int                    getAPSType() const                                               { return m_APSType;                             }
   void                   setAPSType(int type)                                             { m_APSType = type;                             }
-#endif
 
   void                   setAlfAPSParam(AlfSliceParam& alfAPSParam)                       { m_alfAPSParam = alfAPSParam;                  }
-#if JVET_N0415_CTB_ALF
   void                   setTemporalId(int i) { m_alfAPSParam.tLayer = i; }
   int                    getTemporalId() { return m_alfAPSParam.tLayer; }
   AlfSliceParam&         getAlfAPSParam()  { return m_alfAPSParam; }
-#else
-  const AlfSliceParam&   getAlfAPSParam() const { return m_alfAPSParam; }
-#endif
 
-#if JVET_N0805_APS_LMCS
   void                   setReshaperAPSInfo(SliceReshapeInfo& reshapeAPSInfo)             { m_reshapeAPSInfo = reshapeAPSInfo;            }
   SliceReshapeInfo&      getReshaperAPSInfo()                                             { return m_reshapeAPSInfo;                      }
-#endif
 };
 struct WPScalingParam
 {
@@ -2119,19 +1470,12 @@ private:
   int                        m_iLastIDR;
   int                        m_iAssociatedIRAP;
   NalUnitType                m_iAssociatedIRAPType;
-#if JVET_M0128
   const ReferencePictureList* m_pRPL0;                //< pointer to RPL for L0, either in the SPS or the local RPS in the same slice header
   const ReferencePictureList* m_pRPL1;                //< pointer to RPL for L1, either in the SPS or the local RPS in the same slice header
   ReferencePictureList        m_localRPL0;            //< RPL for L0 when present in slice header
   ReferencePictureList        m_localRPL1;            //< RPL for L1 when present in slice header
   int                         m_rpl0Idx;              //< index of used RPL in the SPS or -1 for local RPL in the slice header
   int                         m_rpl1Idx;              //< index of used RPL in the SPS or -1 for local RPL in the slice header
-#else
-  const ReferencePictureSet* m_pRPS;             //< pointer to RPS, either in the SPS or the local RPS in the same slice header
-  ReferencePictureSet        m_localRPS;             //< RPS when present in slice header
-  int                        m_rpsIdx;               //< index of used RPS in the SPS or -1 for local RPS in the slice header
-  RefPicListModification     m_RefPicListModification;
-#endif
   NalUnitType                m_eNalUnitType;         ///< Nal unit type for the slice
   SliceType                  m_eSliceType;
   int                        m_iSliceQp;
@@ -2146,9 +1490,7 @@ private:
   bool                       m_pendingRasInit;
 
   bool                       m_depQuantEnabledFlag;
-#if HEVC_USE_SIGN_HIDING
   bool                       m_signDataHidingEnabledFlag;
-#endif
   bool                       m_bCheckLDC;
 
   bool                       m_biDirPred;
@@ -2156,11 +1498,7 @@ private:
 
   //  Data
   int                        m_iSliceQpDelta;
-#if JVET_N0054_JOINT_CHROMA
   int                        m_iSliceChromaQpDelta[MAX_NUM_COMPONENT+1];
-#else
-  int                        m_iSliceChromaQpDelta[MAX_NUM_COMPONENT];
-#endif
   Picture*                   m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
   int                        m_aiRefPOCList  [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
   bool                       m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
@@ -2171,9 +1509,7 @@ private:
 #if HEVC_VPS
   const VPS*                 m_pcVPS;
 #endif
-#if JVET_N0349_DPS
   const DPS*                 m_dps;
-#endif
   const SPS*                 m_pcSPS;
   const PPS*                 m_pcPPS;
   Picture*                   m_pcPic;
@@ -2186,9 +1522,7 @@ private:
   uint32_t                       m_colRefIdx;
   uint32_t                       m_maxNumMergeCand;
   uint32_t                   m_maxNumAffineMergeCand;
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   uint32_t                   m_maxNumTriangleCand;
-#endif
   bool                       m_disFracMMVD;
   double                     m_lambdas[MAX_NUM_COMPONENT];
 
@@ -2205,12 +1539,10 @@ private:
   uint32_t                       m_sliceBits;
   bool                       m_bFinalized;
 
-#if JVET_N0857_RECT_SLICES
   uint32_t                   m_sliceCurStartBrickIdx;
   uint32_t                   m_sliceCurEndBrickIdx;
   uint32_t                   m_sliceNumBricks;
   uint32_t                   m_sliceIdx;
-#endif
 
   bool                       m_bTestWeightPred;
   bool                       m_bTestWeightBiPred;
@@ -2222,9 +1554,6 @@ private:
   bool                       m_cabacInitFlag;
 
   bool                       m_bLMvdL1Zero;
-#if !JVET_M0101_HLS
-  bool                       m_temporalLayerNonReferenceFlag;
-#endif
   bool                       m_LFCrossSliceBoundaryFlag;
 
   bool                       m_enableTMVPFlag;
@@ -2245,32 +1574,16 @@ private:
   uint32_t                   m_uiMaxTTSizeIChroma;
   uint32_t                   m_uiMaxBTSize;
 
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   APS*                       m_alfApss[MAX_NUM_APS];
-#else
-  APS*                       m_apss[MAX_NUM_APS];
-#endif
   bool                       m_tileGroupAlfEnabledFlag[MAX_NUM_COMPONENT];
   int                        m_tileGroupNumAps;
   std::vector<int>           m_tileGroupLumaApsId;
   int                        m_tileGroupChromaApsId;
-#else
-  int                        m_apsId;
-  APS*                       m_aps;
-  bool                       m_tileGroupAlfEnabledFlag;
-#endif
-#if JVET_N0329_IBC_SEARCH_IMP
   bool                       m_disableSATDForRd;
-#endif
-#if JVET_N0805_APS_LMCS
   int                        m_lmcsApsId;
   APS*                       m_lmcsAps;
   bool                       m_tileGroupLmcsEnabledFlag;
   bool                       m_tileGroupLmcsChromaResidualScaleFlag;
-#else
-  SliceReshapeInfo           m_sliceReshapeInfo;
-#endif
 public:
                               Slice();
   virtual                     ~Slice();
@@ -2280,10 +1593,8 @@ public:
   void                        setVPS( VPS* pcVPS )                                   { m_pcVPS = pcVPS;                                              }
   const VPS*                  getVPS() const                                         { return m_pcVPS;                                               }
 #endif
-#if JVET_N0349_DPS
   void                        setDPS( DPS* dps )                                     { m_dps = dps;                                              }
   const DPS*                  getDPS() const                                         { return m_dps;                                               }
-#endif
 
   void                        setSPS( const SPS* pcSPS )                             { m_pcSPS = pcSPS;                                              }
   const SPS*                  getSPS() const                                         { return m_pcSPS;                                               }
@@ -2293,21 +1604,8 @@ public:
 
   void                        setPPSId( int PPSId )                                  { m_iPPSId = PPSId;                                             }
   int                         getPPSId() const                                       { return m_iPPSId;                                              }
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   void                        setAlfAPSs(APS** apss)                                 { memcpy(m_alfApss, apss, sizeof(m_alfApss));                   }
   APS**                       getAlfAPSs()                                           { return m_alfApss;                                             }
-#else
-  void                        setAPSs(APS** apss) { memcpy(m_apss, apss, sizeof(m_apss)); }
-  APS**                       getAPSs() { return m_apss; }
-#endif
-#else
-  void                        setAPS(APS* aps)                                     { m_aps = aps; m_apsId = (aps) ? aps->getAPSId() : -1; }
-  APS*                        getAPS()                                               { return m_aps;                                               }
-  void                        setAPSId(int apsId)                                    { m_apsId = apsId;                                             }
-  int                         getAPSId() const                                       { return m_apsId;                                              }
-#endif
-#if JVET_N0805_APS_LMCS
   void                        setLmcsAPS(APS* lmcsAps)                               { m_lmcsAps = lmcsAps; m_lmcsApsId = (lmcsAps) ? lmcsAps->getAPSId() : -1; }
   APS*                        getLmcsAPS()                                           { return m_lmcsAps;                                            }
   void                        setLmcsAPSId(int lmcsApsId)                            { m_lmcsApsId = lmcsApsId;                                     }
@@ -2318,12 +1616,10 @@ public:
   void                        setLmcsChromaResidualScaleFlag(bool b)                 { m_tileGroupLmcsChromaResidualScaleFlag = b;                  }
   bool                        getLmcsChromaResidualScaleFlag()                       { return m_tileGroupLmcsChromaResidualScaleFlag;               }
   const bool                  getLmcsChromaResidualScaleFlag()                 const { return m_tileGroupLmcsChromaResidualScaleFlag;               }
-#endif
   void                        setPicOutputFlag( bool b   )                           { m_PicOutputFlag = b;                                          }
   bool                        getPicOutputFlag() const                               { return m_PicOutputFlag;                                       }
   void                        setSaoEnabledFlag(ChannelType chType, bool s)          {m_saoEnabledFlag[chType] =s;                                   }
   bool                        getSaoEnabledFlag(ChannelType chType) const            { return m_saoEnabledFlag[chType];                              }
-#if JVET_M0128
   void                        setRPL0(const ReferencePictureList *pcRPL)             { m_pRPL0 = pcRPL;                                             }
   void                        setRPL1(const ReferencePictureList *pcRPL)             { m_pRPL1 = pcRPL;                                             }
   const ReferencePictureList* getRPL0()                                              { return m_pRPL0;                                              }
@@ -2334,15 +1630,6 @@ public:
   void                        setRPL1idx(int rplIdx)                                 { m_rpl1Idx = rplIdx;                                          }
   int                         getRPL0idx() const                                     { return m_rpl0Idx;                                            }
   int                         getRPL1idx() const                                     { return m_rpl1Idx;                                            }
-#else
-  void                        setRPS( const ReferencePictureSet *pcRPS )             { m_pRPS = pcRPS;                                               }
-  const ReferencePictureSet*  getRPS()                                               { return m_pRPS;                                                }
-  ReferencePictureSet*        getLocalRPS()                                          { return &m_localRPS;                                           }
-
-  void                        setRPSidx( int rpsIdx )                                { m_rpsIdx = rpsIdx;                                            }
-  int                         getRPSidx() const                                      { return m_rpsIdx;                                              }
-  RefPicListModification*     getRefPicListModification()                            { return &m_RefPicListModification;                             }
-#endif
   void                        setLastIDR(int iIDRPOC)                                { m_iLastIDR = iIDRPOC;                                         }
   int                         getLastIDR() const                                     { return m_iLastIDR;                                            }
   void                        setAssociatedIRAPPOC(int iAssociatedIRAPPOC)           { m_iAssociatedIRAP = iAssociatedIRAPPOC;                       }
@@ -2376,35 +1663,15 @@ public:
   void                        setIsUsedAsLongTerm(int i, int j, bool value)          { m_bIsUsedAsLongTerm[i][j] = value;                            }
   bool                        getCheckLDC() const                                    { return m_bCheckLDC;                                           }
   bool                        getMvdL1ZeroFlag() const                               { return m_bLMvdL1Zero;                                         }
-#if !JVET_M0128
-  int                         getNumRpsCurrTempList() const;
-#endif
   int                         getList1IdxToList0Idx( int list1Idx ) const            { return m_list1IdxToList0Idx[list1Idx];                        }
-#if !JVET_M0101_HLS
-  bool                        isReferenceNalu() const                                { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); }
-#endif
   void                        setPOC( int i )                                        { m_iPOC              = i;                                      }
   void                        setNalUnitType( NalUnitType e )                        { m_eNalUnitType      = e;                                      }
   NalUnitType                 getNalUnitType() const                                 { return m_eNalUnitType;                                        }
   bool                        getRapPicFlag() const;
   bool                        getIdrPicFlag() const                                  { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
-#if JVET_N0067_NAL_Unit_Header
   bool                        isIRAP() const { return (getNalUnitType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA); }
   bool                        isIDRorBLA() const { return (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL) || (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP); }
-#else
-#if !JVET_M0101_HLS
-  bool                        isIRAP() const                                         { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23);  }
-  bool                        isIDRorBLA() const                                      { return (getNalUnitType() >= 16) && (getNalUnitType() <= 20);  }
-#else
-  bool                        isIRAP() const { return (getNalUnitType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL13); }
-  bool                        isIDRorBLA() const { return (getNalUnitType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP); }
-#endif
-#endif
-#if !JVET_M0128
-  void                        checkCRA(const ReferencePictureSet *pReferencePictureSet, int& pocCRA, NalUnitType& associatedIRAPType, PicList& rcListPic);
-#else
   void                        checkCRA(const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1, int& pocCRA, NalUnitType& associatedIRAPType, PicList& rcListPic);
-#endif
   void                        decodingRefreshMarking(int& pocCRA, bool& bRefreshPending, PicList& rcListPic, const bool bEfficientFieldIRAPEnabled);
   void                        setSliceType( SliceType e )                            { m_eSliceType        = e;                                      }
   void                        setSliceQp( int i )                                    { m_iSliceQp          = i;                                      }
@@ -2420,11 +1687,7 @@ public:
   void                        setPic( Picture* p )                                   { m_pcPic             = p;                                      }
   void                        setDepth( int iDepth )                                 { m_iDepth            = iDepth;                                 }
 
-#if JVET_M0128
   void                        constructRefPicList(PicList& rcListPic);
-#else
-  void                        setRefPicList( PicList& rcListPic, bool checkNumPocTotalCurr = false, bool bCopyL0toL1ErrorCase = false );
-#endif
   void                        setRefPOCList();
 
   void                        setColFromL0Flag( bool colFromL0 )                     { m_colFromL0Flag = colFromL0;                                  }
@@ -2465,10 +1728,8 @@ public:
 
   void                        setDepQuantEnabledFlag( bool b )                       { m_depQuantEnabledFlag = b; }
   bool                        getDepQuantEnabledFlag() const                         { return m_depQuantEnabledFlag; }
-#if HEVC_USE_SIGN_HIDING
   void                        setSignDataHidingEnabledFlag( bool b )                 { m_signDataHidingEnabledFlag = b;              }
   bool                        getSignDataHidingEnabledFlag() const                   { return m_signDataHidingEnabledFlag;           }
-#endif
 
   void                        initEqualRef();
   bool                        isEqualRef( RefPicList e, int iRefIdx1, int iRefIdx2 )
@@ -2497,30 +1758,17 @@ public:
   void                        setTLayer( uint32_t uiTLayer )                             { m_uiTLayer = uiTLayer;                                        }
 
   void                        checkLeadingPictureRestrictions( PicList& rcListPic )                                         const;
-#if JVET_M0128
   void                        applyReferencePictureListBasedMarking( PicList& rcListPic, const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1 )  const;
-#else
-  void                        applyReferencePictureSet( PicList& rcListPic, const ReferencePictureSet *RPSList)             const;
-#endif
   bool                        isTemporalLayerSwitchingPoint( PicList& rcListPic )                                           const;
   bool                        isStepwiseTemporalLayerSwitchingPointCandidate( PicList& rcListPic )                          const;
-#if JVET_M0128
   int                         checkThatAllRefPicsAreAvailable(PicList& rcListPic, const ReferencePictureList *pRPL, int rplIdx, bool printErrors)                const;
   void                        createExplicitReferencePictureSetFromReference(PicList& rcListPic, const ReferencePictureList *pRPL0, const ReferencePictureList *pRPL1);
-#else
-  int                         checkThatAllRefPicsAreAvailable( PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool printErrors, int pocRandomAccess = 0, bool bUseRecoveryPoint = false) const;
-  void                        createExplicitReferencePictureSetFromReference(PicList& rcListPic, const ReferencePictureSet *pReferencePictureSet, bool isRAP, int pocRandomAccess, bool bUseRecoveryPoint, const bool bEfficientFieldIRAPEnabled
-                              , bool isEncodeLtRef, bool isCompositeRefEnable
-  );
-#endif
   void                        setMaxNumMergeCand(uint32_t val )                          { m_maxNumMergeCand = val;                                      }
   uint32_t                    getMaxNumMergeCand() const                             { return m_maxNumMergeCand;                                     }
   void                        setMaxNumAffineMergeCand( uint32_t val )               { m_maxNumAffineMergeCand = val;  }
   uint32_t                    getMaxNumAffineMergeCand() const                       { return m_maxNumAffineMergeCand; }
-  #if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   void                        setMaxNumTriangleCand(uint32_t val)                    { m_maxNumTriangleCand = val;}
   uint32_t                    getMaxNumTriangleCand() const                          { return m_maxNumTriangleCand;}
-#endif
   void                        setDisFracMMVD( bool val )                             { m_disFracMMVD = val;                                          }
   bool                        getDisFracMMVD() const                                 { return m_disFracMMVD;                                         }
   void                        setNoOutputPriorPicsFlag( bool val )                   { m_noOutputPriorPicsFlag = val;                                }
@@ -2547,7 +1795,6 @@ public:
   uint32_t                        getSliceBits() const                                   { return m_sliceBits;                                           }
   void                        setFinalized( bool uiVal )                             { m_bFinalized = uiVal;                                         }
   bool                        getFinalized() const                                   { return m_bFinalized;                                          }
-#if JVET_N0857_RECT_SLICES
   void                        setSliceCurStartBrickIdx(uint32_t brickIdx)            { m_sliceCurStartBrickIdx = brickIdx;                           }
   uint32_t                    getSliceCurStartBrickIdx() const                       { return m_sliceCurStartBrickIdx;                               }
   void                        setSliceCurEndBrickIdx(uint32_t brickIdx)              { m_sliceCurEndBrickIdx = brickIdx;                             }
@@ -2556,7 +1803,6 @@ public:
   uint32_t                    getSliceNumBricks() const                              { return m_sliceNumBricks;                                      }
   void                        setSliceIndex(uint32_t idx)                            { m_sliceIdx = idx;                                             }
   uint32_t                    setSliceIndex() const                                  { return m_sliceIdx;                                            }
-#endif
   bool                        testWeightPred( ) const                                { return m_bTestWeightPred;                                     }
   void                        setTestWeightPred( bool bValue )                       { m_bTestWeightPred = bValue;                                   }
   bool                        testWeightBiPred( ) const                              { return m_bTestWeightBiPred;                                   }
@@ -2583,10 +1829,6 @@ public:
 
   void                        setCabacInitFlag( bool val )                           { m_cabacInitFlag = val;                                        } //!< set CABAC initial flag
   bool                        getCabacInitFlag()                               const { return m_cabacInitFlag;                                       } //!< get CABAC initial flag
-#if !JVET_M0101_HLS
-  bool                        getTemporalLayerNonReferenceFlag()               const { return m_temporalLayerNonReferenceFlag;                       }
-  void                        setTemporalLayerNonReferenceFlag(bool x)               { m_temporalLayerNonReferenceFlag = x;                          }
-#endif
   void                        setLFCrossSliceBoundaryFlag( bool   val )              { m_LFCrossSliceBoundaryFlag = val;                             }
   bool                        getLFCrossSliceBoundaryFlag()                    const { return m_LFCrossSliceBoundaryFlag;                            }
 
@@ -2610,7 +1852,6 @@ public:
   void resetProcessingTime()       { m_dProcessingTime = m_iProcessingStartTime = 0; }
   double getProcessingTime() const { return m_dProcessingTime; }
 
-#if JVET_N0415_CTB_ALF
   void                        resetTileGroupAlfEnabledFlag() { memset(m_tileGroupAlfEnabledFlag, 0, sizeof(m_tileGroupAlfEnabledFlag)); }
   bool                        getTileGroupAlfEnabledFlag(ComponentID compId) const { return m_tileGroupAlfEnabledFlag[compId]; }
   void                        setTileGroupAlfEnabledFlag(ComponentID compId, bool b) { m_tileGroupAlfEnabledFlag[compId] = b; }
@@ -2619,11 +1860,7 @@ public:
   int                         getTileGroupApsIdChroma() const { return m_tileGroupChromaApsId; }
   void                        setTileGroupApsIdChroma(int i) { m_tileGroupChromaApsId = i; }
   std::vector<int32_t>        getTileGroupApsIdLuma() const { return m_tileGroupLumaApsId; }
-#if JVET_N0805_APS_LMCS
   void                        setAlfAPSs(std::vector<int> ApsIDs)
-#else
-  void                        setAPSs(std::vector<int> ApsIDs)
-#endif
   {
     m_tileGroupLumaApsId.resize(m_tileGroupNumAps);
     for (int i = 0; i < m_tileGroupNumAps; i++)
@@ -2631,18 +1868,8 @@ public:
       m_tileGroupLumaApsId[i] = ApsIDs[i];
     }
   }
-#else
-  bool                        getTileGroupAlfEnabledFlag() const { return m_tileGroupAlfEnabledFlag; }
-  void                        setTileGroupAlfEnabledFlag(bool b) { m_tileGroupAlfEnabledFlag = b; }
-#endif
-#if JVET_N0329_IBC_SEARCH_IMP
   void                        setDisableSATDForRD(bool b) { m_disableSATDForRd = b; }
   bool                        getDisableSATDForRD() { return m_disableSATDForRd; }
-#endif
-#if !JVET_N0805_APS_LMCS
-  const SliceReshapeInfo&     getReshapeInfo() const { return m_sliceReshapeInfo; }
-        SliceReshapeInfo&     getReshapeInfo()       { return m_sliceReshapeInfo; }
-#endif
 protected:
   Picture*              xGetRefPic        (PicList& rcListPic, int poc);
   Picture*              xGetLongTermRefPic(PicList& rcListPic, int poc, bool pocHasMsb);
@@ -2663,14 +1890,9 @@ public:
 
   ParameterSetMap(int maxId)
   :m_maxId (maxId)
-#if !JVET_N0415_CTB_ALF
-  ,m_activePsId(-1)
-#endif
   ,m_lastActiveParameterSet(NULL)
   {
-#if JVET_N0415_CTB_ALF
     m_activePsId.clear();
-#endif
   }
 
   ~ParameterSetMap()
@@ -2696,12 +1918,10 @@ public:
     return m_paramsetMap[psId].parameterSet;
   }
 
-#if JVET_N0415_CTB_ALF
   void clearMap()
   {
     m_paramsetMap.clear();
   }
-#endif
 
   void storePS(int psId, T *ps, const std::vector<uint8_t> *pNaluData)
   {
@@ -2720,11 +1940,7 @@ public:
         return;
       }
 
-#if JVET_N0415_CTB_ALF
       if (find(m_activePsId.begin(), m_activePsId.end(), psId) != m_activePsId.end())
-#else
-      if( m_activePsId == psId )
-#endif
       {
         std::swap( m_paramsetMap[psId].parameterSet, m_lastActiveParameterSet );
       }
@@ -2792,21 +2008,13 @@ public:
     return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second.parameterSet;
   }
 
-#if JVET_N0415_CTB_ALF
   void setActive(int psId) { m_activePsId.push_back(psId); }
   void clear() { m_activePsId.clear(); }
-#else
-  void setActive(int psId ) { m_activePsId = psId;}
-#endif
 
 private:
   std::map<int,MapData<T> > m_paramsetMap;
   int                       m_maxId;
-#if JVET_N0415_CTB_ALF
   std::vector<int>          m_activePsId;
-#else
-  int                       m_activePsId;
-#endif
   T*                        m_lastActiveParameterSet;
   static void setID(T* parameterSet, const int psId);
 };
@@ -2827,14 +2035,12 @@ public:
   VPS*           getFirstVPS()                                               { return m_vpsMap.getFirstPS(); };
 #endif
 
-#if JVET_N0349_DPS
   void           storeDPS(DPS *dps, const std::vector<uint8_t> &naluData)    { m_dpsMap.storePS( dps->getDecodingParameterSetId(), dps, &naluData); };
   //! get pointer to existing video parameter set
   DPS*           getDPS(int dpsId)                                           { return m_dpsMap.getPS(dpsId); };
   bool           getDPSChangedFlag(int dpsId) const                          { return m_dpsMap.getChangedFlag(dpsId); }
   void           clearDPSChangedFlag(int dpsId)                              { m_dpsMap.clearChangedFlag(dpsId); }
   DPS*           getFirstDPS()                                               { return m_dpsMap.getFirstPS(); };
-#endif
   //! store sequence parameter set and take ownership of it
   void           storeSPS(SPS *sps, const std::vector<uint8_t> &naluData) { m_spsMap.storePS( sps->getSPSId(), sps, &naluData); };
   //! get pointer to existing sequence parameter set
@@ -2862,32 +2068,19 @@ public:
 #endif
   //! \returns true, if activation is successful
   bool           activatePPS(int ppsId, bool isIRAP);
-#if JVET_N0415_CTB_ALF
   APS**          getAPSs() { return &m_apss[0]; }
   ParameterSetMap<APS>* getApsMap() { return &m_apsMap; }
-#endif
-#if JVET_N0805_APS_LMCS
   void           storeAPS(APS *aps, const std::vector<uint8_t> &naluData)    { m_apsMap.storePS((aps->getAPSId() << NUM_APS_TYPE_LEN) + aps->getAPSType(), aps, &naluData); };
   APS*           getAPS(int apsId, int apsType)                              { return m_apsMap.getPS((apsId << NUM_APS_TYPE_LEN) + apsType); };
   bool           getAPSChangedFlag(int apsId, int apsType) const             { return m_apsMap.getChangedFlag((apsId << NUM_APS_TYPE_LEN) + apsType); }
   void           clearAPSChangedFlag(int apsId, int apsType)                 { m_apsMap.clearChangedFlag((apsId << NUM_APS_TYPE_LEN) + apsType); }
   APS*           getFirstAPS()                                               { return m_apsMap.getFirstPS(); };
   bool           activateAPS(int apsId, int apsType);
-#else
-  void           storeAPS(APS *aps, const std::vector<uint8_t> &naluData)    { m_apsMap.storePS(aps->getAPSId(), aps, &naluData); };
-  APS*           getAPS(int apsId)                                           { return m_apsMap.getPS(apsId);                      };
-  bool           getAPSChangedFlag(int apsId) const                          { return m_apsMap.getChangedFlag(apsId);             }
-  void           clearAPSChangedFlag(int apsId)                              { m_apsMap.clearChangedFlag(apsId);                  }
-  APS*           getFirstAPS()                                               { return m_apsMap.getFirstPS();                      };
-  bool           activateAPS(int apsId);
-#endif
 #if HEVC_VPS
   const VPS*     getActiveVPS()const                                         { return m_vpsMap.getPS(m_activeVPSId); };
 #endif
   const SPS*     getActiveSPS()const                                         { return m_spsMap.getPS(m_activeSPSId); };
-#if JVET_N0349_DPS
   const DPS*     getActiveDPS()const                                         { return m_dpsMap.getPS(m_activeDPSId); };
-#endif
 
 protected:
 #if HEVC_VPS
@@ -2896,20 +2089,14 @@ protected:
   ParameterSetMap<SPS> m_spsMap;
   ParameterSetMap<PPS> m_ppsMap;
   ParameterSetMap<APS> m_apsMap;
-#if JVET_N0349_DPS
   ParameterSetMap<DPS> m_dpsMap;
-#endif
 
-#if JVET_N0415_CTB_ALF
   APS* m_apss[MAX_NUM_APS];
-#endif
 
 #if HEVC_VPS
   int m_activeVPSId; // -1 for nothing active
 #endif
-#if JVET_N0349_DPS
   int m_activeDPSId; // -1 for nothing active
-#endif
   int m_activeSPSId; // -1 for nothing active
 };
 
@@ -2995,12 +2182,8 @@ public:
 };
 
 #if ENABLE_TRACING
-#if HEVC_VPS || JVET_N0278_HLS
 void xTraceVPSHeader();
-#endif
-#if JVET_N0349_DPS
 void xTraceDPSHeader();
-#endif
 void xTraceSPSHeader();
 void xTracePPSHeader();
 void xTraceAPSHeader();
diff --git a/source/Lib/CommonLib/TrQuant.cpp b/source/Lib/CommonLib/TrQuant.cpp
index c98194cb0..ef42ebeac 100644
--- a/source/Lib/CommonLib/TrQuant.cpp
+++ b/source/Lib/CommonLib/TrQuant.cpp
@@ -157,16 +157,9 @@ void TrQuant::init( const Quant* otherQuant,
   delete m_quant;
   m_quant = nullptr;
 
-#if !JVET_N0847_SCALING_LISTS
-  if( bUseRDOQ || !bEnc )
-#endif
   {
     m_quant = new DepQuant( otherQuant, bEnc );
   }
-#if !JVET_N0847_SCALING_LISTS
-  else
-    m_quant = new Quant( otherQuant );
-#endif
 
   if( m_quant )
   {
@@ -174,7 +167,6 @@ void TrQuant::init( const Quant* otherQuant,
   }
 }
 
-#if JVET_N0193_LFNST
 void TrQuant::fwdLfnstNxN( int* src, int* dst, const uint32_t mode, const uint32_t index, const uint32_t size, int zeroOutSize )
 {
   const int8_t* trMat  = ( size > 4 ) ? g_lfnst8x8[ mode ][ index ][ 0 ] : g_lfnst4x4[ mode ][ index ][ 0 ];
@@ -263,11 +255,7 @@ void TrQuant::xInvLfnst( const TransformUnit &tu, const ComponentID compID )
   if( lfnstIdx && tu.mtsIdx != MTS_SKIP && width >= 4 && height >= 4 )
   {
     const bool whge3 = width >= 8 && height >= 8;
-#if JVET_N0103_CGSIZE_HARMONIZATION
     const ScanElement * scan = whge3 ? g_coefTopLeftDiagScan8x8[ gp_sizeIdxInfo->idxFrom( width ) ] : g_scanOrder[ SCAN_GROUPED_4x4 ][ SCAN_DIAG ][ gp_sizeIdxInfo->idxFrom( width ) ][ gp_sizeIdxInfo->idxFrom( height ) ];
-#else
-    const ScanElement * scan = whge3 ? g_coefTopLeftDiagScan8x8[ gp_sizeIdxInfo->idxFrom( width ) ] : g_scanOrder[ toChannelType( compID ) ][ SCAN_GROUPED_4x4 ][ SCAN_DIAG ][ gp_sizeIdxInfo->idxFrom( width ) ][ gp_sizeIdxInfo->idxFrom( height ) ];
-#endif
     uint32_t intraMode = PU::getFinalIntraMode( *tu.cs->getPU( area.pos(), toChannelType( compID ) ), toChannelType( compID ) );
 
     if( PU::isLMCMode( tu.cs->getPU( area.pos(), toChannelType( compID ) )->intraDir[ toChannelType( compID ) ] ) )
@@ -367,11 +355,7 @@ void TrQuant::xFwdLfnst( const TransformUnit &tu, const ComponentID compID, cons
   if( lfnstIdx && tu.mtsIdx != MTS_SKIP && width >= 4 && height >= 4 )
   {
     const bool whge3 = width >= 8 && height >= 8;
-#if JVET_N0103_CGSIZE_HARMONIZATION
     const ScanElement * scan = whge3 ? g_coefTopLeftDiagScan8x8[ gp_sizeIdxInfo->idxFrom( width ) ] : g_scanOrder[ SCAN_GROUPED_4x4 ][ SCAN_DIAG ][ gp_sizeIdxInfo->idxFrom( width ) ][ gp_sizeIdxInfo->idxFrom( height ) ];
-#else
-    const ScanElement * scan = whge3 ? g_coefTopLeftDiagScan8x8[ gp_sizeIdxInfo->idxFrom( width ) ] : g_scanOrder[ toChannelType( compID ) ][ SCAN_GROUPED_4x4 ][ SCAN_DIAG ][ gp_sizeIdxInfo->idxFrom( width ) ][ gp_sizeIdxInfo->idxFrom( height ) ];
-#endif
     uint32_t intraMode = PU::getFinalIntraMode( *tu.cs->getPU( area.pos(), toChannelType( compID ) ), toChannelType( compID ) );
 
     if( PU::isLMCMode( tu.cs->getPU( area.pos(), toChannelType( compID ) )->intraDir[ toChannelType( compID ) ] ) )
@@ -460,7 +444,6 @@ void TrQuant::xFwdLfnst( const TransformUnit &tu, const ComponentID compID, cons
     }
   }
 }
-#endif
 
 
 void TrQuant::invTransformNxN( TransformUnit &tu, const ComponentID &compID, PelBuf &pResi, const QpParam &cQP )
@@ -495,12 +478,10 @@ void TrQuant::invTransformNxN( TransformUnit &tu, const ComponentID &compID, Pel
 
     DTRACE_COEFF_BUF( D_TCOEFF, tempCoeff, tu, tu.cu->predMode, compID );
 
-#if JVET_N0193_LFNST
     if( tu.cs->sps->getUseLFNST() )
     {
       xInvLfnst( tu, compID );
     }
-#endif
 
     if( isLuma(compID) && tu.mtsIdx == MTS_SKIP )
     {
@@ -579,26 +560,16 @@ void TrQuant::invRdpcmNxN(TransformUnit& tu, const ComponentID &compID, PelBuf &
 // Logical transform
 // ------------------------------------------------------------------------------------------------
 
-#if JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
 void TrQuant::getTrTypes(const TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer)
-#else
-void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer )
-#endif
 {
-#if JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
   const bool isExplicitMTS = (CU::isIntra(*tu.cu) ? tu.cs->sps->getUseIntraMTS() : tu.cs->sps->getUseInterMTS() && CU::isInter(*tu.cu)) && isLuma(compID);
   const bool isImplicitMTS = CU::isIntra(*tu.cu) && tu.cs->sps->getUseImplicitMTS() && isLuma(compID);
   const bool isISP = CU::isIntra(*tu.cu) && tu.cu->ispMode && isLuma(compID);
   const bool isSBT = CU::isInter(*tu.cu) && tu.cu->sbtInfo && isLuma(compID);
-#else
-  bool mtsActivated = CU::isIntra( *tu.cu ) ? tu.cs->sps->getUseIntraMTS() : tu.cs->sps->getUseInterMTS() && CU::isInter( *tu.cu );
-  bool mtsImplicit  = CU::isIntra( *tu.cu ) && tu.cs->sps->getUseImplicitMTS() && compID == COMPONENT_Y;
-#endif
 
   trTypeHor = DCT2;
   trTypeVer = DCT2;
 
-#if JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
   if (isImplicitMTS || isISP)
   {
     int  width = tu.blocks[compID].width;
@@ -612,21 +583,9 @@ void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTy
       trTypeVer = DST7;
     return;
   }
-#endif
 
-#if !JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
-  if (tu.cu->ispMode && isLuma(compID))
-  {
-    TU::getTransformTypeISP(tu, compID, trTypeHor, trTypeVer);
-    return;
-  }
-#endif
 
-#if JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
   if (isSBT)
-#else
-  if( tu.cu->sbtInfo && compID == COMPONENT_Y )
-#endif
   {
     uint8_t sbtIdx = tu.cu->getSbtIdx();
     uint8_t sbtPos = tu.cu->getSbtPos();
@@ -660,7 +619,6 @@ void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTy
     return;
   }
 
-#if JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
   if (isExplicitMTS)
   {
     if (tu.mtsIdx > MTS_SKIP)
@@ -672,36 +630,6 @@ void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTy
       trTypeVer = indVer ? DCT8 : DST7;
     }
   }
-#else
-  if ( mtsActivated )
-  {
-    if( compID == COMPONENT_Y )
-    {
-      if ( tu.mtsIdx > MTS_SKIP )
-      {
-        int indHor = ( tu.mtsIdx - MTS_DST7_DST7 ) &  1;
-        int indVer = ( tu.mtsIdx - MTS_DST7_DST7 ) >> 1;
-
-        trTypeHor = indHor ? DCT8 : DST7;
-        trTypeVer = indVer ? DCT8 : DST7;
-      }
-    }
-  }
-  else if ( mtsImplicit )
-  {
-    int  width       = tu.blocks[compID].width;
-    int  height      = tu.blocks[compID].height;
-    bool widthDstOk  = width  >= 4 && width  <= 16;
-    bool heightDstOk = height >= 4 && height <= 16;
-
-    if ( width < height && widthDstOk )
-      trTypeHor = DST7;
-    else if ( height < width && heightDstOk )
-      trTypeVer = DST7;
-    else if ( width == height && widthDstOk )
-      trTypeHor = trTypeVer = DST7;
-  }
-#endif
 }
 
 
@@ -959,9 +887,7 @@ void TrQuant::transformNxN( TransformUnit &tu, const ComponentID &compID, const
 void TrQuant::transformNxN( TransformUnit &tu, const ComponentID &compID, const QpParam &cQP, TCoeff &uiAbsSum, const Ctx &ctx, const bool loadTr, double* diagRatio, double* horVerRatio )
 {
         CodingStructure &cs = *tu.cs;
-#if JVET_N0193_LFNST
   const SPS &sps            = *cs.sps;
-#endif
   const CompArea &rect      = tu.blocks[compID];
   const uint32_t uiWidth        = rect.width;
   const uint32_t uiHeight       = rect.height;
@@ -979,12 +905,10 @@ void TrQuant::transformNxN( TransformUnit &tu, const ComponentID &compID, const
   RDPCMMode rdpcmMode = RDPCM_OFF;
   rdpcmNxN(tu, compID, cQP, uiAbsSum, rdpcmMode);
 
-#if JVET_N0413_RDPCM
   if( tu.cu->bdpcmMode && isLuma(compID) )
   {
     tu.mtsIdx = MTS_SKIP;
   }
-#endif
 
   if (rdpcmMode == RDPCM_OFF)
   {
@@ -1048,12 +972,10 @@ void TrQuant::transformNxN( TransformUnit &tu, const ComponentID &compID, const
         xGetCoeffEnergy( tu, compID, tempCoeff, diagRatio, horVerRatio );
       }
 
-#if JVET_N0193_LFNST
       if( sps.getUseLFNST() )
       {
         xFwdLfnst( tu, compID, loadTr );
       }
-#endif
 
       DTRACE_COEFF_BUF( D_TCOEFF, tempCoeff, tu, tu.cu->predMode, compID );
 
diff --git a/source/Lib/CommonLib/TrQuant.h b/source/Lib/CommonLib/TrQuant.h
index f416f3bfd..b6334ecaf 100644
--- a/source/Lib/CommonLib/TrQuant.h
+++ b/source/Lib/CommonLib/TrQuant.h
@@ -47,9 +47,7 @@
 #include "UnitPartitioner.h"
 #include "Quant.h"
 
-#if JVET_N0847_SCALING_LISTS
 #include "DepQuant.h"
-#endif
 //! \ingroup CommonLib
 //! \{
 
@@ -80,26 +78,18 @@ public:
                     const bool bEnc                 = false,
                     const bool useTransformSkipFast = false
   );
-#if JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
   void getTrTypes(const TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer);
-#else
-  void getTrTypes( TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer );
-#endif
 
-#if JVET_N0193_LFNST
   void fwdLfnstNxN( int* src, int* dst, const uint32_t mode, const uint32_t index, const uint32_t size, int zeroOutSize );
   void invLfnstNxN( int* src, int* dst, const uint32_t mode, const uint32_t index, const uint32_t size, int zeroOutSize );
 
   uint32_t getLFNSTIntraMode( int wideAngPredMode );
   bool     getTransposeFlag ( uint32_t intraMode  );
-#endif
 
 protected:
 
-#if JVET_N0193_LFNST
   void xFwdLfnst( const TransformUnit &tu, const ComponentID compID, const bool loadTr = false );
   void xInvLfnst( const TransformUnit &tu, const ComponentID compID );
-#endif
 
 public:
 
@@ -122,11 +112,7 @@ public:
   void   setLambda   ( const double dLambda )                      { m_quant->setLambda( dLambda ); }
   double getLambda   () const                                      { return m_quant->getLambda(); }
 
-#if JVET_N0847_SCALING_LISTS  //maybe no need
   DepQuant* getQuant() { return m_quant; }
-#else
-  Quant* getQuant() { return m_quant;  }
-#endif
 
 
 #if ENABLE_SPLIT_PARALLELISM
@@ -142,16 +128,10 @@ protected:
   bool     m_scalingListEnabledFlag;
 
 private:
-#if JVET_N0847_SCALING_LISTS
 	DepQuant *m_quant;          //!< Quantizer
-#else
-  Quant    *m_quant;          //!< Quantizer
-#endif
   TCoeff** m_mtsCoeffs;
-#if JVET_N0193_LFNST
   TCoeff   m_tempInMatrix [ 48 ];
   TCoeff   m_tempOutMatrix[ 48 ];
-#endif
 
 
   // forward Transform
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 1d7079279..6de4c6214 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -50,169 +50,81 @@
 #include <assert.h>
 #include <cassert>
 
-#define JVET_N0047_Merge_IDR_Non_IDR                      1 // merging IDR and non-IDR pictures
 
-#define JVET_N0276_CONSTRAINT_FLAGS                       1 // JVET-N0276: On interoperability point signalling
 
-#define JVET_N0278_HLS                                    1 // JVET-N0278: HLS for MPEG requirements on immersive media delivery and access
 
-#define JVET_N0805_APS_LMCS                               1 // JVET-N0805: Reference to APS from slice header for LMCS
 
-#define JVET_N0070_WRAPAROUND                             1 // reference wraparound simplifications
 
-#define JVET_N0063_VUI                                    1 // JVET-N0063: Video Usability Information
 
-#define JVET_N0847_SCALING_LISTS                          1  //1: default mode, 2: user defined mode
 
-#if JVET_N0847_SCALING_LISTS
-#define HEVC_USE_SCALING_LISTS                            1 
-#endif
 
-#define JVET_N0415_CTB_ALF                                1 // JVET-N0415: CTB-based ALF switch
 
-#define JVET_N0105_LFNST_CTX_MODELLING                    1 // LFNST index signalled without intra mode dependency and with on ctx-coded bin
 
-#define JVET_N0193_LFNST                                  1 //Low Frequency Non-Separable Transform (LFNST), previously, Reduced Secondary Transform (RST)
 
-#define JVET_N0217_MATRIX_INTRAPRED                       1 // matrix-based intra prediction (MIP)
 
-#define JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM               1 // JVET-N0400, JVET-N0447, JVET-N0500, JVET-N0851, align triangle merge candidate number and regular merge candidate number
 
-#define JVET_N0413_RDPCM                                  1 // Residual DPCM JVET-N0413/N0214
 
-#define JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP             1 // JVET-N0866: unified transform derivation for ISP and implicit MTS (combining JVET-N0172, JVET-N0375, JVET-N0419 and JVET-N0420)
 
-#define JVET_N0340_TRI_MERGE_CAND                         1
 
-#define JVET_N0302_SIMPLFIED_CIIP                         1
-#define JVET_N0327_MERGE_BIT_CALC_FIX                     1
 
-#define JVET_N0324_REGULAR_MRG_FLAG                       1
 
-#define JVET_N0251_ITEM4_IBC_LOCAL_SEARCH_RANGE           1
 
-#define JVET_N0435_WAIP_HARMONIZATION                     1
 
-#define JVET_N0168_AMVR_ME_MODIFICATION                   1 // Correct the cost and bits calculation in encoder side
 
-#define JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND  1 // loop filter disabled across virtual boundaries
 
-#define JVET_N0067_NAL_Unit_Header                        1 // NAL Unit Header 
 
-#define JVET_N0349_DPS                                    1 // Decoding Parameter Set
 
-#define JVET_N0068_AFFINE_MEM_BW                          1 // memory bandwidth reduction for affine mode
 
-#define JVET_N0308_MAX_CU_SIZE_FOR_ISP                    1
 
-#define JVET_N0857_TILES_BRICKS                           1 // VTM-5 basic Slices/Tiles/Bricks design, rectangular slices not supported yet
-#define JVET_N0857_RECT_SLICES                            1 // Support for rectangular slices and raster-scan slices (i.e., multiple tiles/brick in a slice)
 
-#if JVET_N0857_TILES_BRICKS
-#define JVET_N0124_PROPOSAL1                              1   // JVET-N0124 Proposal 1
-#define JVET_N0124_PROPOSAL2                              1   // JVET-N0124 Proposal 2
-#endif
 
-#define JVET_N0280_RESIDUAL_CODING_TS                     1
 
-#define JVET_N0103_CGSIZE_HARMONIZATION                   1 // Chroma CG sizes aligned to luma CG sizes
 
 
 
 
-#define JVET_N0146_DMVR_BDOF_CONDITION                    1 // JVET-N146/N0162/N0442/N0153/N0262/N0440/N0086 applicable condition of DMVR and BDOF
 
-#define JVET_N0470_SMVD_FIX                               1 // remove mvd_l1_zero_flag condition, align to spec text.
 
-#define JVET_N0235_SMVD_SPS                               1
 
-#define JVET_N0671                                        1
 
-#if JVET_N0671
-#define JVET_N0671_CHROMA_FORMAT_422                      1
-#define JVET_N0671_RGB                                    1
 
-#define JVET_N0671_CCLM                                   1
-#define JVET_N0671_AFFINE                                 1
-#define JVET_N0671_DMVR                                   1
 
-#define JVET_N0671_RDCOST_FIX                             1
-#define JVET_N0671_INTRA_TPM_ALIGNWITH420                 1
 
-#endif //JVET_N0671
 
-#define JVET_N0843_BVP_SIMPLIFICATION                     1
 
-#define JVET_N0448_N0380                                  1 // When MaxNumMergeCand is 1, MMVD_BASE_MV_NUM is inferred to be 1.
 
-#define JVET_N0266_SMALL_BLOCKS                           1 // remove 4x4 uni-pred, 4x8/8x4 bi-pred from regular inter modes
 
-#define JVET_N0054_JOINT_CHROMA                           1 // Joint chroma residual coding mode
 
-#define JVET_N0317_ADD_ZERO_BV                            1
 
-#define JVET_N0318_N0467_IBC_SIZE                         1 // IBC flag dependent on CU size and disabling 128x128 IBC mode
 
-#define JVET_N0462_FIX_CTX_MODELING                       1 // Fix context modeling of inter_pred_idc
 
-#define JVET_N0175_N0251_N0384_IBC_SMALL_CTU              1 // IBC search range arrangement for small CTU sizes
 
-#define JVET_N0127_MMVD_SPS_FLAG                          1
 
-#define JVET_N0286_SIMPLIFIED_GBI_IDX                     1 // Simplified coding of the GBi index
 
-#define JVET_N600_AMVR_TPM_CTX_REDUCTION                  1
 
-#define JVET_N0188_UNIFY_RICEPARA                         1
 
-#define JVET_N0334_MVCLIPPING                             1 // prevention of MV stroage overflow and alignment with spec of MV/CPMV modular for AMVP mode
 
-#define JVET_N0481_BCW_CONSTRUCTED_AFFINE                 1
 
-#define JVET_N0483_DISABLE_SBT_FOR_TPM                    1
 
-#define JVET_N0180_ALF_LINE_BUFFER_REDUCTION              1 // Line buffer reduction for ALF using symmetric padding
 
-#define JVET_N0242_NON_LINEAR_ALF                         1 // enable CE5-3.2, Non-linear ALF based on clipping function
 
-#define JVET_N0329_IBC_SEARCH_IMP                         1 // IBC encoder-side improvement
 
-#define JVET_N0325_BDOF                                   1  // unified right-shifts for BDOF derivation
 
-#define JVET_N0247_HASH_IMPROVE                           1  // Improve hash motion estimation
 
-#define JVET_N0449_MMVD_SIMP                              1 // Configurable number of mmvd distance entries used
 
-#define JVET_N0363_INTRA_COST_MOD                         1 // Modified cost criterion for intra encoder search
 
-#define JVET_N0137_DUALTREE_CHROMA_SIZE                   1
 
-#define JVET_N0335_N0085_MV_ROUNDING                      1  // MV rounding unification
 
-#define JVET_N0332_LTRP_MMVD_FIX                          1 // MMVD scaling considering LTRPs from N0332
 
-#define JVET_N0477_LMCS_CLEANUP                           1
-#define JVET_N0220_LMCS_SIMPLIFICATION                    1
-#define JVET_N0185_UNIFIED_MPM                            1
 
-#define JVET_N0271_SIMPLFIED_CCLM                         1 // Simplified CCLM parameter derivation in JVET-N0271
 
-#define JVET_N0178_IMPLICIT_BDOF_SPLIT                    1
-#define JVET_N0383_N0251_IBC_COL_VPDU_REMOVE              1
 
-#define JVET_N0407_DMVR_CU_SIZE_RESTRICTION               1 // Disable 4xN/8x8 CUs for DMVR
 
-#define JVET_N0196_SIX_TAP_FILTERS                        1 // 6-tap filters for affine motion compensation
 
-#define JVET_N0213_TMVP_REMOVAL                           1 // Remove TMVP candidates from merge and amvp mode with samples <= 32
 
-#define JVET_N0492_NO_HIERARCH_CBF                        1 // Allow CBFs writing for leaf TU only
 
-#define JVET_N0473_DEBLOCK_INTERNAL_TRANSFORM_BOUNDARIES  1 // JVET-N0473, JVET-N0098: Deblocking of ISP/SBT TU boundaries
 
-#define JVET_N0150_ONE_CTU_DELAY_WPP                      1 // one CTU delay WPP
 
-#define JCTVC_Y0038_PARAMS                                1
 
 #define FIX_DB_MAX_TRANSFORM_SIZE                         1
 
@@ -220,7 +132,6 @@
 
 #define JVET_M0497_MATRIX_MULT                            0 // 0: Fast method; 1: Matrix multiplication
 
-#define JVET_M0128                                        1 // Implementation of RPL as in JVET-M0128
 
 #define APPLY_SBT_SL_ON_MTS                               1 // apply save & load fast algorithm on inter MTS when SBT is on
 #define FIX_PCM                                           1 // Fix PCM bugs in VTM3
@@ -243,17 +154,10 @@ typedef std::pair<int, int>  TrCost;
 #endif
 // clang-format on
 
-#ifndef JVET_B0051_NON_MPM_MODE
-#define JVET_B0051_NON_MPM_MODE                         ( 1 && JEM_TOOLS )
-#endif
-#ifndef QTBT_AS_IN_JEM
-#define QTBT_AS_IN_JEM                                    1
-#endif
 #ifndef HEVC_TOOLS
 #define HEVC_TOOLS                                        0
 #endif
 
-#define JVET_N0246_MODIFIED_QUANTSCALES                   1
 
 #ifndef JVET_J0090_MEMORY_BANDWITH_MEASURE
 #define JVET_J0090_MEMORY_BANDWITH_MEASURE                0
@@ -305,35 +209,17 @@ typedef std::pair<int, int>  TrCost;
 #define WCG_WPSNR                                         WCG_EXT
 
 #if HEVC_TOOLS
-#define HEVC_USE_INTRA_SMOOTHING_T32                      1
-#define HEVC_USE_INTRA_SMOOTHING_T64                      1
-#define HEVC_USE_MDCS                                     1
-#define HEVC_USE_SIGN_HIDING                              1
-#define HEVC_USE_SCALING_LISTS                            1
 #define HEVC_VPS                                          1
 #else
-#define HEVC_USE_SIGN_HIDING                              1
 #endif
 
 
-#define JVET_M0101_HLS                                    1  // joint HLS syntax
 
 #define KEEP_PRED_AND_RESI_SIGNALS                        0
 
 
-#if QTBT_AS_IN_JEM // macros which will cause changes in the decoder behavior ara marked with *** - keep them on to retain compatibility with JEM-toolcheck
-#define HM_QTBT_AS_IN_JEM                                 1   // ***
-#if     HM_QTBT_AS_IN_JEM
-#define HM_QTBT_AS_IN_JEM_QUANT                           1   // ***
-#define HM_QTBT_REPRODUCE_FAST_LCTU_BUG                   1
-#endif
-#define HM_CODED_CU_INFO                                  1   // like in JEM, when related CU is skipped, it stays like this even if a non skip mode wins...
-#define HM_4TAPIF_AS_IN_JEM                               1   // *** - PM: condition not well suited for 4-tap interpolation filters
-#define HM_JEM_CLIP_PEL                                   1   // ***
-#define HM_JEM_MERGE_CANDS                                0   // ***
 
 
-#endif//JEM_COMP
 
 // ====================================================================================================================
 // Debugging
@@ -471,13 +357,11 @@ typedef       uint64_t        Distortion;        ///< distortion measurement
 // ====================================================================================================================
 // Enumeration
 // ====================================================================================================================
-#if JVET_N0805_APS_LMCS
 enum ApsTypeValues
 {
   ALF_APS = 0,
   LMCS_APS = 1,
 };
-#endif
 
 enum QuantFlags
 {
@@ -597,9 +481,7 @@ enum ComponentID
   COMPONENT_Cb        = 1,
   COMPONENT_Cr        = 2,
   MAX_NUM_COMPONENT   = 3,
-#if JVET_N0054_JOINT_CHROMA
   JOINT_CbCr          = MAX_NUM_COMPONENT,
-#endif
   MAX_NUM_TBLOCKS     = MAX_NUM_COMPONENT
 };
 
@@ -768,10 +650,6 @@ enum MESearchMethod
 enum CoeffScanType
 {
   SCAN_DIAG = 0,        ///< up-right diagonal scan
-#if HEVC_USE_MDCS
-  SCAN_HOR  = 1,        ///< horizontal first scan
-  SCAN_VER  = 2,        ///< vertical first scan
-#endif
   SCAN_NUMBER_OF_TYPES
 };
 
@@ -782,7 +660,6 @@ enum CoeffScanGroupType
   SCAN_NUMBER_OF_GROUP_TYPES = 2
 };
 
-#if HEVC_USE_SCALING_LISTS
 enum ScalingListMode
 {
   SCALING_LIST_OFF,
@@ -792,12 +669,8 @@ enum ScalingListMode
 
 enum ScalingListSize
 {
-#if JVET_N0847_SCALING_LISTS
   SCALING_LIST_1x1 = 0,
   SCALING_LIST_2x2,
-#else
-  SCALING_LIST_2x2 = 0,
-#endif
   SCALING_LIST_4x4,
   SCALING_LIST_8x8,
   SCALING_LIST_16x16,
@@ -805,16 +678,10 @@ enum ScalingListSize
   SCALING_LIST_64x64,
   SCALING_LIST_128x128,
   SCALING_LIST_SIZE_NUM,
-#if JVET_N0847_SCALING_LISTS
   //for user define matrix
   SCALING_LIST_FIRST_CODED = SCALING_LIST_2x2,
   SCALING_LIST_LAST_CODED = SCALING_LIST_64x64
-#else
-  SCALING_LIST_FIRST_CODED = SCALING_LIST_4x4, // smallest scaling coded as High Level Parameter
-  SCALING_LIST_LAST_CODED  = SCALING_LIST_32x32
-#endif
 };
-#endif
 
 // Slice / Slice segment encoding modes
 enum SliceConstraint
@@ -823,12 +690,8 @@ enum SliceConstraint
   FIXED_NUMBER_OF_CTU    = 1,          ///< Limit maximum number of largest coding tree units in a slice / slice segments
   FIXED_NUMBER_OF_BYTES  = 2,          ///< Limit maximum number of bytes in a slice / slice segment
   FIXED_NUMBER_OF_TILES  = 3,          ///< slices / slice segments span an integer number of tiles
-#if !JVET_N0857_TILES_BRICKS
-  NUMBER_OF_SLICE_CONSTRAINT_MODES = 4
-#else
   SINGLE_BRICK_PER_SLICE = 4,          ///< each brick is coded as separate NAL unit (slice)
   NUMBER_OF_SLICE_CONSTRAINT_MODES = 5
-#endif
 };
 
 // For use with decoded picture hash SEI messages, generated by encoder.
@@ -975,7 +838,6 @@ enum PPSExtensionFlagIndex
 //       effort can be done without use of macros to alter the names used to indicate the different NAL unit types.
 enum NalUnitType
 {
- #if JVET_N0067_NAL_Unit_Header
   NAL_UNIT_PPS = 0,                     // 0 
   NAL_UNIT_ACCESS_UNIT_DELIMITER,       // 1
   NAL_UNIT_PREFIX_SEI,                  // 2
@@ -1009,137 +871,6 @@ enum NalUnitType
   NAL_UNIT_UNSPECIFIED_30,              // 31
   NAL_UNIT_UNSPECIFIED_31,              // 32
   NAL_UNIT_INVALID
-#else
-#if JVET_M0101_HLS
-  NAL_UNIT_CODED_SLICE_TRAIL = 0, // 0
-  NAL_UNIT_CODED_SLICE_STSA,      // 1
-
-  //KJS: keep RADL/RASL since there is no real decision on these types yet
-  NAL_UNIT_CODED_SLICE_RADL,      // 2   should be NAL_UNIT_RESERVED_VCL_2,
-  NAL_UNIT_CODED_SLICE_RASL,      // 3   should be NAL_UNIT_RESERVED_VCL_3,
-
-  NAL_UNIT_RESERVED_VCL_4,
-  NAL_UNIT_RESERVED_VCL_5,
-  NAL_UNIT_RESERVED_VCL_6,
-  NAL_UNIT_RESERVED_VCL_7,
-
-  NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 8
-  NAL_UNIT_CODED_SLICE_IDR_N_LP,    // 9
-  NAL_UNIT_CODED_SLICE_CRA,         // 10
-
-  NAL_UNIT_RESERVED_IRAP_VCL11,
-  NAL_UNIT_RESERVED_IRAP_VCL12,
-  NAL_UNIT_RESERVED_IRAP_VCL13,
-
-  NAL_UNIT_RESERVED_VCL14,
-
-#if HEVC_VPS
-  NAL_UNIT_VPS,                     // probably not coming back
-#else
-  NAL_UNIT_RESERVED_VCL15,
-#endif
-
-  NAL_UNIT_RESERVED_NVCL16,         // probably DPS
-
-  NAL_UNIT_SPS,                     // 17
-  NAL_UNIT_PPS,                     // 18
-  NAL_UNIT_APS,                     // 19 NAL unit type number needs to be reaaranged.
-  NAL_UNIT_ACCESS_UNIT_DELIMITER,   // 20
-  NAL_UNIT_EOS,                     // 21
-  NAL_UNIT_EOB,                     // 22
-  NAL_UNIT_PREFIX_SEI,              // 23
-  NAL_UNIT_SUFFIX_SEI,              // 24
-  NAL_UNIT_FILLER_DATA,             // 25  keep: may be added with HRD
-
-  NAL_UNIT_RESERVED_NVCL26,
-  NAL_UNIT_RESERVED_NVCL27,
-  NAL_UNIT_UNSPECIFIED_28,
-  NAL_UNIT_UNSPECIFIED_29,
-  NAL_UNIT_UNSPECIFIED_30,
-  NAL_UNIT_UNSPECIFIED_31,
-  NAL_UNIT_INVALID,
-#else
-  NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 0
-  NAL_UNIT_CODED_SLICE_TRAIL_R,     // 1
-
-  NAL_UNIT_CODED_SLICE_TSA_N,       // 2
-  NAL_UNIT_CODED_SLICE_TSA_R,       // 3
-
-  NAL_UNIT_CODED_SLICE_STSA_N,      // 4
-  NAL_UNIT_CODED_SLICE_STSA_R,      // 5
-
-  NAL_UNIT_CODED_SLICE_RADL_N,      // 6
-  NAL_UNIT_CODED_SLICE_RADL_R,      // 7
-
-  NAL_UNIT_CODED_SLICE_RASL_N,      // 8
-  NAL_UNIT_CODED_SLICE_RASL_R,      // 9
-
-  NAL_UNIT_RESERVED_VCL_N10,
-  NAL_UNIT_RESERVED_VCL_R11,
-  NAL_UNIT_RESERVED_VCL_N12,
-  NAL_UNIT_RESERVED_VCL_R13,
-  NAL_UNIT_RESERVED_VCL_N14,
-  NAL_UNIT_RESERVED_VCL_R15,
-
-  NAL_UNIT_CODED_SLICE_BLA_W_LP,    // 16
-  NAL_UNIT_CODED_SLICE_BLA_W_RADL,  // 17
-  NAL_UNIT_CODED_SLICE_BLA_N_LP,    // 18
-  NAL_UNIT_CODED_SLICE_IDR_W_RADL,  // 19
-  NAL_UNIT_CODED_SLICE_IDR_N_LP,    // 20
-  NAL_UNIT_CODED_SLICE_CRA,         // 21
-  NAL_UNIT_RESERVED_IRAP_VCL22,
-  NAL_UNIT_RESERVED_IRAP_VCL23,
-
-  NAL_UNIT_RESERVED_VCL24,
-  NAL_UNIT_RESERVED_VCL25,
-  NAL_UNIT_RESERVED_VCL26,
-  NAL_UNIT_RESERVED_VCL27,
-  NAL_UNIT_RESERVED_VCL28,
-  NAL_UNIT_RESERVED_VCL29,
-  NAL_UNIT_RESERVED_VCL30,
-  NAL_UNIT_RESERVED_VCL31,
-
-#if HEVC_VPS || JVET_N0278_HLS
-  NAL_UNIT_VPS,                     // 32
-#else
-  NAL_UNIT_RESERVED_32,
-#endif
-  NAL_UNIT_SPS,                     // 33
-  NAL_UNIT_PPS,                     // 34
-  NAL_UNIT_APS,                     //NAL unit type number needs to be reaaranged.
-  NAL_UNIT_ACCESS_UNIT_DELIMITER,   // 35
-  NAL_UNIT_EOS,                     // 36
-  NAL_UNIT_EOB,                     // 37
-  NAL_UNIT_FILLER_DATA,             // 38
-  NAL_UNIT_PREFIX_SEI,              // 39
-  NAL_UNIT_SUFFIX_SEI,              // 40
-
-  NAL_UNIT_RESERVED_NVCL41,
-  NAL_UNIT_RESERVED_NVCL42,
-  NAL_UNIT_RESERVED_NVCL43,
-  NAL_UNIT_RESERVED_NVCL44,
-  NAL_UNIT_RESERVED_NVCL45,
-  NAL_UNIT_RESERVED_NVCL46,
-  NAL_UNIT_RESERVED_NVCL47,
-  NAL_UNIT_UNSPECIFIED_48,
-  NAL_UNIT_UNSPECIFIED_49,
-  NAL_UNIT_UNSPECIFIED_50,
-  NAL_UNIT_UNSPECIFIED_51,
-  NAL_UNIT_UNSPECIFIED_52,
-  NAL_UNIT_UNSPECIFIED_53,
-  NAL_UNIT_UNSPECIFIED_54,
-  NAL_UNIT_UNSPECIFIED_55,
-  NAL_UNIT_UNSPECIFIED_56,
-  NAL_UNIT_UNSPECIFIED_57,
-  NAL_UNIT_UNSPECIFIED_58,
-  NAL_UNIT_UNSPECIFIED_59,
-  NAL_UNIT_UNSPECIFIED_60,
-  NAL_UNIT_UNSPECIFIED_61,
-  NAL_UNIT_UNSPECIFIED_62,
-  NAL_UNIT_UNSPECIFIED_63,
-  NAL_UNIT_INVALID,
-#endif
-#endif
 };
 
 #if SHARP_LUMA_DELTA_QP
@@ -1659,9 +1390,7 @@ struct XUCache
 #define MAX_NUM_ALF_CHROMA_COEFF        7
 #define MAX_ALF_FILTER_LENGTH           7
 #define MAX_NUM_ALF_COEFF               (MAX_ALF_FILTER_LENGTH * MAX_ALF_FILTER_LENGTH / 2 + 1)
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 #define MAX_ALF_PADDING_SIZE            4
-#endif
 
 enum AlfFilterType
 {
@@ -1748,30 +1477,22 @@ struct AlfFilterShape
 struct AlfSliceParam
 {
   bool                         enabledFlag[MAX_NUM_COMPONENT];                          // alf_slice_enable_flag, alf_chroma_idc
-#if JVET_N0242_NON_LINEAR_ALF
   bool                         nonLinearFlag[MAX_NUM_CHANNEL_TYPE];                     // alf_nonlinear_enable_flag[Luma/Chroma]
-#endif
   short                        lumaCoeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_coeff_luma_delta[i][j]
-#if JVET_N0242_NON_LINEAR_ALF
   short                        lumaClipp[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_clipp_luma_[i][j]
-#endif
   short                        chromaCoeff[MAX_NUM_ALF_CHROMA_COEFF];                   // alf_coeff_chroma[i]
-#if JVET_N0242_NON_LINEAR_ALF
   short                        chromaClipp[MAX_NUM_ALF_CHROMA_COEFF];                   // alf_clipp_chroma[i]
-#endif
   short                        filterCoeffDeltaIdx[MAX_NUM_ALF_CLASSES];                // filter_coeff_delta[i]
   bool                         alfLumaCoeffFlag[MAX_NUM_ALF_CLASSES];                   // alf_luma_coeff_flag[i]
   int                          numLumaFilters;                                          // number_of_filters_minus1 + 1
   bool                         alfLumaCoeffDeltaFlag;                                   // alf_luma_coeff_delta_flag
   bool                         alfLumaCoeffDeltaPredictionFlag;                         // alf_luma_coeff_delta_prediction_flag
   std::vector<AlfFilterShape>* filterShapes;
-#if JVET_N0415_CTB_ALF
   int                          tLayer;
   bool                         newFilterFlag[MAX_NUM_CHANNEL_TYPE];
   int                          fixedFilterPattern;
   int                          fixedFilterIdx[MAX_NUM_ALF_CLASSES];
   int                          fixedFilterSetIndex;
-#endif
 
   AlfSliceParam()
   {
@@ -1781,58 +1502,42 @@ struct AlfSliceParam
   void reset()
   {
     std::memset( enabledFlag, false, sizeof( enabledFlag ) );
-#if JVET_N0242_NON_LINEAR_ALF
     std::memset( nonLinearFlag, false, sizeof( nonLinearFlag ) );
-#endif
     std::memset( lumaCoeff, 0, sizeof( lumaCoeff ) );
-#if JVET_N0242_NON_LINEAR_ALF
     std::memset( lumaClipp, 0, sizeof( lumaClipp ) );
-#endif
     std::memset( chromaCoeff, 0, sizeof( chromaCoeff ) );
-#if JVET_N0242_NON_LINEAR_ALF
     std::memset( chromaClipp, 0, sizeof( chromaClipp ) );
-#endif
     std::memset( filterCoeffDeltaIdx, 0, sizeof( filterCoeffDeltaIdx ) );
     std::memset( alfLumaCoeffFlag, true, sizeof( alfLumaCoeffFlag ) );
     numLumaFilters = 1;
     alfLumaCoeffDeltaFlag = false;
     alfLumaCoeffDeltaPredictionFlag = false;
-#if JVET_N0415_CTB_ALF
     tLayer = 0;
     memset(newFilterFlag, 0, sizeof(newFilterFlag));
     fixedFilterPattern = 0;
     std::memset(fixedFilterIdx, 0, sizeof(fixedFilterIdx));
     fixedFilterSetIndex = 0;;
-#endif
   }
 
   const AlfSliceParam& operator = ( const AlfSliceParam& src )
   {
     std::memcpy( enabledFlag, src.enabledFlag, sizeof( enabledFlag ) );
-#if JVET_N0242_NON_LINEAR_ALF
     std::memcpy( nonLinearFlag, src.nonLinearFlag, sizeof( nonLinearFlag ) );
-#endif
     std::memcpy( lumaCoeff, src.lumaCoeff, sizeof( lumaCoeff ) );
-#if JVET_N0242_NON_LINEAR_ALF
     std::memcpy( lumaClipp, src.lumaClipp, sizeof( lumaClipp ) );
-#endif
     std::memcpy( chromaCoeff, src.chromaCoeff, sizeof( chromaCoeff ) );
-#if JVET_N0242_NON_LINEAR_ALF
     std::memcpy( chromaClipp, src.chromaClipp, sizeof( chromaClipp ) );
-#endif
     std::memcpy( filterCoeffDeltaIdx, src.filterCoeffDeltaIdx, sizeof( filterCoeffDeltaIdx ) );
     std::memcpy( alfLumaCoeffFlag, src.alfLumaCoeffFlag, sizeof( alfLumaCoeffFlag ) );
     numLumaFilters = src.numLumaFilters;
     alfLumaCoeffDeltaFlag = src.alfLumaCoeffDeltaFlag;
     alfLumaCoeffDeltaPredictionFlag = src.alfLumaCoeffDeltaPredictionFlag;
     filterShapes = src.filterShapes;
-#if JVET_N0415_CTB_ALF
     tLayer = src.tLayer;
     std::memcpy(newFilterFlag, src.newFilterFlag, sizeof(newFilterFlag));
     fixedFilterPattern = src.fixedFilterPattern;
     std::memcpy(fixedFilterIdx, src.fixedFilterIdx, sizeof(fixedFilterIdx));
     fixedFilterSetIndex = src.fixedFilterSetIndex;
-#endif
     return *this;
   }
 };
diff --git a/source/Lib/CommonLib/Unit.cpp b/source/Lib/CommonLib/Unit.cpp
index e34fe4249..b6f6ce944 100644
--- a/source/Lib/CommonLib/Unit.cpp
+++ b/source/Lib/CommonLib/Unit.cpp
@@ -267,18 +267,14 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
   affineType        = other.affineType;
   triangle          = other.triangle;
   transQuantBypass  = other.transQuantBypass;
-#if JVET_N0413_RDPCM
   bdpcmMode         = other.bdpcmMode;
-#endif
   ipcm              = other.ipcm;
   qp                = other.qp;
   chromaQpAdj       = other.chromaQpAdj;
   rootCbf           = other.rootCbf;
   sbtInfo           = other.sbtInfo;
-#if JVET_N0193_LFNST
   mtsFlag           = other.mtsFlag;
   lfnstIdx          = other.lfnstIdx;
-#endif
   tileIdx           = other.tileIdx;
   imv               = other.imv;
   imvNumCand        = other.imvNumCand;
@@ -290,9 +286,7 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
   shareParentSize   = other.shareParentSize;
   smvdMode        = other.smvdMode;
   ispMode           = other.ispMode;
-#if JVET_N0217_MATRIX_INTRAPRED
   mipFlag           = other.mipFlag;
-#endif
 
   return *this;
 }
@@ -311,18 +305,14 @@ void CodingUnit::initData()
   affineType        = 0;
   triangle          = false;
   transQuantBypass  = false;
-#if JVET_N0413_RDPCM
   bdpcmMode         = 0;
-#endif
   ipcm              = false;
   qp                = 0;
   chromaQpAdj       = 0;
   rootCbf           = true;
   sbtInfo           = 0;
-#if JVET_N0193_LFNST
   mtsFlag           = 0;
   lfnstIdx          = 0;
-#endif
   tileIdx           = 0;
   imv               = 0;
   imvNumCand        = 0;
@@ -334,9 +324,7 @@ void CodingUnit::initData()
   shareParentSize.height = -1;
   smvdMode        = 0;
   ispMode           = 0;
-#if JVET_N0217_MATRIX_INTRAPRED
   mipFlag           = false;
-#endif
 }
 
 const uint8_t CodingUnit::checkAllowedSbt() const
@@ -355,12 +343,10 @@ const uint8_t CodingUnit::checkAllowedSbt() const
   {
     return 0;
   }
-#if JVET_N0483_DISABLE_SBT_FOR_TPM
   if( triangle )
   {
     return 0;
   }
-#endif
 
   uint8_t sbtAllowed = 0;
   int cuWidth  = lwidth();
@@ -424,9 +410,7 @@ void PredictionUnit::initData()
 
   // inter data
   mergeFlag   = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
   regularMergeFlag = false;
-#endif
   mergeIdx    = MAX_UCHAR;
   triangleSplitDir  = MAX_UCHAR;
   triangleMergeIdx0 = MAX_UCHAR;
@@ -479,9 +463,7 @@ PredictionUnit& PredictionUnit::operator=(const IntraPredictionData& predData)
 PredictionUnit& PredictionUnit::operator=(const InterPredictionData& predData)
 {
   mergeFlag   = predData.mergeFlag;
-#if JVET_N0324_REGULAR_MRG_FLAG
   regularMergeFlag = predData.regularMergeFlag;
-#endif
   mergeIdx    = predData.mergeIdx;
   triangleSplitDir  = predData.triangleSplitDir  ;
   triangleMergeIdx0 = predData.triangleMergeIdx0 ;
@@ -528,9 +510,7 @@ PredictionUnit& PredictionUnit::operator=( const PredictionUnit& other )
   multiRefIdx = other.multiRefIdx;
 
   mergeFlag   = other.mergeFlag;
-#if JVET_N0324_REGULAR_MRG_FLAG
   regularMergeFlag = other.regularMergeFlag;
-#endif
   mergeIdx    = other.mergeIdx;
   triangleSplitDir  = other.triangleSplitDir  ;
   triangleMergeIdx0 = other.triangleMergeIdx0 ;
@@ -640,9 +620,7 @@ void TransformUnit::initData()
   depth              = 0;
   mtsIdx             = MTS_DCT2_DCT2;
   noResidual         = false;
-#if JVET_N0054_JOINT_CHROMA
   jointCbCr          = 0;
-#endif
   m_chromaResScaleInv = 0;
 }
 
@@ -678,9 +656,7 @@ TransformUnit& TransformUnit::operator=(const TransformUnit& other)
   depth              = other.depth;
   mtsIdx             = other.mtsIdx;
   noResidual         = other.noResidual;
-#if JVET_N0054_JOINT_CHROMA
   jointCbCr          = other.jointCbCr;
-#endif
   return *this;
 }
 
@@ -702,9 +678,7 @@ void TransformUnit::copyComponentFrom(const TransformUnit& other, const Componen
   depth            = other.depth;
   mtsIdx           = isLuma( i ) ? other.mtsIdx : mtsIdx;
   noResidual       = other.noResidual;
-#if JVET_N0054_JOINT_CHROMA
   jointCbCr        = isChroma( i ) ? other.jointCbCr : jointCbCr;
-#endif
 }
 
        CoeffBuf TransformUnit::getCoeffs(const ComponentID id)       { return  CoeffBuf(m_coeffs[id], blocks[id]); }
diff --git a/source/Lib/CommonLib/Unit.h b/source/Lib/CommonLib/Unit.h
index 0a2a6fc35..5c2f9eb56 100644
--- a/source/Lib/CommonLib/Unit.h
+++ b/source/Lib/CommonLib/Unit.h
@@ -267,12 +267,8 @@ struct UnitAreaRelative : public UnitArea
 };
 
 class SPS;
-#if HEVC_VPS || JVET_N0278_HLS
 class VPS;
-#endif
-#if JVET_N0349_DPS
 class DPS;
-#endif
 class PPS;
 class Slice;
 
@@ -308,23 +304,17 @@ struct CodingUnit : public UnitArea
   int            affineType;
   bool           triangle;
   bool           transQuantBypass;
-#if JVET_N0413_RDPCM
   int            bdpcmMode;
-#endif
   bool           ipcm;
   uint8_t          imv;
   bool           rootCbf;
   uint8_t        sbtInfo;
   uint32_t           tileIdx;
-#if JVET_N0193_LFNST
   uint8_t         mtsFlag;
   uint32_t        lfnstIdx;
-#endif
   uint8_t         GBiIdx;
   int             refIdxBi[2];
-#if JVET_N0217_MATRIX_INTRAPRED
   bool           mipFlag;
-#endif
 
   // needed for fast imv mode decisions
   int8_t          imvNumCand;
@@ -375,9 +365,7 @@ struct IntraPredictionData
 struct InterPredictionData
 {
   bool      mergeFlag;
-#if JVET_N0324_REGULAR_MRG_FLAG
   bool      regularMergeFlag;
-#endif
   uint8_t     mergeIdx;
   uint8_t     triangleSplitDir;
   uint8_t     triangleMergeIdx0;
@@ -455,9 +443,7 @@ struct TransformUnit : public UnitArea
   uint8_t        depth;
   uint8_t        mtsIdx;
   bool           noResidual;
-#if JVET_N0054_JOINT_CHROMA
   uint8_t        jointCbCr;
-#endif
   uint8_t        cbf        [ MAX_NUM_TBLOCKS ];
   RDPCMMode    rdpcm        [ MAX_NUM_TBLOCKS ];
   int8_t        compAlpha   [ MAX_NUM_TBLOCKS ];
diff --git a/source/Lib/CommonLib/UnitPartitioner.cpp b/source/Lib/CommonLib/UnitPartitioner.cpp
index 416157d1a..3309c07d9 100644
--- a/source/Lib/CommonLib/UnitPartitioner.cpp
+++ b/source/Lib/CommonLib/UnitPartitioner.cpp
@@ -144,23 +144,12 @@ void AdaptiveDepthPartitioner::setMaxMinDepth( unsigned& minDepth, unsigned& max
   unsigned          stdMaxDepth = ( g_aucLog2[cs.sps->getCTUSize()] - g_aucLog2[cs.sps->getMinQTSize( cs.slice->getSliceType(), chType )]);
   const Position    pos         = currArea().blocks[chType].pos();
   const unsigned    curSliceIdx = cs.slice->getIndependentSliceIdx();
-#if JVET_N0857_TILES_BRICKS
   const unsigned    curTileIdx  = cs.picture->brickMap->getBrickIdxRsMap( currArea().lumaPos() );
-#else
-  const unsigned    curTileIdx  = cs.picture->tileMap->getTileIdxMap( currArea().lumaPos() );
-#endif
 
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const CodingUnit* cuLeft        = cs.getCURestricted( pos.offset( -1,                               0 ), pos, curSliceIdx, curTileIdx, chType );
   const CodingUnit* cuBelowLeft   = cs.getCURestricted( pos.offset( -1, currArea().blocks[chType].height), pos, curSliceIdx, curTileIdx, chType );
   const CodingUnit* cuAbove       = cs.getCURestricted( pos.offset(  0,                              -1 ), pos, curSliceIdx, curTileIdx, chType );
   const CodingUnit* cuAboveRight  = cs.getCURestricted( pos.offset( currArea().blocks[chType].width, -1 ), pos, curSliceIdx, curTileIdx, chType );
-#else
-  const CodingUnit* cuLeft        = cs.getCURestricted( pos.offset( -1,                               0 ), curSliceIdx, curTileIdx, chType );
-  const CodingUnit* cuBelowLeft   = cs.getCURestricted( pos.offset( -1, currArea().blocks[chType].height), curSliceIdx, curTileIdx, chType );
-  const CodingUnit* cuAbove       = cs.getCURestricted( pos.offset(  0,                              -1 ), curSliceIdx, curTileIdx, chType );
-  const CodingUnit* cuAboveRight  = cs.getCURestricted( pos.offset( currArea().blocks[chType].width, -1 ), curSliceIdx, curTileIdx, chType );
-#endif
 
   minDepth = stdMaxDepth;
   maxDepth = stdMinDepth;
@@ -355,9 +344,7 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca
 
   // the minimal and maximal sizes are given in luma samples
   const CompArea&  area  = currArea().Y();
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
   const CompArea&  areaC = currArea().Cb();
-#endif
         PartLevel& level = m_partStack.back();
 
   const PartSplit lastSplit = level.split;
@@ -366,9 +353,7 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca
   // don't allow QT-splitting below a BT split
   if( lastSplit != CTU_LEVEL && lastSplit != CU_QUAD_SPLIT ) canQt = false;
   if( area.width <= minQtSize )                              canQt = false;
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
   if( chType == CHANNEL_TYPE_CHROMA && areaC.width <= MIN_DUALTREE_CHROMA_WIDTH ) canQt = false;
-#endif
   if( implicitSplit != CU_DONT_SPLIT )
   {
     canNo = canTh = canTv = false;
@@ -411,26 +396,18 @@ void QTBTPartitioner::canSplit( const CodingStructure &cs, bool& canNo, bool& ca
   // specific check for BT splits
   if( area.height <= minBtSize )                            canBh = false;
   if( area.width > MAX_TB_SIZEY && area.height <= MAX_TB_SIZEY ) canBh = false;
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
   if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE )     canBh = false;
-#endif
   if( area.width <= minBtSize )                              canBv = false;
   if( area.width <= MAX_TB_SIZEY && area.height > MAX_TB_SIZEY ) canBv = false;
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
   if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE )     canBv = false;
-#endif
   if( area.height <= 2 * minTtSize || area.height > maxTtSize || area.width > maxTtSize )
                                                                                        canTh = false;
   if( area.width > MAX_TB_SIZEY || area.height > MAX_TB_SIZEY )  canTh = false;
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
   if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE*2 )     canTh = false;
-#endif
   if( area.width <= 2 * minTtSize || area.width > maxTtSize || area.height > maxTtSize )
                                                                                        canTv = false;
   if( area.width > MAX_TB_SIZEY || area.height > MAX_TB_SIZEY )  canTv = false;
-#if JVET_N0137_DUALTREE_CHROMA_SIZE
   if( chType == CHANNEL_TYPE_CHROMA && areaC.width * areaC.height <= MIN_DUALTREE_CHROMA_SIZE*2 )     canTv = false;
-#endif
 }
 
 bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs )
diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp
index d1453efe8..996a5d162 100644
--- a/source/Lib/CommonLib/UnitTools.cpp
+++ b/source/Lib/CommonLib/UnitTools.cpp
@@ -87,10 +87,8 @@ void CS::setRefinedMotionField(CodingStructure &cs)
             subPu.mv[1] = pu.mv[1];
             subPu.mv[REF_PIC_LIST_0] += pu.mvdL0SubPu[num];
             subPu.mv[REF_PIC_LIST_1] -= pu.mvdL0SubPu[num];
-#if JVET_N0334_MVCLIPPING
             subPu.mv[REF_PIC_LIST_0].clipToStorageBitDepth();
             subPu.mv[REF_PIC_LIST_1].clipToStorageBitDepth();
-#endif
             pu.mvdL0SubPu[num].setZero();
             num++;
             PU::spanMotionInfo(subPu);
@@ -252,26 +250,17 @@ bool CU::hasNonTsCodedBlock( const CodingUnit& cu )
   return hasAnyNonTSCoded;
 }
 
-#if JVET_N0193_LFNST
 uint32_t CU::getNumNonZeroCoeffNonTs( const CodingUnit& cu, const bool lumaFlag, const bool chromaFlag )
-#else
-uint32_t CU::getNumNonZeroCoeffNonTs( const CodingUnit& cu )
-#endif
 {
   uint32_t count = 0;
   for( auto &currTU : traverseTUs( cu ) )
   {
-#if JVET_N0193_LFNST
     count += TU::getNumNonZeroCoeffsNonTS( currTU, lumaFlag, chromaFlag );
-#else
-    count += TU::getNumNonZeroCoeffsNonTS( currTU );
-#endif
   }
 
   return count;
 }
 
-#if JVET_N0193_LFNST
 uint32_t CU::getNumNonZeroCoeffNonTsCorner8x8( const CodingUnit& cu, const bool lumaFlag, const bool chromaFlag )
 {
   uint32_t count = 0;
@@ -282,7 +271,6 @@ uint32_t CU::getNumNonZeroCoeffNonTsCorner8x8( const CodingUnit& cu, const bool
 
   return count;
 }
-#endif
 
 bool CU::divideTuInRows( const CodingUnit &cu )
 {
@@ -411,14 +399,9 @@ ISPType CU::canUseISPSplit( const int width, const int height, const int maxTrSi
 
   const uint32_t minTuSizeForISP = MIN_TB_SIZEY;
   bool  notEnoughSamplesToSplit = ( g_aucLog2[width] + g_aucLog2[height] <= ( g_aucLog2[minTuSizeForISP] << 1 ) );
-#if JVET_N0308_MAX_CU_SIZE_FOR_ISP
   bool  cuSizeLargerThanMaxTrSize = width  > maxTrSize || height > maxTrSize;
   widthCannotBeUsed  = cuSizeLargerThanMaxTrSize || notEnoughSamplesToSplit;
   heightCannotBeUsed = cuSizeLargerThanMaxTrSize || notEnoughSamplesToSplit;
-#else
-  widthCannotBeUsed  = width  > maxTrSize || notEnoughSamplesToSplit;
-  heightCannotBeUsed = height > maxTrSize || notEnoughSamplesToSplit;
-#endif
 
   if( !widthCannotBeUsed && !heightCannotBeUsed )
   {
@@ -488,15 +471,8 @@ cTUTraverser CU::traverseTUs( const CodingUnit& cu )
 int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType &channelType /*= CHANNEL_TYPE_LUMA*/ )
 {
   const int numMPMs = NUM_MOST_PROBABLE_MODES;
-#if !JVET_N0185_UNIFIED_MPM
-  const int extendRefLine = (channelType == CHANNEL_TYPE_LUMA) ? pu.multiRefIdx : 0;
-  const ISPType ispType = isLuma( channelType ) ? ISPType( pu.cu->ispMode ) : NOT_INTRA_SUBPARTITIONS;
-  const bool isHorSplit = ispType == HOR_INTRA_SUBPARTITIONS;
-#endif
   {
-#if JVET_N0217_MATRIX_INTRAPRED
     CHECK(channelType != CHANNEL_TYPE_LUMA, "Not harmonized yet");
-#endif
     int numCand      = -1;
     int leftIntraDir = PLANAR_IDX, aboveIntraDir = PLANAR_IDX;
 
@@ -508,22 +484,14 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
     const PredictionUnit *puLeft = pu.cs->getPURestricted(posLB.offset(-1, 0), pu, channelType);
     if (puLeft && CU::isIntra(*puLeft->cu))
     {
-#if JVET_N0217_MATRIX_INTRAPRED
       leftIntraDir = PU::getIntraDirLuma( *puLeft );
-#else
-      leftIntraDir = puLeft->intraDir[channelType];
-#endif
     }
 
     // Get intra direction of above PU
     const PredictionUnit *puAbove = pu.cs->getPURestricted(posRT.offset(0, -1), pu, channelType);
     if (puAbove && CU::isIntra(*puAbove->cu) && CU::isSameCtu(*pu.cu, *puAbove->cu))
     {
-#if JVET_N0217_MATRIX_INTRAPRED
       aboveIntraDir = PU::getIntraDirLuma( *puAbove );
-#else
-      aboveIntraDir = puAbove->intraDir[channelType];
-#endif
     }
 
     CHECK(2 >= numMPMs, "Invalid number of most probable modes");
@@ -531,192 +499,9 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
     const int offset = (int)NUM_LUMA_MODE - 6;
     const int mod = offset + 3;
 
-#if !JVET_N0185_UNIFIED_MPM
-    if (extendRefLine)
-    {
-      int modeIdx = 0;
-      int angularMode[2] = { 0, 0 };
-
-      if (leftIntraDir > DC_IDX)
-      {
-        angularMode[modeIdx++] = leftIntraDir;
-      }
-      if (aboveIntraDir > DC_IDX && aboveIntraDir != leftIntraDir)
-      {
-        angularMode[modeIdx++] = aboveIntraDir;
-      }
-      if (modeIdx == 0)
-      {
-        mpm[0] = VER_IDX;
-        mpm[1] = HOR_IDX;
-        mpm[2] = 2;
-        mpm[3] = DIA_IDX;
-        mpm[4] = VDIA_IDX;
-        mpm[5] = 26;
-      }
-      else if (modeIdx == 1)
-      {
-        mpm[0] = angularMode[0];
-        mpm[1] = ((angularMode[0] + offset) % mod) + 2;
-        mpm[2] = ((angularMode[0] - 1) % mod) + 2;
-        mpm[3] = ((angularMode[0] + offset - 1) % mod) + 2;
-        mpm[4] = (angularMode[0] % mod) + 2;
-        mpm[5] = ((angularMode[0] + offset - 2) % mod) + 2;
-      }
-      else
-      {
-        mpm[0] = angularMode[0];
-        mpm[1] = angularMode[1];
-        int maxCandModeIdx = mpm[0] > mpm[1] ? 0 : 1;
-        int minCandModeIdx = 1 - maxCandModeIdx;
-        if (mpm[maxCandModeIdx] - mpm[minCandModeIdx] == 1)
-        {
-          mpm[2] = ((angularMode[minCandModeIdx] + offset) % mod) + 2;
-          mpm[3] = ((angularMode[maxCandModeIdx] - 1) % mod) + 2;
-          mpm[4] = ((angularMode[minCandModeIdx] + offset - 1) % mod) + 2;
-          mpm[5] = ( angularMode[maxCandModeIdx] % mod) + 2;
-        }
-        else if (mpm[maxCandModeIdx] - mpm[minCandModeIdx] >= 62)
-        {
-          mpm[2] = ((angularMode[minCandModeIdx] - 1) % mod) + 2;
-          mpm[3] = ((angularMode[maxCandModeIdx] + offset) % mod) + 2;
-          mpm[4] = ((angularMode[minCandModeIdx]) % mod) + 2;
-          mpm[5] = ((angularMode[maxCandModeIdx] + offset - 1) % mod) + 2;
-        }
-        else if (mpm[maxCandModeIdx] - mpm[minCandModeIdx] == 2)
-        {
-          mpm[2] = ((angularMode[minCandModeIdx] - 1) % mod) + 2;
-          mpm[3] = ((angularMode[minCandModeIdx] + offset) % mod) + 2;
-          mpm[4] = ((angularMode[maxCandModeIdx] - 1) % mod) + 2;
-          mpm[5] = ((angularMode[minCandModeIdx] + offset - 1) % mod) + 2;
-        }
-        else
-        {
-          mpm[2] = ((angularMode[minCandModeIdx] + offset) % mod) + 2;
-          mpm[3] = ((angularMode[minCandModeIdx] - 1) % mod) + 2;
-          mpm[4] = ((angularMode[maxCandModeIdx] + offset) % mod) + 2;
-          mpm[5] = ((angularMode[maxCandModeIdx] - 1) % mod) + 2;
-        }
-      }
-    }
-    else if( ispType != NOT_INTRA_SUBPARTITIONS )
-    {
-      //default case
-      mpm[0] = PLANAR_IDX;
-      if( isHorSplit )
-      {
-        mpm[1] = HOR_IDX;
-        mpm[2] = 25;
-        mpm[3] = 10;
-        mpm[4] = 65;
-        mpm[5] = VER_IDX;
-      }
-      else
-      {
-        mpm[1] = VER_IDX;
-        mpm[2] = 43;
-        mpm[3] = 60;
-        mpm[4] = 3;
-        mpm[5] = HOR_IDX;
-      }
-      int canonicalMode = mpm[1];
-      if( leftIntraDir == aboveIntraDir ) //L=A
-      {
-        numCand = 1;
-        if( leftIntraDir > DC_IDX )
-        {
-          mpm[0] =     leftIntraDir;
-          mpm[1] = ( ( leftIntraDir + offset ) % mod ) + 2;
-          mpm[2] = ( ( leftIntraDir - 1 ) % mod ) + 2;
-          if( ( isHorSplit && leftIntraDir < DIA_IDX ) || ( !isHorSplit && leftIntraDir >= DIA_IDX ) )
-          {
-            mpm[3] = ( ( leftIntraDir + offset - 1 ) % mod ) + 2;
-            mpm[4] =   ( leftIntraDir                % mod ) + 2;
-            mpm[5] = ( ( leftIntraDir + offset - 2 ) % mod ) + 2;;
-          }
-          else
-          {
-            if( isHorSplit )
-            {
-              mpm[3] = HOR_IDX;
-              mpm[4] = 5;
-            }
-            else
-            {
-              mpm[3] = VER_IDX;
-              mpm[4] = VDIA_IDX - 3;
-            }
-            mpm[5] = PLANAR_IDX;
-          }
-        }
-      }
-      else //L!=A
-      {
-        numCand = 2;
-        if( ( leftIntraDir > DC_IDX ) && ( aboveIntraDir > DC_IDX ) )
-        {
-          int distLeftToCanonicalMode  = abs( leftIntraDir - canonicalMode );
-          int distAboveToCanonicalMode = abs( aboveIntraDir - canonicalMode );
-          mpm[0] = aboveIntraDir;
-          mpm[1] = leftIntraDir;
-          if( distLeftToCanonicalMode <= distAboveToCanonicalMode )
-          {
-            mpm[0] = leftIntraDir;
-            mpm[1] = aboveIntraDir;
-          }
-          int maxCandModeIdx = mpm[0] > mpm[1] ? 0 : 1;
-          int minCandModeIdx = 1 - maxCandModeIdx;
-          if( mpm[maxCandModeIdx] - mpm[minCandModeIdx] == 1 )
-          {
-            mpm[2] = ( ( mpm[minCandModeIdx] + offset )     % mod ) + 2;
-            mpm[3] = ( ( mpm[maxCandModeIdx] - 1 )          % mod ) + 2;
-            mpm[4] = ( ( mpm[minCandModeIdx] + offset - 1 ) % mod ) + 2;
-            mpm[5] =   ( mpm[maxCandModeIdx]                % mod ) + 2;
-          }
-          else if( mpm[maxCandModeIdx] - mpm[minCandModeIdx] >= 62 )
-          {
-            mpm[2] = ( ( mpm[minCandModeIdx] - 1 )          % mod ) + 2;
-            mpm[3] = ( ( mpm[maxCandModeIdx] + offset )     % mod ) + 2;
-            mpm[4] = ( ( mpm[minCandModeIdx] )              % mod ) + 2;
-            mpm[5] = ( ( mpm[maxCandModeIdx] + offset - 1 ) % mod ) + 2;
-          }
-          else if( mpm[maxCandModeIdx] - mpm[minCandModeIdx] == 2 )
-          {
-            mpm[2] = ( ( mpm[minCandModeIdx] - 1 )          % mod ) + 2;
-            mpm[3] = ( ( mpm[minCandModeIdx] + offset )     % mod ) + 2;
-            mpm[4] = ( ( mpm[maxCandModeIdx] - 1 )          % mod ) + 2;
-            mpm[5] = ( ( mpm[minCandModeIdx] + offset - 1 ) % mod ) + 2;
-          }
-          else
-          {
-            mpm[2] = ( ( mpm[minCandModeIdx] + offset )     % mod ) + 2;
-            mpm[3] = ( ( mpm[minCandModeIdx] - 1 )          % mod ) + 2;
-            mpm[4] = ( ( mpm[maxCandModeIdx] + offset )     % mod ) + 2;
-            mpm[5] = ( ( mpm[maxCandModeIdx] - 1 )          % mod ) + 2;
-          }
-        }
-        else if( leftIntraDir + aboveIntraDir > 2 )
-        {
-          //mpm[0] = PLANAR_IDX;
-          int angMode = leftIntraDir > DC_IDX ? leftIntraDir : aboveIntraDir;
-          mpm[1] = angMode;
-          mpm[2] = ( ( angMode + offset )     % mod ) + 2;
-          mpm[3] = ( ( angMode - 1 )          % mod ) + 2;
-          mpm[4] = ( ( angMode + offset - 1 ) % mod ) + 2;
-          mpm[5] = ( ( angMode )              % mod ) + 2;
-        }
-      }
-    }
-    else
-#endif
     {
-#if JVET_N0185_UNIFIED_MPM
       mpm[0] = PLANAR_IDX;
       mpm[1] = DC_IDX;
-#else
-      mpm[0] = leftIntraDir;
-      mpm[1] = (mpm[0] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX;
-#endif
       mpm[2] = VER_IDX;
       mpm[3] = HOR_IDX;
       mpm[4] = VER_IDX - 4;
@@ -727,53 +512,28 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
         numCand = 1;
         if (leftIntraDir > DC_IDX)
         {
-#if JVET_N0185_UNIFIED_MPM
           mpm[0] = PLANAR_IDX;
           mpm[1] = leftIntraDir;
           mpm[2] = ((leftIntraDir + offset) % mod) + 2;
           mpm[3] = ((leftIntraDir - 1) % mod) + 2;
           mpm[4] = DC_IDX;
           mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2;
-#else
-          mpm[0] = leftIntraDir;
-          mpm[1] = PLANAR_IDX;
-          mpm[2] = DC_IDX;
-          mpm[3] = ((leftIntraDir + offset) % mod) + 2;
-          mpm[4] = ((leftIntraDir - 1) % mod) + 2;
-          mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2;
-#endif
         }
       }
       else //L!=A
       {
         numCand = 2;
-#if !JVET_N0185_UNIFIED_MPM
-        mpm[0] = leftIntraDir;
-        mpm[1] = aboveIntraDir;
-#endif
-#if JVET_N0185_UNIFIED_MPM
         int  maxCandModeIdx = mpm[0] > mpm[1] ? 0 : 1;
-#else
-        bool maxCandModeIdx = mpm[0] > mpm[1] ? 0 : 1;
-#endif
 
         if ((leftIntraDir > DC_IDX) && (aboveIntraDir > DC_IDX))
         {
-#if JVET_N0185_UNIFIED_MPM
           mpm[0] = PLANAR_IDX;
           mpm[1] = leftIntraDir;
           mpm[2] = aboveIntraDir;
           maxCandModeIdx = mpm[1] > mpm[2] ? 1 : 2;
           int minCandModeIdx = mpm[1] > mpm[2] ? 2 : 1;
-#else
-          mpm[2] = PLANAR_IDX;
-#endif
           mpm[3] = DC_IDX;
-#if JVET_N0185_UNIFIED_MPM
           if ((mpm[maxCandModeIdx] - mpm[minCandModeIdx] < 63) && (mpm[maxCandModeIdx] - mpm[minCandModeIdx] > 1))
-#else
-          if ((mpm[maxCandModeIdx] - mpm[!maxCandModeIdx] < 63) && (mpm[maxCandModeIdx] - mpm[!maxCandModeIdx] > 1))
-#endif
           {
             mpm[4] = ((mpm[maxCandModeIdx] + offset) % mod) + 2;
             mpm[5] = ((mpm[maxCandModeIdx] - 1) % mod) + 2;
@@ -786,14 +546,10 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
         }
         else if (leftIntraDir + aboveIntraDir >= 2)
         {
-#if JVET_N0185_UNIFIED_MPM
           mpm[0] = PLANAR_IDX;
           mpm[1] = (leftIntraDir < aboveIntraDir) ? aboveIntraDir : leftIntraDir;
           maxCandModeIdx = 1;
           mpm[2] = DC_IDX;
-#else
-          mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX;
-#endif
           mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2;
           mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2;
           mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2;
@@ -809,7 +565,6 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
   }
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 bool PU::isMIP(const PredictionUnit &pu, const ChannelType &chType)
 {
   return (chType == CHANNEL_TYPE_LUMA && pu.cu->mipFlag);
@@ -997,7 +752,6 @@ AvailableInfo PU::getAvailableInfoLuma(const PredictionUnit &pu)
   CHECKD(availInfo.maxPosTop > puArea.width || availInfo.maxPosLeft > puArea.height, "Error");
   return availInfo;
 }
-#endif
 
 void PU::getIntraChromaCandModes( const PredictionUnit &pu, unsigned modeList[NUM_CHROMA_MODE] )
 {
@@ -1014,11 +768,7 @@ void PU::getIntraChromaCandModes( const PredictionUnit &pu, unsigned modeList[NU
     Position topLeftPos = pu.blocks[pu.chType].lumaPos();
     Position refPos = topLeftPos.offset( pu.blocks[pu.chType].lumaSize().width >> 1, pu.blocks[pu.chType].lumaSize().height >> 1 );
     const PredictionUnit *lumaPU = CS::isDualITree( *pu.cs ) ? pu.cs->picture->cs->getPU( refPos, CHANNEL_TYPE_LUMA ) : &pu;
-#if JVET_N0217_MATRIX_INTRAPRED
     const uint32_t lumaMode = PU::getIntraDirLuma( *lumaPU );
-#else
-    const uint32_t lumaMode = lumaPU->intraDir[CHANNEL_TYPE_LUMA];
-#endif
     for( int i = 0; i < 4; i++ )
     {
       if( lumaMode == modeList[i] )
@@ -1062,135 +812,6 @@ bool PU::isChromaIntraModeCrossCheckMode( const PredictionUnit &pu )
   return pu.intraDir[CHANNEL_TYPE_CHROMA] == DM_CHROMA_IDX;
 }
 
-#if !JVET_N0302_SIMPLFIED_CIIP
-int PU::getMHIntraMPMs(const PredictionUnit &pu, unsigned* mpm, const ChannelType &channelType /*= CHANNEL_TYPE_LUMA*/, const bool isChromaMDMS /*= false*/, const unsigned startIdx /*= 0*/)
-{
-  const int numMPMs = 3; // Multi-hypothesis intra uses only 3 MPM
-  {
-    int numCand = -1;
-    uint32_t leftIntraDir = DC_IDX, aboveIntraDir = DC_IDX;
-
-    const CompArea& area = pu.block(getFirstComponentOfChannel(channelType));
-    const Position& pos = area.pos();
-
-    // Get intra direction of left PU
-    const PredictionUnit *puLeft = pu.cs->getPURestricted(pos.offset(-1, 0), pu, channelType);
-
-    if (puLeft && (CU::isIntra(*puLeft->cu) || puLeft->mhIntraFlag))
-    {
-      leftIntraDir = puLeft->intraDir[channelType];
-
-      if (isChroma(channelType) && leftIntraDir == DM_CHROMA_IDX)
-      {
-        leftIntraDir = puLeft->intraDir[0];
-      }
-    }
-
-    // Get intra direction of above PU
-    const PredictionUnit* puAbove = pu.cs->getPURestricted(pos.offset(0, -1), pu, channelType);
-
-    if (puAbove && (CU::isIntra(*puAbove->cu) || puAbove->mhIntraFlag) && CU::isSameCtu(*pu.cu, *puAbove->cu))
-    {
-      aboveIntraDir = puAbove->intraDir[channelType];
-
-      if (isChroma(channelType) && aboveIntraDir == DM_CHROMA_IDX)
-      {
-        aboveIntraDir = puAbove->intraDir[0];
-      }
-    }
-
-    CHECK(2 >= numMPMs, "Invalid number of most probable modes");
-
-    uint32_t leftIntraDir2 = leftIntraDir;
-    uint32_t aboveIntraDir2 = aboveIntraDir;
-
-    leftIntraDir2 = (leftIntraDir2 > DC_IDX) ? ((leftIntraDir2 <= DIA_IDX) ? HOR_IDX : VER_IDX) : leftIntraDir2;
-    aboveIntraDir2 = (aboveIntraDir2 > DC_IDX) ? ((aboveIntraDir2 <= DIA_IDX) ? HOR_IDX : VER_IDX) : aboveIntraDir2;
-
-    if (leftIntraDir2 == aboveIntraDir2)
-    {
-      numCand = 1;
-
-      if (leftIntraDir2 > DC_IDX) // angular modes
-      {
-        mpm[0] = leftIntraDir2;
-        mpm[1] = PLANAR_IDX;
-        mpm[2] = DC_IDX;
-      }
-      else //non-angular
-      {
-        mpm[0] = PLANAR_IDX;
-        mpm[1] = DC_IDX;
-        mpm[2] = VER_IDX;
-      }
-    }
-    else
-    {
-      numCand = 2;
-
-      mpm[0] = leftIntraDir2;
-      mpm[1] = aboveIntraDir2;
-
-      if (leftIntraDir2 && aboveIntraDir2) //both modes are non-planar
-      {
-        mpm[2] = PLANAR_IDX;
-      }
-      else
-      {
-        mpm[2] = (leftIntraDir2 + aboveIntraDir2) < 2 ? VER_IDX : DC_IDX;
-      }
-    }
-    int narrowCase = getNarrowShape(pu.lwidth(), pu.lheight());
-    if (narrowCase > 0)
-    {
-      bool isMPM[NUM_LUMA_MODE];
-      for (int idx = 0; idx < NUM_LUMA_MODE; idx++)
-      {
-        isMPM[idx] = false;
-      }
-      for (int idx = 0; idx < numMPMs; idx++)
-      {
-        isMPM[mpm[idx]] = true;
-      }
-      if (narrowCase == 1 && isMPM[HOR_IDX])
-      {
-        for (int idx = 0; idx < numMPMs; idx++)
-        {
-          if (mpm[idx] == HOR_IDX)
-          {
-            if (!isMPM[PLANAR_IDX])
-              mpm[idx] = PLANAR_IDX;
-            else if (!isMPM[DC_IDX])
-              mpm[idx] = DC_IDX;
-            else if (!isMPM[VER_IDX])
-              mpm[idx] = VER_IDX;
-            break;
-          }
-        }
-      }
-      if (narrowCase == 2 && isMPM[VER_IDX])
-      {
-        for (int idx = 0; idx < numMPMs; idx++)
-        {
-          if (mpm[idx] == VER_IDX)
-          {
-            if (!isMPM[PLANAR_IDX])
-              mpm[idx] = PLANAR_IDX;
-            else if (!isMPM[DC_IDX])
-              mpm[idx] = DC_IDX;
-            else if (!isMPM[HOR_IDX])
-              mpm[idx] = HOR_IDX;
-            break;
-          }
-        }
-      }
-    }
-    CHECK(numCand == 0, "No candidates found");
-    CHECK(mpm[0] == mpm[1] || mpm[0] == mpm[2] || mpm[2] == mpm[1], "redundant MPM");
-    return numCand;
-  }
-}
-#endif
 int PU::getNarrowShape(const int width, const int height)
 {
   int longSide = (width > height) ? width : height;
@@ -1218,24 +839,15 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT
     Position refPos = topLeftPos.offset( pu.blocks[pu.chType].lumaSize().width >> 1, pu.blocks[pu.chType].lumaSize().height >> 1 );
     const PredictionUnit &lumaPU = CS::isDualITree( *pu.cs ) ? *pu.cs->picture->cs->getPU( refPos, CHANNEL_TYPE_LUMA ) : *pu.cs->getPU( topLeftPos, CHANNEL_TYPE_LUMA );
 
-#if JVET_N0217_MATRIX_INTRAPRED
     uiIntraMode = PU::getIntraDirLuma( lumaPU );
-#else
-    uiIntraMode = lumaPU.intraDir[0];
-#endif
   }
-#if JVET_N0671_CHROMA_FORMAT_422
   if( pu.chromaFormat == CHROMA_422 && !isLuma( chType ) && uiIntraMode < NUM_LUMA_MODE ) // map directional, planar and dc
-#else
-  if( pu.chromaFormat == CHROMA_422 && !isLuma( chType ) )
-#endif //JVET_N0671_CHROMA_FORMAT_422
   {
     uiIntraMode = g_chroma422IntraAngleMappingTable[uiIntraMode];
   }
   return uiIntraMode;
 }
 
-#if JVET_N0193_LFNST
 int PU::getWideAngIntraMode( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID )
 {
   if( dirMode < 2 )
@@ -1263,7 +875,6 @@ int PU::getWideAngIntraMode( const TransformUnit &tu, const uint32_t dirMode, co
 
   return predMode;
 }
-#endif
 
 bool PU::xCheckSimilarMotion(const int mergeCandIndex, const int prevCnt, const MergeCtx mergeCandList, bool hasPruned[MRG_MAX_NUM_CANDS])
 {
@@ -1328,11 +939,7 @@ bool PU::addMergeHMVPCand(const CodingStructure &cs, MergeCtx& mrgCtx, bool isCa
   {
     hasPruned[subPuMvpPos] = true;
   }
-#if JVET_N0266_SMALL_BLOCKS
   auto &lut = ibcFlag ? ( isShared ? cs.motionLut.lutShareIbc : cs.motionLut.lutIbc ) : cs.motionLut.lut;
-#else
-  auto &lut = ibcFlag ? ( isShared ? cs.motionLut.lutShareIbc : cs.motionLut.lutIbc ) : ( isShared ? cs.motionLut.lutShare : cs.motionLut.lut );
-#endif
   int num_avai_candInLUT = (int) lut.size();
 
   for (int mrgIdx = 1; mrgIdx <= num_avai_candInLUT; mrgIdx++)
@@ -1344,11 +951,7 @@ bool PU::addMergeHMVPCand(const CodingStructure &cs, MergeCtx& mrgCtx, bool isCa
     {
       mrgCtx.mvFieldNeighbours[(cnt << 1) + 1].setMvField(miNeighbor.mv[1], miNeighbor.refIdx[1]);
     }
-#if JVET_N0843_BVP_SIMPLIFICATION
     if (mrgIdx > 2 || (mrgIdx > 1 && ibcFlag) || !xCheckSimilarMotion(cnt, prevCnt, mrgCtx, hasPruned))
-#else
-    if (mrgIdx > 2 || !xCheckSimilarMotion(cnt, prevCnt, mrgCtx, hasPruned))
-#endif
     {
 #if !JVET_L0090_PAIR_AVG
       isCandInter[cnt] = true;
@@ -1389,9 +992,6 @@ void PU::getIBCMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx, const
 
   int cnt = 0;
 
-#if JVET_N0843_BVP_SIMPLIFICATION==0
-  const Position posLT = pu.shareParentPos;
-#endif
   const Position posRT = pu.shareParentPos.offset(pu.shareParentSize.width - 1, 0);
   const Position posLB = pu.shareParentPos.offset(0, pu.shareParentSize.height - 1);
 
@@ -1452,108 +1052,8 @@ void PU::getIBCMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx, const
 
   int spatialCandPos = cnt;
 
-#if JVET_N0843_BVP_SIMPLIFICATION==0
-  // above right
-  const PredictionUnit *puAboveRight = cs.getPURestricted(posRT.offset(1, -1), pu, pu.chType);
-  bool isAvailableB0 = puAboveRight && isDiffMER(pu, *puAboveRight) && CU::isIBC(*puAboveRight->cu);
-  if (isAvailableB0)
-  {
-    miAboveRight = puAboveRight->getMotionInfo(posRT.offset(1, -1));
-
-#if HM_JEM_MERGE_CANDS
-    if ((!isAvailableB1 || (miAbove != miAboveRight)) && (!isAvailableA1 || (miLeft != miAboveRight)))
-#else
-    if (!isAvailableB1 || (miAbove != miAboveRight))
-#endif
-    {
-      // get Inter Dir
-      mrgCtx.interDirNeighbours[cnt] = miAboveRight.interDir;
-      // get Mv from Above-right
-      mrgCtx.mvFieldNeighbours[cnt << 1].setMvField(miAboveRight.mv[0], miAboveRight.refIdx[0]);
-
-      if (mrgCandIdx == cnt && canFastExit)
-      {
-        return;
-      }
-
-      cnt++;
-    }
-  }
-  // early termination
-  if (cnt == maxNumMergeCand)
-  {
-    return;
-  }
-
-  //left bottom
-  const PredictionUnit *puLeftBottom = cs.getPURestricted(posLB.offset(-1, 1), pu, pu.chType);
-  bool isAvailableA0 = puLeftBottom && isDiffMER(pu, *puLeftBottom) && CU::isIBC(*puLeftBottom->cu);
-  if (isAvailableA0)
-  {
-    miBelowLeft = puLeftBottom->getMotionInfo(posLB.offset(-1, 1));
 
-#if HM_JEM_MERGE_CANDS
-    if ((!isAvailableA1 || (miBelowLeft != miLeft)) && (!isAvailableB1 || (miBelowLeft != miAbove)) && (!isAvailableB0 || (miBelowLeft != miAboveRight)))
-#else
-    if (!isAvailableA1 || (miBelowLeft != miLeft))
-#endif
-    {
-      // get Inter Dir
-      mrgCtx.interDirNeighbours[cnt] = miBelowLeft.interDir;
-      mrgCtx.mvFieldNeighbours[cnt << 1].setMvField(miBelowLeft.mv[0], miBelowLeft.refIdx[0]);
-      if (mrgCandIdx == cnt && canFastExit)
-      {
-        return;
-      }
-
-      cnt++;
-    }
-  }
-  // early termination
-  if (cnt == maxNumMergeCand)
-  {
-    return;
-  }
-
-  // above left
-  if (cnt < 4)
-  {
-    const PredictionUnit *puAboveLeft = cs.getPURestricted(posLT.offset(-1, -1), pu, pu.chType);
-    bool isAvailableB2 = puAboveLeft && isDiffMER(pu, *puAboveLeft) && CU::isIBC(*puAboveLeft->cu);
-    if (isAvailableB2)
-    {
-      miAboveLeft = puAboveLeft->getMotionInfo(posLT.offset(-1, -1));
-
-#if HM_JEM_MERGE_CANDS
-      if ((!isAvailableA1 || (miLeft != miAboveLeft)) && (!isAvailableB1 || (miAbove != miAboveLeft)) && (!isAvailableA0 || (miBelowLeft != miAboveLeft)) && (!isAvailableB0 || (miAboveRight != miAboveLeft)))
-#else
-      if ((!isAvailableA1 || (miLeft != miAboveLeft)) && (!isAvailableB1 || (miAbove != miAboveLeft)))
-#endif
-      {
-        // get Inter Dir
-        mrgCtx.interDirNeighbours[cnt] = miAboveLeft.interDir;
-        mrgCtx.mvFieldNeighbours[cnt << 1].setMvField(miAboveLeft.mv[0], miAboveLeft.refIdx[0]);
-        if (mrgCandIdx == cnt && canFastExit)
-        {
-          return;
-        }
-
-        cnt++;
-      }
-    }
-  }
-  // early termination
-  if (cnt == maxNumMergeCand)
-  {
-    return;
-  }
-#endif
-
-#if JVET_N0843_BVP_SIMPLIFICATION
   int maxNumMergeCandMin1 = maxNumMergeCand;
-#else
-  int maxNumMergeCandMin1 = maxNumMergeCand - 1;
-#endif
   if (cnt != maxNumMergeCandMin1)
   {
     bool isAvailableSubPu = false;
@@ -1582,35 +1082,7 @@ void PU::getIBCMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx, const
     }
   }
 
-#if JVET_L0090_PAIR_AVG && JVET_N0843_BVP_SIMPLIFICATION==0
-  // pairwise-average candidates
-    if (cnt>1 && cnt <maxNumMergeCand)
-    {
-       mrgCtx.mvFieldNeighbours[cnt * 2    ].setMvField(Mv(0, 0), NOT_VALID);
-       mrgCtx.mvFieldNeighbours[cnt * 2 + 1].setMvField(Mv(0, 0), NOT_VALID);
-
-       const Mv& MvI = mrgCtx.mvFieldNeighbours[0 * 2].mv;
-       const Mv& MvJ = mrgCtx.mvFieldNeighbours[1 * 2].mv;
-       // average two MVs
-       Mv avgMv = MvI;
-
-       avgMv += MvJ;
-       mrgCtx.mrgTypeNeighbours[cnt] = MRG_TYPE_IBC;
-       roundAffineMv(avgMv.hor, avgMv.ver, 1);
-       avgMv.roundToPrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT);
-      mrgCtx.mvFieldNeighbours[cnt * 2 ].setMvField(avgMv, MAX_NUM_REF);
-      mrgCtx.interDirNeighbours[cnt] = 1;
-      cnt++;
-    }
-
-    // early termination
-    if (cnt == maxNumMergeCand)
-    {
-      return;
-    }
-#endif
 
-#if JVET_N0317_ADD_ZERO_BV
     while (cnt < maxNumMergeCand)
     {
       mrgCtx.mvFieldNeighbours[cnt * 2].setMvField(Mv(0, 0), MAX_NUM_REF);
@@ -1621,7 +1093,6 @@ void PU::getIBCMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx, const
         return;
       }
     }
-#endif
 
   mrgCtx.numValidMergeCand = cnt;
 
@@ -1658,15 +1129,9 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
 
   int cnt = 0;
 
-#if JVET_N0266_SMALL_BLOCKS
   const Position posLT = pu.Y().topLeft();
   const Position posRT = pu.Y().topRight();
   const Position posLB = pu.Y().bottomLeft();
-#else
-  const Position posLT = pu.shareParentPos;
-  const Position posRT = pu.shareParentPos.offset(pu.shareParentSize.width - 1, 0);
-  const Position posLB = pu.shareParentPos.offset(0, pu.shareParentSize.height - 1);
-#endif
   MotionInfo miAbove, miLeft, miAboveLeft, miAboveRight, miBelowLeft;
 
   //left
@@ -1758,11 +1223,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
   {
     miAboveRight = puAboveRight->getMotionInfo( posRT.offset( 1, -1 ) );
 
-#if HM_JEM_MERGE_CANDS
-    if( ( !isAvailableB1 || ( miAbove != miAboveRight ) ) && ( !isAvailableA1 || ( miLeft != miAboveRight ) ) )
-#else
     if( !isAvailableB1 || ( miAbove != miAboveRight ) )
-#endif
     {
 #if !JVET_L0090_PAIR_AVG
       isCandInter[cnt] = true;
@@ -1802,11 +1263,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
   {
     miBelowLeft = puLeftBottom->getMotionInfo( posLB.offset( -1, 1 ) );
 
-#if HM_JEM_MERGE_CANDS
-    if( ( !isAvailableA1 || ( miBelowLeft != miLeft ) ) && ( !isAvailableB1 || ( miBelowLeft != miAbove ) ) && ( !isAvailableB0 || ( miBelowLeft != miAboveRight ) ) )
-#else
     if( !isAvailableA1 || ( miBelowLeft != miLeft ) )
-#endif
     {
 #if !JVET_L0090_PAIR_AVG
       isCandInter[cnt] = true;
@@ -1849,11 +1306,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
     {
       miAboveLeft = puAboveLeft->getMotionInfo( posLT.offset( -1, -1 ) );
 
-#if HM_JEM_MERGE_CANDS
-      if( ( !isAvailableA1 || ( miLeft != miAboveLeft ) ) && ( !isAvailableB1 || ( miAbove != miAboveLeft ) ) && ( !isAvailableA0 || ( miBelowLeft != miAboveLeft ) ) && ( !isAvailableB0 || ( miAboveRight != miAboveLeft ) ) )
-#else
       if( ( !isAvailableA1 || ( miLeft != miAboveLeft ) ) && ( !isAvailableB1 || ( miAbove != miAboveLeft ) ) )
-#endif
       {
 #if !JVET_L0090_PAIR_AVG
         isCandInter[cnt] = true;
@@ -1885,31 +1338,16 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
     return;
   }
 
-#if JVET_N0213_TMVP_REMOVAL
   if (slice.getEnableTMVPFlag() && (pu.lumaSize().width + pu.lumaSize().height > 12))
-#else
-  if (slice.getEnableTMVPFlag())
-#endif
   {
     //>> MTK colocated-RightBottom
     // offset the pos to be sure to "point" to the same position the uiAbsPartIdx would've pointed to
-#if JVET_N0266_SMALL_BLOCKS
     Position posRB = pu.Y().bottomRight().offset( -3, -3 );
-#else
-    Position posRB = pu.shareParentPos.offset(pu.shareParentSize.width-3, pu.shareParentSize.height - 3);
-#endif
     const PreCalcValues& pcv = *cs.pcv;
 
     Position posC0;
-#if JVET_N0266_SMALL_BLOCKS
     Position posC1 = pu.Y().center();
-#else
-    Position posC1 = pu.shareParentPos.offset((pu.shareParentSize.width/2), (pu.shareParentSize.height/2));
-#endif
     bool C0Avail = false;
-#if !JVET_N0266_SMALL_BLOCKS
-    bool C1Avail = (posC1.x < pcv.lumaWidth) && (posC1.y  < pcv.lumaHeight);
-#endif
     if (((posRB.x + pcv.minCUWidth) < pcv.lumaWidth) && ((posRB.y + pcv.minCUHeight) < pcv.lumaHeight))
     {
       int posYInCtu = posRB.y & pcv.maxCUHeightMask;
@@ -1925,11 +1363,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
     int       dir         = 0;
     unsigned  uiArrayAddr = cnt;
     bool      bExistMV    = ( C0Avail && getColocatedMVP(pu, REF_PIC_LIST_0, posC0, cColMv, iRefIdx ) )
-#if JVET_N0266_SMALL_BLOCKS
                               || getColocatedMVP( pu, REF_PIC_LIST_0, posC1, cColMv, iRefIdx );
-#else
-                                      || ( C1Avail && getColocatedMVP(pu, REF_PIC_LIST_0, posC1, cColMv, iRefIdx ));
-#endif
     if (bExistMV)
     {
       dir     |= 1;
@@ -1939,11 +1373,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
     if (slice.isInterB())
     {
       bExistMV = ( C0Avail && getColocatedMVP(pu, REF_PIC_LIST_1, posC0, cColMv, iRefIdx ) )
-#if JVET_N0266_SMALL_BLOCKS
                    || getColocatedMVP( pu, REF_PIC_LIST_1, posC1, cColMv, iRefIdx );
-#else
-                           || (C1Avail &&  getColocatedMVP(pu, REF_PIC_LIST_1, posC1, cColMv, iRefIdx ) );
-#endif
       if (bExistMV)
       {
         dir     |= 2;
@@ -1954,18 +1384,6 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
     if( dir != 0 )
     {
       bool addTMvp = true;
-#if HM_JEM_MERGE_CANDS
-      int iSpanCand = cnt;
-      for( int i = 0; i < iSpanCand; i++ )
-      {
-        if( mrgCtx.interDirNeighbours[  i           ] == dir &&
-            mrgCtx.mvFieldNeighbours [  i << 1      ] == mrgCtx.mvFieldNeighbours[  uiArrayAddr << 1      ] &&
-            mrgCtx.mvFieldNeighbours [( i << 1 ) + 1] == mrgCtx.mvFieldNeighbours[( uiArrayAddr << 1 ) + 1] )
-        {
-          addTMvp = false;
-        }
-      }
-#endif
       if( addTMvp )
       {
         mrgCtx.interDirNeighbours[uiArrayAddr] = dir;
@@ -1995,11 +1413,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
     bool isAvailableSubPu = false;
     unsigned subPuMvpPos = 0;
 #if JVET_L0090_PAIR_AVG
-#if JVET_N0266_SMALL_BLOCKS
     bool isShared = false;
-#else
-    bool  isShared = ((pu.Y().lumaSize().width != pu.shareParentSize.width) || (pu.Y().lumaSize().height != pu.shareParentSize.height));
-#endif
     bool bFound = addMergeHMVPCand(cs, mrgCtx, canFastExit
       , mrgCandIdx
       , maxNumMergeCandMin1, cnt
@@ -2173,14 +1587,12 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
 }
 bool PU::checkDMVRCondition(const PredictionUnit& pu)
 {
-#if JVET_N0146_DMVR_BDOF_CONDITION
     WPScalingParam *wp0;
     WPScalingParam *wp1;
     int refIdx0 = pu.refIdx[REF_PIC_LIST_0];
     int refIdx1 = pu.refIdx[REF_PIC_LIST_1];
     pu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
     pu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
-#endif
   if (pu.cs->sps->getUseDMVR())
   {
     return pu.mergeFlag
@@ -2190,16 +1602,10 @@ bool PU::checkDMVRCondition(const PredictionUnit& pu)
       && !pu.cu->mmvdSkip
       && PU::isBiPredFromDifferentDirEqDistPoc(pu)
       && (pu.lheight() >= 8)
-#if JVET_N0407_DMVR_CU_SIZE_RESTRICTION
       && (pu.lwidth() >= 8)
       && ((pu.lheight() * pu.lwidth()) >= 128)
-#else
-      && ((pu.lheight() * pu.lwidth()) >= 64)
-#endif
-#if JVET_N0146_DMVR_BDOF_CONDITION
       && (pu.cu->GBiIdx == GBI_DEFAULT)
       && ((!wp0[COMPONENT_Y].bPresentFlag) && (!wp1[COMPONENT_Y].bPresentFlag))
-#endif
       ;
   }
   else
@@ -2251,21 +1657,13 @@ bool PU::isBlockVectorValid(PredictionUnit& pu, int xPos, int yPos, int width, i
   }
 
   // in the same CTU line
-#if JVET_N0175_N0251_N0384_IBC_SMALL_CTU
   int numLeftCTUs = (1 << ((7 - ctuSizeLog2) << 1)) - ((ctuSizeLog2 < 7) ? 1 : 0);
   if ((refRightX >> ctuSizeLog2 <= xPos >> ctuSizeLog2) && (refLeftX >> ctuSizeLog2 >= (xPos >> ctuSizeLog2) - numLeftCTUs))
-#else
-  if ((refRightX >> ctuSizeLog2 <= xPos >> ctuSizeLog2) && (refLeftX >> ctuSizeLog2 >= (xPos >> ctuSizeLog2) - 1))
-#endif
   {
 
     // in the same CTU, or left CTU
     // if part of ref block is in the left CTU, some area can be referred from the not-yet updated local CTU buffer
-#if JVET_N0175_N0251_N0384_IBC_SMALL_CTU
     if (((refLeftX >> ctuSizeLog2) == ((xPos >> ctuSizeLog2) - 1)) && (ctuSizeLog2 == 7))
-#else
-    if ((refLeftX >> ctuSizeLog2) == ((xPos >> ctuSizeLog2) - 1))
-#endif
     {
       // ref block's collocated block in current CTU
       const Position refPosCol = pu.Y().topLeft().offset(xBv + ctuSize, yBv);
@@ -2274,10 +1672,8 @@ bool PU::isBlockVectorValid(PredictionUnit& pu, int xPos, int yPos, int width, i
       const Position refPosCol64x64 = {offset64x, offset64y};
       if (pu.cs->isDecomp(refPosCol64x64, toChannelType(COMPONENT_Y)))
         return false;
-#if JVET_N0383_N0251_IBC_COL_VPDU_REMOVE
       if (refPosCol64x64 == pu.Y().topLeft())
         return false;
-#endif
     }
   }
   else
@@ -2390,19 +1786,6 @@ void PU::getInterMMVDMergeCandidates(const PredictionUnit &pu, MergeCtx& mrgCtx,
         break;
     }
   }
-#if !JVET_N0448_N0380
-  if (currBaseNum < MMVD_BASE_MV_NUM)
-  {
-    for (k = currBaseNum; k < MMVD_BASE_MV_NUM; k++)
-    {
-      mrgCtx.mmvdBaseMv[k][0] = MvField(Mv(0, 0), 0);
-      const Slice &slice = *pu.cs->slice;
-      mrgCtx.mmvdBaseMv[k][1] = MvField(Mv(0, 0), (slice.isInterB() ? 0 : -1));
-      mrgCtx.GBiIdx[k] = GBI_DEFAULT;
-      mrgCtx.interDirNeighbours[k] = (mrgCtx.mmvdBaseMv[k][0].refIdx >= 0) + (mrgCtx.mmvdBaseMv[k][1].refIdx >= 0) * 2;
-    }
-  }
-#endif
 }
 bool PU::getColocatedMVP(const PredictionUnit &pu, const RefPicList &eRefPicList, const Position &_pos, Mv& rcMv, const int &refIdx )
 {
@@ -2527,7 +1910,6 @@ bool PU::isDiffMER(const PredictionUnit &pu1, const PredictionUnit &pu2)
   return false;
 }
 
-#if JVET_N0329_IBC_SEARCH_IMP
 bool PU::isAddNeighborMv(const Mv& currMv, Mv* neighborMvs, int numNeighborMv)
 {
   bool existed = false;
@@ -2548,15 +1930,9 @@ bool PU::isAddNeighborMv(const Mv& currMv, Mv* neighborMvs, int numNeighborMv)
     return false;
   }
 }
-#endif
 
-#if JVET_N0329_IBC_SEARCH_IMP
 void PU::getIbcMVPsEncOnly(PredictionUnit &pu, Mv* mvPred, int& nbPred)
-#else
-void PU::getIbcMVPsEncOnly(PredictionUnit &pu, Mv* MvPred, int& nbPred)
-#endif
 {
-#if JVET_N0329_IBC_SEARCH_IMP
   const PreCalcValues   &pcv = *pu.cs->pcv;
   const int  cuWidth = pu.blocks[COMPONENT_Y].width;
   const int  cuHeight = pu.blocks[COMPONENT_Y].height;
@@ -2640,76 +2016,6 @@ void PU::getIbcMVPsEncOnly(PredictionUnit &pu, Mv* MvPred, int& nbPred)
       }
     } while (nbPred > curNbPred && nbPred < IBC_NUM_CANDIDATES);
   }
-#else
-  //-- Get Spatial MV
-  Position posLT = pu.Y().topLeft();
-  Position posRT = pu.Y().topRight();
-  Position posLB = pu.Y().bottomLeft();
-
-  unsigned int left = 0, above = 0;
-
-  //left
-  const PredictionUnit *neibLeftPU = NULL;
-  neibLeftPU = pu.cs->getPURestricted(posLB.offset(-1, 0), pu, CHANNEL_TYPE_LUMA);
-  left = (neibLeftPU) ? CU::isIBC(*neibLeftPU->cu) : 0;
-
-  if (left)
-  {
-    MvPred[nbPred++] = neibLeftPU->bv;
-    if (getDerivedBV(pu, MvPred[nbPred - 1], MvPred[nbPred]))
-      nbPred++;
-  }
-
-  //above
-  const PredictionUnit *neibAbovePU = NULL;
-  neibAbovePU = pu.cs->getPURestricted(posRT.offset(0, -1), pu, CHANNEL_TYPE_LUMA);
-  above = (neibAbovePU) ? CU::isIBC(*neibAbovePU->cu) : 0;
-
-  if (above)
-  {
-    MvPred[nbPred++] = neibAbovePU->bv;
-    if (getDerivedBV(pu, MvPred[nbPred - 1], MvPred[nbPred]))
-      nbPred++;
-  }
-
-  // Below Left predictor search
-  const PredictionUnit *neibBelowLeftPU = NULL;
-  neibBelowLeftPU = pu.cs->getPURestricted(posLB.offset(-1, 1), pu, CHANNEL_TYPE_LUMA);
-  unsigned int belowLeft = (neibBelowLeftPU) ? CU::isIBC(*neibBelowLeftPU->cu) : 0;
-
-  if (belowLeft)
-  {
-    MvPred[nbPred++] = neibBelowLeftPU->bv;
-    if (getDerivedBV(pu, MvPred[nbPred - 1], MvPred[nbPred]))
-      nbPred++;
-  }
-
-
-  // Above Right predictor search
-  const PredictionUnit *neibAboveRightPU = NULL;
-  neibAboveRightPU = pu.cs->getPURestricted(posRT.offset(1, -1), pu, CHANNEL_TYPE_LUMA);
-  unsigned int aboveRight = (neibAboveRightPU) ? CU::isIBC(*neibAboveRightPU->cu) : 0;
-
-  if (aboveRight)
-  {
-    MvPred[nbPred++] = neibAboveRightPU->bv;
-    if (getDerivedBV(pu, MvPred[nbPred - 1], MvPred[nbPred]))
-      nbPred++;
-  }
-
-
-  // Above Left predictor search
-  const PredictionUnit *neibAboveLeftPU = NULL;
-  neibAboveLeftPU = pu.cs->getPURestricted(posLT.offset(-1, -1), pu, CHANNEL_TYPE_LUMA);
-  unsigned int aboveLeft = (neibAboveLeftPU) ? CU::isIBC(*neibAboveLeftPU->cu) : 0;
-
-  if (aboveLeft)
-  {
-    MvPred[nbPred++] = neibAboveLeftPU->bv;
-    if (getDerivedBV(pu, MvPred[nbPred - 1], MvPred[nbPred]))
-      nbPred++;
-  }
-#endif
 }
 
 bool PU::getDerivedBV(PredictionUnit &pu, const Mv& currentMv, Mv& derivedMv)
@@ -2744,85 +2050,12 @@ bool PU::getDerivedBV(PredictionUnit &pu, const Mv& currentMv, Mv& derivedMv)
  */
 void PU::fillIBCMvpCand(PredictionUnit &pu, AMVPInfo &amvpInfo)
 {
-#if JVET_N0843_BVP_SIMPLIFICATION==0
-  CodingStructure &cs = *pu.cs;
-#endif
 
   AMVPInfo *pInfo = &amvpInfo;
 
   pInfo->numCand = 0;
 
-#if JVET_N0843_BVP_SIMPLIFICATION==0
-  //-- Get Spatial MV
-  Position posLT = pu.Y().topLeft();
-  Position posRT = pu.Y().topRight();
-  Position posLB = pu.Y().bottomLeft();
-
-  bool isScaledFlagLX = false; /// variable name from specification; true when the PUs below left or left are available (availableA0 || availableA1).
-
-  const PredictionUnit* tmpPU = cs.getPURestricted(posLB.offset(-1, 1), pu, pu.chType); // getPUBelowLeft(idx, partIdxLB);
-  isScaledFlagLX = tmpPU != NULL && CU::isIBC(*tmpPU->cu);
-  if (!isScaledFlagLX)
-  {
-    tmpPU = cs.getPURestricted(posLB.offset(-1, 0), pu, pu.chType);
-    isScaledFlagLX = tmpPU != NULL && CU::isIBC(*tmpPU->cu);
-  }
 
-  // Left predictor search
-  if (isScaledFlagLX)
-  {
-    bool isAdded = addIBCMVPCand(pu, posLB, MD_BELOW_LEFT, *pInfo);
-
-    if (!isAdded)
-    {
-      isAdded = addIBCMVPCand(pu, posLB, MD_LEFT, *pInfo);
-    }
-  }
-
-  // Above predictor search
-  bool isAdded = addIBCMVPCand(pu, posRT, MD_ABOVE_RIGHT, *pInfo);
-
-  if (!isAdded)
-  {
-    isAdded = addIBCMVPCand(pu, posRT, MD_ABOVE, *pInfo);
-
-    if (!isAdded)
-    {
-      addIBCMVPCand(pu, posLT, MD_ABOVE_LEFT, *pInfo);
-    }
-  }
-
-  for( int i = 0; i < pInfo->numCand; i++ )
-  {
-    pInfo->mvCand[i].roundTransPrecInternal2Amvr(pu.cu->imv);
-  }
-
-  if (pInfo->numCand == 2)
-  {
-    if (pInfo->mvCand[0] == pInfo->mvCand[1])
-    {
-      pInfo->numCand = 1;
-    }
-  }
-
-  if (pInfo->numCand < AMVP_MAX_NUM_CANDS)
-  {
-    addAMVPHMVPCand(pu, REF_PIC_LIST_0, REF_PIC_LIST_1, cs.slice->getPOC(), *pInfo, pu.cu->imv);
-  }
-
-  if (pInfo->numCand > AMVP_MAX_NUM_CANDS)
-  {
-    pInfo->numCand = AMVP_MAX_NUM_CANDS;
-  }
-
-  while (pInfo->numCand < AMVP_MAX_NUM_CANDS)
-  {
-    pInfo->mvCand[pInfo->numCand] = Mv(0, 0);
-    pInfo->numCand++;
-  }
-#endif
-
-#if JVET_N0843_BVP_SIMPLIFICATION
   MergeCtx mergeCtx;
   PU::getIBCMergeCandidates(pu, mergeCtx, AMVP_MAX_NUM_CANDS - 1);
   int candIdx = 0;
@@ -2832,13 +2065,10 @@ void PU::fillIBCMvpCand(PredictionUnit &pu, AMVPInfo &amvpInfo)
     pInfo->numCand++;
     candIdx++;
   }
-#endif
 
   for (Mv &mv : pInfo->mvCand)
   {
-#if JVET_N0843_BVP_SIMPLIFICATION
     mv.roundIbcPrecInternal2Amvr(pu.cu->imv);
-#endif
   }
 }
 
@@ -2945,11 +2175,7 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
     }
   }
 
-#if JVET_N0213_TMVP_REMOVAL
-  if (cs.slice->getEnableTMVPFlag() && pInfo->numCand < AMVP_MAX_NUM_CANDS && (pu.lumaSize().width + pu.lumaSize().height > 12))
-#else
-  if( cs.slice->getEnableTMVPFlag() && pInfo->numCand < AMVP_MAX_NUM_CANDS )
-#endif
+  if (cs.slice->getEnableTMVPFlag() && pInfo->numCand < AMVP_MAX_NUM_CANDS && (pu.lumaSize().width + pu.lumaSize().height > 12))
   {
     // Get Temporal Motion Predictor
     const int refIdx_Col = refIdx;
@@ -2961,9 +2187,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
     Position posC0;
     bool C0Avail = false;
     Position posC1 = pu.Y().center();
-#if !JVET_N0266_SMALL_BLOCKS
-    bool C1Avail =  ( posC1.x  < pcv.lumaWidth ) && ( posC1.y < pcv.lumaHeight ) ;
-#endif
     Mv cColMv;
 
     if( ( ( posRB.x + pcv.minCUWidth ) < pcv.lumaWidth ) && ( ( posRB.y + pcv.minCUHeight ) < pcv.lumaHeight ) )
@@ -2975,11 +2198,7 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
         C0Avail = true;
       }
     }
-#if JVET_N0266_SMALL_BLOCKS
     if ( ( C0Avail && getColocatedMVP( pu, eRefPicList, posC0, cColMv, refIdx_Col ) ) || getColocatedMVP( pu, eRefPicList, posC1, cColMv, refIdx_Col ) )
-#else
-    if ((C0Avail && getColocatedMVP(pu, eRefPicList, posC0, cColMv, refIdx_Col)) || (C1Avail && getColocatedMVP(pu, eRefPicList, posC1, cColMv, refIdx_Col)))
-#endif
     {
       cColMv.roundTransPrecInternal2Amvr(pu.cu->imv);
       pInfo->mvCand[pInfo->numCand++] = cColMv;
@@ -3285,9 +2504,6 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
       Position posC0;
       bool C0Avail = false;
       Position posC1 = pu.Y().center();
-#if !JVET_N0266_SMALL_BLOCKS
-      bool C1Avail =  ( posC1.x  < pcv.lumaWidth ) && ( posC1.y < pcv.lumaHeight ) ;
-#endif
       Mv cColMv;
       if ( ((posRB.x + pcv.minCUWidth) < pcv.lumaWidth) && ((posRB.y + pcv.minCUHeight) < pcv.lumaHeight) )
       {  
@@ -3298,11 +2514,7 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
           C0Avail = true;
         }
       }
-#if JVET_N0266_SMALL_BLOCKS
       if ( ( C0Avail && getColocatedMVP( pu, eRefPicList, posC0, cColMv, refIdxCol ) ) || getColocatedMVP( pu, eRefPicList, posC1, cColMv, refIdxCol ) )
-#else
-      if ( (C0Avail && getColocatedMVP( pu, eRefPicList, posC0, cColMv, refIdxCol )) || (C1Avail && getColocatedMVP( pu, eRefPicList, posC1, cColMv, refIdxCol ) ) )
-#endif
       {
         cColMv.roundAffinePrecInternal2Amvr(pu.cu->imv);
         affiAMVPInfo.mvCandLT[affiAMVPInfo.numCand] = cColMv;
@@ -3553,20 +2765,14 @@ bool PU::isBipredRestriction(const PredictionUnit &pu)
   {
     return true;
   }
-#if JVET_N0266_SMALL_BLOCKS
   /* disable bi-prediction for 4x8/8x4 */
   if ( pu.cu->lumaSize().width + pu.cu->lumaSize().height == 12 )
   {
     return true;
   }
-#endif
   return false;
 }
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
 void PU::getAffineControlPointCand(const PredictionUnit &pu, MotionInfo mi[4], int8_t neighGbi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgType)
-#else
-void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgType )
-#endif
 {
   int cuW = pu.Y().width;
   int cuH = pu.Y().height;
@@ -3578,9 +2784,7 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
   Mv cMv[2][4];
   int refIdx[2] = { -1, -1 };
   int dir = 0;
-#if  JVET_N0481_BCW_CONSTRUCTED_AFFINE
   int8_t gbiIdx = GBI_DEFAULT;
-#endif
   EAffineModel curType = (verNum == 2) ? AFFINEMODEL_4PARAM : AFFINEMODEL_6PARAM;
 
   if ( verNum == 2 )
@@ -3603,7 +2807,6 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
         }
       }
     }
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
     if (dir == 3)
     {
       if (neighGbi[idx0] == neighGbi[idx1])
@@ -3612,7 +2815,6 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
       }
     }
 
-#endif
   }
   else if ( verNum == 3 )
   {
@@ -3634,7 +2836,6 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
         }
       }
     }
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
     int gbiClass[5] = { -1,0,0,0,1 };
     if (dir == 3)
     {
@@ -3658,7 +2859,6 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
 
     }
 
-#endif
   }
 
   if ( dir == 0 )
@@ -3685,25 +2885,19 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
       case 1: // 1 : LT, RT, RB
         cMv[l][2].hor = cMv[l][3].hor + cMv[l][0].hor - cMv[l][1].hor;
         cMv[l][2].ver = cMv[l][3].ver + cMv[l][0].ver - cMv[l][1].ver;
-#if JVET_N0334_MVCLIPPING
         cMv[l][2].clipToStorageBitDepth();
-#endif
         break;
 
       case 2: // 2 : LT, LB, RB
         cMv[l][1].hor = cMv[l][3].hor + cMv[l][0].hor - cMv[l][2].hor;
         cMv[l][1].ver = cMv[l][3].ver + cMv[l][0].ver - cMv[l][2].ver;
-#if JVET_N0334_MVCLIPPING
         cMv[l][1].clipToStorageBitDepth();
-#endif
         break;
 
       case 3: // 3 : RT, LB, RB
         cMv[l][0].hor = cMv[l][1].hor + cMv[l][2].hor - cMv[l][3].hor;
         cMv[l][0].ver = cMv[l][1].ver + cMv[l][2].ver - cMv[l][3].ver;
-#if JVET_N0334_MVCLIPPING
         cMv[l][0].clipToStorageBitDepth();
-#endif
         break;
 
       case 4: // 4 : LT, RT
@@ -3714,9 +2908,7 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
         vy = (cMv[l][0].ver << shift) - ((cMv[l][2].hor - cMv[l][0].hor) << shiftHtoW);
         roundAffineMv( vx, vy, shift );
         cMv[l][1].set( vx, vy );
-#if JVET_N0334_MVCLIPPING
         cMv[l][1].clipToStorageBitDepth();
-#endif
         break;
 
       default:
@@ -3744,9 +2936,7 @@ void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4],
   }
   affMrgType.interDirNeighbours[affMrgType.numValidMergeCand] = dir;
   affMrgType.affineType[affMrgType.numValidMergeCand] = curType;
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
   affMrgType.GBiIdx[affMrgType.numValidMergeCand] = gbiIdx;
-#endif
   affMrgType.numValidMergeCand++;
 
 
@@ -3953,9 +3143,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
     {
       MotionInfo mi[4];
       bool isAvailable[4] = { false };
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
       int8_t neighGbi[4] = { GBI_DEFAULT, GBI_DEFAULT, GBI_DEFAULT, GBI_DEFAULT };
-#endif
       // control point: LT B2->B3->A2
       const Position posLT[3] = { pu.Y().topLeft().offset( -1, -1 ), pu.Y().topLeft().offset( 0, -1 ), pu.Y().topLeft().offset( -1, 0 ) };
       for ( int i = 0; i < 3; i++ )
@@ -3968,9 +3156,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
         {
           isAvailable[0] = true;
           mi[0] = puNeigh->getMotionInfo( pos );
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
           neighGbi[0] = puNeigh->cu->GBiIdx;
-#endif
           break;
         }
       }
@@ -3988,9 +3174,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
         {
           isAvailable[1] = true;
           mi[1] = puNeigh->getMotionInfo( pos );
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
           neighGbi[1] = puNeigh->cu->GBiIdx;
-#endif
           break;
         }
       }
@@ -4008,9 +3192,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
         {
           isAvailable[2] = true;
           mi[2] = puNeigh->getMotionInfo( pos );
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
           neighGbi[2] = puNeigh->cu->GBiIdx;
-#endif
           break;
         }
       }
@@ -4077,11 +3259,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
       for ( int idx = startIdx; idx < modelNum; idx++ )
       {
         int modelIdx = order[idx];
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
         getAffineControlPointCand(pu, mi, neighGbi, isAvailable, model[modelIdx], modelIdx, verNum[modelIdx], affMrgCtx);
-#else
-        getAffineControlPointCand( pu, mi, isAvailable, model[modelIdx], modelIdx, verNum[modelIdx], affMrgCtx );
-#endif
         if ( affMrgCtx.numValidMergeCand != 0 && affMrgCtx.numValidMergeCand - 1 == mrgCandIdx )
         {
           return;
@@ -4141,15 +3319,10 @@ void PU::setAllAffineMvField( PredictionUnit &pu, MvField *mvField, RefPicList e
   pu.refIdx[eRefList] = mvField[0].refIdx;
 }
 
-#if JVET_N0334_MVCLIPPING
 void PU::setAllAffineMv(PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList, bool clipCPMVs)
-#else
-void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList)
-#endif
 {
   int width  = pu.Y().width;
   int shift = MAX_CU_DEPTH;
-#if JVET_N0334_MVCLIPPING
   if (clipCPMVs)
   {
     affLT.mvCliptoStorageBitDepth();
@@ -4159,7 +3332,6 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
       affLB.mvCliptoStorageBitDepth();
     }
   }
-#endif
   int deltaMvHorX, deltaMvHorY, deltaMvVerX, deltaMvVerY;
   deltaMvHorX = (affRT - affLT).getHor() << (shift - g_aucLog2[width]);
   deltaMvHorY = (affRT - affLT).getVer() << (shift - g_aucLog2[width]);
@@ -4185,28 +3357,22 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
 
   MotionBuf mb = pu.getMotionBuf();
   int mvScaleTmpHor, mvScaleTmpVer;
-#if JVET_N0068_AFFINE_MEM_BW
   const bool subblkMVSpreadOverLimit = InterPrediction::isSubblockVectorSpreadOverLimit( deltaMvHorX, deltaMvHorY, deltaMvVerX, deltaMvVerY, pu.interDir );
-#endif
   for ( int h = 0; h < pu.Y().height; h += blockHeight )
   {
     for ( int w = 0; w < pu.Y().width; w += blockWidth )
     {
-#if JVET_N0068_AFFINE_MEM_BW
       if ( !subblkMVSpreadOverLimit )
       {
-#endif
         mvScaleTmpHor = mvScaleHor + deltaMvHorX * (halfBW + w) + deltaMvVerX * (halfBH + h);
         mvScaleTmpVer = mvScaleVer + deltaMvHorY * (halfBW + w) + deltaMvVerY * (halfBH + h);
 
-#if JVET_N0068_AFFINE_MEM_BW
       }
       else
       {
         mvScaleTmpHor = mvScaleHor + deltaMvHorX * ( pu.Y().width >> 1 ) + deltaMvVerX * ( pu.Y().height >> 1 );
         mvScaleTmpVer = mvScaleVer + deltaMvHorY * ( pu.Y().width >> 1 ) + deltaMvVerY * ( pu.Y().height >> 1 );
       }
-#endif
       roundAffineMv( mvScaleTmpHor, mvScaleTmpVer, shift );
       Mv curMv(mvScaleTmpHor, mvScaleTmpVer);
       curMv.clipToStorageBitDepth();
@@ -4579,9 +3745,7 @@ void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interP
       pu.mvpNum[0] = amvpInfo.numCand;
       pu.mvpIdx[0] = mvp_idx;
       pu.mv    [0] = amvpInfo.mvCand[mvp_idx] + pu.mvd[0];
-#if JVET_N0334_MVCLIPPING
       pu.mv[0].mvCliptoStorageBitDepth();
-#endif
     }
 
     if (pu.interDir != 1 /* PRED_L0 */)
@@ -4596,9 +3760,7 @@ void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interP
       pu.mvpNum[1] = amvpInfo.numCand;
       pu.mvpIdx[1] = mvp_idx;
       pu.mv    [1] = amvpInfo.mvCand[mvp_idx] + pu.mvd[1];
-#if JVET_N0334_MVCLIPPING
       pu.mv[1].mvCliptoStorageBitDepth();
-#endif
     }
   }
   else
@@ -4679,7 +3841,6 @@ void PU::restrictBiPredMergeCandsOne(PredictionUnit &pu)
 
 void PU::getTriangleMergeCandidates( const PredictionUnit &pu, MergeCtx& triangleMrgCtx )
 {
-#if JVET_N0340_TRI_MERGE_CAND
   MergeCtx tmpMergeCtx;
 
   const Slice &slice = *pu.cs->slice;
@@ -4734,353 +3895,6 @@ void PU::getTriangleMergeCandidates( const PredictionUnit &pu, MergeCtx& triangl
       }
     }
   }
-#else
-
-  const CodingStructure &cs  = *pu.cs;
-  const Slice &slice         = *pu.cs->slice;
-  const int32_t maxNumMergeCand = TRIANGLE_MAX_NUM_UNI_CANDS;
-  triangleMrgCtx.numValidMergeCand = 0;
-
-  for( int32_t i = 0; i < maxNumMergeCand; i++ )
-  {
-    triangleMrgCtx.interDirNeighbours[i] = 0;
-    triangleMrgCtx.mrgTypeNeighbours [i] = MRG_TYPE_DEFAULT_N;
-    triangleMrgCtx.mvFieldNeighbours[(i << 1)    ].refIdx = NOT_VALID;
-    triangleMrgCtx.mvFieldNeighbours[(i << 1) + 1].refIdx = NOT_VALID;
-    triangleMrgCtx.mvFieldNeighbours[(i << 1)    ].mv = Mv();
-    triangleMrgCtx.mvFieldNeighbours[(i << 1) + 1].mv = Mv();
-  }
-
-  MotionInfo candidate[TRIANGLE_MAX_NUM_CANDS_MEM];
-  int32_t candCount = 0;
-
-  const Position posLT = pu.Y().topLeft();
-  const Position posRT = pu.Y().topRight();
-  const Position posLB = pu.Y().bottomLeft();
-
-  MotionInfo miAbove, miLeft, miAboveLeft, miAboveRight, miBelowLeft;
-
-  //left
-  const PredictionUnit* puLeft = cs.getPURestricted( posLB.offset( -1, 0 ), pu, pu.chType );
-  const bool isAvailableA1 = puLeft && isDiffMER( pu, *puLeft ) && pu.cu != puLeft->cu && CU::isInter( *puLeft->cu )
-    ;
-  if( isAvailableA1 )
-  {
-    miLeft = puLeft->getMotionInfo( posLB.offset(-1, 0) );
-    candidate[candCount].isInter   = true;
-    candidate[candCount].interDir  = miLeft.interDir;
-    candidate[candCount].mv[0]     = miLeft.mv[0];
-    candidate[candCount].mv[1]     = miLeft.mv[1];
-    candidate[candCount].refIdx[0] = miLeft.refIdx[0];
-    candidate[candCount].refIdx[1] = miLeft.refIdx[1];
-    candCount++;
-  }
-
-  // above
-  const PredictionUnit *puAbove = cs.getPURestricted( posRT.offset( 0, -1 ), pu, pu.chType );
-  bool isAvailableB1 = puAbove && isDiffMER( pu, *puAbove ) && pu.cu != puAbove->cu && CU::isInter( *puAbove->cu )
-    ;
-  if( isAvailableB1 )
-  {
-    miAbove = puAbove->getMotionInfo( posRT.offset( 0, -1 ) );
-
-    if( !isAvailableA1 || ( miAbove != miLeft ) )
-    {
-      candidate[candCount].isInter   = true;
-      candidate[candCount].interDir  = miAbove.interDir;
-      candidate[candCount].mv[0]     = miAbove.mv[0];
-      candidate[candCount].mv[1]     = miAbove.mv[1];
-      candidate[candCount].refIdx[0] = miAbove.refIdx[0];
-      candidate[candCount].refIdx[1] = miAbove.refIdx[1];
-      candCount++;
-    }
-  }
-
-  // above right
-  const PredictionUnit *puAboveRight = cs.getPURestricted( posRT.offset( 1, -1 ), pu, pu.chType );
-  bool isAvailableB0 = puAboveRight && isDiffMER( pu, *puAboveRight ) && CU::isInter( *puAboveRight->cu )
-    ;
-
-  if( isAvailableB0 )
-  {
-    miAboveRight = puAboveRight->getMotionInfo( posRT.offset( 1, -1 ) );
-
-    if( ( !isAvailableB1 || ( miAbove != miAboveRight ) ) && ( !isAvailableA1 || ( miLeft != miAboveRight ) ) )
-    {
-      candidate[candCount].isInter   = true;
-      candidate[candCount].interDir  = miAboveRight.interDir;
-      candidate[candCount].mv[0]     = miAboveRight.mv[0];
-      candidate[candCount].mv[1]     = miAboveRight.mv[1];
-      candidate[candCount].refIdx[0] = miAboveRight.refIdx[0];
-      candidate[candCount].refIdx[1] = miAboveRight.refIdx[1];
-      candCount++;
-    }
-  }
-
-  //left bottom
-  const PredictionUnit *puLeftBottom = cs.getPURestricted( posLB.offset( -1, 1 ), pu, pu.chType );
-  bool isAvailableA0 = puLeftBottom && isDiffMER( pu, *puLeftBottom ) && CU::isInter( *puLeftBottom->cu )
-    ;
-  if( isAvailableA0 )
-  {
-    miBelowLeft = puLeftBottom->getMotionInfo( posLB.offset( -1, 1 ) );
-
-    if( ( !isAvailableA1 || ( miBelowLeft != miLeft ) ) && ( !isAvailableB1 || ( miBelowLeft != miAbove ) ) && ( !isAvailableB0 || ( miBelowLeft != miAboveRight ) ) )
-    {
-      candidate[candCount].isInter   = true;
-      candidate[candCount].interDir  = miBelowLeft.interDir;
-      candidate[candCount].mv[0]     = miBelowLeft.mv[0];
-      candidate[candCount].mv[1]     = miBelowLeft.mv[1];
-      candidate[candCount].refIdx[0] = miBelowLeft.refIdx[0];
-      candidate[candCount].refIdx[1] = miBelowLeft.refIdx[1];
-      candCount++;
-    }
-  }
-
-  // above left
-  const PredictionUnit *puAboveLeft = cs.getPURestricted( posLT.offset( -1, -1 ), pu, pu.chType );
-  bool isAvailableB2 = puAboveLeft && isDiffMER( pu, *puAboveLeft ) && CU::isInter( *puAboveLeft->cu )
-    ;
-
-  if( isAvailableB2 )
-  {
-    miAboveLeft = puAboveLeft->getMotionInfo( posLT.offset( -1, -1 ) );
-
-    if( ( !isAvailableA1 || ( miLeft != miAboveLeft ) ) && ( !isAvailableB1 || ( miAbove != miAboveLeft ) ) && ( !isAvailableA0 || ( miBelowLeft != miAboveLeft ) ) && ( !isAvailableB0 || ( miAboveRight != miAboveLeft ) ) )
-    {
-      candidate[candCount].isInter   = true;
-      candidate[candCount].interDir  = miAboveLeft.interDir;
-      candidate[candCount].mv[0]     = miAboveLeft.mv[0];
-      candidate[candCount].mv[1]     = miAboveLeft.mv[1];
-      candidate[candCount].refIdx[0] = miAboveLeft.refIdx[0];
-      candidate[candCount].refIdx[1] = miAboveLeft.refIdx[1];
-      candCount++;
-    }
-  }
-
-  if( slice.getEnableTMVPFlag() )
-  {
-    Position posRB = pu.Y().bottomRight().offset(-3, -3);
-
-    const PreCalcValues& pcv = *cs.pcv;
-
-    Position posC0;
-    Position posC1 = pu.Y().center();
-    bool isAvailableC0 = false;
-#if !JVET_N0266_SMALL_BLOCKS
-    bool isAvailableC1 = (posC1.x < pcv.lumaWidth) && (posC1.y < pcv.lumaHeight);
-#endif
-    if (((posRB.x + pcv.minCUWidth) < pcv.lumaWidth) && ((posRB.y + pcv.minCUHeight) < pcv.lumaHeight))
-    {
-      Position posInCtu( posRB.x & pcv.maxCUWidthMask, posRB.y & pcv.maxCUHeightMask );
-
-      if( ( posInCtu.x + 4 < pcv.maxCUWidth ) &&           // is not at the last column of CTU
-          ( posInCtu.y + 4 < pcv.maxCUHeight ) )           // is not at the last row    of CTU
-      {
-        posC0 = posRB.offset( 4, 4 );
-        isAvailableC0 = true;
-      }
-      else if( posInCtu.x + 4 < pcv.maxCUWidth )           // is not at the last column of CTU But is last row of CTU
-      {
-        posC0 = posRB.offset( 4, 4 );
-        // in the reference the CTU address is not set - thus probably resulting in no using this C0 possibility
-      }
-      else if( posInCtu.y + 4 < pcv.maxCUHeight )          // is not at the last row of CTU But is last column of CTU
-      {
-        posC0 = posRB.offset( 4, 4 );
-        isAvailableC0 = true;
-      }
-      else //is the right bottom corner of CTU
-      {
-        posC0 = posRB.offset( 4, 4 );
-        // same as for last column but not last row
-      }
-    }
-
-    // C0
-    Mv        cColMv;
-    int32_t   refIdx     = 0;
-    bool      existMV    = ( isAvailableC0 && getColocatedMVP( pu, REF_PIC_LIST_0, posC0, cColMv, refIdx ) );
-    MotionInfo temporalMv;
-    temporalMv.interDir  = 0;
-    if( existMV )
-    {
-      temporalMv.isInter   = true;
-      temporalMv.interDir |= 1;
-      temporalMv.mv[0]     = cColMv;
-      temporalMv.refIdx[0] = refIdx;
-    }
-    existMV = ( isAvailableC0 && getColocatedMVP( pu, REF_PIC_LIST_1, posC0, cColMv, refIdx ) );
-    if( existMV )
-    {
-      temporalMv.interDir |= 2;
-      temporalMv.mv[1]     = cColMv;
-      temporalMv.refIdx[1] = refIdx;
-    }
-
-    if( temporalMv.interDir != 0 )
-    {
-      candidate[candCount].isInter   = true;
-      candidate[candCount].interDir  = temporalMv.interDir;
-      candidate[candCount].mv[0]     = temporalMv.mv[0];
-      candidate[candCount].mv[1]     = temporalMv.mv[1];
-      candidate[candCount].refIdx[0] = temporalMv.refIdx[0];
-      candidate[candCount].refIdx[1] = temporalMv.refIdx[1];
-      candCount++;
-    }
-
-    // C1
-    temporalMv.interDir = 0;
-#if JVET_N0266_SMALL_BLOCKS
-    existMV = getColocatedMVP( pu, REF_PIC_LIST_0, posC1, cColMv, refIdx );
-#else
-    existMV    = isAvailableC1 && getColocatedMVP(pu, REF_PIC_LIST_0, posC1, cColMv, refIdx );
-#endif
-    if( existMV )
-    {
-      temporalMv.isInter   = true;
-      temporalMv.interDir |= 1;
-      temporalMv.mv[0]     = cColMv;
-      temporalMv.refIdx[0] = refIdx;
-    }
-#if JVET_N0266_SMALL_BLOCKS
-    existMV = getColocatedMVP( pu, REF_PIC_LIST_1, posC1, cColMv, refIdx );
-#else
-    existMV    = isAvailableC1 && getColocatedMVP(pu, REF_PIC_LIST_1, posC1, cColMv, refIdx );
-#endif
-    if( existMV )
-    {
-      temporalMv.interDir |= 2;
-      temporalMv.mv[1]     = cColMv;
-      temporalMv.refIdx[1] = refIdx;
-    }
-
-    if( temporalMv.interDir != 0 )
-    {
-      candidate[candCount].isInter   = true;
-      candidate[candCount].interDir  = temporalMv.interDir;
-      candidate[candCount].mv[0]     = temporalMv.mv[0];
-      candidate[candCount].mv[1]     = temporalMv.mv[1];
-      candidate[candCount].refIdx[0] = temporalMv.refIdx[0];
-      candidate[candCount].refIdx[1] = temporalMv.refIdx[1];
-      candCount++;
-    }
-  }
-  // put uni-prediction candidate to the triangle candidate list
-  for( int32_t i = 0; i < candCount; i++ )
-  {
-    if( candidate[i].interDir != 3 )
-    {
-      triangleMrgCtx.interDirNeighbours[triangleMrgCtx.numValidMergeCand] = candidate[i].interDir;
-      triangleMrgCtx.mrgTypeNeighbours [triangleMrgCtx.numValidMergeCand] = MRG_TYPE_DEFAULT_N;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].mv = candidate[i].mv[0];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].mv = candidate[i].mv[1];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].refIdx = candidate[i].refIdx[0];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].refIdx = candidate[i].refIdx[1];
-      triangleMrgCtx.numValidMergeCand += isUniqueTriangleCandidates(pu, triangleMrgCtx);
-      if( triangleMrgCtx.numValidMergeCand == TRIANGLE_MAX_NUM_UNI_CANDS )
-      {
-        return;
-      }
-    }
-  }
-
-  // put L0 mv of bi-prediction candidate to the triangle candidate list
-  for( int32_t i = 0; i < candCount; i++ )
-  {
-    if( candidate[i].interDir == 3 )
-    {
-      triangleMrgCtx.interDirNeighbours[triangleMrgCtx.numValidMergeCand] = 1;
-      triangleMrgCtx.mrgTypeNeighbours [triangleMrgCtx.numValidMergeCand] = MRG_TYPE_DEFAULT_N;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].mv = candidate[i].mv[0];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].mv = Mv(0, 0);
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].refIdx = candidate[i].refIdx[0];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].refIdx = -1;
-      triangleMrgCtx.numValidMergeCand += isUniqueTriangleCandidates(pu, triangleMrgCtx);
-      if( triangleMrgCtx.numValidMergeCand == TRIANGLE_MAX_NUM_UNI_CANDS )
-      {
-        return;
-      }
-    }
-  }
-
-  // put L1 mv of bi-prediction candidate to the triangle candidate list
-  for( int32_t i = 0; i < candCount; i++ )
-  {
-    if( candidate[i].interDir == 3 )
-    {
-      triangleMrgCtx.interDirNeighbours[triangleMrgCtx.numValidMergeCand] = 2;
-      triangleMrgCtx.mrgTypeNeighbours [triangleMrgCtx.numValidMergeCand] = MRG_TYPE_DEFAULT_N;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].mv = Mv(0, 0);
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].mv = candidate[i].mv[1];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].refIdx = -1;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].refIdx = candidate[i].refIdx[1];
-      triangleMrgCtx.numValidMergeCand += isUniqueTriangleCandidates(pu, triangleMrgCtx);
-      if( triangleMrgCtx.numValidMergeCand == TRIANGLE_MAX_NUM_UNI_CANDS )
-      {
-        return;
-      }
-    }
-  }
-
-  // put average of L0 and L1 mvs of bi-prediction candidate to the triangle candidate list
-  for( int32_t i = 0; i < candCount; i++ )
-  {
-    if( candidate[i].interDir == 3 )
-    {
-      int32_t curPicPoc   = slice.getPOC();
-      int32_t refPicPocL0 = slice.getRefPOC(REF_PIC_LIST_0, candidate[i].refIdx[0]);
-      int32_t refPicPocL1 = slice.getRefPOC(REF_PIC_LIST_1, candidate[i].refIdx[1]);
-      Mv aveMv = candidate[i].mv[1];
-      int32_t distscale = xGetDistScaleFactor( curPicPoc, refPicPocL0, curPicPoc, refPicPocL1 );
-      if( distscale != 4096 )
-      {
-        aveMv = aveMv.scaleMv( distscale ); // scaling to L0
-      }
-      aveMv = aveMv + candidate[i].mv[0];
-      roundAffineMv(aveMv.hor, aveMv.ver, 1);
-      triangleMrgCtx.interDirNeighbours[triangleMrgCtx.numValidMergeCand] = 1;
-      triangleMrgCtx.mrgTypeNeighbours [triangleMrgCtx.numValidMergeCand] = MRG_TYPE_DEFAULT_N;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].mv = aveMv;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].mv = Mv(0, 0);
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1)    ].refIdx = candidate[i].refIdx[0];
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1].refIdx = -1;
-      triangleMrgCtx.numValidMergeCand += isUniqueTriangleCandidates(pu, triangleMrgCtx);
-      if( triangleMrgCtx.numValidMergeCand == TRIANGLE_MAX_NUM_UNI_CANDS )
-      {
-        return;
-      }
-    }
-  }
-
-  // fill with Mv(0, 0)
-  int32_t numRefIdx = std::min( slice.getNumRefIdx(REF_PIC_LIST_0), slice.getNumRefIdx(REF_PIC_LIST_1) );
-  int32_t cnt = 0;
-  while( triangleMrgCtx.numValidMergeCand < TRIANGLE_MAX_NUM_UNI_CANDS )
-  {
-    if( cnt < numRefIdx )
-    {
-      triangleMrgCtx.interDirNeighbours[triangleMrgCtx.numValidMergeCand] = 1;
-      triangleMrgCtx.mvFieldNeighbours[triangleMrgCtx.numValidMergeCand << 1].setMvField(Mv(0, 0), cnt);
-      triangleMrgCtx.mvFieldNeighbours[(triangleMrgCtx.numValidMergeCand << 1) + 1].refIdx = NOT_VALID;
-      triangleMrgCtx.mvFieldNeighbours[(triangleMrgCtx.numValidMergeCand << 1) + 1].mv = Mv();
-      triangleMrgCtx.numValidMergeCand++;
-
-      if( triangleMrgCtx.numValidMergeCand == TRIANGLE_MAX_NUM_UNI_CANDS )
-      {
-        return;
-      }
-
-      triangleMrgCtx.interDirNeighbours[triangleMrgCtx.numValidMergeCand] = 2;
-      triangleMrgCtx.mvFieldNeighbours [(triangleMrgCtx.numValidMergeCand << 1) + 1 ].setMvField(Mv(0, 0), cnt);
-      triangleMrgCtx.mvFieldNeighbours[triangleMrgCtx.numValidMergeCand << 1].refIdx = NOT_VALID;
-      triangleMrgCtx.mvFieldNeighbours[triangleMrgCtx.numValidMergeCand << 1].mv = Mv();
-      triangleMrgCtx.numValidMergeCand++;
-
-      cnt = (cnt + 1) % numRefIdx;
-    }
-  }
-#endif
 }
 
 bool PU::isUniqueTriangleCandidates( const PredictionUnit &pu, MergeCtx& triangleMrgCtx )
@@ -5360,35 +4174,11 @@ int CU::getMaxNeighboriMVCandNum( const CodingStructure& cs, const Position& pos
   int        maxImvNumCand  = 0;
 
   // Get BCBP of left PU
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const CodingUnit *cuLeft  = cs.getCURestricted( pos.offset( -1, 0 ), pos, cs.slice->getIndependentSliceIdx(), cs.picture->brickMap->getBrickIdxRsMap( pos ), CH_L );
-#else
-  const CodingUnit *cuLeft  = cs.getCURestricted( pos.offset( -1, 0 ), cs.slice->getIndependentSliceIdx(), cs.picture->brickMap->getBrickIdxRsMap( pos ), CH_L );
-#endif
-#else
-#if JVET_N0150_ONE_CTU_DELAY_WPP
-  const CodingUnit *cuLeft  = cs.getCURestricted( pos.offset( -1, 0 ), pos, cs.slice->getIndependentSliceIdx(), cs.picture->tileMap->getTileIdxMap( pos ), CH_L );
-#else
-  const CodingUnit *cuLeft  = cs.getCURestricted( pos.offset( -1, 0 ), cs.slice->getIndependentSliceIdx(), cs.picture->tileMap->getTileIdxMap( pos ), CH_L );
-#endif
-#endif
   maxImvNumCand = ( cuLeft ) ? cuLeft->imvNumCand : numDefault;
 
   // Get BCBP of above PU
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   const CodingUnit *cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), pos, cs.slice->getIndependentSliceIdx(), cs.picture->brickMap->getBrickIdxRsMap( pos ), CH_L );
-#else
-  const CodingUnit *cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), cs.slice->getIndependentSliceIdx(), cs.picture->brickMap->getBrickIdxRsMap( pos ), CH_L );
-#endif
-#else
-#if JVET_N0150_ONE_CTU_DELAY_WPP
-  const CodingUnit *cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), pos, cs.slice->getIndependentSliceIdx(), cs.picture->tileMap->getTileIdxMap( pos ), CH_L );
-#else
-  const CodingUnit *cuAbove = cs.getCURestricted( pos.offset( 0, -1 ), cs.slice->getIndependentSliceIdx(), cs.picture->tileMap->getTileIdxMap( pos ), CH_L );
-#endif
-#endif
   maxImvNumCand = std::max( maxImvNumCand, ( cuAbove ) ? cuAbove->imvNumCand : numDefault );
 
   return maxImvNumCand;
@@ -5629,7 +4419,6 @@ uint8_t CU::deriveGbiIdx( uint8_t gbiLO, uint8_t gbiL1 )
   }
 }
 
-#if JVET_N0413_RDPCM
 bool CU::bdpcmAllowed( const CodingUnit& cu, const ComponentID compID )
 {
   bool bdpcmAllowed = compID == COMPONENT_Y;
@@ -5638,7 +4427,6 @@ bool CU::bdpcmAllowed( const CodingUnit& cu, const ComponentID compID )
 
   return bdpcmAllowed;
 }
-#endif
 // TU tools
 
 bool TU::isNonTransformedResidualRotated(const TransformUnit &tu, const ComponentID &compID)
@@ -5672,9 +4460,7 @@ bool TU::isTSAllowed(const TransformUnit &tu, const ComponentID compID)
   tsAllowed &= tu.cs->pps->getUseTransformSkip();
   tsAllowed &= !tu.cu->transQuantBypass;
   tsAllowed &= ( !tu.cu->ispMode || !isLuma(compID) );
-#if JVET_N0413_RDPCM
   tsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE );
-#endif
   SizeType transformSkipMaxSize = 1 << maxSize;
   tsAllowed &= tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize;
   tsAllowed &= !tu.cu->sbtInfo;
@@ -5691,9 +4477,7 @@ bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID)
   mtsAllowed &= ( tu.lwidth() <= maxSize && tu.lheight() <= maxSize );
   mtsAllowed &= !tu.cu->ispMode;
   mtsAllowed &= !tu.cu->sbtInfo;
-#if JVET_N0413_RDPCM
   mtsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE );
-#endif
   return mtsAllowed;
 }
 
@@ -5715,61 +4499,6 @@ uint32_t TU::getGolombRiceStatisticsIndex(const TransformUnit &tu, const Compone
   return selectedIndex;
 }
 
-#if HEVC_USE_MDCS
-uint32_t TU::getCoefScanIdx(const TransformUnit &tu, const ComponentID &compID)
-{
-  //------------------------------------------------
-
-  //this mechanism is available for intra only
-
-  if( !CU::isIntra( *tu.cu ) )
-  {
-    return SCAN_DIAG;
-  }
-
-  //------------------------------------------------
-
-  //check that MDCS can be used for this TU
-
-
-  const CompArea &area      = tu.blocks[compID];
-  const SPS &sps            = *tu.cs->sps;
-  const ChromaFormat format = sps.getChromaFormatIdc();
-
-
-  const uint32_t maximumWidth  = MDCS_MAXIMUM_WIDTH  >> getComponentScaleX(compID, format);
-  const uint32_t maximumHeight = MDCS_MAXIMUM_HEIGHT >> getComponentScaleY(compID, format);
-
-  if ((area.width > maximumWidth) || (area.height > maximumHeight))
-  {
-    return SCAN_DIAG;
-  }
-
-  //------------------------------------------------
-
-  //otherwise, select the appropriate mode
-
-  const PredictionUnit &pu = *tu.cs->getPU( area.pos(), toChannelType( compID ) );
-
-  uint32_t uiDirMode = PU::getFinalIntraMode(pu, toChannelType(compID));
-
-  //------------------
-
-       if (abs((int) uiDirMode - VER_IDX) <= MDCS_ANGLE_LIMIT)
-  {
-    return SCAN_HOR;
-  }
-  else if (abs((int) uiDirMode - HOR_IDX) <= MDCS_ANGLE_LIMIT)
-  {
-    return SCAN_VER;
-  }
-  else
-  {
-    return SCAN_DIAG;
-  }
-}
-
-#endif
 bool TU::hasCrossCompPredInfo( const TransformUnit &tu, const ComponentID &compID )
 {
   return (isChroma(compID) && tu.cs->pps->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() && TU::getCbf(tu, COMPONENT_Y) &&
@@ -5781,11 +4510,7 @@ uint32_t TU::getNumNonZeroCoeffsNonTS( const TransformUnit& tu, const bool bLuma
   uint32_t count = 0;
   for( uint32_t i = 0; i < ::getNumberValidTBlocks( *tu.cs->pcv ); i++ )
   {
-#if JVET_N0193_LFNST
     if( tu.blocks[ i ].valid() && tu.mtsIdx != MTS_SKIP && TU::getCbf( tu, ComponentID( i ) ) )
-#else
-    if( tu.blocks[i].valid() && ( isLuma(ComponentID(i)) ? tu.mtsIdx !=MTS_SKIP : true ) && TU::getCbf( tu, ComponentID( i ) ) )
-#endif
     {
       if( isLuma  ( tu.blocks[i].compID ) && !bLuma   ) continue;
       if( isChroma( tu.blocks[i].compID ) && !bChroma ) continue;
@@ -5801,7 +4526,6 @@ uint32_t TU::getNumNonZeroCoeffsNonTS( const TransformUnit& tu, const bool bLuma
   return count;
 }
 
-#if JVET_N0193_LFNST
 uint32_t TU::getNumNonZeroCoeffsNonTSCorner8x8( const TransformUnit& tu, const bool lumaFlag, const bool chromaFlag )
 {
   const uint32_t lumaWidth       = tu.blocks[ 0 ].width,  chromaWidth  = tu.blocks[ 1 ].width;
@@ -5843,7 +4567,6 @@ uint32_t TU::getNumNonZeroCoeffsNonTSCorner8x8( const TransformUnit& tu, const b
   }
   return count;
 }
-#endif
 
 bool TU::needsSqrt2Scale( const TransformUnit &tu, const ComponentID &compID )
 {
@@ -5852,22 +4575,11 @@ bool TU::needsSqrt2Scale( const TransformUnit &tu, const ComponentID &compID )
   return (!isTransformSkip) && (((g_aucLog2[size.width] + g_aucLog2[size.height]) & 1) == 1);
 }
 
-#if HM_QTBT_AS_IN_JEM_QUANT
 
 bool TU::needsBlockSizeTrafoScale( const TransformUnit &tu, const ComponentID &compID )
 {
   return needsSqrt2Scale( tu, compID ) || isNonLog2BlockSize( tu.blocks[compID] );
 }
-#else
-bool TU::needsQP3Offset(const TransformUnit &tu, const ComponentID &compID)
-{
-  if( !tu.transformSkip[compID] )
-  {
-    return ( ( ( g_aucLog2[tu.blocks[compID].width] + g_aucLog2[tu.blocks[compID].height] ) & 1 ) == 1 );
-  }
-  return false;
-}
-#endif
 
 
 TransformUnit* TU::getPrevTU( const TransformUnit &tu, const ComponentID compID )
@@ -5888,40 +4600,6 @@ bool TU::getPrevTuCbfAtDepth( const TransformUnit &currentTu, const ComponentID
   return ( prevTU != nullptr ) ? TU::getCbfAtDepth( *prevTU, compID, trDepth ) : false;
 }
 
-#if !JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
-void TU::getTransformTypeISP( const TransformUnit &tu, const ComponentID compID, int &typeH, int &typeV )
-{
-  typeH = DCT2, typeV = DCT2;
-  const int uiChFinalMode = PU::getFinalIntraMode( *tu.cu->firstPU, toChannelType( compID ) );
-  bool intraModeIsEven = uiChFinalMode % 2 == 0;
-
-  if( uiChFinalMode == DC_IDX || uiChFinalMode == 33 || uiChFinalMode == 35 )
-  {
-    typeH = DCT2;
-    typeV = typeH;
-  }
-  else if( uiChFinalMode == PLANAR_IDX || ( uiChFinalMode >= 31 && uiChFinalMode <= 37 ) )
-  {
-    typeH = DST7;
-    typeV = typeH;
-  }
-  else if( ( intraModeIsEven && uiChFinalMode >= 2 && uiChFinalMode <= 30 ) || ( !intraModeIsEven && uiChFinalMode >= 39 && uiChFinalMode <= 65 ) )
-  {
-    typeH = DST7;
-    typeV = DCT2;
-  }
-  else if( ( !intraModeIsEven && uiChFinalMode >= 3 && uiChFinalMode <= 29 ) || ( intraModeIsEven && uiChFinalMode >= 38 && uiChFinalMode <= 66 ) )
-  {
-    typeH = DCT2;
-    typeV = DST7;
-  }
-  //Size restriction for non-DCT-II transforms
-  Area tuArea = tu.blocks[compID];
-  typeH = tuArea.width  <= 2 || tuArea.width  >= 32 ? DCT2 : typeH;
-  typeV = tuArea.height <= 2 || tuArea.height >= 32 ? DCT2 : typeV;
-}
-
-#endif
 
 // other tools
 
@@ -5930,7 +4608,6 @@ uint32_t getCtuAddr( const Position& pos, const PreCalcValues& pcv )
   return ( pos.x >> pcv.maxCUWidthLog2 ) + ( pos.y >> pcv.maxCUHeightLog2 ) * pcv.widthInCtus;
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 int getNumModesMip(const Size& block)
 {
   if (block.width > (4 * block.height) || block.height > (4 * block.width))
@@ -5962,7 +4639,6 @@ bool mipModesAvailable(const Size& block)
 {
   return (getNumModesMip(block));
 }
-#endif
 
 
 
diff --git a/source/Lib/CommonLib/UnitTools.h b/source/Lib/CommonLib/UnitTools.h
index e82e7268f..edfbb8f1e 100644
--- a/source/Lib/CommonLib/UnitTools.h
+++ b/source/Lib/CommonLib/UnitTools.h
@@ -78,20 +78,14 @@ namespace CU
   PartSplit getSplitAtDepth           (const CodingUnit& cu, const unsigned depth);
 
   bool hasNonTsCodedBlock             (const CodingUnit& cu);
-#if JVET_N0193_LFNST
   uint32_t getNumNonZeroCoeffNonTs         ( const CodingUnit& cu, const bool lumaFlag = true, const bool chromaFlag = true );
   uint32_t getNumNonZeroCoeffNonTsCorner8x8( const CodingUnit& cu, const bool lumaFlag = true, const bool chromaFlag = true );
-#else
-  uint32_t getNumNonZeroCoeffNonTs        (const CodingUnit& cu);
-#endif
 
   bool  isGBiIdxCoded                 (const CodingUnit& cu);
   uint8_t getValidGbiIdx              (const CodingUnit& cu);
   void  setGbiIdx                     (CodingUnit& cu, uint8_t uh);
   uint8_t deriveGbiIdx                (uint8_t gbiLO, uint8_t gbiL1);
-#if JVET_N0413_RDPCM
   bool bdpcmAllowed                   (const CodingUnit& cu, const ComponentID compID);
-#endif
 
 
   bool      divideTuInRows            ( const CodingUnit &cu );
@@ -130,18 +124,14 @@ namespace PU
 {
   int  getLMSymbolList(const PredictionUnit &pu, int *pModeList);
   int  getIntraMPMs(const PredictionUnit &pu, unsigned *mpm, const ChannelType &channelType = CHANNEL_TYPE_LUMA);
-#if JVET_N0217_MATRIX_INTRAPRED
   bool          isMIP                 (const PredictionUnit &pu, const ChannelType &chType = CHANNEL_TYPE_LUMA);
   int           getMipMPMs            (const PredictionUnit &pu, unsigned *mpm);
   int           getMipSizeId          (const PredictionUnit &pu);
   uint32_t      getIntraDirLuma       (const PredictionUnit &pu);
   AvailableInfo getAvailableInfoLuma  (const PredictionUnit &pu);
-#endif
   void getIntraChromaCandModes        (const PredictionUnit &pu, unsigned modeList[NUM_CHROMA_MODE]);
   uint32_t getFinalIntraMode              (const PredictionUnit &pu, const ChannelType &chType);
-#if JVET_N0193_LFNST
   int getWideAngIntraMode             ( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID );
-#endif
   void getInterMergeCandidates        (const PredictionUnit &pu, MergeCtx& mrgCtx,
     int mmvdList,
     const int& mrgCandIdx = -1 );
@@ -172,17 +162,11 @@ namespace PU
   bool isBipredRestriction            (const PredictionUnit &pu);
   void spanMotionInfo                 (      PredictionUnit &pu, const MergeCtx &mrgCtx = MergeCtx() );
   void applyImv                       (      PredictionUnit &pu, MergeCtx &mrgCtx, InterPrediction *interPred = NULL );
-#if JVET_N0481_BCW_CONSTRUCTED_AFFINE
   void getAffineControlPointCand(const PredictionUnit &pu, MotionInfo mi[4], int8_t neighGbi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgCtx);
-#else
-  void getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgCtx );
-#endif
   void getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx, const int mrgCandIdx = -1 );
   void setAllAffineMvField            (      PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
   void setAllAffineMv                 (      PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList
-#if JVET_N0334_MVCLIPPING
     , bool clipCPMVs = false
-#endif
   );
   bool getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count
     , int mmvdList
@@ -196,20 +180,13 @@ namespace PU
   bool isLMCMode                      (                          unsigned mode);
   bool isLMCModeEnabled               (const PredictionUnit &pu, unsigned mode);
   bool isChromaIntraModeCrossCheckMode(const PredictionUnit &pu);
-#if !JVET_N0302_SIMPLFIED_CIIP
-  int  getMHIntraMPMs                 (const PredictionUnit &pu, unsigned *mpm, const ChannelType &channelType = CHANNEL_TYPE_LUMA, const bool isChromaMDMS = false, const unsigned startIdx = 0);
-#endif
   int  getNarrowShape                 (const int width, const int height);
   void getTriangleMergeCandidates     (const PredictionUnit &pu, MergeCtx &triangleMrgCtx);
   bool isUniqueTriangleCandidates     (const PredictionUnit &pu, MergeCtx &triangleMrgCtx);
   void spanTriangleMotionInfo         (      PredictionUnit &pu, MergeCtx &triangleMrgCtx, const bool splitDir, const uint8_t candIdx0, const uint8_t candIdx1);
   int32_t mappingRefPic               (const PredictionUnit &pu, int32_t refPicPoc, bool targetRefPicList);
-#if JVET_N0329_IBC_SEARCH_IMP
   bool isAddNeighborMv  (const Mv& currMv, Mv* neighborMvs, int numNeighborMv);
   void getIbcMVPsEncOnly(PredictionUnit &pu, Mv* mvPred, int& nbPred);
-#else
-  void getIbcMVPsEncOnly(PredictionUnit &pu, Mv* MvPred, int& nbPred);
-#endif
   bool getDerivedBV(PredictionUnit &pu, const Mv& currentMv, Mv& derivedMv);
   bool isBlockVectorValid(PredictionUnit& pu, int xPos, int yPos, int width, int height, int picWidth, int picHeight, int xStartInCU, int yStartInCU, int xBv, int yBv, int ctuSize);
   bool checkDMVRCondition(const PredictionUnit& pu);
@@ -219,9 +196,7 @@ namespace PU
 namespace TU
 {
   uint32_t getNumNonZeroCoeffsNonTS       (const TransformUnit &tu, const bool bLuma = true, const bool bChroma = true);
-#if JVET_N0193_LFNST
   uint32_t getNumNonZeroCoeffsNonTSCorner8x8( const TransformUnit &tu, const bool bLuma = true, const bool bChroma = true );
-#endif
   bool isNonTransformedResidualRotated(const TransformUnit &tu, const ComponentID &compID);
   bool getCbf                         (const TransformUnit &tu, const ComponentID &compID);
   bool getCbfAtDepth                  (const TransformUnit &tu, const ComponentID &compID, const unsigned &depth);
@@ -229,38 +204,23 @@ namespace TU
   bool isTSAllowed                    (const TransformUnit &tu, const ComponentID  compID);
   bool isMTSAllowed                   (const TransformUnit &tu, const ComponentID  compID);
   uint32_t getGolombRiceStatisticsIndex   (const TransformUnit &tu, const ComponentID &compID);
-#if HEVC_USE_MDCS
-  uint32_t getCoefScanIdx                 (const TransformUnit &tu, const ComponentID &compID);
-#endif
   bool hasCrossCompPredInfo           (const TransformUnit &tu, const ComponentID &compID);
 
 
   bool needsSqrt2Scale                ( const TransformUnit &tu, const ComponentID &compID );
-#if HM_QTBT_AS_IN_JEM_QUANT
   bool needsBlockSizeTrafoScale       ( const TransformUnit &tu, const ComponentID &compID );
-#else
-  bool needsQP3Offset                 (const TransformUnit &tu, const ComponentID &compID);
-#endif
   TransformUnit* getPrevTU          ( const TransformUnit &tu, const ComponentID compID );
   bool           getPrevTuCbfAtDepth( const TransformUnit &tu, const ComponentID compID, const int trDepth );
-#if !JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP
-  void           getTransformTypeISP( const TransformUnit &tu, const ComponentID compID, int &typeH, int &typeV );
-#endif
 
 }
 
 uint32_t getCtuAddr        (const Position& pos, const PreCalcValues &pcv);
-#if JVET_N0217_MATRIX_INTRAPRED
 int  getNumModesMip   (const Size& block);
 int  getNumEpBinsMip  (const Size& block);
 bool mipModesAvailable(const Size& block);
-#endif
 
 template<typename T, size_t N>
 uint32_t updateCandList(T uiMode, double uiCost, static_vector<T, N>& candModeList, static_vector<double, N>& candCostList
-#if !JVET_N0217_MATRIX_INTRAPRED
-  , static_vector<int, N>& extendRefList, int extendRef
-#endif
   , size_t uiFastCandNum = N, int* iserttPos = nullptr)
 {
   CHECK( std::min( uiFastCandNum, candModeList.size() ) != std::min( uiFastCandNum, candCostList.size() ), "Sizes do not match!" );
@@ -281,21 +241,9 @@ uint32_t updateCandList(T uiMode, double uiCost, static_vector<T, N>& candModeLi
     {
       candModeList[currSize - i] = candModeList[currSize - 1 - i];
       candCostList[currSize - i] = candCostList[currSize - 1 - i];
-#if !JVET_N0217_MATRIX_INTRAPRED
-      if (extendRef != -1)
-      {
-        extendRefList[currSize - i] = extendRefList[currSize - 1 - i];
-      }
-#endif
     }
     candModeList[currSize - shift] = uiMode;
     candCostList[currSize - shift] = uiCost;
-#if !JVET_N0217_MATRIX_INTRAPRED
-    if (extendRef != -1)
-    {
-      extendRefList[currSize - shift] = extendRef;
-    }
-#endif
     if (iserttPos != nullptr)
     {
       *iserttPos = int(currSize - shift);
@@ -306,12 +254,6 @@ uint32_t updateCandList(T uiMode, double uiCost, static_vector<T, N>& candModeLi
   {
     candModeList.insert( candModeList.end() - shift, uiMode );
     candCostList.insert( candCostList.end() - shift, uiCost );
-#if !JVET_N0217_MATRIX_INTRAPRED
-    if (extendRef != -1)
-    {
-      extendRefList.insert(extendRefList.end() - shift, extendRef);
-    }
-#endif
     if (iserttPos != nullptr)
     {
       *iserttPos = int(candModeList.size() - shift - 1);
diff --git a/source/Lib/CommonLib/WeightPrediction.cpp b/source/Lib/CommonLib/WeightPrediction.cpp
index 6a645952d..007fb08fc 100644
--- a/source/Lib/CommonLib/WeightPrediction.cpp
+++ b/source/Lib/CommonLib/WeightPrediction.cpp
@@ -215,7 +215,6 @@ void WeightPrediction::addWeightBi(const CPelUnitBuf          &pcYuvSrc0,
   } // compID loop
 }
 
-#if JVET_N0146_DMVR_BDOF_CONDITION
 void WeightPrediction::addWeightBiComponent(const CPelUnitBuf          &pcYuvSrc0,
                                             const CPelUnitBuf          &pcYuvSrc1,
                                             const ClpRngs              &clpRngs,
@@ -271,7 +270,6 @@ void WeightPrediction::addWeightBiComponent(const CPelUnitBuf          &pcYuvSrc
     dst += dstStride;
   } // y loop
 }
-#endif
 
 void  WeightPrediction::addWeightUni(const CPelUnitBuf          &pcYuvSrc0,
                                      const ClpRngs              &clpRngs,
@@ -409,9 +407,7 @@ void  WeightPrediction::xWeightedPredictionBi(const PredictionUnit       &pu,
 
   CHECK( !pu.cs->pps->getWPBiPred(), "Weighted Bi-prediction disabled" );
 
-#if JVET_N0146_DMVR_BDOF_CONDITION
   if (iRefIdx0 < 0 && iRefIdx1 < 0) return;
-#endif
 
   getWpScaling(pu.cu->slice, iRefIdx0, iRefIdx1, pwp0, pwp1, maxNumComp);
 
diff --git a/source/Lib/CommonLib/WeightPrediction.h b/source/Lib/CommonLib/WeightPrediction.h
index 86671665f..a038dd257 100644
--- a/source/Lib/CommonLib/WeightPrediction.h
+++ b/source/Lib/CommonLib/WeightPrediction.h
@@ -71,7 +71,6 @@ public:
                                 const bool                  bRoundLuma = true,
                                 const ComponentID           maxNumComp = MAX_NUM_COMPONENT );
 
-#if JVET_N0146_DMVR_BDOF_CONDITION
   void addWeightBiComponent(    const CPelUnitBuf          &pcYuvSrc0,
                                 const CPelUnitBuf          &pcYuvSrc1,
                                 const ClpRngs              &clpRngs,
@@ -80,7 +79,6 @@ public:
                                       PelUnitBuf           &rpcYuvDst,
                                 const bool                  bRoundLuma = true,
                                 const ComponentID           Comp = COMPONENT_Y);
-#endif
 
   void  addWeightUni(           const CPelUnitBuf          &pcYuvSrc0,
                                 const ClpRngs              &clpRngs,
diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp
index 6ae216abf..d5a82c9d4 100644
--- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp
+++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp
@@ -437,13 +437,9 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
           DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::SkipFlag), cu.skip);
         }
 
-#if JVET_N0413_RDPCM
         DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::BDPCM), cu.bdpcmMode);
-#endif
         DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::TileIdx), cu.tileIdx);
-#if JVET_N0193_LFNST
         DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::LFNSTIdx), cu.lfnstIdx);
-#endif
         DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::MMVDSkipFlag), cu.mmvdSkip);
       }
       else if( chType == CHANNEL_TYPE_CHROMA )
@@ -474,9 +470,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
             {
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeFlag), pu.mergeFlag);
             }
-#if JVET_N0324_REGULAR_MRG_FLAG
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::RegularMergeFlag), pu.regularMergeFlag);
-#endif
             if( pu.mergeFlag )
             {
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeIdx),  pu.mergeIdx);
@@ -491,9 +485,6 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
               {
                 DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::Luma_IntraMode),  pu.intraDir[COMPONENT_Y]);
               }
-#if !JVET_N0324_REGULAR_MRG_FLAG
-              DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::TriangleFlag), pu.cu->triangle);
-#endif
             }
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineFlag), pu.cu->affine);
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineType), pu.cu->affineType);
@@ -682,9 +673,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
           if(chType == CHANNEL_TYPE_LUMA)
           {
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IPCM), cu.ipcm);
-#if JVET_N0217_MATRIX_INTRAPRED
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::MIPFlag), cu.mipFlag);
-#endif
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::ISPMode), cu.ispMode);
           }
           else if(chType == CHANNEL_TYPE_CHROMA)
@@ -710,9 +699,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
                 {
                   const uint32_t uiChFinalMode  = PU::getFinalIntraMode( pu, ChannelType( chType ) );
                   DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::Chroma_IntraMode), uiChFinalMode);
-#if JVET_N0671_CHROMA_FORMAT_422
                     assert(0);
-#endif //JVET_N0671_CHROMA_FORMAT_422
                 }
               }
             }
@@ -731,12 +718,10 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
           DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::Cbf_Y), tu.cbf[COMPONENT_Y]);
           DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::MTSIdx), tu.mtsIdx);
         }
-#if JVET_N0054_JOINT_CHROMA
         if ( tu.Cb().valid() )
         {
           DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::JointCbCr), tu.jointCbCr);
         }
-#endif
 
         if( !CU::isIntra(cu) && CU::isRDPCMEnabled(cu) && ( tu.mtsIdx==MTS_SKIP || cu.transQuantBypass ) )
         {
@@ -904,13 +889,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                   }
                 }
               }
-#if !JVET_N0324_REGULAR_MRG_FLAG
-              if (cu.cs->slice->getSPS()->getUseTriangle() && cu.cs->slice->isInterB() && cu.lwidth() * cu.lheight() >= TRIANGLE_MIN_SIZE && !cu.affine)
-              {
-                DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::TriangleFlag), cu.triangle);
-
-              }
-#endif
             }
             else
             {
diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.h b/source/Lib/CommonLib/dtrace_blockstatistics.h
index 71f9bf8b7..865b1753a 100644
--- a/source/Lib/CommonLib/dtrace_blockstatistics.h
+++ b/source/Lib/CommonLib/dtrace_blockstatistics.h
@@ -65,16 +65,10 @@ enum class BlockStatistic {
   SplitSeries,
   TransQuantBypassFlag,
   MTSIdx,
-#if JVET_N0413_RDPCM
   BDPCM,
-#endif
   TileIdx,
-#if JVET_N0193_LFNST
   LFNSTIdx,
-#endif
-#if JVET_N0054_JOINT_CHROMA
   JointCbCr,
-#endif
   CompAlphaCb,
   CompAlphaCr,
   RDPCM_Y,
@@ -86,9 +80,7 @@ enum class BlockStatistic {
   Luma_IntraMode,
   Chroma_IntraMode,
   MultiRefIdx,
-#if JVET_N0217_MATRIX_INTRAPRED
   MIPFlag,
-#endif
   ISPMode,
 
   // inter
@@ -102,9 +94,7 @@ enum class BlockStatistic {
   IMVMode,
   InterDir,
   MergeFlag,
-#if JVET_N0324_REGULAR_MRG_FLAG
   RegularMergeFlag,
-#endif
   MergeIdx,
   MergeType,
   MVPIdxL0,
@@ -126,9 +116,6 @@ enum class BlockStatistic {
   MMVDMergeIdx,
   MHIntraFlag,
   SMVDFlag,
-#if !JVET_N0324_REGULAR_MRG_FLAG
-  TriangleFlag,
-#endif
   TrianglePartitioning,
   TriangleMVL0, //<< currently only uni-prediction enabled
   TriangleMVL1, //<< currently only uni-prediction enabled
@@ -167,9 +154,7 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
   //                                                                                                                                                                           Value range, vector scale
   { BlockStatistic::PredMode,               std::tuple<std::string, BlockStatisticType, std::string>{"PredMode",                    BlockStatisticType::Integer,                "[0, " + std::to_string(NUMBER_OF_PREDICTION_MODES) + "]"}},
   { BlockStatistic::MergeFlag,              std::tuple<std::string, BlockStatisticType, std::string>{"MergeFlag",                   BlockStatisticType::Flag,                   ""}},
-#if JVET_N0324_REGULAR_MRG_FLAG
   { BlockStatistic::RegularMergeFlag,       std::tuple<std::string, BlockStatisticType, std::string>{"RegularMergeFlag",            BlockStatisticType::Flag,                   ""}},
-#endif
   { BlockStatistic::MVL0,                   std::tuple<std::string, BlockStatisticType, std::string>{"MVL0",                        BlockStatisticType::Vector,                 "Scale: 4"}},
   { BlockStatistic::MVL1,                   std::tuple<std::string, BlockStatisticType, std::string>{"MVL1",                        BlockStatisticType::Vector,                 "Scale: 4"}},
   { BlockStatistic::IPCM,                   std::tuple<std::string, BlockStatisticType, std::string>{"IPCM",                        BlockStatisticType::Flag,                   ""}},
@@ -177,25 +162,17 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
   { BlockStatistic::Chroma_IntraMode,       std::tuple<std::string, BlockStatisticType, std::string>{"Chroma_IntraMode",            BlockStatisticType::Integer,                "[0, " + std::to_string(NUM_INTRA_MODE) + "]"}},
   { BlockStatistic::SkipFlag,               std::tuple<std::string, BlockStatisticType, std::string>{"SkipFlag",                    BlockStatisticType::Flag,                   ""}},
   { BlockStatistic::MTSIdx,                 std::tuple<std::string, BlockStatisticType, std::string>{"TransformSkipFlag_Y",         BlockStatisticType::Integer,                ""}},
-#if JVET_N0413_RDPCM
   { BlockStatistic::BDPCM,                  std::tuple<std::string, BlockStatisticType, std::string>{"BDPCM",                       BlockStatisticType::Flag,                   ""}},    // called bdpcmMode, but used like a flag in the software? related to intra, but signalled always?
-#endif
   { BlockStatistic::TileIdx,                std::tuple<std::string, BlockStatisticType, std::string>{"TileIdx",                     BlockStatisticType::Integer,                ""}},
-#if JVET_N0193_LFNST
   { BlockStatistic::LFNSTIdx,               std::tuple<std::string, BlockStatisticType, std::string>{"LFNSTIdx",                    BlockStatisticType::Integer,                "[0, 3]"}},
-#endif
-#if JVET_N0054_JOINT_CHROMA
   { BlockStatistic::JointCbCr,              std::tuple<std::string, BlockStatisticType, std::string>{"JointCbCr",                   BlockStatisticType::Flag,                   ""}},
-#endif
   { BlockStatistic::CompAlphaCb,            std::tuple<std::string, BlockStatisticType, std::string>{"CompAlphaCb",                 BlockStatisticType::Integer,                ""}},
   { BlockStatistic::CompAlphaCr,            std::tuple<std::string, BlockStatisticType, std::string>{"CompAlphaCr",                 BlockStatisticType::Integer,                ""}},
   { BlockStatistic::RDPCM_Y,                std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Y",                     BlockStatisticType::Integer,                "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}},
   { BlockStatistic::RDPCM_Cb,               std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Cb",                    BlockStatisticType::Integer,                "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}},
   { BlockStatistic::RDPCM_Cr,               std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Cr",                    BlockStatisticType::Integer,                "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}},
 
-#if JVET_N0217_MATRIX_INTRAPRED
   { BlockStatistic::MIPFlag,                std::tuple<std::string, BlockStatisticType, std::string>{"MIPFlag",                     BlockStatisticType::Flag,                   ""}},
-#endif
   { BlockStatistic::ISPMode,                std::tuple<std::string, BlockStatisticType, std::string>{"ISPMode",                     BlockStatisticType::Integer,                "[0, " + std::to_string(NUM_INTRA_SUBPARTITIONS_MODES) + "]"}},
   { BlockStatistic::Depth,                  std::tuple<std::string, BlockStatisticType, std::string>{"Depth",                       BlockStatisticType::Integer,                "[0, 7]"}},
   { BlockStatistic::QT_Depth,               std::tuple<std::string, BlockStatisticType, std::string>{"QT_Depth",                    BlockStatisticType::Integer,                "[0, 7]"}},
@@ -233,9 +210,6 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
   { BlockStatistic::MMVDMergeIdx,           std::tuple<std::string, BlockStatisticType, std::string>{"MMVDMergeIdx",                BlockStatisticType::Integer,                "[0, 1]"}},
   { BlockStatistic::MHIntraFlag,            std::tuple<std::string, BlockStatisticType, std::string>{"MHIntraFlag",                 BlockStatisticType::Flag,                   ""}},
   { BlockStatistic::SMVDFlag,               std::tuple<std::string, BlockStatisticType, std::string>{"SMVDFlag",                    BlockStatisticType::Flag,                   ""}},
-#if !JVET_N0324_REGULAR_MRG_FLAG
-  { BlockStatistic::TriangleFlag,           std::tuple<std::string, BlockStatisticType, std::string>{"TriangleFlag",                BlockStatisticType::Flag,                   ""}},
-#endif
   { BlockStatistic::TrianglePartitioning,   std::tuple<std::string, BlockStatisticType, std::string>{"TrianglePartitioning",        BlockStatisticType::Line,                   ""}},
   { BlockStatistic::TriangleMVL0,           std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL0",                BlockStatisticType::VectorPolygon,          "Scale: 4"}},
   { BlockStatistic::TriangleMVL1,           std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL1",                BlockStatisticType::VectorPolygon,          "Scale: 4"}},
diff --git a/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h b/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h
index 71f42c7d9..dc75192ee 100644
--- a/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h
+++ b/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h
@@ -48,19 +48,7 @@
 #endif
 
 template<X86_VEXT vext>
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift, int vbCTUHeight, int vbPos)
-#else
-static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift, int vbCTUHeight, int vbPos)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift)
-#else
-static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift)
-#endif
-#endif
 {
   const int img_stride = srcLuma.stride;
   const Pel* srcExt = srcLuma.buf;
@@ -88,25 +76,15 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
     const Pel *p_imgY_pad_up = &srcExt[yoffset + img_stride];
     const Pel *p_imgY_pad_up2 = &srcExt[yoffset + img_stride * 2];
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
     // pixel padding for gradient calculation
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
     if (((blkDst.pos().y - 2 + i) > 0) && ((blkDst.pos().y - 2 + i) % vbCTUHeight) == (vbPos - 2))
-#else
-    if (((posY - 2 + i) > 0) && ((posY - 2 + i) % vbCTUHeight) == (vbPos - 2))
-#endif
     {
       p_imgY_pad_up2 = &srcExt[yoffset + img_stride];
     }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
     else if (((blkDst.pos().y - 2 + i) > 0) && ((blkDst.pos().y - 2 + i) % vbCTUHeight) == vbPos)
-#else
-    else if (((posY - 2 + i) > 0) && ((posY - 2 + i) % vbCTUHeight) == vbPos)
-#endif
     {
       p_imgY_pad_down = &srcExt[yoffset];
     }
-#endif
 
     __m128i mmStore = _mm_setzero_si128();
 
@@ -217,24 +195,15 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
   {
     for( int j = 0; j < blk.width; j += 8 )
     {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
       __m128i  xmm0, xmm1, xmm2, xmm3;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       if ((((i << 1) + blkDst.pos().y) % vbCTUHeight) == (vbPos - 4))
-#else
-      if ((((i << 1) + posY) % vbCTUHeight) == (vbPos - 4))
-#endif
       {
         xmm0 = _mm_loadu_si128((__m128i*)(&(_temp[i + 0][j])));
         xmm1 = _mm_loadu_si128((__m128i*)(&(_temp[i + 1][j])));
         xmm2 = _mm_loadu_si128((__m128i*)(&(_temp[i + 2][j])));
         xmm3 = mm_0;
       }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       else if ((((i << 1) + blkDst.pos().y) % vbCTUHeight) == vbPos)
-#else
-      else if ((((i << 1) + posY) % vbCTUHeight) == vbPos)
-#endif
       {
         xmm0 = mm_0;
         xmm1 = _mm_loadu_si128((__m128i*)(&(_temp[i + 1][j])));
@@ -249,12 +218,6 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
         xmm3 = _mm_loadu_si128((__m128i*)(&(_temp[i + 3][j])));
       }
 
-#else
-      __m128i xmm0 = _mm_loadu_si128((__m128i*)(&(_temp[i + 0][j])));
-      __m128i xmm1 = _mm_loadu_si128((__m128i*)(&(_temp[i + 1][j])));
-      __m128i xmm2 = _mm_loadu_si128((__m128i*)(&(_temp[i + 2][j])));
-      __m128i xmm3 = _mm_loadu_si128((__m128i*)(&(_temp[i + 3][j])));
-#endif
 
       __m128i xmm4 = _mm_add_epi16( xmm0, xmm1 );
       __m128i xmm6 = _mm_add_epi16( xmm2, xmm3 );
@@ -270,12 +233,7 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
       __m128i xmm12 = _mm_blend_epi16( xmm4, _mm_shuffle_epi32( xmm0, 0x40 ), 0xF0 );
       __m128i xmm10 = _mm_shuffle_epi32( xmm12, 0xB1 );
       xmm12 = _mm_add_epi32( xmm10, xmm12 );
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       if (((((i << 1) + blkDst.pos().y) % vbCTUHeight) == (vbPos - 4)) || ((((i << 1) + blkDst.pos().y) % vbCTUHeight) == vbPos))
-#else
-      if (((((i << 1) + posY) % vbCTUHeight) == (vbPos - 4)) || ((((i << 1) + posY) % vbCTUHeight) == vbPos))
-#endif
       {
         xmm12 = _mm_srai_epi32(_mm_add_epi32(_mm_slli_epi32(xmm12, 5), _mm_slli_epi32(xmm12, 6)), shift);
       }
@@ -283,9 +241,6 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
       {
         xmm12 = _mm_srai_epi32(xmm12, shift - 6);
       }
-#else
-      xmm12 = _mm_srai_epi32(xmm12, shift - 6);
-#endif
       xmm12 = _mm_min_epi32( xmm12, xmm13 );
 
       xmm12 = _mm_and_si128( xmm12, mm_15 );
@@ -378,13 +333,8 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
       int classIdx0 = c0;
       int classIdx1 = c1;
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       const int yOffset = (i << 1) + blkDst.pos().y;
       const int xOffset = j + blkDst.pos().x;
-#else
-      const int yOffset = ( i << 1 ) + posY;
-      const int xOffset = j + posX;
-#endif
 
       AlfClassifier *cl0 = classifier[yOffset] + xOffset;
       AlfClassifier *cl1 = classifier[yOffset + 1] + xOffset;
@@ -403,42 +353,8 @@ static void simdDeriveClassificationBlk(AlfClassifier** classifier, int** laplac
 }
 
 template<X86_VEXT vext>
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#else
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#else
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos)
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs)
-#else
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs)
-#else
-static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs)
-#endif
-#endif
-#endif
 {
-#if !JVET_N0242_NON_LINEAR_ALF
-  static const unsigned char mask05[16] = { 8, 9, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-  static const unsigned char mask03[16] = { 4, 5, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
-  static const unsigned char mask_c[16] = { 0, 1, 8, 9, 4, 5, 14, 15, 2, 3, 10, 11, 12, 13, 6, 7 };
-
-#endif
   const bool bChroma = isChroma( compId );
 
   const SPS*     sps = cs.slice->getSPS();
@@ -452,16 +368,6 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
   const int srcStride = srcLuma.stride;
   const int dstStride = dstLuma.stride;
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  const Pel* srcExt = srcLuma.buf;
-  Pel* dst = dstLuma.buf;
-
-  const Pel *pImgYPad0, *pImgYPad1, *pImgYPad2, *pImgYPad3, *pImgYPad4, *pImgYPad5;
-
-  short *coef = filterSet;
-  const Pel *pImg0, *pImg1, *pImg2, *pImg3, *pImg4, *pImg5;
-
-#endif
   const int numBitsMinus1 = AdaptiveLoopFilter::m_NUM_BITS - 1;
   const int offset = ( 1 << ( AdaptiveLoopFilter::m_NUM_BITS - 2 ) );
 
@@ -470,13 +376,8 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
   const int startWidth = blk.x;
   const int endWidth = blk.x + blk.width;
 
-#if JVET_N0242_NON_LINEAR_ALF
   const Pel* src = srcLuma.buf;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   Pel* dst = dstLuma.buf + blkDst.y * dstStride;
-#else
-  Pel* dst = dstLuma.buf + startHeight * dstStride;
-#endif
 
   const Pel *pImgYPad0, *pImgYPad1, *pImgYPad2, *pImgYPad3, *pImgYPad4;
   const Pel *pImg0, *pImg1, *pImg2, *pImg3, *pImg4;
@@ -485,119 +386,48 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
   short *clip[2] = { fClipSet, fClipSet };
 
   int transposeIdx[2] = {0, 0};
-#else
-  Pel* imgYRecPost = dst;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  imgYRecPost += blkDst.y * dstStride;
-#else
-  imgYRecPost += startHeight * dstStride;
-#endif
-
-  int transposeIdx = 0;
-
-#endif
   const int clsSizeY = 4;
   const int clsSizeX = 4;
 
-#if JVET_N0242_NON_LINEAR_ALF
   bool pcmFlags2x2[8] = {0,0,0,0,0,0,0,0};
   Pel  pcmRec2x2[32];
-#else
-  bool pcmFlags2x2[4] = {0,0,0,0};
-  Pel  pcmRec2x2[16];
-#endif
 
   CHECK( startHeight % clsSizeY, "Wrong startHeight in filtering" );
   CHECK( startWidth % clsSizeX, "Wrong startWidth in filtering" );
   CHECK( ( endHeight - startHeight ) % clsSizeY, "Wrong endHeight in filtering" );
   CHECK( ( endWidth - startWidth ) % clsSizeX, "Wrong endWidth in filtering" );
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  const Pel* imgYRec = srcExt;
-
-  Pel *pRec;
-#endif
   AlfClassifier *pClass = nullptr;
 
-#if JVET_N0242_NON_LINEAR_ALF
   int dstStride2 = dstStride * clsSizeY;
-#endif
   int srcStride2 = srcStride * clsSizeY;
 
   const __m128i mmOffset = _mm_set1_epi32( offset );
-#if JVET_N0242_NON_LINEAR_ALF
   const __m128i mmMin = _mm_set1_epi16( clpRng.min );
   const __m128i mmMax = _mm_set1_epi16( clpRng.max );
-#else
-  const __m128i mmMin = _mm_set1_epi32( clpRng.min );
-  const __m128i mmMax = _mm_set1_epi32( clpRng.max );
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   const unsigned char *filterCoeffIdx[2];
   Pel filterCoeff[MAX_NUM_ALF_LUMA_COEFF][2];
   Pel filterClipp[MAX_NUM_ALF_LUMA_COEFF][2];
 
   pImgYPad0 = src + startHeight * srcStride + startWidth;
-#else
-  const __m128i xmm10 = _mm_loadu_si128( ( __m128i* )mask03 );
-  const __m128i mm_mask05 = _mm_loadu_si128( ( __m128i* )mask05 );
-
-  pImgYPad0 = imgYRec + startHeight * srcStride + startWidth;
-#endif
   pImgYPad1 = pImgYPad0 + srcStride;
   pImgYPad2 = pImgYPad0 - srcStride;
   pImgYPad3 = pImgYPad1 + srcStride;
   pImgYPad4 = pImgYPad2 - srcStride;
-#if !JVET_N0242_NON_LINEAR_ALF
-  pImgYPad5 = pImgYPad3 + srcStride;
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   Pel* pRec0 = dst + blkDst.x;
-#else
-  Pel* pRec0 = dst + startWidth;
-#endif
   Pel* pRec1;
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  pRec = imgYRecPost + blkDst.x;
-#else
-  pRec = imgYRecPost + startWidth;
-#endif
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   for( int i = 0; i < endHeight - startHeight; i += clsSizeY )
-#else
-  for( int i = 0; i < endHeight - startHeight; i += 4 )
-#endif
   {
-#if !JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-    pRec = imgYRecPost + blkDst.x + i * dstStride;
-#else
-    pRec = imgYRecPost + startWidth + i * dstStride;
-#endif
-
-#endif
     if( !bChroma )
     {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       pClass = classifier[blkDst.y + i] + blkDst.x;
-#else
-      pClass = classifier[startHeight + i] + startWidth;
-#endif
     }
 
-#if JVET_N0242_NON_LINEAR_ALF
     for( int j = 0; j < endWidth - startWidth; j += 8 )
-#else
-    for( int j = 0; j < endWidth - startWidth; j += 4 )
-#endif
     {
-#if JVET_N0242_NON_LINEAR_ALF
       for( int k = 0; k < 2; ++k )
       {
         if( !bChroma )
@@ -649,87 +479,8 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
           filterClipp[i][k] = clip[k][filterCoeffIdx[k][i]];
         }
       }
-#else
-      if( !bChroma )
-      {
-        AlfClassifier& cl = pClass[j];
-        transposeIdx = cl.transposeIdx;
-        if( isPCMFilterDisabled && cl.classIdx == AdaptiveLoopFilter::m_ALF_UNUSED_CLASSIDX && transposeIdx == AdaptiveLoopFilter::m_ALF_UNUSED_TRANSPOSIDX )
-        {
-          pRec += 4;
-          continue;
-        }
-        coef = filterSet + cl.classIdx * MAX_NUM_ALF_LUMA_COEFF;
-      }
-      else if ( isPCMFilterDisabled )
-      {
-        int  blkX, blkY;
-        bool *flags  = pcmFlags2x2;
-        Pel  *pcmRec = pcmRec2x2;
-
-        // check which chroma 2x2 blocks use PCM
-        // chroma PCM may not be aligned with 4x4 ALF processing grid
-        for( blkY=0; blkY<4; blkY+=2 )
-        {
-          for( blkX=0; blkX<4; blkX+=2 )
-          {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-            Position pos(j + blkDst.x + blkX, i + blkDst.y + blkY);
-#else
-            Position pos(j+startWidth+blkX, i+startHeight+blkY);
-#endif
-            CodingUnit* cu = isDualTree ? cs.getCU(pos, CH_C) : cs.getCU(recalcPosition(nChromaFormat, CH_C, CH_L, pos), CH_L);
-            *flags++ = cu->ipcm ? 1 : 0;
-
-            // save original samples from 2x2 PCM blocks
-            if( cu->ipcm )
-            {
-              *pcmRec++ = pRec[(blkY+0)*dstStride + (blkX+0)];
-              *pcmRec++ = pRec[(blkY+0)*dstStride + (blkX+1)];
-              *pcmRec++ = pRec[(blkY+1)*dstStride + (blkX+0)];
-              *pcmRec++ = pRec[(blkY+1)*dstStride + (blkX+1)];
-            }
-          }
-        }
-
-        // skip entire 4x4 if all chroma 2x2 blocks use PCM
-        if( pcmFlags2x2[0] && pcmFlags2x2[1] && pcmFlags2x2[2] && pcmFlags2x2[3] )
-        {
-          pRec += 4;
-          continue;
-        }
-      }
-
-      __m128i c0, t0 = _mm_setzero_si128();
-
-      c0 = _mm_loadu_si128( ( __m128i* )( coef + 0 ) );
-      c0 = _mm_alignr_epi8( c0, c0, 2 );
-      c0 = _mm_blend_epi16( c0, t0, 0x40 );
-
-      if( transposeIdx & 1 )
-      {
-        c0 = _mm_shuffle_epi8( c0, _mm_loadu_si128( ( __m128i* )mask_c ) );
-      }
-
-      if( transposeIdx == 0 || transposeIdx == 1 )
-      {
-        c0 = _mm_shuffle_epi8( c0, xmm10 );
-      }
-
-#endif
-#if !JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-      pImg0 = pImgYPad0 + j;
-      pImg1 = pImgYPad1 + j;
-      pImg2 = pImgYPad2 + j;
-      pImg3 = pImgYPad3 + j;
-      pImg4 = pImgYPad4 + j;
-#endif
-#if !JVET_N0180_ALF_LINE_BUFFER_REDUCTION && !JVET_N0242_NON_LINEAR_ALF
-      pImg5 = pImgYPad5 + j;
-#endif
 
 
-#if JVET_N0242_NON_LINEAR_ALF
       pRec1 = pRec0 + j;
 
       if ( bChroma && isPCMFilterDisabled )
@@ -744,11 +495,7 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
         {
           for( blkX=0; blkX<8; blkX+=2 )
           {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             Position pos(j + blkDst.x + blkX, i + blkDst.y + blkY);
-#else
-            Position pos(j+startWidth+blkX, i+startHeight+blkY);
-#endif
             CodingUnit* cu = isDualTree ? cs.getCU(pos, CH_C) : cs.getCU(recalcPosition(nChromaFormat, CH_C, CH_L, pos), CH_L);
             if(cu != NULL) 
             {
@@ -775,15 +522,11 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
 
       for( int ii = 0; ii < clsSizeY; ii++ )
       {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
         pImg0 = pImgYPad0 + j + ii * srcStride;
         pImg1 = pImgYPad1 + j + ii * srcStride;
         pImg2 = pImgYPad2 + j + ii * srcStride;
         pImg3 = pImgYPad3 + j + ii * srcStride;
         pImg4 = pImgYPad4 + j + ii * srcStride;
-#endif
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if ((blkDst.y + i + ii) % vbCTUHeight < vbPos && ((blkDst.y + i + ii) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
         {
           pImg1 = ((blkDst.y + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
@@ -800,25 +543,6 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
           pImg1 = ((blkDst.y + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
           pImg3 = ((blkDst.y + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
         }
-#else
-        if ((startHeight + i + ii) % vbCTUHeight < vbPos && ((startHeight + i + ii) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((startHeight + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-
-          pImg2 = ((startHeight + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-        }
-        else if ((startHeight + i + ii) % vbCTUHeight >= vbPos && ((startHeight + i + ii) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((startHeight + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-
-          pImg1 = ((startHeight + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-        }
-#endif
-#endif
         __m128i clipp, clipm;
         __m128i coeffa, coeffb;
         __m128i xmmCur = _mm_lddqu_si128( ( __m128i* ) ( pImg0 + 0 ) );
@@ -990,149 +714,7 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
           xmmS0 = _mm_blend_epi16( xmmS0, xmmCur, 0xFC );
           _mm_storeu_si128( ( __m128i* )( pRec1 ), xmmS0 );
         }
-#else
-      for( int k = 0; k < 4; k++ )
-      {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-        pImg0 = pImgYPad0 + j + k * srcStride; //j: width, 4x4 block
-        pImg1 = pImgYPad1 + j + k * srcStride;
-        pImg2 = pImgYPad2 + j + k * srcStride;
-        pImg3 = pImgYPad3 + j + k * srcStride;
-        pImg4 = pImgYPad4 + j + k * srcStride;
-#endif
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        if ((blkDst.y + i + k) % vbCTUHeight < vbPos && ((blkDst.y + i + k) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((blkDst.y + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-          pImg5 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 3) ? pImg3 : pImg5;
-
-          pImg2 = ((blkDst.y + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-        }
-        else if ((blkDst.y + i + k) % vbCTUHeight >= vbPos && ((blkDst.y + i + k) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((blkDst.y + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-
-          pImg1 = ((blkDst.y + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-          pImg5 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
-        }
-#else
-        if ((startHeight + i + k) % vbCTUHeight < vbPos && ((startHeight + i + k) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((startHeight + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 3) ? pImg3 : pImg5;
-
-          pImg2 = ((startHeight + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-        }
-        else if ((startHeight + i + k) % vbCTUHeight >= vbPos && ((startHeight + i + k) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((startHeight + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-
-          pImg1 = ((startHeight + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
-        }
-#endif
-#endif
-        __m128i xmm4 = _mm_lddqu_si128( ( __m128i* ) ( pImg4 ) );
-        __m128i xmm2 = _mm_lddqu_si128( ( __m128i* ) ( pImg2 - 1 ) );
-        __m128i xmm0 = _mm_lddqu_si128( ( __m128i* ) ( pImg0 - 2 ) );
-        __m128i xmm1 = _mm_lddqu_si128( ( __m128i* ) ( pImg1 - 1 - 1 ) );
-        __m128i xmm3 = _mm_lddqu_si128( ( __m128i* ) ( pImg3 - 0 - 2 ) );
-
-        __m128i xmm7 = _mm_setzero_si128();
-
-        __m128i xmm6 = _mm_shuffle_epi8( xmm0, mm_mask05 );
-        __m128i xmm8 = _mm_shuffle_epi8( _mm_srli_si128( xmm0, 2 ), mm_mask05 );
-        __m128i xmm9 = _mm_shuffle_epi8( _mm_srli_si128( xmm0, 4 ), mm_mask05 );
-        __m128i xmm11 = _mm_shuffle_epi8( _mm_srli_si128( xmm0, 6 ), mm_mask05 );
-
-        xmm6 = _mm_blend_epi16( xmm7, xmm6, 0x03 );
-        xmm8 = _mm_blend_epi16( xmm7, xmm8, 0x03 );
-        xmm9 = _mm_blend_epi16( xmm7, xmm9, 0x03 );
-        xmm11 = _mm_blend_epi16( xmm7, xmm11, 0x03 );
 
-        xmm6 = _mm_add_epi16( xmm6, xmm0 );
-        xmm8 = _mm_add_epi16( xmm8, _mm_srli_si128( xmm0, 2 ) );
-        xmm9 = _mm_add_epi16( xmm9, _mm_srli_si128( xmm0, 4 ) );
-        xmm11 = _mm_add_epi16( xmm11, _mm_srli_si128( xmm0, 6 ) );
-
-        xmm6 = _mm_slli_si128( xmm6, 6 );
-        xmm8 = _mm_slli_si128( xmm8, 6 );
-        xmm9 = _mm_slli_si128( xmm9, 6 );
-        xmm11 = _mm_slli_si128( xmm11, 6 );
-
-        xmm4 = _mm_add_epi16( xmm4, _mm_srli_si128( xmm3, 4 ) );
-        xmm6 = _mm_blend_epi16( xmm6, _mm_slli_si128( xmm4, 14 ), 0x80 );
-        xmm8 = _mm_blend_epi16( xmm8, _mm_slli_si128( xmm4, 12 ), 0x80 );
-        xmm9 = _mm_blend_epi16( xmm9, _mm_slli_si128( xmm4, 10 ), 0x80 );
-        xmm11 = _mm_blend_epi16( xmm11, _mm_slli_si128( xmm4, 8 ), 0x80 );
-
-        __m128i xmm12 = _mm_shuffle_epi8( xmm2, xmm10 );
-        __m128i xmm13 = _mm_shuffle_epi8( _mm_srli_si128( xmm2, 2 ), xmm10 );
-        __m128i xmm14 = _mm_shuffle_epi8( _mm_srli_si128( xmm2, 4 ), xmm10 );
-        __m128i xmm15 = _mm_shuffle_epi8( _mm_srli_si128( xmm2, 6 ), xmm10 );
-
-        xmm12 = _mm_add_epi16( xmm12, _mm_srli_si128( xmm1, 2 ) );
-        xmm13 = _mm_add_epi16( xmm13, _mm_srli_si128( xmm1, 4 ) );
-        xmm14 = _mm_add_epi16( xmm14, _mm_srli_si128( xmm1, 6 ) );
-        xmm15 = _mm_add_epi16( xmm15, _mm_srli_si128( xmm1, 8 ) );
-
-        xmm6 = _mm_blend_epi16( xmm6, xmm12, 0x07 );
-        xmm8 = _mm_blend_epi16( xmm8, xmm13, 0x07 );
-        xmm9 = _mm_blend_epi16( xmm9, xmm14, 0x07 );
-        xmm11 = _mm_blend_epi16( xmm11, xmm15, 0x07 );
-
-        xmm6 = _mm_madd_epi16( xmm6, c0 );
-        xmm8 = _mm_madd_epi16( xmm8, c0 );
-        xmm9 = _mm_madd_epi16( xmm9, c0 );
-        xmm11 = _mm_madd_epi16( xmm11, c0 );
-
-        xmm12 = _mm_shuffle_epi32( xmm6, 0x1B );
-        xmm13 = _mm_shuffle_epi32( xmm8, 0x1B );
-        xmm14 = _mm_shuffle_epi32( xmm9, 0x1B );
-        xmm15 = _mm_shuffle_epi32( xmm11, 0x1B );
-
-        xmm6 = _mm_add_epi32( xmm6, xmm12 );
-        xmm8 = _mm_add_epi32( xmm8, xmm13 );
-        xmm9 = _mm_add_epi32( xmm9, xmm14 );
-        xmm11 = _mm_add_epi32( xmm11, xmm15 );
-
-        xmm6 = _mm_blend_epi16( xmm6, xmm8, 0xF0 );
-        xmm9 = _mm_blend_epi16( xmm9, xmm11, 0xF0 );
-
-        xmm12 = _mm_hadd_epi32( xmm6, xmm9 );
-
-        xmm12 = _mm_add_epi32( xmm12, mmOffset );
-        xmm12 = _mm_srai_epi32( xmm12, numBitsMinus1 );
-
-        xmm12 = _mm_min_epi32( mmMax, _mm_max_epi32( xmm12, mmMin ) );
-
-        xmm12 = _mm_packus_epi32( xmm12, xmm12 );
-
-        _mm_storel_epi64( ( __m128i* )( pRec ), xmm12 );
-
-        pRec += dstStride;
-#endif
-#if !JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-        pImg0 += srcStride;
-        pImg1 += srcStride;
-        pImg2 += srcStride;
-        pImg3 += srcStride;
-        pImg4 += srcStride;
-#endif
-#if !JVET_N0242_NON_LINEAR_ALF && !JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-        pImg5 += srcStride;
-#endif
-
-#if JVET_N0242_NON_LINEAR_ALF
         pRec1 += dstStride;
       }
       pRec1 -= dstStride2;
@@ -1157,101 +739,23 @@ static void simdFilter5x5Blk(AlfClassifier** classifier, const PelUnitBuf &recDs
         }
       }
 
-#else
-      } //<-- end of k-loop
-
-      pRec -= ( 4 * dstStride );
-
-      // restore 2x2 PCM chroma blocks
-      if( bChroma && isPCMFilterDisabled )
-      {
-        int  blkX, blkY;
-        bool *flags  = pcmFlags2x2;
-        Pel  *pcmRec = pcmRec2x2;
-        for( blkY=0; blkY<4; blkY+=2 )
-        {
-          for( blkX=0; blkX<4; blkX+=2 )
-          {
-            if( *flags++ )
-            {
-              pRec[(blkY+0)*dstStride + (blkX+0)] = *pcmRec++;
-              pRec[(blkY+0)*dstStride + (blkX+1)] = *pcmRec++;
-              pRec[(blkY+1)*dstStride + (blkX+0)] = *pcmRec++;
-              pRec[(blkY+1)*dstStride + (blkX+1)] = *pcmRec++;
-            }
-          }
-        }
-      }
-
-      pRec += 4;
-#endif
     }
 
-#if JVET_N0242_NON_LINEAR_ALF
     pRec0 += dstStride2;
-#else
-    pRec += 4 * dstStride;
-#endif
 
     pImgYPad0 += srcStride2;
     pImgYPad1 += srcStride2;
     pImgYPad2 += srcStride2;
     pImgYPad3 += srcStride2;
     pImgYPad4 += srcStride2;
-#if !JVET_N0242_NON_LINEAR_ALF
-    pImgYPad5 += srcStride2;
-#endif
   }
 }
 
 template<X86_VEXT vext>
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 static void simdFilter7x7Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs,  int vbCTUHeight, int vbPos)
-#else
-static void simdFilter7x7Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs,  int vbCTUHeight, int vbPos)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdFilter7x7Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs,  int vbCTUHeight, int vbPos)
-#else
-static void simdFilter7x7Blk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs,  int vbCTUHeight, int vbPos)
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs )
-#else
-static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs )
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs )
-#else
-static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs )
-#endif
-#endif
-#endif
 {
-#if !JVET_N0242_NON_LINEAR_ALF
-  static const unsigned char mask0[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 7, 4, 5, 2, 3 };
-  static const unsigned char mask00[16] = { 2, 3, 0, 1, 0, 0, 0, 0, 8, 9, 0, 0, 0, 0, 0, 1 };
-  static const unsigned char mask02[16] = { 0, 0, 0, 0, 2, 3, 10, 11, 0, 0, 10, 11, 2, 3, 0, 0 };
-  static const unsigned char mask20[16] = { 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, 6, 7, 0, 0, 0, 0 };
-  static const unsigned char mask22[16] = { 14, 15, 0, 0, 6, 7, 4, 5, 12, 13, 0, 0, 8, 9, 0, 1 };
-  static const unsigned char mask35[16] = { 4, 5, 2, 3, 0, 1, 14, 15, 12, 13, 10, 11, 8, 9, 6, 7 };
-
-#endif
   const bool bChroma = isChroma( compId );
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  if( bChroma )
-  {
-    CHECK( 0, "Chroma doesn't support 7x7" );
-  }
-#endif
   const SPS*     sps = cs.slice->getSPS();
   bool isDualTree = CS::isDualITree(cs);
   bool isPCMFilterDisabled = sps->getPCMFilterDisableFlag();
@@ -1262,17 +766,6 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
   const int srcStride = srcLuma.stride;
   const int dstStride = dstLuma.stride;
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  const Pel* srcExt = srcLuma.buf;
-  Pel* dst = dstLuma.buf;
-
-  const Pel *pImgYPad0, *pImgYPad1, *pImgYPad2, *pImgYPad3, *pImgYPad4, *pImgYPad5, *pImgYPad6;
-
-  short *coef = filterSet;
-  const Pel *pImg0, *pImg1, *pImg2, *pImg3, *pImg4;
-  const Pel *pImg5, *pImg6;
-
-#endif
   const int numBitsMinus1 = AdaptiveLoopFilter::m_NUM_BITS - 1;
   const int offset = ( 1 << ( AdaptiveLoopFilter::m_NUM_BITS - 2 ) );
 
@@ -1281,13 +774,8 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
   const int startWidth = blk.x;
   const int endWidth = blk.x + blk.width;
 
-#if JVET_N0242_NON_LINEAR_ALF
   const Pel* src = srcLuma.buf;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   Pel* dst = dstLuma.buf + blkDst.y * dstStride;
-#else
-  Pel* dst = dstLuma.buf + startHeight * dstStride;
-#endif
 
   const Pel *pImgYPad0, *pImgYPad1, *pImgYPad2, *pImgYPad3, *pImgYPad4, *pImgYPad5, *pImgYPad6;
   const Pel *pImg0, *pImg1, *pImg2, *pImg3, *pImg4, *pImg5, *pImg6;
@@ -1296,63 +784,31 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
   short *clip[2] = { fClipSet, fClipSet };
 
   int transposeIdx[2] = {0, 0};
-#else
-  Pel* imgYRecPost = dst;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  imgYRecPost += blkDst.y * dstStride;
-#else
-  imgYRecPost += startHeight * dstStride;
-#endif
-
-  int transposeIdx = 0;
-
-#endif
   const int clsSizeY = 4;
   const int clsSizeX = 4;
 
-#if JVET_N0242_NON_LINEAR_ALF
   bool pcmFlags2x2[8] = {0,0,0,0,0,0,0,0};
   Pel  pcmRec2x2[32];
-#else
-  bool pcmFlags2x2[4] = {0,0,0,0};
-  Pel  pcmRec2x2[16];
-#endif
 
   CHECK( startHeight % clsSizeY, "Wrong startHeight in filtering" );
   CHECK( startWidth % clsSizeX, "Wrong startWidth in filtering" );
   CHECK( ( endHeight - startHeight ) % clsSizeY, "Wrong endHeight in filtering" );
   CHECK( ( endWidth - startWidth ) % clsSizeX, "Wrong endWidth in filtering" );
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  const Pel* imgYRec = srcExt;
-
-  Pel *pRec;
-#endif
   AlfClassifier *pClass = nullptr;
 
   int dstStride2 = dstStride * clsSizeY;
   int srcStride2 = srcStride * clsSizeY;
 
   const __m128i mmOffset = _mm_set1_epi32( offset );
-#if JVET_N0242_NON_LINEAR_ALF
   const __m128i mmMin = _mm_set1_epi16( clpRng.min );
   const __m128i mmMax = _mm_set1_epi16( clpRng.max );
-#else
-  const __m128i mmMin = _mm_set1_epi32( clpRng.min );
-  const __m128i mmMax = _mm_set1_epi32( clpRng.max );
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   const unsigned char *filterCoeffIdx[2];
   Pel filterCoeff[MAX_NUM_ALF_LUMA_COEFF][2];
   Pel filterClipp[MAX_NUM_ALF_LUMA_COEFF][2];
 
   pImgYPad0 = src + startHeight * srcStride + startWidth;
-#else
-  const __m128i xmm10 = _mm_loadu_si128( ( __m128i* )mask35 );
-
-  pImgYPad0 = imgYRec + startHeight * srcStride + startWidth;
-#endif
   pImgYPad1 = pImgYPad0 + srcStride;
   pImgYPad2 = pImgYPad0 - srcStride;
   pImgYPad3 = pImgYPad1 + srcStride;
@@ -1360,51 +816,18 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
   pImgYPad5 = pImgYPad3 + srcStride;
   pImgYPad6 = pImgYPad4 - srcStride;
 
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   Pel* pRec0 = dst + blkDst.x;
-#else
-  Pel* pRec0 = dst + startWidth;
-#endif
   Pel* pRec1;
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  pRec = imgYRecPost + blkDst.x;
-#else
-  pRec = imgYRecPost + startWidth;
-#endif
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   for( int i = 0; i < endHeight - startHeight; i += clsSizeY )
-#else
-  for( int i = 0; i < endHeight - startHeight; i += 4 )
-#endif
   {
-#if !JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-    pRec = imgYRecPost + blkDst.x + i * dstStride;
-#else
-    pRec = imgYRecPost + startWidth + i * dstStride;
-#endif
-
-#endif
     if( !bChroma )
     {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       pClass = classifier[blkDst.y + i] + blkDst.x;
-#else
-      pClass = classifier[startHeight + i] + startWidth;
-#endif
     }
 
-#if JVET_N0242_NON_LINEAR_ALF
     for( int j = 0; j < endWidth - startWidth; j += 8 )
-#else
-    for( int j = 0; j < endWidth - startWidth; j += 4 )
-#endif
     {
-#if JVET_N0242_NON_LINEAR_ALF
       for (int k = 0; k < 2; ++k)
       {
         if( !bChroma )
@@ -1456,103 +879,7 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
           filterClipp[i][k] = clip[k][filterCoeffIdx[k][i]];
         }
       }
-#else
-      if( !bChroma )
-      {
-        AlfClassifier& cl = pClass[j];
-        transposeIdx = cl.transposeIdx;
-        if ( isPCMFilterDisabled && cl.classIdx == AdaptiveLoopFilter::m_ALF_UNUSED_CLASSIDX && transposeIdx == AdaptiveLoopFilter::m_ALF_UNUSED_TRANSPOSIDX )
-        {
-          pRec += 4;
-          continue;
-        }
-        coef = filterSet + cl.classIdx * MAX_NUM_ALF_LUMA_COEFF;
-      }
-      else if ( isPCMFilterDisabled )
-      {
-        int  blkX, blkY;
-        bool *flags  = pcmFlags2x2;
-        Pel  *pcmRec = pcmRec2x2;
-
-        // check which chroma 2x2 blocks use PCM
-        // chroma PCM may not be aligned with 4x4 ALF processing grid
-        for( blkY=0; blkY<4; blkY+=2 )
-        {
-          for( blkX=0; blkX<4; blkX+=2 )
-          {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-            Position pos(j + blkDst.x + blkX, i + blkDst.y + blkY);
-#else
-            Position pos(j+startWidth+blkX, i+startHeight+blkY);
-#endif
-            CodingUnit* cu = isDualTree ? cs.getCU(pos, CH_C) : cs.getCU(recalcPosition(nChromaFormat, CH_C, CH_L, pos), CH_L);
-            *flags++ = cu->ipcm ? 1 : 0;
-
-            // save original samples from 2x2 PCM blocks
-            if( cu->ipcm )
-            {
-              *pcmRec++ = pRec[(blkY+0)*dstStride + (blkX+0)];
-              *pcmRec++ = pRec[(blkY+0)*dstStride + (blkX+1)];
-              *pcmRec++ = pRec[(blkY+1)*dstStride + (blkX+0)];
-              *pcmRec++ = pRec[(blkY+1)*dstStride + (blkX+1)];
-            }
-          }
-        }
-
-        // skip entire 4x4 if all chroma 2x2 blocks use PCM
-        if( pcmFlags2x2[0] && pcmFlags2x2[1] && pcmFlags2x2[2] && pcmFlags2x2[3] )
-        {
-          pRec += 4;
-          continue;
-        }
-      }
-
-      __m128i c0, c2, t1, t2;
 
-      t1 = _mm_loadu_si128( ( __m128i* )( coef + 0 ) );
-      t2 = _mm_loadu_si128( ( __m128i* )( coef + 1 ) );
-      c2 = _mm_loadu_si128( ( __m128i* )( coef + 4 - 3 ) );
-      c0 = _mm_loadu_si128( ( __m128i* )( coef + 9 - 1 ) );
-
-      c0 = _mm_blend_epi16( c0, t1, 0x01 );
-      c2 = _mm_blend_epi16( c2, t2, 0x07 );
-
-      if( transposeIdx & 1 )
-      {
-        t1 = _mm_loadu_si128( ( __m128i* )mask00 );
-        t2 = _mm_loadu_si128( ( __m128i* )mask02 );
-        __m128i t3 = _mm_loadu_si128( ( __m128i* )mask20 );
-        __m128i t4 = _mm_loadu_si128( ( __m128i* )mask22 );
-
-        t1 = _mm_shuffle_epi8( c0, t1 );
-        t2 = _mm_shuffle_epi8( c2, t2 );
-        t3 = _mm_shuffle_epi8( c0, t3 );
-        t4 = _mm_shuffle_epi8( c2, t4 );
-
-        c0 = _mm_blend_epi16( t1, t2, 0x6C );
-        c2 = _mm_blend_epi16( t4, t3, 0x22 );
-      }
-      else
-      {
-        c0 = _mm_shuffle_epi8( c0, _mm_loadu_si128( ( __m128i* )mask0 ) );
-      }
-
-      if( transposeIdx == 0 || transposeIdx == 3 )
-      {
-        c2 = _mm_shuffle_epi8( c2, xmm10 );
-      }
- #endif
-#if !JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-      pImg0 = pImgYPad0 + j;
-      pImg1 = pImgYPad1 + j;
-      pImg2 = pImgYPad2 + j;
-      pImg3 = pImgYPad3 + j;
-      pImg4 = pImgYPad4 + j;
-      pImg5 = pImgYPad5 + j;
-      pImg6 = pImgYPad6 + j;
-#endif
-
-#if JVET_N0242_NON_LINEAR_ALF
       pRec1 = pRec0 + j;
 
       if ( bChroma && isPCMFilterDisabled )
@@ -1567,11 +894,7 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
         {
           for( blkX=0; blkX<8; blkX+=2 )
           {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             Position pos(j + blkDst.x + blkX, i + blkDst.y + blkY);
-#else
-            Position pos(j+startWidth+blkX, i+startHeight+blkY);
-#endif
             CodingUnit* cu = isDualTree ? cs.getCU(pos, CH_C) : cs.getCU(recalcPosition(nChromaFormat, CH_C, CH_L, pos), CH_L);
             if( cu != NULL) 
             {
@@ -1598,7 +921,6 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
 
       for( int ii = 0; ii < clsSizeY; ii++ )
       {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
         pImg0 = pImgYPad0 + j + ii * srcStride;
         pImg1 = pImgYPad1 + j + ii * srcStride;
         pImg2 = pImgYPad2 + j + ii * srcStride;
@@ -1606,7 +928,6 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
         pImg4 = pImgYPad4 + j + ii * srcStride;
         pImg5 = pImgYPad5 + j + ii * srcStride;
         pImg6 = pImgYPad6 + j + ii * srcStride;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         if ((blkDst.y + i + ii) % vbCTUHeight < vbPos && ((blkDst.y + i + ii) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
         {
           pImg1 = ((blkDst.y + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
@@ -1627,29 +948,6 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
           pImg3 = ((blkDst.y + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
           pImg5 = ((blkDst.y + i + ii) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
         }
-#else
-        if ((startHeight + i + ii) % vbCTUHeight < vbPos && ((startHeight + i + ii) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((startHeight + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 3) ? pImg3 : pImg5;
-
-          pImg2 = ((startHeight + i + ii) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-          pImg6 = ((startHeight + i + ii) % vbCTUHeight >= vbPos - 3) ? pImg4 : pImg6;
-        }
-        else if ((startHeight + i + ii) % vbCTUHeight >= vbPos && ((startHeight + i + ii) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((startHeight + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-          pImg6 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 2) ? pImg4 : pImg6;
-
-          pImg1 = ((startHeight + i + ii) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + ii) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
-        }
-#endif
-#endif
         __m128i clipp, clipm;
         __m128i coeffa, coeffb;
         __m128i xmmCur = _mm_lddqu_si128( ( __m128i* ) ( pImg0 + 0 ) );
@@ -1965,150 +1263,7 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
           xmmS0 = _mm_blend_epi16( xmmS0, xmmCur, 0xFC );
           _mm_storeu_si128( ( __m128i* )( pRec1 ), xmmS0 );
         }
-#else
-      for( int k = 0; k < 4; k++ )
-      {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-        pImg0 = pImgYPad0 + j + k * srcStride; //j: width, 4x4 block
-        pImg1 = pImgYPad1 + j + k * srcStride;
-        pImg2 = pImgYPad2 + j + k * srcStride;
-        pImg3 = pImgYPad3 + j + k * srcStride;
-        pImg4 = pImgYPad4 + j + k * srcStride;
-        pImg5 = pImgYPad5 + j + k * srcStride;
-        pImg6 = pImgYPad6 + j + k * srcStride;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-        if ((blkDst.y + i + k) % vbCTUHeight < vbPos && ((blkDst.y + i + k) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((blkDst.y + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-          pImg5 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 3) ? pImg3 : pImg5;
-
-          pImg2 = ((blkDst.y + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-          pImg6 = ((blkDst.y + i + k) % vbCTUHeight >= vbPos - 3) ? pImg4 : pImg6;
-        }
-        else if ((blkDst.y + i + k) % vbCTUHeight >= vbPos && ((blkDst.y + i + k) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((blkDst.y + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-          pImg6 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 2) ? pImg4 : pImg6;
-
-          pImg1 = ((blkDst.y + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-          pImg5 = ((blkDst.y + i + k) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
-        }
-#else
-        if ((startHeight + i + k) % vbCTUHeight < vbPos && ((startHeight + i + k) % vbCTUHeight >= vbPos - (bChroma ? 2 : 4))) //above
-        {
-          pImg1 = ((startHeight + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 2) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 3) ? pImg3 : pImg5;
-
-          pImg2 = ((startHeight + i + k) % vbCTUHeight == vbPos - 1) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 2) ? pImg2 : pImg4;
-          pImg6 = ((startHeight + i + k) % vbCTUHeight >= vbPos - 3) ? pImg4 : pImg6;
-        }
-        else if ((startHeight + i + k) % vbCTUHeight >= vbPos && ((startHeight + i + k) % vbCTUHeight <= vbPos + (bChroma ? 1 : 3))) //bottom
-        {
-          pImg2 = ((startHeight + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg2;
-          pImg4 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 1) ? pImg2 : pImg4;
-          pImg6 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 2) ? pImg4 : pImg6;
 
-          pImg1 = ((startHeight + i + k) % vbCTUHeight == vbPos) ? pImg0 : pImg1;
-          pImg3 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 1) ? pImg1 : pImg3;
-          pImg5 = ((startHeight + i + k) % vbCTUHeight <= vbPos + 2) ? pImg3 : pImg5;
-        }
-#endif
-#endif
-        __m128i xmm6 = _mm_lddqu_si128( ( __m128i* ) pImg6 );
-        __m128i xmm4 = _mm_lddqu_si128( ( __m128i* ) ( pImg4 - 1 ) );
-        __m128i xmm2 = _mm_lddqu_si128( ( __m128i* ) ( pImg2 - 2 ) );
-        __m128i xmm0 = _mm_lddqu_si128( ( __m128i* ) ( pImg0 - 3 ) );
-        __m128i xmm11 = _mm_lddqu_si128( ( __m128i* ) ( pImg0 + 5 ) );
-        __m128i xmm1 = _mm_lddqu_si128( ( __m128i* ) ( pImg1 - 2 - 1 ) );
-        __m128i xmm8 = _mm_lddqu_si128( ( __m128i* ) ( pImg1 + 5 ) );
-        __m128i xmm3 = _mm_lddqu_si128( ( __m128i* ) ( pImg3 - 2 ) );
-        __m128i xmm5 = _mm_lddqu_si128( ( __m128i* ) ( pImg5 - 1 ) );
-
-        xmm6 = _mm_add_epi16( xmm6, _mm_srli_si128( xmm5, 2 ) );
-
-        __m128i xmm12 = _mm_blend_epi16( _mm_slli_si128( xmm0, 2 ), xmm6, 0x01 );
-        __m128i xmm13 = _mm_blend_epi16( xmm0, _mm_srli_si128( xmm6, 2 ), 0x01 );
-
-        __m128i xmm14 = _mm_blend_epi16( _mm_slli_si128( xmm2, 6 ), xmm4, 0x07 );
-        __m128i xmm16 = _mm_blend_epi16( _mm_slli_si128( xmm1, 4 ), _mm_srli_si128( xmm3, 2 ), 0x07 );
-        xmm14 = _mm_shuffle_epi8( xmm14, xmm10 );
-        xmm14 = _mm_add_epi16( xmm14, xmm16 );
-        __m128i xmm15 = _mm_blend_epi16( _mm_slli_si128( xmm2, 4 ), _mm_srli_si128( xmm4, 2 ), 0x07 );
-        __m128i xmm17 = _mm_blend_epi16( _mm_slli_si128( xmm1, 2 ), _mm_srli_si128( xmm3, 4 ), 0x07 );
-        xmm15 = _mm_shuffle_epi8( xmm15, xmm10 );
-        xmm15 = _mm_add_epi16( xmm15, xmm17 );
-
-        xmm12 = _mm_madd_epi16( xmm12, c0 );
-        xmm13 = _mm_madd_epi16( xmm13, c0 );
-        xmm14 = _mm_madd_epi16( xmm14, c2 );
-        xmm15 = _mm_madd_epi16( xmm15, c2 );
-
-        xmm12 = _mm_add_epi32( xmm12, xmm14 );
-        xmm13 = _mm_add_epi32( xmm13, xmm15 );
-        xmm14 = _mm_shuffle_epi32( xmm12, 0x1B );
-        xmm15 = _mm_shuffle_epi32( xmm13, 0x1B );
-        xmm12 = _mm_add_epi32( xmm12, xmm14 );
-        xmm13 = _mm_add_epi32( xmm13, xmm15 );
-
-        __m128i xmm7 = _mm_blend_epi16( xmm12, xmm13, 0xF0 );
-
-        xmm12 = _mm_blend_epi16( _mm_alignr_epi8( xmm11, xmm0, 2 ), _mm_srli_si128( xmm6, 4 ), 0x01 );
-        xmm13 = _mm_blend_epi16( _mm_alignr_epi8( xmm11, xmm0, 4 ), _mm_srli_si128( xmm6, 6 ), 0x01 );
-
-        xmm14 = _mm_blend_epi16( _mm_slli_si128( xmm2, 2 ), _mm_srli_si128( xmm4, 4 ), 0x07 );
-        xmm16 = _mm_blend_epi16( xmm1, _mm_srli_si128( xmm3, 6 ), 0x07 );
-        xmm14 = _mm_shuffle_epi8( xmm14, xmm10 );
-        xmm14 = _mm_add_epi16( xmm14, xmm16 );
-        xmm15 = _mm_blend_epi16( xmm2, _mm_srli_si128( xmm4, 6 ), 0x07 );
-        xmm8 = _mm_alignr_epi8( xmm8, xmm1, 2 );
-        xmm17 = _mm_blend_epi16( xmm8, _mm_srli_si128( xmm3, 8 ), 0x07 );
-        xmm15 = _mm_shuffle_epi8( xmm15, xmm10 );
-        xmm15 = _mm_add_epi16( xmm15, xmm17 );
-
-        xmm12 = _mm_madd_epi16( xmm12, c0 );
-        xmm13 = _mm_madd_epi16( xmm13, c0 );
-        xmm14 = _mm_madd_epi16( xmm14, c2 );
-        xmm15 = _mm_madd_epi16( xmm15, c2 );
-
-        xmm12 = _mm_add_epi32( xmm12, xmm14 );
-        xmm13 = _mm_add_epi32( xmm13, xmm15 );
-        xmm14 = _mm_shuffle_epi32( xmm12, 0x1B );
-        xmm15 = _mm_shuffle_epi32( xmm13, 0x1B );
-        xmm12 = _mm_add_epi32( xmm12, xmm14 );
-        xmm13 = _mm_add_epi32( xmm13, xmm15 );
-
-        __m128i xmm9 = _mm_blend_epi16( xmm12, xmm13, 0xF0 );
-
-        xmm12 = _mm_hadd_epi32( xmm7, xmm9 );
-
-        xmm12 = _mm_add_epi32( xmm12, mmOffset );
-        xmm12 = _mm_srai_epi32( xmm12, numBitsMinus1 );
-
-        xmm12 = _mm_min_epi32( mmMax, _mm_max_epi32( xmm12, mmMin ) );
-
-        xmm12 = _mm_packus_epi32( xmm12, xmm12 );
-
-        _mm_storel_epi64( ( __m128i* )( pRec ), xmm12 );
-
-        pRec += dstStride;
-#endif
-
-#if !JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-        pImg0 += srcStride;
-        pImg1 += srcStride;
-        pImg2 += srcStride;
-        pImg3 += srcStride;
-        pImg4 += srcStride;
-        pImg5 += srcStride;
-        pImg6 += srcStride;
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
 
         pRec1 += dstStride;
       }
@@ -2134,41 +1289,9 @@ static void simdFilter7x7Blk( AlfClassifier** classifier, const PelUnitBuf &recD
         }
       }
 
-#else
-      }
-
-      pRec -= ( 4 * dstStride );
-
-      // restore 2x2 PCM chroma blocks
-      if( bChroma && isPCMFilterDisabled )
-      {
-        int  blkX, blkY;
-        bool *flags  = pcmFlags2x2;
-        Pel  *pcmRec = pcmRec2x2;
-        for( blkY=0; blkY<4; blkY+=2 )
-        {
-          for( blkX=0; blkX<4; blkX+=2 )
-          {
-            if( *flags++ )
-            {
-              pRec[(blkY+0)*dstStride + (blkX+0)] = *pcmRec++;
-              pRec[(blkY+0)*dstStride + (blkX+1)] = *pcmRec++;
-              pRec[(blkY+1)*dstStride + (blkX+0)] = *pcmRec++;
-              pRec[(blkY+1)*dstStride + (blkX+1)] = *pcmRec++;
-            }
-          }
-        }
-      }
-
-      pRec += 4;
-#endif
     }
 
-#if JVET_N0242_NON_LINEAR_ALF
     pRec0 += dstStride2;
-#else
-    pRec += dstStride2;
-#endif
 
     pImgYPad0 += srcStride2;
     pImgYPad1 += srcStride2;
diff --git a/source/Lib/CommonLib/x86/BufferX86.h b/source/Lib/CommonLib/x86/BufferX86.h
index 41e97b108..ae3969589 100644
--- a/source/Lib/CommonLib/x86/BufferX86.h
+++ b/source/Lib/CommonLib/x86/BufferX86.h
@@ -288,11 +288,7 @@ void gradFilter_SSE(Pel* src, int srcStride, int width, int height, int gradStri
 
   int widthInside = width - 2 * BIO_EXTEND_SIZE;
   int heightInside = height - 2 * BIO_EXTEND_SIZE;
-#if JVET_N0325_BDOF
   int shift1 = std::max<int>(6, bitDepth - 6);
-#else
-  int shift1 = std::max<int>(2, (14 - bitDepth));
-#endif
 
   assert((widthInside & 3) == 0);
 
@@ -344,13 +340,8 @@ void gradFilter_SSE(Pel* src, int srcStride, int width, int height, int gradStri
 template< X86_VEXT vext >
 void calcBIOPar_SSE(const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, const int bitDepth)
 {
-#if JVET_N0325_BDOF
   int shift4 = std::max<int>(4, (bitDepth - 8));
   int shift5 = std::max<int>(1, (bitDepth - 11));
-#else
-  int shift4 = std::min<int>(8, (bitDepth - 4));
-  int shift5 = std::min<int>(5, (bitDepth - 7));
-#endif
   for (int y = 0; y < heightG; y++)
   {
     int x = 0;
diff --git a/source/Lib/CommonLib/x86/InterpolationFilterX86.h b/source/Lib/CommonLib/x86/InterpolationFilterX86.h
index 59c455d30..33bd60b4e 100644
--- a/source/Lib/CommonLib/x86/InterpolationFilterX86.h
+++ b/source/Lib/CommonLib/x86/InterpolationFilterX86.h
@@ -195,21 +195,6 @@ static void fullPelCopyAVX2( const ClpRng& clpRng, const void*_src, int srcStrid
 template<X86_VEXT vext, bool isFirst, bool isLast>
 static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride, int16_t* dst, int dstStride, int width, int height, bool biMCForDMVR)
 {
-#if !HM_JEM_CLIP_PEL
-  if( vext >= AVX2 && ( width % 16 ) == 0 )
-  {
-    fullPelCopyAVX2<Pel, 16, isFirst, isLast >( clpRng, src, srcStride, dst, dstStride, width, height );
-  }
-  else if( ( width % 16 ) == 0 )
-  {
-    fullPelCopySSE<Pel, 16, isFirst, isLast >( clpRng, src, srcStride, dst, dstStride, width, height );
-  }
-  else if( ( width % 8 ) == 0 )
-  {
-    fullPelCopySSE<Pel, 8, isFirst, isLast>( clpRng, src, srcStride, dst, dstStride, width, height );
-  }
-  else
-#endif
   { //Scalar
     InterpolationFilter::filterCopy<isFirst, isLast>( clpRng, src, srcStride, dst, dstStride, width, height, biMCForDMVR);
   }
diff --git a/source/Lib/CommonLib/x86/RdCostX86.h b/source/Lib/CommonLib/x86/RdCostX86.h
index 25e402e2f..740a24ece 100644
--- a/source/Lib/CommonLib/x86/RdCostX86.h
+++ b/source/Lib/CommonLib/x86/RdCostX86.h
@@ -2109,12 +2109,6 @@ Distortion RdCost::xGetHADs_SIMD( const DistParam &rcDtParam )
     THROW( "Unsupported size" );
   }
 
-#if 0
-  Distortion hadSimd   = uiSum >> DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth);
-  Distortion hadScalar = RdCost::xGetHADs( rcDtParam );
-
-  CHECK( hadSimd != hadScalar, "SIMD implementation of HAD norm is equal to the scalar implementation!" );
-#endif
 
   return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(rcDtParam.bitDepth);
 }
diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp
index 6969c038d..f206c628c 100644
--- a/source/Lib/DecoderLib/CABACReader.cpp
+++ b/source/Lib/DecoderLib/CABACReader.cpp
@@ -142,44 +142,24 @@ bool CABACReader::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
 
 
   sao( cs, ctuRsAddr );
-#if JVET_N0415_CTB_ALF
   if (cs.sps->getALFEnabledFlag() && (cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Y)))
   {
-#else
-  if (cs.sps->getALFEnabledFlag() && (cs.slice->getTileGroupAlfEnabledFlag()))
-  {
-    CHECK(cs.aps == nullptr, "APS not initialized");
-    const AlfSliceParam& alfSliceParam = cs.aps->getAlfAPSParam();
-#endif
     const PreCalcValues& pcv = *cs.pcv;
     int                 frame_width_in_ctus = pcv.widthInCtus;
     int                 ry = ctuRsAddr / frame_width_in_ctus;
     int                 rx = ctuRsAddr - ry * frame_width_in_ctus;
     const Position      pos( rx * cs.pcv->maxCUWidth, ry * cs.pcv->maxCUHeight );
     const uint32_t          curSliceIdx = cs.slice->getIndependentSliceIdx();
-#if JVET_N0857_TILES_BRICKS
     const uint32_t          curTileIdx = cs.picture->brickMap->getBrickIdxRsMap( pos );
-#else
-    const uint32_t          curTileIdx = cs.picture->tileMap->getTileIdxMap( pos );
-#endif
-#if JVET_N0150_ONE_CTU_DELAY_WPP
     bool                leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), pos, curSliceIdx, curTileIdx, CH_L ) ? true : false;
     bool                aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), pos, curSliceIdx, curTileIdx, CH_L ) ? true : false;
-#else
-    bool                leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, curTileIdx, CH_L ) ? true : false;
-    bool                aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false;
-#endif
 
     int leftCTUAddr = leftAvail ? ctuRsAddr - 1 : -1;
     int aboveCTUAddr = aboveAvail ? ctuRsAddr - frame_width_in_ctus : -1;
 
     for( int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++ )
     {
-#if JVET_N0415_CTB_ALF
       if (cs.slice->getTileGroupAlfEnabledFlag((ComponentID)compIdx))
-#else
-      if( alfSliceParam.enabledFlag[compIdx] )
-#endif
       {
         uint8_t* ctbAlfFlag = cs.slice->getPic()->getAlfCtuEnableFlag( compIdx );
         int ctx = 0;
@@ -189,12 +169,10 @@ bool CABACReader::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
         RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET(STATS__CABAC_BITS__ALF);
         ctbAlfFlag[ctuRsAddr] = m_BinDecoder.decodeBin( Ctx::ctbAlfFlag( compIdx * 3 + ctx ) );
 
-#if JVET_N0415_CTB_ALF
         if (isLuma((ComponentID)compIdx) && ctbAlfFlag[ctuRsAddr])
         {
           readAlfCtuFilterIndex(cs, ctuRsAddr);
         }
-#endif
       }
     }
   }
@@ -231,7 +209,6 @@ bool CABACReader::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
   return isLast;
 }
 
-#if JVET_N0415_CTB_ALF
 void CABACReader::readAlfCtuFilterIndex(CodingStructure& cs, unsigned ctuRsAddr)
 {
   short* alfCtbFilterSetIndex = cs.slice->getPic()->getAlfCtbFilterIndex();
@@ -272,7 +249,6 @@ void CABACReader::readAlfCtuFilterIndex(CodingStructure& cs, unsigned ctuRsAddr)
   }
   alfCtbFilterSetIndex[ctuRsAddr] = filtIndex;
 }
-#endif
 //================================================================================
 //  clause 7.3.8.3
 //--------------------------------------------------------------------------------
@@ -310,26 +286,14 @@ void CABACReader::sao( CodingStructure& cs, unsigned ctuRsAddr )
 
   RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__SAO );
 
-#if JVET_N0857_TILES_BRICKS
   const unsigned  curTileIdx  = cs.picture->brickMap->getBrickIdxRsMap( pos );
-#else
-  const unsigned  curTileIdx  = cs.picture->tileMap->getTileIdxMap( pos );
-#endif
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   if( cs.getCURestricted( pos.offset(-(int)cs.pcv->maxCUWidth, 0), pos, curSliceIdx, curTileIdx, CH_L ) )
-#else
-  if( cs.getCURestricted( pos.offset(-(int)cs.pcv->maxCUWidth, 0), curSliceIdx, curTileIdx, CH_L ) )
-#endif
   {
     // sao_merge_left_flag
     sao_merge_type  += int( m_BinDecoder.decodeBin( Ctx::SaoMergeFlag() ) );
   }
 
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   if( sao_merge_type < 0 && cs.getCURestricted( pos.offset(0, -(int)cs.pcv->maxCUHeight), pos, curSliceIdx, curTileIdx, CH_L ) )
-#else
-  if( sao_merge_type < 0 && cs.getCURestricted( pos.offset(0, -(int)cs.pcv->maxCUHeight), curSliceIdx, curTileIdx, CH_L ) )
-#endif
   {
     // sao_merge_above_flag
     sao_merge_type  += int( m_BinDecoder.decodeBin( Ctx::SaoMergeFlag() ) ) << 1;
@@ -604,11 +568,7 @@ bool CABACReader::coding_tree( CodingStructure& cs, Partitioner& partitioner, CU
 
   partitioner.setCUData( cu );
   cu.slice   = cs.slice;
-#if JVET_N0857_TILES_BRICKS
   cu.tileIdx = cs.picture->brickMap->getBrickIdxRsMap( currArea.lumaPos() );
-#else
-  cu.tileIdx = cs.picture->tileMap->getTileIdxMap( currArea.lumaPos() );
-#endif
 
   // Predict QP on start of quantization group
   if( cuCtx.qgStart )
@@ -737,9 +697,7 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
   {
     cu_transquant_bypass_flag( cu );
   }
-#if JVET_N0324_REGULAR_MRG_FLAG
   PredictionUnit&    pu = cs.addPU(cu, partitioner.chType);
-#endif
   // skip flag
   if ((!cs.slice->isIntra() || cs.slice->getSPS()->getIBCFlag()) && cu.Y().valid())
   {
@@ -750,9 +708,6 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
   if( cu.skip )
   {
     cs.addTU         ( cu, partitioner.chType );
-#if !JVET_N0324_REGULAR_MRG_FLAG
-    PredictionUnit&    pu = cs.addPU( cu, partitioner.chType );
-#endif
     pu.shareParentPos = cu.shareParentPos;
     pu.shareParentSize = cu.shareParentSize;
     MergeCtx           mrgCtx;
@@ -762,14 +717,9 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
 
   // prediction mode and partitioning data
   pred_mode ( cu );
-#if JVET_N0413_RDPCM
   bdpcm_mode( cu, ComponentID( partitioner.chType ) );
-#endif
 
   // --> create PUs
-#if !JVET_N0324_REGULAR_MRG_FLAG
-  CU::addPUs( cu );
-#endif
   // pcm samples
   if( CU::isIntra(cu) )
   {
@@ -782,11 +732,6 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
     }
   }
 
-#if !JVET_N0217_MATRIX_INTRAPRED
-  extend_ref_line( cu );
-
-  isp_mode( cu );
-#endif
 
   // prediction data ( intra prediction modes / reference indexes + motion vectors )
   cu_pred_data( cu );
@@ -817,10 +762,8 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
     cu.rootCbf = false;
     cu.predMode = MODE_INTRA;
     cu.mmvdSkip = false;
-#if JVET_N0318_N0467_IBC_SIZE
     if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
     {
-#endif
     unsigned ctxId = DeriveCtx::CtxSkipFlag(cu);
     unsigned skip = m_BinDecoder.decodeBin(Ctx::SkipFlag(ctxId));
     DTRACE( g_trace_ctx, D_SYNTAX, "cu_skip_flag() ctx=%d skip=%d\n", ctxId, skip ? 1 : 0 );
@@ -831,17 +774,13 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
       cu.predMode = MODE_IBC;
       cu.mmvdSkip = false;
     }
-#if JVET_N0318_N0467_IBC_SIZE
     }
-#endif
     return;
   }
-#if JVET_N0266_SMALL_BLOCKS
   if ( !cu.cs->slice->getSPS()->getIBCFlag() && cu.lwidth() == 4 && cu.lheight() == 4 )
   {
     return;
   }
-#endif
   unsigned ctxId  = DeriveCtx::CtxSkipFlag(cu);
   unsigned skip   = m_BinDecoder.decodeBin( Ctx::SkipFlag(ctxId) );
 
@@ -849,11 +788,8 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
 
   if (skip && cu.cs->slice->getSPS()->getIBCFlag())
   {
-#if JVET_N0318_N0467_IBC_SIZE
     if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
     {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
       if ( cu.lwidth() == 4 && cu.lheight() == 4 )
       {
         cu.skip     = true;
@@ -862,7 +798,6 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
         cu.mmvdSkip = false;
         return;
       }
-#endif
     unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
     if (m_BinDecoder.decodeBin(Ctx::IBCFlag(ctxidx)))
     {
@@ -870,27 +805,22 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
       cu.rootCbf = false;
       cu.predMode = MODE_IBC;
       cu.mmvdSkip = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
       cu.firstPU->regularMergeFlag = false;
-#endif
     }
     else
     {
       cu.predMode = MODE_INTER;
     }
     DTRACE(g_trace_ctx, D_SYNTAX, "ibc() ctx=%d cu.predMode=%d\n", ctxidx, cu.predMode);
-#if JVET_N0318_N0467_IBC_SIZE
     }
     else
     {
       cu.predMode = MODE_INTER;
     }
-#endif
   }
   if ((skip && CU::isInter(cu) && cu.cs->slice->getSPS()->getIBCFlag()) ||
     (skip && !cu.cs->slice->getSPS()->getIBCFlag()))
   {
-#if JVET_N0324_REGULAR_MRG_FLAG
     if (!cu.cs->slice->getSPS()->getUseMMVD() && (cu.firstPU->lwidth() * cu.firstPU->lheight() == 32))
     {
       cu.firstPU->regularMergeFlag = true;
@@ -911,15 +841,9 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
     }
     else
     {
-#if JVET_N0127_MMVD_SPS_FLAG
       if (cu.cs->slice->getSPS()->getUseMMVD())
       {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
         bool isCUWithOnlyRegularAndMMVD=((cu.firstPU->lwidth() == 8 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 8));
-#else
-        bool isCUWithOnlyRegularAndMMVD=((cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 8 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 8));
-#endif
         if (isCUWithOnlyRegularAndMMVD)
         {
           cu.mmvdSkip = !(cu.firstPU->regularMergeFlag);
@@ -930,30 +854,12 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
           cu.mmvdSkip = mmvdSkip;
           DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, mmvdSkip ? 1 : 0);
         }
-#if JVET_N0127_MMVD_SPS_FLAG
       }
       else
       {
         cu.mmvdSkip = false;
       }
-#endif
-    }
-#else
-#if JVET_N0127_MMVD_SPS_FLAG
-    if (cu.cs->slice->getSPS()->getUseMMVD())
-    {
-#endif
-      unsigned mmvdSkip = m_BinDecoder.decodeBin(Ctx::MmvdFlag(0));
-      cu.mmvdSkip = mmvdSkip;
-      DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, mmvdSkip ? 1 : 0);
-#if JVET_N0127_MMVD_SPS_FLAG
-    }
-    else
-    {
-      cu.mmvdSkip = false;
     }
-#endif
-#endif
     cu.skip     = true;
     cu.rootCbf  = false;
     cu.predMode = MODE_INTER;
@@ -983,29 +889,16 @@ void CABACReader::imv_mode( CodingUnit& cu, MergeCtx& mrgCtx )
   const SPS *sps = cu.cs->sps;
 
   unsigned value = 0;
-#if !JVET_N600_AMVR_TPM_CTX_REDUCTION
-  unsigned ctxId = DeriveCtx::CtxIMVFlag( cu );
-#endif
   if (CU::isIBC(cu))
     value = 1;
   else
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
     value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 0 ) );
   DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", value, 0 );
-#else
-    value = m_BinDecoder.decodeBin( Ctx::ImvFlag( ctxId ) );
-  DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", value, ctxId );
-#endif
 
   if( sps->getAMVREnabledFlag() && value )
   {
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
     value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 1 ) );
     DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", value, 1 );
-#else
-    value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 3 ) );
-    DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", value, 3 );
-#endif
     value++;
   }
 
@@ -1030,23 +923,13 @@ void CABACReader::affine_amvr_mode( CodingUnit& cu, MergeCtx& mrgCtx )
   }
 
   unsigned value = 0;
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
   value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 2 ) );
   DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", value, 2 );
-#else
-  value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 4 ) );
-  DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", value, 4 );
-#endif
 
   if( value )
   {
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
     value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 3 ) );
     DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", value, 3 );
-#else
-    value = m_BinDecoder.decodeBin( Ctx::ImvFlag( 5 ) );
-    DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", value, 5 );
-#endif
     value++;
   }
 
@@ -1060,25 +943,17 @@ void CABACReader::pred_mode( CodingUnit& cu )
 
   if (cu.cs->slice->getSPS()->getIBCFlag())
   {
-#if JVET_N0266_SMALL_BLOCKS
     if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) )
-#else
-    if (cu.cs->slice->isIntra())
-#endif
     {
       cu.predMode = MODE_INTRA;
-#if JVET_N0318_N0467_IBC_SIZE
       if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
       {
-#endif
       unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
       if (m_BinDecoder.decodeBin(Ctx::IBCFlag(ctxidx)))
       {
         cu.predMode = MODE_IBC;
       }
-#if JVET_N0318_N0467_IBC_SIZE
       }
-#endif
     }
     else
     {
@@ -1089,28 +964,20 @@ void CABACReader::pred_mode( CodingUnit& cu )
       else
       {
         cu.predMode = MODE_INTER;
-#if JVET_N0318_N0467_IBC_SIZE
         if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
         {
-#endif
         unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
         if (m_BinDecoder.decodeBin(Ctx::IBCFlag(ctxidx)))
         {
           cu.predMode = MODE_IBC;
         }
-#if JVET_N0318_N0467_IBC_SIZE
         }
-#endif
       }
     }
   }
   else
   {
-#if JVET_N0266_SMALL_BLOCKS
     if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) || m_BinDecoder.decodeBin( Ctx::PredMode( DeriveCtx::CtxPredModeFlag( cu ) ) ) )
-#else
-    if (cu.cs->slice->isIntra() || m_BinDecoder.decodeBin(Ctx::PredMode(DeriveCtx::CtxPredModeFlag(cu))))
-#endif
     {
       cu.predMode = MODE_INTRA;
     }
@@ -1120,7 +987,6 @@ void CABACReader::pred_mode( CodingUnit& cu )
     }
   }
 }
-#if JVET_N0413_RDPCM
 void CABACReader::bdpcm_mode( CodingUnit& cu, const ComponentID compID )
 {
   cu.bdpcmMode = 0;
@@ -1138,7 +1004,6 @@ void CABACReader::bdpcm_mode( CodingUnit& cu, const ComponentID compID )
 
   DTRACE( g_trace_ctx, D_SYNTAX, "bdpcm_mode() x=%d, y=%d, w=%d, h=%d, bdpcm=%d\n", cu.lumaPos().x, cu.lumaPos().y, cu.lwidth(), cu.lheight(), cu.bdpcmMode );
 }
-#endif
 void CABACReader::pcm_flag( CodingUnit& cu, Partitioner &partitioner )
 {
   const SPS& sps = *cu.cs->sps;
@@ -1202,26 +1067,16 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
     uint32_t prefixNumBits = numGBi - 2;
     uint32_t step = 1;
 
-#if !JVET_N0286_SIMPLIFIED_GBI_IDX
-    unsigned ctxIdGBi = 4;
-#endif
     idx = 1;
 
     for(int ui = 0; ui < prefixNumBits; ++ui)
     {
-#if JVET_N0286_SIMPLIFIED_GBI_IDX
       symbol = m_BinDecoder.decodeBinEP();
-#else
-      symbol = m_BinDecoder.decodeBin(Ctx::GBiIdx(ctxIdGBi));
-#endif
 
       if (symbol == 1)
       {
         break;
       }
-#if !JVET_N0286_SIMPLIFIED_GBI_IDX
-      ctxIdGBi += step;
-#endif
       idx += step;
     }
   }
@@ -1269,11 +1124,7 @@ void CABACReader::extend_ref_line(CodingUnit& cu)
 #if !ENABLE_JVET_L0283_MRL
   return;
 #endif
-#if JVET_N0413_RDPCM
   if ( !cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.ipcm || cu.bdpcmMode )
-#else
-  if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.ipcm)
-#endif
   {
     cu.firstPU->multiRefIdx = 0;
     return;
@@ -1314,7 +1165,6 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
     return;
   }
 
-#if JVET_N0413_RDPCM
   if( cu.bdpcmMode )
   {
     PredictionUnit *pu = cu.firstPU;
@@ -1323,9 +1173,7 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
     cu.firstPU->intraDir[0] = mpm_pred[0];
     return;
   }
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
   mip_flag(cu);
   if (cu.mipFlag)
   {
@@ -1334,7 +1182,6 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
   }
   extend_ref_line( cu );
   isp_mode( cu );
-#endif
 
   RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2( STATS__CABAC_BITS__INTRA_DIR_ANG, cu.lumaSize(), CHANNEL_TYPE_LUMA );
 
@@ -1365,15 +1212,11 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
     {
       uint32_t ipred_idx = 0;
       {
-#if JVET_N0185_UNIFIED_MPM
         unsigned ctx = (pu->cu->ispMode == NOT_INTRA_SUBPARTITIONS ? 1 : 0);
         if (pu->multiRefIdx == 0)
           ipred_idx = m_BinDecoder.decodeBin(Ctx::IntraLumaPlanarFlag(ctx));
         else
           ipred_idx = 1;
-#else
-        ipred_idx = m_BinDecoder.decodeBinEP();
-#endif
         if( ipred_idx )
         {
           ipred_idx += m_BinDecoder.decodeBinEP();
@@ -1517,9 +1360,7 @@ void CABACReader::cu_residual( CodingUnit& cu, Partitioner &partitioner, CUCtx&
     transform_tree( *cu.cs, partitioner, cuCtx, chromaCbfs );
   }
 
-#if JVET_N0193_LFNST
   residual_lfnst_mode( cu );
-#endif
 }
 
 void CABACReader::rqt_root_cbf( CodingUnit& cu )
@@ -1636,42 +1477,30 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
     }
     else
     {
-#if JVET_N0324_REGULAR_MRG_FLAG
       if (pu.regularMergeFlag)
       {
         merge_idx(pu);
       }
       else
       {
-#endif
         subblock_merge_flag( *pu.cu );
         MHIntra_flag(pu);
         if (pu.mhIntraFlag)
         {
-#if JVET_N0302_SIMPLFIED_CIIP
           pu.intraDir[0] = PLANAR_IDX;
-#else
-          MHIntra_luma_pred_modes(*pu.cu);
-#endif
           pu.intraDir[1] = DM_CHROMA_IDX;
         }
-#if JVET_N0324_REGULAR_MRG_FLAG
         else
         {
           pu.cu->triangle = pu.cu->cs->slice->getSPS()->getUseTriangle() && pu.cu->cs->slice->isInterB() && !pu.cu->affine && !pu.mmvdMergeFlag && !pu.cu->mmvdSkip;
         }
-#else
-        triangle_mode( *pu.cu );
-#endif
         if (pu.mmvdMergeFlag)
         {
           mmvd_merge_idx(pu);
         }
         else
           merge_data   ( pu );
-#if JVET_N0324_REGULAR_MRG_FLAG
       }
-#endif
     }
   }
   else if (CU::isIBC(*pu.cu))
@@ -1825,12 +1654,9 @@ void CABACReader::merge_flag( PredictionUnit& pu )
   if (pu.mergeFlag && CU::isIBC(*pu.cu))
   {
     pu.mmvdMergeFlag = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
     pu.regularMergeFlag = false;
-#endif
     return;
   }
-#if JVET_N0324_REGULAR_MRG_FLAG
   if (pu.mergeFlag)
   {
     if (!pu.cs->sps->getUseMMVD() && (pu.lwidth() * pu.lheight() == 32))
@@ -1851,15 +1677,9 @@ void CABACReader::merge_flag( PredictionUnit& pu )
     }
     else
     {
-#if JVET_N0127_MMVD_SPS_FLAG
       if (pu.cs->sps->getUseMMVD())
       {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
         bool isCUWithOnlyRegularAndMMVD=((pu.lwidth() == 8 && pu.lheight() == 4) || (pu.lwidth() == 4 && pu.lheight() == 8));
-#else
-        bool isCUWithOnlyRegularAndMMVD=((pu.lwidth() == 4 && pu.lheight() == 4) || (pu.lwidth() == 8 && pu.lheight() == 4) || (pu.lwidth() == 4 && pu.lheight() == 8));
-#endif
         if (isCUWithOnlyRegularAndMMVD)
         {
           pu.mmvdMergeFlag = !(pu.regularMergeFlag);
@@ -1869,32 +1689,13 @@ void CABACReader::merge_flag( PredictionUnit& pu )
           pu.mmvdMergeFlag = (m_BinDecoder.decodeBin(Ctx::MmvdFlag(0)));
           DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_merge_flag() mmvd_merge=%d pos=(%d,%d) size=%dx%d\n", pu.mmvdMergeFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height);
         }
-#if JVET_N0127_MMVD_SPS_FLAG
       }
       else
       {
         pu.mmvdMergeFlag = false;
       }
-#endif
     }
   }
-#else
-#if JVET_N0127_MMVD_SPS_FLAG
-  if (pu.mergeFlag && pu.cs->sps->getUseMMVD())
-#else
-  if (pu.mergeFlag)
-#endif
-  {
-    pu.mmvdMergeFlag = (m_BinDecoder.decodeBin(Ctx::MmvdFlag(0)));
-    DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_merge_flag() mmvd_merge=%d pos=(%d,%d) size=%dx%d\n", pu.mmvdMergeFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height);
-  }
-#if JVET_N0127_MMVD_SPS_FLAG
-  else
-  {
-    pu.mmvdMergeFlag = false;
-  }
-#endif
-#endif
 }
 
 
@@ -1964,15 +1765,10 @@ void CABACReader::merge_idx( PredictionUnit& pu )
       }
       return decIdx;
     };
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
     const int maxNumTriangleCand = pu.cs->slice->getMaxNumTriangleCand();
     CHECK(maxNumTriangleCand < 2, "Incorrect max number of triangle candidates");
     candIdx0 = decodeOneIdx(maxNumTriangleCand - 1);
     candIdx1 = decodeOneIdx(maxNumTriangleCand - 2);
-#else
-    candIdx0 = decodeOneIdx(TRIANGLE_MAX_NUM_UNI_CANDS - 1);
-    candIdx1 = decodeOneIdx(TRIANGLE_MAX_NUM_UNI_CANDS - 2);
-#endif
     candIdx1 += candIdx1 >= candIdx0 ? 1 : 0;
     DTRACE( g_trace_ctx, D_SYNTAX, "merge_idx() triangle_split_dir=%d\n", splitDir );
     DTRACE( g_trace_ctx, D_SYNTAX, "merge_idx() triangle_idx0=%d\n", candIdx0 );
@@ -2013,12 +1809,8 @@ void CABACReader::mmvd_merge_idx(PredictionUnit& pu)
 
   mvpIdx = (var + dir0)*(MMVD_MAX_REFINE_NUM*MMVD_BASE_MV_NUM);
 
-#if JVET_N0448_N0380
   int numCand = int(pu.cs->slice->getMaxNumMergeCand());
   int numCandminus1_base = (numCand > 1) ? MMVD_BASE_MV_NUM - 1 : 0;
-#else
-  int numCandminus1_base = MMVD_BASE_MV_NUM - 1;
-#endif
   var0 = 0;
   if (numCandminus1_base > 0)
   {
@@ -2191,141 +1983,8 @@ void CABACReader::MHIntra_flag(PredictionUnit& pu)
   DTRACE(g_trace_ctx, D_SYNTAX, "MHIntra_flag() MHIntra=%d pos=(%d,%d) size=%dx%d\n", pu.mhIntraFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height);
 }
 
-#if !JVET_N0302_SIMPLFIED_CIIP
-void CABACReader::MHIntra_luma_pred_modes(CodingUnit &cu)
-{
-  if (!cu.Y().valid())
-  {
-    return;
-  }
-
-  RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2(STATS__CABAC_BITS__INTRA_DIR_ANG, cu.lumaSize(), CHANNEL_TYPE_LUMA);
-
-  const int numMPMs = 3;  // Multi-hypothesis intra uses only 3 MPM
-
-  // prev_intra_luma_pred_flag
-  int numBlocks = CU::getNumPUs(cu);
-  int mpmFlag[4];
-  PredictionUnit *pu = cu.firstPU;
-  for (int k = 0; k < numBlocks; k++)
-  {
-    if (PU::getNarrowShape(pu->lwidth(), pu->lheight()) == 0)
-    {
-      mpmFlag[k] = m_BinDecoder.decodeBin(Ctx::MHIntraPredMode());
-    }
-    else
-    {
-      mpmFlag[k] = 1;
-    }
-  }
-
-  unsigned mpm_pred[numMPMs];
-  for (int k = 0; k < numBlocks; k++)
-  {
-    PU::getMHIntraMPMs(*pu, mpm_pred);
-
-    if (mpmFlag[k])
-    {
-      unsigned pred_idx = 0;
-
-      pred_idx = m_BinDecoder.decodeBinEP();
-      if (pred_idx)
-      {
-        pred_idx += m_BinDecoder.decodeBinEP();
-      }
-      pu->intraDir[0] = mpm_pred[pred_idx];
-    }
-    else
-    {
-      unsigned pred_mode = 0;
-
-      bool isMPMCand[4];
-      for (unsigned i = 0; i < 4; i++)
-      {
-        isMPMCand[i] = false;
-      }
-      for (unsigned i = 0; i < 3; i++)
-      {
-        if (mpm_pred[i] == PLANAR_IDX)
-        {
-          isMPMCand[0] = true;
-        }
-        else if (mpm_pred[i] == DC_IDX)
-        {
-          isMPMCand[1] = true;
-        }
-        else if (mpm_pred[i] == HOR_IDX)
-        {
-          isMPMCand[2] = true;
-        }
-        else if (mpm_pred[i] == VER_IDX)
-        {
-          isMPMCand[3] = true;
-        }
-      }
-      if (!isMPMCand[0])
-      {
-        pred_mode = PLANAR_IDX;
-      }
-      if (!isMPMCand[1])
-      {
-        pred_mode = DC_IDX;
-      }
-      if (!isMPMCand[2])
-      {
-        pred_mode = HOR_IDX;
-      }
-      if (!isMPMCand[3])
-      {
-        pred_mode = VER_IDX;
-      }
-      pu->intraDir[0] = pred_mode;
-    }
-    DTRACE(g_trace_ctx, D_SYNTAX, "intra_luma_pred_modes() idx=%d pos=(%d,%d) mode=%d\n", k, pu->lumaPos().x, pu->lumaPos().y, pu->intraDir[0]);
-    pu = pu->next;
-  }
-}
-#endif
-
-#if !JVET_N0324_REGULAR_MRG_FLAG
-void CABACReader::triangle_mode( CodingUnit& cu )
-{
-  RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__TRIANGLE_FLAG );
-
-  if( !cu.cs->slice->getSPS()->getUseTriangle() || !cu.cs->slice->isInterB() || cu.lwidth() * cu.lheight() < TRIANGLE_MIN_SIZE || cu.affine )
-  {
-    return;
-  }
-
-  if ( cu.firstPU->mmvdMergeFlag || cu.mmvdSkip )
-  {
-    return;
-  }
-
-  if ( cu.firstPU->mhIntraFlag )
-  {
-    return;
-  }
-
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
-  if (cu.cs->slice->getMaxNumTriangleCand() < 2)
-  {
-    return;
-  }
-#endif
-
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
-  cu.triangle = m_BinDecoder.decodeBin( Ctx::TriangleFlag(0) );
-#else
-  unsigned flag_idx = DeriveCtx::CtxTriangleFlag( cu );
-  cu.triangle = m_BinDecoder.decodeBin( Ctx::TriangleFlag(flag_idx) );
-#endif
 
 
-  DTRACE( g_trace_ctx, D_SYNTAX, "triangle_mode() triangle_mode=%d pos=(%d,%d) size: %dx%d\n", cu.triangle, cu.Y().x, cu.Y().y, cu.lumaSize().width, cu.lumaSize().height );
-}
-#endif
-
 //================================================================================
 //  clause 7.3.8.7
 //--------------------------------------------------------------------------------
@@ -2383,9 +2042,7 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
 
   split = partitioner.canSplit( TU_MAX_TR_SPLIT, cs );
 
-#if JVET_N0492_NO_HIERARCH_CBF
   bool max_tu_split = split;
-#endif
 
   if( cu.sbtInfo && partitioner.canSplit( PartSplit( cu.getSbtTuSplit() ), cs ) )
   {
@@ -2402,20 +2059,12 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
   if( area.chromaFormat != CHROMA_400 && area.blocks[COMPONENT_Cb].valid() && ( !CS::isDualITree( cs ) || partitioner.chType == CHANNEL_TYPE_CHROMA ) && ( !cu.ispMode || chromaCbfISP ) )
   {
     const int cbfDepth = chromaCbfISP ? trDepth - 1 : trDepth;
-#if JVET_N0492_NO_HIERARCH_CBF
     if (!max_tu_split)
-#endif
     {
-#if !JVET_N0492_NO_HIERARCH_CBF
-      if (chromaCbfs.Cb)
-#endif
       {
         if (!(cu.sbtInfo && trDepth == 1))
           chromaCbfs.Cb &= cbf_comp(cs, area.blocks[COMPONENT_Cb], cbfDepth);
       }
-#if !JVET_N0492_NO_HIERARCH_CBF
-      if (chromaCbfs.Cr)
-#endif
       {
         if (!(cu.sbtInfo && trDepth == 1))
           chromaCbfs.Cr &= cbf_comp(cs, area.blocks[COMPONENT_Cr], cbfDepth, chromaCbfs.Cb);
@@ -2568,7 +2217,6 @@ bool CABACReader::cbf_comp( CodingStructure& cs, const CompArea& area, unsigned
 
   RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2(STATS__CABAC_BITS__QT_CBF, area.size(), area.compID);
 
-#if JVET_N0413_RDPCM
   unsigned  cbf = 0;
   if( area.compID == COMPONENT_Y && cs.getCU( area.pos(), ChannelType( area.compID ) )->bdpcmMode )
   {
@@ -2578,9 +2226,6 @@ bool CABACReader::cbf_comp( CodingStructure& cs, const CompArea& area, unsigned
   {
     cbf = m_BinDecoder.decodeBin( ctxSet( ctxId ) );
   }
-#else
-  const unsigned  cbf = m_BinDecoder.decodeBin( ctxSet( ctxId ) );
-#endif
 
   DTRACE( g_trace_ctx, D_SYNTAX, "cbf_comp() etype=%d pos=(%d,%d) ctx=%d cbf=%d\n", area.compID, area.x, area.y, ctxId, cbf );
   return cbf;
@@ -2750,20 +2395,17 @@ void CABACReader::cu_chroma_qp_offset( CodingUnit& cu )
 //    void        residual_coding_subblock( coeffCtx )
 //================================================================================
 
-#if JVET_N0054_JOINT_CHROMA
 void CABACReader::joint_cb_cr( TransformUnit& tu )
 {
   RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2( STATS__CABAC_BITS__JOINT_CB_CR, tu.blocks[COMPONENT_Cr].lumaSize(), CHANNEL_TYPE_CHROMA );
   tu.jointCbCr = m_BinDecoder.decodeBin( Ctx::JointCbCrFlag( 0 ) );
 }
-#endif
 
 void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
 {
   const CodingUnit& cu = *tu.cu;
   DTRACE( g_trace_ctx, D_SYNTAX, "residual_coding() etype=%d pos=(%d,%d) size=%dx%d predMode=%d\n", tu.blocks[compID].compID, tu.blocks[compID].x, tu.blocks[compID].y, tu.blocks[compID].width, tu.blocks[compID].height, cu.predMode );
 
-#if JVET_N0054_JOINT_CHROMA
   // Joint Cb-Cr residual mode is signalled if both Cb and Cr cbfs are true
   if ( compID == COMPONENT_Cr && TU::getCbf( tu, COMPONENT_Cb ) )
   {
@@ -2773,25 +2415,17 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
     if ( tu.jointCbCr )
       return;
   }
-#endif
 
   // parse transform skip and explicit rdpcm mode
   mts_coding         ( tu, compID );
   explicit_rdpcm_mode( tu, compID );
 
-#if JVET_N0280_RESIDUAL_CODING_TS
-#if JVET_N0413_RDPCM
   if( isLuma( compID ) && ( tu.mtsIdx == MTS_SKIP || tu.cu->bdpcmMode ) )
-#else
-  if( isLuma( compID ) && tu.mtsIdx == MTS_SKIP )
-#endif
   {
     residual_codingTS( tu, compID );
     return;
   }
-#endif
 
-#if HEVC_USE_SIGN_HIDING
   // determine sign hiding
   bool signHiding  = ( cu.cs->slice->getSignDataHidingEnabledFlag() && !cu.transQuantBypass && tu.rdpcm[compID] == RDPCM_OFF );
   if(  signHiding && CU::isIntra(cu) && CU::isRDPCMEnabled(cu) && tu.mtsIdx==MTS_SKIP )
@@ -2803,14 +2437,9 @@ void CABACReader::residual_coding( TransformUnit& tu, ComponentID compID )
       signHiding = false;
     }
   }
-#endif
 
   // init coeff coding context
-#if HEVC_USE_SIGN_HIDING
   CoeffCodingContext  cctx    ( tu, compID, signHiding );
-#else
-  CoeffCodingContext  cctx    ( tu, compID );
-#endif
   TCoeff*             coeff   = tu.getCoeffs( compID ).buf;
 
   // parse last coeff position
@@ -2842,9 +2471,7 @@ void CABACReader::mts_coding( TransformUnit& tu, ComponentID compID )
   const bool  tsAllowed = TU::isTSAllowed ( tu, compID );
   const bool mtsAllowed = TU::isMTSAllowed( tu, compID );
 
-#if JVET_N0413_RDPCM
   if( tu.cu->bdpcmMode ) tu.mtsIdx = MTS_SKIP;
-#endif
   if( !mtsAllowed && !tsAllowed ) return;
 
   RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2( STATS__CABAC_BITS__MTS_FLAGS, tu.blocks[compID], compID );
@@ -2889,17 +2516,9 @@ void CABACReader::mts_coding( TransformUnit& tu, ComponentID compID )
 void CABACReader::isp_mode( CodingUnit& cu )
 {
 #if INCLUDE_ISP_CFG_FLAG
-#if JVET_N0413_RDPCM
   if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm || !cu.cs->sps->getUseISP() || cu.bdpcmMode )
 #else
-  if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm || !cu.cs->sps->getUseISP() )
-#endif
-#else
-#if JVET_N0413_RDPCM
   if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm || cu.bdpcmMode )
-#else
-  if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm )
-#endif
 #endif
   {
     cu.ispMode = NOT_INTRA_SUBPARTITIONS;
@@ -2961,14 +2580,9 @@ void CABACReader::explicit_rdpcm_mode( TransformUnit& tu, ComponentID compID )
   }
 }
 
-#if JVET_N0193_LFNST
 void CABACReader::residual_lfnst_mode( CodingUnit& cu )
 {
-#if JVET_N0217_MATRIX_INTRAPRED
   if( cu.ispMode != NOT_INTRA_SUBPARTITIONS || cu.mipFlag == true ||
-#else
-  if( cu.ispMode != NOT_INTRA_SUBPARTITIONS ||
-#endif
     ( CS::isDualITree( *cu.cs ) && cu.chType == CHANNEL_TYPE_CHROMA && std::min( cu.blocks[ 1 ].width, cu.blocks[ 1 ].height ) < 4 ) )
   {
     return;
@@ -2997,42 +2611,19 @@ void CABACReader::residual_lfnst_mode( CodingUnit& cu )
     return;
   }
 
-#if !JVET_N0105_LFNST_CTX_MODELLING
-  uint32_t ctxOff = 0;
-
-  int intraMode = cu.firstPU->intraDir[ cu.chType ];
-  if( intraMode == DM_CHROMA_IDX && !isLuma( cu.chType ) )
-  {
-    intraMode = PLANAR_IDX;
-  }
-  if( cu.chromaFormat == CHROMA_422 && !isLuma( cu.chType ) )
-  {
-    intraMode = g_chroma422IntraAngleMappingTable[ intraMode ];
-  }
-  ctxOff = PU::isLMCMode( intraMode ) || intraMode <= DC_IDX;
-#endif
 
   unsigned cctx = 0;
   if( cu.firstTU->mtsIdx < MTS_DST7_DST7 && CS::isDualITree( *cu.cs ) ) cctx++;
 
-#if JVET_N0105_LFNST_CTX_MODELLING
   uint32_t idxLFNST = m_BinDecoder.decodeBin( Ctx::LFNSTIdx( cctx ) );
-#else
-  uint32_t idxLFNST = m_BinDecoder.decodeBin( Ctx::LFNSTIdx( ctxOff + 4 * cctx ) );
-#endif
   if( idxLFNST )
   {
-#if JVET_N0105_LFNST_CTX_MODELLING
     idxLFNST += m_BinDecoder.decodeBinEP();
-#else
-    idxLFNST += m_BinDecoder.decodeBin( Ctx::LFNSTIdx( 2 + ctxOff + 4 * cctx ) );
-#endif
   }
   cu.lfnstIdx = idxLFNST;
 
   DTRACE( g_trace_ctx, D_SYNTAX, "residual_lfnst_mode() etype=%d pos=(%d,%d) mode=%d\n", COMPONENT_Y, cu.lx(), cu.ly(), ( int ) cu.lfnstIdx );
 }
-#endif
 
 int CABACReader::last_sig_coeff( CoeffCodingContext& cctx, TransformUnit& tu, ComponentID compID )
 {
@@ -3084,13 +2675,6 @@ int CABACReader::last_sig_coeff( CoeffCodingContext& cctx, TransformUnit& tu, Co
   }
 
   int blkPos;
-#if HEVC_USE_MDCS
-  if( cctx.scanType() == SCAN_VER )
-  {
-    blkPos = PosLastY + ( PosLastX * cctx.width() );
-  }
-  else
-#endif
   {
     blkPos = PosLastX + ( PosLastY * cctx.width() );
   }
@@ -3146,10 +2730,8 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co
 
   //===== decode absolute values =====
   const int inferSigPos   = nextSigPos != cctx.scanPosLast() ? ( cctx.isNotFirst() ? minSubPos : -1 ) : nextSigPos;
-#if HEVC_USE_SIGN_HIDING
   int       firstNZPos    = nextSigPos;
   int       lastNZPos     = -1;
-#endif
   int       numNonZero    =  0;
   bool      is2x2subblock = ( cctx.log2CGSize() == 2 );
   int       remRegBins    = ( is2x2subblock ? MAX_NUM_REG_BINS_2x2SUBBLOCK : MAX_NUM_REG_BINS_4x4SUBBLOCK );
@@ -3178,10 +2760,8 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co
       uint8_t&  ctxOff = ctxOffset[ nextSigPos - minSubPos ];
       ctxOff           = cctx.ctxOffsetAbs();
       sigBlkPos[ numNonZero++ ] = blkPos;
-#if HEVC_USE_SIGN_HIDING
       firstNZPos = nextSigPos;
       lastNZPos  = std::max<int>( lastNZPos, nextSigPos );
-#endif
 
       RExt__DECODER_DEBUG_BIT_STATISTICS_SET( ctype_gt1 );
       unsigned gt1Flag = m_BinDecoder.decodeBin( cctx.greater1CtxIdAbs(ctxOff) );
@@ -3214,10 +2794,8 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co
   unsigned ricePar = 0;
   for( int scanPos = firstSigPos; scanPos > firstPosMode2; scanPos-- )
   {
-#if JVET_N0188_UNIFY_RICEPARA
     int       sumAll = cctx.templateAbsSum(scanPos, coeff, 4);
     ricePar = g_auiGoRiceParsCoeff[sumAll];
-#endif
     TCoeff& tcoeff = coeff[ cctx.blockPos( scanPos ) ];
     if( tcoeff >= 4 )
     {
@@ -3225,23 +2803,13 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co
       int       rem     = m_BinDecoder.decodeRemAbsEP( ricePar, cctx.extPrec(), cctx.maxLog2TrDRange() );
       DTRACE( g_trace_ctx, D_SYNTAX_RESI, "rem_val() bin=%d ctx=%d\n", rem, ricePar );
       tcoeff += (rem<<1);
-#if !JVET_N0188_UNIFY_RICEPARA
-      if( ricePar < 3 && rem > (3<<ricePar)-1 )
-      {
-        ricePar++;
-      }
-#endif
     }
   }
 
   //===== coeff bypass ====
   for( int scanPos = firstPosMode2; scanPos >= minSubPos; scanPos-- )
   {
-#if JVET_N0188_UNIFY_RICEPARA
     int       sumAll = cctx.templateAbsSum(scanPos, coeff, 0);
-#else
-    int       sumAll    = cctx.templateAbsSum(scanPos, coeff);
-#endif
     int       rice      = g_auiGoRiceParsCoeff                        [sumAll];
     int       pos0      = g_auiGoRicePosCoeff0[std::max(0, state - 1)][sumAll];
     int       rem       = m_BinDecoder.decodeRemAbsEP( rice, cctx.extPrec(), cctx.maxLog2TrDRange() );
@@ -3253,36 +2821,25 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co
     {
       int        blkPos         = cctx.blockPos( scanPos );
       sigBlkPos[ numNonZero++ ] = blkPos;
-#if HEVC_USE_SIGN_HIDING
       lastNZPos  = std::max<int>( lastNZPos, scanPos );
-#endif
       coeff[blkPos] = tcoeff;
     }
   }
 
   //===== decode sign's =====
   RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2( STATS__CABAC_BITS__SIGN_BIT, Size( cctx.width(), cctx.height() ), cctx.compID() );
-#if HEVC_USE_SIGN_HIDING
   const unsigned  numSigns    = ( cctx.hideSign( firstNZPos, lastNZPos ) ? numNonZero - 1 : numNonZero );
   unsigned        signPattern = m_BinDecoder.decodeBinsEP( numSigns ) << ( 32 - numSigns );
-#else
-  unsigned        signPattern = m_BinDecoder.decodeBinsEP( numNonZero ) << ( 32 - numNonZero );
-#endif
 
   //===== set final coefficents =====
   int sumAbs = 0;
-#if HEVC_USE_SIGN_HIDING
   for( unsigned k = 0; k < numSigns; k++ )
-#else
-  for( unsigned k = 0; k < numNonZero; k++ )
-#endif
   {
     int AbsCoeff          = coeff[ sigBlkPos[ k ] ];
     sumAbs               += AbsCoeff;
     coeff[ sigBlkPos[k] ] = ( signPattern & ( 1u << 31 ) ? -AbsCoeff : AbsCoeff );
     signPattern         <<= 1;
   }
-#if HEVC_USE_SIGN_HIDING
   if( numNonZero > numSigns )
   {
     int k                 = numSigns;
@@ -3290,20 +2847,14 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co
     sumAbs               += AbsCoeff;
     coeff[ sigBlkPos[k] ] = ( sumAbs & 1 ? -AbsCoeff : AbsCoeff );
   }
-#endif
 }
 
-#if JVET_N0280_RESIDUAL_CODING_TS
 void CABACReader::residual_codingTS( TransformUnit& tu, ComponentID compID )
 {
   DTRACE( g_trace_ctx, D_SYNTAX, "residual_codingTS() etype=%d pos=(%d,%d) size=%dx%d\n", tu.blocks[compID].compID, tu.blocks[compID].x, tu.blocks[compID].y, tu.blocks[compID].width, tu.blocks[compID].height );
 
   // init coeff coding context
-#if JVET_N0413_RDPCM
   CoeffCodingContext  cctx    ( tu, compID, false, tu.cu->bdpcmMode );
-#else
-  CoeffCodingContext  cctx    ( tu, compID, false );
-#endif
   TCoeff*             coeff   = tu.getCoeffs( compID ).buf;
 
   cctx.setNumCtxBins( 2 * tu.lwidth()*tu.lheight() );
@@ -3390,11 +2941,7 @@ void CABACReader::residual_coding_subblockTS( CoeffCodingContext& cctx, TCoeff*
       int sign;
       if( cctx.isContextCoded() )
       {
-#if JVET_N0413_RDPCM
         sign = m_BinDecoder.decodeBin( Ctx::TsResidualSign(  cctx.bdpcm() ? 1 : 0 ) );
-#else
-        sign = m_BinDecoder.decodeBin( Ctx::TsResidualSign( toChannelType( cctx.compID() ) ) );
-#endif
       }
       else
       {
@@ -3489,7 +3036,6 @@ void CABACReader::residual_coding_subblockTS( CoeffCodingContext& cctx, TCoeff*
     signPattern         >>= 1;
   }
 }
-#endif
 
 
 //================================================================================
@@ -3575,7 +3121,6 @@ unsigned CABACReader::exp_golomb_eqprob( unsigned count )
   return symbol;
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 unsigned CABACReader::code_unary_fixed( unsigned ctxId, unsigned unary_max, unsigned fixed )
 {
   unsigned idx;
@@ -3668,4 +3213,3 @@ void CABACReader::mip_pred_mode( PredictionUnit &pu )
 
   DTRACE( g_trace_ctx, D_SYNTAX, "mip_pred_mode() pos=(%d,%d) mode=%d\n", pu.lumaPos().x, pu.lumaPos().y, pu.intraDir[CHANNEL_TYPE_LUMA] );
 }
-#endif
diff --git a/source/Lib/DecoderLib/CABACReader.h b/source/Lib/DecoderLib/CABACReader.h
index eb03163ac..72868ea7f 100644
--- a/source/Lib/DecoderLib/CABACReader.h
+++ b/source/Lib/DecoderLib/CABACReader.h
@@ -68,9 +68,7 @@ public:
   // sao (clause 7.3.8.3)
   void        sao                       ( CodingStructure&              cs,     unsigned        ctuRsAddr );
 
-#if JVET_N0415_CTB_ALF
   void        readAlfCtuFilterIndex(CodingStructure&              cs, unsigned        ctuRsAddr);
-#endif
 
   // coding (quad)tree (clause 7.3.8.4)
   bool        coding_tree               ( CodingStructure&              cs,     Partitioner&    pm,       CUCtx& cuCtx, Partitioner* pPartitionerChroma = nullptr, CUCtx* pCuCtxChroma = nullptr);
@@ -81,9 +79,7 @@ public:
   void        cu_transquant_bypass_flag ( CodingUnit&                   cu );
   void        cu_skip_flag              ( CodingUnit&                   cu );
   void        pred_mode                 ( CodingUnit&                   cu );
-#if JVET_N0413_RDPCM
   void        bdpcm_mode                ( CodingUnit&                   cu,     const ComponentID compID );
-#endif
   void        pcm_flag                  ( CodingUnit&                   cu,     Partitioner&    pm );
   void        cu_pred_data              ( CodingUnit&                   cu );
   void        cu_gbi_flag               ( CodingUnit&                   cu );
@@ -96,11 +92,9 @@ public:
   void        rqt_root_cbf              ( CodingUnit&                   cu );
   void        sbt_mode                  ( CodingUnit&                   cu );
   bool        end_of_ctu                ( CodingUnit&                   cu,     CUCtx&          cuCtx );
-#if JVET_N0217_MATRIX_INTRAPRED
   void        mip_flag                  ( CodingUnit&                   cu );
   void        mip_pred_modes            ( CodingUnit&                   cu );
   void        mip_pred_mode             ( PredictionUnit&               pu );
-#endif
 
   // prediction unit (clause 7.3.8.6)
   void        prediction_unit           ( PredictionUnit&               pu,     MergeCtx&       mrgCtx );
@@ -117,9 +111,6 @@ public:
   void        mvp_flag                  ( PredictionUnit&               pu,     RefPicList      eRefList );
   void        MHIntra_flag              ( PredictionUnit&               pu );
   void        MHIntra_luma_pred_modes   ( CodingUnit&                   cu );
-#if !JVET_N0324_REGULAR_MRG_FLAG
-  void        triangle_mode             ( CodingUnit&                   cu );
-#endif
   void        smvd_mode              ( PredictionUnit&               pu );
 
   // pcm samples (clause 7.3.8.7)
@@ -140,20 +131,14 @@ public:
   // residual coding (clause 7.3.8.11)
   void        residual_coding           ( TransformUnit&                tu,     ComponentID     compID );
   void        mts_coding                ( TransformUnit&                tu,     ComponentID     compID );
-#if JVET_N0193_LFNST
   void        residual_lfnst_mode       ( CodingUnit&                   cu );
-#endif
   void        isp_mode                  ( CodingUnit&                   cu );
   void        explicit_rdpcm_mode       ( TransformUnit&                tu,     ComponentID     compID );
   int         last_sig_coeff            ( CoeffCodingContext&           cctx,   TransformUnit& tu, ComponentID   compID );
   void        residual_coding_subblock  ( CoeffCodingContext&           cctx,   TCoeff*         coeff, const int stateTransTable, int& state );
-#if JVET_N0280_RESIDUAL_CODING_TS
   void        residual_codingTS         ( TransformUnit&                tu,     ComponentID     compID );
   void        residual_coding_subblockTS( CoeffCodingContext&           cctx,   TCoeff*         coeff  );
-#endif
-#if JVET_N0054_JOINT_CHROMA
   void        joint_cb_cr               ( TransformUnit&                tu );
-#endif
 
   // cross component prediction (clause 7.3.8.12)
   void        cross_comp_pred           ( TransformUnit&                tu,     ComponentID     compID );
@@ -163,9 +148,7 @@ private:
   unsigned    unary_max_eqprob          (                                   unsigned maxSymbol );
   unsigned    exp_golomb_eqprob         ( unsigned count );
   unsigned    get_num_bits_read         () { return m_BinDecoder.getNumBitsRead(); }
-#if JVET_N0217_MATRIX_INTRAPRED
   unsigned    code_unary_fixed          ( unsigned ctxId, unsigned unary_max, unsigned fixed );
-#endif
 
   void        xReadTruncBinCode(uint32_t& symbol, uint32_t maxSymbol);
 public:
diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp
index f745f6603..9dfb9f0ed 100644
--- a/source/Lib/DecoderLib/DecCu.cpp
+++ b/source/Lib/DecoderLib/DecCu.cpp
@@ -122,9 +122,6 @@ void DecCu::decompressCtu( CodingStructure& cs, const UnitArea& ctuArea )
         if ((currCU.shareParentPos.x >= 0) && (!(currCU.shareParentPos.x == prevTmpPos.x && currCU.shareParentPos.y == prevTmpPos.y)))
         {
           m_shareStateDec = GEN_ON_SHARED_BOUND;
-#if !JVET_N0266_SMALL_BLOCKS
-          cs.motionLut.lutShare = cs.motionLut.lut;
-#endif
           cs.motionLut.lutShareIbc = cs.motionLut.lutIbc;
         }
 
@@ -198,7 +195,6 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
   }
   else
   {
-#if JVET_N0217_MATRIX_INTRAPRED
     if( PU::isMIP( pu, chType ) )
     {
       m_pcIntraPred->initIntraMip( pu );
@@ -206,27 +202,12 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
     }
     else
     {
-#endif
     m_pcIntraPred->predIntraAng( compID, piPred, pu );
-#if JVET_N0217_MATRIX_INTRAPRED
     }
-#endif
   }
   const Slice           &slice = *cs.slice;
-#if JVET_N0805_APS_LMCS
   bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
-#else
-  bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
-#endif
-#if JVET_N0477_LMCS_CLEANUP
-#if JVET_N0805_APS_LMCS
   if (flag && slice.getLmcsChromaResidualScaleFlag() && (compID != COMPONENT_Y) && (tu.cbf[COMPONENT_Cb] || tu.cbf[COMPONENT_Cr]))
-#else
-  if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID != COMPONENT_Y) && (tu.cbf[COMPONENT_Cb] || tu.cbf[COMPONENT_Cr]))
-#endif
-#else
-  if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID != COMPONENT_Y))
-#endif
   {
     const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size()));
     const CompArea &areaY = CompArea(COMPONENT_Y, tu.chromaFormat, area);
@@ -241,12 +222,10 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
 
   const QpParam cQP( tu, compID );
 
-#if JVET_N0054_JOINT_CHROMA
   // Joint chroma residual mode: Cr uses negative of the signalled Cb residual
   if ( tu.jointCbCr && compID == COMPONENT_Cr )
     piResi.copyAndNegate( cs.getResiBuf( tu.blocks[COMPONENT_Cb] ) );
   else
-#endif
   if( TU::getCbf( tu, compID ) )
   {
     m_pcTrQuant->invTransformNxN( tu, compID, piResi, cQP );
@@ -258,15 +237,9 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
 
   //===== reconstruction =====
   flag = flag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
-#if JVET_N0805_APS_LMCS
   if (flag && TU::getCbf(tu, compID) && isChroma(compID) && slice.getLmcsChromaResidualScaleFlag())
-#else
-  if (flag && TU::getCbf(tu, compID) && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj())
-#endif
   {
-#if JVET_N0054_JOINT_CHROMA
     if ( !(tu.jointCbCr && compID == COMPONENT_Cr) ) // // Joint chroma residual mode: chroma scaling took place already when doing Cb
-#endif
     piResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID));
   }
   if( isChroma(compID) && tu.compAlpha[compID] != 0 )
@@ -289,11 +262,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
   CompArea    tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
   PelBuf tmpPred;
 #endif
-#if JVET_N0805_APS_LMCS
   if (slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
-#else
-  if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
-#endif
   {
 #if REUSE_CU_RESULTS
     {
@@ -310,11 +279,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
 #if !KEEP_PRED_AND_RESI_SIGNALS
   pReco.copyFrom( piPred );
 #endif
-#if JVET_N0805_APS_LMCS
   if (slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
-#else
-  if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
-#endif
   {
 #if REUSE_CU_RESULTS
     {
@@ -496,11 +461,7 @@ void DecCu::xReconInter(CodingUnit &cu)
 
   if (cu.firstPU->mhIntraFlag)
   {
-#if JVET_N0805_APS_LMCS
     if (cu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-    if (cu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
     {
       cu.cs->getPredBuf(*cu.firstPU).Y().rspSignal(m_pcReshape->getFwdLUT());
     }
@@ -525,11 +486,7 @@ void DecCu::xReconInter(CodingUnit &cu)
     CompArea    tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
     PelBuf tmpPred;
 #endif
-#if JVET_N0805_APS_LMCS
     if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-    if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
     {
 #if REUSE_CU_RESULTS
       if (cs.pcv->isEncoder)
@@ -547,11 +504,7 @@ void DecCu::xReconInter(CodingUnit &cu)
     cs.getResiBuf( cu ).reconstruct( cs.getPredBuf( cu ), cs.getResiBuf( cu ), cs.slice->clpRngs() );
     cs.getRecoBuf( cu ).copyFrom   (                      cs.getResiBuf( cu ) );
 #endif
-#if JVET_N0805_APS_LMCS
     if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-    if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
     {
 #if REUSE_CU_RESULTS
       if (cs.pcv->isEncoder)
@@ -564,11 +517,7 @@ void DecCu::xReconInter(CodingUnit &cu)
   else
   {
     cs.getRecoBuf(cu).copyClip(cs.getPredBuf(cu), cs.slice->clpRngs());
-#if JVET_N0805_APS_LMCS
     if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && !cu.firstPU->mhIntraFlag && !CU::isIBC(cu))
-#else
-    if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && !cu.firstPU->mhIntraFlag && !CU::isIBC(cu))
-#endif
     {
       cs.getRecoBuf(cu).get(COMPONENT_Y).rspSignal(m_pcReshape->getFwdLUT());
     }
@@ -593,12 +542,10 @@ void DecCu::xDecodeInterTU( TransformUnit & currTU, const ComponentID compID )
 
   const QpParam cQP(currTU, compID);
 
-#if JVET_N0054_JOINT_CHROMA
   // Joint chroma residual mode: Cr uses negative of the signalled Cb residual
   if ( currTU.jointCbCr && compID == COMPONENT_Cr )
     resiBuf.copyAndNegate( cs.getResiBuf( currTU.blocks[COMPONENT_Cb] ) );
   else
-#endif
   if( TU::getCbf( currTU, compID ) )
   {
     m_pcTrQuant->invTransformNxN( currTU, compID, resiBuf, cQP );
@@ -610,15 +557,9 @@ void DecCu::xDecodeInterTU( TransformUnit & currTU, const ComponentID compID )
 
   //===== reconstruction =====
   const Slice           &slice = *cs.slice;
-#if JVET_N0805_APS_LMCS
   if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && isChroma(compID) && TU::getCbf(currTU, compID) && slice.getLmcsChromaResidualScaleFlag() && currTU.blocks[compID].width*currTU.blocks[compID].height > 4)
-#else
-  if ( slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && isChroma(compID) && TU::getCbf(currTU, compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() && currTU.blocks[compID].width*currTU.blocks[compID].height > 4 )
-#endif
   {
-#if JVET_N0054_JOINT_CHROMA
     if ( !(currTU.jointCbCr && compID == COMPONENT_Cr) ) // Joint chroma residual mode: chroma scaling took place already when doing Cb
-#endif
     resiBuf.scaleSignal(currTU.getChromaAdj(), 0, currTU.cu->cs->slice->clpRng(compID));
   }
   if( isChroma( compID ) && currTU.compAlpha[compID] != 0 )
@@ -644,15 +585,7 @@ void DecCu::xDecodeInterTexture(CodingUnit &cu)
     {
       CodingStructure  &cs = *cu.cs;
       const Slice &slice = *cs.slice;
-#if JVET_N0477_LMCS_CLEANUP
-#if JVET_N0805_APS_LMCS
       if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && slice.getLmcsChromaResidualScaleFlag() && (compID == COMPONENT_Y) && (currTU.cbf[COMPONENT_Cb] || currTU.cbf[COMPONENT_Cr]))
-#else
-      if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID == COMPONENT_Y) && (currTU.cbf[COMPONENT_Cb] || currTU.cbf[COMPONENT_Cr]))
-#endif
-#else
-      if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID == COMPONENT_Y))
-#endif
       {
         const CompArea &areaY = currTU.blocks[COMPONENT_Y];
         PelBuf predY = cs.getPredBuf(areaY);
@@ -711,10 +644,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
       {
         if( pu.cu->triangle )
         {
-#if JVET_N0340_TRI_MERGE_CAND && !JVET_N0266_SMALL_BLOCKS
-          pu.shareParentPos = cu.shareParentPos;
-          pu.shareParentSize = cu.shareParentSize;
-#endif
           PU::getTriangleMergeCandidates( pu, m_triangleMrgCtx );
         }
         else
@@ -772,10 +701,8 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
     }
     else
     {
-#if JVET_N0843_BVP_SIMPLIFICATION
       pu.shareParentPos = cu.shareParentPos;
       pu.shareParentSize = cu.shareParentSize;
-#endif
 #if REUSE_CU_RESULTS
       if ( cu.imv && !pu.cu->affine && !cu.cs->pcv->isEncoder )
 #else
@@ -822,11 +749,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
                 mvLB = affineAMVPInfo.mvCandLB[mvp_idx] + pu.mvdAffi[eRefList][2];
                 mvLB += pu.mvdAffi[eRefList][0];
               }
-#if JVET_N0334_MVCLIPPING
               PU::setAllAffineMv(pu, mvLT, mvRT, mvLB, eRefList, true);
-#else
-              PU::setAllAffineMv( pu, mvLT, mvRT, mvLB, eRefList );
-#endif
             }
           }
         }
@@ -843,9 +766,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
             mvd.changeIbcPrecAmvr2Internal(pu.cu->imv);
           }
           pu.mv[REF_PIC_LIST_0] = amvpInfo.mvCand[pu.mvpIdx[REF_PIC_LIST_0]] + mvd;
-#if JVET_N0334_MVCLIPPING
           pu.mv[REF_PIC_LIST_0].mvCliptoStorageBitDepth();
-#endif
         }
         else
         {
@@ -862,9 +783,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
                 pu.mvd[eRefList].changeTransPrecAmvr2Internal(pu.cu->imv);
               }
               pu.mv[eRefList] = amvpInfo.mvCand[pu.mvpIdx[eRefList]] + pu.mvd[eRefList];
-#if JVET_N0334_MVCLIPPING
               pu.mv[eRefList].mvCliptoStorageBitDepth();
-#endif
             }
           }
         }
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 2c56028fe..0775a62a0 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -201,9 +201,7 @@ bool tryDecodePicture( Picture* pcEncPic, const int expectedPoc, const std::stri
 
                 if( pic->cs->sps->getALFEnabledFlag() )
                 {
-#if JVET_N0415_CTB_ALF
                   std::copy(pic->getAlfCtbFilterIndexVec().begin(), pic->getAlfCtbFilterIndexVec().end(), pcEncPic->getAlfCtbFilterIndexVec().begin());
-#endif
                   for( int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++ )
                   {
                     std::copy( pic->getAlfCtuEnableFlag()[compIdx].begin(), pic->getAlfCtuEnableFlag()[compIdx].end(), pcEncPic->getAlfCtuEnableFlag()[compIdx].begin() );
@@ -211,24 +209,13 @@ bool tryDecodePicture( Picture* pcEncPic, const int expectedPoc, const std::stri
 
                   for( int i = 0; i < pic->slices.size(); i++ )
                   {
-#if JVET_N0415_CTB_ALF
                     pcEncPic->slices[i]->setTileGroupNumAps(pic->slices[i]->getTileGroupNumAps());
-#if JVET_N0805_APS_LMCS
                     pcEncPic->slices[i]->setAlfAPSs(pic->slices[i]->getTileGroupApsIdLuma());
                     pcEncPic->slices[i]->setAlfAPSs(pic->slices[i]->getAlfAPSs());
-#else
-                    pcEncPic->slices[i]->setAPSs(pic->slices[i]->getTileGroupApsIdLuma());
-                    pcEncPic->slices[i]->setAPSs(pic->slices[i]->getAPSs());
-#endif
                     pcEncPic->slices[i]->setTileGroupApsIdChroma(pic->slices[i]->getTileGroupApsIdChroma());
                     pcEncPic->slices[i]->setTileGroupAlfEnabledFlag(COMPONENT_Y,  pic->slices[i]->getTileGroupAlfEnabledFlag(COMPONENT_Y));
                     pcEncPic->slices[i]->setTileGroupAlfEnabledFlag(COMPONENT_Cb, pic->slices[i]->getTileGroupAlfEnabledFlag(COMPONENT_Cb));
                     pcEncPic->slices[i]->setTileGroupAlfEnabledFlag(COMPONENT_Cr, pic->slices[i]->getTileGroupAlfEnabledFlag(COMPONENT_Cr));
-#else
-                    pcEncPic->slices[i]->setAPSId(pic->slices[i]->getAPSId());
-                    pcEncPic->slices[i]->setAPS( pic->slices[i]->getAPS());
-                    pcEncPic->slices[i]->setTileGroupAlfEnabledFlag( pic->slices[i]->getTileGroupAlfEnabledFlag());
-#endif
                   }
                 }
 
@@ -579,21 +566,12 @@ void DecLib::executeLoopFilters()
 
   if( cs.sps->getALFEnabledFlag() )
   {
-#if JVET_N0415_CTB_ALF
     if (cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Y))
-#else
-    if (cs.slice->getTileGroupAlfEnabledFlag())
-#endif
     {
       // ALF decodes the differentially coded coefficients and stores them in the parameters structure.
       // Code could be restructured to do directly after parsing. So far we just pass a fresh non-const
       // copy in case the APS gets used more than once.
-#if JVET_N0415_CTB_ALF
       m_cALF.ALFProcess(cs);
-#else
-      AlfSliceParam alfParamCopy = cs.aps->getAlfAPSParam();
-      m_cALF.ALFProcess(cs, alfParamCopy);
-#endif
     }
 
   }
@@ -754,16 +732,8 @@ void DecLib::xActivateParameterSets()
 {
   if (m_bFirstSliceInPicture)
   {
-#if JVET_N0415_CTB_ALF
     APS** apss = m_parameterSetManager.getAPSs();
     memset(apss, 0, sizeof(*apss) * MAX_NUM_APS);
-#else
-    APS *aps = m_parameterSetManager.getAPS(m_apcSlicePilot->getAPSId()); // this is a temporary APS object. Do not store this value
-    if (m_apcSlicePilot->getAPSId() != -1)
-    {
-      CHECK(aps == 0, "No APS present");
-    }
-#endif
     const PPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value
     CHECK(pps == 0, "No PPS present");
 
@@ -781,31 +751,18 @@ void DecLib::xActivateParameterSets()
     {
       THROW("Parameter set activation failed!");
     }
-#if JVET_N0415_CTB_ALF
     m_parameterSetManager.getApsMap()->clear();
     //luma APSs
     for (int i = 0; i < m_apcSlicePilot->getTileGroupApsIdLuma().size(); i++)
     {
       int apsId = m_apcSlicePilot->getTileGroupApsIdLuma()[i];
-#if JVET_N0805_APS_LMCS
       APS* aps = m_parameterSetManager.getAPS(apsId, ALF_APS);
-#else
-      APS* aps = m_parameterSetManager.getAPS(apsId);
-#endif
 
       if (aps)
       {
-#if JVET_N0805_APS_LMCS
         m_parameterSetManager.clearAPSChangedFlag(apsId, ALF_APS);
-#else
-        m_parameterSetManager.clearAPSChangedFlag(apsId);
-#endif
         apss[apsId] = aps;
-#if JVET_N0805_APS_LMCS
         if (false == m_parameterSetManager.activateAPS(apsId, ALF_APS))
-#else
-        if (false == m_parameterSetManager.activateAPS(apsId))
-#endif
         {
           THROW("APS activation failed!");
         }
@@ -814,40 +771,17 @@ void DecLib::xActivateParameterSets()
 
     //chroma APS
     int apsId = m_apcSlicePilot->getTileGroupApsIdChroma();
-#if JVET_N0805_APS_LMCS
     APS* aps = m_parameterSetManager.getAPS(apsId, ALF_APS);
-#else
-    APS* aps = m_parameterSetManager.getAPS(apsId);
-#endif
     if (aps)
     {
-#if JVET_N0805_APS_LMCS
       m_parameterSetManager.clearAPSChangedFlag(apsId, ALF_APS);
-#else
-      m_parameterSetManager.clearAPSChangedFlag(apsId);
-#endif
       apss[apsId] = aps;
-#if JVET_N0805_APS_LMCS
       if (false == m_parameterSetManager.activateAPS(apsId, ALF_APS))
-#else
-      if (false == m_parameterSetManager.activateAPS(apsId))
-#endif
-      {
-        THROW("APS activation failed!");
-      }
-    }
-#else
-    if (aps)
-    {
-      m_parameterSetManager.clearAPSChangedFlag(aps->getAPSId());
-      if (false == m_parameterSetManager.activateAPS(m_apcSlicePilot->getAPSId()))
       {
         THROW("APS activation failed!");
       }
     }
-#endif
 
-#if JVET_N0805_APS_LMCS
     APS* lmcsAPS = NULL;
     if (m_apcSlicePilot->getLmcsAPSId() != -1)
     {
@@ -863,7 +797,6 @@ void DecLib::xActivateParameterSets()
         THROW("LMCS APS activation failed!");
       }
     }
-#endif
 
     xParsePrefixSEImessages();
 
@@ -877,23 +810,9 @@ void DecLib::xActivateParameterSets()
     //  Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use.
     m_pcPic = xGetNewPicBuffer (*sps, *pps, m_apcSlicePilot->getTLayer());
 
-#if JVET_M0128
     m_apcSlicePilot->applyReferencePictureListBasedMarking(m_cListPic, m_apcSlicePilot->getRPL0(), m_apcSlicePilot->getRPL1());
-#else
-    m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
-#endif
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
     m_pcPic->finalInit(*sps, *pps, apss, *lmcsAPS);
-#else
-    m_pcPic->finalInit(*sps, *pps, apss);
-#endif
-#else
-    m_pcPic->finalInit(*sps, *pps, *aps);
-#endif
-#if JVET_N0857_RECT_SLICES
     m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId())->setNumBricksInPic((int)m_pcPic->brickMap->bricks.size());
-#endif
     m_pcPic->createTempBuffers( m_pcPic->cs->pps->pcv->maxCUWidth );
     m_pcPic->cs->createCoeffs();
 
@@ -906,9 +825,6 @@ void DecLib::xActivateParameterSets()
     Slice *pSlice = m_pcPic->slices[m_uiSliceSegmentIdx];
 
     // Update the PPS and SPS pointers with the ones of the picture.
-#if !JVET_N0415_CTB_ALF
-    aps= pSlice->getAPS();
-#endif
     pps=pSlice->getPPS();
     sps=pSlice->getSPS();
 
@@ -916,18 +832,8 @@ void DecLib::xActivateParameterSets()
     m_pcPic->cs->slice = pSlice;
     m_pcPic->cs->sps   = sps;
     m_pcPic->cs->pps   = pps;
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
     memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
-#else
-    memcpy(m_pcPic->cs->apss, apss, sizeof(m_pcPic->cs->apss));
-#endif
-#else
-    m_pcPic->cs->aps   = aps;
-#endif
-#if JVET_N0805_APS_LMCS
     m_pcPic->cs->lmcsAps = lmcsAPS;
-#endif
 
 #if HEVC_VPS
     m_pcPic->cs->vps   = pSlice->getVPS();
@@ -1000,35 +906,15 @@ void DecLib::xActivateParameterSets()
 
     const SPS *sps = pSlice->getSPS();
     const PPS *pps = pSlice->getPPS();
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
     APS** apss = pSlice->getAlfAPSs();
-#else
-    APS** apss = pSlice->getAPSs();
-#endif
-#else
-    APS *aps = pSlice->getAPS();
-#endif
-#if JVET_N0805_APS_LMCS
     APS *lmcsAPS = pSlice->getLmcsAPS();
-#endif
 
     // fix Parameter Sets, now that we have the real slice
     m_pcPic->cs->slice = pSlice;
     m_pcPic->cs->sps   = sps;
     m_pcPic->cs->pps   = pps;
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
     memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
-#else
-    memcpy(m_pcPic->cs->apss, apss, sizeof(m_pcPic->cs->apss));
-#endif
-#else
-    m_pcPic->cs->aps   = aps;
-#endif
-#if JVET_N0805_APS_LMCS
     m_pcPic->cs->lmcsAps = lmcsAPS;
-#endif
 
 #if HEVC_VPS
     m_pcPic->cs->vps   = pSlice->getVPS();
@@ -1044,33 +930,19 @@ void DecLib::xActivateParameterSets()
     {
       EXIT("Error - a new PPS has been decoded while processing a picture");
     }
-#if JVET_N0415_CTB_ALF
     for (int i = 0; i < MAX_NUM_APS; i++)
     {
-#if JVET_N0805_APS_LMCS
       APS* aps = m_parameterSetManager.getAPS(i, ALF_APS);
       if (aps && m_parameterSetManager.getAPSChangedFlag(i, ALF_APS))
-#else
-      APS* aps = m_parameterSetManager.getAPS(i);
-      if (aps && m_parameterSetManager.getAPSChangedFlag(i))
-#endif
       {
         EXIT("Error - a new APS has been decoded while processing a picture");
       }
     }
-#else
-    if (aps && m_parameterSetManager.getAPSChangedFlag(aps->getAPSId()))
-    {
-      EXIT("Error - a new APS has been decoded while processing a picture");
-    }
-#endif
 
-#if JVET_N0805_APS_LMCS
     if (lmcsAPS && m_parameterSetManager.getAPSChangedFlag(lmcsAPS->getAPSId(), LMCS_APS) )
     {
       EXIT("Error - a new LMCS APS has been decoded while processing a picture");
     }
-#endif
 
     xParsePrefixSEImessages();
 
@@ -1126,14 +998,6 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   }
 
   m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType);
-#if !JVET_M0101_HLS
-  bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N ||
-                           m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N   ||
-                           m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N  ||
-                           m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N  ||
-                           m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N);
-  m_apcSlicePilot->setTemporalLayerNonReferenceFlag(nonReferenceFlag);
-#endif
   m_apcSlicePilot->setTLayer(nalu.m_temporalId);
 
   m_HLSReader.setBitstream( &nalu.getBitstream() );
@@ -1168,14 +1032,8 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   //For inference of NoOutputOfPriorPicsFlag
   if (m_apcSlicePilot->getRapPicFlag())
   {
-#if !JVET_M0101_HLS
-    if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
-        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
-        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsCvsStartFlag()))
-#else
     if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
         (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsCvsStartFlag()))
-#endif
     {
       m_apcSlicePilot->setNoRaslOutputFlag(true);
     }
@@ -1208,11 +1066,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   }
 
   //For inference of PicOutputFlag
-#if !JVET_M0101_HLS
-  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
-#else
   if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL)
-#endif
   {
     if ( m_craNoRaslOutputFlag )
     {
@@ -1229,13 +1083,6 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
     int iMaxPOClsb = 1 << sps->getBitsForPOC();
     m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
     xUpdatePreviousTid0POC(m_apcSlicePilot);
-#if !JVET_N0415_CTB_ALF
-    if (m_apcSlicePilot->getAPSId() != -1)
-    {
-      APS *aps = m_parameterSetManager.getAPS(m_apcSlicePilot->getAPSId());
-      CHECK(aps == 0, "No APS present");
-    }
-#endif
   }
 
   // Skip pictures due to random access
@@ -1247,14 +1094,6 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
     return false;
   }
   // Skip TFD pictures associated with BLA/BLANT pictures
-#if !JVET_M0101_HLS
-  if (isSkipPictureForBLA(iPOCLastDisplay))
-  {
-    m_prevSliceSkipped = true;
-    m_skippedPOC = m_apcSlicePilot->getPOC();
-    return false;
-  }
-#endif
 
   // clear previous slice skipped flag
   m_prevSliceSkipped = false;
@@ -1284,17 +1123,10 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   //detect lost reference picture and insert copy of earlier frame.
   {
     int lostPoc;
-#if JVET_M0128
     while ((lostPoc = m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPL0(), 0, true)) > 0)
       xCreateLostPicture(lostPoc - 1);
     while ((lostPoc = m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPL1(), 1, true)) > 0)
       xCreateLostPicture(lostPoc - 1);
-#else
-    while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0)
-    {
-      xCreateLostPicture(lostPoc-1);
-    }
-#endif
   }
 
     m_prevPOC = m_apcSlicePilot->getPOC();
@@ -1320,20 +1152,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
 
   // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses.
   // Now, having set up the maps, convert them to the correct form.
-#if JVET_N0857_TILES_BRICKS
   const BrickMap& tileMap = *(m_pcPic->brickMap);
-#else
-  const TileMap& tileMap = *(m_pcPic->tileMap);
-#endif
-#if !JVET_N0857_RECT_SLICES
-#if JVET_N0857_TILES_BRICKS
-    pcSlice->setSliceCurStartCtuTsAddr( tileMap.getCtuRsToBsAddrMap(pcSlice->getSliceCurStartCtuTsAddr()) );
-    pcSlice->setSliceCurEndCtuTsAddr( tileMap.getCtuRsToBsAddrMap(pcSlice->getSliceCurEndCtuTsAddr()) );
-#else
-    pcSlice->setSliceCurStartCtuTsAddr( tileMap.getCtuRsToTsAddrMap(pcSlice->getSliceCurStartCtuTsAddr()) );
-    pcSlice->setSliceCurEndCtuTsAddr( tileMap.getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr()) );
-#endif
-#else
   const uint32_t numberOfCtusInFrame = m_pcPic->cs->pcv->sizeInCtus;
 
   uint32_t startCtuIdx = 0;
@@ -1358,16 +1177,9 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
 
   pcSlice->setSliceCurStartCtuTsAddr(startCtuIdx);
   pcSlice->setSliceCurEndCtuTsAddr(endCtuIdx);
-#endif
 
-#if JVET_M0128
   pcSlice->checkCRA(pcSlice->getRPL0(), pcSlice->getRPL1(), m_pocCRA, m_associatedIRAPType, m_cListPic);
   pcSlice->constructRefPicList(m_cListPic);
-#else
-    pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic );
-    // Set reference list
-    pcSlice->setRefPicList( m_cListPic, true, true );
-#endif
 
     if (!pcSlice->isIntra())
     {
@@ -1396,15 +1208,8 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
       pcSlice->setCheckLDC(bLowDelay);
     }
 
-#if JVET_N0235_SMVD_SPS
     if (pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false
-#if !JVET_N0470_SMVD_FIX
-      && pcSlice->getMvdL1ZeroFlag() == false
-#endif
       )
-#else
-    if ( pcSlice->getCheckLDC() == false && pcSlice->getMvdL1ZeroFlag() == false )
-#endif
     {
       int currPOC = pcSlice->getPOC();
 
@@ -1484,7 +1289,6 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
     pcSlice->setRefPOCList();
 
 
-#if HEVC_USE_SCALING_LISTS
   Quant *quant = m_cTrQuant.getQuant();
 
   if(pcSlice->getSPS()->getScalingListFlag())
@@ -1509,12 +1313,10 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   {
     quant->setUseScalingList(false);
   }
-#endif
 
 
   if (pcSlice->getSPS()->getUseReshaper())
   {
-#if JVET_N0805_APS_LMCS
     if (pcSlice->getLmcsEnabledFlag())
     {
       APS* lmcsAPS = pcSlice->getLmcsAPS();
@@ -1535,15 +1337,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
       tInfo.setSliceReshapeChromaAdj(false);
       tInfo.setSliceReshapeModelPresentFlag(false);
     }
-#endif
-#if !JVET_N0805_APS_LMCS
-    m_cReshaper.copySliceReshaperInfo(m_cReshaper.getSliceReshaperInfo(), pcSlice->getReshapeInfo());
-#endif
-#if JVET_N0805_APS_LMCS
     if (pcSlice->getLmcsEnabledFlag())
-#else
-    if (pcSlice->getReshapeInfo().getSliceReshapeModelPresentFlag())
-#endif
     {
       m_cReshaper.constructReshaper();
     }
@@ -1585,19 +1379,13 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   return false;
 }
 
-#if HEVC_VPS || JVET_N0278_HLS
 void DecLib::xDecodeVPS( InputNALUnit& nalu )
 {
   VPS* vps = new VPS();
   m_HLSReader.setBitstream( &nalu.getBitstream() );
   m_HLSReader.parseVPS( vps );
-#if !JVET_N0278_HLS
-  m_parameterSetManager.storeVPS( vps, nalu.getBitstream().getFifo() );
-#endif
 }
-#endif
 
-#if JVET_N0349_DPS
 void DecLib::xDecodeDPS( InputNALUnit& nalu )
 {
   DPS* dps = new DPS();
@@ -1605,7 +1393,6 @@ void DecLib::xDecodeDPS( InputNALUnit& nalu )
   m_HLSReader.parseDPS( dps );
   m_parameterSetManager.storeDPS( dps, nalu.getBitstream().getFifo() );
 }
-#endif
 
 void DecLib::xDecodeSPS( InputNALUnit& nalu )
 {
@@ -1621,11 +1408,7 @@ void DecLib::xDecodePPS( InputNALUnit& nalu )
 {
   PPS* pps = new PPS();
   m_HLSReader.setBitstream( &nalu.getBitstream() );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   m_HLSReader.parsePPS( pps, &m_parameterSetManager );
-#else
-  m_HLSReader.parsePPS( pps );
-#endif
   m_parameterSetManager.storePPS( pps, nalu.getBitstream().getFifo() );
 }
 
@@ -1634,20 +1417,14 @@ void DecLib::xDecodeAPS(InputNALUnit& nalu)
   APS* aps = new APS();
   m_HLSReader.setBitstream(&nalu.getBitstream());
   m_HLSReader.parseAPS(aps);
-#if JVET_N0415_CTB_ALF
   aps->setTemporalId(nalu.m_temporalId);
-#endif
   m_parameterSetManager.storeAPS(aps, nalu.getBitstream().getFifo());
 }
 bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
 {
   bool ret;
   // ignore all NAL units of layers > 0
-#if JVET_N0278_HLS
   if (getTargetDecLayer() >= 0 && nalu.m_nuhLayerId != getTargetDecLayer()) //TBC: ignore bitstreams whose nuh_layer_id is not the target layer id
-#else
-  if (nalu.m_nuhLayerId > 0)
-#endif
   {
     msg( WARNING, "Warning: found NAL unit with nuh_layer_id equal to %d. Ignoring.\n", nalu.m_nuhLayerId);
     return false;
@@ -1655,17 +1432,13 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
 
   switch (nalu.m_nalUnitType)
   {
-#if HEVC_VPS || JVET_N0278_HLS
     case NAL_UNIT_VPS:
       xDecodeVPS( nalu );
       return false;
-#endif
 
-#if JVET_N0349_DPS
     case NAL_UNIT_DPS:
       xDecodeDPS( nalu );
       return false;
-#endif
 
     case NAL_UNIT_SPS:
       xDecodeSPS( nalu );
@@ -1694,24 +1467,6 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
       }
       return false;
 
-#if !JVET_M0101_HLS
-    case NAL_UNIT_CODED_SLICE_TRAIL_R:
-    case NAL_UNIT_CODED_SLICE_TRAIL_N:
-    case NAL_UNIT_CODED_SLICE_TSA_R:
-    case NAL_UNIT_CODED_SLICE_TSA_N:
-    case NAL_UNIT_CODED_SLICE_STSA_R:
-    case NAL_UNIT_CODED_SLICE_STSA_N:
-    case NAL_UNIT_CODED_SLICE_BLA_W_LP:
-    case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
-    case NAL_UNIT_CODED_SLICE_BLA_N_LP:
-    case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
-    case NAL_UNIT_CODED_SLICE_IDR_N_LP:
-    case NAL_UNIT_CODED_SLICE_CRA:
-    case NAL_UNIT_CODED_SLICE_RADL_N:
-    case NAL_UNIT_CODED_SLICE_RADL_R:
-    case NAL_UNIT_CODED_SLICE_RASL_N:
-    case NAL_UNIT_CODED_SLICE_RASL_R:
-#else
     case NAL_UNIT_CODED_SLICE_TRAIL:
     case NAL_UNIT_CODED_SLICE_STSA:
     case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
@@ -1719,7 +1474,6 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
     case NAL_UNIT_CODED_SLICE_CRA:
     case NAL_UNIT_CODED_SLICE_RADL:
     case NAL_UNIT_CODED_SLICE_RASL:
-#endif
       ret = xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
 #if JVET_J0090_MEMORY_BANDWITH_MEASURE
       if ( ret )
@@ -1752,110 +1506,25 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
     case NAL_UNIT_EOB:
       return false;
 
-#if !JVET_N0067_NAL_Unit_Header
-    case NAL_UNIT_FILLER_DATA:
-      {
-        FDReader fdReader;
-        uint32_t size;
-        fdReader.parseFillerData(&(nalu.getBitstream()),size);
-        msg( NOTICE, "Note: found NAL_UNIT_FILLER_DATA with %u bytes payload.\n", size);
-        return false;
-      }
-#endif
-#if JVET_N0067_NAL_Unit_Header
     case NAL_UNIT_RESERVED_VCL_12:
     case NAL_UNIT_RESERVED_VCL_13:
     case NAL_UNIT_RESERVED_VCL_14:
     case NAL_UNIT_RESERVED_VCL_15:
-#else
-#if !JVET_M0101_HLS
-    case NAL_UNIT_RESERVED_VCL_N10:
-    case NAL_UNIT_RESERVED_VCL_R11:
-    case NAL_UNIT_RESERVED_VCL_N12:
-    case NAL_UNIT_RESERVED_VCL_R13:
-    case NAL_UNIT_RESERVED_VCL_N14:
-    case NAL_UNIT_RESERVED_VCL_R15:
-
-    case NAL_UNIT_RESERVED_IRAP_VCL22:
-    case NAL_UNIT_RESERVED_IRAP_VCL23:
-
-    case NAL_UNIT_RESERVED_VCL24:
-    case NAL_UNIT_RESERVED_VCL25:
-    case NAL_UNIT_RESERVED_VCL26:
-    case NAL_UNIT_RESERVED_VCL27:
-    case NAL_UNIT_RESERVED_VCL28:
-    case NAL_UNIT_RESERVED_VCL29:
-    case NAL_UNIT_RESERVED_VCL30:
-    case NAL_UNIT_RESERVED_VCL31:
-#if !HEVC_VPS && !JVET_N0278_HLS
-    case NAL_UNIT_RESERVED_32:
-#endif
-#else
-    case NAL_UNIT_RESERVED_VCL_4:
-    case NAL_UNIT_RESERVED_VCL_5:
-    case NAL_UNIT_RESERVED_VCL_6:
-    case NAL_UNIT_RESERVED_VCL_7:
-
-    case NAL_UNIT_RESERVED_IRAP_VCL11:
-    case NAL_UNIT_RESERVED_IRAP_VCL12:
-    case NAL_UNIT_RESERVED_IRAP_VCL13:
-
-    case NAL_UNIT_RESERVED_VCL14:
-#if !HEVC_VPS
-    case NAL_UNIT_RESERVED_VCL15:
-#endif
-#endif
-#endif
       msg( NOTICE, "Note: found reserved VCL NAL unit.\n");
       xParsePrefixSEIsForUnknownVCLNal();
       return false;
-#if JVET_N0067_NAL_Unit_Header
     case NAL_UNIT_RESERVED_NVCL_5:
     case NAL_UNIT_RESERVED_NVCL_6:
     case NAL_UNIT_RESERVED_NVCL_7:
     case NAL_UNIT_RESERVED_NVCL_21:
     case NAL_UNIT_RESERVED_NVCL_22:
     case NAL_UNIT_RESERVED_NVCL_23:
-#else
-#if !JVET_M0101_HLS
-    case NAL_UNIT_RESERVED_NVCL41:
-    case NAL_UNIT_RESERVED_NVCL42:
-    case NAL_UNIT_RESERVED_NVCL43:
-    case NAL_UNIT_RESERVED_NVCL44:
-    case NAL_UNIT_RESERVED_NVCL45:
-    case NAL_UNIT_RESERVED_NVCL46:
-    case NAL_UNIT_RESERVED_NVCL47:
-#else
-    case NAL_UNIT_RESERVED_NVCL16:
-    case NAL_UNIT_RESERVED_NVCL26:
-    case NAL_UNIT_RESERVED_NVCL27:
-#endif
-#endif
       msg( NOTICE, "Note: found reserved NAL unit.\n");
       return false;
-#if !JVET_M0101_HLS
-    case NAL_UNIT_UNSPECIFIED_48:
-    case NAL_UNIT_UNSPECIFIED_49:
-    case NAL_UNIT_UNSPECIFIED_50:
-    case NAL_UNIT_UNSPECIFIED_51:
-    case NAL_UNIT_UNSPECIFIED_52:
-    case NAL_UNIT_UNSPECIFIED_53:
-    case NAL_UNIT_UNSPECIFIED_54:
-    case NAL_UNIT_UNSPECIFIED_55:
-    case NAL_UNIT_UNSPECIFIED_56:
-    case NAL_UNIT_UNSPECIFIED_57:
-    case NAL_UNIT_UNSPECIFIED_58:
-    case NAL_UNIT_UNSPECIFIED_59:
-    case NAL_UNIT_UNSPECIFIED_60:
-    case NAL_UNIT_UNSPECIFIED_61:
-    case NAL_UNIT_UNSPECIFIED_62:
-    case NAL_UNIT_UNSPECIFIED_63:
-#else
     case NAL_UNIT_UNSPECIFIED_28:
     case NAL_UNIT_UNSPECIFIED_29:
     case NAL_UNIT_UNSPECIFIED_30:
     case NAL_UNIT_UNSPECIFIED_31:
-#endif
       msg( NOTICE, "Note: found unspecified NAL unit.\n");
       return false;
     default:
@@ -1866,21 +1535,6 @@ bool DecLib::decode(InputNALUnit& nalu, int& iSkipFrame, int& iPOCLastDisplay)
   return false;
 }
 
-#if !JVET_M0101_HLS
-/** Function for checking if picture should be skipped because of association with a previous BLA picture
- *  This function skips all TFD pictures that follow a BLA picture in decoding order and precede it in output order.
- */
-bool DecLib::isSkipPictureForBLA( int& iPOCLastDisplay )
-{
-  if( ( m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_N_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_RADL ) &&
-        m_apcSlicePilot->getPOC() < m_pocCRA && ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N ) )
-  {
-    iPOCLastDisplay++;
-    return true;
-  }
-  return false;
-}
-#endif
 
 /** Function for checking if picture should be skipped because of random access. This function checks the skipping of pictures in the case of -s option random access.
  *  All pictures prior to the random access point indicated by the counter iSkipFrame are skipped.
@@ -1900,14 +1554,7 @@ bool DecLib::isRandomAccessSkipPicture( int& iSkipFrame, int& iPOCLastDisplay )
   }
   else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet.
   {
-#if !JVET_M0101_HLS
-    if (   m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA
-        || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-        || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-        || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL )
-#else
     if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )
-#endif
     {
       // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT.
       m_pocRandomAccess = m_apcSlicePilot->getPOC();
@@ -1927,11 +1574,7 @@ bool DecLib::isRandomAccessSkipPicture( int& iSkipFrame, int& iPOCLastDisplay )
     }
   }
   // skip the reordered pictures, if necessary
-#if !JVET_M0101_HLS
-  else if (m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N))
-#else
   else if (m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL))
-#endif
   {
     iPOCLastDisplay++;
     return true;
diff --git a/source/Lib/DecoderLib/DecLib.h b/source/Lib/DecoderLib/DecLib.h
index 8d5c2185b..f29cda58f 100644
--- a/source/Lib/DecoderLib/DecLib.h
+++ b/source/Lib/DecoderLib/DecLib.h
@@ -82,9 +82,7 @@ private:
 
   SEIMessages             m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices, excluding prefix SEIs...
 
-#if JVET_N0278_HLS
   int                     m_iTargetLayer;                       ///< target stream layer to be decoded
-#endif
 
   // functional classes
   IntraPrediction         m_cIntraPred;
@@ -103,9 +101,6 @@ private:
   RdCost                  m_cRdCost;                      ///< RD cost computation class
 #if JVET_J0090_MEMORY_BANDWITH_MEASURE
   CacheModel              m_cacheModel;
-#endif
-#if !JVET_M0101_HLS
-  bool isSkipPictureForBLA(int& iPOCLastDisplay);
 #endif
   bool isRandomAccessSkipPicture(int& iSkipFrame,  int& iPOCLastDisplay);
   Picture*                m_pcPic;
@@ -152,10 +147,8 @@ public:
   void  finishPictureLight(int& poc, PicList*& rpcListPic );
   void  checkNoOutputPriorPics (PicList* rpcListPic);
 
-#if JVET_N0278_HLS
   void  setTargetDecLayer (int val) { m_iTargetLayer = val; }
   int   getTargetDecLayer()         { return m_iTargetLayer; }
-#endif
   
   bool  getNoOutputPriorPicsFlag () const   { return m_isNoOutputPriorPics; }
   void  setNoOutputPriorPicsFlag (bool val) { m_isNoOutputPriorPics = val; }
@@ -177,20 +170,12 @@ protected:
 
   void      xActivateParameterSets();
   bool      xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDisplay);
-#if HEVC_VPS || JVET_N0278_HLS
   void      xDecodeVPS( InputNALUnit& nalu );
-#endif
-#if JVET_N0349_DPS
   void      xDecodeDPS( InputNALUnit& nalu );
-#endif
   void      xDecodeSPS( InputNALUnit& nalu );
   void      xDecodePPS( InputNALUnit& nalu );
   void      xDecodeAPS(InputNALUnit& nalu);
-#if !JVET_M0101_HLS
-  void      xUpdatePreviousTid0POC( Slice *pSlice ) { if ((pSlice->getTLayer()==0) && (pSlice->isReferenceNalu() && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) { m_prevTid0POC=pSlice->getPOC(); } }
-#else
   void      xUpdatePreviousTid0POC(Slice *pSlice) { if ((pSlice->getTLayer() == 0) && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL) && (pSlice->getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL))  { m_prevTid0POC = pSlice->getPOC(); }  }
-#endif
   void      xParsePrefixSEImessages();
   void      xParsePrefixSEIsForUnknownVCLNal();
 
diff --git a/source/Lib/DecoderLib/DecSlice.cpp b/source/Lib/DecoderLib/DecSlice.cpp
index 1c16aff44..9f83a1202 100644
--- a/source/Lib/DecoderLib/DecSlice.cpp
+++ b/source/Lib/DecoderLib/DecSlice.cpp
@@ -77,11 +77,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
 
   const SPS*     sps          = slice->getSPS();
   Picture*       pic          = slice->getPic();
-#if JVET_N0857_TILES_BRICKS
   const BrickMap& tileMap     = *pic->brickMap;
-#else
-  const TileMap& tileMap      = *pic->tileMap;
-#endif
   CABACReader&   cabacReader  = *m_CABACDecoder->getCABACReader( 0 );
 
   // setup coding structure
@@ -89,19 +85,9 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
   cs.slice            = slice;
   cs.sps              = sps;
   cs.pps              = slice->getPPS();
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
   memcpy(cs.alfApss, slice->getAlfAPSs(), sizeof(cs.alfApss));
-#else
-  memcpy(cs.apss, slice->getAPSs(), sizeof(cs.apss));
-#endif
-#else
-  cs.aps              = slice->getAPS();
-#endif
 
-#if JVET_N0805_APS_LMCS
   cs.lmcsAps = slice->getLmcsAPS();
-#endif
 
 #if HEVC_VPS
   cs.vps              = slice->getVPS();
@@ -114,9 +100,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
   if (slice->getSliceCurStartCtuTsAddr() == 0)
   {
     cs.picture->resizeAlfCtuEnableFlag( cs.pcv->sizeInCtus );
-#if JVET_N0415_CTB_ALF
     cs.picture->resizeAlfCtbFilterIndex(cs.pcv->sizeInCtus);
-#endif
   }
 
   const unsigned numSubstreams = slice->getNumberOfSubstreamSizes() + 1;
@@ -130,9 +114,6 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
   }
 
   const int       startCtuTsAddr          = slice->getSliceCurStartCtuTsAddr();
-#if !JVET_N0857_TILES_BRICKS
-  const int       startCtuRsAddr          = tileMap.getCtuTsToRsAddrMap(startCtuTsAddr);
-#endif
 
   const unsigned  numCtusInFrame          = cs.pcv->sizeInCtus;
   const unsigned  widthInCtus             = cs.pcv->widthInCtus;
@@ -147,44 +128,27 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
 
   DTRACE( g_trace_ctx, D_HEADER, "=========== POC: %d ===========\n", slice->getPOC() );
 
-#if !JVET_N0857_RECT_SLICES
-  // The first CTU of the slice is the first coded substream, but the global substream number, as calculated by getSubstreamForCtuAddr may be higher.
-  // This calculates the common offset for all substreams in this slice.
-  const unsigned  subStreamOffset         = tileMap.getSubstreamForCtuAddr(startCtuRsAddr, true, slice);
-#endif
 
   // for every CTU in the slice segment...
   bool isLastCtuOfSliceSegment = false;
-#if JVET_N0857_RECT_SLICES
   uint32_t startSliceRsRow = tileMap.getCtuBsToRsAddrMap(startCtuTsAddr) / widthInCtus;
   uint32_t startSliceRsCol = tileMap.getCtuBsToRsAddrMap(startCtuTsAddr) % widthInCtus;
   uint32_t endSliceRsRow = tileMap.getCtuBsToRsAddrMap(slice->getSliceCurEndCtuTsAddr() - 1) / widthInCtus;
   uint32_t endSliceRsCol = tileMap.getCtuBsToRsAddrMap(slice->getSliceCurEndCtuTsAddr() - 1) % widthInCtus;
   unsigned subStrmId = 0;
-#endif
   for( unsigned ctuTsAddr = startCtuTsAddr; !isLastCtuOfSliceSegment && ctuTsAddr < numCtusInFrame; ctuTsAddr++ )
   {
-#if JVET_N0857_TILES_BRICKS
     const unsigned  ctuRsAddr             = tileMap.getCtuBsToRsAddrMap(ctuTsAddr);
     const Brick&  currentTile             = tileMap.bricks[ tileMap.getBrickIdxRsMap(ctuRsAddr) ];
-#else
-    const unsigned  ctuRsAddr             = tileMap.getCtuTsToRsAddrMap(ctuTsAddr);
-    const Tile&     currentTile           = tileMap.tiles[ tileMap.getTileIdxMap(ctuRsAddr) ];
-#endif
-#if JVET_N0857_RECT_SLICES
     if (slice->getPPS()->getRectSliceFlag() &&
       ((ctuRsAddr / widthInCtus) < startSliceRsRow || (ctuRsAddr / widthInCtus) > endSliceRsRow ||
       (ctuRsAddr % widthInCtus) < startSliceRsCol || (ctuRsAddr % widthInCtus) > endSliceRsCol))
       continue;
-#endif
     const unsigned  firstCtuRsAddrOfTile  = currentTile.getFirstCtuRsAddr();
     const unsigned  tileXPosInCtus        = firstCtuRsAddrOfTile % widthInCtus;
     const unsigned  tileYPosInCtus        = firstCtuRsAddrOfTile / widthInCtus;
     const unsigned  ctuXPosInCtus         = ctuRsAddr % widthInCtus;
     const unsigned  ctuYPosInCtus         = ctuRsAddr / widthInCtus;
-#if !JVET_N0857_RECT_SLICES
-    const unsigned  subStrmId             = tileMap.getSubstreamForCtuAddr( ctuRsAddr, true, slice ) - subStreamOffset;
-#endif
     const unsigned  maxCUSize             = sps->getMaxCUWidth();
     Position pos( ctuXPosInCtus*maxCUSize, ctuYPosInCtus*maxCUSize) ;
     UnitArea ctuArea(cs.area.chromaFormat, Area( pos.x, pos.y, maxCUSize, maxCUSize ) );
@@ -209,19 +173,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
       {
         cabacReader.initCtxModels( *slice );
       }
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0150_ONE_CTU_DELAY_WPP
       if( cs.getCURestricted( pos.offset(0, -1), pos, slice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) )
-#else
-      if( cs.getCURestricted( pos.offset(maxCUSize, -1), slice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) )
-#endif
-#else
-#if JVET_N0150_ONE_CTU_DELAY_WPP
-      if( cs.getCURestricted( pos.offset(0, -1), pos, slice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) )
-#else
-      if( cs.getCURestricted( pos.offset(maxCUSize, -1), slice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) )
-#endif
-#endif
       {
         // Top-right is available, so use it.
         cabacReader.getCtx() = m_entropyCodingSyncContextState;
@@ -239,9 +191,6 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
     {
       cs.motionLut.lut.resize(0);
       cs.motionLut.lutIbc.resize(0);
-#if !JVET_N0266_SMALL_BLOCKS
-      cs.motionLut.lutShare.resize(0);
-#endif
       cs.motionLut.lutShareIbc.resize(0);
     }
 
@@ -259,11 +208,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
 
     m_pcCuDecoder->decompressCtu( cs, ctuArea );
 
-#if JVET_N0150_ONE_CTU_DELAY_WPP
     if( ctuXPosInCtus == tileXPosInCtus && wavefrontsEnabled )
-#else
-    if( ctuXPosInCtus == tileXPosInCtus+1 && wavefrontsEnabled )
-#endif
     {
       m_entropyCodingSyncContextState = cabacReader.getCtx();
     }
@@ -276,13 +221,8 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
 #endif
         slice->setSliceCurEndCtuTsAddr( ctuTsAddr+1 );
     }
-#if JVET_N0857_TILES_BRICKS
     else if( ( ctuXPosInCtus + 1 == tileXPosInCtus + currentTile.getWidthInCtus () ) &&
              ( ctuYPosInCtus + 1 == tileYPosInCtus + currentTile.getHeightInCtus() || wavefrontsEnabled ) )
-#else
-    else if( ( ctuXPosInCtus + 1 == tileXPosInCtus + currentTile.getTileWidthInCtus () ) &&
-             ( ctuYPosInCtus + 1 == tileYPosInCtus + currentTile.getTileHeightInCtus() || wavefrontsEnabled ) )
-#endif
     {
       // The sub-stream/stream should be terminated after this CTU.
       // (end of slice-segment, end of tile, end of wavefront-CTU-row)
@@ -291,9 +231,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
 #if DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES
       cabacReader.remaining_bytes( true );
 #endif
-#if JVET_N0857_RECT_SLICES
       subStrmId++;
-#endif
     }
   }
   CHECK( !isLastCtuOfSliceSegment, "Last CTU of slice segment not signalled as such" );
diff --git a/source/Lib/DecoderLib/NALread.cpp b/source/Lib/DecoderLib/NALread.cpp
index c52db6499..d0ed99d4f 100644
--- a/source/Lib/DecoderLib/NALread.cpp
+++ b/source/Lib/DecoderLib/NALread.cpp
@@ -110,7 +110,6 @@ static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, InputBitstream *bi
 static void xTraceNalUnitHeader(InputNALUnit& nalu)
 {
   DTRACE( g_trace_ctx, D_NALUNITHEADER, "*********** NAL UNIT (%s) ***********\n", nalUnitTypeToString(nalu.m_nalUnitType) );
-  #if JVET_N0067_NAL_Unit_Header
   bool zeroTidRequiredFlag = 0;
   if((nalu.m_nalUnitType >= 16) && (nalu.m_nalUnitType <= 31)) {
     zeroTidRequiredFlag = 1;
@@ -124,12 +123,6 @@ static void xTraceNalUnitHeader(InputNALUnit& nalu)
   DTRACE( g_trace_ctx, D_NALUNITHEADER, "%-50s u(%d)  : %u\n", "nuh_layer_id", 7, nalu.m_nuhLayerId );
 #endif
   DTRACE( g_trace_ctx, D_NALUNITHEADER, "%-50s u(%d)  : %u\n", "nuh_reserved_zero_bit", 1, 0 );
-  #else
-  DTRACE( g_trace_ctx, D_NALUNITHEADER, "%-50s u(%d)  : %u\n", "forbidden_zero_bit", 1, 0 );
-  DTRACE( g_trace_ctx, D_NALUNITHEADER, "%-50s u(%d)  : %u\n", "nal_unit_type", 6, nalu.m_nalUnitType );
-  DTRACE( g_trace_ctx, D_NALUNITHEADER, "%-50s u(%d)  : %u\n", "nuh_layer_id", 6, nalu.m_nuhLayerId );
-  DTRACE( g_trace_ctx, D_NALUNITHEADER, "%-50s u(%d)  : %u\n", "nuh_temporal_id_plus1", 3, nalu.m_temporalId + 1 );
-  #endif
 }
 #endif
 
@@ -137,7 +130,6 @@ void readNalUnitHeader(InputNALUnit& nalu)
 {
   InputBitstream& bs = nalu.getBitstream();
 
-#if JVET_N0067_NAL_Unit_Header
   bool zeroTidRequiredFlag = bs.read(1);              // zero_tid_required_flag
   nalu.m_temporalId = bs.read(3) - 1;                 // nuh_temporal_id_plus1
   //When zero_tid_required_flag is equal to 1, the value of nuh_temporal_id_plus1 shall be equal to 1.
@@ -154,20 +146,9 @@ void readNalUnitHeader(InputNALUnit& nalu)
 #endif
   uint32_t nuh_reserved_zero_bit = bs.read(1);        // nuh_reserved_zero_bit
   CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
-#else
-  bool forbidden_zero_bit = bs.read(1);           // forbidden_zero_bit
-  if(forbidden_zero_bit != 0) { THROW( "Forbidden zero-bit not '0'" );}
-  nalu.m_nalUnitType = (NalUnitType) bs.read(6);  // nal_unit_type
-  nalu.m_nuhLayerId = bs.read(6);                 // nuh_layer_id
-  nalu.m_temporalId = bs.read(3) - 1;             // nuh_temporal_id_plus1
-#endif
 
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
-#if JVET_N0067_NAL_Unit_Header
   CodingStatistics::IncrementStatisticEP(STATS__NAL_UNIT_HEADER_BITS, 1+3+4+7+1, 0);
-#else
-  CodingStatistics::IncrementStatisticEP(STATS__NAL_UNIT_HEADER_BITS, 1+6+6+3, 0);
-#endif
 #endif
 
 #if ENABLE_TRACING
@@ -179,82 +160,15 @@ void readNalUnitHeader(InputNALUnit& nalu)
   {
     if ( nalu.m_temporalId )
     {
-#if JVET_N0067_NAL_Unit_Header
       CHECK(  
            (uint32_t)nalu.m_nalUnitType >= 16
         && (uint32_t)nalu.m_nalUnitType <= 31
             , "Invalid NAL type" );
-#else
-#if HEVC_VPS
-#if !JVET_M0101_HLS
-      CHECK(  nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
-           || nalu.m_nalUnitType == NAL_UNIT_VPS
-           || nalu.m_nalUnitType == NAL_UNIT_SPS
-           || nalu.m_nalUnitType == NAL_UNIT_EOS
-           || nalu.m_nalUnitType == NAL_UNIT_EOB
-            , "Invalid NAL type" );
-#else
-      CHECK(  nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
-           || nalu.m_nalUnitType == NAL_UNIT_VPS
-           || nalu.m_nalUnitType == NAL_UNIT_SPS
-           || nalu.m_nalUnitType == NAL_UNIT_EOS
-           || nalu.m_nalUnitType == NAL_UNIT_EOB
-           , "Invalid NAL type" );
-#endif
-#else
-#if !JVET_M0101_HLS
-      CHECK(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
-#if JVET_N0278_HLS
-           || nalu.m_nalUnitType == NAL_UNIT_VPS
-#endif
-           || nalu.m_nalUnitType == NAL_UNIT_SPS
-           || nalu.m_nalUnitType == NAL_UNIT_EOS
-           || nalu.m_nalUnitType == NAL_UNIT_EOB
-           , "Invalid NAL type");
-#else
-      CHECK(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-         || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
-         || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA
-#if JVET_N0278_HLS
-         || nalu.m_nalUnitType == NAL_UNIT_VPS
-#endif
-         || nalu.m_nalUnitType == NAL_UNIT_SPS
-         || nalu.m_nalUnitType == NAL_UNIT_EOS
-         || nalu.m_nalUnitType == NAL_UNIT_EOB
-         , "Invalid NAL type");
-#endif
-#endif
-#endif
     }
     else
     {
-#if JVET_N0067_NAL_Unit_Header
-      CHECK(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
-         , "Invalid NAL type");
-#else
-#if !JVET_M0101_HLS
-      CHECK(  nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R
-           || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
-            , "Invalid NAL type" );
-#else
       CHECK(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA
          , "Invalid NAL type");
-#endif
-#endif
     }
   }
 }
diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp
index 0f4864f1b..a7f7698df 100644
--- a/source/Lib/DecoderLib/SEIread.cpp
+++ b/source/Lib/DecoderLib/SEIread.cpp
@@ -474,7 +474,6 @@ void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, uint32_t pay
   sei_read_uvlc( pDecodedMessageOutputStream, val, "decoding_unit_idx");
   sei.m_decodingUnitIdx = val;
 
-#if JVET_N0063_VUI
   if(sps->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
   {
     sei_read_code( pDecodedMessageOutputStream, ( sps->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay_increment");
@@ -490,24 +489,6 @@ void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, uint32_t pay
     sei_read_code( pDecodedMessageOutputStream, sps->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay");
     sei.m_picSptDpbOutputDuDelay = val;
   }
-#else
-  const VUI *vui = sps->getVuiParameters();
-  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
-  {
-    sei_read_code( pDecodedMessageOutputStream, ( vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay_increment");
-    sei.m_duSptCpbRemovalDelay = val;
-  }
-  else
-  {
-    sei.m_duSptCpbRemovalDelay = 0;
-  }
-  sei_read_flag( pDecodedMessageOutputStream, val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = (val != 0);
-  if(sei.m_dpbOutputDuDelayPresentFlag)
-  {
-    sei_read_code( pDecodedMessageOutputStream, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay");
-    sei.m_picSptDpbOutputDuDelay = val;
-  }
-#endif
 }
 
 void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, uint32_t payloadSize, const SPS *sps, std::ostream *pDecodedMessageOutputStream)
@@ -515,12 +496,7 @@ void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, uint32_t paylo
   int i, nalOrVcl;
   uint32_t code;
 
-#if JVET_N0063_VUI
   const HRDParameters *pHRD = sps->getHrdParameters();
-#else
-  const VUI *pVUI = sps->getVuiParameters();
-  const HRDParameters *pHRD = pVUI->getHrdParameters();
-#endif
 
   output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
 
@@ -569,17 +545,9 @@ void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, uint32_t payloadSi
   int i;
   uint32_t code;
 
-#if JVET_N0063_VUI
   const HRDParameters *hrd = sps->getHrdParameters();
-#else
-  const VUI *vui = sps->getVuiParameters();
-  const HRDParameters *hrd = vui->getHrdParameters();
-#endif
   output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
 
-#if !JVET_N0063_VUI
-  if( vui->getFrameFieldInfoPresentFlag() )
-#endif
   {
     sei_read_code( pDecodedMessageOutputStream, 4, code, "pic_struct" );             sei.m_picStruct            = code;
     sei_read_code( pDecodedMessageOutputStream, 2, code, "source_scan_type" );       sei.m_sourceScanType       = code;
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 610d1aadb..b6f1b5b82 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -269,7 +269,6 @@ HLSyntaxReader::~HLSyntaxReader()
 // Public member functions
 // ====================================================================================================================
 
-#if JVET_M0128
 void HLSyntaxReader::copyRefPicList(SPS* sps, ReferencePictureList* source_rpl, ReferencePictureList* dest_rp)
 {
   dest_rp->setNumberOfShorttermPictures(source_rpl->getNumberOfShorttermPictures());
@@ -339,112 +338,8 @@ void HLSyntaxReader::parseRefPicList(SPS* sps, ReferencePictureList* rpl)
   rpl->setNumberOfShorttermPictures(numStrp);
   rpl->setNumberOfLongtermPictures(numLtrp);
 }
-#else
-void HLSyntaxReader::parseShortTermRefPicSet( SPS* sps, ReferencePictureSet* rps, int idx )
-{
-  uint32_t code;
-  uint32_t interRPSPred;
-  if (idx > 0)
-  {
-    READ_FLAG(interRPSPred, "inter_ref_pic_set_prediction_flag");  rps->setInterRPSPrediction(interRPSPred);
-  }
-  else
-  {
-    interRPSPred = false;
-    rps->setInterRPSPrediction(false);
-  }
-
-  if (interRPSPred)
-  {
-    uint32_t bit;
-    if(idx == sps->getRPSList()->getNumberOfReferencePictureSets())
-    {
-      READ_UVLC(code, "delta_idx_minus1" ); // delta index of the Reference Picture Set used for prediction minus 1
-    }
-    else
-    {
-      code = 0;
-    }
-    rps->setDeltaRIdxMinus1(code); // th we need that for proper transcoding
-    CHECK(code > idx-1, "Code exceeds boundary"); // delta_idx_minus1 shall not be larger than idx-1, otherwise we will predict from a negative row position that does not exist. When idx equals 0 there is no legal value and interRPSPred must be zero. See J0185-r2
-    int rIdx =  idx - 1 - code;
-    CHECK(rIdx > idx-1 || rIdx < 0, "Invalid index"); // Made assert tighter; if rIdx = idx then prediction is done from itself. rIdx must belong to range 0, idx-1, inclusive, see J0185-r2
-    ReferencePictureSet*   rpsRef = sps->getRPSList()->getReferencePictureSet(rIdx);
-    int k = 0, k0 = 0, k1 = 0;
-    READ_CODE(1, bit, "delta_rps_sign"); // delta_RPS_sign
-    READ_UVLC(code, "abs_delta_rps_minus1");  // absolute delta RPS minus 1
-    int deltaRPS = (1 - 2 * bit) * (code + 1); // delta_RPS
-
-    rps->setDeltaRPS( deltaRPS ); // th we need that for proper transcoding
-
-    for(int j=0 ; j <= rpsRef->getNumberOfPictures(); j++)
-    {
-      READ_CODE(1, bit, "used_by_curr_pic_flag" ); //first bit is "1" if Idc is 1
-      int refIdc = bit;
-      if (refIdc == 0)
-      {
-        READ_CODE(1, bit, "use_delta_flag" ); //second bit is "1" if Idc is 2, "0" otherwise.
-        refIdc = bit<<1; //second bit is "1" if refIdc is 2, "0" if refIdc = 0.
-      }
-      if (refIdc == 1 || refIdc == 2)
-      {
-        int deltaPOC = deltaRPS + ((j < rpsRef->getNumberOfPictures())? rpsRef->getDeltaPOC(j) : 0);
-        rps->setDeltaPOC(k, deltaPOC);
-        rps->setUsed(k, (refIdc == 1));
-
-        if (deltaPOC < 0)
-        {
-          k0++;
-        }
-        else
-        {
-          k1++;
-        }
-        k++;
-      }
-      rps->setRefIdc(j,refIdc);
-    }
-    rps->setNumRefIdc(rpsRef->getNumberOfPictures()+1);
-    rps->setNumberOfPictures(k);
-    rps->setNumberOfNegativePictures(k0);
-    rps->setNumberOfPositivePictures(k1);
-    rps->sortDeltaPOC();
-  }
-  else
-  {
-    READ_UVLC(code, "num_negative_pics");           rps->setNumberOfNegativePictures(code);
-    READ_UVLC(code, "num_positive_pics");           rps->setNumberOfPositivePictures(code);
-    int prev = 0;
-    int poc;
-    for(int j=0 ; j < rps->getNumberOfNegativePictures(); j++)
-    {
-      READ_UVLC(code, "delta_poc_s0_minus1");
-      poc = prev-code-1;
-      prev = poc;
-      rps->setDeltaPOC(j,poc);
-      READ_FLAG(code, "used_by_curr_pic_s0_flag");  rps->setUsed(j,code);
-    }
-    prev = 0;
-    for(int j=rps->getNumberOfNegativePictures(); j < rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures(); j++)
-    {
-      READ_UVLC(code, "delta_poc_s1_minus1");
-      poc = prev+code+1;
-      prev = poc;
-      rps->setDeltaPOC(j,poc);
-      READ_FLAG(code, "used_by_curr_pic_s1_flag");  rps->setUsed(j,code);
-    }
-    rps->setNumberOfPictures(rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures());
-  }
 
-  rps->printDeltaPOC();
-}
-#endif
-
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetManager )
-#else
-void HLSyntaxReader::parsePPS( PPS* pcPPS )
-#endif
 {
 #if ENABLE_TRACING
   xTracePPSHeader ();
@@ -477,10 +372,8 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
   CHECK(uiCode > 14, "Invalid code read");
   pcPPS->setNumRefIdxL1DefaultActive(uiCode+1);
 
-#if JVET_M0128
   READ_FLAG(uiCode, "rpl1_idx_present_flag");
   pcPPS->setRpl1IdxPresentFlag(uiCode);
-#endif
 
   READ_SVLC(iCode, "init_qp_minus26" );                            pcPPS->setPicInitQPMinus26(iCode);
   READ_FLAG( uiCode, "constrained_intra_pred_flag" );              pcPPS->setConstrainedIntraPred( uiCode ? true : false );
@@ -507,12 +400,10 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
   CHECK( pcPPS->getQpOffset(COMPONENT_Cr) < -12, "Invalid Cr QP offset" );
   CHECK( pcPPS->getQpOffset(COMPONENT_Cr) >  12, "Invalid Cr QP offset" );
 
-#if JVET_N0054_JOINT_CHROMA
   READ_SVLC( iCode, "pps_cb_cr_qp_offset");
   pcPPS->setQpOffset(JOINT_CbCr, iCode);
   CHECK( pcPPS->getQpOffset(JOINT_CbCr) < -12, "Invalid CbCr QP offset" );
   CHECK( pcPPS->getQpOffset(JOINT_CbCr) >  12, "Invalid CbCr QP offset" );
-#endif
 
   CHECK(MAX_NUM_COMPONENT>3, "Invalid maximal number of components");
 
@@ -527,7 +418,6 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
   READ_FLAG( uiCode, "transquant_bypass_enabled_flag");
   pcPPS->setTransquantBypassEnabledFlag(uiCode ? true : false);
   
-#if JVET_N0857_TILES_BRICKS
   READ_FLAG( uiCode, "single_tile_in_pic_flag" );                 pcPPS->setSingleTileInPicFlag(uiCode == 1);
 
   if(!pcPPS->getSingleTileInPicFlag())
@@ -574,9 +464,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
     READ_FLAG( uiCode, "brick_splitting_present_flag" );                 pcPPS->setBrickSplittingPresentFlag(uiCode == 1);
 
     int numTilesInPic = pcPPS->getUniformTileSpacingFlag() ? 0 : (pcPPS->getNumTileColumnsMinus1() + 1) * (pcPPS->getNumTileRowsMinus1() + 1);
-#if JVET_N0857_RECT_SLICES
     pcPPS->setNumTilesInPic(numTilesInPic);
-#endif
 
     if (pcPPS->getBrickSplittingPresentFlag())
     {
@@ -636,9 +524,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
       const uint32_t numSlicesInPic = pcPPS->getNumSlicesInPicMinus1() + 1;
       const uint32_t numTilesInPic = (tileColumnsMinus1 + 1) * (tileRowsMinus1 + 1);
       int codeLength = (int)ceil(log2(numTilesInPic));
-#if JVET_N0124_PROPOSAL2
       int codeLength2 = codeLength;
-#endif
       if (numSlicesInPic > 0)
       {
         std::vector<int> topLeft(numSlicesInPic);
@@ -650,31 +536,15 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
           {
             READ_CODE( codeLength, uiCode, "top_left_brick_idx" );
             topLeft[i] = uiCode;
-#if JVET_N0124_PROPOSAL2
-#if JVET_N0857_RECT_SLICES
             codeLength2 = (int)ceil(log2((numTilesInPic - topLeft[i] < 2) ? 2 : numTilesInPic - topLeft[i]));  //Bugfix
-#else
-            codeLength2 = (int)ceil(log2(numTilesInPic - topLeft[i]));
-#endif
-#endif
           }
-#if JVET_N0124_PROPOSAL2
           READ_CODE( codeLength2, uiCode, "bottom_right_brick_idx_delta");
-#else
-          READ_CODE(codeLength, uiCode, "bottom_right_brick_idx_delta");
-#endif
           bottomRight[i] = topLeft[i] + uiCode;
         }
-#if JVET_N0857_RECT_SLICES
         pcPPS->setTopLeftBrickIdx(topLeft);
         pcPPS->setBottomRightBrickIdx(bottomRight);
-#else
-        pcPPS->setTopLeftTileIdx(topLeft);
-        pcPPS->setBottomRightTileIdx(bottomRight);
-#endif
       }
     }
-#if JVET_N0857_RECT_SLICES
     if (pcPPS->getRectSliceFlag() && pcPPS->getSingleBrickPerSliceFlag())
     {
       std::vector<int> topLeft(numTilesInPic);  //TODO: this should be numBricksInPic. Fix it when the bricks codes have been updated
@@ -687,7 +557,6 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
       pcPPS->setTopLeftBrickIdx(topLeft);
       pcPPS->setBottomRightBrickIdx(bottomRight);
     }
-#endif
 
     READ_FLAG( uiCode, "loop_filter_across_bricks_enabled_flag ");        pcPPS->setLoopFilterAcrossBricksEnabledFlag(uiCode ? true : false);
     if (pcPPS->getLoopFilterAcrossBricksEnabledFlag())
@@ -697,18 +566,14 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
   }
   else
   {
-#if JVET_N0124_PROPOSAL1
     pcPPS->setSingleBrickPerSliceFlag(true);
-#endif
     pcPPS->setRectSliceFlag(true);
-#if JVET_N0857_RECT_SLICES
     std::vector<int> topLeft(1);
     topLeft[0] = 0;
     std::vector<int> bottomRight(1);
     bottomRight[0] = 0;
     pcPPS->setTopLeftBrickIdx(topLeft);
     pcPPS->setBottomRightBrickIdx(bottomRight);
-#endif
   }
 
   if (pcPPS->getRectSliceFlag())
@@ -717,7 +582,6 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
     if (pcPPS->getSignalledSliceIdFlag())
     {
       READ_UVLC( uiCode, "signalled_slice_id_length_minus1" );             pcPPS->setSignalledSliceIdLengthMinus1(uiCode);
-#if JVET_N0857_RECT_SLICES
       const uint32_t numSlices = pcPPS->getNumSlicesInPicMinus1() + 1;
       int codeLength = pcPPS->getSignalledSliceIdLengthMinus1() + 1;
       if (numSlices > 0)
@@ -730,22 +594,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
         }
         pcPPS->setSliceId(sliceID);
       }
-#else
-      const uint32_t numTileGroups = pcPPS->getNumSlicesInPicMinus1() + 1;
-      int codeLength = pcPPS->getSignalledSliceIdLengthMinus1() + 1;
-      if (numTileGroups > 0)
-      {
-        std::vector<int> tileGroupID(numTileGroups);
-        for (uint32_t i = 0; i < numTileGroups; i++)
-        {
-          READ_CODE( codeLength, uiCode, "slice_id" );
-          tileGroupID[i] = uiCode;
-        }
-        pcPPS->setSliceId(tileGroupID);
-      }
-#endif
     }
-#if JVET_N0857_RECT_SLICES
     else
     {
       std::vector<int> sliceID(pcPPS->getNumSlicesInPicMinus1() + 1);
@@ -755,52 +604,8 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
       }
       pcPPS->setSliceId(sliceID);
     }
-#endif
   }
-#endif
-
-#if !JVET_N0857_TILES_BRICKS
-  READ_FLAG(uiCode, "tiles_enabled_flag");                       pcPPS->setTilesEnabledFlag(uiCode == 1);
 
-  if (pcPPS->getTilesEnabledFlag())
-  {
-    READ_UVLC(uiCode, "num_tile_columns_minus1");                pcPPS->setNumTileColumnsMinus1(uiCode);
-    READ_UVLC(uiCode, "num_tile_rows_minus1");                   pcPPS->setNumTileRowsMinus1(uiCode);
-    READ_FLAG(uiCode, "uniform_spacing_flag");                   pcPPS->setUniformTileSpacingFlag(uiCode == 1);
-
-    const uint32_t tileColumnsMinus1 = pcPPS->getNumTileColumnsMinus1();
-    const uint32_t tileRowsMinus1 = pcPPS->getNumTileRowsMinus1();
-
-    if (!pcPPS->getUniformTileSpacingFlag())
-    {
-      if (tileColumnsMinus1 > 0)
-      {
-        std::vector<int> columnWidth(tileColumnsMinus1);
-        for (uint32_t i = 0; i < tileColumnsMinus1; i++)
-        {
-          READ_UVLC(uiCode, "column_width_minus1");
-          columnWidth[i] = uiCode + 1;
-        }
-        pcPPS->setTileColumnWidth(columnWidth);
-      }
-
-      if (tileRowsMinus1 > 0)
-      {
-        std::vector<int> rowHeight(tileRowsMinus1);
-        for (uint32_t i = 0; i < tileRowsMinus1; i++)
-        {
-          READ_UVLC(uiCode, "row_height_minus1");
-          rowHeight[i] = uiCode + 1;
-        }
-        pcPPS->setTileRowHeight(rowHeight);
-      }
-    }
-    CHECK((tileColumnsMinus1 + tileRowsMinus1) == 0, "Invalid tile configuration");
-    READ_FLAG ( uiCode, "loop_filter_across_tiles_enabled_flag" );     pcPPS->setLoopFilterAcrossBricksEnabledFlag( uiCode ? true : false );
-  }
- 
-  READ_FLAG( uiCode, "pps_loop_filter_across_slices_enabled_flag" );   pcPPS->setLoopFilterAcrossSlicesEnabledFlag( uiCode ? true : false );
-#endif
   READ_FLAG(uiCode, "entropy_coding_sync_enabled_flag");         pcPPS->setEntropyCodingSyncEnabledFlag(uiCode == 1);
 
   READ_FLAG( uiCode, "deblocking_filter_control_present_flag" );       pcPPS->setDeblockingFilterControlPresentFlag( uiCode ? true : false );
@@ -815,7 +620,6 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
     }
   }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   READ_FLAG( uiCode, "pps_loop_filter_across_virtual_boundaries_disabled_flag" ); pcPPS->setLoopFilterAcrossVirtualBoundariesDisabledFlag( uiCode != 0 );
   if( pcPPS->getLoopFilterAcrossVirtualBoundariesDisabledFlag() )
   {
@@ -834,20 +638,13 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS )
       READ_CODE( numBits, uiCode, "pps_virtual_boundaries_pos_y" ); pcPPS->setVirtualBoundariesPosY( uiCode << 3, i );
     }
   }
-#endif
 
-#if HEVC_USE_SCALING_LISTS
   READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
   if(pcPPS->getScalingListPresentFlag ())
   {
     parseScalingList( &(pcPPS->getScalingList()) );
   }
-#endif
 
-#if !JVET_M0128
-  READ_FLAG( uiCode, "lists_modification_present_flag");
-  pcPPS->setListsModificationPresentFlag(uiCode);
-#endif
 
   READ_UVLC( uiCode, "log2_parallel_merge_level_minus2");
   pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode);
@@ -959,7 +756,6 @@ void HLSyntaxReader::parseAPS( APS* aps )
   READ_CODE(5, code, "adaptation_parameter_set_id");
   aps->setAPSId(code);
 
- #if JVET_N0805_APS_LMCS
   READ_CODE(3, code, "aps_params_type");
   aps->setAPSType(code);
   if (code == ALF_APS)
@@ -979,136 +775,24 @@ void HLSyntaxReader::parseAPS( APS* aps )
     }
   }
   xReadRbspTrailingBits();
-#else
-  AlfSliceParam param = aps->getAlfAPSParam();
-#if JVET_N0415_CTB_ALF
-  param.enabledFlag[COMPONENT_Y] = param.enabledFlag[COMPONENT_Cb] = param.enabledFlag[COMPONENT_Cr] = true;
-  READ_FLAG(code, "alf_luma_new_filter");
-  param.newFilterFlag[CHANNEL_TYPE_LUMA] = code;
-  READ_FLAG(code, "alf_chroma_new_filter");
-  param.newFilterFlag[CHANNEL_TYPE_CHROMA] = code;
-#else
-  param.enabledFlag[COMPONENT_Y] = true;
-
-  int alfChromaIdc = truncatedUnaryEqProb(3);        //alf_chroma_idc
-  param.enabledFlag[COMPONENT_Cb] = alfChromaIdc >> 1;
-  param.enabledFlag[COMPONENT_Cr] = alfChromaIdc & 1;
-#endif
-
-#if JVET_N0242_NON_LINEAR_ALF && !JVET_N0415_CTB_ALF
-  READ_FLAG( code, "alf_luma_clip" );
-  param.nonLinearFlag[CHANNEL_TYPE_LUMA] = code ? true : false;
-
-  if( alfChromaIdc )
-  {
-    READ_FLAG( code, "alf_chroma_clip" );
-    param.nonLinearFlag[CHANNEL_TYPE_CHROMA] = code ? true : false;
-  }
-#endif
-
-#if JVET_N0415_CTB_ALF
-  if (param.newFilterFlag[CHANNEL_TYPE_LUMA])
-  {
-#if JVET_N0242_NON_LINEAR_ALF
-    READ_FLAG(code, "alf_luma_clip");
-    param.nonLinearFlag[CHANNEL_TYPE_LUMA] = code ? true : false;
-#endif
-#endif
-  xReadTruncBinCode(code, MAX_NUM_ALF_CLASSES);  //number_of_filters_minus1
-  param.numLumaFilters = code + 1;
-  if (param.numLumaFilters > 1)
-  {
-    for (int i = 0; i < MAX_NUM_ALF_CLASSES; i++)
-    {
-      xReadTruncBinCode(code, param.numLumaFilters);
-      param.filterCoeffDeltaIdx[i] = code;
-    }
-  }
-  else
-  {
-    memset(param.filterCoeffDeltaIdx, 0, sizeof(param.filterCoeffDeltaIdx));
-  }
-
-#if JVET_N0415_CTB_ALF
-  READ_FLAG(code, "fixed_filter_set_flag");
-  param.fixedFilterSetIndex = code;
-  if (param.fixedFilterSetIndex > 0)
-  {
-    xReadTruncBinCode(code, NUM_FIXED_FILTER_SETS);
-    param.fixedFilterSetIndex = code + 1;
-    READ_FLAG(code, "fixed_filter_flag_pattern");
-    param.fixedFilterPattern = code;
-    for (int classIdx = 0; classIdx < MAX_NUM_ALF_CLASSES; classIdx++)
-    {
-      code = 1;
-      if (param.fixedFilterPattern > 0)
-      {
-        READ_FLAG(code, "fixed_filter_flag");
-      }
-      param.fixedFilterIdx[classIdx] = code;
-    }
-  }
-#endif
-  alfFilter(param, false);
-#if JVET_N0415_CTB_ALF
-  }
-  if (param.newFilterFlag[CHANNEL_TYPE_CHROMA])
-  {
-#if JVET_N0242_NON_LINEAR_ALF
-    READ_FLAG(code, "alf_luma_clip");
-    param.nonLinearFlag[CHANNEL_TYPE_CHROMA] = code ? true : false;
-#endif
-#else
-  if (alfChromaIdc)
-  {
-#endif
-    alfFilter(param, true);
-  }
-  aps->setAlfAPSParam(param);
-
-  xReadRbspTrailingBits();
-#endif
 }
 
-#if JVET_N0805_APS_LMCS
 void HLSyntaxReader::parseAlfAps( APS* aps )
 {
   uint32_t  code;
 
   AlfSliceParam param = aps->getAlfAPSParam();
-#if JVET_N0415_CTB_ALF
   param.enabledFlag[COMPONENT_Y] = param.enabledFlag[COMPONENT_Cb] = param.enabledFlag[COMPONENT_Cr] = true;
   READ_FLAG(code, "alf_luma_new_filter");
   param.newFilterFlag[CHANNEL_TYPE_LUMA] = code;
   READ_FLAG(code, "alf_chroma_new_filter");
   param.newFilterFlag[CHANNEL_TYPE_CHROMA] = code;
-#else
-  param.enabledFlag[COMPONENT_Y] = true;
-
-  int alfChromaIdc = truncatedUnaryEqProb(3);        //alf_chroma_idc
-  param.enabledFlag[COMPONENT_Cb] = alfChromaIdc >> 1;
-  param.enabledFlag[COMPONENT_Cr] = alfChromaIdc & 1;
-#endif
-
-#if JVET_N0242_NON_LINEAR_ALF && !JVET_N0415_CTB_ALF
-  READ_FLAG(code, "alf_luma_clip");
-  param.nonLinearFlag[CHANNEL_TYPE_LUMA] = code ? true : false;
 
-  if (alfChromaIdc)
-  {
-    READ_FLAG(code, "alf_chroma_clip");
-    param.nonLinearFlag[CHANNEL_TYPE_CHROMA] = code ? true : false;
-  }
-#endif
 
-#if JVET_N0415_CTB_ALF
   if (param.newFilterFlag[CHANNEL_TYPE_LUMA])
   {
-#if JVET_N0242_NON_LINEAR_ALF
     READ_FLAG(code, "alf_luma_clip");
     param.nonLinearFlag[CHANNEL_TYPE_LUMA] = code ? true : false;
-#endif
-#endif
     xReadTruncBinCode(code, MAX_NUM_ALF_CLASSES);  //number_of_filters_minus1
     param.numLumaFilters = code + 1;
     if (param.numLumaFilters > 1)
@@ -1124,7 +808,6 @@ void HLSyntaxReader::parseAlfAps( APS* aps )
       memset(param.filterCoeffDeltaIdx, 0, sizeof(param.filterCoeffDeltaIdx));
     }
 
-#if JVET_N0415_CTB_ALF
     READ_FLAG(code, "fixed_filter_set_flag");
     param.fixedFilterSetIndex = code;
     if (param.fixedFilterSetIndex > 0)
@@ -1143,20 +826,12 @@ void HLSyntaxReader::parseAlfAps( APS* aps )
         param.fixedFilterIdx[classIdx] = code;
       }
     }
-#endif
     alfFilter(param, false);
-#if JVET_N0415_CTB_ALF
   }
   if (param.newFilterFlag[CHANNEL_TYPE_CHROMA])
   {
-#if JVET_N0242_NON_LINEAR_ALF
     READ_FLAG(code, "alf_luma_clip");
     param.nonLinearFlag[CHANNEL_TYPE_CHROMA] = code ? true : false;
-#endif
-#else
-    if (alfChromaIdc)
-    {
-#endif
       alfFilter(param, true);
   }
   aps->setAlfAPSParam(param);
@@ -1185,7 +860,6 @@ void HLSyntaxReader::parseLmcsAps( APS* aps )
   }
   aps->setReshaperAPSInfo(info);
 }
-#endif
 
 
 void  HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS)
@@ -1194,7 +868,6 @@ void  HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS)
   DTRACE( g_trace_ctx, D_HEADER, "----------- vui_parameters -----------\n");
 #endif
 
-#if JVET_N0063_VUI
 
   uint32_t  symbol;
 
@@ -1245,98 +918,6 @@ void  HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS)
     READ_FLAG(   symbol, "video_full_range_flag");                    pcVUI->setVideoFullRangeFlag(symbol);
   }
 
-#else
-
-  uint32_t  uiCode;
-
-  READ_FLAG(     uiCode, "aspect_ratio_info_present_flag");           pcVUI->setAspectRatioInfoPresentFlag(uiCode);
-  if (pcVUI->getAspectRatioInfoPresentFlag())
-  {
-    READ_CODE(8, uiCode, "aspect_ratio_idc");                         pcVUI->setAspectRatioIdc(uiCode);
-    if (pcVUI->getAspectRatioIdc() == 255)
-    {
-      READ_CODE(16, uiCode, "sar_width");                             pcVUI->setSarWidth(uiCode);
-      READ_CODE(16, uiCode, "sar_height");                            pcVUI->setSarHeight(uiCode);
-    }
-  }
-
-  READ_FLAG(     uiCode, "overscan_info_present_flag");               pcVUI->setOverscanInfoPresentFlag(uiCode);
-  if (pcVUI->getOverscanInfoPresentFlag())
-  {
-    READ_FLAG(   uiCode, "overscan_appropriate_flag");                pcVUI->setOverscanAppropriateFlag(uiCode);
-  }
-
-  READ_FLAG(     uiCode, "video_signal_type_present_flag");           pcVUI->setVideoSignalTypePresentFlag(uiCode);
-  if (pcVUI->getVideoSignalTypePresentFlag())
-  {
-    READ_CODE(3, uiCode, "video_format");                             pcVUI->setVideoFormat(uiCode);
-    READ_FLAG(   uiCode, "video_full_range_flag");                    pcVUI->setVideoFullRangeFlag(uiCode);
-    READ_FLAG(   uiCode, "colour_description_present_flag");          pcVUI->setColourDescriptionPresentFlag(uiCode);
-    if (pcVUI->getColourDescriptionPresentFlag())
-    {
-      READ_CODE(8, uiCode, "colour_primaries");                       pcVUI->setColourPrimaries(uiCode);
-      READ_CODE(8, uiCode, "transfer_characteristics");               pcVUI->setTransferCharacteristics(uiCode);
-      READ_CODE(8, uiCode, "matrix_coeffs");                          pcVUI->setMatrixCoefficients(uiCode);
-    }
-  }
-
-  READ_FLAG(     uiCode, "chroma_loc_info_present_flag");             pcVUI->setChromaLocInfoPresentFlag(uiCode);
-  if (pcVUI->getChromaLocInfoPresentFlag())
-  {
-    READ_UVLC(   uiCode, "chroma_sample_loc_type_top_field" );        pcVUI->setChromaSampleLocTypeTopField(uiCode);
-    READ_UVLC(   uiCode, "chroma_sample_loc_type_bottom_field" );     pcVUI->setChromaSampleLocTypeBottomField(uiCode);
-  }
-
-  READ_FLAG(     uiCode, "neutral_chroma_indication_flag");           pcVUI->setNeutralChromaIndicationFlag(uiCode);
-
-  READ_FLAG(     uiCode, "field_seq_flag");                           pcVUI->setFieldSeqFlag(uiCode);
-
-  READ_FLAG(uiCode, "frame_field_info_present_flag");                 pcVUI->setFrameFieldInfoPresentFlag(uiCode);
-
-  READ_FLAG(     uiCode, "default_display_window_flag");
-  if (uiCode != 0)
-  {
-    Window &defDisp = pcVUI->getDefaultDisplayWindow();
-    READ_UVLC(   uiCode, "def_disp_win_left_offset" );                defDisp.setWindowLeftOffset  ( uiCode * SPS::getWinUnitX( pcSPS->getChromaFormatIdc()) );
-    READ_UVLC(   uiCode, "def_disp_win_right_offset" );               defDisp.setWindowRightOffset ( uiCode * SPS::getWinUnitX( pcSPS->getChromaFormatIdc()) );
-    READ_UVLC(   uiCode, "def_disp_win_top_offset" );                 defDisp.setWindowTopOffset   ( uiCode * SPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
-    READ_UVLC(   uiCode, "def_disp_win_bottom_offset" );              defDisp.setWindowBottomOffset( uiCode * SPS::getWinUnitY( pcSPS->getChromaFormatIdc()) );
-  }
-
-  TimingInfo *timingInfo = pcVUI->getTimingInfo();
-  READ_FLAG(       uiCode, "vui_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
-  if(timingInfo->getTimingInfoPresentFlag())
-  {
-    READ_CODE( 32, uiCode, "vui_num_units_in_tick");                timingInfo->setNumUnitsInTick             (uiCode);
-    READ_CODE( 32, uiCode, "vui_time_scale");                       timingInfo->setTimeScale                  (uiCode);
-    READ_FLAG(     uiCode, "vui_poc_proportional_to_timing_flag");  timingInfo->setPocProportionalToTimingFlag(uiCode ? true : false);
-    if(timingInfo->getPocProportionalToTimingFlag())
-    {
-      READ_UVLC(   uiCode, "vui_num_ticks_poc_diff_one_minus1");    timingInfo->setNumTicksPocDiffOneMinus1   (uiCode);
-    }
-
-    READ_FLAG(     uiCode, "vui_hrd_parameters_present_flag");        pcVUI->setHrdParametersPresentFlag(uiCode);
-    if( pcVUI->getHrdParametersPresentFlag() )
-    {
-      parseHrdParameters( pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
-    }
-  }
-
-  READ_FLAG(     uiCode, "bitstream_restriction_flag");               pcVUI->setBitstreamRestrictionFlag(uiCode);
-  if (pcVUI->getBitstreamRestrictionFlag())
-  {
-    READ_FLAG(   uiCode, "tiles_fixed_structure_flag");               pcVUI->setTilesFixedStructureFlag(uiCode);
-    READ_FLAG(   uiCode, "motion_vectors_over_pic_boundaries_flag");  pcVUI->setMotionVectorsOverPicBoundariesFlag(uiCode);
-    READ_FLAG(   uiCode, "restricted_ref_pic_lists_flag");            pcVUI->setRestrictedRefPicListsFlag(uiCode);
-    READ_UVLC(   uiCode, "min_spatial_segmentation_idc");             pcVUI->setMinSpatialSegmentationIdc(uiCode);
-    CHECK(uiCode >= 4096, "Invalid code signalled");
-    READ_UVLC(   uiCode, "max_bytes_per_pic_denom" );                 pcVUI->setMaxBytesPerPicDenom(uiCode);
-    READ_UVLC(   uiCode, "max_bits_per_min_cu_denom" );               pcVUI->setMaxBitsPerMinCuDenom(uiCode);
-    READ_UVLC(   uiCode, "log2_max_mv_length_horizontal" );           pcVUI->setLog2MaxMvLengthHorizontal(uiCode);
-    READ_UVLC(   uiCode, "log2_max_mv_length_vertical" );             pcVUI->setLog2MaxMvLengthVertical(uiCode);
-  }
-
-#endif
 }
 
 void HLSyntaxReader::parseHrdParameters(HRDParameters *hrd, bool commonInfPresentFlag, uint32_t maxNumSubLayersMinus1)
@@ -1417,44 +998,6 @@ void HLSyntaxReader::parseHrdParameters(HRDParameters *hrd, bool commonInfPresen
   }
 }
 
-#if !JVET_N0805_APS_LMCS
-void HLSyntaxReader::parseReshaper(SliceReshapeInfo& info, const SPS* pcSPS, const bool isIntra)
-{
-  unsigned  symbol = 0;
-  READ_FLAG(symbol, "tile_group_reshaper_model_present_flag");                 info.setSliceReshapeModelPresentFlag(symbol == 1);
-  if (info.getSliceReshapeModelPresentFlag())
-  {
-    memset(info.reshaperModelBinCWDelta, 0, PIC_CODE_CW_BINS * sizeof(int));
-    READ_UVLC(symbol, "reshaper_model_min_bin_idx");                             info.reshaperModelMinBinIdx = symbol;
-    READ_UVLC(symbol, "reshaper_model_delta_max_bin_idx");                       info.reshaperModelMaxBinIdx = PIC_CODE_CW_BINS - 1 - symbol;
-    READ_UVLC(symbol, "reshaper_model_bin_delta_abs_cw_prec_minus1");            info.maxNbitsNeededDeltaCW = symbol + 1;
-    assert(info.maxNbitsNeededDeltaCW > 0);
-    for (uint32_t i = info.reshaperModelMinBinIdx; i <= info.reshaperModelMaxBinIdx; i++)
-    {
-      READ_CODE(info.maxNbitsNeededDeltaCW, symbol, "reshaper_model_bin_delta_abs_CW");
-      int absCW = symbol;
-      if (absCW > 0)
-      {
-        READ_CODE(1, symbol, "reshaper_model_bin_delta_sign_CW_flag");
-      }
-      int signCW = symbol;
-      info.reshaperModelBinCWDelta[i] = (1 - 2 * signCW) * absCW;
-    }
-  }
-  READ_FLAG(symbol, "tile_group_reshaper_enable_flag");           info.setUseSliceReshaper(symbol == 1);
-  if (info.getUseSliceReshaper())
-  {
-    if (!(pcSPS->getUseDualITree() && isIntra))
-    {
-      READ_FLAG(symbol, "slice_reshaper_ChromaAdj");                info.setSliceReshapeChromaAdj(symbol);
-    }
-    else
-    {
-      info.setSliceReshapeChromaAdj(0);
-    }
-  }
-}
-#endif
 
 void HLSyntaxReader::parseSPS(SPS* pcSPS)
 {
@@ -1463,52 +1006,10 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 #if ENABLE_TRACING
   xTraceSPSHeader ();
 #endif
-#if JVET_N0349_DPS
   READ_CODE( 4,  uiCode, "sps_decoding_parameter_set_id");       pcSPS->setDecodingParameterSetId( uiCode );
-#endif
 #if HEVC_VPS
   READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
 #endif
-#if !JVET_M0101_HLS
-  READ_UVLC(     uiCode, "sps_seq_parameter_set_id" );           pcSPS->setSPSId( uiCode );
-  CHECK(uiCode > 15, "Invalid SPS id signalled");
-
-  READ_FLAG(uiCode, "intra_only_constraint_flag");               pcSPS->setIntraOnlyConstraintFlag(uiCode > 0 ? true : false);
-  READ_CODE(4, uiCode, "max_bitdepth_constraint_idc");           pcSPS->setMaxBitDepthConstraintIdc(uiCode);
-  READ_CODE(2, uiCode, "max_chroma_format_constraint_idc");      pcSPS->setMaxChromaFormatConstraintIdc(uiCode);
-  READ_FLAG(uiCode, "frame_only_constraint_flag");               pcSPS->setFrameConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_qtbtt_dual_tree_intra_constraint_flag"); pcSPS->setNoQtbttDualTreeIntraConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_sao_constraint_flag");                   pcSPS->setNoSaoConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_alf_constraint_flag");                   pcSPS->setNoAlfConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_pcm_constraint_flag");                   pcSPS->setNoPcmConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_ref_wraparound_constraint_flag");        pcSPS->setNoRefWraparoundConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_temporal_mvp_constraint_flag");          pcSPS->setNoTemporalMvpConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_sbtmvp_constraint_flag");                pcSPS->setNoSbtmvpConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_amvr_constraint_flag");                  pcSPS->setNoAmvrConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_bdof_constraint_flag");                  pcSPS->setNoBdofConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_cclm_constraint_flag");                  pcSPS->setNoCclmConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_mts_constraint_flag");                   pcSPS->setNoMtsConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_affine_motion_constraint_flag");         pcSPS->setNoAffineMotionConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_gbi_constraint_flag");                   pcSPS->setNoGbiConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_mh_intra_constraint_flag");              pcSPS->setNoMhIntraConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_triangle_constraint_flag");              pcSPS->setNoTriangleConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_ladf_constraint_flag");                  pcSPS->setNoLadfConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_curr_pic_ref_constraint_flag");          pcSPS->setNoCurrPicRefConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_qp_delta_constraint_flag");              pcSPS->setNoQpDeltaConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_dep_quant_constraint_flag");             pcSPS->setNoDepQuantConstraintFlag(uiCode > 0 ? true : false);
-  READ_FLAG(uiCode, "no_sign_data_hiding_constraint_flag");      pcSPS->setNoSignDataHidingConstraintFlag(uiCode > 0 ? true : false);
-
-  // KJS: Marakech decision: sub-layers added back
-  READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
-  CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled");
-  READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );           pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
-  if ( pcSPS->getMaxTLayers() == 1 )
-  {
-    // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
-    CHECK( uiCode != 1, "Invalid maximum number of T-layers" );
-  }
-  parsePTL(pcSPS->getPTL(), true, pcSPS->getMaxTLayers() - 1);
-#else
   READ_CODE(3, uiCode, "sps_max_sub_layers_minus1");          pcSPS->setMaxTLayers   (uiCode + 1);
   CHECK(uiCode > 6, "Invalid maximum number of T-layer signalled");
   READ_CODE(5, uiCode, "sps_reserved_zero_5bits");
@@ -1517,18 +1018,10 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
   parseProfileTierLevel(pcSPS->getProfileTierLevel(), pcSPS->getMaxTLayers() - 1);
 
   READ_UVLC(uiCode, "sps_seq_parameter_set_id");           pcSPS->setSPSId(uiCode);
-#endif
 
   READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) );
   CHECK(uiCode > 3, "Invalid chroma format signalled");
 
-#if !JVET_N0671_CHROMA_FORMAT_422
-  if (pcSPS->getChromaFormatIdc() == CHROMA_422)
-  {
-    EXIT("Error:  4:2:2 chroma sampling format not supported with current compiler setting."
-      "\n        Set compiler flag \"JVET_N0671_CHROMA_FORMAT_422\" equal to 1 for enabling 4:2:2.\n");
-  }
-#endif //!JVET_N0671_CHROMA_FORMAT_422
 
 
   if( pcSPS->getChromaFormatIdc() == CHROMA_444 )
@@ -1563,9 +1056,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 
   READ_UVLC( uiCode,    "log2_max_pic_order_cnt_lsb_minus4" );   pcSPS->setBitsForPOC( 4 + uiCode );
   CHECK(uiCode > 12, "Invalid code");
-#if JVET_N0047_Merge_IDR_Non_IDR
   READ_FLAG( uiCode, "sps_idr_rpl_present_flag" ); pcSPS->setIDRRefParamListPresent( (bool) uiCode);                 
-#endif
   // KJS: Marakech decision: sub-layers added back
   uint32_t subLayerOrderingInfoPresentFlag;
   READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
@@ -1591,7 +1082,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
     }
   }
 
-#if JVET_M0128
   READ_FLAG(uiCode, "long_term_ref_pics_flag");          pcSPS->setLongTermRefsPresent(uiCode);
   READ_FLAG(uiCode, "rpl1_copy_from_rpl0_flag");
   pcSPS->setRPL1CopyFromRPL0Flag(uiCode);
@@ -1630,7 +1120,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
     for (uint32_t ii = 0; ii < numberOfRPL; ii++)
       copyRefPicList(pcSPS, rplListSource->getReferencePictureList(ii), rplListDest->getReferencePictureList(ii));
   }
-#endif
 
   unsigned  minQT[3] = { 0, 0, 0 };
   unsigned  maxBTD[3] = { 0, 0, 0 };
@@ -1682,12 +1171,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
   pcSPS->setMaxBTSize(maxBTSize[1], maxBTSize[0], maxBTSize[2]);
   pcSPS->setMaxTTSize(maxTTSize[1], maxTTSize[0], maxTTSize[2]);
 
-#if !JVET_M0101_HLS
-  if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
-  {
-    CHECK(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() < 5, "Invalid code");
-  }
-#endif
 
 #if MAX_TB_SIZE_SIGNALLING
   // KJS: Not in syntax
@@ -1706,23 +1189,19 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
     READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" );                 pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false );
   }
 
-#if JVET_N0070_WRAPAROUND
   if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() )
   {    
-#endif
   READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag");                  pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false );
 
   if (pcSPS->getWrapAroundEnabledFlag())
   {
     READ_UVLC(uiCode, "sps_ref_wraparound_offset_minus1");               pcSPS->setWrapAroundOffset( (uiCode+1)*(1 <<  pcSPS->getLog2MinCodingBlockSize()));
   }
-#if JVET_N0070_WRAPAROUND
   }
   else 
   {
     pcSPS->setWrapAroundEnabledFlag(0);
   }
-#endif
 
 
   READ_FLAG( uiCode, "sps_temporal_mvp_enabled_flag" );                  pcSPS->setSPSTemporalMVPEnabledFlag(uiCode);
@@ -1743,9 +1222,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
   READ_FLAG( uiCode,  "sps_affine_amvr_enabled_flag" );             pcSPS->setAffineAmvrEnabledFlag ( uiCode != 0 );
 
   READ_FLAG(uiCode, "sps_dmvr_enable_flag");                        pcSPS->setUseDMVR(uiCode != 0);
-#if JVET_N0127_MMVD_SPS_FLAG
   READ_FLAG(uiCode, "sps_mmvd_enable_flag");                        pcSPS->setUseMMVD(uiCode != 0);
-#endif
   // KJS: sps_cclm_enabled_flag
   READ_FLAG( uiCode,    "lm_chroma_enabled_flag" );                 pcSPS->setUseLMChroma            ( uiCode != 0 );
   if ( pcSPS->getUseLMChroma() && pcSPS->getChromaFormatIdc() == CHROMA_420 )
@@ -1759,12 +1236,8 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
     READ_FLAG( uiCode,    "mts_intra_enabled_flag" );               pcSPS->setUseIntraMTS            ( uiCode != 0 );
     READ_FLAG( uiCode,    "mts_inter_enabled_flag" );               pcSPS->setUseInterMTS            ( uiCode != 0 );
   }
-#if JVET_N0193_LFNST
   READ_FLAG( uiCode, "lfnst_enabled_flag" );                        pcSPS->setUseLFNST               ( uiCode != 0 );
-#endif
-#if JVET_N0235_SMVD_SPS
   READ_FLAG(uiCode, "smvd_flag");                                   pcSPS->setUseSMVD                ( uiCode != 0 );
-#endif
   // KJS: sps_affine_enabled_flag
   READ_FLAG( uiCode,    "affine_flag" );                            pcSPS->setUseAffine              ( uiCode != 0 );
   if ( pcSPS->getUseAffine() )
@@ -1776,20 +1249,14 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
   // KJS: sps_ciip_enabled_flag
   READ_FLAG( uiCode,     "mhintra_flag" );                           pcSPS->setUseMHIntra             ( uiCode != 0 );
 
-#if JVET_N0127_MMVD_SPS_FLAG
   if ( pcSPS->getUseMMVD() )
   {
     READ_FLAG( uiCode,  "sps_fpel_mmvd_enabled_flag" );             pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 );
   }
-#else
-  READ_FLAG( uiCode,  "sps_fpel_mmvd_enabled_flag" );               pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 );
-#endif
 
   READ_FLAG( uiCode,    "triangle_flag" );                          pcSPS->setUseTriangle            ( uiCode != 0 );
 
-#if JVET_N0217_MATRIX_INTRAPRED
   READ_FLAG( uiCode,    "sps_mip_flag");                            pcSPS->setUseMIP                 ( uiCode != 0 );
-#endif
   // KJS: not in draft yet
   READ_FLAG(uiCode, "sbt_enable_flag");                             pcSPS->setUseSBT(uiCode != 0);
   if( pcSPS->getUseSBT() )
@@ -1819,41 +1286,10 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
 #endif
 
   // KJS: reference picture sets to be replaced
-#if !JVET_M0128
-  READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );
-  CHECK(uiCode > 64, "Invalid code");
-  pcSPS->createRPSList(uiCode);
-
-  RPSList* rpsList = pcSPS->getRPSList();
-  ReferencePictureSet* rps;
-
-  for(uint32_t i=0; i< rpsList->getNumberOfReferencePictureSets(); i++)
-  {
-    rps = rpsList->getReferencePictureSet(i);
-    parseShortTermRefPicSet(pcSPS,rps,i);
-  }
-  READ_FLAG( uiCode, "long_term_ref_pics_present_flag" );          pcSPS->setLongTermRefsPresent(uiCode);
-  if (pcSPS->getLongTermRefsPresent())
-  {
-    READ_UVLC( uiCode, "num_long_term_ref_pics_sps" );
-    pcSPS->setNumLongTermRefPicSPS(uiCode);
-    for (uint32_t k = 0; k < pcSPS->getNumLongTermRefPicSPS(); k++)
-    {
-      READ_CODE( pcSPS->getBitsForPOC(), uiCode, "lt_ref_pic_poc_lsb_sps" );
-      pcSPS->setLtRefPicPocLsbSps(k, uiCode);
-      READ_FLAG( uiCode,  "used_by_curr_pic_lt_sps_flag[i]");
-      pcSPS->setUsedByCurrPicLtSPSFlag(k, uiCode?1:0);
-    }
-  }
-#endif
 
   // KJS: not found in draft -> does not exist
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  READ_FLAG( uiCode, "strong_intra_smoothing_enable_flag" );      pcSPS->setUseStrongIntraSmoothing(uiCode);
-#endif
 
   // KJS: remove scaling lists?
-#if HEVC_USE_SCALING_LISTS
   READ_FLAG( uiCode, "scaling_list_enabled_flag" );                 pcSPS->setScalingListFlag ( uiCode );
   if(pcSPS->getScalingListFlag())
   {
@@ -1863,9 +1299,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
       parseScalingList( &(pcSPS->getScalingList()) );
     }
   }
-#endif
 
-#if JVET_N0063_VUI
   TimingInfo *timingInfo = pcSPS->getTimingInfo();
   READ_FLAG(       uiCode, "timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
   if(timingInfo->getTimingInfoPresentFlag())
@@ -1879,7 +1313,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
       parseHrdParameters( pcSPS->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
     }
   }
-#endif
 
   READ_FLAG( uiCode, "vui_parameters_present_flag" );             pcSPS->setVuiParametersPresentFlag(uiCode);
 
@@ -1950,7 +1383,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
   xReadRbspTrailingBits();
 }
 
-#if JVET_N0349_DPS
 void HLSyntaxReader::parseDPS(DPS* dps)
 {
 #if ENABLE_TRACING
@@ -1979,7 +1411,6 @@ void HLSyntaxReader::parseDPS(DPS* dps)
   }
   xReadRbspTrailingBits();
 }
-#endif
 
 #if HEVC_VPS
 void HLSyntaxReader::parseVPS(VPS* pcVPS)
@@ -2076,7 +1507,7 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS)
 
   xReadRbspTrailingBits();
 }
-#elif JVET_N0278_HLS
+#else
 void HLSyntaxReader::parseVPS(VPS* pcVPS)
 {
 #if ENABLE_TRACING
@@ -2116,10 +1547,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
   PPS* pps = NULL;
   SPS* sps = NULL;
 
-#if !JVET_N0857_RECT_SLICES
-  uint32_t firstSliceSegmentInPic;
-  READ_FLAG( firstSliceSegmentInPic, "first_slice_segment_in_pic_flag" );
-#endif
   if( pcSlice->getRapPicFlag())
   {
     READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored -- updated already
@@ -2137,24 +1564,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
   const uint32_t numValidComp=getNumberValidComponents(chFmt);
   const bool bChroma=(chFmt!=CHROMA_400);
 
-#if !JVET_N0857_RECT_SLICES
-  int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight());
-  uint32_t sliceSegmentAddress = 0;
-  int bitsSliceSegmentAddress = 0;
-  while(numCTUs>(1<<bitsSliceSegmentAddress))
-  {
-    bitsSliceSegmentAddress++;
-  }
-
-  if(!firstSliceSegmentInPic)
-  {
-    READ_CODE( bitsSliceSegmentAddress, sliceSegmentAddress, "slice_segment_address" );
-  }
-  //set uiCode to equal slice start address (or dependent slice start address)
-    pcSlice->setSliceCurStartCtuTsAddr(sliceSegmentAddress); // this is actually a Raster-Scan (RS) address, but we do not have the RS->TS conversion table defined yet.
-    pcSlice->setSliceCurEndCtuTsAddr(numCTUs);
-#endif
-#if JVET_N0857_RECT_SLICES
     int bitsSliceAddress = 1;
     if (!pps->getRectSliceFlag())
     {
@@ -2203,7 +1612,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
       pcSlice->setSliceCurEndBrickIdx(pcSlice->getSliceCurStartBrickIdx() + uiCode);
     }
     pcSlice->setSliceCurStartCtuTsAddr(pcSlice->getSliceCurStartBrickIdx());
-#endif
 
     for (int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++)
     {
@@ -2224,19 +1632,10 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
     //   read colour_plane_id
     //   (separate_colour_plane_flag == 1) is not supported in this version of the standard.
 
-#if JVET_N0047_Merge_IDR_Non_IDR
     if( pcSlice->getIdrPicFlag() && !(sps->getIDRRefParamListPresent()))
-#else
-    if( pcSlice->getIdrPicFlag() )
-#endif
     {
       READ_CODE(sps->getBitsForPOC(), uiCode, "slice_pic_order_cnt_lsb");
       pcSlice->setPOC(uiCode);
-#if !JVET_M0128
-      ReferencePictureSet* rps = pcSlice->getLocalRPS();
-      (*rps)=ReferencePictureSet();
-      pcSlice->setRPS(rps);
-#endif
     }
     else
     {
@@ -2259,18 +1658,8 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
       {
         iPOCmsb = iPrevPOCmsb;
       }
-#if !JVET_M0101_HLS
-      if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-           || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-           || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
-      {
-        // For BLA picture types, POCmsb is set to 0.
-        iPOCmsb = 0;
-      }
-#endif
       pcSlice->setPOC              (iPOCmsb+iPOClsb);
 
-#if JVET_M0128
       //Read L0 related syntax elements
       if (sps->getNumRPL0() > 0)
       {
@@ -2390,132 +1779,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
           }
         }
       }
-#else
-      ReferencePictureSet* rps;
-      rps = pcSlice->getLocalRPS();
-      (*rps)=ReferencePictureSet();
-
-      pcSlice->setRPS(rps);
-      READ_FLAG( uiCode, "short_term_ref_pic_set_sps_flag" );
-      if(uiCode == 0) // use short-term reference picture set explicitly signalled in slice header
-      {
-        parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
-      }
-      else // use reference to short-term reference picture set in PPS
-      {
-        int numBits = 0;
-        while ((1 << numBits) < sps->getRPSList()->getNumberOfReferencePictureSets())
-        {
-          numBits++;
-        }
-        if (numBits > 0)
-        {
-          READ_CODE( numBits, uiCode, "short_term_ref_pic_set_idx");
-        }
-        else
-        {
-          uiCode = 0;
-
-        }
-        *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode));
-      }
-      if(sps->getLongTermRefsPresent())
-      {
-        int offset = rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures();
-        uint32_t numOfLtrp = 0;
-        uint32_t numLtrpInSPS = 0;
-        if (sps->getNumLongTermRefPicSPS() > 0)
-        {
-          READ_UVLC( uiCode, "num_long_term_sps");
-          numLtrpInSPS = uiCode;
-          numOfLtrp += numLtrpInSPS;
-          rps->setNumberOfLongtermPictures(numOfLtrp);
-        }
-        int bitsForLtrpInSPS = 0;
-        while (sps->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS))
-        {
-          bitsForLtrpInSPS++;
-        }
-        READ_UVLC( uiCode, "num_long_term_pics");             rps->setNumberOfLongtermPictures(uiCode);
-        numOfLtrp += uiCode;
-        rps->setNumberOfLongtermPictures(numOfLtrp);
-        int maxPicOrderCntLSB = 1 << sps->getBitsForPOC();
-        int prevDeltaMSB = 0, deltaPocMSBCycleLT = 0;
-        for(int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++)
-        {
-          int pocLsbLt;
-          if (k < numLtrpInSPS)
-          {
-            uiCode = 0;
-            if (bitsForLtrpInSPS > 0)
-            {
-              READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]");
-            }
-            bool usedByCurrFromSPS=sps->getUsedByCurrPicLtSPSFlag(uiCode);
-
-            pocLsbLt = sps->getLtRefPicPocLsbSps(uiCode);
-            rps->setUsed(j,usedByCurrFromSPS);
-          }
-          else
-          {
-            READ_CODE(sps->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode;
-            READ_FLAG( uiCode, "used_by_curr_pic_lt_flag");     rps->setUsed(j,uiCode);
-          }
-          READ_FLAG(uiCode,"delta_poc_msb_present_flag");
-          bool mSBPresentFlag = uiCode ? true : false;
-          if(mSBPresentFlag)
-          {
-            READ_UVLC( uiCode, "delta_poc_msb_cycle_lt[i]" );
-            bool deltaFlag = false;
-            //            First LTRP                               || First LTRP from SH
-            if( (j == offset+rps->getNumberOfLongtermPictures()-1) || (j == offset+(numOfLtrp-numLtrpInSPS)-1) )
-            {
-              deltaFlag = true;
-            }
-            if(deltaFlag)
-            {
-              deltaPocMSBCycleLT = uiCode;
-            }
-            else
-            {
-              deltaPocMSBCycleLT = uiCode + prevDeltaMSB;
-            }
-
-            int pocLTCurr = pcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB
-              - iPOClsb + pocLsbLt;
-            rps->setPOC     (j, pocLTCurr);
-            rps->setDeltaPOC(j, - pcSlice->getPOC() + pocLTCurr);
-            rps->setCheckLTMSBPresent(j,true);
-          }
-          else
-          {
-            rps->setPOC     (j, pocLsbLt);
-            rps->setDeltaPOC(j, - pcSlice->getPOC() + pocLsbLt);
-            rps->setCheckLTMSBPresent(j,false);
-
-            // reset deltaPocMSBCycleLT for first LTRP from slice header if MSB not present
-            if( j == offset+(numOfLtrp-numLtrpInSPS)-1 )
-            {
-              deltaPocMSBCycleLT = 0;
-            }
-          }
-          prevDeltaMSB = deltaPocMSBCycleLT;
-        }
-        offset += rps->getNumberOfLongtermPictures();
-        rps->setNumberOfPictures(offset);
-      }
-#if !JVET_M0101_HLS
-      if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-           || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-           || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
-      {
-        // In the case of BLA picture types, rps data is read from slice header but ignored
-        rps = pcSlice->getLocalRPS();
-        (*rps)=ReferencePictureSet();
-        pcSlice->setRPS(rps);
-      }
-#endif
-#endif
 
       if (sps->getSPSTemporalMVPEnabledFlag())
       {
@@ -2542,7 +1805,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
     if( sps->getALFEnabledFlag() )
     {
       READ_FLAG(uiCode, "tile_group_alf_enabled_flag");
-#if JVET_N0415_CTB_ALF
       pcSlice->setTileGroupAlfEnabledFlag(COMPONENT_Y, uiCode);
       int alfChromaIdc = 0;
       if (uiCode)
@@ -2565,11 +1827,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
         }
 		
 		
-#if JVET_N0805_APS_LMCS
         pcSlice->setAlfAPSs(apsId);
-#else
-        pcSlice->setAPSs(apsId);
-#endif
         alfChromaIdc = truncatedUnaryEqProb(3);        //alf_chroma_idc
         if (alfChromaIdc)
         {
@@ -2590,21 +1848,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
       }
       pcSlice->setTileGroupAlfEnabledFlag(COMPONENT_Cb, alfChromaIdc & 1);
       pcSlice->setTileGroupAlfEnabledFlag(COMPONENT_Cr, alfChromaIdc >> 1);
-#else
-      if (uiCode)
-      {
-        READ_CODE(5, uiCode, "tile_group_aps_id");
-        pcSlice->setAPSId(uiCode);
-        pcSlice->setAPS(parameterSetManager->getAPS(uiCode));
-        pcSlice->setTileGroupAlfEnabledFlag(true);
-      }
-      else
-      {
-        pcSlice->setTileGroupAlfEnabledFlag(false);
-        pcSlice->setAPSId(-1);
-        pcSlice->setAPS(nullptr);
-      }
-#endif
     }
 
     if (pcSlice->getIdrPicFlag())
@@ -2641,94 +1884,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
       }
     }
     // }
-#if !JVET_M0128
-    RefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
-    if(!pcSlice->isIntra())
-    {
-      if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )
-      {
-        refPicListModification->setRefPicListModificationFlagL0( 0 );
-      }
-      else
-      {
-        READ_FLAG( uiCode, "ref_pic_list_modification_flag_l0" ); refPicListModification->setRefPicListModificationFlagL0( uiCode ? 1 : 0 );
-      }
-
-      if(refPicListModification->getRefPicListModificationFlagL0())
-      {
-        uiCode = 0;
-        int i = 0;
-        int numRpsCurrTempList0 = pcSlice->getNumRpsCurrTempList();
-        if ( numRpsCurrTempList0 > 1 )
-        {
-          int length = 1;
-          numRpsCurrTempList0 --;
-          while ( numRpsCurrTempList0 >>= 1)
-          {
-            length ++;
-          }
-          for (i = 0; i < pcSlice->getNumRefIdx(REF_PIC_LIST_0); i ++)
-          {
-            READ_CODE( length, uiCode, "list_entry_l0" );
-            refPicListModification->setRefPicSetIdxL0(i, uiCode );
-          }
-        }
-        else
-        {
-          for (i = 0; i < pcSlice->getNumRefIdx(REF_PIC_LIST_0); i ++)
-          {
-            refPicListModification->setRefPicSetIdxL0(i, 0 );
-          }
-        }
-      }
-    }
-    else
-    {
-      refPicListModification->setRefPicListModificationFlagL0(0);
-    }
-    if(pcSlice->isInterB())
-    {
-      if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )
-      {
-        refPicListModification->setRefPicListModificationFlagL1( 0 );
-      }
-      else
-      {
-        READ_FLAG( uiCode, "ref_pic_list_modification_flag_l1" ); refPicListModification->setRefPicListModificationFlagL1( uiCode ? 1 : 0 );
-      }
-      if(refPicListModification->getRefPicListModificationFlagL1())
-      {
-        uiCode = 0;
-        int i = 0;
-        int numRpsCurrTempList1 = pcSlice->getNumRpsCurrTempList();
-        if ( numRpsCurrTempList1 > 1 )
-        {
-          int length = 1;
-          numRpsCurrTempList1 --;
-          while ( numRpsCurrTempList1 >>= 1)
-          {
-            length ++;
-          }
-          for (i = 0; i < pcSlice->getNumRefIdx(REF_PIC_LIST_1); i ++)
-          {
-            READ_CODE( length, uiCode, "list_entry_l1" );
-            refPicListModification->setRefPicSetIdxL1(i, uiCode );
-          }
-        }
-        else
-        {
-          for (i = 0; i < pcSlice->getNumRefIdx(REF_PIC_LIST_1); i ++)
-          {
-            refPicListModification->setRefPicSetIdxL1(i, 0 );
-          }
-        }
-      }
-    }
-    else
-    {
-      refPicListModification->setRefPicListModificationFlagL1(0);
-    }
-#endif
 
     if (pcSlice->isInterB())
     {
@@ -2774,7 +1929,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
     }
     READ_FLAG( uiCode, "dep_quant_enabled_flag" );
     pcSlice->setDepQuantEnabledFlag( uiCode != 0 );
-#if HEVC_USE_SIGN_HIDING
     if( !pcSlice->getDepQuantEnabledFlag() )
     {
       READ_FLAG( uiCode, "sign_data_hiding_enabled_flag" );
@@ -2784,7 +1938,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
     {
       pcSlice->setSignDataHidingEnabledFlag( 0 );
     }
-#endif
     if (
       sps->getSplitConsOverrideEnabledFlag()
       )
@@ -2852,7 +2005,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
         READ_FLAG( uiCode, "tile_group_fracmmvd_disabled_flag" );
         pcSlice->setDisFracMMVD( uiCode ? true : false );
       }
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
       if (sps->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
       {
         READ_UVLC(uiCode, "max_num_merge_cand_minus_max_num_triangle_cand");
@@ -2863,7 +2015,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
       {
         pcSlice->setMaxNumTriangleCand(0);
       }
-#endif
     }
 
     READ_SVLC( iCode, "slice_qp_delta" );
@@ -2894,14 +2045,12 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
         CHECK( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) < -12, "Invalid chroma QP offset" );
         CHECK( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >  12, "Invalid chroma QP offset" );
 
-#if JVET_N0054_JOINT_CHROMA
         READ_SVLC( iCode, "slice_cb_cr_qp_offset" );
         pcSlice->setSliceChromaQpDelta(JOINT_CbCr, iCode );
         CHECK( pcSlice->getSliceChromaQpDelta(JOINT_CbCr) < -12, "Invalid chroma QP offset" );
         CHECK( pcSlice->getSliceChromaQpDelta(JOINT_CbCr) >  12, "Invalid chroma QP offset" );
         CHECK( (pps->getQpOffset(JOINT_CbCr) + pcSlice->getSliceChromaQpDelta(JOINT_CbCr)) < -12, "Invalid chroma QP offset" );
         CHECK( (pps->getQpOffset(JOINT_CbCr) + pcSlice->getSliceChromaQpDelta(JOINT_CbCr)) >  12, "Invalid chroma QP offset" );
-#endif
       }
     }
 
@@ -2966,7 +2115,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
 
     if (sps->getUseReshaper())
     {
-#if JVET_N0805_APS_LMCS
       READ_FLAG(uiCode, "slice_lmcs_enabled_flag");          
       pcSlice->setLmcsEnabledFlag(uiCode == 1);
 
@@ -2985,16 +2133,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
           pcSlice->setLmcsChromaResidualScaleFlag(false);
         }
       }
-#else
-      parseReshaper(pcSlice->getReshapeInfo(), sps, pcSlice->isIntra());
-#endif
     }
 
-#if JVET_N0857_RECT_SLICES
     if( pcSlice->getSliceCurStartBrickIdx() == 0 )
-#else
-    if( firstSliceSegmentInPic )
-#endif
   {
     pcSlice->setDefaultClpRng( *sps );
 
@@ -3012,11 +2153,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
 
 
   std::vector<uint32_t> entryPointOffset;
-#if JVET_N0857_TILES_BRICKS
   if( !pps->getSingleTileInPicFlag() || pps->getEntropyCodingSyncEnabledFlag() )
-#else
-  if( pps->getTilesEnabledFlag() || pps->getEntropyCodingSyncEnabledFlag() )
-#endif
   {
     uint32_t numEntryPointOffsets;
     uint32_t offsetLenMinus1;
@@ -3041,11 +2178,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
 
   pcSlice->clearSubstreamSizes();
 
-#if !JVET_N0857_TILES_BRICKS
-  if( pps->getTilesEnabledFlag() || pps->getEntropyCodingSyncEnabledFlag() )
-#else
   if( !pps->getSingleTileInPicFlag() || pps->getEntropyCodingSyncEnabledFlag() )
-#endif
   {
     int endOfSliceHeaderLocation = m_pcBitstream->getByteLocation();
 
@@ -3082,7 +2215,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
   return;
 }
 
-#if JVET_M0101_HLS
 void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
 {
   uint32_t symbol;
@@ -3096,9 +2228,7 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
   READ_CODE(2, symbol,  "max_chroma_format_constraint_idc"         ); cinfo->setMaxChromaFormatConstraintIdc((ChromaFormat)symbol);
 
   READ_FLAG(symbol,  "no_qtbtt_dual_tree_intra_constraint_flag" ); cinfo->setNoQtbttDualTreeIntraConstraintFlag(symbol > 0 ? true : false);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_FLAG(symbol, "no_partition_constraints_override_constraint_flag"); cinfo->setNoPartitionConstraintsOverrideConstraintFlag(symbol > 0 ? true : false);
-#endif
   READ_FLAG(symbol,  "no_sao_constraint_flag");                    cinfo->setNoSaoConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol,  "no_alf_constraint_flag");                    cinfo->setNoAlfConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol,  "no_pcm_constraint_flag");                    cinfo->setNoPcmConstraintFlag(symbol > 0 ? true : false);
@@ -3107,31 +2237,18 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
   READ_FLAG(symbol,  "no_sbtmvp_constraint_flag");                 cinfo->setNoSbtmvpConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol,  "no_amvr_constraint_flag");                   cinfo->setNoAmvrConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol,  "no_bdof_constraint_flag");                   cinfo->setNoBdofConstraintFlag(symbol > 0 ? true : false);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_FLAG(symbol, "no_dmvr_constraint_flag");                    cinfo->setNoDmvrConstraintFlag(symbol > 0 ? true : false);
-#endif
   READ_FLAG(symbol, "no_cclm_constraint_flag");                    cinfo->setNoCclmConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol, "no_mts_constraint_flag");                     cinfo->setNoMtsConstraintFlag(symbol > 0 ? true : false);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_FLAG(symbol, "no_sbt_constraint_flag");                     cinfo->setNoSbtConstraintFlag(symbol > 0 ? true : false);
-#endif
   READ_FLAG(symbol, "no_affine_motion_constraint_flag");           cinfo->setNoAffineMotionConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol, "no_gbi_constraint_flag");                     cinfo->setNoGbiConstraintFlag(symbol > 0 ? true : false);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_FLAG(symbol, "no_ibc_constraint_flag");                     cinfo->setNoIbcConstraintFlag(symbol > 0 ? true : false);
-#endif
   READ_FLAG(symbol, "no_mh_intra_constraint_flag");                cinfo->setNoMhIntraConstraintFlag(symbol > 0 ? true : false);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_FLAG(symbol, "no_fpel_mmvd_constraint_flag");               cinfo->setNoFPelMmvdConstraintFlag(symbol > 0 ? true : false);
-#endif
   READ_FLAG(symbol, "no_triangle_constraint_flag");                cinfo->setNoTriangleConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol, "no_ladf_constraint_flag");                    cinfo->setNoLadfConstraintFlag(symbol > 0 ? true : false);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_FLAG(symbol, "no_transform_skip_constraint_flag");          cinfo->setNoTransformSkipConstraintFlag(symbol > 0 ? true : false);
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  READ_FLAG(symbol, "no_curr_pic_ref_constraint_flag");            cinfo->setNoCurrPicRefConstraintFlag(symbol > 0 ? true : false);
-#endif
   READ_FLAG(symbol, "no_qp_delta_constraint_flag");                cinfo->setNoQpDeltaConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol, "no_dep_quant_constraint_flag");               cinfo->setNoDepQuantConstraintFlag(symbol > 0 ? true : false);
   READ_FLAG(symbol, "no_sign_data_hiding_constraint_flag");        cinfo->setNoSignDataHidingConstraintFlag(symbol > 0 ? true : false);
@@ -3143,9 +2260,7 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubL
   uint32_t symbol;
   READ_CODE(7 , symbol,   "general_profile_idc"              ); ptl->setProfileIdc  (Profile::Name(symbol));
   READ_FLAG(    symbol,   "general_tier_flag"                ); ptl->setTierFlag    (symbol ? Level::HIGH : Level::MAIN);
-#if JVET_N0276_CONSTRAINT_FLAGS
   READ_CODE(24 , symbol,   "general_sub_profile_idc"         ); ptl->setSubProfileIdc  (symbol);
-#endif
 
   parseConstraintInfo( ptl->getConstraintInfo() );
 
@@ -3171,115 +2286,6 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubL
 }
 
 
-#else
-void HLSyntaxReader::parsePTL( PTL *rpcPTL, bool profilePresentFlag, int maxNumSubLayersMinus1 )
-{
-  uint32_t uiCode;
-  if(profilePresentFlag)
-  {
-    parseProfileTier(rpcPTL->getGeneralPTL(), false);
-  }
-  READ_CODE( 8, uiCode, "general_level_idc" );    rpcPTL->getGeneralPTL()->setLevelIdc(Level::Name(uiCode));
-
-  for (int i = 0; i < maxNumSubLayersMinus1; i++)
-  {
-    READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);
-    READ_FLAG( uiCode, "sub_layer_level_present_flag[i]"   ); rpcPTL->setSubLayerLevelPresentFlag  (i, uiCode);
-  }
-
-  if (maxNumSubLayersMinus1 > 0)
-  {
-    for (int i = maxNumSubLayersMinus1; i < 8; i++)
-    {
-      READ_CODE(2, uiCode, "reserved_zero_2bits");
-      CHECK(uiCode != 0, "Invalid code");
-    }
-  }
-
-  for(int i = 0; i < maxNumSubLayersMinus1; i++)
-  {
-    if( rpcPTL->getSubLayerProfilePresentFlag(i) )
-    {
-      parseProfileTier(rpcPTL->getSubLayerPTL(i), true);
-    }
-    if(rpcPTL->getSubLayerLevelPresentFlag(i))
-    {
-      READ_CODE( 8, uiCode, "sub_layer_level_idc[i]" );   rpcPTL->getSubLayerPTL(i)->setLevelIdc(Level::Name(uiCode));
-    }
-  }
-}
-
-#if ENABLE_TRACING|| RExt__DECODER_DEBUG_BIT_STATISTICS
-void HLSyntaxReader::parseProfileTier(ProfileTierLevel *ptl, const bool bIsSubLayer)
-#define PTL_TRACE_TEXT(txt) bIsSubLayer?("sub_layer_" txt) : ("general_" txt)
-#else
-void HLSyntaxReader::parseProfileTier(ProfileTierLevel *ptl, const bool /*bIsSubLayer*/)
-#define PTL_TRACE_TEXT(txt) txt
-#endif
-{
-  uint32_t uiCode;
-  READ_CODE(2 , uiCode,   PTL_TRACE_TEXT("profile_space"                   )); ptl->setProfileSpace(uiCode);
-  READ_FLAG(    uiCode,   PTL_TRACE_TEXT("tier_flag"                       )); ptl->setTierFlag    (uiCode ? Level::HIGH : Level::MAIN);
-  READ_CODE(5 , uiCode,   PTL_TRACE_TEXT("profile_idc"                     )); ptl->setProfileIdc  (Profile::Name(uiCode));
-  for(int j = 0; j < 32; j++)
-  {
-    READ_FLAG(  uiCode,   PTL_TRACE_TEXT("profile_compatibility_flag[][j]" )); ptl->setProfileCompatibilityFlag(j, uiCode ? 1 : 0);
-  }
-  READ_FLAG(uiCode,       PTL_TRACE_TEXT("progressive_source_flag"         )); ptl->setProgressiveSourceFlag(uiCode ? true : false);
-
-  READ_FLAG(uiCode,       PTL_TRACE_TEXT("interlaced_source_flag"          )); ptl->setInterlacedSourceFlag(uiCode ? true : false);
-
-  READ_FLAG(uiCode,       PTL_TRACE_TEXT("non_packed_constraint_flag"      )); ptl->setNonPackedConstraintFlag(uiCode ? true : false);
-
-  READ_FLAG(uiCode,       PTL_TRACE_TEXT("frame_only_constraint_flag"      )); ptl->setFrameOnlyConstraintFlag(uiCode ? true : false);
-
-  if (ptl->getProfileIdc() == Profile::MAINREXT           || ptl->getProfileCompatibilityFlag(Profile::MAINREXT) ||
-      ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT || ptl->getProfileCompatibilityFlag(Profile::HIGHTHROUGHPUTREXT))
-  {
-    uint32_t maxBitDepth=16;
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_12bit_constraint_flag"       )); if (uiCode) maxBitDepth=12;
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_10bit_constraint_flag"       )); if (uiCode) maxBitDepth=10;
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_8bit_constraint_flag"        )); if (uiCode) maxBitDepth=8;
-    ptl->setBitDepthConstraint(maxBitDepth);
-    ChromaFormat chromaFmtConstraint=CHROMA_444;
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_422chroma_constraint_flag"   )); if (uiCode) chromaFmtConstraint=CHROMA_422;
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_420chroma_constraint_flag"   )); if (uiCode) chromaFmtConstraint=CHROMA_420;
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("max_monochrome_constraint_flag"  )); if (uiCode) chromaFmtConstraint=CHROMA_400;
-    ptl->setChromaFormatConstraint(chromaFmtConstraint);
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("intra_constraint_flag"           )); ptl->setIntraConstraintFlag(uiCode != 0);
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("one_picture_only_constraint_flag")); ptl->setOnePictureOnlyConstraintFlag(uiCode != 0);
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("lower_bit_rate_constraint_flag"  )); ptl->setLowerBitRateConstraintFlag(uiCode != 0);
-    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_34bits[0..15]"     ));
-    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_34bits[16..31]"    ));
-    READ_CODE(2,  uiCode, PTL_TRACE_TEXT("reserved_zero_34bits[32..33]"    ));
-  }
-  else
-  {
-    ptl->setBitDepthConstraint( ( ptl->getProfileIdc() == Profile::MAIN10 || ptl->getProfileIdc() == Profile::NEXT ) ? 10 : 8 );
-    ptl->setChromaFormatConstraint(CHROMA_420);
-    ptl->setIntraConstraintFlag(false);
-    ptl->setLowerBitRateConstraintFlag(true);
-    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[0..15]"     ));
-    READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[16..31]"    ));
-    READ_CODE(11, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[32..42]"    ));
-  }
-
-  if ((ptl->getProfileIdc() >= Profile::MAIN && ptl->getProfileIdc() <= Profile::HIGHTHROUGHPUTREXT) ||
-       ptl->getProfileCompatibilityFlag(Profile::MAIN) ||
-       ptl->getProfileCompatibilityFlag(Profile::MAIN10) ||
-       ptl->getProfileCompatibilityFlag(Profile::MAINSTILLPICTURE) ||
-       ptl->getProfileCompatibilityFlag(Profile::MAINREXT) ||
-       ptl->getProfileCompatibilityFlag(Profile::HIGHTHROUGHPUTREXT) )
-  {
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("inbld_flag"                      )); CHECK(uiCode != 0, "Invalid code");
-  }
-  else
-  {
-    READ_FLAG(    uiCode, PTL_TRACE_TEXT("reserved_zero_bit"               ));
-  }
-#undef PTL_TRACE_TEXT
-}
-#endif
 
 void HLSyntaxReader::parseTerminatingBit( uint32_t& ruiBit )
 {
@@ -3442,7 +2448,6 @@ void HLSyntaxReader::parsePredWeightTable( Slice* pcSlice, const SPS *sps )
   CHECK(uiTotalSignalledWeightFlags>24, "Too many weight flag signalled");
 }
 
-#if HEVC_USE_SCALING_LISTS
 /** decode quantization matrix
 * \param scalingList quantization matrix information
 */
@@ -3455,22 +2460,7 @@ void HLSyntaxReader::parseScalingList(ScalingList* scalingList)
   {
     for(listId = 0; listId <  SCALING_LIST_NUM; listId++)
     {
-#if JVET_N0847_SCALING_LISTS
       if (!(((sizeId == SCALING_LIST_2x2) && (listId % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0)) || ((sizeId > SCALING_LIST_32x32) && (listId % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) != 0))))//2x2 luma
-#else
-      if ((sizeId==SCALING_LIST_32x32) && (listId%(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) != 0))
-      {
-        int *src = scalingList->getScalingListAddress(sizeId, listId);
-        const int size = std::min(MAX_MATRIX_COEF_NUM,(int)g_scalingListSize[sizeId]);
-        const int *srcNextSmallerSize = scalingList->getScalingListAddress(sizeId-1, listId);
-        for(int i=0; i<size; i++)
-        {
-          src[i] = srcNextSmallerSize[i];
-        }
-        scalingList->setScalingListDC(sizeId,listId,(sizeId > SCALING_LIST_8x8) ? scalingList->getScalingListDC(sizeId-1, listId) : src[0]);
-      }
-      else
-#endif
       {
         READ_FLAG( code, "scaling_list_pred_mode_flag");
         scalingListPredModeFlag = (code) ? true : false;
@@ -3479,17 +2469,9 @@ void HLSyntaxReader::parseScalingList(ScalingList* scalingList)
         {
           READ_UVLC( code, "scaling_list_pred_matrix_id_delta");
 
-#if JVET_N0847_SCALING_LISTS 
           if (sizeId == SCALING_LIST_64x64)
-#else
-          if (sizeId==SCALING_LIST_32x32)
-#endif
           {
-#if JVET_N0847_SCALING_LISTS
             code *= (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries.
-#else
-            code*=(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries.
-#endif
 	  }
 
           scalingList->setRefMatrixId (sizeId,listId,(uint32_t)((int)(listId)-(code)));
@@ -3522,11 +2504,7 @@ void HLSyntaxReader::decodeScalingList(ScalingList *scalingList, uint32_t sizeId
   int data;
   int scalingListDcCoefMinus8 = 0;
   int nextCoef = SCALING_LIST_START_VALUE;
-#if JVET_N0847_SCALING_LISTS 
   ScanElement *scan = g_scanOrder[SCAN_UNGROUPED][SCAN_DIAG][gp_sizeIdxInfo->idxFrom(1 << (sizeId == SCALING_LIST_2x2 ? 1 : (sizeId == SCALING_LIST_4x4 ? 2 : 3)))][gp_sizeIdxInfo->idxFrom(1 << (sizeId == SCALING_LIST_2x2 ? 1 : (sizeId == SCALING_LIST_4x4 ? 2 : 3)))];
-#else
-  uint32_t* scan = g_scanOrder[SCAN_UNGROUPED][SCAN_DIAG][gp_sizeIdxInfo->idxFrom( 1 << ( sizeId == SCALING_LIST_FIRST_CODED ? 2 : 3 ) )][gp_sizeIdxInfo->idxFrom( 1 << ( sizeId == SCALING_LIST_FIRST_CODED ? 2 : 3 ) )];
-#endif
   int *dst = scalingList->getScalingListAddress(sizeId, listId);
 
   if( sizeId > SCALING_LIST_8x8 )
@@ -3538,23 +2516,16 @@ void HLSyntaxReader::decodeScalingList(ScalingList *scalingList, uint32_t sizeId
 
   for(i = 0; i < coefNum; i++)
   {
-#if JVET_N0847_SCALING_LISTS
     if (sizeId == SCALING_LIST_64x64 && scan[i].x >= 4 && scan[i].y >= 4)
     {
       dst[scan[i].idx] = 0;
       continue;
     }
-#endif
     READ_SVLC( data, "scaling_list_delta_coef");
     nextCoef = (nextCoef + data + 256 ) % 256;
-#if JVET_N0847_SCALING_LISTS
     dst[scan[i].idx] = nextCoef;//[scan[scanIdx].idx]
-#else
-    dst[scan[i]] = nextCoef;
-#endif
   }
 }
-#endif
 
 bool HLSyntaxReader::xMoreRbspData()
 {
@@ -3585,11 +2556,7 @@ bool HLSyntaxReader::xMoreRbspData()
   return (cnt>0);
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 int HLSyntaxReader::alfGolombDecode( const int k, const bool signed_val )
-#else
-int HLSyntaxReader::alfGolombDecode( const int k )
-#endif
 {
   uint32_t uiSymbol;
   int q = -1;
@@ -3621,11 +2588,7 @@ int HLSyntaxReader::alfGolombDecode( const int k )
     }
   }
   nr += q * m;                    // add the bits and the multiple of M
-#if JVET_N0242_NON_LINEAR_ALF
   if( signed_val && nr != 0 )
-#else
-  if( nr != 0 )
-#endif
   {
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
     xReadFlag( uiSymbol, "" );
@@ -3674,9 +2637,7 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
   static int kMinTab[MAX_NUM_ALF_COEFF];
   const int numFilters = isChroma ? 1 : alfSliceParam.numLumaFilters;
   short* coeff = isChroma ? alfSliceParam.chromaCoeff : alfSliceParam.lumaCoeff;
-#if JVET_N0242_NON_LINEAR_ALF
   short* clipp = isChroma ? alfSliceParam.chromaClipp : alfSliceParam.lumaClipp;
-#endif
 
   for( int idx = 0; idx < maxGolombIdx; idx++ )
   {
@@ -3712,7 +2673,6 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
       coeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] = alfGolombDecode( kMinTab[alfShape.golombIdx[i]] );
     }
   }
-#if JVET_N0242_NON_LINEAR_ALF
 
   // Clipping values coding
   if ( alfSliceParam.nonLinearFlag[isChroma] )
@@ -3775,7 +2735,6 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
       std::fill_n( clipp + ind * MAX_NUM_ALF_LUMA_COEFF, alfShape.numCoeff, 0 );
     }
   }
-#endif
 }
 
 int HLSyntaxReader::truncatedUnaryEqProb( const int maxSymbol )
diff --git a/source/Lib/DecoderLib/VLCReader.h b/source/Lib/DecoderLib/VLCReader.h
index 9c70f565b..1ff98fa3b 100644
--- a/source/Lib/DecoderLib/VLCReader.h
+++ b/source/Lib/DecoderLib/VLCReader.h
@@ -109,9 +109,7 @@ public:
 
 protected:
   void xReadRbspTrailingBits();
-#if JVET_M0101_HLS
   bool isByteAligned() { return (m_pcBitstream->getNumBitsUntilByteAligned() == 0 ); }
-#endif
 };
 
 
@@ -143,61 +141,36 @@ public:
   virtual ~HLSyntaxReader();
 
 protected:
-#if JVET_M0128
   void  copyRefPicList(SPS* pcSPS, ReferencePictureList* source_rpl, ReferencePictureList* dest_rpl);
   void  parseRefPicList(SPS* pcSPS, ReferencePictureList* rpl);
-#else
-  void  parseShortTermRefPicSet            (SPS* pcSPS, ReferencePictureSet* pcRPS, int idx);
-#endif
 
 public:
   void  setBitstream        ( InputBitstream* p )   { m_pcBitstream = p; }
-#if HEVC_VPS || JVET_N0278_HLS
   void  parseVPS            ( VPS* pcVPS );
-#endif
-#if JVET_N0349_DPS
   void  parseDPS            ( DPS* dps );
-#endif
   void  parseSPS            ( SPS* pcSPS );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void  parsePPS            ( PPS* pcPPS, ParameterSetManager *parameterSetManager );
-#else
-  void  parsePPS            ( PPS* pcPPS );
-#endif
   void  parseAPS            ( APS* pcAPS );
-#if JVET_N0805_APS_LMCS
   void  parseAlfAps         ( APS* pcAPS );
   void  parseLmcsAps        ( APS* pcAPS );
-#endif
   void  parseVUI            ( VUI* pcVUI, SPS* pcSPS );
-#if !JVET_M0101_HLS
-  void  parsePTL            ( PTL *rpcPTL, bool profilePresentFlag, int maxNumSubLayersMinus1 );
-  void  parseProfileTier    ( ProfileTierLevel *ptl, const bool bIsSubLayer );
-#else
   void  parseConstraintInfo   (ConstraintInfo *cinfo);
   void  parseProfileTierLevel ( ProfileTierLevel *ptl, int maxNumSubLayersMinus1);
-#endif
   void  parseHrdParameters  ( HRDParameters *hrd, bool cprms_present_flag, uint32_t tempLevelHigh );
   void  parseSliceHeader    ( Slice* pcSlice, ParameterSetManager *parameterSetManager, const int prevTid0POC );
   void  parseTerminatingBit ( uint32_t& ruiBit );
   void  parseRemainingBytes ( bool noTrailingBytesExpected );
 
   void  parsePredWeightTable( Slice* pcSlice, const SPS *sps );
-#if HEVC_USE_SCALING_LISTS
   void  parseScalingList    ( ScalingList* scalingList );
   void  decodeScalingList   ( ScalingList *scalingList, uint32_t sizeId, uint32_t listId);
-#endif
   void parseReshaper        ( SliceReshapeInfo& sliceReshaperInfo, const SPS* pcSPS, const bool isIntra );
   void alfFilter( AlfSliceParam& alfSliceParam, const bool isChroma );
 
 private:
   int truncatedUnaryEqProb( const int maxSymbol );
   void xReadTruncBinCode( uint32_t& ruiSymbol, const int uiMaxSymbol );
-#if JVET_N0242_NON_LINEAR_ALF
   int  alfGolombDecode( const int k, const bool signed_val=true );
-#else
-  int  alfGolombDecode( const int k );
-#endif
 
 protected:
   bool  xMoreRbspData();
diff --git a/source/Lib/EncoderLib/AnnexBwrite.h b/source/Lib/EncoderLib/AnnexBwrite.h
index 4067197af..bbf05a697 100644
--- a/source/Lib/EncoderLib/AnnexBwrite.h
+++ b/source/Lib/EncoderLib/AnnexBwrite.h
@@ -60,25 +60,9 @@ static std::vector<uint32_t> writeAnnexB(std::ostream& out, const AccessUnit& au
 
     static const uint8_t start_code_prefix[] = {0,0,0,1};
 #if HEVC_VPS
-#if JVET_N0349_DPS
     if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DPS || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
 #else
-    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
-#endif
-#else
-#if JVET_N0349_DPS
-#if JVET_N0278_HLS
     if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
-#else
-    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_DPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
-#endif
-#else
-#if JVET_N0278_HLS
-    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
-#else
-    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
-#endif
-#endif
 #endif
     {
       /* From AVC, When any of the following conditions are fulfilled, the
diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp
index 918933e80..604d36461 100644
--- a/source/Lib/EncoderLib/CABACWriter.cpp
+++ b/source/Lib/EncoderLib/CABACWriter.cpp
@@ -172,12 +172,10 @@ void CABACWriter::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
     for (int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++)
     {
       codeAlfCtuEnableFlag(cs, ctuRsAddr, compIdx, NULL);
-#if JVET_N0415_CTB_ALF
       if (isLuma(ComponentID(compIdx)))
       {
         codeAlfCtuFilterIndex(cs, ctuRsAddr, cs.slice->getTileGroupAlfEnabledFlag(COMPONENT_Y));
       }
-#endif
     }
   }
 
@@ -244,18 +242,9 @@ void CABACWriter::sao( const Slice& slice, unsigned ctuRsAddr )
   int                 rx                      = ctuRsAddr - ry * frame_width_in_ctus;
   const Position      pos                     ( rx * cs.pcv->maxCUWidth, ry * cs.pcv->maxCUHeight );
   const unsigned      curSliceIdx             = slice.getIndependentSliceIdx();
-#if JVET_N0857_TILES_BRICKS
   const unsigned      curTileIdx              = cs.picture->brickMap->getBrickIdxRsMap( pos );
-#else
-  const unsigned      curTileIdx              = cs.picture->tileMap->getTileIdxMap( pos );
-#endif
-#if JVET_N0150_ONE_CTU_DELAY_WPP
   bool                leftMergeAvail          = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0  ), pos, curSliceIdx, curTileIdx, CH_L ) ? true : false;
   bool                aboveMergeAvail         = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), pos, curSliceIdx, curTileIdx, CH_L ) ? true : false;
-#else
-  bool                leftMergeAvail          = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0  ), curSliceIdx, curTileIdx, CH_L ) ? true : false;
-  bool                aboveMergeAvail         = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false;
-#endif
   sao_block_pars( sao_ctu_pars, sps.getBitDepths(), sliceEnabled, leftMergeAvail, aboveMergeAvail, false );
 }
 
@@ -613,9 +602,7 @@ void CABACWriter::coding_unit( const CodingUnit& cu, Partitioner& partitioner, C
 
   // prediction mode and partitioning data
   pred_mode ( cu );
-#if JVET_N0413_RDPCM
   bdpcm_mode( cu, ComponentID( partitioner.chType ) );
-#endif
 
 #if FIX_PCM
   // pcm samples
@@ -629,11 +616,6 @@ void CABACWriter::coding_unit( const CodingUnit& cu, Partitioner& partitioner, C
     }
   }
 #endif
-#if !JVET_N0217_MATRIX_INTRAPRED
-  extend_ref_line(cu);
-
-  isp_mode( cu );
-#endif
 
   // prediction data ( intra prediction modes / reference indexes + motion vectors )
   cu_pred_data( cu );
@@ -658,45 +640,32 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
 
   if (cu.slice->isIntra() && cu.cs->slice->getSPS()->getIBCFlag())
   {
-#if JVET_N0318_N0467_IBC_SIZE
     if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
     {
-#endif
     m_BinEncoder.encodeBin((cu.skip), Ctx::SkipFlag(ctxId));
     DTRACE(g_trace_ctx, D_SYNTAX, "cu_skip_flag() ctx=%d skip=%d\n", ctxId, cu.skip ? 1 : 0);
-#if JVET_N0318_N0467_IBC_SIZE
     }
-#endif
     return;
   }
-#if JVET_N0266_SMALL_BLOCKS
   if ( !cu.cs->slice->getSPS()->getIBCFlag() && cu.lwidth() == 4 && cu.lheight() == 4 )
   {
     return;
   }
-#endif
   m_BinEncoder.encodeBin( ( cu.skip ), Ctx::SkipFlag( ctxId ) );
 
   DTRACE( g_trace_ctx, D_SYNTAX, "cu_skip_flag() ctx=%d skip=%d\n", ctxId, cu.skip ? 1 : 0 );
   if (cu.skip && cu.cs->slice->getSPS()->getIBCFlag())
   {
-#if JVET_N0318_N0467_IBC_SIZE
     if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
     {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
       if ( cu.lwidth() == 4 && cu.lheight() == 4 )
       {
         return;
       }
-#endif
     unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
     m_BinEncoder.encodeBin(CU::isIBC(cu) ? 1 : 0, Ctx::IBCFlag(ctxidx));
     DTRACE(g_trace_ctx, D_SYNTAX, "ibc() ctx=%d cu.predMode=%d\n", ctxidx, cu.predMode);
-#if JVET_N0318_N0467_IBC_SIZE
     }
-#endif
-#if JVET_N0324_REGULAR_MRG_FLAG
     if (CU::isInter(cu))
     {
       if (!cu.cs->slice->getSPS()->getUseMMVD() && (cu.firstPU->lwidth() * cu.firstPU->lheight() == 32))
@@ -708,15 +677,9 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
         m_BinEncoder.encodeBin(cu.firstPU->regularMergeFlag, Ctx::RegularMergeFlag(0));
         DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 0, cu.firstPU->regularMergeFlag?1:0);
       }
-#if JVET_N0127_MMVD_SPS_FLAG
       if (cu.cs->slice->getSPS()->getUseMMVD())
       {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
         bool isCUWithOnlyRegularAndMMVD=((cu.firstPU->lwidth() == 8 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 8));
-#else
-        bool isCUWithOnlyRegularAndMMVD=((cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 8 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 8));
-#endif
         if (isCUWithOnlyRegularAndMMVD)
         {
           CHECK(cu.mmvdSkip==cu.firstPU->regularMergeFlag, "mmvdSkip_flag must be !regularMergeFlag");
@@ -726,23 +689,9 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
           m_BinEncoder.encodeBin(cu.mmvdSkip, Ctx::MmvdFlag(0));
           DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, cu.mmvdSkip ? 1 : 0);
         }
-#if JVET_N0127_MMVD_SPS_FLAG
       }
-#endif
     }
-#else
-#if JVET_N0127_MMVD_SPS_FLAG
-    if (CU::isInter(cu) && cu.cs->slice->getSPS()->getUseMMVD())
-#else
-    if (CU::isInter(cu))
-#endif
-    {
-      m_BinEncoder.encodeBin(cu.mmvdSkip, Ctx::MmvdFlag(0));
-      DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, cu.mmvdSkip ? 1 : 0);
-    }
-#endif
   }
-#if JVET_N0324_REGULAR_MRG_FLAG
   if (cu.skip && !cu.cs->slice->getSPS()->getIBCFlag())
   {
     if (!cu.cs->slice->getSPS()->getUseMMVD() && (cu.firstPU->lwidth() * cu.firstPU->lheight() == 32))
@@ -754,15 +703,9 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
       m_BinEncoder.encodeBin(cu.firstPU->regularMergeFlag, Ctx::RegularMergeFlag(0));
       DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 0, cu.firstPU->regularMergeFlag?1:0);
     }
-#if JVET_N0127_MMVD_SPS_FLAG
     if (cu.cs->slice->getSPS()->getUseMMVD())
     {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
       bool isCUWithOnlyRegularAndMMVD=((cu.firstPU->lwidth() == 8 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 8));
-#else
-      bool isCUWithOnlyRegularAndMMVD=((cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 8 && cu.firstPU->lheight() == 4) || (cu.firstPU->lwidth() == 4 && cu.firstPU->lheight() == 8));
-#endif
       if (isCUWithOnlyRegularAndMMVD)
       {
         CHECK(cu.mmvdSkip==cu.firstPU->regularMergeFlag, "mmvdSkip_flag must be !regularMergeFlag");
@@ -772,21 +715,8 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
         m_BinEncoder.encodeBin(cu.mmvdSkip, Ctx::MmvdFlag(0));
         DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, cu.mmvdSkip ? 1 : 0);
       }
-#if JVET_N0127_MMVD_SPS_FLAG
     }
-#endif
   }
-#else
-#if JVET_N0127_MMVD_SPS_FLAG
-  if (cu.skip && !cu.cs->slice->getSPS()->getIBCFlag() && cu.cs->slice->getSPS()->getUseMMVD())
-#else
-  if (cu.skip && !cu.cs->slice->getSPS()->getIBCFlag())
-#endif
-  {
-    m_BinEncoder.encodeBin(cu.mmvdSkip, Ctx::MmvdFlag(0));
-    DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_cu_skip_flag() ctx=%d mmvd_skip=%d\n", 0, cu.mmvdSkip ? 1 : 0);
-  }
-#endif
 }
 
 
@@ -794,53 +724,36 @@ void CABACWriter::pred_mode( const CodingUnit& cu )
 {
   if (cu.cs->slice->getSPS()->getIBCFlag())
   {
-#if JVET_N0266_SMALL_BLOCKS
     if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) )
-#else
-    if (cu.cs->slice->isIntra())
-#endif
     {
-#if JVET_N0318_N0467_IBC_SIZE
       if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
       {
-#endif
       unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
       m_BinEncoder.encodeBin(CU::isIBC(cu), Ctx::IBCFlag(ctxidx));
-#if JVET_N0318_N0467_IBC_SIZE
       }
-#endif
     }
     else
     {
       m_BinEncoder.encodeBin((CU::isIntra(cu)), Ctx::PredMode(DeriveCtx::CtxPredModeFlag(cu)));
       if (!CU::isIntra(cu))
       {
-#if JVET_N0318_N0467_IBC_SIZE
         if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
         {
-#endif
         unsigned ctxidx = DeriveCtx::CtxIBCFlag(cu);
         m_BinEncoder.encodeBin(CU::isIBC(cu), Ctx::IBCFlag(ctxidx));
-#if JVET_N0318_N0467_IBC_SIZE
         }
-#endif
       }
     }
   }
   else
   {
-#if JVET_N0266_SMALL_BLOCKS
     if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) )
-#else
-    if (cu.cs->slice->isIntra())
-#endif
     {
       return;
     }
     m_BinEncoder.encodeBin((CU::isIntra(cu)), Ctx::PredMode(DeriveCtx::CtxPredModeFlag(cu)));
   }
 }
-#if JVET_N0413_RDPCM
 void CABACWriter::bdpcm_mode( const CodingUnit& cu, const ComponentID compID )
 {
   if( !CU::bdpcmAllowed( cu, compID ) ) return;
@@ -853,7 +766,6 @@ void CABACWriter::bdpcm_mode( const CodingUnit& cu, const ComponentID compID )
   }
   DTRACE( g_trace_ctx, D_SYNTAX, "bdpcm_mode() x=%d, y=%d, w=%d, h=%d, bdpcm=%d\n", cu.lumaPos().x, cu.lumaPos().y, cu.lwidth(), cu.lheight(), cu.bdpcmMode );
 }
-#endif
 void CABACWriter::pcm_data( const CodingUnit& cu, Partitioner& partitioner  )
 {
   pcm_flag( cu, partitioner );
@@ -919,29 +831,17 @@ void CABACWriter::cu_gbi_flag(const CodingUnit& cu)
     const uint32_t prefixNumBits = numGBi - 2;
     const uint32_t step = 1;
 
-#if !JVET_N0286_SIMPLIFIED_GBI_IDX
-    int ctxIdGBi = 4;
-#endif
     uint8_t idx = 1;
     for(int ui = 0; ui < prefixNumBits; ++ui)
     {
       if (gbiCodingIdx == idx)
       {
-#if JVET_N0286_SIMPLIFIED_GBI_IDX
         m_BinEncoder.encodeBinEP(1);
-#else
-        m_BinEncoder.encodeBin(1, Ctx::GBiIdx(ctxIdGBi));
-#endif
         break;
       }
       else
       {
-#if JVET_N0286_SIMPLIFIED_GBI_IDX
         m_BinEncoder.encodeBinEP(0);
-#else
-        m_BinEncoder.encodeBin(0, Ctx::GBiIdx(ctxIdGBi));
-        ctxIdGBi += step;
-#endif
         idx += step;
       }
     }
@@ -995,11 +895,7 @@ void CABACWriter::extend_ref_line(const PredictionUnit& pu)
 #endif
 
   const CodingUnit& cu = *pu.cu;
-#if JVET_N0413_RDPCM
   if( !cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma( cu.chType ) || cu.bdpcmMode )
-#else
-  if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType))
-#endif
   {
     return;
   }
@@ -1025,11 +921,7 @@ void CABACWriter::extend_ref_line(const CodingUnit& cu)
   return;
 #endif
 
-#if JVET_N0413_RDPCM
   if ( !cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.ipcm || cu.bdpcmMode )
-#else
-  if (!cu.Y().valid() || cu.predMode != MODE_INTRA || !isLuma(cu.chType) || cu.ipcm)
-#endif
   {
     return;
   }
@@ -1065,7 +957,6 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
     return;
   }
 
-#if JVET_N0413_RDPCM
   if( cu.bdpcmMode )
   {
     PredictionUnit *pu = cu.firstPU;
@@ -1074,9 +965,7 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
     cu.firstPU->intraDir[0] = mpm_pred[0];
     return;
   }
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
   mip_flag(cu);
   if (cu.mipFlag)
   {
@@ -1086,7 +975,6 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
   extend_ref_line( cu );
 
   isp_mode( cu );
-#endif
 
   const int numMPMs   = NUM_MOST_PROBABLE_MODES;
   const int numBlocks = CU::getNumPUs( cu );
@@ -1136,13 +1024,9 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
     if( mpm_idx < numMPMs )
     {
       {
-#if JVET_N0185_UNIFIED_MPM
         unsigned ctx = (pu->cu->ispMode == NOT_INTRA_SUBPARTITIONS ? 1 : 0);
         if (pu->multiRefIdx == 0)
           m_BinEncoder.encodeBin(mpm_idx > 0, Ctx::IntraLumaPlanarFlag(ctx));
-#else
-        m_BinEncoder.encodeBinEP( mpm_idx > 0 );
-#endif
         if( mpm_idx )
         {
           m_BinEncoder.encodeBinEP( mpm_idx > 1 );
@@ -1191,10 +1075,7 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
 void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
 {
 
-#if JVET_N0413_RDPCM
   if( pu.cu->bdpcmMode ) return;
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   mip_flag(*pu.cu);
   if (pu.cu->mipFlag)
   {
@@ -1204,7 +1085,6 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
   extend_ref_line( pu );
 
   isp_mode( *pu.cu );
-#endif
 
   // prev_intra_luma_pred_flag
   const int numMPMs  = NUM_MOST_PROBABLE_MODES;
@@ -1236,13 +1116,9 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
   if( mpm_idx < numMPMs )
   {
     {
-#if JVET_N0185_UNIFIED_MPM
       unsigned ctx = (pu.cu->ispMode == NOT_INTRA_SUBPARTITIONS ? 1 : 0);
       if (pu.multiRefIdx == 0)
         m_BinEncoder.encodeBin( mpm_idx > 0, Ctx::IntraLumaPlanarFlag(ctx) );
-#else
-      m_BinEncoder.encodeBinEP( mpm_idx > 0 );
-#endif
       if( mpm_idx )
       {
         m_BinEncoder.encodeBinEP( mpm_idx > 1 );
@@ -1385,9 +1261,7 @@ void CABACWriter::cu_residual( const CodingUnit& cu, Partitioner& partitioner, C
     transform_tree( *cu.cs, partitioner, cuCtx, chromaCbfs );
   }
 
-#if JVET_N0193_LFNST
   residual_lfnst_mode( cu, cuCtx );
-#endif
 }
 
 void CABACWriter::rqt_root_cbf( const CodingUnit& cu )
@@ -1457,12 +1331,7 @@ void CABACWriter::sbt_mode( const CodingUnit& cu )
 void CABACWriter::end_of_ctu( const CodingUnit& cu, CUCtx& cuCtx )
 {
   const Slice*  slice             = cu.cs->slice;
-#if JVET_N0857_TILES_BRICKS
   const int     currentCTUTsAddr  = cu.cs->picture->brickMap->getCtuRsToBsAddrMap( CU::getCtuAddr( cu ) );
-#else
-  const TileMap& tileMap          = *cu.cs->picture->tileMap;
-  const int     currentCTUTsAddr  = tileMap.getCtuRsToTsAddrMap( CU::getCtuAddr( cu ) );
-#endif
   const bool    isLastSubCUOfCtu  = CU::isLastSubCUOfCtu( cu );
 
   if ( isLastSubCUOfCtu
@@ -1517,34 +1386,14 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
       merge_idx(pu);
       return;
     }
-#if JVET_N0324_REGULAR_MRG_FLAG
     if (pu.regularMergeFlag)
     {
       merge_idx(pu);
     }
     else
     {
-#endif
       subblock_merge_flag( *pu.cu );
       MHIntra_flag( pu );
-#if !JVET_N0302_SIMPLFIED_CIIP
-      if ( pu.mhIntraFlag )
-      {
-        MHIntra_luma_pred_modes( *pu.cu );
-      }
-#if JVET_N0324_REGULAR_MRG_FLAG
-      else
-      {
-        if (!pu.cu->affine && !pu.mmvdMergeFlag && !pu.cu->mmvdSkip)
-        {
-          CHECK(!pu.cu->triangle, "triangle_flag must be true");
-        }
-      }
-#else
-      triangle_mode( *pu.cu );
-#endif
-#else
-#if JVET_N0324_REGULAR_MRG_FLAG
       if (!pu.mhIntraFlag)
       {
         if (!pu.cu->affine && !pu.mmvdMergeFlag && !pu.cu->mmvdSkip)
@@ -1552,19 +1401,13 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
           CHECK(!pu.cu->triangle, "triangle_flag must be true");
         }
       }
-#else
-      triangle_mode(*pu.cu);
-#endif
-#endif
       if (pu.mmvdMergeFlag)
       {
         mmvd_merge_idx(pu);
       }
       else
         merge_idx    ( pu );
-#if JVET_N0324_REGULAR_MRG_FLAG
     }
-#endif
   }
   else if (CU::isIBC(*pu.cu))
   {
@@ -1699,7 +1542,6 @@ void CABACWriter::merge_flag( const PredictionUnit& pu )
   {
     return;
   }
-#if JVET_N0324_REGULAR_MRG_FLAG
   if (pu.mergeFlag)
   {
     if (!pu.cs->sps->getUseMMVD() && (pu.lwidth() * pu.lheight() == 32))
@@ -1711,15 +1553,9 @@ void CABACWriter::merge_flag( const PredictionUnit& pu )
       m_BinEncoder.encodeBin(pu.regularMergeFlag, Ctx::RegularMergeFlag(1));
       DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 1, pu.regularMergeFlag?1:0);
     }
-#if JVET_N0127_MMVD_SPS_FLAG
     if (pu.cs->sps->getUseMMVD())
     {
-#endif
-#if JVET_N0266_SMALL_BLOCKS
       bool isCUWithOnlyRegularAndMMVD=((pu.lwidth() == 8 && pu.lheight() == 4) || (pu.lwidth() == 4 && pu.lheight() == 8));
-#else
-      bool isCUWithOnlyRegularAndMMVD=((pu.lwidth() == 4 && pu.lheight() == 4) || (pu.lwidth() == 8 && pu.lheight() == 4) || (pu.lwidth() == 4 && pu.lheight() == 8));
-#endif
       if (isCUWithOnlyRegularAndMMVD)
       {
         CHECK(pu.mmvdMergeFlag==pu.regularMergeFlag, "mmvdMergeFlag must be !regularMergeFlag");
@@ -1729,21 +1565,8 @@ void CABACWriter::merge_flag( const PredictionUnit& pu )
         m_BinEncoder.encodeBin(pu.mmvdMergeFlag, Ctx::MmvdFlag(0));
         DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_merge_flag() mmvd_merge=%d pos=(%d,%d) size=%dx%d\n", pu.mmvdMergeFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height);
       }
-#if JVET_N0127_MMVD_SPS_FLAG
     }
-#endif
-  }
-#else
-#if JVET_N0127_MMVD_SPS_FLAG
-  if (pu.mergeFlag && pu.cs->sps->getUseMMVD())
-#else
-  if (pu.mergeFlag)
-#endif
-  {
-    m_BinEncoder.encodeBin(pu.mmvdMergeFlag, Ctx::MmvdFlag(0));
-    DTRACE(g_trace_ctx, D_SYNTAX, "mmvd_merge_flag() mmvd_merge=%d pos=(%d,%d) size=%dx%d\n", pu.mmvdMergeFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height);
   }
-#endif
 }
 
 void CABACWriter::imv_mode( const CodingUnit& cu )
@@ -1765,27 +1588,14 @@ void CABACWriter::imv_mode( const CodingUnit& cu )
     return;
   }
 
-#if !JVET_N600_AMVR_TPM_CTX_REDUCTION
-  unsigned ctxId = DeriveCtx::CtxIMVFlag( cu );
-#endif
   if (CU::isIBC(cu) == false)
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
     m_BinEncoder.encodeBin( (cu.imv > 0), Ctx::ImvFlag( 0 ) );
   DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", (cu.imv > 0), 0 );
-#else
-    m_BinEncoder.encodeBin( ( cu.imv > 0 ), Ctx::ImvFlag( ctxId ) );
-  DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", (cu.imv > 0), ctxId );
-#endif
 
   if( sps->getAMVREnabledFlag() && cu.imv > 0 )
   {
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
     m_BinEncoder.encodeBin( (cu.imv > 1), Ctx::ImvFlag( 1 ) );
     DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", (cu.imv > 1), 1 );
-#else
-    m_BinEncoder.encodeBin( ( cu.imv > 1 ), Ctx::ImvFlag( 3 ) );
-    DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() value=%d ctx=%d\n", ( cu.imv > 1 ), 3 );
-#endif
   }
 
   DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() IMVFlag=%d\n", cu.imv );
@@ -1805,23 +1615,13 @@ void CABACWriter::affine_amvr_mode( const CodingUnit& cu )
     return;
   }
 
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
   m_BinEncoder.encodeBin( (cu.imv > 0), Ctx::ImvFlag( 2 ) );
   DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", (cu.imv > 0), 2 );
-#else
-  m_BinEncoder.encodeBin( ( cu.imv > 0 ), Ctx::ImvFlag( 4 ) );
-  DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", ( cu.imv > 0 ), 4 );
-#endif
 
   if( cu.imv > 0 )
   {
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
     m_BinEncoder.encodeBin( (cu.imv > 1), Ctx::ImvFlag( 3 ) );
     DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", (cu.imv > 1), 3 );
-#else
-    m_BinEncoder.encodeBin( ( cu.imv > 1 ), Ctx::ImvFlag( 5 ) );
-    DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() value=%d ctx=%d\n", ( cu.imv > 1 ), 5 );
-#endif
   }
   DTRACE( g_trace_ctx, D_SYNTAX, "affine_amvr_mode() IMVFlag=%d\n", cu.imv );
 }
@@ -1868,13 +1668,11 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
       candIdx1 -= candIdx1 < candIdx0 ? 0 : 1;
       auto encodeOneIdx = [this](uint8_t mrgIdx, int numCandminus1)
       {
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
         if (numCandminus1 == 0)
         {
           CHECK(mrgIdx, "Incorrect index!");
           return;
         }
-#endif
         if(mrgIdx == 0)
         {
           this->m_BinEncoder.encodeBin( 0, Ctx::MergeIdx() );
@@ -1894,17 +1692,12 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
         }
       };
       m_BinEncoder.encodeBinEP(splitDir);
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
       const int maxNumTriangleCand = pu.cs->slice->getMaxNumTriangleCand();
       CHECK(maxNumTriangleCand < 2, "Incorrect max number of triangle candidates");
       CHECK(candIdx0 >= maxNumTriangleCand, "Incorrect candIdx0");
       CHECK(candIdx1 >= maxNumTriangleCand, "Incorrect candIdx1");
       encodeOneIdx(candIdx0, maxNumTriangleCand - 1);
       encodeOneIdx(candIdx1, maxNumTriangleCand - 2);
-#else
-      encodeOneIdx(candIdx0, TRIANGLE_MAX_NUM_UNI_CANDS - 1);
-      encodeOneIdx(candIdx1, TRIANGLE_MAX_NUM_UNI_CANDS - 2);
-#endif
       return;
     }
   int numCandminus1 = int( pu.cs->slice->getMaxNumMergeCand() ) - 1;
@@ -1940,12 +1733,8 @@ void CABACWriter::mmvd_merge_idx(const PredictionUnit& pu)
   var1 = (mvpIdx - (var0 * MMVD_MAX_REFINE_NUM)) / 4;
   var2 = mvpIdx - (var0 * MMVD_MAX_REFINE_NUM) - var1 * 4;
 
-#if JVET_N0448_N0380
   int numCand = int(pu.cs->slice->getMaxNumMergeCand());
   int numCandminus1_base = (numCand > 1) ? MMVD_BASE_MV_NUM - 1 : 0;
-#else
-  int numCandminus1_base = MMVD_BASE_MV_NUM - 1;
-#endif
   if (numCandminus1_base > 0)
   {
     if (var0 == 0)
@@ -2105,104 +1894,7 @@ void CABACWriter::MHIntra_flag(const PredictionUnit& pu)
   DTRACE(g_trace_ctx, D_SYNTAX, "MHIntra_flag() MHIntra=%d pos=(%d,%d) size=%dx%d\n", pu.mhIntraFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height);
 }
 
-#if !JVET_N0302_SIMPLFIED_CIIP
-void CABACWriter::MHIntra_luma_pred_modes(const CodingUnit& cu)
-{
-  if (!cu.Y().valid())
-  {
-    return;
-  }
-
-  const int numMPMs = 3;
-  int      numBlocks = CU::getNumPUs(cu);
-  unsigned mpm_idxs[4];
-  unsigned pred_modes[4];
 
-  const PredictionUnit* pu = cu.firstPU;
-
-  unsigned mpm_pred[numMPMs];
-  for (int k = 0; k < numBlocks; k++)
-  {
-    unsigned&  mpm_idx = mpm_idxs[k];
-    unsigned&  pred_mode = pred_modes[k];
-
-    PU::getMHIntraMPMs(*pu, mpm_pred);
-
-    pred_mode = pu->intraDir[0];
-
-    mpm_idx = numMPMs;
-
-    for (int idx = 0; idx < numMPMs; idx++)
-    {
-      if (pred_mode == mpm_pred[idx])
-      {
-        mpm_idx = idx;
-        break;
-      }
-    }
-    if (PU::getNarrowShape(pu->lwidth(), pu->lheight()) == 0)
-    {
-      m_BinEncoder.encodeBin(mpm_idx < numMPMs, Ctx::MHIntraPredMode());
-    }
-    pu = pu->next;
-  }
-
-  pu = cu.firstPU;
-
-  // mpm_idx / rem_intra_luma_pred_mode
-  for (int k = 0; k < numBlocks; k++)
-  {
-    const unsigned& mpm_idx = mpm_idxs[k];
-    if (mpm_idx < numMPMs)
-    {
-      m_BinEncoder.encodeBinEP(mpm_idx > 0);
-      if (mpm_idx)
-      {
-        m_BinEncoder.encodeBinEP(mpm_idx > 1);
-      }
-    }
-    DTRACE(g_trace_ctx, D_SYNTAX, "intra_luma_pred_modes() idx=%d pos=(%d,%d) mode=%d\n", k, pu->lumaPos().x, pu->lumaPos().y, pu->intraDir[0]);
-    pu = pu->next;
-  }
-}
-#endif
-
-#if !JVET_N0324_REGULAR_MRG_FLAG
-void CABACWriter::triangle_mode( const CodingUnit& cu )
-{
-  if( !cu.cs->slice->getSPS()->getUseTriangle() || !cu.cs->slice->isInterB() || cu.lwidth() * cu.lheight() < TRIANGLE_MIN_SIZE || cu.affine )
-  {
-    return;
-  }
-
-  if ( cu.firstPU->mmvdMergeFlag || cu.mmvdSkip )
-  {
-    return;
-  }
-
-  if ( cu.firstPU->mhIntraFlag )
-  {
-    return;
-  }
-
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
-  if (cu.cs->slice->getMaxNumTriangleCand() < 2)
-  {
-    return;
-  }
-#endif
-
-#if JVET_N600_AMVR_TPM_CTX_REDUCTION
-  m_BinEncoder.encodeBin( cu.triangle, Ctx::TriangleFlag(0) );
-#else
-  unsigned flag_idx     = DeriveCtx::CtxTriangleFlag( cu );
-
-  m_BinEncoder.encodeBin( cu.triangle, Ctx::TriangleFlag(flag_idx) );
-#endif
-
-  DTRACE( g_trace_ctx, D_SYNTAX, "triangle_mode() triangle_mode=%d pos=(%d,%d) size: %dx%d\n", cu.triangle, cu.Y().x, cu.Y().y, cu.lumaSize().width, cu.lumaSize().height );
-}
-#endif
 
 //================================================================================
 //  clause 7.3.8.7
@@ -2258,16 +1950,12 @@ void CABACWriter::transform_tree( const CodingStructure& cs, Partitioner& partit
   const unsigned        trDepth       = partitioner.currTrDepth;
   const bool            split         = ( tu.depth > trDepth );
   const bool            chromaCbfISP  = area.blocks[COMPONENT_Cb].valid() && cu.ispMode && !split;
-#if JVET_N0492_NO_HIERARCH_CBF
   bool max_tu_split = false;
-#endif
 
   // split_transform_flag
   if( partitioner.canSplit( TU_MAX_TR_SPLIT, cs ) )
   {
-#if JVET_N0492_NO_HIERARCH_CBF
     max_tu_split = true;
-#endif
     CHECK( !split, "transform split implied" );
   }
   else if( cu.sbtInfo && partitioner.canSplit( PartSplit( cu.getSbtTuSplit() ), cs ) )
@@ -2283,39 +1971,19 @@ void CABACWriter::transform_tree( const CodingStructure& cs, Partitioner& partit
   {
     {
       unsigned cbfDepth = chromaCbfISP ? trDepth - 1 : trDepth;
-#if JVET_N0492_NO_HIERARCH_CBF
       if (!max_tu_split || chromaCbfISP)
-#else
-      if (trDepth == 0 || chromaCbfs.Cb || chromaCbfISP)
-#endif
       {
         chromaCbfs.Cb = TU::getCbfAtDepth( tu, COMPONENT_Cb, trDepth );
         if( !( cu.sbtInfo && trDepth == 1 ) )
         cbf_comp( cs, chromaCbfs.Cb, area.blocks[COMPONENT_Cb], cbfDepth );
       }
-#if !JVET_N0492_NO_HIERARCH_CBF
-      else
-      {
-        CHECK( TU::getCbfAtDepth( tu, COMPONENT_Cb, cbfDepth ) != chromaCbfs.Cb, "incorrect Cb cbf" );
-      }
-#endif
 
-#if JVET_N0492_NO_HIERARCH_CBF
       if (!max_tu_split || chromaCbfISP)
-#else
-      if (trDepth == 0 || chromaCbfs.Cr || chromaCbfISP)
-#endif
       {
         chromaCbfs.Cr = TU::getCbfAtDepth( tu, COMPONENT_Cr, trDepth );
         if( !( cu.sbtInfo && trDepth == 1 ) )
         cbf_comp( cs, chromaCbfs.Cr, area.blocks[COMPONENT_Cr], cbfDepth, chromaCbfs.Cb );
       }
-#if !JVET_N0492_NO_HIERARCH_CBF
-      else
-      {
-        CHECK( TU::getCbfAtDepth( tu, COMPONENT_Cr, cbfDepth ) != chromaCbfs.Cr, "incorrect Cr cbf" );
-      }
-#endif
     }
   }
   else if( CS::isDualITree( cs ) )
@@ -2421,7 +2089,6 @@ void CABACWriter::cbf_comp( const CodingStructure& cs, bool cbf, const CompArea&
 {
   const unsigned  ctxId   = DeriveCtx::CtxQtCbf( area.compID, depth, prevCbCbf, useISP && isLuma(area.compID) );
   const CtxSet&   ctxSet  = Ctx::QtCbf[ area.compID ];
-#if JVET_N0413_RDPCM
   if( area.compID == COMPONENT_Y && cs.getCU( area.pos(), ChannelType( area.compID ) )->bdpcmMode )
   {
     m_BinEncoder.encodeBin( cbf, ctxSet( 4 ) );
@@ -2430,9 +2097,6 @@ void CABACWriter::cbf_comp( const CodingStructure& cs, bool cbf, const CompArea&
   {
   m_BinEncoder.encodeBin( cbf, ctxSet( ctxId ) );
   }
-#else
-  m_BinEncoder.encodeBin( cbf, ctxSet( ctxId ) );
-#endif
   DTRACE( g_trace_ctx, D_SYNTAX, "cbf_comp() etype=%d pos=(%d,%d) ctx=%d cbf=%d\n", area.compID, area.x, area.y, ctxId, cbf );
 }
 
@@ -2619,19 +2283,16 @@ void CABACWriter::cu_chroma_qp_offset( const CodingUnit& cu )
 //    void        residual_coding_subblock( coeffCtx )
 //================================================================================
 
-#if JVET_N0054_JOINT_CHROMA
 void CABACWriter::joint_cb_cr( const TransformUnit& tu )
 {
   m_BinEncoder.encodeBin( tu.jointCbCr ? 1 : 0, Ctx::JointCbCrFlag( 0 ) );
 }
-#endif
 
 void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID )
 {
   const CodingUnit& cu = *tu.cu;
   DTRACE( g_trace_ctx, D_SYNTAX, "residual_coding() etype=%d pos=(%d,%d) size=%dx%d predMode=%d\n", tu.blocks[compID].compID, tu.blocks[compID].x, tu.blocks[compID].y, tu.blocks[compID].width, tu.blocks[compID].height, cu.predMode );
 
-#if JVET_N0054_JOINT_CHROMA
   // Joint Cb-Cr residual mode is signalled if both Cb and Cr cbfs are true
   if ( compID == COMPONENT_Cr && TU::getCbf( tu, COMPONENT_Cb ) )
   {
@@ -2641,25 +2302,17 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID )
     if ( tu.jointCbCr )
       return;
   }
-#endif
 
   // code transform skip and explicit rdpcm mode
   mts_coding         ( tu, compID );
   explicit_rdpcm_mode( tu, compID );
 
-#if JVET_N0280_RESIDUAL_CODING_TS
-#if JVET_N0413_RDPCM
   if( isLuma( compID ) && ( tu.mtsIdx == MTS_SKIP || tu.cu->bdpcmMode ) )
-#else
-  if( isLuma( compID ) && tu.mtsIdx==MTS_SKIP )
-#endif
   {
     residual_codingTS( tu, compID );
     return;
   }
-#endif
 
-#if HEVC_USE_SIGN_HIDING
   // determine sign hiding
   bool signHiding  = ( cu.cs->slice->getSignDataHidingEnabledFlag() && !cu.transQuantBypass && tu.rdpcm[compID] == RDPCM_OFF );
   if(  signHiding && CU::isIntra(cu) && CU::isRDPCMEnabled(cu) && tu.mtsIdx==MTS_SKIP )
@@ -2671,14 +2324,9 @@ void CABACWriter::residual_coding( const TransformUnit& tu, ComponentID compID )
       signHiding = false;
     }
   }
-#endif
 
   // init coeff coding context
-#if HEVC_USE_SIGN_HIDING
   CoeffCodingContext  cctx    ( tu, compID, signHiding );
-#else
-  CoeffCodingContext  cctx    ( tu, compID );
-#endif
   const TCoeff*       coeff   = tu.getCoeffs( compID ).buf;
 
   // determine and set last coeff position and sig group flags
@@ -2770,17 +2418,9 @@ void CABACWriter::mts_coding( const TransformUnit& tu, ComponentID compID )
 void CABACWriter::isp_mode( const CodingUnit& cu )
 {
 #if INCLUDE_ISP_CFG_FLAG
-#if JVET_N0413_RDPCM
   if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm || !cu.cs->sps->getUseISP() || cu.bdpcmMode )
 #else
-  if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm || !cu.cs->sps->getUseISP() )
-#endif
-#else
-#if JVET_N0413_RDPCM
   if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm || cu.bdpcmMode )
-#else
-  if( !CU::isIntra( cu ) || !isLuma( cu.chType ) || cu.firstPU->multiRefIdx || cu.ipcm )
-#endif
 #endif
   {
     CHECK( cu.ispMode != NOT_INTRA_SUBPARTITIONS, "error: cu.intraSubPartitions != 0" );
@@ -2827,14 +2467,9 @@ void CABACWriter::explicit_rdpcm_mode( const TransformUnit& tu, ComponentID comp
   }
 }
 
-#if JVET_N0193_LFNST
 void CABACWriter::residual_lfnst_mode( const CodingUnit& cu, CUCtx& cuCtx )
 {
-#if JVET_N0217_MATRIX_INTRAPRED
   if( cu.ispMode != NOT_INTRA_SUBPARTITIONS || cu.mipFlag == true ||
-#else
-  if( cu.ispMode != NOT_INTRA_SUBPARTITIONS ||
-#endif
     ( CS::isDualITree( *cu.cs ) && cu.chType == CHANNEL_TYPE_CHROMA && std::min( cu.blocks[ 1 ].width, cu.blocks[ 1 ].height ) < 4 ) )
   {
     return;
@@ -2860,57 +2495,26 @@ void CABACWriter::residual_lfnst_mode( const CodingUnit& cu, CUCtx& cuCtx )
     return;
   }
 
-#if !JVET_N0105_LFNST_CTX_MODELLING
-  uint32_t ctxOff = 0;
-
-  int intraMode = cu.firstPU->intraDir[ cu.chType ];
-  if( intraMode == DM_CHROMA_IDX && !isLuma( cu.chType ) )
-  {
-    intraMode = PLANAR_IDX;
-  }
-  if( cu.chromaFormat == CHROMA_422 && !isLuma( cu.chType ) )
-  {
-    intraMode = g_chroma422IntraAngleMappingTable[ intraMode ];
-  }
-  ctxOff = PU::isLMCMode( intraMode ) || intraMode <= DC_IDX;
-#endif
 
   unsigned cctx = 0;
   if( cu.firstTU->mtsIdx < MTS_DST7_DST7 && CS::isDualITree( *cu.cs ) ) cctx++;
 
   const uint32_t idxLFNST = cu.lfnstIdx;
   assert( idxLFNST < 3 );
-#if JVET_N0105_LFNST_CTX_MODELLING
   m_BinEncoder.encodeBin( idxLFNST ? 1 : 0, Ctx::LFNSTIdx( cctx ) );
-#else
-  m_BinEncoder.encodeBin( idxLFNST ? 1 : 0, Ctx::LFNSTIdx( ctxOff + 4 * cctx ) );
-#endif
 
   if( idxLFNST )
   {
-#if JVET_N0105_LFNST_CTX_MODELLING
     m_BinEncoder.encodeBinEP( ( idxLFNST - 1 ) ? 1 : 0 );
-#else
-    m_BinEncoder.encodeBin( ( idxLFNST - 1 ) ? 1 : 0, Ctx::LFNSTIdx( 2 + ctxOff + 4 * cctx ) );
-#endif
   }
 
   DTRACE( g_trace_ctx, D_SYNTAX, "residual_lfnst_mode() etype=%d pos=(%d,%d) mode=%d\n", COMPONENT_Y, cu.lx(), cu.ly(), ( int ) cu.lfnstIdx );
 }
-#endif
 
 void CABACWriter::last_sig_coeff( CoeffCodingContext& cctx, const TransformUnit& tu, ComponentID compID )
 {
   unsigned blkPos = cctx.blockPos( cctx.scanPosLast() );
   unsigned posX, posY;
-#if HEVC_USE_MDCS
-  if( cctx.scanType() == SCAN_VER )
-  {
-    posX  = blkPos / cctx.width();
-    posY  = blkPos - ( posX * cctx.width() );
-  }
-  else
-#endif
   {
     posY  = blkPos / cctx.width();
     posX  = blkPos - ( posY * cctx.width() );
@@ -2991,10 +2595,8 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe
 
   //===== encode absolute values =====
   const int inferSigPos   = nextSigPos != cctx.scanPosLast() ? ( cctx.isNotFirst() ? minSubPos : -1 ) : nextSigPos;
-#if HEVC_USE_SIGN_HIDING
   int       firstNZPos    = nextSigPos;
   int       lastNZPos     = -1;
-#endif
   int       remAbsLevel   = -1;
   int       numNonZero    =  0;
   unsigned  signPattern   =  0;
@@ -3023,10 +2625,8 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe
       uint8_t&  ctxOff  = ctxOffset[ nextSigPos - minSubPos ];
       ctxOff            = cctx.ctxOffsetAbs();
       numNonZero++;
-#if HEVC_USE_SIGN_HIDING
       firstNZPos  = nextSigPos;
       lastNZPos   = std::max<int>( lastNZPos, nextSigPos );
-#endif
       remAbsLevel = abs( Coeff ) - 1;
 
       if( nextSigPos != cctx.scanPosLast() ) signPattern <<= 1;
@@ -3062,22 +2662,14 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe
   unsigned ricePar = 0;
   for( int scanPos = firstSigPos; scanPos > firstPosMode2; scanPos-- )
   {
-#if JVET_N0188_UNIFY_RICEPARA
     int       sumAll = cctx.templateAbsSum(scanPos, coeff, 4);
     ricePar = g_auiGoRiceParsCoeff[sumAll];
-#endif
     unsigned absLevel = abs( coeff[ cctx.blockPos( scanPos ) ] );
     if( absLevel >= 4 )
     {
       unsigned rem      = ( absLevel - 4 ) >> 1;
       m_BinEncoder.encodeRemAbsEP( rem, ricePar, cctx.extPrec(), cctx.maxLog2TrDRange() );
       DTRACE( g_trace_ctx, D_SYNTAX_RESI, "rem_val() bin=%d ctx=%d\n", rem, ricePar );
-#if !JVET_N0188_UNIFY_RICEPARA
-      if( ricePar < 3 && rem > (3<<ricePar)-1 )
-      {
-        ricePar++;
-      }
-#endif
     }
   }
 
@@ -3086,11 +2678,7 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe
   {
     TCoeff    Coeff     = coeff[ cctx.blockPos( scanPos ) ];
     unsigned  absLevel  = abs( Coeff );
-#if JVET_N0188_UNIFY_RICEPARA
     int       sumAll = cctx.templateAbsSum(scanPos, coeff, 0);
-#else
-    int       sumAll    = cctx.templateAbsSum(scanPos, coeff);
-#endif
     int       rice      = g_auiGoRiceParsCoeff                        [sumAll];
     int       pos0      = g_auiGoRicePosCoeff0[std::max(0, state - 1)][sumAll];
     unsigned  rem       = ( absLevel == 0 ? pos0 : absLevel <= pos0 ? absLevel-1 : absLevel );
@@ -3100,16 +2688,13 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe
     if( absLevel )
     {
       numNonZero++;
-#if HEVC_USE_SIGN_HIDING
       lastNZPos   = std::max<int>( lastNZPos, scanPos );
-#endif
       signPattern <<= 1;
       if( Coeff < 0 ) signPattern++;
     }
   }
 
   //===== encode sign's =====
-#if HEVC_USE_SIGN_HIDING
   unsigned numSigns = numNonZero;
   if( cctx.hideSign( firstNZPos, lastNZPos ) )
   {
@@ -3117,22 +2702,14 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe
     signPattern >>= 1;
   }
   m_BinEncoder.encodeBinsEP( signPattern, numSigns );
-#else
-  m_BinEncoder.encodeBinsEP( signPattern, numNonZero );
-#endif
 }
 
-#if JVET_N0280_RESIDUAL_CODING_TS
 void CABACWriter::residual_codingTS( const TransformUnit& tu, ComponentID compID )
 {
   DTRACE( g_trace_ctx, D_SYNTAX, "residual_codingTS() etype=%d pos=(%d,%d) size=%dx%d\n", tu.blocks[compID].compID, tu.blocks[compID].x, tu.blocks[compID].y, tu.blocks[compID].width, tu.blocks[compID].height );
 
   // init coeff coding context
-#if JVET_N0413_RDPCM
   CoeffCodingContext  cctx    ( tu, compID, false, tu.cu->bdpcmMode );
-#else
-  CoeffCodingContext  cctx    ( tu, compID, false );
-#endif
   const TCoeff*       coeff   = tu.getCoeffs( compID ).buf;
 
   cctx.setNumCtxBins( 2 * tu.lwidth()*tu.lheight() );
@@ -3225,11 +2802,7 @@ void CABACWriter::residual_coding_subblockTS( CoeffCodingContext& cctx, const TC
       int sign = Coeff < 0;
       if( cctx.isContextCoded() )
       {
-#if JVET_N0413_RDPCM
         m_BinEncoder.encodeBin( sign, Ctx::TsResidualSign( cctx.bdpcm() ? 1 : 0 ) );
-#else
-        m_BinEncoder.encodeBin( sign, Ctx::TsResidualSign( toChannelType( cctx.compID() ) ) );
-#endif
       }
       else
       {
@@ -3307,7 +2880,6 @@ void CABACWriter::residual_coding_subblockTS( CoeffCodingContext& cctx, const TC
     }
   }
 }
-#endif
 
 
 
@@ -3448,11 +3020,7 @@ void CABACWriter::codeAlfCtuEnableFlags( CodingStructure& cs, ComponentID compID
 
 void CABACWriter::codeAlfCtuEnableFlag( CodingStructure& cs, uint32_t ctuRsAddr, const int compIdx, AlfSliceParam* alfParam)
 {
-#if JVET_N0415_CTB_ALF
   const bool alfComponentEnabled = (alfParam != NULL) ? alfParam->enabledFlag[compIdx] : cs.slice->getTileGroupAlfEnabledFlag((ComponentID)compIdx);
-#else
-  const bool alfComponentEnabled = (alfParam != NULL) ? alfParam->enabledFlag[compIdx] : cs.aps->getAlfAPSParam().enabledFlag[compIdx] ;
-#endif
 
   if( cs.sps->getALFEnabledFlag() && alfComponentEnabled )
   {
@@ -3462,18 +3030,9 @@ void CABACWriter::codeAlfCtuEnableFlag( CodingStructure& cs, uint32_t ctuRsAddr,
     int                 rx = ctuRsAddr - ry * frame_width_in_ctus;
     const Position      pos( rx * cs.pcv->maxCUWidth, ry * cs.pcv->maxCUHeight );
     const uint32_t          curSliceIdx = cs.slice->getIndependentSliceIdx();
-#if JVET_N0857_TILES_BRICKS
     const uint32_t      curTileIdx = cs.picture->brickMap->getBrickIdxRsMap( pos );
-#else
-    const uint32_t          curTileIdx = cs.picture->tileMap->getTileIdxMap( pos );
-#endif
-#if JVET_N0150_ONE_CTU_DELAY_WPP
     bool                leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), pos, curSliceIdx, curTileIdx, CH_L ) ? true : false;
     bool                aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), pos, curSliceIdx, curTileIdx, CH_L ) ? true : false;
-#else
-    bool                leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, curTileIdx, CH_L ) ? true : false;
-    bool                aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false;
-#endif
 
     int leftCTUAddr = leftAvail ? ctuRsAddr - 1 : -1;
     int aboveCTUAddr = aboveAvail ? ctuRsAddr - frame_width_in_ctus : -1;
@@ -3486,7 +3045,6 @@ void CABACWriter::codeAlfCtuEnableFlag( CodingStructure& cs, uint32_t ctuRsAddr,
   }
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 void CABACWriter::code_unary_fixed( unsigned symbol, unsigned ctxId, unsigned unary_max, unsigned fixed )
 {
   bool unary = (symbol <= unary_max);
@@ -3584,9 +3142,7 @@ void CABACWriter::mip_pred_mode( const PredictionUnit& pu )
 
   DTRACE( g_trace_ctx, D_SYNTAX, "mip_pred_mode() pos=(%d,%d) mode=%d\n", pu.lumaPos().x, pu.lumaPos().y, pu.intraDir[CHANNEL_TYPE_LUMA] );
 }
-#endif
 
-#if JVET_N0415_CTB_ALF
 void CABACWriter::codeAlfCtuFilterIndex(CodingStructure& cs, uint32_t ctuRsAddr, bool alfEnableLuma)
 {
   if ( (!cs.sps->getALFEnabledFlag()) || (!alfEnableLuma))
@@ -3639,6 +3195,5 @@ void CABACWriter::codeAlfCtuFilterIndex(CodingStructure& cs, uint32_t ctuRsAddr,
     xWriteTruncBinCode(filterSetIdx, NUM_FIXED_FILTER_SETS);
   }
 }
-#endif
 
 //! \}
diff --git a/source/Lib/EncoderLib/CABACWriter.h b/source/Lib/EncoderLib/CABACWriter.h
index f6198b625..f67bb0e65 100644
--- a/source/Lib/EncoderLib/CABACWriter.h
+++ b/source/Lib/EncoderLib/CABACWriter.h
@@ -89,9 +89,7 @@ public:
   void        cu_transquant_bypass_flag ( const CodingUnit&             cu );
   void        cu_skip_flag              ( const CodingUnit&             cu );
   void        pred_mode                 ( const CodingUnit&             cu );
-#if JVET_N0413_RDPCM
   void        bdpcm_mode                ( const CodingUnit&             cu,       const ComponentID compID );
-#endif
   void        pcm_data                  ( const CodingUnit&             cu,       Partitioner&      pm );
   void        pcm_flag                  ( const CodingUnit&             cu,       Partitioner&      pm );
   void        cu_pred_data              ( const CodingUnit&             cu );
@@ -107,11 +105,9 @@ public:
   void        rqt_root_cbf              ( const CodingUnit&             cu );
   void        sbt_mode                  ( const CodingUnit&             cu );
   void        end_of_ctu                ( const CodingUnit&             cu,       CUCtx&            cuCtx );
-#if JVET_N0217_MATRIX_INTRAPRED
   void        mip_flag                  ( const CodingUnit&             cu );
   void        mip_pred_modes            ( const CodingUnit&             cu );
   void        mip_pred_mode             ( const PredictionUnit&         pu );
-#endif
 
   // prediction unit (clause 7.3.8.6)
   void        prediction_unit           ( const PredictionUnit&         pu );
@@ -128,9 +124,6 @@ public:
 
   void        MHIntra_flag              ( const PredictionUnit&         pu );
   void        MHIntra_luma_pred_modes   ( const CodingUnit&             cu );
-#if !JVET_N0324_REGULAR_MRG_FLAG
-  void        triangle_mode             ( const CodingUnit&             cu );
-#endif
   void        smvd_mode              ( const PredictionUnit&         pu );
 
   // pcm samples (clause 7.3.8.7)
@@ -150,20 +143,14 @@ public:
   // residual coding (clause 7.3.8.11)
   void        residual_coding           ( const TransformUnit&          tu,       ComponentID       compID );
   void        mts_coding                ( const TransformUnit&          tu,       ComponentID       compID );
-#if JVET_N0193_LFNST
   void        residual_lfnst_mode       ( const CodingUnit&             cu,       CUCtx&            cuCtx );
-#endif
   void        isp_mode                  ( const CodingUnit&             cu );
   void        explicit_rdpcm_mode       ( const TransformUnit&          tu,       ComponentID       compID );
   void        last_sig_coeff            ( CoeffCodingContext&           cctx,     const TransformUnit& tu, ComponentID       compID );
   void        residual_coding_subblock  ( CoeffCodingContext&           cctx,     const TCoeff*     coeff, const int stateTransTable, int& state );
-#if JVET_N0280_RESIDUAL_CODING_TS
   void        residual_codingTS         ( const TransformUnit&          tu,       ComponentID       compID );
   void        residual_coding_subblockTS( CoeffCodingContext&           cctx,     const TCoeff*     coeff  );
-#endif
-#if JVET_N0054_JOINT_CHROMA
   void        joint_cb_cr               ( const TransformUnit&          tu );
-#endif
 
   // cross component prediction (clause 7.3.8.12)
   void        cross_comp_pred           ( const TransformUnit&          tu,       ComponentID       compID );
@@ -171,17 +158,13 @@ public:
   void        codeAlfCtuEnableFlags     ( CodingStructure& cs, ChannelType channel, AlfSliceParam* alfParam);
   void        codeAlfCtuEnableFlags     ( CodingStructure& cs, ComponentID compID, AlfSliceParam* alfParam);
   void        codeAlfCtuEnableFlag      ( CodingStructure& cs, uint32_t ctuRsAddr, const int compIdx, AlfSliceParam* alfParam );
-#if JVET_N0415_CTB_ALF
   void        codeAlfCtuFilterIndex(CodingStructure& cs, uint32_t ctuRsAddr, bool alfEnableLuma);
-#endif
 
 private:
   void        unary_max_symbol          ( unsigned symbol, unsigned ctxId0, unsigned ctxIdN, unsigned maxSymbol );
   void        unary_max_eqprob          ( unsigned symbol,                                   unsigned maxSymbol );
   void        exp_golomb_eqprob         ( unsigned symbol, unsigned count );
-#if JVET_N0217_MATRIX_INTRAPRED
   void        code_unary_fixed          ( unsigned symbol, unsigned ctxId, unsigned unary_max, unsigned fixed );
-#endif
 
   // statistic
   unsigned    get_num_written_bits()    { return m_BinEncoder.getNumWrittenBits(); }
diff --git a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
index 495cba98a..8003002a5 100644
--- a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
+++ b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
@@ -39,14 +39,9 @@
 #include "CommonLib/Picture.h"
 #include "CommonLib/CodingStructure.h"
 
-#if JVET_N0415_CTB_ALF
 #define AlfCtx(c) SubCtx( Ctx::Alf, c)
-#else
-#define AlfCtx(c) SubCtx( Ctx::ctbAlfFlag, c )
-#endif
 std::vector<double> EncAdaptiveLoopFilter::m_lumaLevelToWeightPLUT;
 
-#if JVET_N0242_NON_LINEAR_ALF
 void AlfCovariance::getClipMax(const AlfFilterShape& alfShape, int *clip_max) const
 {
   for( int k = 0; k < numCoeff-1; ++k )
@@ -405,7 +400,6 @@ int AlfCovariance::gnsSolveByChol( TE LHS, double* rhs, double *x, int numEq ) c
 }
 //////////////////////////////////////////////////////////////////////////////////////////
 
-#endif
 EncAdaptiveLoopFilter::EncAdaptiveLoopFilter()
   : m_CABACEstimator( nullptr )
 {
@@ -417,29 +411,18 @@ EncAdaptiveLoopFilter::EncAdaptiveLoopFilter()
   {
     m_alfCovarianceFrame[i] = nullptr;
   }
-#if !JVET_N0242_NON_LINEAR_ALF
-  m_filterCoeffQuant = nullptr;
-#endif
   m_filterCoeffSet = nullptr;
-#if JVET_N0242_NON_LINEAR_ALF
   m_filterClippSet = nullptr;
-#endif
   m_diffFilterCoeff = nullptr;
 
   m_alfWSSD = 0;
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 void EncAdaptiveLoopFilter::create( const EncCfg* encCfg, const int picWidth, const int picHeight, const ChromaFormat chromaFormatIDC, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE], const int internalBitDepth[MAX_NUM_CHANNEL_TYPE] )
-#else
-void EncAdaptiveLoopFilter::create( const int picWidth, const int picHeight, const ChromaFormat chromaFormatIDC, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE], const int internalBitDepth[MAX_NUM_CHANNEL_TYPE] )
-#endif
 {
   AdaptiveLoopFilter::create( picWidth, picHeight, chromaFormatIDC, maxCUWidth, maxCUHeight, maxCUDepth, inputBitDepth );
-#if JVET_N0242_NON_LINEAR_ALF
   CHECK( encCfg == nullptr, "encCfg must not be null" );
   m_encCfg = encCfg;
-#endif
 
   for( int channelIdx = 0; channelIdx < MAX_NUM_CHANNEL_TYPE; channelIdx++ )
   {
@@ -480,35 +463,23 @@ void EncAdaptiveLoopFilter::create( const int picWidth, const int picHeight, con
 
   for( int i = 0; i != m_filterShapes[COMPONENT_Y].size(); i++ )
   {
-#if JVET_N0415_CTB_ALF
     for (int j = 0; j <= MAX_NUM_ALF_CLASSES + 1; j++)
-#else
-    for( int j = 0; j <= MAX_NUM_ALF_CLASSES; j++ )
-#endif
     {
       m_alfCovarianceMerged[i][j].create( m_filterShapes[COMPONENT_Y][i].numCoeff );
     }
   }
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  m_filterCoeffQuant = new int[MAX_NUM_ALF_LUMA_COEFF];
-#endif
   m_filterCoeffSet = new int*[MAX_NUM_ALF_CLASSES];
-#if JVET_N0242_NON_LINEAR_ALF
   m_filterClippSet = new int*[MAX_NUM_ALF_CLASSES];
-#endif
   m_diffFilterCoeff = new int*[MAX_NUM_ALF_CLASSES];
 
   for( int i = 0; i < MAX_NUM_ALF_CLASSES; i++ )
   {
     m_filterCoeffSet[i] = new int[MAX_NUM_ALF_LUMA_COEFF];
-#if JVET_N0242_NON_LINEAR_ALF
     m_filterClippSet[i] = new int[MAX_NUM_ALF_LUMA_COEFF];
-#endif
     m_diffFilterCoeff[i] = new int[MAX_NUM_ALF_LUMA_COEFF];
   }
 
-#if JVET_N0415_CTB_ALF
   m_apsIdStart = (int)MAX_NUM_APS;
   m_ctbDistortionFixedFilter = new double[m_numCTUsInPic];
   for (int comp = 0; comp < MAX_NUM_COMPONENT; comp++)
@@ -517,17 +488,14 @@ void EncAdaptiveLoopFilter::create( const int picWidth, const int picHeight, con
   }
   m_alfCtbFilterSetIndexTmp.resize(m_numCTUsInPic);
   memset(m_clipDefaultEnc, 0, sizeof(m_clipDefaultEnc));
-#endif
 }
 
 void EncAdaptiveLoopFilter::destroy()
 {
-#if JVET_N0415_CTB_ALF
   if (!m_created)
   {
     return;
   }
-#endif
   for( int channelIdx = 0; channelIdx < MAX_NUM_CHANNEL_TYPE; channelIdx++ )
   {
     if( m_alfCovarianceFrame[channelIdx] )
@@ -584,11 +552,7 @@ void EncAdaptiveLoopFilter::destroy()
 
   for( int i = 0; i != m_filterShapes[COMPONENT_Y].size(); i++ )
   {
-#if JVET_N0415_CTB_ALF
     for (int j = 0; j <= MAX_NUM_ALF_CLASSES + 1; j++)
-#else
-    for( int j = 0; j <= MAX_NUM_ALF_CLASSES; j++ )
-#endif
     {
       m_alfCovarianceMerged[i][j].destroy();
     }
@@ -605,7 +569,6 @@ void EncAdaptiveLoopFilter::destroy()
     m_filterCoeffSet = nullptr;
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   if( m_filterClippSet )
   {
     for( int i = 0; i < MAX_NUM_ALF_CLASSES; i++ )
@@ -617,7 +580,6 @@ void EncAdaptiveLoopFilter::destroy()
     m_filterClippSet = nullptr;
   }
 
-#endif
   if( m_diffFilterCoeff )
   {
     for( int i = 0; i < MAX_NUM_ALF_CLASSES; i++ )
@@ -629,12 +591,7 @@ void EncAdaptiveLoopFilter::destroy()
     m_diffFilterCoeff = nullptr;
   }
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  delete[] m_filterCoeffQuant;
-  m_filterCoeffQuant = nullptr;
-#endif
 
-#if JVET_N0415_CTB_ALF
   delete[] m_ctbDistortionFixedFilter;
   m_ctbDistortionFixedFilter = nullptr;
   for (int comp = 0; comp < MAX_NUM_COMPONENT; comp++)
@@ -642,43 +599,26 @@ void EncAdaptiveLoopFilter::destroy()
     delete[] m_ctbDistortionUnfilter[comp];
     m_ctbDistortionUnfilter[comp] = nullptr;
   }
-#endif
   AdaptiveLoopFilter::destroy();
 }
-#if JVET_N0415_CTB_ALF
 void EncAdaptiveLoopFilter::initCABACEstimator( CABACEncoder* cabacEncoder, CtxCache* ctxCache, Slice* pcSlice
 , ParameterSetMap<APS>* apsMap )
-#else
-void EncAdaptiveLoopFilter::initCABACEstimator( CABACEncoder* cabacEncoder, CtxCache* ctxCache, Slice* pcSlice )
-#endif
 {
-#if JVET_N0415_CTB_ALF
   m_apsMap = apsMap;
-#endif
   m_CABACEstimator = cabacEncoder->getCABACEstimator( pcSlice->getSPS() );
   m_CtxCache = ctxCache;
   m_CABACEstimator->initCtxModels( *pcSlice );
   m_CABACEstimator->resetBits();
 }
 
-#if JVET_N0415_CTB_ALF
 void EncAdaptiveLoopFilter::ALFProcess(CodingStructure& cs, const double *lambdas
 #if ENABLE_QPA
                                        , const double lambdaChromaWeight
 #endif
                                       )
-#else
-void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambdas,
-#if ENABLE_QPA
-                                        const double lambdaChromaWeight,
-#endif
-                                        AlfSliceParam& alfSliceParam )
-#endif
 {
-#if JVET_N0415_CTB_ALF
   if (cs.slice->getPendingRasInit() || cs.slice->isIDRorBLA())
   {
-#if JVET_N0805_APS_LMCS
     memset(cs.slice->getAlfAPSs(), 0, sizeof(*cs.slice->getAlfAPSs())*MAX_NUM_APS);
     m_apsIdStart = (int)MAX_NUM_APS;
     m_apsMap->clear();
@@ -689,15 +629,10 @@ void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambd
       if (alfAPS)
         alfAPS = nullptr;
     }
-#else
-    memset(cs.slice->getAPSs(), 0, sizeof(*cs.slice->getAPSs())*MAX_NUM_APS);
-    m_apsMap->clearMap();
-#endif
   }
   AlfSliceParam alfSliceParam;
   alfSliceParam.reset();
   const TempCtx  ctxStart(m_CtxCache, AlfCtx(m_CABACEstimator->getCtx()));
-#endif
   // set available filter shapes
   alfSliceParam.filterShapes = m_filterShapes;
 
@@ -726,7 +661,6 @@ void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambd
 
   // derive classification
   const CPelBuf& recLuma = recYuv.get( COMPONENT_Y );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   const PreCalcValues& pcv = *cs.pcv;
   bool clipTop = false, clipBottom = false, clipLeft = false, clipRight = false;
   int numHorVirBndry = 0, numVerVirBndry = 0;
@@ -785,19 +719,9 @@ void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambd
       }
     }
   }
-#else
-  Area blk( 0, 0, recLuma.width, recLuma.height );
-  deriveClassification( m_classifier, recLuma, blk );
-  Area blkPCM(0, 0, recLuma.width, recLuma.height);
-  resetPCMBlkClassInfo(cs, m_classifier, recLuma, blkPCM);
-#endif
 
   // get CTB stats for filtering
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   deriveStatsForFiltering( orgYuv, recYuv, cs );
-#else
-  deriveStatsForFiltering( orgYuv, recYuv );
-#endif
 
   // derive filter (luma)
   alfEncoder( cs, alfSliceParam, orgYuv, recYuv, cs.getRecoBuf(), CHANNEL_TYPE_LUMA
@@ -807,9 +731,6 @@ void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambd
             );
 
   // derive filter (chroma)
-#if !JVET_N0415_CTB_ALF
-  if ( alfSliceParam.enabledFlag[COMPONENT_Y] )
-#endif
   {
     alfEncoder( cs, alfSliceParam, orgYuv, recYuv, cs.getRecoBuf(), CHANNEL_TYPE_CHROMA
 #if ENABLE_QPA
@@ -818,7 +739,6 @@ void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambd
               );
   }
 
-#if JVET_N0415_CTB_ALF
   m_CABACEstimator->getCtx() = AlfCtx(ctxStart);
   alfEncoderCtb(cs, alfSliceParam
 #if ENABLE_QPA
@@ -827,7 +747,6 @@ void EncAdaptiveLoopFilter::ALFProcess( CodingStructure& cs, const double *lambd
   );
 
   alfReconstructor(cs, recYuv);
-#endif
 }
 
 double EncAdaptiveLoopFilter::deriveCtbAlfEnableFlags( CodingStructure& cs, const int iShapeIdx, ChannelType channel,
@@ -849,19 +768,15 @@ double EncAdaptiveLoopFilter::deriveCtbAlfEnableFlags( CodingStructure& cs, cons
   CHECK ((chromaWeight > 0.0) && (cs.slice->getSliceCurStartCtuTsAddr() != 0), "incompatible start CTU address, must be 0");
 #endif
 
-#if JVET_N0415_CTB_ALF
   reconstructCoeff(m_alfSliceParamTemp, channel, true, isLuma(channel));
   for (int classIdx = 0; classIdx < (isLuma(channel) ? MAX_NUM_ALF_CLASSES : 1); classIdx++)
   {
     for (int i = 0; i < (isLuma(channel) ? MAX_NUM_ALF_LUMA_COEFF : MAX_NUM_ALF_CHROMA_COEFF); i++)
     {
       m_filterCoeffSet[classIdx][i] = isLuma(channel) ? m_coeffFinal[classIdx* MAX_NUM_ALF_LUMA_COEFF + i] : m_chromaCoeffFinal[i];
-#if JVET_N0242_NON_LINEAR_ALF
       m_filterClippSet[classIdx][i] = isLuma(channel) ? m_clippFinal[classIdx* MAX_NUM_ALF_LUMA_COEFF + i] : m_chromaClippFinal[i];
-#endif
     }
   }
-#endif
 
   for( int ctuIdx = 0; ctuIdx < m_numCTUsInPic; ctuIdx++ )
   {
@@ -925,12 +840,7 @@ void EncAdaptiveLoopFilter::alfEncoder( CodingStructure& cs, AlfSliceParam& alfS
   double costMin = MAX_DOUBLE;
 
   std::vector<AlfFilterShape>& alfFilterShape = alfSliceParam.filterShapes[channel];
-#if JVET_N0415_CTB_ALF
   m_bitsNewFilter[channel] = 0;
-#else
-  const ComponentID compIDFirst = isLuma( channel ) ? COMPONENT_Y : COMPONENT_Cb;
-  const ComponentID compIDLast = isLuma( channel ) ? COMPONENT_Y : COMPONENT_Cr;
-#endif
   const int numClasses = isLuma( channel ) ? MAX_NUM_ALF_CLASSES : 1;
   int uiCoeffBits = 0;
 
@@ -950,32 +860,22 @@ void EncAdaptiveLoopFilter::alfEncoder( CodingStructure& cs, AlfSliceParam& alfS
       setCtuEnableFlag( m_ctuEnableFlagTmp, channel, 0 );
     }
 
-#if JVET_N0242_NON_LINEAR_ALF
     const int nonLinearFlagMax =
       ( isLuma( channel ) ? m_encCfg->getUseNonLinearAlfLuma() : m_encCfg->getUseNonLinearAlfChroma() )
       ? 2 : 1;
 
     for( int nonLinearFlag = 0; nonLinearFlag < nonLinearFlagMax; nonLinearFlag++ )
     {
-#endif
     //2. all CTUs are on
     setEnableFlag( m_alfSliceParamTemp, channel, true );
-#if JVET_N0242_NON_LINEAR_ALF
     m_alfSliceParamTemp.nonLinearFlag[channel] = nonLinearFlag;
-#endif
     m_CABACEstimator->getCtx() = AlfCtx( ctxStart );
     setCtuEnableFlag( m_ctuEnableFlag, channel, 1 );
-#if JVET_N0242_NON_LINEAR_ALF
     cost = getFilterCoeffAndCost( cs, 0, channel, nonLinearFlag != 0, iShapeIdx, uiCoeffBits );
-#else
-    cost = getFilterCoeffAndCost( cs, 0, channel, false, iShapeIdx, uiCoeffBits );
-#endif
 
     if( cost < costMin )
     {
-#if JVET_N0415_CTB_ALF
       m_bitsNewFilter[channel] = uiCoeffBits;
-#endif
       costMin = cost;
       copyAlfSliceParam( alfSliceParam, m_alfSliceParamTemp, channel );
       ctxBest = AlfCtx( m_CABACEstimator->getCtx() );
@@ -999,9 +899,7 @@ void EncAdaptiveLoopFilter::alfEncoder( CodingStructure& cs, AlfSliceParam& alfS
                                         numClasses, alfFilterShape[iShapeIdx].numCoeff, distUnfilter );
         if (cost < costMin)
         {
-#if JVET_N0415_CTB_ALF
           m_bitsNewFilter[channel] = uiCoeffBits;
-#endif
           costMin = cost;
           ctxBest = AlfCtx(m_CABACEstimator->getCtx());
           copyCtuEnableFlag(m_ctuEnableFlagTmp, m_ctuEnableFlag, channel);
@@ -1014,238 +912,9 @@ void EncAdaptiveLoopFilter::alfEncoder( CodingStructure& cs, AlfSliceParam& alfS
         cost = getFilterCoeffAndCost(cs, distUnfilter, channel, true, iShapeIdx, uiCoeffBits);
       }
     }//for iter
-#if JVET_N0242_NON_LINEAR_ALF
     }// for nonLineaFlag
-#endif
   }//for shapeIdx
   m_CABACEstimator->getCtx() = AlfCtx( ctxBest );
-#if !JVET_N0415_CTB_ALF
-  copyCtuEnableFlag( m_ctuEnableFlag, m_ctuEnableFlagTmp, channel );
-
-  //filtering
-  reconstructCoeff( alfSliceParam, channel, isLuma( channel ) );
-
-  for( int compIdx = compIDFirst; compIdx <= compIDLast; compIdx++ )
-  {
-    ComponentID compID = (ComponentID)compIdx;
-    if( alfSliceParam.enabledFlag[compID] )
-    {
-      const PreCalcValues& pcv = *cs.pcv;
-      int ctuIdx = 0;
-      const int chromaScaleX = getComponentScaleX( compID, recBuf.chromaFormat );
-      const int chromaScaleY = getComponentScaleY( compID, recBuf.chromaFormat );
-      AlfFilterType filterType = isLuma( compID ) ? ALF_FILTER_7 : ALF_FILTER_5;
-      short* coeff = isLuma( compID ) ? m_coeffFinal : alfSliceParam.chromaCoeff;
-#if JVET_N0242_NON_LINEAR_ALF
-      short* clipp = isLuma( compID ) ? m_clippFinal : m_chromaClippFinal; //alfSliceParam.chromaClipp;
-#endif
-
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-      bool clipTop = false, clipBottom = false, clipLeft = false, clipRight = false;
-      int numHorVirBndry = 0, numVerVirBndry = 0;
-      int horVirBndryPos[] = { 0, 0, 0 };
-      int verVirBndryPos[] = { 0, 0, 0 };
-#endif
-      for( int yPos = 0; yPos < pcv.lumaHeight; yPos += pcv.maxCUHeight )
-      {
-        for( int xPos = 0; xPos < pcv.lumaWidth; xPos += pcv.maxCUWidth )
-        {
-          const int width = ( xPos + pcv.maxCUWidth > pcv.lumaWidth ) ? ( pcv.lumaWidth - xPos ) : pcv.maxCUWidth;
-          const int height = ( yPos + pcv.maxCUHeight > pcv.lumaHeight ) ? ( pcv.lumaHeight - yPos ) : pcv.maxCUHeight;
-          Area blk( xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY );
-
-          if( m_ctuEnableFlag[compID][ctuIdx] )
-          {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-            if( isCrossedByVirtualBoundaries( xPos, yPos, width, height, clipTop, clipBottom, clipLeft, clipRight, numHorVirBndry, numVerVirBndry, horVirBndryPos, verVirBndryPos, cs.slice->getPPS() ) )
-            {
-              int yStart = yPos;
-              for( int i = 0; i <= numHorVirBndry; i++ )
-              {
-                const int yEnd = i == numHorVirBndry ? yPos + height : horVirBndryPos[i];
-                const int h = yEnd - yStart;
-                const bool clipT = ( i == 0 && clipTop ) || ( i > 0 ) || ( yStart == 0 );
-                const bool clipB = ( i == numHorVirBndry && clipBottom ) || ( i < numHorVirBndry ) || ( yEnd == pcv.lumaHeight );
-
-                int xStart = xPos;
-                for( int j = 0; j <= numVerVirBndry; j++ )
-                {
-                  const int xEnd = j == numVerVirBndry ? xPos + width : verVirBndryPos[j];
-                  const int w = xEnd - xStart;
-                  const bool clipL = ( j == 0 && clipLeft ) || ( j > 0 ) || ( xStart == 0 );
-                  const bool clipR = ( j == numVerVirBndry && clipRight ) || ( j < numVerVirBndry ) || ( xEnd == pcv.lumaWidth );
-
-                  const int wBuf = w + (clipL ? 0 : MAX_ALF_PADDING_SIZE) + (clipR ? 0 : MAX_ALF_PADDING_SIZE);
-                  const int hBuf = h + (clipT ? 0 : MAX_ALF_PADDING_SIZE) + (clipB ? 0 : MAX_ALF_PADDING_SIZE);
-                  PelUnitBuf buf = m_tempBuf2.subBuf( UnitArea( cs.area.chromaFormat, Area( 0, 0, wBuf, hBuf ) ) );
-                  buf.copyFrom( recExtBuf.subBuf( UnitArea( cs.area.chromaFormat, Area( xStart - (clipL ? 0 : MAX_ALF_PADDING_SIZE), yStart - (clipT ? 0 : MAX_ALF_PADDING_SIZE), wBuf, hBuf ) ) ) );
-                  buf.extendBorderPel( MAX_ALF_PADDING_SIZE );
-                  buf = buf.subBuf( UnitArea ( cs.area.chromaFormat, Area( clipL ? 0 : MAX_ALF_PADDING_SIZE, clipT ? 0 : MAX_ALF_PADDING_SIZE, w, h ) ) );
-
-                  const Area blkSrc( 0, 0, w >> chromaScaleX, h >> chromaScaleY );
-                  const Area blkDst( xStart >> chromaScaleX, yStart >> chromaScaleY, w >> chromaScaleX, h >> chromaScaleY );
-                  if( filterType == ALF_FILTER_5 )
-                  {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-                    m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs
-                      , m_alfVBChmaCTUHeight
-                      , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-                    );
-#else
-                    m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, m_clpRngs.comp[compIdx], cs
-                      , m_alfVBChmaCTUHeight
-                      , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-                    );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-                    m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs);
-#else
-                    m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-                  }
-                  else if( filterType == ALF_FILTER_7 )
-                  {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-                    m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs
-                      , m_alfVBLumaCTUHeight
-                      , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-                    );
-#else
-                    m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, m_clpRngs.comp[compIdx], cs
-                      , m_alfVBLumaCTUHeight
-                      , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-                    );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-                    m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs);
-#else
-                    m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, coeff, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-                  }
-                  else
-                  {
-                    CHECK( 0, "Wrong ALF filter type" );
-                  }
-
-                  xStart = xEnd;
-                }
-
-                yStart = yEnd;
-              }
-            }
-            else
-            {
-#endif
-            if( filterType == ALF_FILTER_5 )
-            {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs
-                , m_alfVBChmaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-              );
-#else
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs
-                , m_alfVBChmaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-              );
-#endif			  
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, m_clpRngs.comp[compIdx], cs
-                , m_alfVBChmaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-              );
-#else
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, m_clpRngs.comp[compIdx], cs
-                , m_alfVBChmaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-              );
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs);
-#else
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, m_clpRngs.comp[compIdx], cs);
-#else
-              m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-#endif
-
-            }
-            else if( filterType == ALF_FILTER_7 )
-            {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-              );
-#else
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight+4 : m_alfVBLumaPos)
-              );
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, m_clpRngs.comp[compIdx], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-              );
-#else
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, m_clpRngs.comp[compIdx], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight+4 : m_alfVBLumaPos)
-              );
-#endif
-#endif
-#else
-
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs);
-#else
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, clipp, m_clpRngs.comp[compIdx], cs);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, coeff, m_clpRngs.comp[compIdx], cs);
-#else
-              m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, compID, coeff, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-#endif
-           }
-            else
-            {
-              CHECK( 0, "Wrong ALF filter type" );
-            }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-            }
-#endif
-          }
-          ctuIdx++;
-        }
-      }
-    }
-  }
-#endif
 }
 
 void EncAdaptiveLoopFilter::copyAlfSliceParam( AlfSliceParam& alfSliceParamDst, AlfSliceParam& alfSliceParamSrc, ChannelType channel )
@@ -1256,22 +925,14 @@ void EncAdaptiveLoopFilter::copyAlfSliceParam( AlfSliceParam& alfSliceParamDst,
   }
   else
   {
-#if JVET_N0242_NON_LINEAR_ALF
     alfSliceParamDst.nonLinearFlag[channel] = alfSliceParamSrc.nonLinearFlag[channel];
-#endif
     alfSliceParamDst.enabledFlag[COMPONENT_Cb] = alfSliceParamSrc.enabledFlag[COMPONENT_Cb];
     alfSliceParamDst.enabledFlag[COMPONENT_Cr] = alfSliceParamSrc.enabledFlag[COMPONENT_Cr];
     memcpy( alfSliceParamDst.chromaCoeff, alfSliceParamSrc.chromaCoeff, sizeof( alfSliceParamDst.chromaCoeff ) );
-#if JVET_N0242_NON_LINEAR_ALF
     memcpy( alfSliceParamDst.chromaClipp, alfSliceParamSrc.chromaClipp, sizeof( alfSliceParamDst.chromaClipp ) );
-#endif
   }
 }
-#if JVET_N0415_CTB_ALF
 double EncAdaptiveLoopFilter::getFilterCoeffAndCost( CodingStructure& cs, double distUnfilter, ChannelType channel, bool bReCollectStat, int iShapeIdx, int& uiCoeffBits, bool onlyFilterCost )
-#else
-double EncAdaptiveLoopFilter::getFilterCoeffAndCost( CodingStructure& cs, double distUnfilter, ChannelType channel, bool bReCollectStat, int iShapeIdx, int& uiCoeffBits )
-#endif
 {
   //collect stat based on CTU decision
   if( bReCollectStat )
@@ -1286,50 +947,33 @@ double EncAdaptiveLoopFilter::getFilterCoeffAndCost( CodingStructure& cs, double
   //get filter coeff
   if( isLuma( channel ) )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     std::fill_n(m_alfClipMerged[iShapeIdx][0][0], MAX_NUM_ALF_LUMA_COEFF*MAX_NUM_ALF_CLASSES*MAX_NUM_ALF_CLASSES, m_alfSliceParamTemp.nonLinearFlag[channel] ? AlfNumClippingValues[CHANNEL_TYPE_LUMA] / 2 : 0);
     // Reset Merge Tmp Cov
     m_alfCovarianceMerged[iShapeIdx][MAX_NUM_ALF_CLASSES].reset(AlfNumClippingValues[channel]);
-#if JVET_N0415_CTB_ALF
     m_alfCovarianceMerged[iShapeIdx][MAX_NUM_ALF_CLASSES + 1].reset(AlfNumClippingValues[channel]);
-#endif
     //distortion
     dist += mergeFiltersAndCost( m_alfSliceParamTemp, alfFilterShape, m_alfCovarianceFrame[channel][iShapeIdx], m_alfCovarianceMerged[iShapeIdx], m_alfClipMerged[iShapeIdx], uiCoeffBits );
-#else
-    dist += mergeFiltersAndCost( m_alfSliceParamTemp, alfFilterShape, m_alfCovarianceFrame[channel][iShapeIdx], m_alfCovarianceMerged[iShapeIdx], uiCoeffBits );
-#endif
   }
   else
   {
     //distortion
-#if JVET_N0242_NON_LINEAR_ALF
     assert(alfFilterShape.numCoeff == m_alfCovarianceFrame[channel][iShapeIdx][0].numCoeff);
     std::fill_n(m_filterClippSet[0], MAX_NUM_ALF_CHROMA_COEFF, m_alfSliceParamTemp.nonLinearFlag[channel] ? AlfNumClippingValues[CHANNEL_TYPE_CHROMA] / 2 : 0);
     dist += m_alfCovarianceFrame[channel][iShapeIdx][0].pixAcc + deriveCoeffQuant( m_filterClippSet[0], m_filterCoeffSet[0], m_alfCovarianceFrame[channel][iShapeIdx][0], alfFilterShape, m_NUM_BITS, m_alfSliceParamTemp.nonLinearFlag[channel] );
-#else
-    dist += m_alfCovarianceFrame[channel][iShapeIdx][0].pixAcc + deriveCoeffQuant( m_filterCoeffQuant, m_alfCovarianceFrame[channel][iShapeIdx][0].E, m_alfCovarianceFrame[channel][iShapeIdx][0].y, alfFilterShape.numCoeff, alfFilterShape.weights, m_NUM_BITS, true );
-    memcpy( m_filterCoeffSet[0], m_filterCoeffQuant, sizeof( *m_filterCoeffQuant ) * alfFilterShape.numCoeff );
-#endif
     //setEnableFlag( m_alfSliceParamTemp, channel, m_ctuEnableFlag );
     const int alfChromaIdc = m_alfSliceParamTemp.enabledFlag[COMPONENT_Cb] * 2 + m_alfSliceParamTemp.enabledFlag[COMPONENT_Cr];
     for( int i = 0; i < MAX_NUM_ALF_CHROMA_COEFF; i++ )
     {
-#if JVET_N0242_NON_LINEAR_ALF
       m_alfSliceParamTemp.chromaCoeff[i] = m_filterCoeffSet[0][i];
       m_alfSliceParamTemp.chromaClipp[i] = m_filterClippSet[0][i];
-#else
-      m_alfSliceParamTemp.chromaCoeff[i] = m_filterCoeffQuant[i];
-#endif
     }
     uiCoeffBits += getCoeffRate( m_alfSliceParamTemp, true );
     uiSliceFlag = lengthTruncatedUnary(alfChromaIdc, 3);
   }
-#if JVET_N0415_CTB_ALF
   if (onlyFilterCost)
   {
     return dist + m_lambda[channel] * uiCoeffBits;
   }
-#endif
   double rate = uiCoeffBits + uiSliceFlag;
   m_CABACEstimator->resetBits();
   m_CABACEstimator->codeAlfCtuEnableFlags( cs, channel, &m_alfSliceParamTemp);
@@ -1340,30 +984,11 @@ double EncAdaptiveLoopFilter::getFilterCoeffAndCost( CodingStructure& cs, double
 int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isChroma )
 {
   int iBits = 0;
-#if JVET_N0242_NON_LINEAR_ALF
   assert( isChroma );
-#else
-  if( !isChroma )
-  {
-    iBits++;                                               // alf_coefficients_delta_flag
-    if( !alfSliceParam.alfLumaCoeffDeltaFlag )
-    {
-      if( alfSliceParam.numLumaFilters > 1 )
-      {
-        iBits++;                                           // coeff_delta_pred_mode_flag
-      }
-    }
-  }
-#endif
 
   memset( m_bitsCoeffScan, 0, sizeof( m_bitsCoeffScan ) );
-#if JVET_N0242_NON_LINEAR_ALF
   AlfFilterShape alfShape( 5 );
-#else
-  AlfFilterShape alfShape( isChroma ? 5 : 7 );
-#endif
   const int maxGolombIdx = AdaptiveLoopFilter::getMaxGolombIdx( alfShape.filterType );
-#if JVET_N0242_NON_LINEAR_ALF
   const int numFilters = 1;
 
   // vlc for all
@@ -1376,27 +1001,6 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
       m_bitsCoeffScan[alfShape.golombIdx[i]][k] += lengthGolomb( coeffVal, k );
     }
   }
-#else
-  const short* coeff = isChroma ? alfSliceParam.chromaCoeff : alfSliceParam.lumaCoeff;
-  const int numFilters = isChroma ? 1 : alfSliceParam.numLumaFilters;
-
-  // vlc for all
-  for( int ind = 0; ind < numFilters; ++ind )
-  {
-    if( isChroma || !alfSliceParam.alfLumaCoeffDeltaFlag || alfSliceParam.alfLumaCoeffFlag[ind] )
-    {
-      for( int i = 0; i < alfShape.numCoeff - 1; i++ )
-      {
-        int coeffVal = abs( coeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] );
-
-        for( int k = 1; k < 15; k++ )
-        {
-          m_bitsCoeffScan[alfShape.golombIdx[i]][k] += lengthGolomb( coeffVal, k );
-        }
-      }
-    }
-  }
-#endif
 
   int kMin = getGolombKMin( alfShape, numFilters, m_kMinTab, m_bitsCoeffScan );
 
@@ -1412,37 +1016,12 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
     kMin = m_kMinTab[idx];
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   // Filter coefficients
   for( int i = 0; i < alfShape.numCoeff - 1; i++ )
   {
     iBits += lengthGolomb( alfSliceParam.chromaCoeff[i], m_kMinTab[alfShape.golombIdx[i]] );  // alf_coeff_chroma[i], alf_coeff_luma_delta[i][j]
   }
-#else
-  if( !isChroma )
-  {
-    if( alfSliceParam.alfLumaCoeffDeltaFlag )
-    {
-      iBits += numFilters;             //filter_coefficient_flag[i]
-    }
-  }
-
-  // Filter coefficients
-  for( int ind = 0; ind < numFilters; ++ind )
-  {
-    if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.alfLumaCoeffDeltaFlag )
-    {
-      continue;
-    }
-
-    for( int i = 0; i < alfShape.numCoeff - 1; i++ )
-    {
-      iBits += lengthGolomb( coeff[ind* MAX_NUM_ALF_LUMA_COEFF + i], m_kMinTab[alfShape.golombIdx[i]] );  // alf_coeff_chroma[i], alf_coeff_luma_delta[i][j]
-    }
-  }
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   if( m_alfSliceParamTemp.nonLinearFlag[isChroma] )
   {
     memset( m_bitsCoeffScan, 0, sizeof( m_bitsCoeffScan ) );
@@ -1481,7 +1060,6 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
       iBits += lengthGolomb( alfSliceParam.chromaClipp[i], m_kMinTab[alfShape.golombIdx[i]], false );  // alf_coeff_chroma[i], alf_coeff_luma_delta[i][j]
     }
   }
-#endif
   return iBits;
 }
 
@@ -1515,30 +1093,13 @@ double EncAdaptiveLoopFilter::getFilteredDistortion( AlfCovariance* cov, const i
 
   for( int classIdx = 0; classIdx < numClasses; classIdx++ )
   {
-#if JVET_N0415_CTB_ALF
-#if JVET_N0242_NON_LINEAR_ALF
     dist += cov[classIdx].calcErrorForCoeffs(m_filterClippSet[classIdx], m_filterCoeffSet[classIdx], numCoeff, m_NUM_BITS);
-#else
-    dist += calcErrorForCoeffs(cov[classIdx].E, cov[classIdx].y, m_filterCoeffSet[classIdx], numCoeff, m_NUM_BITS);
-#endif
-#else
-    int filterIdx = numClasses == 1 ? 0 : m_filterIndices[numFiltersMinus1][classIdx];
-#if JVET_N0242_NON_LINEAR_ALF
-    dist += cov[classIdx].calcErrorForCoeffs( m_filterClippSet[filterIdx], m_filterCoeffSet[filterIdx], numCoeff, m_NUM_BITS );
-#else
-    dist += calcErrorForCoeffs( cov[classIdx].E, cov[classIdx].y, m_filterCoeffSet[filterIdx], numCoeff, m_NUM_BITS );
-#endif
-#endif
   }
 
   return dist;
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam, AlfFilterShape& alfShape, AlfCovariance* covFrame, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], int& uiCoeffBits )
-#else
-double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam, AlfFilterShape& alfShape, AlfCovariance* covFrame, AlfCovariance* covMerged, int& uiCoeffBits )
-#endif
 {
   int numFiltersBest = 0;
   int numFilters = MAX_NUM_ALF_CLASSES;
@@ -1548,27 +1109,11 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
   double cost, cost0, dist, distForce0, costMin = MAX_DOUBLE;
   int predMode = 0, bestPredMode = 0, coeffBits, coeffBitsForce0;
 
-#if JVET_N0242_NON_LINEAR_ALF
   mergeClasses( alfShape, covFrame, covMerged, clipMerged, MAX_NUM_ALF_CLASSES, m_filterIndices );
-#else
-  mergeClasses( covFrame, covMerged, MAX_NUM_ALF_CLASSES, m_filterIndices );
-#endif
 
   while( numFilters >= 1 )
   {
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
     dist = deriveFilterCoeffs(covFrame, covMerged, clipMerged, alfShape, m_filterIndices[numFilters - 1], numFilters, errorForce0CoeffTab, alfSliceParam);
-#else
-    dist = deriveFilterCoeffs(covFrame, covMerged, clipMerged, alfShape, m_filterIndices[numFilters - 1], numFilters, errorForce0CoeffTab);
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-    dist = deriveFilterCoeffs( covFrame, covMerged, alfShape, m_filterIndices[numFilters - 1], numFilters, errorForce0CoeffTab, alfSliceParam );
-#else
-    dist = deriveFilterCoeffs( covFrame, covMerged, alfShape, m_filterIndices[numFilters - 1], numFilters, errorForce0CoeffTab );
-#endif
-#endif
     // filter coeffs are stored in m_filterCoeffSet
     distForce0 = getDistForce0( alfShape, numFilters, errorForce0CoeffTab, codedVarBins );
     coeffBits = deriveFilterCoefficientsPredictionMode( alfShape, m_filterCoeffSet, m_diffFilterCoeff, numFilters, predMode );
@@ -1582,7 +1127,6 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
       cost = cost0;
     }
 
-#if JVET_N0415_CTB_ALF
     if (alfSliceParam.fixedFilterSetIndex > 0)
     {
       int len = 0;
@@ -1594,7 +1138,6 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
       }
       cost += m_lambda[COMPONENT_Y] * len;
     }
-#endif
 
     if( cost <= costMin )
     {
@@ -1605,19 +1148,7 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
     numFilters--;
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
   dist = deriveFilterCoeffs( covFrame, covMerged, clipMerged, alfShape, m_filterIndices[numFiltersBest - 1], numFiltersBest, errorForce0CoeffTab, alfSliceParam );
-#else
-  dist = deriveFilterCoeffs( covFrame, covMerged, clipMerged, alfShape, m_filterIndices[numFiltersBest - 1], numFiltersBest, errorForce0CoeffTab );
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-  dist = deriveFilterCoeffs( covFrame, covMerged, alfShape, m_filterIndices[numFiltersBest - 1], numFiltersBest, errorForce0CoeffTab, alfSliceParam );
-#else
-  dist = deriveFilterCoeffs( covFrame, covMerged, alfShape, m_filterIndices[numFiltersBest - 1], numFiltersBest, errorForce0CoeffTab );
-#endif
-#endif
   coeffBits = deriveFilterCoefficientsPredictionMode( alfShape, m_filterCoeffSet, m_diffFilterCoeff, numFiltersBest, predMode );
   distForce0 = getDistForce0( alfShape, numFiltersBest, errorForce0CoeffTab, codedVarBins );
   coeffBitsForce0 = getCostFilterCoeffForce0( alfShape, m_filterCoeffSet, numFiltersBest, codedVarBins );
@@ -1647,9 +1178,7 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
       if( codedVarBins[varInd] == 0 )
       {
         memset( m_filterCoeffSet[varInd], 0, sizeof( int )*MAX_NUM_ALF_LUMA_COEFF );
-#if JVET_N0242_NON_LINEAR_ALF
         memset( m_filterClippSet[varInd], 0, sizeof( int )*MAX_NUM_ALF_LUMA_COEFF );
-#endif
       }
     }
   }
@@ -1666,9 +1195,7 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
       {
         alfSliceParam.lumaCoeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] = m_filterCoeffSet[ind][i];
       }
-#if JVET_N0242_NON_LINEAR_ALF
       alfSliceParam.lumaClipp[ind * MAX_NUM_ALF_LUMA_COEFF + i] = m_filterClippSet[ind][i];
-#endif
     }
   }
 
@@ -1690,7 +1217,6 @@ int EncAdaptiveLoopFilter::getNonFilterCoeffRate( AlfSliceParam& alfSliceParam )
       len += getTBlength( (int)alfSliceParam.filterCoeffDeltaIdx[i], alfSliceParam.numLumaFilters );  //filter_coeff_delta[i]
     }
   }
-#if JVET_N0415_CTB_ALF
   len++; //fixed filter set flag
   if (alfSliceParam.fixedFilterSetIndex > 0)
   {
@@ -1699,7 +1225,6 @@ int EncAdaptiveLoopFilter::getNonFilterCoeffRate( AlfSliceParam& alfSliceParam )
     if (alfSliceParam.fixedFilterPattern > 0)
       len += MAX_NUM_ALF_CLASSES;  //"fixed_filter_flag" for each class
   }
-#endif
   return len;
 }
 
@@ -1799,7 +1324,6 @@ int EncAdaptiveLoopFilter::getCostFilterCoeffForce0( AlfFilterShape& alfShape, i
     }
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   if( m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] )
   {
     memset( m_bitsCoeffScan, 0, sizeof( m_bitsCoeffScan ) );
@@ -1844,7 +1368,6 @@ int EncAdaptiveLoopFilter::getCostFilterCoeffForce0( AlfFilterShape& alfShape, i
     }
   }
 
-#endif
   return len;
 }
 
@@ -1871,16 +1394,11 @@ int EncAdaptiveLoopFilter::deriveFilterCoefficientsPredictionMode( AlfFilterShap
 
   predMode = ( ratePredMode1 < ratePredMode0 && numFilters > 1 ) ? 1 : 0;
 
-#if JVET_N0242_NON_LINEAR_ALF
   int rateClipp = m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] ? getCostFilterClipp( alfShape, filterSet, numFilters ) : 0;
 
   return ( numFilters > 1 ? 1 : 0 )        // coeff_delta_pred_mode_flag
        + rateClipp
        + ( predMode ? ratePredMode1 : ratePredMode0 ); // min_golomb_order, golomb_order_increase_flag, alf_coeff_luma_delta
-#else
-  return ( numFilters > 1 ? 1 : 0 )        // coeff_delta_pred_mode_flag
-       + ( predMode ? ratePredMode1 : ratePredMode0 ); // min_golomb_order, golomb_order_increase_flag, alf_coeff_luma_delta
-#endif
 }
 
 int EncAdaptiveLoopFilter::getCostFilterCoeff( AlfFilterShape& alfShape, int **pDiffQFilterCoeffIntPP, const int numFilters )
@@ -1913,7 +1431,6 @@ int EncAdaptiveLoopFilter::getCostFilterCoeff( AlfFilterShape& alfShape, int **p
   return len;
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 int EncAdaptiveLoopFilter::getCostFilterClipp( AlfFilterShape& alfShape, int **pDiffQFilterCoeffIntPP, const int numFilters )
 {
   memset( m_bitsCoeffScan, 0, sizeof( m_bitsCoeffScan ) );
@@ -1936,7 +1453,6 @@ int EncAdaptiveLoopFilter::getCostFilterClipp( AlfFilterShape& alfShape, int **p
           + lengthFilterClipps( alfShape, numFilters, pDiffQFilterCoeffIntPP, m_kMinTab ); // Filter clippings
 }
 
-#endif
 int EncAdaptiveLoopFilter::lengthFilterCoeffs( AlfFilterShape& alfShape, const int numFilters, int **FilterCoeff, int* kMinTab )
 {
   int bitCnt = 0;
@@ -1951,7 +1467,6 @@ int EncAdaptiveLoopFilter::lengthFilterCoeffs( AlfFilterShape& alfShape, const i
   return bitCnt;
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 int EncAdaptiveLoopFilter::lengthFilterClipps( AlfFilterShape& alfShape, const int numFilters, int **FilterCoeff, int* kMinTab )
 {
   int bitCnt = 0;
@@ -1968,7 +1483,6 @@ int EncAdaptiveLoopFilter::lengthFilterClipps( AlfFilterShape& alfShape, const i
   return bitCnt;
 }
 
-#endif
 double EncAdaptiveLoopFilter::getDistForce0( AlfFilterShape& alfShape, const int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], bool* codedVarBins )
 {
   static int bitsVarBin[MAX_NUM_ALF_CLASSES];
@@ -1997,7 +1511,6 @@ double EncAdaptiveLoopFilter::getDistForce0( AlfFilterShape& alfShape, const int
     }
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   if( m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] )
   {
     memset( m_bitsCoeffScan, 0, sizeof( m_bitsCoeffScan ) );
@@ -2028,7 +1541,6 @@ double EncAdaptiveLoopFilter::getDistForce0( AlfFilterShape& alfShape, const int
     }
   }
 
-#endif
   double distForce0 = getDistCoeffForce0( codedVarBins, errorTabForce0Coeff, bitsVarBin, numFilters );
 
   return distForce0;
@@ -2115,19 +1627,11 @@ int EncAdaptiveLoopFilter::lengthUvlc( int uiCode )
   return ( uiLength >> 1 ) + ( ( uiLength + 1 ) >> 1 );
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 int EncAdaptiveLoopFilter::lengthGolomb( int coeffVal, int k, bool signed_coeff )
-#else
-int EncAdaptiveLoopFilter::lengthGolomb( int coeffVal, int k )
-#endif
 {
   int m = 2 << ( k - 1 );
   int q = coeffVal / m;
-#if JVET_N0242_NON_LINEAR_ALF
   if( signed_coeff && coeffVal != 0 )
-#else
-  if( coeffVal != 0 )
-#endif
   {
     return q + 2 + k;
   }
@@ -2137,24 +1641,11 @@ int EncAdaptiveLoopFilter::lengthGolomb( int coeffVal, int k )
   }
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
 double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], AlfSliceParam& alfSliceParam )
-#else
-double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2] )
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovariance* covMerged, AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], AlfSliceParam& alfSliceParam )
-#else
-double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovariance* covMerged, AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2] )
-#endif
-#endif
 {
   double error = 0.0;
   AlfCovariance& tmpCov = covMerged[MAX_NUM_ALF_CLASSES];
 
-#if JVET_N0415_CTB_ALF
   alfSliceParam.fixedFilterSetIndex = 0;
   AlfCovariance& tmpCovFf = covMerged[MAX_NUM_ALF_CLASSES + 1];
   double factor = 1 << (m_NUM_BITS - 1);
@@ -2163,9 +1654,7 @@ double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovaria
   double errorCurSetPerClass[MAX_NUM_ALF_CLASSES] = { 0 };
   int    fixedFilterFlagPerClass[MAX_NUM_ALF_CLASSES] = { 0 };
 
-#if JVET_N0242_NON_LINEAR_ALF
   if (!alfSliceParam.nonLinearFlag[CHANNEL_TYPE_LUMA])
-#endif
   {
     alfSliceParam.fixedFilterSetIndex = 0;
     for (int filterSetIdx = 0; filterSetIdx < NUM_FIXED_FILTER_SETS; filterSetIdx++)
@@ -2174,11 +1663,7 @@ double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovaria
       for (int classIdx = 0; classIdx < MAX_NUM_ALF_CLASSES; classIdx++)
       {
         int fixedFilterIdx = m_classToFilterMapping[filterSetIdx][classIdx];
-#if JVET_N0242_NON_LINEAR_ALF
         errorCurSetPerClass[classIdx] = cov[classIdx].calcErrorForCoeffs(clipMerged[numFilters - 1][filterIndices[classIdx]], m_fixedFilterSetCoeff[fixedFilterIdx], MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#else
-        errorCurSetPerClass[classIdx] = calcErrorForCoeffs(cov[classIdx].E, cov[classIdx].y, m_fixedFilterSetCoeff[fixedFilterIdx], MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#endif
 
         if (errorCurSetPerClass[classIdx] >= 0)
         {
@@ -2214,25 +1699,19 @@ double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovaria
       }
     }
   }
-#endif
 
   for( int filtIdx = 0; filtIdx < numFilters; filtIdx++ )
   {
     tmpCov.reset();
-#if JVET_N0242_NON_LINEAR_ALF
     bool found_clip = false;
-#endif
     for( int classIdx = 0; classIdx < MAX_NUM_ALF_CLASSES; classIdx++ )
     {
       if( filterIndices[classIdx] == filtIdx )
       {
-#if JVET_N0415_CTB_ALF
         //adjust stat
         tmpCovFf = cov[classIdx];
         if (alfSliceParam.fixedFilterSetIndex > 0 && alfSliceParam.fixedFilterIdx[classIdx] > 0
-#if JVET_N0242_NON_LINEAR_ALF
           && alfSliceParam.nonLinearFlag[CHANNEL_TYPE_LUMA] == false
-#endif
           )
         {
           int fixedFilterIdx = m_classToFilterMapping[alfSliceParam.fixedFilterSetIndex - 1][classIdx];
@@ -2242,76 +1721,41 @@ double EncAdaptiveLoopFilter::deriveFilterCoeffs( AlfCovariance* cov, AlfCovaria
             double sum = 0;
             for (int j = 0; j < MAX_NUM_ALF_LUMA_COEFF; j++)
             {
-#if JVET_N0242_NON_LINEAR_ALF
               sum += tmpCovFf.E[clipMerged[numFilters - 1][classIdx][i]][clipMerged[numFilters - 1][classIdx][j]][i][j] * m_fixedFilterSetCoeff[fixedFilterIdx][j];
-#else
-              sum += tmpCovFf.E[i][j] * m_fixedFilterSetCoeff[fixedFilterIdx][j];
-#endif
             }
             sum /= factor;
-#if JVET_N0242_NON_LINEAR_ALF
             tmpCovFf.y[clipMerged[numFilters - 1][classIdx][i]][i] -= sum;
-#else
-            tmpCovFf.y[i] -= sum;
-#endif
           }
         }
         tmpCov += tmpCovFf;
-#else
-        tmpCov += cov[classIdx];
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
         if( !found_clip )
         {
           found_clip = true; // clip should be at the adress of shortest one
           memcpy(m_filterClippSet[filtIdx], clipMerged[numFilters-1][classIdx], sizeof(int[MAX_NUM_ALF_LUMA_COEFF]));
         }
-#endif
       }
     }
 
     // Find coeffcients
-#if JVET_N0242_NON_LINEAR_ALF
     assert(alfShape.numCoeff == tmpCov.numCoeff);
     errorTabForce0Coeff[filtIdx][1] = tmpCov.pixAcc + deriveCoeffQuant( m_filterClippSet[filtIdx], m_filterCoeffSet[filtIdx], tmpCov, alfShape, m_NUM_BITS, false );
-#else
-    errorTabForce0Coeff[filtIdx][1] = tmpCov.pixAcc + deriveCoeffQuant( m_filterCoeffQuant, tmpCov.E, tmpCov.y, alfShape.numCoeff, alfShape.weights, m_NUM_BITS );
-#endif
     errorTabForce0Coeff[filtIdx][0] = tmpCov.pixAcc;
     error += errorTabForce0Coeff[filtIdx][1];
-#if !JVET_N0242_NON_LINEAR_ALF
-
-    // store coeff
-    memcpy( m_filterCoeffSet[filtIdx], m_filterCoeffQuant, sizeof( int )*alfShape.numCoeff );
-#endif
   }
   return error;
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 double EncAdaptiveLoopFilter::deriveCoeffQuant( int *filterClipp, int *filterCoeffQuant, const AlfCovariance& cov, const AlfFilterShape& shape, const int bitDepth, const bool optimizeClip )
-#else
-double EncAdaptiveLoopFilter::deriveCoeffQuant( int *filterCoeffQuant, double **E, double *y, const int numCoeff, std::vector<int>& weights, const int bitDepth, const bool bChroma )
-#endif
 {
   const int factor = 1 << ( bitDepth - 1 );
   const int max_value = factor - 1;
   const int min_value = -factor + 1;
 
-#if JVET_N0242_NON_LINEAR_ALF
 const int numCoeff = shape.numCoeff;
-#else
-  static int filterCoeffQuantMod[MAX_NUM_ALF_LUMA_COEFF];
-#endif
   static double filterCoeff[MAX_NUM_ALF_LUMA_COEFF];
 
-#if JVET_N0242_NON_LINEAR_ALF
   cov.optimizeFilter( shape, filterClipp, filterCoeff, optimizeClip );
-#else
-  gnsSolveByChol( E, y, filterCoeff, numCoeff );
-#endif
   roundFiltCoeff( filterCoeffQuant, filterCoeff, numCoeff, factor );
-#if JVET_N0242_NON_LINEAR_ALF
 
   for ( int i = 0; i < numCoeff - 1; i++ )
   {
@@ -2355,167 +1799,8 @@ const int numCoeff = shape.numCoeff;
   }
 
   return errRef;
-#else
-  const int targetCoeffSumInt = 0;
-  int quantCoeffSum = 0;
-  for( int i = 0; i < numCoeff; i++ )
-  {
-    quantCoeffSum += weights[i] * filterCoeffQuant[i];
-  }
-  int count = 0;
-  while( quantCoeffSum != targetCoeffSumInt && count < 10 )
-  {
-    int sign = quantCoeffSum > targetCoeffSumInt ? 1 : -1;
-    int diff = ( quantCoeffSum - targetCoeffSumInt ) * sign;
-
-    double errMin = MAX_DOUBLE;
-    int minInd = -1;
-
-    for( int k = 0; k < numCoeff; k++ )
-    {
-      if( weights[k] <= diff )
-      {
-        memcpy( filterCoeffQuantMod, filterCoeffQuant, sizeof( int ) * numCoeff );
-
-        filterCoeffQuantMod[k] -= sign;
-        double error = calcErrorForCoeffs( E, y, filterCoeffQuantMod, numCoeff, bitDepth );
-
-        if( error < errMin )
-        {
-          errMin = error;
-          minInd = k;
-        }
-      }
-    }
-
-    if( minInd != -1 )
-    {
-      filterCoeffQuant[minInd] -= sign;
-    }
-
-    quantCoeffSum = 0;
-    for( int i = 0; i < numCoeff; i++ )
-    {
-      quantCoeffSum += weights[i] * filterCoeffQuant[i];
-    }
-    ++count;
-  }
-  if( count == 10 )
-  {
-    memset( filterCoeffQuant, 0, sizeof( int ) * numCoeff );
-  }
-
-  for ( int i = 0; i < numCoeff - 1; i++ )
-  {
-    filterCoeffQuant[i] = std::min( max_value, std::max( min_value, filterCoeffQuant[i] ) );
-    filterCoeff[i] = filterCoeffQuant[i] / double( factor );
-  }
-
-  quantCoeffSum = 0;
-  for ( int i = 0; i < numCoeff - 1; i++ )
-  {
-    quantCoeffSum += weights[i] * filterCoeffQuant[i];
-    filterCoeff[i] = filterCoeffQuant[i] / double(factor);
-  }
-  filterCoeffQuant[numCoeff - 1] = -quantCoeffSum;
-  filterCoeff[numCoeff - 1] = filterCoeffQuant[numCoeff - 1] / double(factor);
-
-
-  //Restrict the range of the center coefficient
-  int max_value_center = (2 * factor - 1) - factor;
-  int min_value_center = 0 - factor;
-
-  filterCoeffQuant[numCoeff - 1] = std::min(max_value_center, std::max(min_value_center, filterCoeffQuant[numCoeff - 1]));
-  filterCoeff[numCoeff - 1] = filterCoeffQuant[numCoeff - 1] / double(factor);
-
-  int coeffQuantAdjust[MAX_NUM_ALF_LUMA_COEFF];
-  int adjustedTotalCoeff = (numCoeff - 1) << 1;
-
-  count = 0;
-  quantCoeffSum += filterCoeffQuant[numCoeff - 1];
-  while (quantCoeffSum != targetCoeffSumInt && count < 15)
-  {
-    int sign = quantCoeffSum > targetCoeffSumInt ? 1 : -1;
-    int diff = (quantCoeffSum - targetCoeffSumInt) * sign;
-
-    if (diff > 4 * adjustedTotalCoeff)     sign = sign * 8;
-    else if (diff > 2 * adjustedTotalCoeff)     sign = sign * 4;
-    else if (diff >     adjustedTotalCoeff)     sign = sign * 2;
-
-    double errMin = MAX_DOUBLE;
-    int    minInd = -1;
-
-    for (int k = 0; k < numCoeff - 1; k++)
-    {
-      memcpy(coeffQuantAdjust, filterCoeffQuant, sizeof(int) * numCoeff);
-
-      coeffQuantAdjust[k] -= sign;
-
-      if (coeffQuantAdjust[k] <= max_value && coeffQuantAdjust[k] >= min_value)
-      {
-        double error = calcErrorForCoeffs(E, y, coeffQuantAdjust, numCoeff, bitDepth);
-
-        if (error < errMin)
-        {
-          errMin = error;
-          minInd = k;
-        }
-      }
-    }
-
-    if (minInd != -1)
-    {
-      filterCoeffQuant[minInd] -= sign;
-      quantCoeffSum -= (weights[minInd] * sign);
-    }
-
-    ++count;
-  }
-
-  if (quantCoeffSum != targetCoeffSumInt)
-  {
-    memset(filterCoeffQuant, 0, sizeof(int) * numCoeff);
-  }
-
-  for (int i = 0; i < numCoeff - 1; i++)
-  {
-    CHECK(filterCoeffQuant[i] > max_value || filterCoeffQuant[i] < min_value, "filterCoeffQuant[i]>max_value || filterCoeffQuant[i]<min_value");
-    filterCoeff[i] = filterCoeffQuant[i] / double(factor);
-  }
-  CHECK(filterCoeffQuant[numCoeff - 1] > max_value_center || filterCoeffQuant[numCoeff - 1] < min_value_center, "filterCoeffQuant[numCoeff-1]>max_value_center || filterCoeffQuant[numCoeff-1]<min_value_center");
-  filterCoeff[numCoeff - 1] = filterCoeffQuant[numCoeff - 1] / double(factor);
-
-
-  double error = calcErrorForCoeffs( E, y, filterCoeffQuant, numCoeff, bitDepth );
-  return error;
-#endif
 }
 
-#if !JVET_N0242_NON_LINEAR_ALF
-double EncAdaptiveLoopFilter::calcErrorForCoeffs( double **E, double *y,
-#if JVET_N0415_CTB_ALF
-  const
-#endif
-  int *coeff, const int numCoeff, const int bitDepth )
-{
-  double factor = 1 << ( bitDepth - 1 );
-  double error = 0;
-
-  for( int i = 0; i < numCoeff; i++ )   //diagonal
-  {
-    double sum = 0;
-    for( int j = i + 1; j < numCoeff; j++ )
-    {
-      // E[j][i] = E[i][j], sum will be multiplied by 2 later
-      sum += E[i][j] * coeff[j];
-    }
-    error += ( ( E[i][i] * coeff[i] + sum * 2 ) / factor - 2 * y[i] ) * coeff[i];
-  }
-
-  return error / factor;
-}
-
-#endif
 void EncAdaptiveLoopFilter::roundFiltCoeff( int *filterCoeffQuant, double *filterCoeff, const int numCoeff, const int factor )
 {
   for( int i = 0; i < numCoeff; i++ )
@@ -2525,18 +1810,12 @@ void EncAdaptiveLoopFilter::roundFiltCoeff( int *filterCoeffQuant, double *filte
   }
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 void EncAdaptiveLoopFilter::mergeClasses( const AlfFilterShape& alfShape, AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], const int numClasses, short filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES] )
-#else
-void EncAdaptiveLoopFilter::mergeClasses( AlfCovariance* cov, AlfCovariance* covMerged, const int numClasses, short filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES] )
-#endif
 {
-#if JVET_N0242_NON_LINEAR_ALF
   static int tmpClip[MAX_NUM_ALF_LUMA_COEFF];
   static int bestMergeClip[MAX_NUM_ALF_LUMA_COEFF];
   static double err[MAX_NUM_ALF_CLASSES];
   static double bestMergeErr;
-#endif
   static bool availableClass[MAX_NUM_ALF_CLASSES];
   static uint8_t indexList[MAX_NUM_ALF_CLASSES];
   static uint8_t indexListTemp[MAX_NUM_ALF_CLASSES];
@@ -2550,16 +1829,13 @@ void EncAdaptiveLoopFilter::mergeClasses( AlfCovariance* cov, AlfCovariance* cov
     indexList[i] = i;
     availableClass[i] = true;
     covMerged[i] = cov[i];
-#if JVET_N0242_NON_LINEAR_ALF
     covMerged[i].numBins = m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] ? AlfNumClippingValues[COMPONENT_Y] : 1;
-#endif
   }
 
   // Try merging different covariance matrices
 
   // temporal AlfCovariance structure is allocated as the last element in covMerged array, the size of covMerged is MAX_NUM_ALF_CLASSES + 1
   AlfCovariance& tmpCov = covMerged[MAX_NUM_ALF_CLASSES];
-#if JVET_N0242_NON_LINEAR_ALF
   tmpCov.numBins = m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] ? AlfNumClippingValues[COMPONENT_Y] : 1;
 
   // init Clip
@@ -2575,13 +1851,8 @@ void EncAdaptiveLoopFilter::mergeClasses( AlfCovariance* cov, AlfCovariance* cov
       err[i] = covMerged[i].calculateError( clipMerged[numRemaining-1][i] );
     }
   }
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   while( numRemaining >= 2 )
-#else
-  while( numRemaining > 2 )
-#endif
   {
     double errorMin = std::numeric_limits<double>::max();
     int bestToMergeIdx1 = 0, bestToMergeIdx2 = 1;
@@ -2594,32 +1865,21 @@ void EncAdaptiveLoopFilter::mergeClasses( AlfCovariance* cov, AlfCovariance* cov
         {
           if( availableClass[j] )
           {
-#if JVET_N0242_NON_LINEAR_ALF
             double error1 = err[i];
             double error2 = err[j];
-#else
-            double error1 = calculateError( covMerged[i] );
-            double error2 = calculateError( covMerged[j] );
-#endif
 
             tmpCov.add( covMerged[i], covMerged[j] );
-#if JVET_N0242_NON_LINEAR_ALF
             for( int l = 0; l < MAX_NUM_ALF_LUMA_COEFF; ++l )
             {
               tmpClip[l] = (clipMerged[numRemaining-1][i][l] + clipMerged[numRemaining-1][j][l] + 1 ) >> 1;
             }
             double errorMerged = m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] ? tmpCov.optimizeFilterClip( alfShape, tmpClip ) : tmpCov.calculateError( tmpClip );
             double error = errorMerged - error1 - error2;
-#else
-            double error = calculateError( tmpCov ) - error1 - error2;
-#endif
 
             if( error < errorMin )
             {
-#if JVET_N0242_NON_LINEAR_ALF
               bestMergeErr = errorMerged;
               memcpy(bestMergeClip, tmpClip, sizeof(bestMergeClip));
-#endif
               errorMin = error;
               bestToMergeIdx1 = i;
               bestToMergeIdx2 = j;
@@ -2630,11 +1890,9 @@ void EncAdaptiveLoopFilter::mergeClasses( AlfCovariance* cov, AlfCovariance* cov
     }
 
     covMerged[bestToMergeIdx1] += covMerged[bestToMergeIdx2];
-#if JVET_N0242_NON_LINEAR_ALF
     memcpy(clipMerged[numRemaining-2], clipMerged[numRemaining-1], sizeof(int[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF]));
     memcpy(clipMerged[numRemaining-2][bestToMergeIdx1], bestMergeClip, sizeof(bestMergeClip));
     err[bestToMergeIdx1] = bestMergeErr;
-#endif
     availableClass[bestToMergeIdx2] = false;
 
     for( int i = 0; i < numClasses; i++ )
@@ -2687,11 +1945,7 @@ void EncAdaptiveLoopFilter::getFrameStats( ChannelType channel, int iShapeIdx )
   int numClasses = isLuma( channel ) ? MAX_NUM_ALF_CLASSES : 1;
   for( int i = 0; i < numClasses; i++ )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     m_alfCovarianceFrame[channel][iShapeIdx][i].reset(AlfNumClippingValues[channel]);
-#else
-    m_alfCovarianceFrame[channel][iShapeIdx][i].reset();
-#endif
   }
   if( isLuma( channel ) )
   {
@@ -2718,11 +1972,7 @@ void EncAdaptiveLoopFilter::getFrameStat( AlfCovariance* frameCov, AlfCovariance
   }
 }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnitBuf& recYuv, CodingStructure& cs )
-#else
-void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnitBuf& recYuv )
-#endif
 {
   int ctuRsAddr = 0;
   const int numberOfComponents = getNumberValidComponents( m_chromaFormat );
@@ -2739,11 +1989,7 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
       {
         for( int ctuIdx = 0; ctuIdx < m_numCTUsInPic; ctuIdx++ )
         {
-#if JVET_N0242_NON_LINEAR_ALF
           m_alfCovariance[compIdx][shape][ctuIdx][classIdx].reset(AlfNumClippingValues[toChannelType( compID )]);
-#else
-          m_alfCovariance[compIdx][shape][ctuIdx][classIdx].reset();
-#endif
         }
       }
     }
@@ -2760,29 +2006,22 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
     {
       for( int classIdx = 0; classIdx < numClasses; classIdx++ )
       {
-#if JVET_N0242_NON_LINEAR_ALF
         m_alfCovarianceFrame[channelIdx][shape][classIdx].reset(AlfNumClippingValues[channelID]);
-#else
-        m_alfCovarianceFrame[channelIdx][shape][classIdx].reset();
-#endif
       }
     }
   }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   const PreCalcValues& pcv = *cs.pcv;
   bool clipTop = false, clipBottom = false, clipLeft = false, clipRight = false;
   int numHorVirBndry = 0, numVerVirBndry = 0;
   int horVirBndryPos[] = { 0, 0, 0 };
   int verVirBndryPos[] = { 0, 0, 0 };
-#endif
   for( int yPos = 0; yPos < m_picHeight; yPos += m_maxCUHeight )
   {
     for( int xPos = 0; xPos < m_picWidth; xPos += m_maxCUWidth )
     {
       const int width = ( xPos + m_maxCUWidth > m_picWidth ) ? ( m_picWidth - xPos ) : m_maxCUWidth;
       const int height = ( yPos + m_maxCUHeight > m_picHeight ) ? ( m_picHeight - yPos ) : m_maxCUHeight;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       if( isCrossedByVirtualBoundaries( xPos, yPos, width, height, clipTop, clipBottom, clipLeft, clipRight, numHorVirBndry, numVerVirBndry, horVirBndryPos, verVirBndryPos, cs.slice->getPPS() ) )
       {
         int yStart = yPos;
@@ -2825,26 +2064,11 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
 
               for( int shape = 0; shape != m_filterShapes[chType].size(); shape++ )
               {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
               const CompArea& compAreaDst = areaDst.block( compID );
                 getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compAreaDst, compArea, chType
                   , ((compIdx == 0) ? m_alfVBLumaCTUHeight : m_alfVBChmaCTUHeight)
                   , ((yPos + m_maxCUHeight >= m_picHeight) ? m_picHeight : ((compIdx == 0) ? m_alfVBLumaPos : m_alfVBChmaPos))
                 );
-#else
-                getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, compArea
-                  , ((compIdx == 0) ? m_alfVBLumaCTUHeight : m_alfVBChmaCTUHeight)
-                  , ((yPos + m_maxCUHeight >= m_picHeight) ? m_picHeight : ((compIdx == 0) ? m_alfVBLumaPos : m_alfVBChmaPos))
-                );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-                getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compAreaDst, compArea, chType);
-#else
-                getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compAreaDst, compArea);
-#endif
-#endif
               }
             }
 
@@ -2873,7 +2097,6 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
       }
       else
       {
-#endif
       const UnitArea area( m_chromaFormat, Area( xPos, yPos, width, height ) );
 
       for( int compIdx = 0; compIdx < numberOfComponents; compIdx++ )
@@ -2891,47 +2114,10 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
 
         for( int shape = 0; shape != m_filterShapes[chType].size(); shape++ )
         {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, compArea, chType
             , ((compIdx == 0) ? m_alfVBLumaCTUHeight : m_alfVBChmaCTUHeight)
             , ((yPos + m_maxCUHeight >= m_picHeight) ? m_picHeight : ((compIdx == 0) ? m_alfVBLumaPos : m_alfVBChmaPos))        
           );
-#else
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, chType
-            , ((compIdx == 0) ? m_alfVBLumaCTUHeight : m_alfVBChmaCTUHeight)
-            , ((yPos + m_maxCUHeight >= m_picHeight) ? m_picHeight+4 : ((compIdx == 0) ? m_alfVBLumaPos : m_alfVBChmaPos))        
-          );
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, compArea
-            , ((compIdx == 0) ? m_alfVBLumaCTUHeight : m_alfVBChmaCTUHeight)
-            , ((yPos + m_maxCUHeight >= m_picHeight) ? m_picHeight : ((compIdx == 0) ? m_alfVBLumaPos : m_alfVBChmaPos))
-          );
-#else
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea
-            , ((compIdx == 0) ? m_alfVBLumaCTUHeight : m_alfVBChmaCTUHeight)
-            , ((yPos + m_maxCUHeight >= m_picHeight) ? m_picHeight+4 : ((compIdx == 0) ? m_alfVBLumaPos : m_alfVBChmaPos))
-          );
-#endif
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, compArea, chType);
-#else
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, chType);
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea, compArea);
-#else
-          getBlkStats(m_alfCovariance[compIdx][shape][ctuRsAddr], m_filterShapes[chType][shape], compIdx ? nullptr : m_classifier, org, orgStride, rec, recStride, compArea);
-#endif
-#endif
-#endif
 
 
           const int numClasses = isLuma( compID ) ? MAX_NUM_ALF_CLASSES : 1;
@@ -2942,89 +2128,37 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
           }
         }
       }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       }
-#endif
       ctuRsAddr++;
     }
   }
 }
 
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
 void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos)
-#else
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, int vbCTUHeight, int vbPos)
-#else
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area, int vbCTUHeight, int vbPos)
-#endif
-#endif
 
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel)
-#else
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area, const ChannelType channel)
-#endif
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area)
-#else
-void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area)
-#endif
-#endif
-#endif
 
 
 {
-#if JVET_N0242_NON_LINEAR_ALF
   static int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues];
 
   const int numBins = AlfNumClippingValues[channel];
-#else
-  static int ELocal[MAX_NUM_ALF_LUMA_COEFF];
-#endif
 
   int transposeIdx = 0;
   int classIdx = 0;
 
   for( int i = 0; i < area.height; i++ )
   {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
     int vbDistance = ((areaDst.y + i) % vbCTUHeight) - vbPos;
-#else
-    int vbDistance = (i % vbCTUHeight) - vbPos;
-#endif
-#endif
     for( int j = 0; j < area.width; j++ )
     {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       if( classifier && classifier[areaDst.y + i][areaDst.x + j].classIdx == m_ALF_UNUSED_CLASSIDX && classifier[areaDst.y + i][areaDst.x + j].transposeIdx == m_ALF_UNUSED_TRANSPOSIDX )
-#else
-      if( classifier && classifier[area.y + i][area.x + j].classIdx == m_ALF_UNUSED_CLASSIDX && classifier[area.y + i][area.x + j].transposeIdx == m_ALF_UNUSED_TRANSPOSIDX )
-#endif
       {
         continue;
       }
-#if JVET_N0242_NON_LINEAR_ALF
       std::memset( ELocal, 0, sizeof( ELocal ) );
-#else
-      std::memset( ELocal, 0, shape.numCoeff * sizeof( int ) );
-#endif
       if( classifier )
       {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         AlfClassifier& cl = classifier[areaDst.y + i][areaDst.x + j];
-#else
-        AlfClassifier& cl = classifier[area.y + i][area.x + j];
-#endif
         transposeIdx = cl.transposeIdx;
         classIdx = cl.classIdx;
       }
@@ -3035,24 +2169,11 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFi
         weight = m_lumaLevelToWeightPLUT[org[j]];
       }
       int yLocal = org[j] - rec[j];
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
       calcCovariance(ELocal, rec + j, recStride, shape, transposeIdx, channel, vbDistance);
-#else
-      calcCovariance(ELocal, rec + j, recStride, shape.pattern.data(), shape.filterLength >> 1, transposeIdx, vbDistance);
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-      calcCovariance( ELocal, rec + j, recStride, shape, transposeIdx, channel );
-#else
-      calcCovariance( ELocal, rec + j, recStride, shape.pattern.data(), shape.filterLength >> 1, transposeIdx );
-#endif
-#endif
       for( int k = 0; k < shape.numCoeff; k++ )
       {
         for( int l = k; l < shape.numCoeff; l++ )
         {
-#if JVET_N0242_NON_LINEAR_ALF
           for( int b0 = 0; b0 < numBins; b0++ )
           {
             for( int b1 = 0; b1 < numBins; b1++ )
@@ -3067,16 +2188,7 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFi
               }
             }
           }
-#else
-          if (m_alfWSSD)
-          {
-            alfCovariace[classIdx].E[k][l] += weight * (double)(ELocal[k] * ELocal[l]);
-          }
-          else
-          alfCovariace[classIdx].E[k][l] += ELocal[k] * ELocal[l];
-#endif
         }
-#if JVET_N0242_NON_LINEAR_ALF
         for( int b = 0; b < numBins; b++ )
         {
           if (m_alfWSSD)
@@ -3088,31 +2200,15 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFi
             alfCovariance[classIdx].y[b][k] += ELocal[k][b] * yLocal;
           }
         }
-#else
-        if (m_alfWSSD)
-        {
-          alfCovariace[classIdx].y[k] += weight * (double)(ELocal[k] * yLocal);
-        }
-        else
-        alfCovariace[classIdx].y[k] += ELocal[k] * yLocal;
-#endif
       }
       if (m_alfWSSD)
       {
-#if JVET_N0242_NON_LINEAR_ALF
         alfCovariance[classIdx].pixAcc += weight * (double)(yLocal * yLocal);
-#else
-        alfCovariace[classIdx].pixAcc += weight * (double)(yLocal * yLocal);
-#endif
       }
       else
-#if JVET_N0242_NON_LINEAR_ALF
       {
         alfCovariance[classIdx].pixAcc += yLocal * yLocal;
       }
-#else
-      alfCovariace[classIdx].pixAcc += yLocal * yLocal;
-#endif
     }
     org += orgStride;
     rec += recStride;
@@ -3125,7 +2221,6 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFi
     {
       for( int l = 0; l < k; l++ )
       {
-#if JVET_N0242_NON_LINEAR_ALF
         for( int b0 = 0; b0 < numBins; b0++ )
         {
           for( int b1 = 0; b1 < numBins; b1++ )
@@ -3133,29 +2228,13 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariace, const AlfFi
             alfCovariance[classIdx].E[b0][b1][k][l] = alfCovariance[classIdx].E[b1][b0][l][k];
           }
         }
-#else
-        alfCovariace[classIdx].E[k][l] = alfCovariace[classIdx].E[l][k];
-#endif
       }
     }
   }
 }
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
 void EncAdaptiveLoopFilter::calcCovariance(int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel, int vbDistance)
-#else
-void EncAdaptiveLoopFilter::calcCovariance(int *ELocal, const Pel *rec, const int stride, const int *filterPattern, const int halfFilterLength, const int transposeIdx, int vbDistance)
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-void EncAdaptiveLoopFilter::calcCovariance(int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel)
-#else
-void EncAdaptiveLoopFilter::calcCovariance(int *ELocal, const Pel *rec, const int stride, const int *filterPattern, const int halfFilterLength, const int transposeIdx)
-#endif
-#endif
 
 {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
   int clipTopRow = -4;
   int clipBotRow = 4;
   if (vbDistance >= -3 && vbDistance < 0)
@@ -3168,33 +2247,22 @@ void EncAdaptiveLoopFilter::calcCovariance(int *ELocal, const Pel *rec, const in
     clipTopRow = -vbDistance;
     clipBotRow = -clipTopRow; // symmetric
   }
-#endif
 
-#if JVET_N0242_NON_LINEAR_ALF
   const int *filterPattern = shape.pattern.data();
   const int halfFilterLength = shape.filterLength >> 1;
   const Pel* clip = m_alfClippingValues[channel];
   const int numBins = AlfNumClippingValues[channel];
 
-#endif
   int k = 0;
 
-#if JVET_N0242_NON_LINEAR_ALF
   const short curr = rec[0];
-#endif
 
   if( transposeIdx == 0 )
   {
     for( int i = -halfFilterLength; i < 0; i++ )
     {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
       const Pel* rec0 = rec + std::max(i, clipTopRow) * stride;
       const Pel* rec1 = rec - std::max(i, -clipBotRow) * stride;
-#else
-      const Pel* rec0 = rec + i * stride;
-      const Pel* rec1 = rec - i * stride;
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
       for( int j = -halfFilterLength - i; j <= halfFilterLength + i; j++, k++ )
       {
         for( int b = 0; b < numBins; b++ )
@@ -3202,14 +2270,7 @@ void EncAdaptiveLoopFilter::calcCovariance(int *ELocal, const Pel *rec, const in
           ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[j], rec1[-j]);
         }
       }
-#else
-      for( int j = -halfFilterLength - i; j <= halfFilterLength + i; j++ )
-      {
-        ELocal[filterPattern[k++]] += rec0[j] + rec1[-j];
-      }
-#endif
     }
-#if JVET_N0242_NON_LINEAR_ALF
     for( int j = -halfFilterLength; j < 0; j++, k++ )
     {
       for( int b = 0; b < numBins; b++ )
@@ -3217,358 +2278,85 @@ void EncAdaptiveLoopFilter::calcCovariance(int *ELocal, const Pel *rec, const in
         ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[j], rec[-j]);
       }
     }
-#else
-    for( int j = -halfFilterLength; j < 0; j++ )
-    {
-      ELocal[filterPattern[k++]] += rec[j] + rec[-j];
-    }
-#endif
   }
   else if( transposeIdx == 1 )
   {
     for( int j = -halfFilterLength; j < 0; j++ )
-    {
-      const Pel* rec0 = rec + j;
-      const Pel* rec1 = rec - j;
-
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-      for (int i = -halfFilterLength - j; i <= halfFilterLength + j; i++, k++)
-      {
-        for (int b = 0; b < numBins; b++)
-        {
-          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[std::max(i, clipTopRow) * stride], rec1[-std::max(i, -clipBotRow) * stride]);
-        }
-    }
-#else
-      for (int i = -halfFilterLength - j; i <= halfFilterLength + j; i++)
-      {
-        ELocal[filterPattern[k++]] += rec0[std::max(i, clipTopRow) * stride] + rec1[-std::max(i, -clipBotRow) * stride];
-      }
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-      for (int i = -halfFilterLength - j; i <= halfFilterLength + j; i++, k++)
-      {
-        for (int b = 0; b < numBins; b++)
-        {
-          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[i * stride], rec1[-i * stride]);
-        }
-      }
-#else
-      for (int i = -halfFilterLength - j; i <= halfFilterLength + j; i++)
-      {
-        ELocal[filterPattern[k++]] += rec0[i * stride] + rec1[-i * stride];
-      }
-#endif
-#endif
-    }
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-    for (int i = -halfFilterLength; i < 0; i++, k++)
-    {
-      for (int b = 0; b < numBins; b++)
-      {
-        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[std::max(i, clipTopRow) * stride], rec[-std::max(i, -clipBotRow) * stride]);
-      }
-    }
-#else
-    for (int i = -halfFilterLength; i < 0; i++)
-    {
-      ELocal[filterPattern[k++]] += rec[std::max(i, clipTopRow) * stride] + rec[-std::max(i, -clipBotRow) * stride];
-    }
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-    for( int i = -halfFilterLength; i < 0; i++, k++ )
-    {
-      for( int b = 0; b < numBins; b++ )
-      {
-        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[i*stride], rec[-i * stride]);
-      }
-    }
-#else
-    for( int i = -halfFilterLength; i < 0; i++ )
-    {
-      ELocal[filterPattern[k++]] += rec[i*stride] + rec[-i * stride];
-    }
-#endif
-#endif
-  }
-  else if( transposeIdx == 2 )
-  {
-    for( int i = -halfFilterLength; i < 0; i++ )
-    {
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-      const Pel* rec0 = rec + std::max(i, clipTopRow) * stride;
-      const Pel* rec1 = rec - std::max(i, -clipBotRow) * stride;
-#else
-      const Pel* rec0 = rec + i * stride;
-      const Pel* rec1 = rec - i * stride;
-#endif
-
-#if JVET_N0242_NON_LINEAR_ALF
-      for( int j = halfFilterLength + i; j >= -halfFilterLength - i; j--, k++ )
-      {
-        for( int b = 0; b < numBins; b++ )
-        {
-          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[j], rec1[-j]);
-        }
-      }
-#else
-      for( int j = halfFilterLength + i; j >= -halfFilterLength - i; j-- )
-      {
-        ELocal[filterPattern[k++]] += rec0[j] + rec1[-j];
-      }
-#endif
-    }
-#if JVET_N0242_NON_LINEAR_ALF
-    for( int j = -halfFilterLength; j < 0; j++, k++ )
-    {
-      for( int b = 0; b < numBins; b++ )
-      {
-        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[j], rec[-j]);
-      }
-    }
-#else
-    for( int j = -halfFilterLength; j < 0; j++ )
-    {
-      ELocal[filterPattern[k++]] += rec[j] + rec[-j];
-    }
-#endif
-  }
-  else
-  {
-    for( int j = -halfFilterLength; j < 0; j++ )
-    {
-      const Pel* rec0 = rec + j;
-      const Pel* rec1 = rec - j;
-
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-      for (int i = halfFilterLength + j; i >= -halfFilterLength - j; i--, k++)
-      {
-        for (int b = 0; b < numBins; b++)
-        {
-          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[std::max(i, clipTopRow) * stride], rec1[-std::max(i, -clipBotRow) * stride]);
-        }
-      }
-#else
-      for (int i = halfFilterLength + j; i >= -halfFilterLength - j; i--)
-      {
-        ELocal[filterPattern[k++]] += rec0[std::max(i, clipTopRow) * stride] + rec1[-std::max(i, -clipBotRow) * stride];
-      }
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-      for( int i = halfFilterLength + j; i >= -halfFilterLength - j; i--, k++ )
-      {
-        for( int b = 0; b < numBins; b++ )
-        {
-          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[i * stride], rec1[-i * stride]);
-        }
-      }
-#else
-      for( int i = halfFilterLength + j; i >= -halfFilterLength - j; i-- )
-      {
-        ELocal[filterPattern[k++]] += rec0[i * stride] + rec1[-i * stride];
-      }
-#endif
-#endif
-    }
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-    for (int i = -halfFilterLength; i < 0; i++, k++)
-    {
-      for (int b = 0; b < numBins; b++)
-      {
-        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[std::max(i, clipTopRow) * stride], rec[-std::max(i, -clipBotRow) * stride]);
-      }
-    }
-#else
-    for (int i = -halfFilterLength; i < 0; i++)
-    {
-      ELocal[filterPattern[k++]] += rec[std::max(i, clipTopRow) * stride] + rec[-std::max(i, -clipBotRow) * stride];
-    }
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-    for (int i = -halfFilterLength; i < 0; i++, k++)
-    {
-      for (int b = 0; b < numBins; b++)
-      {
-        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[i*stride], rec[-i * stride]);
-      }
-    }
-#else
-    for (int i = -halfFilterLength; i < 0; i++)
-    {
-      ELocal[filterPattern[k++]] += rec[i*stride] + rec[-i * stride];
-    }
-#endif
-#endif
-
-  }
-#if JVET_N0242_NON_LINEAR_ALF
-  for( int b = 0; b < numBins; b++ )
-  {
-    ELocal[filterPattern[k]][b] += curr;
-  }
-#else
-  ELocal[filterPattern[k++]] += rec[0];
-#endif
-}
-
-
-
-#if !JVET_N0242_NON_LINEAR_ALF
-double EncAdaptiveLoopFilter::calculateError( AlfCovariance& cov )
-{
-  static double c[MAX_NUM_ALF_COEFF];
-
-  gnsSolveByChol( cov.E, cov.y, c, cov.numCoeff );
-
-  double sum = 0;
-  for( int i = 0; i < cov.numCoeff; i++ )
-  {
-    sum += c[i] * cov.y[i];
-  }
-
-  return cov.pixAcc - sum;
-}
-
-//********************************
-// Cholesky decomposition
-//********************************
-
-#define ROUND(a)  (((a) < 0)? (int)((a) - 0.5) : (int)((a) + 0.5))
-#define REG              0.0001
-#define REG_SQR          0.0000001
-
-//Find filter coeff related
-int EncAdaptiveLoopFilter::gnsCholeskyDec( double **inpMatr, double outMatr[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], int numEq )
-{
-  static double invDiag[MAX_NUM_ALF_COEFF];  /* Vector of the inverse of diagonal entries of outMatr */
-
-  for( int i = 0; i < numEq; i++ )
-  {
-    for( int j = i; j < numEq; j++ )
-    {
-      /* Compute the scaling factor */
-      double scale = inpMatr[i][j];
-      if( i > 0 )
+    {
+      const Pel* rec0 = rec + j;
+      const Pel* rec1 = rec - j;
+
+      for (int i = -halfFilterLength - j; i <= halfFilterLength + j; i++, k++)
       {
-        for( int k = i - 1; k >= 0; k-- )
+        for (int b = 0; b < numBins; b++)
         {
-          scale -= outMatr[k][j] * outMatr[k][i];
+          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[std::max(i, clipTopRow) * stride], rec1[-std::max(i, -clipBotRow) * stride]);
         }
+    }
+    }
+    for (int i = -halfFilterLength; i < 0; i++, k++)
+    {
+      for (int b = 0; b < numBins; b++)
+      {
+        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[std::max(i, clipTopRow) * stride], rec[-std::max(i, -clipBotRow) * stride]);
       }
+    }
+  }
+  else if( transposeIdx == 2 )
+  {
+    for( int i = -halfFilterLength; i < 0; i++ )
+    {
+      const Pel* rec0 = rec + std::max(i, clipTopRow) * stride;
+      const Pel* rec1 = rec - std::max(i, -clipBotRow) * stride;
 
-      /* Compute i'th row of outMatr */
-      if( i == j )
+      for( int j = halfFilterLength + i; j >= -halfFilterLength - i; j--, k++ )
       {
-        if( scale <= REG_SQR ) // if(scale <= 0 )  /* If inpMatr is singular */
+        for( int b = 0; b < numBins; b++ )
         {
-          return 0;
+          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[j], rec1[-j]);
         }
-        else              /* Normal operation */
-          invDiag[i] = 1.0 / ( outMatr[i][i] = sqrt( scale ) );
-      }
-      else
-      {
-        outMatr[i][j] = scale * invDiag[i]; /* Upper triangular part          */
-        outMatr[j][i] = 0.0;              /* Lower triangular part set to 0 */
       }
     }
-  }
-  return 1; /* Signal that Cholesky factorization is successfully performed */
-}
-
-void EncAdaptiveLoopFilter::gnsTransposeBacksubstitution( double U[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], double* rhs, double* x, int order )
-{
-  /* Backsubstitution starts */
-  x[0] = rhs[0] / U[0][0];               /* First row of U'                   */
-  for( int i = 1; i < order; i++ )
-  {         /* For the rows 1..order-1           */
-
-    double sum = 0; //Holds backsubstitution from already handled rows
-
-    for( int j = 0; j < i; j++ ) /* Backsubst already solved unknowns */
+    for( int j = -halfFilterLength; j < 0; j++, k++ )
     {
-      sum += x[j] * U[j][i];
+      for( int b = 0; b < numBins; b++ )
+      {
+        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[j], rec[-j]);
+      }
     }
-
-    x[i] = ( rhs[i] - sum ) / U[i][i];       /* i'th component of solution vect.  */
   }
-}
-
-void EncAdaptiveLoopFilter::gnsBacksubstitution( double R[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], double* z, int size, double* A )
-{
-  size--;
-  A[size] = z[size] / R[size][size];
-
-  for( int i = size - 1; i >= 0; i-- )
+  else
   {
-    double sum = 0;
+    for( int j = -halfFilterLength; j < 0; j++ )
+    {
+      const Pel* rec0 = rec + j;
+      const Pel* rec1 = rec - j;
 
-    for( int j = i + 1; j <= size; j++ )
+      for (int i = halfFilterLength + j; i >= -halfFilterLength - j; i--, k++)
+      {
+        for (int b = 0; b < numBins; b++)
+        {
+          ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec0[std::max(i, clipTopRow) * stride], rec1[-std::max(i, -clipBotRow) * stride]);
+        }
+      }
+    }
+    for (int i = -halfFilterLength; i < 0; i++, k++)
     {
-      sum += R[i][j] * A[j];
+      for (int b = 0; b < numBins; b++)
+      {
+        ELocal[filterPattern[k]][b] += clipALF(clip[b], curr, rec[std::max(i, clipTopRow) * stride], rec[-std::max(i, -clipBotRow) * stride]);
+      }
     }
 
-    A[i] = ( z[i] - sum ) / R[i][i];
   }
-}
-
-int EncAdaptiveLoopFilter::gnsSolveByChol( double **LHS, double *rhs, double *x, int numEq )
-{
-  static double aux[MAX_NUM_ALF_COEFF];     /* Auxiliary vector */
-  static double U[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF];    /* Upper triangular Cholesky factor of LHS */
-  int res = 1;  // Signal that Cholesky factorization is successfully performed
-
-                /* The equation to be solved is LHSx = rhs */
-
-                /* Compute upper triangular U such that U'*U = LHS */
-  if( gnsCholeskyDec( LHS, U, numEq ) ) /* If Cholesky decomposition has been successful */
+  for( int b = 0; b < numBins; b++ )
   {
-    /* Now, the equation is  U'*U*x = rhs, where U is upper triangular
-    * Solve U'*aux = rhs for aux
-    */
-    gnsTransposeBacksubstitution( U, rhs, aux, numEq );
-
-    /* The equation is now U*x = aux, solve it for x (new motion coefficients) */
-    gnsBacksubstitution( U, aux, numEq, x );
-
+    ELocal[filterPattern[k]][b] += curr;
   }
-  else /* LHS was singular */
-  {
-    res = 0;
-
-    /* Regularize LHS */
-    for( int i = 0; i < numEq; i++ )
-    {
-      LHS[i][i] += REG;
-    }
-
-    /* Compute upper triangular U such that U'*U = regularized LHS */
-    res = gnsCholeskyDec( LHS, U, numEq );
+}
 
-    if( !res )
-    {
-      std::memset( x, 0, sizeof( double )*numEq );
-      return 0;
-    }
 
-    /* Solve  U'*aux = rhs for aux */
-    gnsTransposeBacksubstitution( U, rhs, aux, numEq );
 
-    /* Solve U*x = aux for x */
-    gnsBacksubstitution( U, aux, numEq, x );
-  }
-  return res;
-}
-//////////////////////////////////////////////////////////////////////////////////////////
-#endif
 void EncAdaptiveLoopFilter::setEnableFlag( AlfSliceParam& alfSlicePara, ChannelType channel, bool val )
 {
   if( channel == CHANNEL_TYPE_LUMA )
@@ -3625,21 +2413,12 @@ void EncAdaptiveLoopFilter::setCtuEnableFlag( uint8_t** ctuFlags, ChannelType ch
   }
 }
 
-#if JVET_N0415_CTB_ALF
 std::vector<int> EncAdaptiveLoopFilter::getAvaiApsIdsLuma(CodingStructure& cs, int &newApsId)
 {
-#if JVET_N0805_APS_LMCS
   APS** apss = cs.slice->getAlfAPSs();
-#else
-  APS** apss = cs.slice->getAPSs();
-#endif
   for (int i = 0; i < MAX_NUM_APS; i++)
   {
-#if JVET_N0805_APS_LMCS
     apss[i] = m_apsMap->getPS((i << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-    apss[i] = m_apsMap->getPS(i);
-#endif
   }
 
   std::vector<int> result;
@@ -3648,11 +2427,7 @@ std::vector<int> EncAdaptiveLoopFilter::getAvaiApsIdsLuma(CodingStructure& cs, i
   {
     while (apsIdChecked < MAX_NUM_APS && !cs.slice->isIntra() && result.size() < (ALF_CTB_MAX_NUM_APS - 1) && !cs.slice->getPendingRasInit() && !cs.slice->isIDRorBLA())
     {
-#if JVET_N0805_APS_LMCS
       APS* curAPS = cs.slice->getAlfAPSs()[curApsId];
-#else
-      APS* curAPS = cs.slice->getAPSs()[curApsId];
-#endif
       if (curAPS && curAPS->getTemporalId() <= cs.slice->getTLayer() && curAPS->getAlfAPSParam().newFilterFlag[CHANNEL_TYPE_LUMA])
       {
         result.push_back(curApsId);
@@ -3662,11 +2437,7 @@ std::vector<int> EncAdaptiveLoopFilter::getAvaiApsIdsLuma(CodingStructure& cs, i
     }
   }
   cs.slice->setTileGroupNumAps((int)result.size());
-#if JVET_N0805_APS_LMCS
   cs.slice->setAlfAPSs(result);
-#else
-  cs.slice->setAPSs(result);
-#endif
   newApsId = m_apsIdStart - 1;
   if (newApsId < 0)
   {
@@ -3697,11 +2468,7 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
   TempCtx        ctxTempStart(m_CtxCache);
   TempCtx        ctxTempBest(m_CtxCache);
   AlfSliceParam  alfSliceParamNewFiltersBest = alfSliceParamNewFilters;
-#if JVET_N0805_APS_LMCS
   APS**          apss = cs.slice->getAlfAPSs();
-#else
-  APS**          apss = cs.slice->getAPSs();
-#endif
   short*     alfCtbFilterSetIndex = cs.picture->getAlfCtbFilterIndex();
   bool     hasNewFilters[2] = { alfSliceParamNewFilters.enabledFlag[COMPONENT_Y] , alfSliceParamNewFilters.enabledFlag[COMPONENT_Cb] || alfSliceParamNewFilters.enabledFlag[COMPONENT_Cr] };
   initDistortion();
@@ -3765,21 +2532,13 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
               for (int classIdx = 0; classIdx < MAX_NUM_ALF_CLASSES; classIdx++)
               {
                 short* pCoeff = m_coeffFinal;
-#if JVET_N0242_NON_LINEAR_ALF
                 short* pClipp = m_clippFinal;
-#endif
                 for (int i = 0; i < MAX_NUM_ALF_LUMA_COEFF; i++)
                 {
                   m_filterTmp[i] = pCoeff[classIdx * MAX_NUM_ALF_LUMA_COEFF + i];
-#if JVET_N0242_NON_LINEAR_ALF
                   m_clipTmp[i] = pClipp[classIdx * MAX_NUM_ALF_LUMA_COEFF + i];
-#endif
                 }
-#if JVET_N0242_NON_LINEAR_ALF
                 dDistOrgNewFilter += m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].calcErrorForCoeffs(m_clipTmp, m_filterTmp, MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#else
-                dDistOrgNewFilter += calcErrorForCoeffs(m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].E, m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].y, m_filterTmp, MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#endif
               }
             }
           }
@@ -3787,7 +2546,6 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
           {
             int bitNL[2] = { 0, 0 };
             double errNL[2] = { 0.0, 0.0 };
-#if JVET_N0242_NON_LINEAR_ALF
             m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] = 1;
             if (m_encCfg->getUseNonLinearAlfLuma())
             {
@@ -3795,13 +2553,10 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
               m_alfSliceParamTempNL = m_alfSliceParamTemp;
             }
             else
-#endif
             {
               errNL[1] = MAX_DOUBLE;
             }
-#if JVET_N0242_NON_LINEAR_ALF
             m_alfSliceParamTemp.nonLinearFlag[CHANNEL_TYPE_LUMA] = 0;
-#endif
             errNL[0] = getFilterCoeffAndCost(cs, 0, CHANNEL_TYPE_LUMA, true, 0, bitNL[0], true);
 
             int bitsNewFilterTempLuma = bitNL[0];
@@ -3850,51 +2605,33 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
               if (filterSetIdx < NUM_FIXED_FILTER_SETS)
               {
                 int filterIdx = m_classToFilterMapping[filterSetIdx][classIdx];
-#if JVET_N0242_NON_LINEAR_ALF
                 dist += m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].calcErrorForCoeffs(m_clipDefaultEnc, m_fixedFilterSetCoeff[filterIdx], MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#else
-                dist += calcErrorForCoeffs(m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].E, m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].y, m_fixedFilterSetCoeff[filterIdx], MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#endif
               }
               else
               {
                 short *pCoeff;
-#if JVET_N0242_NON_LINEAR_ALF
                 short *pClipp;
-#endif
                 if (useNewFilter && filterSetIdx == NUM_FIXED_FILTER_SETS)
                 {
                   pCoeff = m_coeffFinal;
-#if JVET_N0242_NON_LINEAR_ALF
                   pClipp = m_clippFinal;
-#endif
                 }
                 else if (useNewFilter)
                 {
                   pCoeff = m_coeffApsLuma[filterSetIdx - 1 - NUM_FIXED_FILTER_SETS];
-#if JVET_N0242_NON_LINEAR_ALF
                   pClipp = m_clippApsLuma[filterSetIdx - 1 - NUM_FIXED_FILTER_SETS];
-#endif
                 }
                 else
                 {
                   pCoeff = m_coeffApsLuma[filterSetIdx - NUM_FIXED_FILTER_SETS];
-#if JVET_N0242_NON_LINEAR_ALF
                   pClipp = m_clippApsLuma[filterSetIdx - NUM_FIXED_FILTER_SETS];
-#endif
                 }
                 for (int i = 0; i < MAX_NUM_ALF_LUMA_COEFF; i++)
                 {
                   m_filterTmp[i] = pCoeff[classIdx * MAX_NUM_ALF_LUMA_COEFF + i];
-#if JVET_N0242_NON_LINEAR_ALF
                   m_clipTmp[i] = pClipp[classIdx * MAX_NUM_ALF_LUMA_COEFF + i];
-#endif
                 }
-#if JVET_N0242_NON_LINEAR_ALF
                 dist += m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].calcErrorForCoeffs(m_clipTmp, m_filterTmp, MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#else
-                dist += calcErrorForCoeffs(m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].E, m_alfCovariance[COMPONENT_Y][0][ctbIdx][classIdx].y, m_filterTmp, MAX_NUM_ALF_LUMA_COEFF, m_NUM_BITS);
-#endif
               }
             }
             //cost
@@ -3970,11 +2707,7 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
     alfSliceParamNewFiltersBest.tLayer = cs.slice->getTLayer();
     cs.slice->setTileGroupAlfEnabledFlag(COMPONENT_Y, true);
     cs.slice->setTileGroupNumAps((int)bestApsIds.size());
-#if JVET_N0805_APS_LMCS
     cs.slice->setAlfAPSs(bestApsIds);
-#else
-    cs.slice->setAPSs(bestApsIds);
-#endif
     copyCtuEnableFlag(m_ctuEnableFlag, m_ctuEnableFlagTmp, CHANNEL_TYPE_LUMA);
     for (int ctuIdx = 0; ctuIdx < m_numCTUsInPic; ctuIdx++)
     {
@@ -3982,38 +2715,22 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
     }
     if (alfSliceParamNewFiltersBest.newFilterFlag[CHANNEL_TYPE_LUMA])
     {
-#if JVET_N0805_APS_LMCS
       APS* newAPS = m_apsMap->getPS((newApsId << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-      APS* newAPS = m_apsMap->getPS(newApsId);
-#endif
       if (newAPS == NULL)
       {
-#if JVET_N0805_APS_LMCS
         newAPS = m_apsMap->allocatePS((newApsId << NUM_APS_TYPE_LEN) + ALF_APS);
         newAPS->setAPSId(newApsId);
         newAPS->setAPSType(ALF_APS);
-#else
-        newAPS = m_apsMap->allocatePS(newApsId);
-#endif
       }
       newAPS->setAlfAPSParam(alfSliceParamNewFiltersBest);
-#if JVET_N0805_APS_LMCS
       m_apsMap->setChangedFlag((newApsId << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-      m_apsMap->setChangedFlag(newApsId);
-#endif
       m_apsIdStart = newApsId;
     }
 
     std::vector<int> apsIds = cs.slice->getTileGroupApsIdLuma();
     for (int i = 0; i < (int)cs.slice->getTileGroupNumAps(); i++)
     {
-#if JVET_N0805_APS_LMCS
       apss[apsIds[i]] = m_apsMap->getPS((apsIds[i] << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-      apss[apsIds[i]] = m_apsMap->getPS(apsIds[i]);
-#endif
     }
   }
 
@@ -4051,11 +2768,7 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
     {
       continue;
     }
-#if JVET_N0805_APS_LMCS
     APS* curAPS = m_apsMap->getPS((curApsId << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-    APS* curAPS = m_apsMap->getPS(curApsId);
-#endif
     double curCost = (cs.slice->isIntra() && cs.slice->getTileGroupNumAps() == 1) ? 0 : (m_lambda[CHANNEL_TYPE_CHROMA] * 5);
     if (curApsId == newApsIdChroma)
     {
@@ -4091,15 +2804,9 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
         for (int i = 0; i < MAX_NUM_ALF_CHROMA_COEFF; i++)
         {
           m_filterTmp[i] = m_chromaCoeffFinal[i];
-#if JVET_N0242_NON_LINEAR_ALF
           m_clipTmp[i] = m_chromaClippFinal[i];
-#endif
         }
-#if JVET_N0242_NON_LINEAR_ALF
         double dist = distUnfilterCtu + m_alfCovariance[compId][0][ctbIdx][0].calcErrorForCoeffs(m_clipTmp, m_filterTmp, MAX_NUM_ALF_CHROMA_COEFF, m_NUM_BITS);
-#else
-        double dist = distUnfilterCtu + calcErrorForCoeffs(m_alfCovariance[compId][0][ctbIdx][0].E, m_alfCovariance[compId][0][ctbIdx][0].y, m_filterTmp, MAX_NUM_ALF_CHROMA_COEFF, m_NUM_BITS);
-#endif
         double costOn = dist + m_lambda[compId] * rateOn;
         ctxTempBest = AlfCtx(m_CABACEstimator->getCtx());
         //cost off
@@ -4148,46 +2855,26 @@ void  EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfSliceParam& a
     copyCtuEnableFlag(m_ctuEnableFlag, m_ctuEnableFlagTmp, CHANNEL_TYPE_CHROMA);
     if (cs.slice->getTileGroupApsIdChroma() == newApsIdChroma)  //new filter
     {
-#if JVET_N0805_APS_LMCS
       APS* newAPS = m_apsMap->getPS((newApsIdChroma << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-      APS* newAPS = m_apsMap->getPS(newApsIdChroma);
-#endif
       if (newAPS == NULL)
       {
-#if JVET_N0805_APS_LMCS
         newAPS = m_apsMap->allocatePS((newApsIdChroma << NUM_APS_TYPE_LEN) + ALF_APS);
         newAPS->setAPSType(ALF_APS);
         newAPS->setAPSId(newApsIdChroma);
-#else
-        newAPS = m_apsMap->allocatePS(newApsIdChroma);
-#endif
         newAPS->getAlfAPSParam().reset();
       }
       newAPS->getAlfAPSParam().newFilterFlag[CHANNEL_TYPE_CHROMA] = true;
-#if JVET_N0242_NON_LINEAR_ALF
       newAPS->getAlfAPSParam().nonLinearFlag[CHANNEL_TYPE_CHROMA] = alfSliceParamNewFilters.nonLinearFlag[CHANNEL_TYPE_CHROMA];
-#endif
       newAPS->getAlfAPSParam().tLayer = cs.slice->getTLayer();
       for (int i = 0; i < MAX_NUM_ALF_CHROMA_COEFF; i++)
       {
         newAPS->getAlfAPSParam().chromaCoeff[i] = alfSliceParamNewFilters.chromaCoeff[i];
-#if JVET_N0242_NON_LINEAR_ALF
         newAPS->getAlfAPSParam().chromaClipp[i] = alfSliceParamNewFilters.chromaClipp[i];
-#endif
       }
-#if JVET_N0805_APS_LMCS
       m_apsMap->setChangedFlag((newApsIdChroma << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-      m_apsMap->setChangedFlag(newApsIdChroma);
-#endif
       m_apsIdStart = newApsIdChroma;
     }
-#if JVET_N0805_APS_LMCS
     apss[cs.slice->getTileGroupApsIdChroma()] = m_apsMap->getPS((cs.slice->getTileGroupApsIdChroma() << NUM_APS_TYPE_LEN) + ALF_APS);
-#else
-    apss[cs.slice->getTileGroupApsIdChroma()] = m_apsMap->getPS(cs.slice->getTileGroupApsIdChroma());
-#endif
   }
 }
 
@@ -4203,12 +2890,10 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
   const PreCalcValues& pcv = *cs.pcv;
 
   int ctuIdx = 0;
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool clipTop = false, clipBottom = false, clipLeft = false, clipRight = false;
   int numHorVirBndry = 0, numVerVirBndry = 0;
   int horVirBndryPos[] = { 0, 0, 0 };
   int verVirBndryPos[] = { 0, 0, 0 };
-#endif
   for (int yPos = 0; yPos < pcv.lumaHeight; yPos += pcv.maxCUHeight)
   {
     for (int xPos = 0; xPos < pcv.lumaWidth; xPos += pcv.maxCUWidth)
@@ -4216,7 +2901,6 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
       const int width = (xPos + pcv.maxCUWidth > pcv.lumaWidth) ? (pcv.lumaWidth - xPos) : pcv.maxCUWidth;
       const int height = (yPos + pcv.maxCUHeight > pcv.lumaHeight) ? (pcv.lumaHeight - yPos) : pcv.maxCUHeight;
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       bool ctuEnableFlag = m_ctuEnableFlag[COMPONENT_Y][ctuIdx];
       for (int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++)
       {
@@ -4253,42 +2937,21 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
               const Area blkDst(xStart, yStart, w, h);
               short filterSetIndex = alfCtuFilterIndex[ctuIdx];
               short *coeff;
-#if JVET_N0242_NON_LINEAR_ALF
               short *clip;
-#endif
               if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
               {
                 coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#if JVET_N0242_NON_LINEAR_ALF
                 clip = m_clippApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#endif
               }
               else
               {
                 coeff = m_fixedFilterSetCoeffDec[filterSetIndex];
-#if JVET_N0242_NON_LINEAR_ALF
                 clip = m_clipDefault;
-#endif
               }
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
               m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
                 , m_alfVBLumaCTUHeight
                 , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
               );
-#else
-              m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs
-                , m_alfVBLumaCTUHeight
-                , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-              );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-              m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-              m_filter7x7Blk(m_classifier, recBuf, buf, blkDst, blkSrc, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif
             }
 
             for (int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++)
@@ -4300,25 +2963,10 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
               {
                 const Area blkSrc(0, 0, w >> chromaScaleX, h >> chromaScaleY);
                 const Area blkDst(xStart >> chromaScaleX, yStart >> chromaScaleY, w >> chromaScaleX, h >> chromaScaleY);
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
                 m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
                   , m_alfVBChmaCTUHeight
                   , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
                 );
-#else
-                m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs
-                  , m_alfVBChmaCTUHeight
-                  , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-                );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-                m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#else
-                m_filter5x5Blk(m_classifier, recBuf, buf, blkDst, blkSrc, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
               }
             }
             
@@ -4330,7 +2978,6 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
       }
       else
       {
-#endif
 
       const UnitArea area(cs.area.chromaFormat, Area(xPos, yPos, width, height));
       if (m_ctuEnableFlag[COMPONENT_Y][ctuIdx])
@@ -4338,64 +2985,21 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
         Area blk(xPos, yPos, width, height);
         short filterSetIndex = alfCtuFilterIndex[ctuIdx];
         short *coeff;
-#if JVET_N0242_NON_LINEAR_ALF
         short *clip;
-#endif
         if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
         {
           coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#if JVET_N0242_NON_LINEAR_ALF
           clip = m_clippApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
-#endif
         }
         else
         {
           coeff = m_fixedFilterSetCoeffDec[filterSetIndex];
-#if JVET_N0242_NON_LINEAR_ALF
           clip = m_clipDefault;
-#endif
         }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
         m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
           , m_alfVBLumaCTUHeight
           , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
         );
-#else
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif
-#else
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#else
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs
-          , m_alfVBLumaCTUHeight
-          , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBLumaPos)
-        );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs);
-#else
-        m_filter7x7Blk(m_classifier, recBuf, recExtBuf, blk, COMPONENT_Y, coeff, m_clpRngs.comp[COMPONENT_Y], cs);
-#endif
-#endif       
-#endif
       }
 
       for (int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++)
@@ -4406,54 +3010,14 @@ void EncAdaptiveLoopFilter::alfReconstructor(CodingStructure& cs, const PelUnitB
         if (m_ctuEnableFlag[compIdx][ctuIdx])
         {
           Area blk(xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
           m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
             , m_alfVBChmaCTUHeight
             , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
           );
-#else
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#else
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-#else		  
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#else
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs
-            , m_alfVBChmaCTUHeight
-            , ((yPos + pcv.maxCUHeight >= pcv.lumaHeight) ? pcv.lumaHeight : m_alfVBChmaPos)
-          );
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, m_chromaCoeffFinal, m_chromaClippFinal, m_clpRngs.comp[compIdx], cs);
-#else
-          m_filter5x5Blk(m_classifier, recBuf, recExtBuf, blk, compID, m_chromaCoeffFinal, m_clpRngs.comp[compIdx], cs);
-#endif
-#endif
-#endif
         }
       }
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       }
-#endif
       ctuIdx++;
     }
   }
 }
-#endif
diff --git a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h
index 7639d8281..3c78d1196 100644
--- a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h
+++ b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h
@@ -41,111 +41,52 @@
 #include "CommonLib/AdaptiveLoopFilter.h"
 
 #include "CABACWriter.h"
-#if JVET_N0242_NON_LINEAR_ALF
 #include "EncCfg.h"
-#endif
 
 struct AlfCovariance
 {
-#if JVET_N0242_NON_LINEAR_ALF
   static constexpr int MaxAlfNumClippingValues = AdaptiveLoopFilter::MaxAlfNumClippingValues;
   using TE = double[MAX_NUM_ALF_LUMA_COEFF][MAX_NUM_ALF_LUMA_COEFF];
   using Ty = double[MAX_NUM_ALF_LUMA_COEFF];
   using TKE = TE[AdaptiveLoopFilter::MaxAlfNumClippingValues][AdaptiveLoopFilter::MaxAlfNumClippingValues];
   using TKy = Ty[AdaptiveLoopFilter::MaxAlfNumClippingValues];
-#endif
 
   int numCoeff;
-#if JVET_N0242_NON_LINEAR_ALF
   int numBins;
   TKy y;
   TKE E;
-#else
-  double *y;
-  double **E;
-#endif
   double pixAcc;
 
   AlfCovariance() {}
   ~AlfCovariance() {}
 
-#if JVET_N0242_NON_LINEAR_ALF
   void create( int size, int num_bins = MaxAlfNumClippingValues )
-#else
-  void create( int size )
-#endif
   {
     numCoeff = size;
-#if JVET_N0242_NON_LINEAR_ALF
     numBins = num_bins;
     std::memset( y, 0, sizeof( y ) );
     std::memset( E, 0, sizeof( E ) );
-#else
-
-    y = new double[numCoeff];
-    E = new double*[numCoeff];
-
-    for( int i = 0; i < numCoeff; i++ )
-    {
-      E[i] = new double[numCoeff];
-    }
-#endif
   }
 
   void destroy()
   {
-#if !JVET_N0242_NON_LINEAR_ALF
-    for( int i = 0; i < numCoeff; i++ )
-    {
-      delete[] E[i];
-      E[i] = nullptr;
-    }
-
-    delete[] E;
-    E = nullptr;
-
-    delete[] y;
-    y = nullptr;
-#endif
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   void reset( int num_bins = -1 )
-#else
-  void reset()
-#endif
   {
-#if JVET_N0242_NON_LINEAR_ALF
     if ( num_bins > 0 )
       numBins = num_bins;
-#endif
     pixAcc = 0;
-#if JVET_N0242_NON_LINEAR_ALF
     std::memset( y, 0, sizeof( y ) );
     std::memset( E, 0, sizeof( E ) );
-#else
-    std::memset( y, 0, sizeof( *y ) * numCoeff );
-    for( int i = 0; i < numCoeff; i++ )
-    {
-      std::memset( E[i], 0, sizeof( *E[i] ) * numCoeff );
-    }
-#endif
   }
 
   const AlfCovariance& operator=( const AlfCovariance& src )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     numCoeff = src.numCoeff;
     numBins = src.numBins;
     std::memcpy( E, src.E, sizeof( E ) );
     std::memcpy( y, src.y, sizeof( y ) );
-#else
-    for( int i = 0; i < numCoeff; i++ )
-    {
-      std::memcpy( E[i], src.E[i], sizeof( *E[i] ) * numCoeff );
-    }
-    std::memcpy( y, src.y, sizeof( *y ) * numCoeff );
-#endif
     pixAcc = src.pixAcc;
 
     return *this;
@@ -153,7 +94,6 @@ struct AlfCovariance
 
   void add( const AlfCovariance& lhs, const AlfCovariance& rhs )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     numCoeff = lhs.numCoeff;
     numBins = lhs.numBins;
     for( int b0 = 0; b0 < numBins; b0++ )
@@ -176,22 +116,11 @@ struct AlfCovariance
         y[b][j] = lhs.y[b][j] + rhs.y[b][j];
       }
     }
-#else
-    for( int j = 0; j < numCoeff; j++ )
-    {
-      for( int i = 0; i < numCoeff; i++ )
-      {
-        E[j][i] = lhs.E[j][i] + rhs.E[j][i];
-      }
-      y[j] = lhs.y[j] + rhs.y[j];
-    }
-#endif
     pixAcc = lhs.pixAcc + rhs.pixAcc;
   }
 
   const AlfCovariance& operator+= ( const AlfCovariance& src )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     for( int b0 = 0; b0 < numBins; b0++ )
     {
       for( int b1 = 0; b1 < numBins; b1++ )
@@ -212,16 +141,6 @@ struct AlfCovariance
         y[b][j] += src.y[b][j];
       }
     }
-#else
-    for( int j = 0; j < numCoeff; j++ )
-    {
-      for( int i = 0; i < numCoeff; i++ )
-      {
-        E[j][i] += src.E[j][i];
-      }
-      y[j] += src.y[j];
-    }
-#endif
     pixAcc += src.pixAcc;
 
     return *this;
@@ -229,7 +148,6 @@ struct AlfCovariance
 
   const AlfCovariance& operator-= ( const AlfCovariance& src )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     for( int b0 = 0; b0 < numBins; b0++ )
     {
       for( int b1 = 0; b1 < numBins; b1++ )
@@ -250,22 +168,11 @@ struct AlfCovariance
         y[b][j] -= src.y[b][j];
       }
     }
-#else
-    for( int j = 0; j < numCoeff; j++ )
-    {
-      for( int i = 0; i < numCoeff; i++ )
-      {
-        E[j][i] -= src.E[j][i];
-      }
-      y[j] -= src.y[j];
-    }
-#endif
     pixAcc -= src.pixAcc;
 
     return *this;
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   void setEyFromClip(const int* clip, TE _E, Ty _y, int size) const
   {
     for (int k=0; k<size; k++)
@@ -307,7 +214,6 @@ private:
   void gnsBacksubstitution( TE R, double* z, int size, double* A ) const;
   void gnsTransposeBacksubstitution( TE U, double* rhs, double* x, int order ) const;
   int  gnsCholeskyDec( TE inpMatr, TE outMatr, int numEq ) const;
-#endif
 };
 
 class EncAdaptiveLoopFilter : public AdaptiveLoopFilter
@@ -321,41 +227,27 @@ public:
   inline std::vector<double>& getLumaLevelWeightTable() { return m_lumaLevelToWeightPLUT; }
 
 private:
-#if JVET_N0242_NON_LINEAR_ALF
   const EncCfg*          m_encCfg;
-#endif
   AlfCovariance***       m_alfCovariance[MAX_NUM_COMPONENT];          // [compIdx][shapeIdx][ctbAddr][classIdx]
   AlfCovariance**        m_alfCovarianceFrame[MAX_NUM_CHANNEL_TYPE];   // [CHANNEL][shapeIdx][classIdx]
   uint8_t*                 m_ctuEnableFlagTmp[MAX_NUM_COMPONENT];
 
   //for RDO
   AlfSliceParam          m_alfSliceParamTemp;
-#if JVET_N0415_CTB_ALF
   ParameterSetMap<APS>*  m_apsMap;
   AlfCovariance          m_alfCovarianceMerged[ALF_NUM_OF_FILTER_TYPES][MAX_NUM_ALF_CLASSES + 2];
-#else
-  AlfCovariance          m_alfCovarianceMerged[ALF_NUM_OF_FILTER_TYPES][MAX_NUM_ALF_CLASSES + 1];
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
   int                    m_alfClipMerged[ALF_NUM_OF_FILTER_TYPES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF];
-#endif
   CABACWriter*           m_CABACEstimator;
   CtxCache*              m_CtxCache;
   double                 m_lambda[MAX_NUM_COMPONENT];
   const double           FracBitsScale = 1.0 / double( 1 << SCALE_BITS );
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  int*                   m_filterCoeffQuant;
-#endif
   int**                  m_filterCoeffSet;
-#if JVET_N0242_NON_LINEAR_ALF
   int**                  m_filterClippSet;
-#endif
   int**                  m_diffFilterCoeff;
   int                    m_kMinTab[MAX_NUM_ALF_LUMA_COEFF];
   int                    m_bitsCoeffScan[m_MAX_SCAN_VAL][m_MAX_EXP_GOLOMB];
   short                  m_filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES];
-#if JVET_N0415_CTB_ALF
   unsigned               m_bitsNewFilter[MAX_NUM_CHANNEL_TYPE];
   int                    m_apsIdStart;
   double                 *m_ctbDistortionFixedFilter;
@@ -364,15 +256,11 @@ private:
   AlfSliceParam          m_alfSliceParamTempNL;
   int                    m_clipDefaultEnc[MAX_NUM_ALF_LUMA_COEFF];
   int                    m_filterTmp[MAX_NUM_ALF_LUMA_COEFF];
-#if JVET_N0242_NON_LINEAR_ALF
   int                    m_clipTmp[MAX_NUM_ALF_LUMA_COEFF];
-#endif
-#endif
 
 public:
   EncAdaptiveLoopFilter();
   virtual ~EncAdaptiveLoopFilter() {}
-#if JVET_N0415_CTB_ALF
   void  initDistortion();
   std::vector<int> getAvaiApsIdsLuma(CodingStructure& cs, int &newApsId);
   void  alfEncoderCtb(CodingStructure& cs, AlfSliceParam& alfSliceParamNewFilters
@@ -381,36 +269,15 @@ public:
 #endif
   );
   void   alfReconstructor(CodingStructure& cs, const PelUnitBuf& recExtBuf);
-#endif
-#if JVET_N0415_CTB_ALF
   void ALFProcess(CodingStructure& cs, const double *lambdas
 #if ENABLE_QPA
     , const double lambdaChromaWeight
 #endif
   );
-#else
-  void ALFProcess( CodingStructure& cs, const double *lambdas,
-#if ENABLE_QPA
-                   const double lambdaChromaWeight,
-#endif
-                   AlfSliceParam& alfSliceParam );
-#endif
-#if JVET_N0415_CTB_ALF
   void initCABACEstimator( CABACEncoder* cabacEncoder, CtxCache* ctxCache, Slice* pcSlice, ParameterSetMap<APS>* apsMap );
-#else
-  void initCABACEstimator( CABACEncoder* cabacEncoder, CtxCache* ctxCache, Slice* pcSlice );
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
   void create( const EncCfg* encCfg, const int picWidth, const int picHeight, const ChromaFormat chromaFormatIDC, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE], const int internalBitDepth[MAX_NUM_CHANNEL_TYPE] );
-#else
-  void create( const int picWidth, const int picHeight, const ChromaFormat chromaFormatIDC, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE], const int internalBitDepth[MAX_NUM_CHANNEL_TYPE] );
-#endif
   void destroy();
-#if JVET_N0242_NON_LINEAR_ALF
   static int lengthGolomb( int coeffVal, int k, bool signed_coeff=true );
-#else
-  static int lengthGolomb( int coeffVal, int k );
-#endif
   static int getGolombKMin( AlfFilterShape& alfShape, const int numFilters, int kMinTab[MAX_NUM_ALF_LUMA_COEFF], int bitsCoeffScan[m_MAX_SCAN_VAL][m_MAX_EXP_GOLOMB] );
 
 private:
@@ -421,90 +288,20 @@ private:
                    );
 
   void   copyAlfSliceParam( AlfSliceParam& alfSliceParamDst, AlfSliceParam& alfSliceParamSrc, ChannelType channel );
-#if JVET_N0242_NON_LINEAR_ALF
   double mergeFiltersAndCost( AlfSliceParam& alfSliceParam, AlfFilterShape& alfShape, AlfCovariance* covFrame, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], int& uiCoeffBits );
-#else
-  double mergeFiltersAndCost( AlfSliceParam& alfSliceParam, AlfFilterShape& alfShape, AlfCovariance* covFrame, AlfCovariance* covMerged, int& uiCoeffBits );
-#endif
 
   void   getFrameStats( ChannelType channel, int iShapeIdx );
   void   getFrameStat( AlfCovariance* frameCov, AlfCovariance** ctbCov, uint8_t* ctbEnableFlags, const int numClasses );
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void   deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnitBuf& recYuv, CodingStructure& cs );
-#else
-  void   deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnitBuf& recYuv );
-#endif
-#if JVET_N0180_ALF_LINE_BUFFER_REDUCTION
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos);
-#else
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos);
-#endif
   void   calcCovariance(int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel, int vbDistance);
   void   mergeClasses(const AlfFilterShape& alfShape, AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], const int numClasses, short filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES]);
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, int vbCTUHeight, int vbPos);
-#else
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area, int vbCTUHeight, int vbPos);
-#endif  
-  void   calcCovariance(int *ELocal, const Pel *rec, const int stride, const int *filterPattern, const int halfFilterLength, const int transposeIdx, int vbDistance);
-  void   mergeClasses(AlfCovariance* cov, AlfCovariance* covMerged, const int numClasses, short filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES]);
-#endif
-#else
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel);
-#else
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area, const ChannelType channel);
-#endif
-  void   calcCovariance(int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel);
-  void   mergeClasses(const AlfFilterShape& alfShape, AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], const int numClasses, short filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES]);
-#else
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area);
-#else
-  void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& area);
-#endif
-  void   calcCovariance(int *ELocal, const Pel *rec, const int stride, const int *filterPattern, const int halfFilterLength, const int transposeIdx);
-  void   mergeClasses(AlfCovariance* cov, AlfCovariance* covMerged, const int numClasses, short filterIndices[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES]);
-#endif
-#endif
 
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  double calculateError( AlfCovariance& cov );
-#if JVET_N0415_CTB_ALF
-  double calcErrorForCoeffs( double **E, double *y, const int *coeff, const int numCoeff, const int bitDepth );
-#else
-  double calcErrorForCoeffs( double **E, double *y, int *coeff, const int numCoeff, const int bitDepth );
-#endif
-#endif
-#if JVET_N0415_CTB_ALF
   double getFilterCoeffAndCost( CodingStructure& cs, double distUnfilter, ChannelType channel, bool bReCollectStat, int iShapeIdx, int& uiCoeffBits, bool onlyFilterCost = false );
-#else
-  double getFilterCoeffAndCost( CodingStructure& cs, double distUnfilter, ChannelType channel, bool bReCollectStat, int iShapeIdx, int& uiCoeffBits );
-#endif
-#if JVET_N0242_NON_LINEAR_ALF
-#if JVET_N0415_CTB_ALF
   double deriveFilterCoeffs(AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], AlfSliceParam& alfSliceParam);
-#else
-  double deriveFilterCoeffs(AlfCovariance* cov, AlfCovariance* covMerged, int clipMerged[MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_CLASSES][MAX_NUM_ALF_LUMA_COEFF], AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2]);
-#endif
-#else
-#if JVET_N0415_CTB_ALF
-  double deriveFilterCoeffs(AlfCovariance* cov, AlfCovariance* covMerged, AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], AlfSliceParam& alfSliceParam);
-#else
-  double deriveFilterCoeffs(AlfCovariance* cov, AlfCovariance* covMerged, AlfFilterShape& alfShape, short* filterIndices, int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2]);
-#endif
-#endif
   int    deriveFilterCoefficientsPredictionMode( AlfFilterShape& alfShape, int **filterSet, int** filterCoeffDiff, const int numFilters, int& predMode );
-#if JVET_N0242_NON_LINEAR_ALF
   double deriveCoeffQuant( int *filterClipp, int *filterCoeffQuant, const AlfCovariance& cov, const AlfFilterShape& shape, const int bitDepth, const bool optimizeClip );
-#else
-  double deriveCoeffQuant( int *filterCoeffQuant, double **E, double *y, const int numCoeff, std::vector<int>& weights, const int bitDepth, const bool bChroma = false );
-#endif
   double deriveCtbAlfEnableFlags( CodingStructure& cs, const int iShapeIdx, ChannelType channel,
 #if ENABLE_QPA
                                   const double chromaWeight,
@@ -520,13 +317,9 @@ private:
 
   int    getCostFilterCoeffForce0( AlfFilterShape& alfShape, int **pDiffQFilterCoeffIntPP, const int numFilters, bool* codedVarBins );
   int    getCostFilterCoeff( AlfFilterShape& alfShape, int **pDiffQFilterCoeffIntPP, const int numFilters );
-#if JVET_N0242_NON_LINEAR_ALF
   int    getCostFilterClipp( AlfFilterShape& alfShape, int **pDiffQFilterCoeffIntPP, const int numFilters );
-#endif
   int    lengthFilterCoeffs( AlfFilterShape& alfShape, const int numFilters, int **FilterCoeff, int* kMinTab );
-#if JVET_N0242_NON_LINEAR_ALF
   int    lengthFilterClipps( AlfFilterShape& alfShape, const int numFilters, int **FilterCoeff, int* kMinTab );
-#endif
   double getDistForce0( AlfFilterShape& alfShape, const int numFilters, double errorTabForce0Coeff[MAX_NUM_ALF_CLASSES][2], bool* codedVarBins );
   int    getCoeffRate( AlfSliceParam& alfSliceParam, bool isChroma );
 
@@ -534,14 +327,6 @@ private:
   double getUnfilteredDistortion( AlfCovariance* cov, const int numClasses );
   double getFilteredDistortion( AlfCovariance* cov, const int numClasses, const int numFiltersMinus1, const int numCoeff );
 
-#if !JVET_N0242_NON_LINEAR_ALF
-  // Cholesky decomposition
-  int  gnsSolveByChol( double **LHS, double *rhs, double *x, int numEq );
-  void gnsBacksubstitution( double R[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], double* z, int size, double* A );
-  void gnsTransposeBacksubstitution( double U[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], double* rhs, double* x, int order );
-  int  gnsCholeskyDec( double **inpMatr, double outMatr[MAX_NUM_ALF_COEFF][MAX_NUM_ALF_COEFF], int numEq );
-
-#endif
   void setEnableFlag( AlfSliceParam& alfSlicePara, ChannelType channel, bool val );
   void setEnableFlag( AlfSliceParam& alfSlicePara, ChannelType channel, uint8_t** ctuFlags );
   void setCtuEnableFlag( uint8_t** ctuFlags, ChannelType channel, uint8_t val );
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index ba959b3b1..9c10f9b7d 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -64,26 +64,13 @@ struct GOPEntry
   int m_betaOffsetDiv2;
   int m_temporalId;
   bool m_refPic;
-#if !JVET_M0128
-  int m_numRefPicsActive;
-#endif
   int8_t m_sliceType;
-#if JVET_M0128
   int m_numRefPicsActive0;
   int m_numRefPics0;
   int m_deltaRefPics0[MAX_NUM_REF_PICS];
   int m_numRefPicsActive1;
   int m_numRefPics1;
   int m_deltaRefPics1[MAX_NUM_REF_PICS];
-#else
-  int m_numRefPics;
-  int m_referencePics[MAX_NUM_REF_PICS];
-  int m_usedByCurrPic[MAX_NUM_REF_PICS];
-  int m_interRPSPrediction;
-  int m_deltaRPS;
-  int m_numRefIdc;
-  int m_refIdc[MAX_NUM_REF_PICS+1];
-#endif
   bool m_isEncoded;
   GOPEntry()
   : m_POC(-1)
@@ -101,35 +88,18 @@ struct GOPEntry
   , m_betaOffsetDiv2(0)
   , m_temporalId(0)
   , m_refPic(false)
-#if !JVET_M0128
-  , m_numRefPicsActive(0)
-#endif
   , m_sliceType('P')
-#if JVET_M0128
     , m_numRefPicsActive0(0)
     , m_numRefPics0(0)
     , m_numRefPicsActive1(0)
     , m_numRefPics1(0)
-#else
-  , m_numRefPics(0)
-  , m_interRPSPrediction(false)
-  , m_deltaRPS(0)
-  , m_numRefIdc(0)
-#endif
   , m_isEncoded(false)
   {
-#if JVET_M0128
     ::memset(m_deltaRefPics0, 0, sizeof(m_deltaRefPics0));
     ::memset(m_deltaRefPics1, 0, sizeof(m_deltaRefPics1));
-#else
-    ::memset( m_referencePics, 0, sizeof(m_referencePics) );
-    ::memset( m_usedByCurrPic, 0, sizeof(m_usedByCurrPic) );
-    ::memset( m_refIdc,        0, sizeof(m_refIdc) );
-#endif
   }
 };
 
-#if JVET_M0128
 struct RPLEntry
 {
   int m_POC;
@@ -152,11 +122,9 @@ struct RPLEntry
     ::memset(m_deltaRefPics, 0, sizeof(m_deltaRefPics));
   }
 };
-#endif
 
 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry);     //input
 
-#if JVET_N0857_TILES_BRICKS
 struct BrickSplit
 {
   int     m_tileIdx;
@@ -177,7 +145,6 @@ struct BrickSplit
 typedef std::map<int, BrickSplit> BrickSplitMap;
 
 std::istringstream &operator>>(std::istringstream &in, BrickSplit &entry);     //input
-#endif
 
 
 //! \ingroup EncoderLib
@@ -214,9 +181,7 @@ protected:
   uint32_t  m_maxChromaFormatConstraintIdc;
   bool      m_bFrameConstraintFlag;
   bool      m_bNoQtbttDualTreeIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noPartitionConstraintsOverrideConstraintFlag;
-#endif
   bool      m_bNoSaoConstraintFlag;
   bool      m_bNoAlfConstraintFlag;
   bool      m_bNoPcmConstraintFlag;
@@ -225,31 +190,18 @@ protected:
   bool      m_bNoSbtmvpConstraintFlag;
   bool      m_bNoAmvrConstraintFlag;
   bool      m_bNoBdofConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noDmvrConstraintFlag;
-#endif
   bool      m_bNoCclmConstraintFlag;
   bool      m_bNoMtsConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noSbtConstraintFlag;
-#endif
   bool      m_bNoAffineMotionConstraintFlag;
   bool      m_bNoGbiConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noIbcConstraintFlag;
-#endif
   bool      m_bNoMhIntraConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noFPelMmvdConstraintFlag;
-#endif
   bool      m_bNoTriangleConstraintFlag;
   bool      m_bNoLadfConstraintFlag;
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      m_noTransformSkipConstraintFlag;
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool      m_bNoCurrPicRefConstraintFlag;
-#endif
   bool      m_bNoQpDeltaConstraintFlag;
   bool      m_bNoDepQuantConstraintFlag;
   bool      m_bNoSignDataHidingConstraintFlag;
@@ -258,9 +210,7 @@ protected:
   Profile::Name m_profile;
   Level::Tier   m_levelTier;
   Level::Name   m_level;
-#if JVET_N0276_CONSTRAINT_FLAGS
   uint32_t      m_subProfile;
-#endif
   bool m_progressiveSourceFlag;
   bool m_interlacedSourceFlag;
   bool m_nonPackedConstraintFlag;
@@ -272,29 +222,16 @@ protected:
   bool              m_lowerBitRateConstraintFlag;
 
   //====== Coding Structure ========
-#if JVET_M0128
   int       m_uiIntraPeriod;                        // needs to be signed to allow '-1' for no intra period
-#else
-  uint32_t      m_uiIntraPeriod;                    // TODO: make this an int - it can be -1!
-#endif
   uint32_t      m_uiDecodingRefreshType;            ///< the type of decoding refresh employed for the random access.
-#if JCTVC_Y0038_PARAMS
   bool      m_rewriteParamSets;
-#endif
-#if JVET_N0047_Merge_IDR_Non_IDR
   bool      m_idrRefParamList;
-#endif
   int       m_iGOPSize;
-#if JVET_M0128
   RPLEntry  m_RPLList0[MAX_GOP];
   RPLEntry  m_RPLList1[MAX_GOP];
   int		    m_numRPLList0;
   int		    m_numRPLList1;
-#endif
   GOPEntry  m_GOPList[MAX_GOP];
-#if !JVET_M0128
-  int       m_extraRPSs;
-#endif
   int       m_maxDecPicBuffering[MAX_TLAYER];
   int       m_numReorderPics[MAX_TLAYER];
 
@@ -331,18 +268,14 @@ protected:
   int       m_InterMTSMaxCand;
   int       m_ImplicitMTS;
   bool      m_SBT;                                ///< Sub-Block Transform for inter blocks
-#if JVET_N0193_LFNST
   bool      m_LFNST;
   bool      m_useFastLFNST;
-#endif
   int       m_SubPuMvpMode;
   bool      m_Affine;
   bool      m_AffineType;
   bool      m_BIO;
 
-#if JVET_N0235_SMVD_SPS
   bool      m_SMVD;
-#endif
   bool      m_compositeRefEnabled;        //composite reference
   bool      m_GBi;
   bool      m_GBiFast;
@@ -360,15 +293,9 @@ protected:
   bool      m_HashME;
   bool      m_AffineAmvrEncOpt;
   bool      m_DMVR;
-#if JVET_N0127_MMVD_SPS_FLAG
   bool      m_MMVD;
-#endif
-#if JVET_N0449_MMVD_SIMP
   int       m_MmvdDisNum;
-#endif
-#if JVET_N0413_RDPCM
   bool      m_RdpcmMode;
-#endif
   unsigned  m_IBCMode;
   unsigned  m_IBCLocalSearchRangeX;
   unsigned  m_IBCLocalSearchRangeY;
@@ -381,13 +308,11 @@ protected:
   unsigned  m_wrapAroundOffset;
 
   // ADD_NEW_TOOL : (encoder lib) add tool enabling flags and associated parameters here
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   bool      m_loopFilterAcrossVirtualBoundariesDisabledFlag;
   unsigned  m_numVerVirtualBoundaries;
   unsigned  m_numHorVirtualBoundaries;
   unsigned  m_virtualBoundariesPosX[3];
   unsigned  m_virtualBoundariesPosY[3];
-#endif
   bool      m_lumaReshapeEnable;
   unsigned  m_reshapeSignalType;
   unsigned  m_intraCMD;
@@ -399,14 +324,10 @@ protected:
   bool      m_useAMaxBT;
   bool      m_e0023FastEnc;
   bool      m_contentBasedFastQtbt;
-#if JVET_N0242_NON_LINEAR_ALF
   bool      m_useNonLinearAlfLuma;
   bool      m_useNonLinearAlfChroma;
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   bool      m_MIP;
   bool      m_useFastMIP;
-#endif
 
 #if MAX_TB_SIZE_SIGNALLING
   uint32_t  m_log2MaxTbSize;
@@ -451,10 +372,8 @@ protected:
   int       m_chromaCrQpOffset;                 //  Chroma Cr Qp Offset (0:default)
   int       m_chromaCbQpOffsetDualTree;         //  Chroma Cb QP Offset for dual tree
   int       m_chromaCrQpOffsetDualTree;         //  Chroma Cr Qp Offset for dual tree
-#if JVET_N0054_JOINT_CHROMA
   int       m_chromaCbCrQpOffset;               //  QP Offset for the joint Cb-Cr mode
   int       m_chromaCbCrQpOffsetDualTree;       //  QP Offset for the joint Cb-Cr mode in dual tree
-#endif
 #if ER_CHROMA_QP_WCG_PPS
   WCGChromaQPControl m_wcgChromaQpControl;                    ///< Wide-colour-gamut chroma QP control.
 #endif
@@ -540,22 +459,15 @@ protected:
 
   bool      m_entropyCodingSyncEnabledFlag;
  
-#if JVET_N0857_TILES_BRICKS
   bool      m_rectSliceFlag;
   int       m_numSlicesInPicMinus1;
-#if JVET_N0857_RECT_SLICES
   std::vector<int> m_topLeftBrickIdx;
   std::vector<int> m_bottomRightBrickIdx;
-#else
-  std::vector<int> m_topLeftTileIdx;
-  std::vector<int> m_bottomRightTileIdx;
-#endif
   bool      m_loopFilterAcrossSlicesEnabledFlag;
   bool      m_signalledSliceIdFlag;
   int       m_signalledSliceIdLengthMinus1;
   std::vector<int> m_sliceId;
   BrickSplitMap m_brickSplitMap;
-#endif
 
   HashType  m_decodedPictureHashSEIType;
   bool      m_bufferingPeriodSEIEnabled;
@@ -636,13 +548,9 @@ protected:
   uint32_t      m_log2ParallelMergeLevelMinus2;       ///< Parallel merge estimation region
   uint32_t      m_maxNumMergeCand;                    ///< Maximum number of merge candidates
   uint32_t      m_maxNumAffineMergeCand;              ///< Maximum number of affine merge candidates
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   uint32_t      m_maxNumTriangleCand;
-#endif
-#if HEVC_USE_SCALING_LISTS
   ScalingListMode m_useScalingListId;             ///< Using quantization matrix i.e. 0=off, 1=default, 2=file.
   std::string m_scalingListFileName;              ///< quantization matrix file name
-#endif
   int       m_TMVPModeId;
   bool      m_DepQuantEnabledFlag;
   bool      m_SignDataHidingEnabledFlag;
@@ -663,16 +571,11 @@ protected:
 
   CostMode  m_costMode;                                       ///< The cost function to use, primarily when considering lossless coding.
 
-#if HEVC_VPS || JVET_N0278_HLS
   VPS       m_cVPS;
-#endif
-#if JVET_N0349_DPS
   DPS       m_dps;
   bool      m_decodingParameterSetEnabled;                   ///< enable decoding parameter set
-#endif
   bool      m_recalculateQPAccordingToLambda;                 ///< recalculate QP value according to the lambda value
   int       m_activeParameterSetsSEIEnabled;                  ///< enable active parameter set SEI message
-#if JVET_N0063_VUI
   bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
   bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
   bool      m_chromaResamplingFilterHintEnabled;              ///< Signals whether chroma sampling filter hint data is present
@@ -693,45 +596,7 @@ protected:
   bool      m_overscanAppropriateFlag;                        ///< Indicates whether conformant decoded pictures are suitable for display using overscan
   bool      m_videoSignalTypePresentFlag;                     ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
   bool      m_videoFullRangeFlag;                             ///< Indicates the black level and range of luma and chroma signals
-#else
-  bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
-  bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
-  bool      m_chromaResamplingFilterHintEnabled;              ///< Signals whether chroma sampling filter hint data is present
-  int       m_chromaResamplingHorFilterIdc;                   ///< Specifies the Index of filter to use
-  int       m_chromaResamplingVerFilterIdc;                   ///< Specifies the Index of filter to use
-  int       m_aspectRatioIdc;                                 ///< aspect_ratio_idc
-  int       m_sarWidth;                                       ///< horizontal size of the sample aspect ratio
-  int       m_sarHeight;                                      ///< vertical size of the sample aspect ratio
-  bool      m_overscanInfoPresentFlag;                        ///< Signals whether overscan_appropriate_flag is present
-  bool      m_overscanAppropriateFlag;                        ///< Indicates whether conformant decoded pictures are suitable for display using overscan
-  bool      m_videoSignalTypePresentFlag;                     ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
-  int       m_videoFormat;                                    ///< Indicates representation of pictures
-  bool      m_videoFullRangeFlag;                             ///< Indicates the black level and range of luma and chroma signals
-  bool      m_colourDescriptionPresentFlag;                   ///< Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present
-  int       m_colourPrimaries;                                ///< Indicates chromaticity coordinates of the source primaries
-  int       m_transferCharacteristics;                        ///< Indicates the opto-electronic transfer characteristics of the source
-  int       m_matrixCoefficients;                             ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries
-  bool      m_chromaLocInfoPresentFlag;                       ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present
-  int       m_chromaSampleLocTypeTopField;                    ///< Specifies the location of chroma samples for top field
-  int       m_chromaSampleLocTypeBottomField;                 ///< Specifies the location of chroma samples for bottom field
-  bool      m_neutralChromaIndicationFlag;                    ///< Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)
-  Window    m_defaultDisplayWindow;                           ///< Represents the default display window parameters
-  bool      m_frameFieldInfoPresentFlag;                      ///< Indicates that pic_struct and other field coding related values are present in picture timing SEI messages
-  bool      m_pocProportionalToTimingFlag;                    ///< Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS
-  int       m_numTicksPocDiffOneMinus1;                       ///< Number of ticks minus 1 that for a POC difference of one
-  bool      m_bitstreamRestrictionFlag;                       ///< Signals whether bitstream restriction parameters are present
-  bool      m_tilesFixedStructureFlag;                        ///< Indicates that each active picture parameter set has the same values of the syntax elements related to tiles
-  bool      m_motionVectorsOverPicBoundariesFlag;             ///< Indicates that no samples outside the picture boundaries are used for inter prediction
-  int       m_minSpatialSegmentationIdc;                      ///< Indicates the maximum size of the spatial segments in the pictures in the coded video sequence
-  int       m_maxBytesPerPicDenom;                            ///< Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with any coded picture
-  int       m_maxBitsPerMinCuDenom;                           ///< Indicates an upper bound for the number of bits of coding_unit() data
-  int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
-  int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
-#endif
 
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  bool      m_useStrongIntraSmoothing;                        ///< enable the use of strong intra smoothing (bi_linear interpolation) for 32x32 blocks when reference samples are flat.
-#endif
   bool      m_bEfficientFieldIRAPEnabled;                     ///< enable to code fields in a specific, potentially more efficient, order.
   bool      m_bHarmonizeGopFirstFieldCoupleEnabled;
 
@@ -777,9 +642,7 @@ public:
 
   void setProfile(Profile::Name profile) { m_profile = profile; }
   void setLevel(Level::Tier tier, Level::Name level) { m_levelTier = tier; m_level = level; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   void setSubProfile(uint32_t subProfile) { m_subProfile = subProfile; }
-#endif
 
   bool      getIntraOnlyConstraintFlag() const { return m_bIntraOnlyConstraintFlag; }
   void      setIntraOnlyConstraintFlag(bool bVal) { m_bIntraOnlyConstraintFlag = bVal; }
@@ -791,10 +654,8 @@ public:
   void      setFrameConstraintFlag(bool bVal) { m_bFrameConstraintFlag = bVal; }
   bool      getNoQtbttDualTreeIntraConstraintFlag() const { return m_bNoQtbttDualTreeIntraConstraintFlag; }
   void      setNoQtbttDualTreeIntraConstraintFlag(bool bVal) { m_bNoQtbttDualTreeIntraConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      getNoPartitionConstraintsOverrideConstraintFlag() const { return m_noPartitionConstraintsOverrideConstraintFlag; }
   void      setNoPartitionConstraintsOverrideConstraintFlag(bool bVal) { m_noPartitionConstraintsOverrideConstraintFlag = bVal; }
-#endif
   bool      getNoSaoConstraintFlag() const { return m_bNoSaoConstraintFlag; }
   void      setNoSaoConstraintFlag(bool bVal) { m_bNoSaoConstraintFlag = bVal; }
   bool      getNoAlfConstraintFlag() const { return m_bNoAlfConstraintFlag; }
@@ -811,44 +672,30 @@ public:
   void      setNoAmvrConstraintFlag(bool bVal) { m_bNoAmvrConstraintFlag = bVal; }
   bool      getNoBdofConstraintFlag() const { return m_bNoBdofConstraintFlag; }
   void      setNoBdofConstraintFlag(bool bVal) { m_bNoBdofConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      getNoDmvrConstraintFlag() const { return m_noDmvrConstraintFlag; }
   void      setNoDmvrConstraintFlag(bool bVal) { m_noDmvrConstraintFlag = bVal; }
-#endif
   bool      getNoCclmConstraintFlag() const { return m_bNoCclmConstraintFlag; }
   void      setNoCclmConstraintFlag(bool bVal) { m_bNoCclmConstraintFlag = bVal; }
   bool      getNoMtsConstraintFlag() const { return m_bNoMtsConstraintFlag; }
   void      setNoMtsConstraintFlag(bool bVal) { m_bNoMtsConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      getNoSbtConstraintFlag() const { return m_noSbtConstraintFlag; }
   void      setNoSbtConstraintFlag(bool bVal) { m_noSbtConstraintFlag = bVal; }
-#endif
   bool      getNoAffineMotionConstraintFlag() const { return m_bNoAffineMotionConstraintFlag; }
   void      setNoAffineMotionConstraintFlag(bool bVal) { m_bNoAffineMotionConstraintFlag = bVal; }
   bool      getNoGbiConstraintFlag() const { return m_bNoGbiConstraintFlag; }
   void      setNoGbiConstraintFlag(bool bVal) { m_bNoGbiConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      getNoIbcConstraintFlag() const { return m_noIbcConstraintFlag; }
   void      setNoIbcConstraintFlag(bool bVal) { m_noIbcConstraintFlag = bVal; }
-#endif
   bool      getNoMhIntraConstraintFlag() const { return m_bNoMhIntraConstraintFlag; }
   void      setNoMhIntraConstraintFlag(bool bVal) { m_bNoMhIntraConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      getNoFPelMmvdConstraintFlag() const { return m_noFPelMmvdConstraintFlag; }
   void      setNoFPelMmvdConstraintFlag(bool bVal) { m_noFPelMmvdConstraintFlag = bVal; }
-#endif
   bool      getNoTriangleConstraintFlag() const { return m_bNoTriangleConstraintFlag; }
   void      setNoTriangleConstraintFlag(bool bVal) { m_bNoTriangleConstraintFlag = bVal; }
   bool      getNoLadfConstraintFlag() const { return m_bNoLadfConstraintFlag; }
   void      setNoLadfConstraintFlag(bool bVal) { m_bNoLadfConstraintFlag = bVal; }
-#if JVET_N0276_CONSTRAINT_FLAGS
   bool      getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
   void      setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; }
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  bool      getNoCurrPicRefConstraintFlag() const { return m_bNoCurrPicRefConstraintFlag; }
-  void      setNoCurrPicRefConstraintFlag(bool bVal) { m_bNoCurrPicRefConstraintFlag = bVal; }
-#endif
   bool      getNoQpDeltaConstraintFlag() const { return m_bNoQpDeltaConstraintFlag; }
   void      setNoQpDeltaConstraintFlag(bool bVal) { m_bNoQpDeltaConstraintFlag = bVal; }
   bool      getNoDepQuantConstraintFlag() const { return m_bNoDepQuantConstraintFlag; }
@@ -883,29 +730,14 @@ public:
   void      setCabacZeroWordPaddingEnabled(bool value)       { m_cabacZeroWordPaddingEnabled = value; }
 
   //====== Coding Structure ========
-#if JVET_M0128
   void      setIntraPeriod                  (int   i)        { m_uiIntraPeriod = i;                   }
-#else
-  void      setIntraPeriod                  ( int   i )      { m_uiIntraPeriod = (uint32_t)i; }
-#endif
   void      setDecodingRefreshType          ( int   i )      { m_uiDecodingRefreshType = (uint32_t)i; }
-#if JCTVC_Y0038_PARAMS
   void      setReWriteParamSets             ( bool  b )      { m_rewriteParamSets = b; }
-#endif
-#if JVET_N0047_Merge_IDR_Non_IDR
   void      setIDRRefParamListPresent       ( bool  b )      { m_idrRefParamList  = b; }
   bool      getIDRRefParamListPresent       ()        const  { return m_idrRefParamList; }
-#endif
   void      setGOPSize                      ( int   i )      { m_iGOPSize = i; }
   void      setGopList(const GOPEntry GOPList[MAX_GOP]) { for (int i = 0; i < MAX_GOP; i++) m_GOPList[i] = GOPList[i]; }
-#if !JVET_M0128
-  void      setExtraRPSs                    ( int   i )      { m_extraRPSs = i; }
-#endif
   const GOPEntry &getGOPEntry               ( int   i ) const { return m_GOPList[i]; }
-#if !JVET_M0128
-  void      setEncodedFlag                  ( int  i, bool value )  { m_GOPList[i].m_isEncoded = value; }
-#endif
-#if JVET_M0128
   void      setRPLList0(const RPLEntry RPLList[MAX_GOP])
   {
     m_numRPLList0 = 0;
@@ -927,7 +759,6 @@ public:
   const RPLEntry &getRPLEntry(int L01, int idx) const { return (L01 == 0) ? m_RPLList0[idx] : m_RPLList1[idx]; }
   int       getRPLCandidateSize(int L01) const { return  (L01 == 0) ? m_numRPLList0 : m_numRPLList1; }
   void      setEncodedFlag(uint32_t  i, bool value) { m_RPLList0[i].m_isEncoded = value; m_RPLList1[i].m_isEncoded = value; }
-#endif
   void      setMaxDecPicBuffering           ( uint32_t u, uint32_t tlayer ) { m_maxDecPicBuffering[tlayer] = u;    }
   void      setNumReorderPics               ( int  i, uint32_t tlayer ) { m_numReorderPics[tlayer] = i;    }
 
@@ -957,12 +788,10 @@ public:
   void      setDualITree                    ( bool b )       { m_dualITree = b; }
   bool      getDualITree                    ()         const { return m_dualITree; }
 
-#if JVET_N0193_LFNST
   void      setLFNST                        ( bool b )       { m_LFNST = b; }
   bool      getLFNST()                                 const { return m_LFNST; }
   void      setUseFastLFNST                 ( bool b )       { m_useFastLFNST = b; }
   bool      getUseFastLFNST()                          const { return m_useFastLFNST; }
-#endif
 
   void      setUseLMChroma                  ( int n )        { m_LMChroma = n; }
   int       getUseLMChroma()                           const { return m_LMChroma; }
@@ -994,10 +823,8 @@ public:
 
   void      setUseCompositeRef              (bool b)         { m_compositeRefEnabled = b; }
   bool      getUseCompositeRef              ()         const { return m_compositeRefEnabled; }
-#if JVET_N0235_SMVD_SPS
   void      setUseSMVD                      ( bool b )       { m_SMVD = b; }
   bool      getUseSMVD                      ()         const { return m_SMVD; }
-#endif
   void      setUseGBi                       ( bool b )       { m_GBi = b; }
   bool      getUseGBi                       ()         const { return m_GBi; }
   void      setUseGBiFast                   ( uint32_t b )   { m_GBiFast = b; }
@@ -1029,18 +856,12 @@ public:
   bool      getUseAffineAmvrEncOpt          ()         const { return m_AffineAmvrEncOpt; }
   void      setDMVR                      ( bool b )       { m_DMVR = b; }
   bool      getDMVR                      ()         const { return m_DMVR; }
-#if JVET_N0127_MMVD_SPS_FLAG
   void      setMMVD                         (bool b)         { m_MMVD = b;    }
   bool      getMMVD                         ()         const { return m_MMVD; }
-#endif
-#if JVET_N0449_MMVD_SIMP
   void      setMmvdDisNum                   ( int b )        { m_MmvdDisNum = b; }
   int       getMmvdDisNum                   ()         const { return m_MmvdDisNum; }
-#endif
-#if JVET_N0413_RDPCM
   void      setRDPCM                     ( bool b )       { m_RdpcmMode = b; }
   bool      getRDPCM                     ()         const { return m_RdpcmMode; }
-#endif
   void      setIBCMode                      (unsigned n)     { m_IBCMode = n; }
   unsigned  getIBCMode                      ()         const { return m_IBCMode; }
   void      setIBCLocalSearchRangeX         (unsigned n)     { m_IBCLocalSearchRangeX = n; }
@@ -1062,7 +883,6 @@ public:
   unsigned  getWrapAroundOffset             ()         const { return m_wrapAroundOffset; }
 
   // ADD_NEW_TOOL : (encoder lib) add access functions here
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   void      setLoopFilterAcrossVirtualBoundariesDisabledFlag( bool b ) { m_loopFilterAcrossVirtualBoundariesDisabledFlag = b; }
   bool      getLoopFilterAcrossVirtualBoundariesDisabledFlag() const { return m_loopFilterAcrossVirtualBoundariesDisabledFlag; }
   void      setNumVerVirtualBoundaries      ( unsigned u )   { m_numVerVirtualBoundaries = u; }
@@ -1073,7 +893,6 @@ public:
   unsigned  getVirtualBoundariesPosX        ( unsigned idx ) const { return m_virtualBoundariesPosX[idx]; }
   void      setVirtualBoundariesPosY        ( unsigned u, unsigned idx ) { m_virtualBoundariesPosY[idx] = u; }
   unsigned  getVirtualBoundariesPosY        ( unsigned idx ) const { return m_virtualBoundariesPosY[idx]; }
-#endif
 #if INCLUDE_ISP_CFG_FLAG
   void      setUseISP                       ( bool b )       { m_ISP = b; }
   bool      getUseISP                       ()         const { return m_ISP; }
@@ -1109,18 +928,14 @@ public:
   bool      getUseE0023FastEnc              () const         { return m_e0023FastEnc; }
   void      setUseContentBasedFastQtbt      ( bool b )       { m_contentBasedFastQtbt = b; }
   bool      getUseContentBasedFastQtbt      () const         { return m_contentBasedFastQtbt; }
-#if JVET_N0242_NON_LINEAR_ALF
   void      setUseNonLinearAlfLuma          ( bool b )       { m_useNonLinearAlfLuma = b; }
   bool      getUseNonLinearAlfLuma          () const         { return m_useNonLinearAlfLuma; }
   void      setUseNonLinearAlfChroma        ( bool b )       { m_useNonLinearAlfChroma = b; }
   bool      getUseNonLinearAlfChroma        () const         { return m_useNonLinearAlfChroma; }
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   void      setUseMIP                       ( bool b )       { m_MIP = b; }
   bool      getUseMIP                       () const         { return m_MIP; }
   void      setUseFastMIP                   ( bool b )       { m_useFastMIP = b; }
   bool      getUseFastMIP                   () const         { return m_useFastMIP; }
-#endif
 
 #if MAX_TB_SIZE_SIGNALLING
   void      setLog2MaxTbSize                ( uint32_t  u )   { m_log2MaxTbSize = u; }
@@ -1158,11 +973,9 @@ public:
   void      setChromaCrQpOffsetDualTree     ( int   i )      { m_chromaCrQpOffsetDualTree = i; }
   int       getChromaCbQpOffsetDualTree     ()         const { return m_chromaCbQpOffsetDualTree; }
   int       getChromaCrQpOffsetDualTree     ()         const { return m_chromaCrQpOffsetDualTree; }
-#if JVET_N0054_JOINT_CHROMA
   void      setChromaCbCrQpOffset           ( int   i )      { m_chromaCbCrQpOffset = i; }
   void      setChromaCbCrQpOffsetDualTree   ( int   i )      { m_chromaCbCrQpOffsetDualTree = i; }
   int       getChromaCbCrQpOffsetDualTree   ()         const { return m_chromaCbCrQpOffsetDualTree; }
-#endif
 #if ER_CHROMA_QP_WCG_PPS
   void      setWCGChromaQpControl           ( const WCGChromaQPControl &ctrl )     { m_wcgChromaQpControl = ctrl; }
   const WCGChromaQPControl &getWCGChromaQPControl () const { return m_wcgChromaQpControl; }
@@ -1217,9 +1030,7 @@ public:
   //==== Coding Structure ========
   uint32_t      getIntraPeriod                  () const     { return  m_uiIntraPeriod; }
   uint32_t      getDecodingRefreshType          () const     { return  m_uiDecodingRefreshType; }
-#if JCTVC_Y0038_PARAMS
   bool      getReWriteParamSets             ()  const    { return m_rewriteParamSets; }
-#endif
   int       getGOPSize                      () const     { return  m_iGOPSize; }
   int       getMaxDecPicBuffering           (uint32_t tlayer) { return m_maxDecPicBuffering[tlayer]; }
   int       getNumReorderPics               (uint32_t tlayer) { return m_numReorderPics[tlayer]; }
@@ -1396,22 +1207,14 @@ public:
   void  setRowHeight ( const std::vector<int>& rowHeight)            { m_tileRowHeight = rowHeight; }
   uint32_t  getRowHeight                   ( uint32_t rowIdx )               { return m_tileRowHeight[rowIdx]; }
 
-#if JVET_N0857_TILES_BRICKS
   bool  getRectSliceFlag() const                                     { return m_rectSliceFlag; }
   void  setRectSliceFlag(bool val)                                   { m_rectSliceFlag = val; }
   int   getNumSlicesInPicMinus1() const                              { return m_numSlicesInPicMinus1; }
   void  setNumSlicesInPicMinus1(int val)                             { m_numSlicesInPicMinus1 = val; }
-#if JVET_N0857_RECT_SLICES
   int   getTopLeftBrickIdx(uint32_t columnIdx) const                 { return  m_topLeftBrickIdx[columnIdx]; }
   void  setTopLeftBrickIdx(const std::vector<int>& val)              { m_topLeftBrickIdx = val; }
   int   getBottomeRightBrickIdx(uint32_t columnIdx) const            { return  m_bottomRightBrickIdx[columnIdx]; }
   void  setBottomRightBrickIdx(const std::vector<int>& val)          { m_bottomRightBrickIdx = val; }
-#else
-  int   getTopLeftTileIdx(uint32_t columnIdx) const                  { return  m_topLeftTileIdx[columnIdx]; }
-  void  setTopLeftTileIdx(const std::vector<int>& val)               { m_topLeftTileIdx = val; }
-  int   getBottomeRightTileIdx(uint32_t columnIdx) const             { return  m_bottomRightTileIdx[columnIdx]; }
-  void  setBottomRightTileIdx(const std::vector<int>& val)           { m_bottomRightTileIdx = val; }
-#endif
   bool  getLoopFilterAcrossSlicesEnabledFlag() const                 { return m_loopFilterAcrossSlicesEnabledFlag; }
   void  setLoopFilterAcrossSlicesEnabledFlag(bool val)               { m_loopFilterAcrossSlicesEnabledFlag = val; }
   bool  getSignalledSliceIdFlag() const                              { return m_signalledSliceIdFlag; }
@@ -1422,7 +1225,6 @@ public:
   void  setSliceId(const std::vector<int>& val)                      { m_sliceId = val; }
   BrickSplitMap getBrickSplitMap() const                             { return  m_brickSplitMap; }
   void  setBrickSplitMap(const BrickSplitMap& val)                   { m_brickSplitMap = val; }
-#endif
 
   void  xCheckGSParameters();
   void  setEntropyCodingSyncEnabledFlag(bool b)                      { m_entropyCodingSyncEnabledFlag = b; }
@@ -1581,26 +1383,20 @@ public:
   uint32_t         getMaxNumMergeCand                ()                  { return m_maxNumMergeCand;   }
   void         setMaxNumAffineMergeCand          ( uint32_t u )      { m_maxNumAffineMergeCand = u;    }
   uint32_t     getMaxNumAffineMergeCand          ()                  { return m_maxNumAffineMergeCand; }
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   void         setMaxNumTriangleCand             ( uint32_t u )      { m_maxNumTriangleCand = u;    }
   uint32_t     getMaxNumTriangleCand             ()                  { return m_maxNumTriangleCand; }
-#endif
-#if HEVC_USE_SCALING_LISTS
   void         setUseScalingListId    ( ScalingListMode u )          { m_useScalingListId       = u;   }
   ScalingListMode getUseScalingListId    ()                          { return m_useScalingListId;      }
   void         setScalingListFileName       ( const std::string &s ) { m_scalingListFileName = s;      }
   const std::string& getScalingListFileName () const                 { return m_scalingListFileName;   }
-#endif
   void         setTMVPModeId ( int  u )                              { m_TMVPModeId = u;    }
   int          getTMVPModeId ()                                      { return m_TMVPModeId; }
   WeightedPredictionMethod getWeightedPredictionMethod() const       { return m_weightedPredictionMethod; }
   void         setWeightedPredictionMethod( WeightedPredictionMethod m ) { m_weightedPredictionMethod = m; }
   void         setDepQuantEnabledFlag( bool b )                      { m_DepQuantEnabledFlag = b;    }
   bool         getDepQuantEnabledFlag()                              { return m_DepQuantEnabledFlag; }
-#if HEVC_USE_SIGN_HIDING
   void         setSignDataHidingEnabledFlag( bool b )                { m_SignDataHidingEnabledFlag = b;    }
   bool         getSignDataHidingEnabledFlag()                        { return m_SignDataHidingEnabledFlag; }
-#endif
   bool         getUseRateCtrl         () const                       { return m_RCEnableRateControl;   }
   void         setUseRateCtrl         ( bool b )                     { m_RCEnableRateControl = b;      }
   int          getTargetBitrate       ()                             { return m_RCTargetBitrate;       }
@@ -1630,22 +1426,13 @@ public:
   CostMode     getCostMode( ) const                                  { return m_costMode; }
   void         setCostMode(CostMode m )                              { m_costMode = m; }
 
-#if HEVC_VPS || JVET_N0278_HLS
   void         setVPS(VPS *p)                                        { m_cVPS = *p; }
   VPS *        getVPS()                                              { return &m_cVPS; }
-#endif
-#if JVET_N0349_DPS
   void         setDPS(DPS *p)                                        { m_dps = *p; }
   DPS*         getDPS()                                              { return &m_dps; }
-#endif
   void         setUseRecalculateQPAccordingToLambda (bool b)         { m_recalculateQPAccordingToLambda = b;    }
   bool         getUseRecalculateQPAccordingToLambda ()               { return m_recalculateQPAccordingToLambda; }
 
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  void         setUseStrongIntraSmoothing ( bool b )                 { m_useStrongIntraSmoothing = b;    }
-  bool         getUseStrongIntraSmoothing ()                         { return m_useStrongIntraSmoothing; }
-
-#endif
   void         setEfficientFieldIRAPEnabled( bool b )                { m_bEfficientFieldIRAPEnabled = b; }
   bool         getEfficientFieldIRAPEnabled( ) const                 { return m_bEfficientFieldIRAPEnabled; }
 
@@ -1655,11 +1442,8 @@ public:
   void         setActiveParameterSetsSEIEnabled ( int b )            { m_activeParameterSetsSEIEnabled = b; }
   int          getActiveParameterSetsSEIEnabled ()                   { return m_activeParameterSetsSEIEnabled; }
 
-#if JVET_N0063_VUI
-#if JVET_N0349_DPS
   bool         getDecodingParameterSetEnabled()                      { return m_decodingParameterSetEnabled; }
   void         setDecodingParameterSetEnabled(bool i)                { m_decodingParameterSetEnabled = i; }
-#endif
   bool         getVuiParametersPresentFlag()                         { return m_vuiParametersPresentFlag; }
   void         setVuiParametersPresentFlag(bool i)                   { m_vuiParametersPresentFlag = i; }
   bool         getAspectRatioInfoPresentFlag()                       { return m_aspectRatioInfoPresentFlag; }
@@ -1694,72 +1478,6 @@ public:
   void         setVideoSignalTypePresentFlag(bool i)                 { m_videoSignalTypePresentFlag = i; }
   bool         getVideoFullRangeFlag()                               { return m_videoFullRangeFlag; }
   void         setVideoFullRangeFlag(bool i)                         { m_videoFullRangeFlag = i; }
-#else
-  bool         getVuiParametersPresentFlag()                         { return m_vuiParametersPresentFlag; }
-  void         setVuiParametersPresentFlag(bool i)                   { m_vuiParametersPresentFlag = i; }
-#if JVET_N0349_DPS
-  bool         getDecodingParameterSetEnabled()                      { return m_decodingParameterSetEnabled; }
-  void         setDecodingParameterSetEnabled(bool i)                { m_decodingParameterSetEnabled = i; }
-#endif
-  bool         getAspectRatioInfoPresentFlag()                       { return m_aspectRatioInfoPresentFlag; }
-  void         setAspectRatioInfoPresentFlag(bool i)                 { m_aspectRatioInfoPresentFlag = i; }
-  int          getAspectRatioIdc()                                   { return m_aspectRatioIdc; }
-  void         setAspectRatioIdc(int i)                              { m_aspectRatioIdc = i; }
-  int          getSarWidth()                                         { return m_sarWidth; }
-  void         setSarWidth(int i)                                    { m_sarWidth = i; }
-  int          getSarHeight()                                        { return m_sarHeight; }
-  void         setSarHeight(int i)                                   { m_sarHeight = i; }
-  bool         getOverscanInfoPresentFlag()                          { return m_overscanInfoPresentFlag; }
-  void         setOverscanInfoPresentFlag(bool i)                    { m_overscanInfoPresentFlag = i; }
-  bool         getOverscanAppropriateFlag()                          { return m_overscanAppropriateFlag; }
-  void         setOverscanAppropriateFlag(bool i)                    { m_overscanAppropriateFlag = i; }
-  bool         getVideoSignalTypePresentFlag()                       { return m_videoSignalTypePresentFlag; }
-  void         setVideoSignalTypePresentFlag(bool i)                 { m_videoSignalTypePresentFlag = i; }
-  int          getVideoFormat()                                      { return m_videoFormat; }
-  void         setVideoFormat(int i)                                 { m_videoFormat = i; }
-  bool         getVideoFullRangeFlag()                               { return m_videoFullRangeFlag; }
-  void         setVideoFullRangeFlag(bool i)                         { m_videoFullRangeFlag = i; }
-  bool         getColourDescriptionPresentFlag()                     { return m_colourDescriptionPresentFlag; }
-  void         setColourDescriptionPresentFlag(bool i)               { m_colourDescriptionPresentFlag = i; }
-  int          getColourPrimaries()                                  { return m_colourPrimaries; }
-  void         setColourPrimaries(int i)                             { m_colourPrimaries = i; }
-  int          getTransferCharacteristics()                          { return m_transferCharacteristics; }
-  void         setTransferCharacteristics(int i)                     { m_transferCharacteristics = i; }
-  int          getMatrixCoefficients()                               { return m_matrixCoefficients; }
-  void         setMatrixCoefficients(int i)                          { m_matrixCoefficients = i; }
-  bool         getChromaLocInfoPresentFlag()                         { return m_chromaLocInfoPresentFlag; }
-  void         setChromaLocInfoPresentFlag(bool i)                   { m_chromaLocInfoPresentFlag = i; }
-  int          getChromaSampleLocTypeTopField()                      { return m_chromaSampleLocTypeTopField; }
-  void         setChromaSampleLocTypeTopField(int i)                 { m_chromaSampleLocTypeTopField = i; }
-  int          getChromaSampleLocTypeBottomField()                   { return m_chromaSampleLocTypeBottomField; }
-  void         setChromaSampleLocTypeBottomField(int i)              { m_chromaSampleLocTypeBottomField = i; }
-  bool         getNeutralChromaIndicationFlag()                      { return m_neutralChromaIndicationFlag; }
-  void         setNeutralChromaIndicationFlag(bool i)                { m_neutralChromaIndicationFlag = i; }
-  Window      &getDefaultDisplayWindow()                             { return m_defaultDisplayWindow; }
-  void         setDefaultDisplayWindow (int offsetLeft, int offsetRight, int offsetTop, int offsetBottom ) { m_defaultDisplayWindow.setWindow (offsetLeft, offsetRight, offsetTop, offsetBottom); }
-  bool         getFrameFieldInfoPresentFlag()                        { return m_frameFieldInfoPresentFlag; }
-  void         setFrameFieldInfoPresentFlag(bool i)                  { m_frameFieldInfoPresentFlag = i; }
-  bool         getPocProportionalToTimingFlag()                      { return m_pocProportionalToTimingFlag; }
-  void         setPocProportionalToTimingFlag(bool x)                { m_pocProportionalToTimingFlag = x;    }
-  int          getNumTicksPocDiffOneMinus1()                         { return m_numTicksPocDiffOneMinus1;    }
-  void         setNumTicksPocDiffOneMinus1(int x)                    { m_numTicksPocDiffOneMinus1 = x;       }
-  bool         getBitstreamRestrictionFlag()                         { return m_bitstreamRestrictionFlag; }
-  void         setBitstreamRestrictionFlag(bool i)                   { m_bitstreamRestrictionFlag = i; }
-  bool         getTilesFixedStructureFlag()                          { return m_tilesFixedStructureFlag; }
-  void         setTilesFixedStructureFlag(bool i)                    { m_tilesFixedStructureFlag = i; }
-  bool         getMotionVectorsOverPicBoundariesFlag()               { return m_motionVectorsOverPicBoundariesFlag; }
-  void         setMotionVectorsOverPicBoundariesFlag(bool i)         { m_motionVectorsOverPicBoundariesFlag = i; }
-  int          getMinSpatialSegmentationIdc()                        { return m_minSpatialSegmentationIdc; }
-  void         setMinSpatialSegmentationIdc(int i)                   { m_minSpatialSegmentationIdc = i; }
-  int          getMaxBytesPerPicDenom()                              { return m_maxBytesPerPicDenom; }
-  void         setMaxBytesPerPicDenom(int i)                         { m_maxBytesPerPicDenom = i; }
-  int          getMaxBitsPerMinCuDenom()                             { return m_maxBitsPerMinCuDenom; }
-  void         setMaxBitsPerMinCuDenom(int i)                        { m_maxBitsPerMinCuDenom = i; }
-  int          getLog2MaxMvLengthHorizontal()                        { return m_log2MaxMvLengthHorizontal; }
-  void         setLog2MaxMvLengthHorizontal(int i)                   { m_log2MaxMvLengthHorizontal = i; }
-  int          getLog2MaxMvLengthVertical()                          { return m_log2MaxMvLengthVertical; }
-  void         setLog2MaxMvLengthVertical(int i)                     { m_log2MaxMvLengthVertical = i; }
-#endif
 
   bool         getProgressiveSourceFlag() const                      { return m_progressiveSourceFlag; }
   void         setProgressiveSourceFlag(bool b)                      { m_progressiveSourceFlag = b; }
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 48c03b797..d72f65eec 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -65,11 +65,7 @@ extern std::recursive_mutex g_cache_mutex;
 // ====================================================================================================================
 // Constructor / destructor / create / destroy
 // ====================================================================================================================
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
 EncCu::EncCu() : m_triangleModeTest
-#else
-const TriangleMotionInfo  EncCu::m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS] =
-#endif
 {
   TriangleMotionInfo( 0, 1, 0 ), TriangleMotionInfo( 1, 0, 1 ), TriangleMotionInfo( 1, 0, 2 ), TriangleMotionInfo( 0, 0, 1 ), TriangleMotionInfo( 0, 2, 0 ),
   TriangleMotionInfo( 1, 0, 3 ), TriangleMotionInfo( 1, 0, 4 ), TriangleMotionInfo( 1, 1, 0 ), TriangleMotionInfo( 0, 3, 0 ), TriangleMotionInfo( 0, 4, 0 ),
@@ -79,12 +75,8 @@ const TriangleMotionInfo  EncCu::m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS] =
   TriangleMotionInfo( 1, 3, 4 ), TriangleMotionInfo( 1, 4, 0 ), TriangleMotionInfo( 1, 3, 1 ), TriangleMotionInfo( 1, 2, 3 ), TriangleMotionInfo( 1, 4, 1 ),
   TriangleMotionInfo( 0, 4, 1 ), TriangleMotionInfo( 0, 2, 3 ), TriangleMotionInfo( 1, 4, 2 ), TriangleMotionInfo( 0, 3, 2 ), TriangleMotionInfo( 1, 4, 3 ),
   TriangleMotionInfo( 0, 3, 1 ), TriangleMotionInfo( 0, 2, 4 ), TriangleMotionInfo( 1, 2, 4 ), TriangleMotionInfo( 0, 4, 2 ), TriangleMotionInfo( 0, 3, 4 ),
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
 }
 {}
-#else
-};
-#endif
 
 void EncCu::create( EncCfg* encCfg )
 {
@@ -139,7 +131,6 @@ void EncCu::create( EncCfg* encCfg )
   {
     m_acRealMergeBuffer[ui].create(chromaFormat, Area(0, 0, uiMaxWidth, uiMaxHeight));
   }
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   const unsigned maxNumTriangleCand = encCfg->getMaxNumTriangleCand();
   for (unsigned i = 0; i < maxNumTriangleCand; i++)
   {
@@ -172,20 +163,6 @@ void EncCu::create( EncCfg* encCfg )
       }
     }
   }
-#else
-  for( unsigned ui = 0; ui < TRIANGLE_MAX_NUM_UNI_CANDS; ui++ )
-  {
-    for( unsigned uj = 0; uj < TRIANGLE_MAX_NUM_UNI_CANDS; uj++ )
-    {
-      if(ui == uj)
-        continue;
-      uint8_t idxBits0 = ui + (ui == TRIANGLE_MAX_NUM_UNI_CANDS - 1 ? 0 : 1);
-      uint8_t candIdx1Enc = uj - (uj > ui ? 1 : 0);
-      uint8_t idxBits1 = candIdx1Enc + (candIdx1Enc == TRIANGLE_MAX_NUM_UNI_CANDS - 2 ? 0 : 1);
-      m_triangleIdxBins[1][ui][uj] = m_triangleIdxBins[0][ui][uj] = 1 + idxBits0 + idxBits1;
-    }
-  }
-#endif
   for( unsigned ui = 0; ui < TRIANGLE_MAX_NUM_CANDS; ui++ )
   {
     m_acTriangleWeightedBuffer[ui].create( chromaFormat, Area( 0, 0, uiMaxWidth, uiMaxHeight ) );
@@ -1179,15 +1156,8 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
       startShareThisLevel = 1;
     }
   }
-#if JVET_N0266_SMALL_BLOCKS
   if ( m_shareState == GEN_ON_SHARED_BOUND && slice.getSPS()->getIBCFlag() )
-#else
-  if ((m_shareState == GEN_ON_SHARED_BOUND) && (!slice.isIntra() || slice.getSPS()->getIBCFlag()))
-#endif
   {
-#if !JVET_N0266_SMALL_BLOCKS
-    tempCS->motionLut.lutShare = tempCS->motionLut.lut;
-#endif
     tempCS->motionLut.lutShareIbc = tempCS->motionLut.lutIbc;
     m_shareBndPosX = uiLPelX;
     m_shareBndPosY = uiTPelY;
@@ -1277,7 +1247,6 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
 
   {
     bool enforceQT = implicitSplit == CU_QUAD_SPLIT;
-#if HM_QTBT_REPRODUCE_FAST_LCTU_BUG
 
     // LARGE CTU bug
     if( m_pcEncCfg->getUseFastLCTU() )
@@ -1296,7 +1265,6 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
         enforceQT = true;
       }
     }
-#endif
 
     if( !enforceQT )
     {
@@ -1321,20 +1289,11 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
   // The exception is each slice / slice-segment must have at least one CTU.
   if (bestCS->cost != MAX_DOUBLE)
   {
-#if JVET_N0857_TILES_BRICKS
     const BrickMap& tileMap = *tempCS->picture->brickMap;
     const uint32_t CtuAddr  = CU::getCtuAddr( *bestCS->getCU( partitioner.chType ) );
     const bool isEndOfSlice = slice.getSliceMode() == FIXED_NUMBER_OF_BYTES
                               && ((slice.getSliceBits() + CS::getEstBits(*bestCS)) > slice.getSliceArgument() << 3)
                               && CtuAddr != tileMap.getCtuBsToRsAddrMap(slice.getSliceCurStartCtuTsAddr());
-#else
-    const TileMap& tileMap = *tempCS->picture->tileMap;
-    const uint32_t CtuAddr             = CU::getCtuAddr( *bestCS->getCU( partitioner.chType ) );
-    const bool isEndOfSlice        =    slice.getSliceMode() == FIXED_NUMBER_OF_BYTES
-                                      && ((slice.getSliceBits() + CS::getEstBits(*bestCS)) > slice.getSliceArgument() << 3)
-                                      && CtuAddr != tileMap.getCtuTsToRsAddrMap(slice.getSliceCurStartCtuTsAddr())
-                                      ;
-#endif
 
     if(isEndOfSlice)
     {
@@ -1364,14 +1323,12 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
 
 void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode )
 {
-#if JVET_N0193_LFNST
   double          bestInterCost             = m_modeCtrl->getBestInterCost();
   double          costSize2Nx2NmtsFirstPass = m_modeCtrl->getMtsSize2Nx2NFirstPassCost();
   bool            skipSecondMtsPass         = m_modeCtrl->getSkipSecondMTSPass();
   const SPS&      sps                       = *tempCS->sps;
   const int       maxSizeMTS                = MTS_INTRA_MAX_CU_SIZE;
   uint8_t         considerMtsSecondPass     = ( sps.getUseIntraMTS() && isLuma( partitioner.chType ) && partitioner.currArea().lwidth() <= maxSizeMTS && partitioner.currArea().lheight() <= maxSizeMTS ) ? 1 : 0;
-#endif
   const PPS &pps      = *tempCS->pps;
 
   bool   useIntraSubPartitions   = false;
@@ -1380,7 +1337,6 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
   Distortion interHad = m_modeCtrl->getInterHad();
 
 
-#if JVET_N0193_LFNST
   double dct2Cost                =   MAX_DOUBLE;
   double trGrpBestCost     [ 4 ] = { MAX_DOUBLE, MAX_DOUBLE, MAX_DOUBLE, MAX_DOUBLE };
   double globalBestCost          =   MAX_DOUBLE;
@@ -1408,15 +1364,12 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
       for( int lfnstIdx = startLfnstIdx; lfnstIdx <= endLfnstIdx; lfnstIdx++ )
       {
         for( uint8_t mtsFlag = startMtsFlag; mtsFlag <= endMtsFlag; mtsFlag++ )
-#endif
         {
-#if JVET_N0193_LFNST
           //3) if interHad is 0, only try further modes if some intra mode was already better than inter
           if( sps.getUseLFNST() && m_pcEncCfg->getUsePbIntraFast() && !tempCS->slice->isIntra() && bestCU && CU::isInter( *bestCS->getCU( partitioner.chType ) ) && interHad == 0 )
           {
             continue;
           }
-#endif
 
           tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
 
@@ -1424,11 +1377,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
 
           partitioner.setCUData( cu );
           cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
           cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-          cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
           cu.skip             = false;
           cu.mmvdSkip = false;
           cu.predMode         = MODE_INTRA;
@@ -1436,10 +1385,8 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
           cu.chromaQpAdj      = cu.transQuantBypass ? 0 : m_cuChromaQpOffsetIdxPlus1;
           cu.qp               = encTestMode.qp;
           //cu.ipcm             = false;
-#if JVET_N0193_LFNST
           cu.lfnstIdx         = lfnstIdx;
           cu.mtsFlag          = mtsFlag;
-#endif
           cu.ispMode          = NOT_INTRA_SUBPARTITIONS;
 
           CU::addPUs( cu );
@@ -1448,22 +1395,16 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
 
           m_bestModeUpdated = tempCS->useDbCost = bestCS->useDbCost = false;
 
-#if JVET_N0193_LFNST
           bool validCandRet = false;
-#endif
           if( isLuma( partitioner.chType ) )
           {
             //the Intra SubPartitions mode uses the value of the best cost so far (luma if it is the fast version) to avoid test non-necessary lines
             const double bestCostSoFar = CS::isDualITree( *tempCS ) ? m_modeCtrl->getBestCostWithoutSplitFlags() : bestCU && bestCU->predMode == MODE_INTRA ? bestCS->lumaCost : bestCS->cost;
-#if JVET_N0193_LFNST
             validCandRet = m_pcIntraSearch->estIntraPredLumaQT( cu, partitioner, bestCostSoFar, mtsFlag, startMTSIdx[ trGrpIdx ], endMTSIdx[ trGrpIdx ], ( trGrpIdx > 0 ) );
             if( sps.getUseLFNST() && ( !validCandRet || ( cu.ispMode && cu.firstTU->cbf[ COMPONENT_Y ] == 0 ) ) )
             {
               continue;
             }
-#else
-            m_pcIntraSearch->estIntraPredLumaQT( cu, partitioner, bestCostSoFar );
-#endif
 
             useIntraSubPartitions = cu.ispMode != NOT_INTRA_SUBPARTITIONS;
             if( !CS::isDualITree( *tempCS ) )
@@ -1482,11 +1423,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
               interHad = 0;
               // JEM assumes only perfect reconstructions can from now on beat the inter mode
               m_modeCtrl->enforceInterHad( 0 );
-#if JVET_N0193_LFNST
               continue;
-#else
-              return;
-#endif
             }
 
             if( !CS::isDualITree( *tempCS ) )
@@ -1503,11 +1440,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
             if( useIntraSubPartitions && !cu.ispMode )
             {
               //At this point the temp cost is larger than the best cost. Therefore, we can already skip the remaining calculations
-#if JVET_N0193_LFNST
               continue;
-#else
-              return;
-#endif
             }
           }
 
@@ -1534,14 +1467,8 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
           }
           m_CABACEstimator->pred_mode      ( cu );
           m_CABACEstimator->pcm_data       ( cu, partitioner );
-#if !JVET_N0217_MATRIX_INTRAPRED
-          m_CABACEstimator->extend_ref_line( cu );
-          m_CABACEstimator->isp_mode       ( cu );
-#endif
           m_CABACEstimator->cu_pred_data   ( cu );
-#if JVET_N0413_RDPCM
           m_CABACEstimator->bdpcm_mode     ( cu, ComponentID(partitioner.chType) );
-#endif
 
           // Encode Coefficients
           CUCtx cuCtx;
@@ -1552,16 +1479,13 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
           tempCS->fracBits = m_CABACEstimator->getEstFracBits();
           tempCS->cost     = m_pcRdCost->calcRdCost(tempCS->fracBits, tempCS->dist);
 
-#if JVET_N0193_LFNST
           double bestIspCost = cu.ispMode ? CS::isDualITree( *tempCS ) ? tempCS->cost : tempCS->lumaCost : MAX_DOUBLE;
-#endif
 
           const double tmpCostWithoutSplitFlags = tempCS->cost;
           xEncodeDontSplit( *tempCS, partitioner );
 
           xCheckDQP( *tempCS, partitioner );
 
-#if JVET_N0193_LFNST
           // Check if low frequency non-separable transform (LFNST) is too expensive
           const int nonZeroCoeffThr = CS::isDualITree( *tempCS ) ? ( isLuma( partitioner.chType ) ? LFNST_SIG_NZ_LUMA : LFNST_SIG_NZ_CHROMA ) : LFNST_SIG_NZ_LUMA + LFNST_SIG_NZ_CHROMA;
           if( lfnstIdx && cuCtx.numNonZeroCoeffNonTs <= nonZeroCoeffThr )
@@ -1576,21 +1500,18 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
           {
             dct2Cost = tempCS->cost;
           }
-#endif
 
           if( tempCS->cost < bestCS->cost )
           {
             m_modeCtrl->setBestCostWithoutSplitFlags( tmpCostWithoutSplitFlags );
           }
 
-#if JVET_N0193_LFNST
           if( !mtsFlag ) static_cast< double& >( costSize2Nx2NmtsFirstPass ) = tempCS->cost;
 
           if( sps.getUseLFNST() && !tempCS->cus.empty() )
           {
             skipOtherLfnst = m_modeCtrl->checkSkipOtherLfnst( encTestMode, tempCS, partitioner );
           }
-#endif
 
           xCalDebCost( *tempCS, partitioner );
           tempCS->useDbCost = m_pcEncCfg->getUseEncDbOpt();
@@ -1601,7 +1522,6 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
 #else
           DTRACE_MODE_COST( *tempCS, m_pcRdCost->getLambda() );
 #endif
-#if JVET_N0193_LFNST
           if( !sps.getUseLFNST() )
           {
             xCheckBestMode( tempCS, bestCS, partitioner, encTestMode );
@@ -1660,12 +1580,8 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
               }
             }
           }
-#else
-          xCheckBestMode( tempCS, bestCS, partitioner, encTestMode );
-#endif
 
         } //for emtCuFlag
-#if JVET_N0193_LFNST
         if( skipOtherLfnst )
         {
           startLfnstIdx = lfnstIdx;
@@ -1686,7 +1602,6 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
       }
     }
   } //trGrpIdx
-#endif
 }
 
 void EncCu::xCheckIntraPCM(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode )
@@ -1697,11 +1612,7 @@ void EncCu::xCheckIntraPCM(CodingStructure *&tempCS, CodingStructure *&bestCS, P
 
   partitioner.setCUData( cu );
   cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
   cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-  cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
   cu.skip             = false;
   cu.mmvdSkip = false;
   cu.predMode         = MODE_INTRA;
@@ -1709,9 +1620,7 @@ void EncCu::xCheckIntraPCM(CodingStructure *&tempCS, CodingStructure *&bestCS, P
   cu.chromaQpAdj      = cu.transQuantBypass ? 0 : m_cuChromaQpOffsetIdxPlus1;
   cu.qp               = encTestMode.qp;
   cu.ipcm             = true;
-#if JVET_N0413_RDPCM
   cu.bdpcmMode        = 0;
-#endif
 
   tempCS->addPU( CS::getArea( *tempCS, tempCS->area, partitioner.chType ), partitioner.chType );
 
@@ -1842,11 +1751,7 @@ void EncCu::xFillPCMBuffer( CodingUnit &cu )
 
       const CPelBuf source      = tu.cs->getOrgBuf( compArea );
              PelBuf destination = tu.getPcmbuf( compID );
-#if JVET_N0805_APS_LMCS
       if (tu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#else
-      if (tu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#endif
       {
         CompArea    tmpArea(COMPONENT_Y, compArea.chromaFormat, Position(0, 0), compArea.size());
         PelBuf tempOrgBuf = m_tmpStorageLCU->getBuf(tmpArea);
@@ -1896,12 +1801,8 @@ void EncCu::xCheckRDCostHashInter( CodingStructure *&tempCS, CodingStructure *&b
     }
   }
   tempCS->initStructData(encTestMode.qp, encTestMode.lossless);
-#if JVET_N0247_HASH_IMPROVE
   int minSize = min(cu.lwidth(), cu.lheight());
   if (minSize < 64)
-#else
-  if (cu.lwidth() != 64)
-#endif
   {
     isPerfectMatch = false;
   }
@@ -1934,11 +1835,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
     cu.cs       = tempCS;
     cu.predMode = MODE_INTER;
     cu.slice    = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
     cu.tileIdx  = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-    cu.tileIdx  = tempCS->picture->tileMap->getTileIdxMap(tempCS->area.lumaPos());
-#endif
 
     PredictionUnit pu( tempCS->area );
     pu.cu = &cu;
@@ -1949,9 +1846,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
       , 0
     );
     PU::getInterMMVDMergeCandidates(pu, mergeCtx);
-#if JVET_N0324_REGULAR_MRG_FLAG
     pu.regularMergeFlag = true;
-#endif
   }
   bool candHasNoResidual[MRG_MAX_NUM_CANDS + MMVD_ADD_NUM];
   for (uint32_t ui = 0; ui < MRG_MAX_NUM_CANDS + MMVD_ADD_NUM; ui++)
@@ -1971,21 +1866,12 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
   struct ModeInfo
   {
     uint32_t mergeCand;
-#if !JVET_N0302_SIMPLFIED_CIIP
-    uint32_t intraDir;
-#endif
     bool     isRegularMerge;
     bool     isMMVD;
     bool     isCIIP;
-#if JVET_N0302_SIMPLFIED_CIIP
     ModeInfo() : mergeCand(0), isRegularMerge(false), isMMVD(false), isCIIP(false) {}
     ModeInfo(const uint32_t mergeCand, const bool isRegularMerge, const bool isMMVD, const bool isCIIP) :
       mergeCand(mergeCand), isRegularMerge(isRegularMerge), isMMVD(isMMVD), isCIIP(isCIIP) {}
-#else
-    ModeInfo() : mergeCand(0), intraDir(0), isRegularMerge(false), isMMVD(false), isCIIP(false) {}
-    ModeInfo(const uint32_t mergeCand, const uint32_t intraDir, const bool isRegularMerge, const bool isMMVD, const bool isCIIP) :
-      mergeCand(mergeCand), intraDir(intraDir), isRegularMerge(isRegularMerge), isMMVD(isMMVD), isCIIP(isCIIP) {}
-#endif
   };
 
   static_vector<ModeInfo, MRG_MAX_NUM_CANDS + MMVD_ADD_NUM>  RdModeList;
@@ -1995,19 +1881,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
   {
     if (i < mergeCtx.numValidMergeCand)
     {
-#if JVET_N0302_SIMPLFIED_CIIP
       RdModeList.push_back(ModeInfo(i, true, false, false));
-#else
-      RdModeList.push_back(ModeInfo(i, NUM_LUMA_MODE, true, false, false));
-#endif
     }
     else
     {
-#if JVET_N0302_SIMPLFIED_CIIP
       RdModeList.push_back(ModeInfo(std::min(MMVD_ADD_NUM, i - mergeCtx.numValidMergeCand), false, true, false));
-#else
-      RdModeList.push_back(ModeInfo(std::min(MMVD_ADD_NUM, i - mergeCtx.numValidMergeCand), NUM_LUMA_MODE, false, true, false));
-#endif
     }
   }
 
@@ -2068,23 +1946,13 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
     {
       RdModeList.clear();
       mrgTempBufSet       = true;
-#if JVET_N0327_MERGE_BIT_CALC_FIX
       const TempCtx ctxStart(m_CtxCache, m_CABACEstimator->getCtx());
-#else
-      const double sqrtLambdaForFirstPass = m_pcRdCost->getMotionLambda( encTestMode.lossless );
-#endif
 
       CodingUnit &cu      = tempCS->addCU( tempCS->area, partitioner.chType );
-#if !JVET_N0302_SIMPLFIED_CIIP || JVET_N0327_MERGE_BIT_CALC_FIX
       const double sqrtLambdaForFirstPassIntra = m_pcRdCost->getMotionLambda(cu.transQuantBypass) / double(1 << SCALE_BITS);
-#endif
       partitioner.setCUData( cu );
       cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
       cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-      cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
       cu.skip             = false;
       cu.mmvdSkip = false;
       cu.triangle         = false;
@@ -2099,11 +1967,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
       PredictionUnit &pu  = tempCS->addPU( cu, partitioner.chType );
 
       DistParam distParam;
-#if JVET_N0329_IBC_SEARCH_IMP
       const bool bUseHadamard = !encTestMode.lossless && !tempCS->slice->getDisableSATDForRD();
-#else
-      const bool bUseHadamard= !encTestMode.lossless;
-#endif
       m_pcRdCost->setDistParam (distParam, tempCS->getOrgBuf().Y(), m_acMergeBuffer[0].Y(), sps.getBitDepth (CHANNEL_TYPE_LUMA), COMPONENT_Y, bUseHadamard);
 
       const UnitArea localUnitArea( tempCS->area.chromaFormat, Area( 0, 0, tempCS->area.Y().width, tempCS->area.Y().height) );
@@ -2141,30 +2005,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
         }
 
         Distortion uiSad = distParam.distFunc(distParam);
-#if JVET_N0327_MERGE_BIT_CALC_FIX
         m_CABACEstimator->getCtx() = ctxStart;
         uint64_t fracBits = m_pcInterSearch->xCalcPuMeBits(pu);
         double cost = (double)uiSad + (double)fracBits * sqrtLambdaForFirstPassIntra;
-#else
-        uint32_t uiBitsCand = uiMergeCand + 1;
-        if( uiMergeCand == tempCS->slice->getMaxNumMergeCand() - 1 )
-        {
-          uiBitsCand--;
-        }
-#if JVET_N0127_MMVD_SPS_FLAG
-        if ( pu.cs->sps->getUseMMVD() )
-          uiBitsCand++; // for mmvd_flag
-#else
-        uiBitsCand++; // for mmvd_flag
-#endif
-        double cost     = (double)uiSad + (double)uiBitsCand * sqrtLambdaForFirstPass;
-#endif
         insertPos = -1;
-#if JVET_N0302_SIMPLFIED_CIIP
         updateCandList(ModeInfo(uiMergeCand, true, false, false), cost, RdModeList, candCostList, uiNumMrgSATDCand, &insertPos);
-#else
-        updateCandList(ModeInfo(uiMergeCand, NUM_LUMA_MODE, true, false, false), cost, RdModeList, candCostList, uiNumMrgSATDCand, &insertPos);
-#endif
         if (insertPos != -1)
         {
           if (insertPos == RdModeList.size() - 1)
@@ -2185,20 +2030,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
 
       if (isIntrainterEnabled)
       {
-#if !JVET_N0302_SIMPLFIED_CIIP
-        int numTestIntraMode = 4;
-#endif
         // prepare for Intra bits calculation
-#if !JVET_N0327_MERGE_BIT_CALC_FIX
-        const TempCtx ctxStart(m_CtxCache, m_CABACEstimator->getCtx());
-#endif
-#if !JVET_N0302_SIMPLFIED_CIIP
-        const TempCtx ctxStartIntraMode(m_CtxCache, SubCtx(Ctx::MHIntraPredMode, m_CABACEstimator->getCtx()));
-
-        // for Intrainter fast, recored the best intra mode during the first round for mrege 0
-        int bestMHIntraMode = -1;
-        double bestMHIntraCost = MAX_DOUBLE;
-#endif
         pu.mhIntraFlag = true;
 
         // save the to-be-tested merge candidates
@@ -2213,18 +2045,9 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
           acMergeBuffer[mergeCand] = m_acRealMergeBuffer[mergeCand].getBuf(localUnitArea);
 
           // estimate merge bits
-#if JVET_N0327_MERGE_BIT_CALC_FIX
           mergeCtx.setMergeInfo(pu, mergeCand);
-#else
-          uint32_t bitsCand = mergeCand + 1;
-          if (mergeCand == pu.cs->slice->getMaxNumMergeCand() - 1)
-          {
-            bitsCand--;
-          }
-#endif
 
           // first round
-#if JVET_N0302_SIMPLFIED_CIIP
           pu.intraDir[0] = PLANAR_IDX;
           uint32_t intraCnt = 0;
           // generate intrainter Y prediction
@@ -2235,46 +2058,26 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
             m_pcIntraSearch->switchBuffer(pu, COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt));
           }
           pu.cs->getPredBuf(pu).copyFrom(acMergeBuffer[mergeCand]);
-#if JVET_N0805_APS_LMCS
           if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-          if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
           {
             pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT());
           }
           m_pcIntraSearch->geneWeightedPred(COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt));
 
           // calculate cost
-#if JVET_N0805_APS_LMCS
           if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-          if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
           {
             pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getInvLUT());
           }
           distParam.cur = pu.cs->getPredBuf(pu).Y();
           Distortion sadValue = distParam.distFunc(distParam);
-#if JVET_N0805_APS_LMCS
           if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-          if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
           {
             pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT());
           }
-#if JVET_N0327_MERGE_BIT_CALC_FIX
           m_CABACEstimator->getCtx() = ctxStart;
           uint64_t fracBits = m_pcInterSearch->xCalcPuMeBits(pu);
           double cost = (double)sadValue + (double)fracBits * sqrtLambdaForFirstPassIntra;
-#else
-#if JVET_N0324_REGULAR_MRG_FLAG
-          double cost = (double)sadValue + (double)(bitsCand + 9) * sqrtLambdaForFirstPass;
-#else
-          double cost = (double)sadValue + (double)(bitsCand + 1) * sqrtLambdaForFirstPass;
-#endif
-#endif
           insertPos = -1;
           updateCandList(ModeInfo(mergeCand, false, false, true), cost, RdModeList, candCostList, uiNumMrgSATDCand, &insertPos);
           if (insertPos != -1)
@@ -2285,136 +2088,19 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
             }
             swap(singleMergeTempBuffer, acMergeTempBuffer[insertPos]);
           }
-#else
-          for (uint32_t intraCnt = 0; intraCnt < numTestIntraMode; intraCnt++)
-          {
-            pu.intraDir[0] = (intraCnt < 2) ? intraCnt : ((intraCnt == 2) ? HOR_IDX : VER_IDX);
-
-            // fast 2
-            if (mergeCnt > 0 && bestMHIntraMode != pu.intraDir[0])
-            {
-              continue;
-            }
-            int narrowCase = PU::getNarrowShape(pu.lwidth(), pu.lheight());
-            if (narrowCase == 1 && pu.intraDir[0] == HOR_IDX)
-            {
-              continue;
-            }
-            if (narrowCase == 2 && pu.intraDir[0] == VER_IDX)
-            {
-              continue;
-            }
-            // generate intrainter Y prediction
-            if (mergeCnt == 0)
-            {
-              m_pcIntraSearch->initIntraPatternChType( *pu.cu, pu.Y());
-              m_pcIntraSearch->predIntraAng(COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), pu);
-              m_pcIntraSearch->switchBuffer(pu, COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt));
-            }
-            pu.cs->getPredBuf(pu).copyFrom(acMergeBuffer[mergeCand]);
-            if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-            {
-              pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT());
-            }
-            m_pcIntraSearch->geneWeightedPred(COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt));
-
-            // calculate cost
-            if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-            {
-               pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getInvLUT());
-            }
-            distParam.cur = pu.cs->getPredBuf(pu).Y();
-            Distortion sadValue = distParam.distFunc(distParam);
-            if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-            {
-              pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT());
-            }
-#if JVET_N0327_MERGE_BIT_CALC_FIX
-            m_CABACEstimator->getCtx() = ctxStart;
-            uint64_t fracBits = m_pcInterSearch->xCalcPuMeBits(pu);
-            double cost = (double)sadValue + (double)fracBits * sqrtLambdaForFirstPassIntra;
-#else
-            m_CABACEstimator->getCtx() = SubCtx(Ctx::MHIntraPredMode, ctxStartIntraMode);
-            uint64_t fracModeBits = m_pcIntraSearch->xFracModeBitsIntra(pu, pu.intraDir[0], CHANNEL_TYPE_LUMA);
-#if JVET_N0324_REGULAR_MRG_FLAG
-            double cost = (double)sadValue + (double)(bitsCand + 9) * sqrtLambdaForFirstPass + (double)fracModeBits * sqrtLambdaForFirstPassIntra;
-#else
-            double cost = (double)sadValue + (double)(bitsCand + 1) * sqrtLambdaForFirstPass + (double)fracModeBits * sqrtLambdaForFirstPassIntra;
-#endif
-#endif
-            insertPos = -1;
-            updateCandList(ModeInfo(mergeCand, pu.intraDir[0], false, false, true), cost, RdModeList, candCostList, uiNumMrgSATDCand, &insertPos);
-            if (insertPos != -1)
-            {
-              for (int i = int(RdModeList.size()) - 1; i > insertPos; i--)
-              {
-                swap(acMergeTempBuffer[i - 1], acMergeTempBuffer[i]);
-              }
-              swap(singleMergeTempBuffer, acMergeTempBuffer[insertPos]);
-            }
-            // fast 2
-            if (mergeCnt == 0 && cost < bestMHIntraCost)
-            {
-              bestMHIntraMode = pu.intraDir[0];
-              bestMHIntraCost = cost;
-            }
-          }
-#endif
         }
         pu.mhIntraFlag = false;
-#if !JVET_N0327_MERGE_BIT_CALC_FIX
-        m_CABACEstimator->getCtx() = ctxStart;
-#endif
       }
-#if JVET_N0127_MMVD_SPS_FLAG
       if ( pu.cs->sps->getUseMMVD() )
       {
-#endif
         cu.mmvdSkip = true;
-#if JVET_N0448_N0380
         const int tempNum = (mergeCtx.numValidMergeCand > 1) ? MMVD_ADD_NUM : MMVD_ADD_NUM >> 1;
-#else
-        const int tempNum = MMVD_ADD_NUM;
-#endif
         for (int mmvdMergeCand = 0; mmvdMergeCand < tempNum; mmvdMergeCand++)
         {
-#if JVET_N0327_MERGE_BIT_CALC_FIX
           int baseIdx = mmvdMergeCand / MMVD_MAX_REFINE_NUM;
           int refineStep = (mmvdMergeCand - (baseIdx * MMVD_MAX_REFINE_NUM)) / 4;
-#else
-          int bitsBaseIdx = 0;
-          int bitsRefineStep = 0;
-          int bitsDirection = 2;
-          int bitsCand = 0;
-          int baseIdx;
-          int refineStep;
-          baseIdx = mmvdMergeCand / MMVD_MAX_REFINE_NUM;
-          refineStep = (mmvdMergeCand - (baseIdx * MMVD_MAX_REFINE_NUM)) / 4;
-#endif
-#if JVET_N0449_MMVD_SIMP
           if (refineStep >= m_pcEncCfg->getMmvdDisNum())
             continue;
-#endif
-#if !JVET_N0327_MERGE_BIT_CALC_FIX
-          bitsBaseIdx = baseIdx + 1;
-          if (baseIdx == MMVD_BASE_MV_NUM - 1)
-          {
-            bitsBaseIdx--;
-          }
-
-          bitsRefineStep = refineStep + 1;
-          if (refineStep == MMVD_REFINE_STEP - 1)
-          {
-            bitsRefineStep--;
-          }
-
-          bitsCand = bitsBaseIdx + bitsRefineStep + bitsDirection;
-#if JVET_N0324_REGULAR_MRG_FLAG
-          bitsCand += 7;
-#else
-          bitsCand++; // for mmvd_flag
-#endif
-#endif
           mergeCtx.setMmvdMergeCandiInfo(pu, mmvdMergeCand);
 
           PU::spanMotionInfo(pu, mergeCtx);
@@ -2428,19 +2114,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
           pu.mvRefine = false;
           Distortion uiSad = distParam.distFunc(distParam);
 
-#if JVET_N0327_MERGE_BIT_CALC_FIX
           m_CABACEstimator->getCtx() = ctxStart;
           uint64_t fracBits = m_pcInterSearch->xCalcPuMeBits(pu);
           double cost = (double)uiSad + (double)fracBits * sqrtLambdaForFirstPassIntra;
-#else
-          double cost = (double)uiSad + (double)bitsCand * sqrtLambdaForFirstPass;
-#endif
           insertPos = -1;
-#if JVET_N0302_SIMPLFIED_CIIP
           updateCandList(ModeInfo(mmvdMergeCand, false, true, false), cost, RdModeList, candCostList, uiNumMrgSATDCand, &insertPos);
-#else
-          updateCandList(ModeInfo(mmvdMergeCand, NUM_LUMA_MODE, false, true, false), cost, RdModeList, candCostList, uiNumMrgSATDCand, &insertPos);
-#endif
           if (insertPos != -1)
           {
             for (int i = int(RdModeList.size()) - 1; i > insertPos; i--)
@@ -2450,9 +2128,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
             swap(singleMergeTempBuffer, acMergeTempBuffer[insertPos]);
           }
         }
-#if JVET_N0127_MMVD_SPS_FLAG
       }
-#endif
       // Try to limit number of candidates using SATD-costs
       for( uint32_t i = 1; i < uiNumMrgSATDCand; i++ )
       {
@@ -2472,17 +2148,9 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
         {
           if (RdModeList[mergeCnt].isCIIP)
           {
-#if JVET_N0302_SIMPLFIED_CIIP
             pu.intraDir[0] = PLANAR_IDX;
-#else
-            pu.intraDir[0] = RdModeList[mergeCnt].intraDir;
-#endif
             pu.intraDir[1] = DM_CHROMA_IDX;
-#if JVET_N0302_SIMPLFIED_CIIP
             uint32_t bufIdx = 0;
-#else
-            uint32_t bufIdx = (pu.intraDir[0] > 1) ? (pu.intraDir[0] == HOR_IDX ? 2 : 3) : pu.intraDir[0];
-#endif
             m_pcIntraSearch->initIntraPatternChType(*pu.cu, pu.Cb());
             m_pcIntraSearch->predIntraAng(COMPONENT_Cb, pu.cs->getPredBuf(pu).Cb(), pu);
             m_pcIntraSearch->switchBuffer(pu, COMPONENT_Cb, pu.cs->getPredBuf(pu).Cb(), m_pcIntraSearch->getPredictorPtr2(COMPONENT_Cb, bufIdx));
@@ -2496,19 +2164,13 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
       }
 
       tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
-#if JVET_N0327_MERGE_BIT_CALC_FIX
       m_CABACEstimator->getCtx() = ctxStart;
-#endif
     }
     else
     {
       if (bestIsMMVDSkip)
       {
-#if JVET_N0448_N0380
         uiNumMrgSATDCand = mergeCtx.numValidMergeCand + ((mergeCtx.numValidMergeCand > 1) ? MMVD_ADD_NUM : MMVD_ADD_NUM >> 1);
-#else
-        uiNumMrgSATDCand = mergeCtx.numValidMergeCand + MMVD_ADD_NUM;
-#endif
       }
       else
       {
@@ -2552,11 +2214,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
 
       partitioner.setCUData( cu );
       cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
       cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-      cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
       cu.skip             = false;
       cu.mmvdSkip = false;
       cu.triangle         = false;
@@ -2573,14 +2231,8 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
         cu.mmvdSkip = false;
         mergeCtx.setMergeInfo(pu, uiMergeCand);
         pu.mhIntraFlag = true;
-#if JVET_N0324_REGULAR_MRG_FLAG
         pu.regularMergeFlag = false;
-#endif
-#if JVET_N0302_SIMPLFIED_CIIP
         pu.intraDir[0] = PLANAR_IDX;
-#else
-        pu.intraDir[0] = RdModeList[uiMrgHADIdx].intraDir;
-#endif
         CHECK(pu.intraDir[0]<0 || pu.intraDir[0]>(NUM_LUMA_MODE - 1), "out of intra mode");
         pu.intraDir[1] = DM_CHROMA_IDX;
       }
@@ -2626,18 +2278,10 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
         }
         if (pu.mhIntraFlag)
         {
-#if JVET_N0302_SIMPLFIED_CIIP
           uint32_t bufIdx = 0;
-#else
-          uint32_t bufIdx = (pu.intraDir[0] > 1) ? (pu.intraDir[0] == HOR_IDX ? 2 : 3) : pu.intraDir[0];
-#endif
           PelBuf tmpBuf = tempCS->getPredBuf(pu).Y();
           tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Y());
-#if JVET_N0805_APS_LMCS
           if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-          if (pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
           {
             tmpBuf.rspSignal(m_pcReshape->getFwdLUT());
           }
@@ -2729,10 +2373,8 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
   const Slice &slice = *tempCS->slice;
   const SPS &sps = *tempCS->sps;
 
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   if (slice.getMaxNumTriangleCand() < 2)
     return;
-#endif
 
   CHECK( slice.getSliceType() != B_SLICE, "Triangle mode is only applied to B-slices" );
 
@@ -2756,9 +2398,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
   PelUnitBuf                                      triangleWeightedBuffer[TRIANGLE_MAX_NUM_CANDS];
   static_vector<uint8_t, TRIANGLE_MAX_NUM_CANDS> triangleRdModeList;
   static_vector<double,  TRIANGLE_MAX_NUM_CANDS> tianglecandCostList;
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   uint8_t                                         numTriangleCandComb = slice.getMaxNumTriangleCand() * (slice.getMaxNumTriangleCand() - 1) * 2;
-#endif
 
   if( auto blkCache = dynamic_cast< CacheBlkInfoCtrl* >( m_modeCtrl ) )
   {
@@ -2766,11 +2406,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
   }
 
   DistParam distParam;
-#if JVET_N0329_IBC_SEARCH_IMP
   const bool useHadamard = !encTestMode.lossless && !tempCS->slice->getDisableSATDForRD();
-#else
-  const bool useHadamard = !encTestMode.lossless;
-#endif
   m_pcRdCost->setDistParam( distParam, tempCS->getOrgBuf().Y(), m_acMergeBuffer[0].Y(), sps.getBitDepth( CHANNEL_TYPE_LUMA ), COMPONENT_Y, useHadamard );
 
   const UnitArea localUnitArea( tempCS->area.chromaFormat, Area( 0, 0, tempCS->area.Y().width, tempCS->area.Y().height) );
@@ -2783,11 +2419,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
     cu.cs       = tempCS;
     cu.predMode = MODE_INTER;
     cu.slice    = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
     cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-    cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
     cu.triangle = true;
     cu.mmvdSkip = false;
     cu.GBiIdx   = GBI_DEFAULT;
@@ -2795,21 +2427,11 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
     PredictionUnit pu( tempCS->area );
     pu.cu = &cu;
     pu.cs = tempCS;
-#if JVET_N0324_REGULAR_MRG_FLAG
     pu.regularMergeFlag = false;
-#endif
-#if JVET_N0340_TRI_MERGE_CAND && !JVET_N0266_SMALL_BLOCKS
-    pu.shareParentPos = tempCS->sharedBndPos;
-    pu.shareParentSize = tempCS->sharedBndSize;
-#endif
 
     PU::getTriangleMergeCandidates( pu, triangleMrgCtx );
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
     const uint8_t maxNumTriangleCand = pu.cs->slice->getMaxNumTriangleCand();
     for (uint8_t mergeCand = 0; mergeCand < maxNumTriangleCand; mergeCand++)
-#else
-    for( uint8_t mergeCand = 0; mergeCand < TRIANGLE_MAX_NUM_UNI_CANDS; mergeCand++ )
-#endif
     {
       triangleBuffer[mergeCand] = m_acMergeBuffer[mergeCand].getBuf(localUnitArea);
       triangleMrgCtx.setMergeInfo( pu, mergeCand );
@@ -2827,9 +2449,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
 
   bool tempBufSet = bestIsSkip ? false : true;
   triangleNumMrgSATDCand = bestIsSkip ? TRIANGLE_MAX_NUM_CANDS : TRIANGLE_MAX_NUM_SATD_CANDS;
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   triangleNumMrgSATDCand = min(triangleNumMrgSATDCand, numTriangleCandComb);
-#endif
   if( bestIsSkip )
   {
     for( uint8_t i = 0; i < TRIANGLE_MAX_NUM_CANDS; i++ )
@@ -2843,11 +2463,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
 
     partitioner.setCUData( cu );
     cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
     cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-    cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
     cu.skip             = false;
     cu.predMode         = MODE_INTER;
     cu.transQuantBypass = encTestMode.lossless;
@@ -2859,10 +2475,6 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
 
     PredictionUnit &pu  = tempCS->addPU( cu, partitioner.chType );
 
-#if JVET_N0340_TRI_MERGE_CAND && !JVET_N0266_SMALL_BLOCKS
-    pu.shareParentPos = tempCS->sharedBndPos;
-    pu.shareParentSize = tempCS->sharedBndSize;
-#endif
     if( abs(g_aucLog2[cu.lwidth()] - g_aucLog2[cu.lheight()]) >= 2 )
     {
       numTriangleCandidate = 30;
@@ -2872,9 +2484,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
       numTriangleCandidate = TRIANGLE_MAX_NUM_CANDS;
     }
 
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
     numTriangleCandidate = min(numTriangleCandidate, numTriangleCandComb);
-#endif
 
     for( uint8_t mergeCand = 0; mergeCand < numTriangleCandidate; mergeCand++ )
     {
@@ -2886,9 +2496,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
       pu.triangleMergeIdx0 = candIdx0;
       pu.triangleMergeIdx1 = candIdx1;
       pu.mergeFlag = true;
-#if JVET_N0324_REGULAR_MRG_FLAG
       pu.regularMergeFlag = false;
-#endif
       triangleWeightedBuffer[mergeCand] = m_acTriangleWeightedBuffer[mergeCand].getBuf( localUnitArea );
       triangleBuffer[candIdx0] = m_acMergeBuffer[candIdx0].getBuf( localUnitArea );
       triangleBuffer[candIdx1] = m_acMergeBuffer[candIdx1].getBuf( localUnitArea );
@@ -2902,13 +2510,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
 
       double cost = (double)uiSad + (double)uiBitsCand * sqrtLambdaForFirstPass;
 
-#if !JVET_N0217_MATRIX_INTRAPRED
-      static_vector<int, TRIANGLE_MAX_NUM_CANDS> * nullList = nullptr;
-#endif
       updateCandList( mergeCand, cost, triangleRdModeList, tianglecandCostList
-#if !JVET_N0217_MATRIX_INTRAPRED
-        , *nullList, -1
-#endif
         , triangleNumMrgSATDCand );
     }
 
@@ -2934,18 +2536,14 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
       pu.triangleMergeIdx0 = candIdx0;
       pu.triangleMergeIdx1 = candIdx1;
       pu.mergeFlag = true;
-#if JVET_N0324_REGULAR_MRG_FLAG
       pu.regularMergeFlag = false;
-#endif
       m_pcInterSearch->weightedTriangleBlk( pu, splitDir, CHANNEL_TYPE_CHROMA, triangleWeightedBuffer[mergeCand], triangleBuffer[candIdx0], triangleBuffer[candIdx1] );
     }
 
     tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
   }
 
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   triangleNumMrgSATDCand = min(triangleNumMrgSATDCand, (uint8_t)triangleRdModeList.size());
-#endif
 
   m_bestModeUpdated = tempCS->useDbCost = bestCS->useDbCost = false;
   {
@@ -2979,11 +2577,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
 
         partitioner.setCUData(cu);
         cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
         cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-        cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
         cu.skip = false;
         cu.predMode = MODE_INTER;
         cu.transQuantBypass = encTestMode.lossless;
@@ -2998,9 +2592,7 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
         pu.triangleMergeIdx0 = candIdx0;
         pu.triangleMergeIdx1 = candIdx1;
         pu.mergeFlag = true;
-#if JVET_N0324_REGULAR_MRG_FLAG
         pu.regularMergeFlag = false;
-#endif
         PU::spanTriangleMotionInfo(pu, triangleMrgCtx, splitDir, candIdx0, candIdx1 );
 
         if( m_pcEncCfg->getMCTSEncConstraint() && ( !( MCTSHelper::checkMvBufferForMCTSConstraint( *cu.firstPU ) ) ) )
@@ -3072,19 +2664,13 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
     cu.cs = tempCS;
     cu.predMode = MODE_INTER;
     cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
     cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-    cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
     cu.mmvdSkip = false;
 
     PredictionUnit pu( tempCS->area );
     pu.cu = &cu;
     pu.cs = tempCS;
-#if JVET_N0324_REGULAR_MRG_FLAG
     pu.regularMergeFlag = false;
-#endif
     PU::getAffineMergeCand( pu, affineMergeCtx );
 
     if ( affineMergeCtx.numValidMergeCand <= 0 )
@@ -3133,11 +2719,7 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
 
       partitioner.setCUData( cu );
       cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
       cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-      cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
       cu.skip = false;
       cu.affine = true;
       cu.predMode = MODE_INTER;
@@ -3148,11 +2730,7 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
       PredictionUnit &pu = tempCS->addPU( cu, partitioner.chType );
 
       DistParam distParam;
-#if JVET_N0329_IBC_SEARCH_IMP
       const bool bUseHadamard = !encTestMode.lossless && !tempCS->slice->getDisableSATDForRD();
-#else
-      const bool bUseHadamard = !encTestMode.lossless;
-#endif
       m_pcRdCost->setDistParam( distParam, tempCS->getOrgBuf().Y(), m_acMergeBuffer[0].Y(), sps.getBitDepth( CHANNEL_TYPE_LUMA ), COMPONENT_Y, bUseHadamard );
 
       const UnitArea localUnitArea( tempCS->area.chromaFormat, Area( 0, 0, tempCS->area.Y().width, tempCS->area.Y().height ) );
@@ -3164,9 +2742,7 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
         // set merge information
         pu.interDir = affineMergeCtx.interDirNeighbours[uiMergeCand];
         pu.mergeFlag = true;
-#if JVET_N0324_REGULAR_MRG_FLAG
         pu.regularMergeFlag = false;
-#endif
         pu.mergeIdx = uiMergeCand;
         cu.affineType = affineMergeCtx.affineType[uiMergeCand];
         cu.GBiIdx = affineMergeCtx.GBiIdx[uiMergeCand];
@@ -3197,13 +2773,7 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
           uiBitsCand--;
         }
         double cost = (double)uiSad + (double)uiBitsCand * sqrtLambdaForFirstPass;
-#if !JVET_N0217_MATRIX_INTRAPRED
-        static_vector<int, AFFINE_MRG_MAX_NUM_CANDS> emptyList;
-#endif
         updateCandList( uiMergeCand, cost, RdModeList, candCostList
-#if !JVET_N0217_MATRIX_INTRAPRED
-          , emptyList, -1
-#endif
           , uiNumMrgSATDCand );
 
         CHECK( std::min( uiMergeCand + 1, uiNumMrgSATDCand ) != RdModeList.size(), "" );
@@ -3254,11 +2824,7 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
 
       partitioner.setCUData( cu );
       cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
       cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-      cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
       cu.skip = false;
       cu.affine = true;
       cu.predMode = MODE_INTER;
@@ -3355,17 +2921,10 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
 {
   assert(partitioner.chType != CHANNEL_TYPE_CHROMA); // chroma IBC is derived
 
-#if JVET_N0318_N0467_IBC_SIZE
   if (tempCS->area.lwidth() == 128 && tempCS->area.lheight() == 128) // disable 128x128 IBC mode
   {
     return;
   }
-#else
-  if (tempCS->area.lwidth() > IBC_MAX_CAND_SIZE || tempCS->area.lheight() > IBC_MAX_CAND_SIZE) // currently only check 32x32 and below block for ibc merge/skip
-  {
-    return;
-  }
-#endif
   const SPS &sps = *tempCS->sps;
 
   tempCS->initStructData(encTestMode.qp, encTestMode.lossless);
@@ -3384,19 +2943,13 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
     cu.cs = tempCS;
     cu.predMode = MODE_IBC;
     cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
     cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-    cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap(tempCS->area.lumaPos());
-#endif
     PredictionUnit pu(tempCS->area);
     pu.cu = &cu;
     pu.cs = tempCS;
     cu.mmvdSkip = false;
     pu.mmvdMergeFlag = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
     pu.regularMergeFlag = false;
-#endif
     cu.triangle = false;
     pu.shareParentPos = tempCS->sharedBndPos;
     pu.shareParentSize = tempCS->sharedBndSize;
@@ -3427,11 +2980,7 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
 
       partitioner.setCUData(cu);
       cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
       cu.tileIdx = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-      cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap(tempCS->area.lumaPos());
-#endif
       cu.skip = false;
       cu.predMode = MODE_IBC;
       cu.transQuantBypass = encTestMode.lossless;
@@ -3440,24 +2989,14 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
       cu.mmvdSkip = false;
       cu.triangle = false;
       DistParam distParam;
-#if JVET_N0329_IBC_SEARCH_IMP
       const bool bUseHadamard = !encTestMode.lossless && !cu.slice->getDisableSATDForRD();
-#else
-      const bool bUseHadamard = !encTestMode.lossless;
-#endif
       PredictionUnit &pu = tempCS->addPU(cu, partitioner.chType); //tempCS->addPU(cu);
       pu.mmvdMergeFlag = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
       pu.regularMergeFlag = false;
-#endif
       Picture* refPic = pu.cu->slice->getPic();
       const CPelBuf refBuf = refPic->getRecoBuf(pu.blocks[COMPONENT_Y]);
       const Pel*        piRefSrch = refBuf.buf;
-#if JVET_N0805_APS_LMCS
       if (tempCS->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() )
-#else
-      if (tempCS->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() )
-#endif
       {
         const CompArea &area = cu.blocks[COMPONENT_Y];
         CompArea    tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
@@ -3500,14 +3039,8 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
           bitsCand--;
         }
         double cost = (double)sad + (double)bitsCand * sqrtLambdaForFirstPass;
-#if !JVET_N0217_MATRIX_INTRAPRED
-        static_vector<int, MRG_MAX_NUM_CANDS> * nullList = nullptr;
-#endif
 
         updateCandList(mergeCand, cost, RdModeList, candCostList
-#if !JVET_N0217_MATRIX_INTRAPRED
-          , *nullList, -1
-#endif
          , numMrgSATDCand);
       }
 
@@ -3558,11 +3091,7 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
 
             partitioner.setCUData(cu);
             cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
             cu.tileIdx = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-            cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap(tempCS->area.lumaPos());
-#endif
             cu.skip = false;
             cu.predMode = MODE_IBC;
             cu.transQuantBypass = encTestMode.lossless;
@@ -3575,9 +3104,7 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
             pu.intraDir[1] = PLANAR_IDX; // set intra pred for ibc block
             cu.mmvdSkip = false;
             pu.mmvdMergeFlag = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
             pu.regularMergeFlag = false;
-#endif
             cu.triangle = false;
             mergeCtx.setMergeInfo(pu, mergeCand);
             PU::spanMotionInfo(pu, mergeCtx);
@@ -3628,17 +3155,10 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
 
 void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode)
 {
-#if JVET_N0318_N0467_IBC_SIZE
   if (tempCS->area.lwidth() == 128 && tempCS->area.lheight() == 128) // disable 128x128 IBC mode
   {
     return;
   }
-#else
-  if (tempCS->area.lwidth() > IBC_MAX_CAND_SIZE || tempCS->area.lheight() > IBC_MAX_CAND_SIZE) // currently only check 32x32 and below block for ibc merge/skip
-  {
-    return;
-  }
-#endif
 
     tempCS->initStructData(encTestMode.qp, encTestMode.lossless);
 
@@ -3648,11 +3168,7 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best
 
     partitioner.setCUData(cu);
     cu.slice = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
     cu.tileIdx = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-    cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap(tempCS->area.lumaPos());
-#endif
     cu.skip = false;
     cu.predMode = MODE_IBC;
     cu.transQuantBypass = encTestMode.lossless;
@@ -3668,13 +3184,9 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best
     PredictionUnit& pu = *cu.firstPU;
     cu.mmvdSkip = false;
     pu.mmvdMergeFlag = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
     pu.regularMergeFlag = false;
-#endif
-#if JVET_N0843_BVP_SIMPLIFICATION
     pu.shareParentPos  = tempCS->sharedBndPos;
     pu.shareParentSize = tempCS->sharedBndSize;
-#endif
 
     pu.intraDir[0] = DC_IDX; // set intra pred for ibc block
     pu.intraDir[1] = PLANAR_IDX; // set intra pred for ibc block
@@ -3855,11 +3367,7 @@ void EncCu::xCheckRDCostInter( CodingStructure *&tempCS, CodingStructure *&bestC
 
   partitioner.setCUData( cu );
   cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
   cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-  cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
   cu.skip             = false;
   cu.mmvdSkip = false;
 //cu.affine
@@ -3996,11 +3504,7 @@ bool EncCu::xCheckRDCostInterIMV( CodingStructure *&tempCS, CodingStructure *&be
 
   partitioner.setCUData( cu );
   cu.slice            = tempCS->slice;
-#if JVET_N0857_TILES_BRICKS
   cu.tileIdx          = tempCS->picture->brickMap->getBrickIdxRsMap( tempCS->area.lumaPos() );
-#else
-  cu.tileIdx          = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
-#endif
   cu.skip             = false;
   cu.mmvdSkip = false;
 //cu.affine
@@ -4172,11 +3676,7 @@ void EncCu::xCalDebCost( CodingStructure &cs, Partitioner &partitioner, bool cal
       //Copy current CU's reco to Deblock Pic Buffer
       const CompArea&  curCompArea = currCsArea.block( compId );
       picDbBuf.getBuf( curCompArea ).copyFrom( cs.getRecoBuf( curCompArea ) );
-#if JVET_N0805_APS_LMCS
       if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId))
-#else
-      if ( cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma( compId ) )
-#endif
       {
         picDbBuf.getBuf( curCompArea ).rspSignal( m_pcReshape->getInvLUT() );
       }
@@ -4186,11 +3686,7 @@ void EncCu::xCalDebCost( CodingStructure &cs, Partitioner &partitioner, bool cal
       {
         const CompArea&  compArea = areaLeft.block(compId);
         picDbBuf.getBuf( compArea ).copyFrom( cs.picture->getRecoBuf( compArea ) );
-#if JVET_N0805_APS_LMCS
         if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId))
-#else
-        if ( cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma( compId ) )
-#endif
         {
           picDbBuf.getBuf( compArea ).rspSignal( m_pcReshape->getInvLUT() );
         }
@@ -4200,11 +3696,7 @@ void EncCu::xCalDebCost( CodingStructure &cs, Partitioner &partitioner, bool cal
       {
         const CompArea&  compArea = areaTop.block( compId );
         picDbBuf.getBuf( compArea ).copyFrom( cs.picture->getRecoBuf( compArea ) );
-#if JVET_N0805_APS_LMCS
         if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId))
-#else
-        if ( cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma( compId ) )
-#endif
         {
           picDbBuf.getBuf( compArea ).rspSignal( m_pcReshape->getInvLUT() );
         }
@@ -4271,16 +3763,10 @@ Distortion EncCu::getDistortionDb( CodingStructure &cs, CPelBuf org, CPelBuf rec
 {
   Distortion dist = 0;
 #if WCG_EXT
-#if JVET_N0671_RDCOST_FIX
   m_pcRdCost->setChromaFormat(cs.sps->getChromaFormatIdc());
-#endif
   CPelBuf orgLuma = cs.picture->getOrigBuf( cs.area.blocks[COMPONENT_Y] );
   if ( m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (
-#if JVET_N0805_APS_LMCS
     m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())))
-#else
-    m_pcEncCfg->getReshaper() && ( cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() ) ) )
-#endif
   {
     if ( compID == COMPONENT_Y && !afterDb && !m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())
     {
@@ -4295,11 +3781,7 @@ Distortion EncCu::getDistortionDb( CodingStructure &cs, CPelBuf org, CPelBuf rec
       dist += m_pcRdCost->getDistPart( org, reco, cs.sps->getBitDepth( toChannelType( compID ) ), compID, DF_SSE_WTD, &orgLuma );
     }
   }
-#if JVET_N0805_APS_LMCS
   else if (m_pcEncCfg->getReshaper() && cs.slice->getLmcsEnabledFlag() && cs.slice->isIntra()) //intra slice
-#else
-  else if ( m_pcEncCfg->getReshaper() && cs.slice->getReshapeInfo().getUseSliceReshaper() && cs.slice->isIntra() ) //intra slice
-#endif
   {
     if ( compID == COMPONENT_Y && afterDb )
     {
@@ -4372,7 +3854,6 @@ void EncCu::xEncodeInterResidual(   CodingStructure *&tempCS
       }
     }
   }
-#if JVET_N0334_MVCLIPPING
   // avoid MV exceeding 18-bit dynamic range
   const int maxMv = 1 << 17;
   if (!cu->affine && !pu.mergeFlag)
@@ -4399,7 +3880,6 @@ void EncCu::xEncodeInterResidual(   CodingStructure *&tempCS
       }
     }
   }
-#endif
   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();
   uint8_t numRDOTried = 0;
@@ -4715,9 +4195,7 @@ void EncCu::xEncodeDontSplit( CodingStructure &cs, Partitioner &partitioner )
 #if REUSE_CU_RESULTS
 void EncCu::xReuseCachedResult( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner )
 {
-#if JVET_N0671_RDCOST_FIX
   m_pcRdCost->setChromaFormat(tempCS->sps->getChromaFormatIdc());
-#endif
   BestEncInfoCache* bestEncCache = dynamic_cast<BestEncInfoCache*>( m_modeCtrl );
   CHECK( !bestEncCache, "If this mode is chosen, mode controller has to implement the mode caching capabilities" );
   EncTestMode cachedMode;
@@ -4765,11 +4243,7 @@ void EncCu::xReuseCachedResult( CodingStructure *&tempCS, CodingStructure *&best
 
 #if WCG_EXT
       if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (
-#if JVET_N0805_APS_LMCS
         m_pcEncCfg->getReshaper() && (tempCS->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())))
-#else
-        m_pcEncCfg->getReshaper() && (tempCS->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())))
-#endif
       {
         const CPelBuf orgLuma = tempCS->getOrgBuf(tempCS->area.blocks[COMPONENT_Y]);
         if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()))
diff --git a/source/Lib/EncoderLib/EncCu.h b/source/Lib/EncoderLib/EncCu.h
index 0e2d93777..8cf343cd6 100644
--- a/source/Lib/EncoderLib/EncCu.h
+++ b/source/Lib/EncoderLib/EncCu.h
@@ -74,9 +74,7 @@ struct TriangleMotionInfo
   uint8_t   m_candIdx1;
 
   TriangleMotionInfo ( uint8_t splitDir, uint8_t candIdx0, uint8_t candIdx1 ): m_splitDir(splitDir), m_candIdx0(candIdx0), m_candIdx1(candIdx1) { }
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   TriangleMotionInfo() { m_splitDir = m_candIdx0 = m_candIdx1 = 0; }
-#endif
 };
 class EncCu
   : DecCu
@@ -136,11 +134,7 @@ private:
 #endif
   int                   m_bestGbiIdx[2];
   double                m_bestGbiCost[2];
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   TriangleMotionInfo    m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS];
-#else
-  static const TriangleMotionInfo  m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS];
-#endif
   uint8_t                          m_triangleIdxBins[2][TRIANGLE_MAX_NUM_UNI_CANDS][TRIANGLE_MAX_NUM_UNI_CANDS];
 #if SHARP_LUMA_DELTA_QP || ENABLE_QPA_SUB_CTU
   void    updateLambda      ( Slice* slice, const int dQP, const bool updateRdCostLambda );
@@ -170,9 +164,7 @@ public:
   IbcHashMap& getIbcHashMap()              { return m_ibcHashMap;        }
   EncCfg*     getEncCfg()            const { return m_pcEncCfg;          }
 
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   EncCu();
-#endif
   ~EncCu();
 
 protected:
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index 1c86cbe07..e84a1f94b 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -199,7 +199,6 @@ void EncGOP::init ( EncLib* pcEncLib )
   m_pcReshaper = pcEncLib->getReshaper();
 }
 
-#if HEVC_VPS || JVET_N0278_HLS
 int EncGOP::xWriteVPS (AccessUnit &accessUnit, const VPS *vps)
 {
   OutputNALUnit nalu(NAL_UNIT_VPS);
@@ -208,9 +207,7 @@ int EncGOP::xWriteVPS (AccessUnit &accessUnit, const VPS *vps)
   accessUnit.push_back(new NALUnitEBSP(nalu));
   return (int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;
 }
-#endif
 
-#if JVET_N0349_DPS
 int EncGOP::xWriteDPS (AccessUnit &accessUnit, const DPS *dps)
 {
   if (dps->getDecodingParameterSetId() !=0)
@@ -226,7 +223,6 @@ int EncGOP::xWriteDPS (AccessUnit &accessUnit, const DPS *dps)
     return 0;
   }
 }
-#endif
 
 
 int EncGOP::xWriteSPS (AccessUnit &accessUnit, const SPS *sps)
@@ -261,18 +257,14 @@ int EncGOP::xWriteParameterSets (AccessUnit &accessUnit, Slice *slice, const boo
 {
   int actualTotalBits = 0;
 
-#if HEVC_VPS || JVET_N0278_HLS
   if (bSeqFirst)
   {
     actualTotalBits += xWriteVPS(accessUnit, m_pcEncLib->getVPS());
   }
-#endif
-#if JVET_N0349_DPS
   if (bSeqFirst)
   {
     actualTotalBits += xWriteDPS(accessUnit, m_pcEncLib->getDPS());
   }
-#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).
   {
@@ -349,12 +341,8 @@ void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duI
 
   while ( (itNalu!=accessUnit.end())&&
     ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER
-#if HEVC_VPS || JVET_N0278_HLS
     || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS
-#endif
-#if JVET_N0349_DPS
     || (*itNalu)->m_nalUnitType==NAL_UNIT_DPS
-#endif
     || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS
     || (*itNalu)->m_nalUnitType==NAL_UNIT_PPS
     ))
@@ -445,11 +433,7 @@ void EncGOP::xWriteTrailingSEIMessages (SEIMessages& seiMessages, AccessUnit &ac
 
 void EncGOP::xWriteDuSEIMessages (SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, std::deque<DUData> &duData)
 {
-#if JVET_N0063_VUI
   const HRDParameters *hrd = sps->getHrdParameters();
-#else
-  const HRDParameters *hrd = sps->getVuiParameters()->getHrdParameters();
-#endif
 
   if( m_pcCfg->getDecodingUnitInfoSEIEnabled() && hrd->getSubPicCpbParamsPresentFlag() )
   {
@@ -580,17 +564,10 @@ void EncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const SPS
 
 void EncGOP::xCreatePerPictureSEIMessages (int picInGOP, SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, Slice *slice)
 {
-#if JVET_N0063_VUI
   if( ( m_pcCfg->getBufferingPeriodSEIEnabled() ) && ( slice->getSliceType() == I_SLICE ) &&
     ( slice->getSPS()->getVuiParametersPresentFlag() ) &&
     ( ( slice->getSPS()->getHrdParameters()->getNalHrdParametersPresentFlag() )
     || ( slice->getSPS()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) )
-#else
-  if( ( m_pcCfg->getBufferingPeriodSEIEnabled() ) && ( slice->getSliceType() == I_SLICE ) &&
-    ( slice->getSPS()->getVuiParametersPresentFlag() ) &&
-    ( ( slice->getSPS()->getVuiParameters()->getHrdParameters()->getNalHrdParametersPresentFlag() )
-    || ( slice->getSPS()->getVuiParameters()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) )
-#endif
   {
     SEIBufferingPeriod *bufferingPeriodSEI = new SEIBufferingPeriod();
     m_seiEncoder.initSEIBufferingPeriod(bufferingPeriodSEI, slice);
@@ -674,12 +651,7 @@ void EncGOP::xCreateScalableNestingSEI (SEIMessages& seiMessages, SEIMessages& n
 
 void EncGOP::xCreatePictureTimingSEI  (int IRAPGOPid, SEIMessages& seiMessages, SEIMessages& nestedSeiMessages, SEIMessages& duInfoSeiMessages, Slice *slice, bool isField, std::deque<DUData> &duData)
 {
-#if JVET_N0063_VUI
   const HRDParameters *hrd = slice->getSPS()->getHrdParameters();
-#else
-  const VUI *vui = slice->getSPS()->getVuiParameters();
-  const HRDParameters *hrd = vui->getHrdParameters();
-#endif
 
   // update decoding unit parameters
   if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
@@ -716,71 +688,6 @@ void EncGOP::xCreatePictureTimingSEI  (int IRAPGOPid, SEIMessages& seiMessages,
       m_lastBPSEI = m_totalCoded;
     }
 
-#if !JVET_N0063_VUI
-    if( hrd->getSubPicCpbParamsPresentFlag() )
-    {
-      int i;
-      uint64_t ui64Tmp;
-      uint32_t uiPrev = 0;
-      uint32_t numDU = ( pictureTimingSEI->m_numDecodingUnitsMinus1 + 1 );
-      std::vector<uint32_t> &rDuCpbRemovalDelayMinus1 = pictureTimingSEI->m_duCpbRemovalDelayMinus1;
-      uint32_t maxDiff = ( hrd->getTickDivisorMinus2() + 2 ) - 1;
-
-      for( i = 0; i < numDU; i ++ )
-      {
-        pictureTimingSEI->m_numNalusInDuMinus1[ i ]       = ( i == 0 ) ? ( duData[i].accumNalsDU - 1 ) : ( duData[i].accumNalsDU- duData[i-1].accumNalsDU - 1 );
-      }
-
-      if( numDU == 1 )
-      {
-        rDuCpbRemovalDelayMinus1[ 0 ] = 0; /* don't care */
-      }
-      else
-      {
-        rDuCpbRemovalDelayMinus1[ numDU - 1 ] = 0;/* by definition */
-        uint32_t tmp = 0;
-        uint32_t accum = 0;
-
-        for( i = ( numDU - 2 ); i >= 0; i -- )
-        {
-          ui64Tmp = ( ( ( duData[numDU - 1].accumBitsDU  - duData[i].accumBitsDU ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
-          if( (uint32_t)ui64Tmp > maxDiff )
-          {
-            tmp ++;
-          }
-        }
-        uiPrev = 0;
-
-        uint32_t flag = 0;
-        for( i = ( numDU - 2 ); i >= 0; i -- )
-        {
-          flag = 0;
-          ui64Tmp = ( ( ( duData[numDU - 1].accumBitsDU  - duData[i].accumBitsDU ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
-
-          if( (uint32_t)ui64Tmp > maxDiff )
-          {
-            if(uiPrev >= maxDiff - tmp)
-            {
-              ui64Tmp = uiPrev + 1;
-              flag = 1;
-            }
-            else                            ui64Tmp = maxDiff - tmp + 1;
-          }
-          rDuCpbRemovalDelayMinus1[ i ] = (uint32_t)ui64Tmp - uiPrev - 1;
-          if( (int)rDuCpbRemovalDelayMinus1[ i ] < 0 )
-          {
-            rDuCpbRemovalDelayMinus1[ i ] = 0;
-          }
-          else if (tmp > 0 && flag == 1)
-          {
-            tmp --;
-          }
-          accum += rDuCpbRemovalDelayMinus1[ i ] + 1;
-          uiPrev = accum;
-        }
-      }
-    }
-#endif
 
     if( m_pcCfg->getPictureTimingSEIEnabled() )
     {
@@ -859,12 +766,7 @@ void EncGOP::xUpdateTimingSEI(SEIPictureTiming *pictureTimingSEI, std::deque<DUD
   {
     return;
   }
-#if JVET_N0063_VUI
   const HRDParameters *hrd = sps->getHrdParameters();
-#else
-  const VUI *vui = sps->getVuiParameters();
-  const HRDParameters *hrd = vui->getHrdParameters();
-#endif
   if( hrd->getSubPicCpbParamsPresentFlag() )
   {
     int i;
@@ -891,11 +793,7 @@ void EncGOP::xUpdateTimingSEI(SEIPictureTiming *pictureTimingSEI, std::deque<DUD
 
       for( i = ( numDU - 2 ); i >= 0; i -- )
       {
-#if JVET_N0063_VUI
         ui64Tmp = ( ( ( duData[numDU - 1].accumBitsDU  - duData[i].accumBitsDU ) * ( sps->getTimingInfo()->getTimeScale() / sps->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
-#else
-        ui64Tmp = ( ( ( duData[numDU - 1].accumBitsDU  - duData[i].accumBitsDU ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
-#endif
         if( (uint32_t)ui64Tmp > maxDiff )
         {
           tmp ++;
@@ -907,11 +805,7 @@ void EncGOP::xUpdateTimingSEI(SEIPictureTiming *pictureTimingSEI, std::deque<DUD
       for( i = ( numDU - 2 ); i >= 0; i -- )
       {
         flag = 0;
-#if JVET_N0063_VUI
         ui64Tmp = ( ( ( duData[numDU - 1].accumBitsDU  - duData[i].accumBitsDU ) * ( sps->getTimingInfo()->getTimeScale() / sps->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
-#else
-        ui64Tmp = ( ( ( duData[numDU - 1].accumBitsDU  - duData[i].accumBitsDU ) * ( vui->getTimingInfo()->getTimeScale() / vui->getTimingInfo()->getNumUnitsInTick() ) * ( hrd->getTickDivisorMinus2() + 2 ) ) / ( m_pcCfg->getTargetBitrate() ) );
-#endif
 
         if( (uint32_t)ui64Tmp > maxDiff )
         {
@@ -1041,11 +935,7 @@ void EfficientFieldIRAPMapping::initialize(const bool isField, const int gopSize
 
       // check if POC corresponds to IRAP
       NalUnitType tmpUnitType = pEncGop->getNalUnitType(pocCurr, lastIDR, isField);
-#if !JVET_M0101_HLS
-      if(tmpUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP
-#else
       if (tmpUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP
-#endif
       {
         if(pocCurr%2 == 0 && iGOPid < gopSize-1 && pCfg->getGOPEntry(iGOPid).m_POC == pCfg->getGOPEntry(iGOPid+1).m_POC-1)
         { // if top field and following picture in enc order is associated bottom field
@@ -1547,40 +1437,12 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
     }
     // Set the nal unit type
     pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
-#if !JVET_M0101_HLS
-    if(pcSlice->getTemporalLayerNonReferenceFlag())
-    {
-      if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R &&
-          !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE))
-        // Add this condition to avoid POC issues with encoder_intra_main.cfg configuration (see #1127 in bug tracker)
-      {
-        pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TRAIL_N);
-      }
-      if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_RADL_R)
-      {
-        pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_RADL_N);
-      }
-      if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_R)
-      {
-        pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_RASL_N);
-      }
-    }
-#endif
 
     if (m_pcCfg->getEfficientFieldIRAPEnabled())
     {
-#if !JVET_M0101_HLS
-      if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
-#else
       if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
         || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
         || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)  // IRAP picture
-#endif
       {
         m_associatedIRAPType = pcSlice->getNalUnitType();
         m_associatedIRAPPOC = pocCurr;
@@ -1606,7 +1468,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       setLastLTRefPoc(-1);
     }
 
-#if JVET_M0128
     if (m_pcCfg->getUseCompositeRef() && m_picBg->getSpliceFull() && getUseLTRef())
     {
       m_pcEncLib->selectReferencePictureList(pcSlice, pocCurr, iGOPid, m_bgPOC);
@@ -1615,30 +1476,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
     {
       m_pcEncLib->selectReferencePictureList(pcSlice, pocCurr, iGOPid, -1);
     }
-#else
-    if (m_pcCfg->getUseCompositeRef() && m_picBg->getSpliceFull() && getUseLTRef())
-    {
-      m_pcEncLib->selectReferencePictureSet(pcSlice, pocCurr, iGOPid, m_bgPOC);
-    }
-    else
-    {
-      m_pcEncLib->selectReferencePictureSet(pcSlice, pocCurr, iGOPid, -1);
-    }
-#endif
     if (!m_pcCfg->getEfficientFieldIRAPEnabled())
     {
-#if !JVET_M0101_HLS
-      if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
-        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
-#else
       if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
         || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
         || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)  // IRAP picture
-#endif
       {
         m_associatedIRAPType = pcSlice->getNalUnitType();
         m_associatedIRAPPOC = pocCurr;
@@ -1647,63 +1489,23 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     }
 
-#if JVET_M0128
     if (pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL0(), 0, false) != 0 || pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL1(), 1, false) != 0)
     {
       pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPL0(), pcSlice->getRPL1());
     }
 
     pcSlice->applyReferencePictureListBasedMarking(rcListPic, pcSlice->getRPL0(), pcSlice->getRPL1());
-#else
-    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
-#if !JVET_M0101_HLS
-      || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
-#else
-      || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC() + 1)
-#endif
-      )
-    {
-      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3, m_pcCfg->getEfficientFieldIRAPEnabled()
-                                                            , isEncodeLtRef, m_pcCfg->getUseCompositeRef()
-      );
-    }
-
-    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
-#endif
 
     if(pcSlice->getTLayer() > 0
-#if !JVET_M0101_HLS
-      &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
-          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
-          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N
-          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R )
-#else
       && !(pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL     // Check if not a leading picture
         || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL)
-#endif
         )
     {
-#if !JVET_M0101_HLS
-      if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag())
-      {
-        if(pcSlice->getTemporalLayerNonReferenceFlag())
-        {
-          pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_N);
-        }
-        else
-        {
-          pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_R);
-        }
-      }
-      else if(pcSlice->isStepwiseTemporalLayerSwitchingPointCandidate(rcListPic))
-#else
     if (pcSlice->isStepwiseTemporalLayerSwitchingPointCandidate(rcListPic))
-#endif
       {
         bool isSTSA=true;
         for(int ii=iGOPid+1;(ii<m_pcCfg->getGOPSize() && isSTSA==true);ii++)
         {
-#if JVET_M0128
           int lTid = m_pcCfg->getRPLEntry(0, ii).m_temporalId;
 
           if (lTid == pcSlice->getTLayer())
@@ -1747,61 +1549,14 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
               }
             }
           }
-#else
-          int lTid= m_pcCfg->getGOPEntry(ii).m_temporalId;
-          if(lTid==pcSlice->getTLayer())
-          {
-            const ReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);
-            for(int jj=0;jj<nRPS->getNumberOfPictures();jj++)
-            {
-              if(nRPS->getUsed(jj))
-              {
-                int tPoc=m_pcCfg->getGOPEntry(ii).m_POC+nRPS->getDeltaPOC(jj);
-                int kk=0;
-                for(kk=0;kk<m_pcCfg->getGOPSize();kk++)
-                {
-                  if(m_pcCfg->getGOPEntry(kk).m_POC==tPoc)
-                  {
-                    break;
-                  }
-                }
-                int tTid=m_pcCfg->getGOPEntry(kk).m_temporalId;
-                if(tTid >= pcSlice->getTLayer())
-                {
-                  isSTSA=false;
-                  break;
-                }
-              }
-            }
-          }
-#endif
         }
         if(isSTSA==true)
         {
-#if !JVET_M0101_HLS
-          if(pcSlice->getTemporalLayerNonReferenceFlag())
-          {
-            pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N);
-          }
-          else
-          {
-            pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R);
-          }
-#else
           pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA);
-#endif
         }
       }
     }
-#if !JVET_M0128
-    if (pcSlice->getRPSidx() == -1)
-      arrangeLongtermPicturesInRPS(pcSlice, rcListPic);
-    RefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
-    refPicListModification->setRefPicListModificationFlagL0(0);
-    refPicListModification->setRefPicListModificationFlagL1(0);
-#endif
 
-#if JVET_M0128
     if (m_pcCfg->getUseCompositeRef() && getUseLTRef() && (pocCurr > getLastLTRefPoc()))
     {
       pcSlice->setNumRefIdx(REF_PIC_LIST_0, (pcSlice->isIntra()) ? 0 : min(m_pcCfg->getRPLEntry(0, iGOPid).m_numRefPicsActive + 1, pcSlice->getRPL0()->getNumberOfActivePictures()));
@@ -1812,27 +1567,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       pcSlice->setNumRefIdx(REF_PIC_LIST_0, (pcSlice->isIntra()) ? 0 : pcSlice->getRPL0()->getNumberOfActivePictures());
       pcSlice->setNumRefIdx(REF_PIC_LIST_1, (!pcSlice->isInterB()) ? 0 : pcSlice->getRPL1()->getNumberOfActivePictures());
     }
-#else
-    if (m_pcCfg->getUseCompositeRef() && getUseLTRef() && (pocCurr > getLastLTRefPoc()))
-    {
-      pcSlice->setNumRefIdx(REF_PIC_LIST_0, min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive + 1, pcSlice->getRPS()->getNumberOfPictures()));
-      pcSlice->setNumRefIdx(REF_PIC_LIST_1, min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive + 1, pcSlice->getRPS()->getNumberOfPictures()));
-    }
-    else
-    {
-      pcSlice->setNumRefIdx(REF_PIC_LIST_0, std::min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive, pcSlice->getRPS()->getNumberOfPictures()));
-      pcSlice->setNumRefIdx(REF_PIC_LIST_1, std::min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive, pcSlice->getRPS()->getNumberOfPictures()));
-    }
-#endif
     if (m_pcCfg->getUseCompositeRef() && getPrepareLTRef()) {
       arrangeCompositeReference(pcSlice, rcListPic, pocCurr);
     }
     //  Set reference list
-#if JVET_M0128
     pcSlice->constructRefPicList(rcListPic);
-#else
-    pcSlice->setRefPicList ( rcListPic );
-#endif
 
     if (m_pcCfg->getUseHashME())
     {
@@ -2068,15 +1807,8 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       pcSlice->setMvdL1ZeroFlag(false);
     }
 
-#if JVET_N0235_SMVD_SPS
     if ( pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false
-#if !JVET_N0470_SMVD_FIX
-      && pcSlice->getMvdL1ZeroFlag() == false
-#endif
       )
-#else
-    if ( pcSlice->getCheckLDC() == false && pcSlice->getMvdL1ZeroFlag() == false )
-#endif
     {
       int currPOC = pcSlice->getPOC();
 
@@ -2279,11 +2011,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
     const uint32_t numberOfCtusInFrame = pcPic->cs->pcv->sizeInCtus;
     const int numSubstreamsColumns = (pcSlice->getPPS()->getNumTileColumnsMinus1() + 1);
     const int numSubstreamRows     = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcPic->cs->pcv->heightInCtus : (pcSlice->getPPS()->getNumTileRowsMinus1() + 1);
-#if JVET_N0857_TILES_BRICKS
     const int numSubstreams        = std::max<int> (numSubstreamRows * numSubstreamsColumns, (int) pcPic->brickMap->bricks.size());
-#else
-    const int numSubstreams        = numSubstreamRows * numSubstreamsColumns;
-#endif
     std::vector<OutputBitstream> substreamsOut(numSubstreams);
 
 #if ENABLE_QPA
@@ -2312,13 +2040,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
     if( pcSlice->getSPS()->getALFEnabledFlag() )
     {
       pcPic->resizeAlfCtuEnableFlag( numberOfCtusInFrame );
-#if JVET_N0415_CTB_ALF
       pcPic->resizeAlfCtbFilterIndex(numberOfCtusInFrame);
-#else
-      // reset the APS ALF parameters
-      AlfSliceParam newALFParam;
-      pcSlice->getAPS()->setAlfAPSParam(newALFParam);
-#endif
     }
 
     bool decPic = false;
@@ -2336,9 +2058,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       // overwrite chroma qp offset for dual tree
       pcSlice->setSliceChromaQpDelta(COMPONENT_Cb, m_pcCfg->getChromaCbQpOffsetDualTree());
       pcSlice->setSliceChromaQpDelta(COMPONENT_Cr, m_pcCfg->getChromaCrQpOffsetDualTree());
-#if JVET_N0054_JOINT_CHROMA
       pcSlice->setSliceChromaQpDelta(JOINT_CbCr,   m_pcCfg->getChromaCbCrQpOffsetDualTree());
-#endif
       m_pcSliceEncoder->setUpLambda(pcSlice, pcSlice->getLambdas()[0], pcSlice->getSliceQp());
     }
     if (pcSlice->getSPS()->getUseReshaper())
@@ -2423,9 +2143,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         }
       }
 
-#if !JVET_N0805_APS_LMCS
-      m_pcReshaper->copySliceReshaperInfo(pcSlice->getReshapeInfo(), m_pcReshaper->getSliceReshaperInfo());
-#else
       //set all necessary information in LMCS APS and slice
       pcSlice->setLmcsEnabledFlag(m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper());
       pcSlice->setLmcsChromaResidualScaleFlag(m_pcReshaper->getSliceReshaperInfo().getSliceReshapeChromaAdj() == 1);
@@ -2462,7 +2179,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         int apsId = 0;
         pcSlice->setLmcsAPSId(apsId);
       }
-#endif
     }
     else
     {
@@ -2476,19 +2192,15 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
 
       pcSlice->setSliceCurStartCtuTsAddr( 0 );
 
-#if JVET_N0857_RECT_SLICES
       uint32_t sliceIdx = 0;
       const BrickMap& tileMap = *(pcPic->brickMap);
-#endif
       for(uint32_t nextCtuTsAddr = 0; nextCtuTsAddr < numberOfCtusInFrame; )
       {
         m_pcSliceEncoder->precompressSlice( pcPic );
         m_pcSliceEncoder->compressSlice   ( pcPic, false, false );
 
         const uint32_t curSliceEnd = pcSlice->getSliceCurEndCtuTsAddr();
-#if JVET_N0857_RECT_SLICES
         pcSlice->setSliceIndex(sliceIdx);
-#endif
         if(curSliceEnd < numberOfCtusInFrame)
         {
           uint32_t independentSliceIdx = pcSlice->getIndependentSliceIdx();
@@ -2498,7 +2210,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
           pcSlice = pcPic->slices[uiNumSliceSegments];
           CHECK(!(pcSlice->getPPS() != 0), "Unspecified error");
           pcSlice->copySliceInfo(pcPic->slices[uiNumSliceSegments - 1]);
-#if JVET_N0857_RECT_SLICES
           sliceIdx++;
           if (pcSlice->getPPS()->getRectSliceFlag())
           {
@@ -2516,9 +2227,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
           {
             pcSlice->setSliceCurStartCtuTsAddr(curSliceEnd);
           }
-#else
-          pcSlice->setSliceCurStartCtuTsAddr(curSliceEnd);
-#endif
           pcSlice->setSliceBits(0);
           independentSliceIdx++;
           pcSlice->setIndependentSliceIdx(independentSliceIdx);
@@ -2534,7 +2242,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
 
       if (pcSlice->getSPS()->getUseReshaper() && m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper())
       {
-#if JVET_N0805_APS_LMCS
         pcSlice->setLmcsEnabledFlag(true);
         int apsId = 0;
         pcSlice->setLmcsAPSId(apsId);
@@ -2548,7 +2255,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
             pcPic->slices[s]->setLmcsAPSId(pcSlice->getLmcsAPSId());
           }
         }
-#endif
           CHECK((m_pcReshaper->getRecReshaped() == false), "Rec picture is not reshaped!");
           pcPic->getRecoBuf(COMPONENT_Y).rspSignal(m_pcReshaper->getInvLUT());
           m_pcReshaper->setRecReshaped(false);
@@ -2609,7 +2315,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
 
       if( pcSlice->getSPS()->getALFEnabledFlag() )
       {
-#if JVET_N0415_CTB_ALF
         for (int s = 0; s < uiNumSliceSegments; s++)
         {
           pcPic->slices[s]->setTileGroupAlfEnabledFlag(COMPONENT_Y, false);
@@ -2630,35 +2335,15 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
           if (pcPic->slices[s]->getTileGroupAlfEnabledFlag(COMPONENT_Y))
           {
             pcPic->slices[s]->setTileGroupNumAps(cs.slice->getTileGroupNumAps());
-#if JVET_N0805_APS_LMCS
             pcPic->slices[s]->setAlfAPSs(cs.slice->getTileGroupApsIdLuma());
-#else
-            pcPic->slices[s]->setAPSs(cs.slice->getTileGroupApsIdLuma());
-#endif
           }
           else
           {
             pcPic->slices[s]->setTileGroupNumAps(0);
           }
-#if JVET_N0805_APS_LMCS
           pcPic->slices[s]->setAlfAPSs(cs.slice->getAlfAPSs());
           pcPic->slices[s]->setTileGroupApsIdChroma(cs.slice->getTileGroupApsIdChroma());
-#else
-          pcPic->slices[s]->setAPSs(cs.slice->getAPSs());
-          pcPic->slices[s]->setTileGroupApsIdChroma(cs.slice->getTileGroupApsIdChroma());
-#endif
         }
-#else
-        AlfSliceParam alfSliceParam;
-        m_pcALF->initCABACEstimator(m_pcEncLib->getCABACEncoder(), m_pcEncLib->getCtxCache(), pcSlice);
-        m_pcALF->ALFProcess( cs, pcSlice->getLambdas(),
-#if ENABLE_QPA
-                             (m_pcCfg->getUsePerceptQPA() && !m_pcCfg->getUseRateCtrl() && pcSlice->getPPS()->getUseDQP() ? m_pcEncLib->getRdCost (PARL_PARAM0 (0))->getChromaWeight() : 0.0),
-#endif
-                             alfSliceParam );
-        //assign ALF slice header
-        pcPic->cs->aps->setAlfAPSParam(alfSliceParam);
-#endif
       }
       if (m_pcCfg->getUseCompositeRef() && getPrepareLTRef())
       {
@@ -2705,7 +2390,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       /////////////////////////////////////////////////////////////////////////////////////////////////// File writing
 
       // write various parameter sets
-#if JCTVC_Y0038_PARAMS
       bool writePS = m_bSeqFirst || (m_pcCfg->getReWriteParamSets() && (pcSlice->isIRAP()));
       if (writePS)
       {
@@ -2714,11 +2398,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       actualTotalBits += xWriteParameterSets(accessUnit, pcSlice, writePS);
 
       if (writePS)
-#else
-      actualTotalBits += xWriteParameterSets( accessUnit, pcSlice, m_bSeqFirst );
-
-      if ( m_bSeqFirst )
-#endif
       {
         // create prefix SEI messages at the beginning of the sequence
         CHECK(!(leadingSeiMessages.empty()), "Unspecified error");
@@ -2731,7 +2410,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         xWriteAccessUnitDelimiter(accessUnit, pcSlice);
       }
 
-#if JVET_N0805_APS_LMCS
       //send LMCS APS when LMCSModel is updated. It can be updated even current slice does not enable reshaper.
       //For example, in RA, update is on intra slice, but intra slice may not use reshaper
       if (pcSlice->getSPS()->getUseReshaper())
@@ -2748,15 +2426,12 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
           CHECK(aps != pcSlice->getLmcsAPS(), "Wrong LMCS APS pointer in compressGOP");
         }
       }
-#endif
 
-#if JVET_N0415_CTB_ALF
       if (pcSlice->getSPS()->getALFEnabledFlag() && pcSlice->getTileGroupAlfEnabledFlag(COMPONENT_Y))
       {
         for (int apsId = 0; apsId < MAX_NUM_APS; apsId++)   //HD: shouldn't this be looping over slice_alf_aps_id_luma[ i ]? By looping over MAX_NUM_APS, it is possible unused ALF APS is written. Please check!
         {
           ParameterSetMap<APS> *apsMap = m_pcEncLib->getApsMap();
-#if JVET_N0805_APS_LMCS
           APS* aps = apsMap->getPS((apsId << NUM_APS_TYPE_LEN) + ALF_APS);
           bool writeAPS = aps && apsMap->getChangedFlag((apsId << NUM_APS_TYPE_LEN) + ALF_APS);
           if (!aps && pcSlice->getAlfAPSs() && pcSlice->getAlfAPSs()[apsId])
@@ -2765,42 +2440,15 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
             aps = pcSlice->getAlfAPSs()[apsId]; // use asp from slice header
             *apsMap->allocatePS(apsId) = *aps; //allocate and cpy
         }
-#else
-          APS* aps = apsMap->getPS(apsId);
-          bool writeAPS = aps && apsMap->getChangedFlag(apsId);
-          if( !aps && pcSlice->getAPSs() && pcSlice->getAPSs()[apsId] )
-          {
-            writeAPS = true;
-            aps = pcSlice->getAPSs()[apsId]; // use asp from slice header
-            *apsMap->allocatePS( apsId ) = *aps; //allocate and cpy
-          }
-#endif
           
           if (writeAPS )
           {
             actualTotalBits += xWriteAPS(accessUnit, aps);
-#if JVET_N0805_APS_LMCS
             apsMap->clearChangedFlag((apsId << NUM_APS_TYPE_LEN) + ALF_APS);
             CHECK(aps != pcSlice->getAlfAPSs()[apsId], "Wrong APS pointer in compressGOP");
-#else
-            apsMap->clearChangedFlag(apsId);
-            CHECK(aps != pcSlice->getAPSs()[apsId], "Wrong APS pointer in compressGOP");
-#endif
           }
         }
       }
-#else
-      if (pcSlice->getSPS()->getALFEnabledFlag() && pcSlice->getAPS()->getAlfAPSParam().enabledFlag[COMPONENT_Y])
-      {
-        pcSlice->setTileGroupAlfEnabledFlag(true);
-        pcSlice->setAPSId(pcSlice->getAPS()->getAPSId());
-        actualTotalBits += xWriteAPS(accessUnit, pcSlice->getAPS());
-      }
-      else
-      {
-        pcSlice->setTileGroupAlfEnabledFlag(false);
-      }
-#endif
 
       // reset presence of BP SEI indication
       m_bufferingPeriodSEIPresentInAU = false;
@@ -2820,15 +2468,10 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         }
         m_pcSliceEncoder->setSliceSegmentIdx(sliceSegmentIdxCount);
 
-#if JVET_M0128
         pcSlice->setRPL0(pcPic->slices[0]->getRPL0());
         pcSlice->setRPL1(pcPic->slices[0]->getRPL1());
         pcSlice->setRPL0idx(pcPic->slices[0]->getRPL0idx());
         pcSlice->setRPL1idx(pcPic->slices[0]->getRPL1idx());
-#else
-        pcSlice->setRPS   (pcPic->slices[0]->getRPS());
-        pcSlice->setRPSidx(pcPic->slices[0]->getRPSidx());
-#endif
 
         for ( uint32_t ui = 0 ; ui < numSubstreams; ui++ )
         {
@@ -2842,11 +2485,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         pcSlice->setNoRaslOutputFlag(false);
         if (pcSlice->isIRAP())
         {
-#if !JVET_M0101_HLS
-          if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP)
-#else
           if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP)
-#endif
           {
             pcSlice->setNoRaslOutputFlag(true);
           }
@@ -2882,21 +2521,10 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
 
           // Append substreams...
           OutputBitstream *pcOut = pcBitstreamRedirect;
-#if !JVET_N0857_RECT_SLICES   //This seems not needed for tile/brick. Please check if this affects WPP
-#if JVET_N0857_TILES_BRICKS
-          const int numZeroSubstreamsAtStartOfSlice  = pcPic->brickMap->getSubstreamForCtuAddr(pcSlice->getSliceCurStartCtuTsAddr(), false, pcSlice);
-#else
-          const int numZeroSubstreamsAtStartOfSlice  = pcPic->tileMap->getSubstreamForCtuAddr(pcSlice->getSliceCurStartCtuTsAddr(), false, pcSlice);
-#endif
-#endif
           const int numSubstreamsToCode  = pcSlice->getNumberOfSubstreamSizes()+1;
           for ( uint32_t ui = 0 ; ui < numSubstreamsToCode; ui++ )
           {
-#if JVET_N0857_RECT_SLICES
             pcOut->addSubstream(&(substreamsOut[ui]));
-#else
-            pcOut->addSubstream(&(substreamsOut[ui+numZeroSubstreamsAtStartOfSlice]));
-#endif
           }
         }
 
@@ -2915,19 +2543,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
           accessUnit.push_back(new NALUnitEBSP(nalu));
         }
 
-#if JVET_N0063_VUI
         if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
             ( pcSlice->getSPS()->getVuiParametersPresentFlag() ) &&
             ( ( pcSlice->getSPS()->getHrdParameters()->getNalHrdParametersPresentFlag() )
            || ( pcSlice->getSPS()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) &&
             ( pcSlice->getSPS()->getHrdParameters()->getSubPicCpbParamsPresentFlag() ) )
-#else
-        if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
-            ( pcSlice->getSPS()->getVuiParametersPresentFlag() ) &&
-            ( ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getNalHrdParametersPresentFlag() )
-           || ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) &&
-            ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getSubPicCpbParamsPresentFlag() ) )
-#endif
         {
             uint32_t numNalus = 0;
           uint32_t numRBSPBytes = 0;
@@ -3621,25 +3241,9 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
     {
       numRBSPBytes += numRBSPBytes_nal;
 #if HEVC_VPS
-#if JVET_N0349_DPS
       if( it == accessUnit.begin() || ( *it )->m_nalUnitType == NAL_UNIT_VPS || ( *it )->m_nalUnitType == NAL_UNIT_DPS || ( *it )->m_nalUnitType == NAL_UNIT_SPS || ( *it )->m_nalUnitType == NAL_UNIT_PPS )
 #else
-      if( it == accessUnit.begin() || ( *it )->m_nalUnitType == NAL_UNIT_VPS || ( *it )->m_nalUnitType == NAL_UNIT_SPS || ( *it )->m_nalUnitType == NAL_UNIT_PPS )
-#endif
-#else
-#if JVET_N0349_DPS
-#if JVET_N0278_HLS
       if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_VPS || (*it)->m_nalUnitType == NAL_UNIT_DPS || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS)
-#else
-      if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_DPS || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS)
-#endif
-#else
-#if JVET_N0278_HLS
-      if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_VPS || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS)
-#else
-      if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS)
-#endif
-#endif
 #endif
       {
         numRBSPBytes += 4;
@@ -3868,11 +3472,7 @@ NalUnitType EncGOP::getNalUnitType(int pocCurr, int lastIDR, bool isField)
   if (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pocCurr == (m_pcCfg->getUseCompositeRef() ? 2: 1))
   {
     // to avoid the picture becoming an IRAP
-#if !JVET_M0101_HLS
-    return NAL_UNIT_CODED_SLICE_TRAIL_R;
-#else
     return NAL_UNIT_CODED_SLICE_TRAIL;
-#endif
   }
 
   if (m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % (m_pcCfg->getIntraPeriod() * (m_pcCfg->getUseCompositeRef() ? 2 : 1)) == 0)
@@ -3895,29 +3495,17 @@ NalUnitType EncGOP::getNalUnitType(int pocCurr, int lastIDR, bool isField)
       // picture can be still decodable when random accessing to a CRA/CRANT/BLA/BLANT picture by
       // controlling the reference pictures used for encoding that leading picture. Such a leading
       // picture need not be marked as a TFD picture.
-#if !JVET_M0101_HLS
-      return NAL_UNIT_CODED_SLICE_RASL_R;
-#else
       return NAL_UNIT_CODED_SLICE_RASL;
-#endif
     }
   }
   if (lastIDR>0)
   {
     if (pocCurr < lastIDR)
     {
-#if !JVET_M0101_HLS
-      return NAL_UNIT_CODED_SLICE_RADL_R;
-#else
       return NAL_UNIT_CODED_SLICE_RADL;
-#endif
     }
   }
-#if !JVET_M0101_HLS
-  return NAL_UNIT_CODED_SLICE_TRAIL_R;
-#else
   return NAL_UNIT_CODED_SLICE_TRAIL;
-#endif
 }
 
 void EncGOP::xUpdateRasInit(Slice* slice)
@@ -3999,114 +3587,6 @@ void EncGOP::xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, OutputBitstream* c
   codedSliceData->clear();
 }
 
-#if !JVET_M0128
-// Function will arrange the long-term pictures in the decreasing order of poc_lsb_lt,
-// and among the pictures with the same lsb, it arranges them in increasing delta_poc_msb_cycle_lt value
-void EncGOP::arrangeLongtermPicturesInRPS(Slice *pcSlice, PicList& rcListPic)
-{
-  if(pcSlice->getRPS()->getNumberOfLongtermPictures() == 0)
-  {
-    return;
-  }
-  // we can only modify the local RPS!
-  CHECK(!(pcSlice->getRPSidx()==-1), "Unspecified error");
-  ReferencePictureSet *rps = pcSlice->getLocalRPS();
-
-  // Arrange long-term reference pictures in the correct order of LSB and MSB,
-  // and assign values for pocLSBLT and MSB present flag
-  int longtermPicsPoc[MAX_NUM_REF_PICS], longtermPicsLSB[MAX_NUM_REF_PICS], indices[MAX_NUM_REF_PICS];
-  int longtermPicsMSB[MAX_NUM_REF_PICS];
-  bool mSBPresentFlag[MAX_NUM_REF_PICS];
-  ::memset(longtermPicsPoc, 0, sizeof(longtermPicsPoc));    // Store POC values of LTRP
-  ::memset(longtermPicsLSB, 0, sizeof(longtermPicsLSB));    // Store POC LSB values of LTRP
-  ::memset(longtermPicsMSB, 0, sizeof(longtermPicsMSB));    // Store POC LSB values of LTRP
-  ::memset(indices        , 0, sizeof(indices));            // Indices to aid in tracking sorted LTRPs
-  ::memset(mSBPresentFlag , 0, sizeof(mSBPresentFlag));     // Indicate if MSB needs to be present
-
-  // Get the long-term reference pictures
-  int offset = rps->getNumberOfNegativePictures() + rps->getNumberOfPositivePictures();
-  int i, ctr = 0;
-  int maxPicOrderCntLSB = 1 << pcSlice->getSPS()->getBitsForPOC();
-  for(i = rps->getNumberOfPictures() - 1; i >= offset; i--, ctr++)
-  {
-    longtermPicsPoc[ctr] = rps->getPOC(i);                                  // LTRP POC
-    longtermPicsLSB[ctr] = getLSB(longtermPicsPoc[ctr], maxPicOrderCntLSB); // LTRP POC LSB
-    indices[ctr]      = i;
-    longtermPicsMSB[ctr] = longtermPicsPoc[ctr] - longtermPicsLSB[ctr];
-  }
-  int numLongPics = rps->getNumberOfLongtermPictures();
-  CHECK(!(ctr == numLongPics), "Unspecified error");
-
-  // Arrange pictures in decreasing order of MSB;
-  for(i = 0; i < numLongPics; i++)
-  {
-    for(int j = 0; j < numLongPics - 1; j++)
-    {
-      if(longtermPicsMSB[j] < longtermPicsMSB[j+1])
-      {
-        std::swap(longtermPicsPoc[j], longtermPicsPoc[j+1]);
-        std::swap(longtermPicsLSB[j], longtermPicsLSB[j+1]);
-        std::swap(longtermPicsMSB[j], longtermPicsMSB[j+1]);
-        std::swap(indices[j]        , indices[j+1]        );
-      }
-    }
-  }
-
-  for(i = 0; i < numLongPics; i++)
-  {
-    // Check if MSB present flag should be enabled.
-    // Check if the buffer contains any pictures that have the same LSB.
-    PicList::iterator  iterPic = rcListPic.begin();
-    Picture*                      pcPic;
-    while ( iterPic != rcListPic.end() )
-    {
-      pcPic = *iterPic;
-      if( (getLSB(pcPic->getPOC(), maxPicOrderCntLSB) == longtermPicsLSB[i])   &&     // Same LSB
-                                      (pcPic->referenced)     &&    // Reference picture
-                                        (pcPic->getPOC() != longtermPicsPoc[i])    )  // Not the LTRP itself
-      {
-        mSBPresentFlag[i] = true;
-        break;
-      }
-      iterPic++;
-    }
-  }
-
-  // tempArray for usedByCurr flag
-  bool tempArray[MAX_NUM_REF_PICS]; ::memset(tempArray, 0, sizeof(tempArray));
-  for(i = 0; i < numLongPics; i++)
-  {
-    tempArray[i] = rps->getUsed(indices[i]);
-  }
-  // Now write the final values;
-  ctr = 0;
-  int currMSB = 0, currLSB = 0;
-  // currPicPoc = currMSB + currLSB
-  currLSB = getLSB(pcSlice->getPOC(), maxPicOrderCntLSB);
-  currMSB = pcSlice->getPOC() - currLSB;
-
-  for(i = rps->getNumberOfPictures() - 1; i >= offset; i--, ctr++)
-  {
-    rps->setPOC                   (i, longtermPicsPoc[ctr]);
-    rps->setDeltaPOC              (i, - pcSlice->getPOC() + longtermPicsPoc[ctr]);
-    rps->setUsed                  (i, tempArray[ctr]);
-    rps->setPocLSBLT              (i, longtermPicsLSB[ctr]);
-    rps->setDeltaPocMSBCycleLT    (i, (currMSB - (longtermPicsPoc[ctr] - longtermPicsLSB[ctr])) / maxPicOrderCntLSB);
-    rps->setDeltaPocMSBPresentFlag(i, mSBPresentFlag[ctr]);
-
-    CHECK(!(rps->getDeltaPocMSBCycleLT(i) >= 0), "Unspecified error");   // Non-negative value
-  }
-  for(i = rps->getNumberOfPictures() - 1, ctr = 1; i >= offset; i--, ctr++)
-  {
-    for(int j = rps->getNumberOfPictures() - 1 - ctr; j >= offset; j--)
-    {
-      // Here at the encoder we know that we have set the full POC value for the LTRPs, hence we
-      // don't have to check the MSB present flag values for this constraint.
-      CHECK(!( rps->getPOC(i) != rps->getPOC(j) ), "Unspecified error"); // If assert fails, LTRP entry repeated in RPS!!!
-    }
-  }
-}
-#endif
 
 void EncGOP::arrangeCompositeReference(Slice* pcSlice, PicList& rcListPic, int pocCurr)
 {
diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h
index 7db9df8a7..21144d031 100644
--- a/source/Lib/EncoderLib/EncGOP.h
+++ b/source/Lib/EncoderLib/EncGOP.h
@@ -208,9 +208,6 @@ public:
 #endif
   EncSlice*  getSliceEncoder()   { return m_pcSliceEncoder; }
   NalUnitType getNalUnitType( int pocCurr, int lastIdr, bool isField );
-#if !JVET_M0128
-  void arrangeLongtermPicturesInRPS(Slice *, PicList& );
-#endif
   void arrangeCompositeReference(Slice* pcSlice, PicList& rcListPic, int pocCurr);
   void updateCompositeReference(Slice* pcSlice, PicList& rcListPic, int pocCurr);
 
@@ -274,12 +271,8 @@ protected:
   void xWriteTrailingSEIMessages (SEIMessages& seiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps);
   void xWriteDuSEIMessages       (SEIMessages& duInfoSeiMessages, AccessUnit &accessUnit, int temporalId, const SPS *sps, std::deque<DUData> &duData);
 
-#if HEVC_VPS || JVET_N0278_HLS
   int xWriteVPS (AccessUnit &accessUnit, const VPS *vps);
-#endif
-#if JVET_N0349_DPS
   int xWriteDPS (AccessUnit &accessUnit, const DPS *dps);
-#endif
   int xWriteSPS (AccessUnit &accessUnit, const SPS *sps);
   int xWritePPS (AccessUnit &accessUnit, const PPS *pps);
   int xWriteAPS(AccessUnit &accessUnit, APS *aps);
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index 7ce50c5eb..4f822c1cb 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -60,18 +60,12 @@
 EncLib::EncLib()
   : m_spsMap( MAX_NUM_SPS )
   , m_ppsMap( MAX_NUM_PPS )
-#if JVET_N0805_APS_LMCS
   , m_apsMap(MAX_NUM_APS * MAX_NUM_APS_TYPE)
-#else
-  , m_apsMap( MAX_NUM_APS )
-#endif
   , m_AUWriterIf( nullptr )
 #if JVET_J0090_MEMORY_BANDWITH_MEASURE
   , m_cacheModel()
 #endif
-#if JVET_N0805_APS_LMCS
   , m_lmcsAPS(nullptr)
-#endif
 {
   m_iPOCLast          = -1;
   m_iNumPicRcvd       =  0;
@@ -83,9 +77,7 @@ EncLib::EncLib()
   g_pelBufOP.initPelBufOpsX86();
 #endif
 
-#if JVET_N0415_CTB_ALF
   memset(m_apss, 0, sizeof(m_apss));
-#endif
 }
 
 EncLib::~EncLib()
@@ -146,11 +138,7 @@ void EncLib::create ()
   }
   if( m_alf )
   {
-#if JVET_N0242_NON_LINEAR_ALF
     m_cEncALF.create( this, getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_bitDepth, m_inputBitDepth );
-#else
-    m_cEncALF.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_bitDepth, m_inputBitDepth );
-#endif
   }
 
 #if ENABLE_SPLIT_PARALLELISM || ENABLE_WPP_PARALLELISM
@@ -239,24 +227,19 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
 
   SPS &sps0=*(m_spsMap.allocatePS(0)); // NOTE: implementations that use more than 1 SPS need to be aware of activation issues.
   PPS &pps0=*(m_ppsMap.allocatePS(0));
-#if !JVET_N0415_CTB_ALF
-  APS &aps0=*(m_apsMap.allocatePS(0));
-#endif
 
   // initialize SPS
   xInitSPS(sps0);
 #if HEVC_VPS
   xInitVPS(m_cVPS, sps0);
-#elif JVET_N0278_HLS
+#else
   xInitVPS(m_cVPS);
 #endif
 
-#if JVET_N0349_DPS
   int dpsId = getDecodingParameterSetEnabled() ? 1 : 0;
   xInitDPS(m_dps, sps0, dpsId);
   sps0.setDecodingParameterSetId(m_dps.getDecodingParameterSetId());
     
-#endif
 #if ENABLE_SPLIT_PARALLELISM
   if( omp_get_dynamic() )
   {
@@ -273,11 +256,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
 #if U0132_TARGET_BITS_SATURATION
   if (m_RCCpbSaturationEnabled)
   {
-#if JVET_N0063_VUI
     m_cRateCtrl.initHrdParam(sps0.getHrdParameters(), m_iFrameRate, m_RCInitialCpbFullness);
-#else
-    m_cRateCtrl.initHrdParam(sps0.getVuiParameters()->getHrdParameters(), m_iFrameRate, m_RCInitialCpbFullness);
-#endif
   }
 #endif
 #if ENABLE_SPLIT_PARALLELISM || ENABLE_WPP_PARALLELISM
@@ -292,14 +271,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
   // initialize PPS
   xInitPPS(pps0, sps0);
   // initialize APS
-#if !JVET_N0415_CTB_ALF
-  xInitAPS(aps0);
-#endif
-#if JVET_M0128
   xInitRPL(sps0, isFieldCoding);
-#else
-  xInitRPS(sps0, isFieldCoding);
-#endif
 
 #if ER_CHROMA_QP_WCG_PPS
   if (m_wcgChromaQpControl.isEnabled())
@@ -413,7 +385,6 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
 
   m_iMaxRefPicNum = 0;
 
-#if HEVC_USE_SCALING_LISTS
 #if ER_CHROMA_QP_WCG_PPS
   if( m_wcgChromaQpControl.isEnabled() )
   {
@@ -425,7 +396,6 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
   {
     xInitScalingLists( sps0, pps0 );
   }
-#endif
 #if ENABLE_WPP_PARALLELISM
   m_entropyCodingSyncContextStateVec.resize( pps0.pcv->heightInCtus );
 #endif
@@ -434,18 +404,8 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
     Picture *picBg = new Picture;
     picBg->create(sps0.getChromaFormatIdc(), Size(sps0.getPicWidthInLumaSamples(), sps0.getPicHeightInLumaSamples()), sps0.getMaxCUWidth(), sps0.getMaxCUWidth() + 16, false);
     picBg->getRecoBuf().fill(0);
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
     picBg->finalInit(sps0, pps0, m_apss, *m_lmcsAPS);
-#else
-    picBg->finalInit(sps0, pps0, m_apss);
-#endif
-#else
-    picBg->finalInit(sps0, pps0, aps0);
-#endif
-#if JVET_N0857_RECT_SLICES
     pps0.setNumBricksInPic((int)picBg->brickMap->bricks.size());
-#endif
     picBg->allocateNewSlice();
     picBg->createSpliceIdx(pps0.pcv->sizeInCtus);
     m_cGOPEncoder.setPicBg(picBg);
@@ -456,7 +416,6 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
   }
 }
 
-#if HEVC_USE_SCALING_LISTS
 void EncLib::xInitScalingLists(SPS &sps, PPS &pps)
 {
   // Initialise scaling lists
@@ -523,20 +482,11 @@ void EncLib::xInitScalingLists(SPS &sps, PPS &pps)
     THROW("error : ScalingList == " << getUseScalingListId() << " not supported\n");
   }
 
-#if JVET_N0847_SCALING_LISTS
   if (getUseScalingListId() == SCALING_LIST_FILE_READ && sps.getScalingListPresentFlag())
-#else
-  if (getUseScalingListId() != SCALING_LIST_OFF)
-#endif
   {
     // Prepare delta's:
-#if JVET_N0847_SCALING_LISTS
     for (uint32_t sizeId = SCALING_LIST_2x2; sizeId <= SCALING_LIST_64x64; sizeId++)
-#else
-    for(uint32_t sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
-#endif
     {
-#if JVET_N0847_SCALING_LISTS
       for (uint32_t listId = 0; listId < SCALING_LIST_NUM; listId++)
       {
         if (((sizeId == SCALING_LIST_64x64) && (listId % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) != 0))
@@ -544,18 +494,11 @@ void EncLib::xInitScalingLists(SPS &sps, PPS &pps)
         {
           continue;
         }
-#else
-      const int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
-
-      for(uint32_t listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)
-      {
-#endif
         sps.getScalingList().checkPredMode( sizeId, listId );
       }
     }
   }
 }
-#endif
 
 void EncLib::xInitPPSforLT(PPS& pps)
 {
@@ -614,16 +557,7 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru
     const SPS *sps = m_spsMap.getPS(pps->getSPSId());
 
     picCurr->M_BUFS(0, PIC_ORIGINAL).copyFrom(m_cGOPEncoder.getPicBg()->getRecoBuf());
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
     picCurr->finalInit(*sps, *pps, m_apss, *m_lmcsAPS);
-#else
-    picCurr->finalInit(*sps, *pps, m_apss);
-#endif
-#else
-    APS *aps = m_apsMap.getPS(0);
-    picCurr->finalInit(*sps, *pps, *aps);
-#endif
     picCurr->poc = m_iPOCLast - 1;
     m_iPOCLast -= 2;
     if (getUseAdaptiveQP())
@@ -671,20 +605,9 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru
 
       pcPicCurr->M_BUFS( 0, PIC_ORIGINAL ).swap( *pcPicYuvOrg );
       pcPicCurr->M_BUFS( 0, PIC_TRUE_ORIGINAL ).swap(*cPicYuvTrueOrg );
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
       pcPicCurr->finalInit(*pSPS, *pPPS, m_apss, *m_lmcsAPS);
-#else
-      pcPicCurr->finalInit(*pSPS, *pPPS, m_apss);
-#endif
-#else
-      APS *pAPS = m_apsMap.getPS(0);
-      pcPicCurr->finalInit(*pSPS, *pPPS, *pAPS);
-#endif
-#if JVET_N0857_RECT_SLICES
       PPS *ptrPPS = (ppsID<0) ? m_ppsMap.getFirstPS() : m_ppsMap.getPS(ppsID);
       ptrPPS->setNumBricksInPic((int)pcPicCurr->brickMap->bricks.size());
-#endif
     }
 
     pcPicCurr->poc = m_iPOCLast;
@@ -778,16 +701,7 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* pcPicYuvTr
         int ppsID=-1; // Use default PPS ID
         const PPS *pPPS=(ppsID<0) ? m_ppsMap.getFirstPS() : m_ppsMap.getPS(ppsID);
         const SPS *pSPS=m_spsMap.getPS(pPPS->getSPSId());
-#if JVET_N0415_CTB_ALF
-#if JVET_N0805_APS_LMCS
         pcField->finalInit(*pSPS, *pPPS, m_apss, *m_lmcsAPS);
-#else
-        pcField->finalInit(*pSPS, *pPPS, m_apss);
-#endif
-#else
-        APS *pAPS = m_apsMap.getPS(0);
-        pcField->finalInit(*pSPS, *pPPS, *pAPS);
-#endif
       }
 
       pcField->poc = m_iPOCLast;
@@ -921,7 +835,7 @@ void EncLib::xInitVPS(VPS &vps, const SPS &sps)
     // Set up HrdParameters here.
   }
 }
-#elif JVET_N0278_HLS
+#else
 void EncLib::xInitVPS(VPS &vps)
 {
   // The SPS must have already been set up.
@@ -934,7 +848,6 @@ void EncLib::xInitVPS(VPS &vps)
 }
 #endif
 
-#if JVET_N0349_DPS
 void EncLib::xInitDPS(DPS &dps, const SPS &sps, const int dpsId)
 {
   // The SPS must have already been set up.
@@ -943,86 +856,10 @@ void EncLib::xInitDPS(DPS &dps, const SPS &sps, const int dpsId)
   dps.setMaxSubLayersMinus1(sps.getMaxTLayers()-1);
   dps.setProfileTierLevel(*sps.getProfileTierLevel());
 }
-#endif
 
 
 void EncLib::xInitSPS(SPS &sps)
 {
-#if !JVET_M0101_HLS
-  sps.setIntraOnlyConstraintFlag(m_bIntraOnlyConstraintFlag);
-  sps.setMaxBitDepthConstraintIdc(m_maxBitDepthConstraintIdc);
-  sps.setMaxChromaFormatConstraintIdc(m_maxChromaFormatConstraintIdc);
-  sps.setFrameConstraintFlag(m_frameOnlyConstraintFlag);
-  sps.setNoQtbttDualTreeIntraConstraintFlag(m_bNoQtbttDualTreeIntraConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoPartitionConstraintsOverrideConstraintFlag(m_noPartitionConstraintsOverrideConstraintFlag);
-#endif
-  sps.setNoSaoConstraintFlag(m_bNoSaoConstraintFlag);
-  sps.setNoAlfConstraintFlag(m_bNoAlfConstraintFlag);
-  sps.setNoPcmConstraintFlag(m_bNoPcmConstraintFlag);
-  sps.setNoRefWraparoundConstraintFlag(m_bNoRefWraparoundConstraintFlag);
-  sps.setNoTemporalMvpConstraintFlag(m_bNoTemporalMvpConstraintFlag);
-  sps.setNoSbtmvpConstraintFlag(m_bNoSbtmvpConstraintFlag);
-  sps.setNoAmvrConstraintFlag(m_bNoAmvrConstraintFlag);
-  sps.setNoBdofConstraintFlag(m_bNoBdofConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoDmvrConstraintFlag(m_noDmvrConstraintFlag);
-#endif
-  sps.setNoCclmConstraintFlag(m_bNoCclmConstraintFlag);
-  sps.setNoMtsConstraintFlag(m_bNoMtsConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoSbtConstraintFlag(m_noSbtConstraintFlag);
-#endif
-  sps.setNoAffineMotionConstraintFlag(m_bNoAffineMotionConstraintFlag);
-  sps.setNoGbiConstraintFlag(m_bNoGbiConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoIbcConstraintFlag(m_noIbcConstraintFlag);
-#endif
-  sps.setNoMhIntraConstraintFlag(m_bNoMhIntraConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoFPelMmvdConstraintFlag(m_noFPelMmvdConstraintFlag);
-#endif
-  sps.setNoTriangleConstraintFlag(m_bNoTriangleConstraintFlag);
-  sps.setNoLadfConstraintFlag(m_bNoLadfConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoTransformSkipConstraintFlag(m_noTransformSkipConstraintFlag);
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  sps.setNoCurrPicRefConstraintFlag(m_bNoCurrPicRefConstraintFlag);
-#endif
-  sps.setNoQpDeltaConstraintFlag(m_bNoQpDeltaConstraintFlag);
-  sps.setNoDepQuantConstraintFlag(m_bNoDepQuantConstraintFlag);
-  sps.setNoSignDataHidingConstraintFlag(m_bNoSignDataHidingConstraintFlag);
-
-  ProfileTierLevel& profileTierLevel = *sps.getPTL()->getGeneralPTL();
-  profileTierLevel.setLevelIdc                    (m_level);
-  profileTierLevel.setTierFlag                    (m_levelTier);
-  profileTierLevel.setProfileIdc                  (m_profile);
-#if JVET_N0276_CONSTRAINT_FLAGS
-  profileTierLevel.setSubProfileIdc               (m_subProfile);
-#endif
-  profileTierLevel.setProfileCompatibilityFlag    (m_profile, 1);
-  profileTierLevel.setProgressiveSourceFlag       (m_progressiveSourceFlag);
-  profileTierLevel.setInterlacedSourceFlag        (m_interlacedSourceFlag);
-  profileTierLevel.setNonPackedConstraintFlag     (m_nonPackedConstraintFlag);
-  profileTierLevel.setFrameOnlyConstraintFlag     (m_frameOnlyConstraintFlag);
-  profileTierLevel.setBitDepthConstraint          (m_bitDepthConstraintValue);
-  profileTierLevel.setChromaFormatConstraint      (m_chromaFormatConstraintValue);
-  profileTierLevel.setIntraConstraintFlag         (m_intraConstraintFlag);
-  profileTierLevel.setOnePictureOnlyConstraintFlag(m_onePictureOnlyConstraintFlag);
-  profileTierLevel.setLowerBitRateConstraintFlag  (m_lowerBitRateConstraintFlag);
-
-  if ((m_profile == Profile::MAIN10) && (m_bitDepth[CHANNEL_TYPE_LUMA] == 8) && (m_bitDepth[CHANNEL_TYPE_CHROMA] == 8))
-  {
-    /* The above constraint is equal to Profile::MAIN */
-    profileTierLevel.setProfileCompatibilityFlag(Profile::MAIN, 1);
-  }
-  if (m_profile == Profile::MAIN)
-  {
-    /* A Profile::MAIN10 decoder can always decode Profile::MAIN */
-    profileTierLevel.setProfileCompatibilityFlag( Profile::MAIN10, 1 );
-  }
-#else
   ProfileTierLevel* profileTierLevel = sps.getProfileTierLevel();
   ConstraintInfo* cinfo = profileTierLevel->getConstraintInfo();
   cinfo->setProgressiveSourceFlag       (m_progressiveSourceFlag);
@@ -1033,9 +870,7 @@ void EncLib::xInitSPS(SPS &sps)
   cinfo->setMaxBitDepthConstraintIdc    (m_maxBitDepthConstraintIdc);
   cinfo->setMaxChromaFormatConstraintIdc((ChromaFormat)m_maxChromaFormatConstraintIdc);
   cinfo->setNoQtbttDualTreeIntraConstraintFlag(m_bNoQtbttDualTreeIntraConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
   cinfo->setNoPartitionConstraintsOverrideConstraintFlag(m_noPartitionConstraintsOverrideConstraintFlag);
-#endif
   cinfo->setNoSaoConstraintFlag(m_bNoSaoConstraintFlag);
   cinfo->setNoAlfConstraintFlag(m_bNoAlfConstraintFlag);
   cinfo->setNoPcmConstraintFlag(m_bNoPcmConstraintFlag);
@@ -1044,31 +879,18 @@ void EncLib::xInitSPS(SPS &sps)
   cinfo->setNoSbtmvpConstraintFlag(m_bNoSbtmvpConstraintFlag);
   cinfo->setNoAmvrConstraintFlag(m_bNoAmvrConstraintFlag);
   cinfo->setNoBdofConstraintFlag(m_bNoBdofConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
   cinfo->setNoDmvrConstraintFlag(m_noDmvrConstraintFlag);
-#endif
   cinfo->setNoCclmConstraintFlag(m_bNoCclmConstraintFlag);
   cinfo->setNoMtsConstraintFlag(m_bNoMtsConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
   cinfo->setNoSbtConstraintFlag(m_noSbtConstraintFlag);
-#endif
   cinfo->setNoAffineMotionConstraintFlag(m_bNoAffineMotionConstraintFlag);
   cinfo->setNoGbiConstraintFlag(m_bNoGbiConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
   cinfo->setNoIbcConstraintFlag(m_noIbcConstraintFlag);
-#endif
   cinfo->setNoMhIntraConstraintFlag(m_bNoMhIntraConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
   cinfo->setNoFPelMmvdConstraintFlag(m_noFPelMmvdConstraintFlag);
-#endif
   cinfo->setNoTriangleConstraintFlag(m_bNoTriangleConstraintFlag);
   cinfo->setNoLadfConstraintFlag(m_bNoLadfConstraintFlag);
-#if JVET_N0276_CONSTRAINT_FLAGS
   cinfo->setNoTransformSkipConstraintFlag(m_noTransformSkipConstraintFlag);
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  cinfo->setNoCurrPicRefConstraintFlag(m_bNoCurrPicRefConstraintFlag);
-#endif
   cinfo->setNoQpDeltaConstraintFlag(m_bNoQpDeltaConstraintFlag);
   cinfo->setNoDepQuantConstraintFlag(m_bNoDepQuantConstraintFlag);
   cinfo->setNoSignDataHidingConstraintFlag(m_bNoSignDataHidingConstraintFlag);
@@ -1076,11 +898,8 @@ void EncLib::xInitSPS(SPS &sps)
   profileTierLevel->setLevelIdc                    (m_level);
   profileTierLevel->setTierFlag                    (m_levelTier);
   profileTierLevel->setProfileIdc                  (m_profile);
-#if JVET_N0276_CONSTRAINT_FLAGS
   profileTierLevel->setSubProfileIdc               (m_subProfile);
-#endif
 
-#endif
   /* XXX: should Main be marked as compatible with still picture? */
   /* XXX: may be a good idea to refactor the above into a function
    * that chooses the actual compatibility based upon options */
@@ -1098,13 +917,9 @@ void EncLib::xInitSPS(SPS &sps)
   sps.setSplitConsOverrideEnabledFlag        ( m_useSplitConsOverride );
   sps.setMinQTSizes                          ( m_uiMinQT );
   sps.setMaxBTDepth                          ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
-#if JVET_N0047_Merge_IDR_Non_IDR
   sps.setIDRRefParamListPresent              ( m_idrRefParamList );
-#endif
   sps.setUseDualITree                        ( m_dualITree );
-#if JVET_N0193_LFNST
   sps.setUseLFNST                            ( m_LFNST );
-#endif
   sps.setSBTMVPEnabledFlag                  ( m_SubPuMvpMode );
   sps.setAMVREnabledFlag                ( m_ImvMode != IMV_OFF );
   sps.setBDOFEnabledFlag                    ( m_BIO );
@@ -1120,9 +935,7 @@ void EncLib::xInitSPS(SPS &sps)
   {
     sps.setMaxSbtSize                       ( m_iSourceWidth >= 1920 ? 64 : 32 );
   }
-#if JVET_N0235_SMVD_SPS
   sps.setUseSMVD                ( m_SMVD );
-#endif
   sps.setUseGBi                ( m_GBi );
 #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
   sps.setLadfEnabled           ( m_LadfEnabled );
@@ -1140,12 +953,8 @@ void EncLib::xInitSPS(SPS &sps)
 
   sps.setUseMHIntra            ( m_MHIntra );
   sps.setUseTriangle           ( m_Triangle );
-#if JVET_N0127_MMVD_SPS_FLAG
   sps.setUseMMVD               ( m_MMVD );
   sps.setFpelMmvdEnabledFlag   (( m_MMVD ) ? m_allowDisFracMMVD : false);
-#else
-  sps.setFpelMmvdEnabledFlag             ( m_allowDisFracMMVD );
-#endif
   sps.setAffineAmvrEnabledFlag              ( m_AffineAmvr );
   sps.setUseDMVR                            ( m_DMVR );
 
@@ -1157,9 +966,7 @@ void EncLib::xInitSPS(SPS &sps)
   sps.setUseISP                             ( m_ISP );
 #endif
   sps.setUseReshaper                        ( m_lumaReshapeEnable );
-#if JVET_N0217_MATRIX_INTRAPRED
   sps.setUseMIP                ( m_MIP );
-#endif
   int minCUSize =  sps.getMaxCUWidth() >> sps.getLog2DiffMaxMinCodingBlockSize();
   int log2MinCUSize = 0;
   while(minCUSize > 1)
@@ -1199,16 +1006,10 @@ void EncLib::xInitSPS(SPS &sps)
   }
 
   sps.setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag );
-#if HEVC_USE_SCALING_LISTS
   sps.setScalingListFlag ( (m_useScalingListId == SCALING_LIST_OFF) ? 0 : 1 );
-#endif
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  sps.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );
-#endif
   sps.setALFEnabledFlag( m_alf );
   sps.setVuiParametersPresentFlag(getVuiParametersPresentFlag());
 
-#if JVET_N0063_VUI
   if (sps.getVuiParametersPresentFlag())
   {
     VUI* pcVUI = sps.getVuiParameters();
@@ -1230,43 +1031,6 @@ void EncLib::xInitSPS(SPS &sps)
     pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
     pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag());
   }
-#else
-  if (sps.getVuiParametersPresentFlag())
-  {
-    VUI* pcVUI = sps.getVuiParameters();
-    pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioInfoPresentFlag());
-    pcVUI->setAspectRatioIdc(getAspectRatioIdc());
-    pcVUI->setSarWidth(getSarWidth());
-    pcVUI->setSarHeight(getSarHeight());
-    pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
-    pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
-    pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
-    pcVUI->setVideoFormat(getVideoFormat());
-    pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag());
-    pcVUI->setColourDescriptionPresentFlag(getColourDescriptionPresentFlag());
-    pcVUI->setColourPrimaries(getColourPrimaries());
-    pcVUI->setTransferCharacteristics(getTransferCharacteristics());
-    pcVUI->setMatrixCoefficients(getMatrixCoefficients());
-    pcVUI->setChromaLocInfoPresentFlag(getChromaLocInfoPresentFlag());
-    pcVUI->setChromaSampleLocTypeTopField(getChromaSampleLocTypeTopField());
-    pcVUI->setChromaSampleLocTypeBottomField(getChromaSampleLocTypeBottomField());
-    pcVUI->setNeutralChromaIndicationFlag(getNeutralChromaIndicationFlag());
-    pcVUI->setDefaultDisplayWindow(getDefaultDisplayWindow());
-    pcVUI->setFrameFieldInfoPresentFlag(getFrameFieldInfoPresentFlag());
-    pcVUI->setFieldSeqFlag(false);
-    pcVUI->setHrdParametersPresentFlag(false);
-    pcVUI->getTimingInfo()->setPocProportionalToTimingFlag(getPocProportionalToTimingFlag());
-    pcVUI->getTimingInfo()->setNumTicksPocDiffOneMinus1   (getNumTicksPocDiffOneMinus1()   );
-    pcVUI->setBitstreamRestrictionFlag(getBitstreamRestrictionFlag());
-    pcVUI->setTilesFixedStructureFlag(getTilesFixedStructureFlag());
-    pcVUI->setMotionVectorsOverPicBoundariesFlag(getMotionVectorsOverPicBoundariesFlag());
-    pcVUI->setMinSpatialSegmentationIdc(getMinSpatialSegmentationIdc());
-    pcVUI->setMaxBytesPerPicDenom(getMaxBytesPerPicDenom());
-    pcVUI->setMaxBitsPerMinCuDenom(getMaxBitsPerMinCuDenom());
-    pcVUI->setLog2MaxMvLengthHorizontal(getLog2MaxMvLengthHorizontal());
-    pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical());
-  }
-#endif
 
   sps.setNumLongTermRefPicSPS(NUM_LONG_TERM_REF_PIC_SPS);
   CHECK(!(NUM_LONG_TERM_REF_PIC_SPS <= MAX_NUM_LONG_TERM_REF_PICS), "Unspecified error");
@@ -1286,11 +1050,7 @@ void EncLib::xInitSPS(SPS &sps)
   }
   if( getBufferingPeriodSEIEnabled() || getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() )
   {
-#if JVET_N0063_VUI
     sps.setHrdParametersPresentFlag( true );
-#else
-    sps.getVuiParameters()->setHrdParametersPresentFlag( true );
-#endif
   }
 
   // Set up SPS range extension settings
@@ -1306,31 +1066,19 @@ void EncLib::xInitSPS(SPS &sps)
   sps.getSpsRangeExtension().setPersistentRiceAdaptationEnabledFlag(m_persistentRiceAdaptationEnabledFlag);
   sps.getSpsRangeExtension().setCabacBypassAlignmentEnabledFlag(m_cabacBypassAlignmentEnabledFlag);
 
-#if JVET_M0128
   if (m_uiIntraPeriod < 0)
     sps.setRPL1CopyFromRPL0Flag(true);
-#endif
 }
 
 void EncLib::xInitHrdParameters(SPS &sps)
 {
   m_encHRD.initHRDParameters((EncCfg*) this);
   
-#if JVET_N0063_VUI
   HRDParameters *hrdParams = sps.getHrdParameters();
   *hrdParams = m_encHRD.getHRDParameters();
 
   TimingInfo *timingInfo = sps.getTimingInfo();
   *timingInfo = m_encHRD.getTimingInfo();
-#else
-  VUI *vui = sps.getVuiParameters();
-  
-  HRDParameters *hrdParams = vui->getHrdParameters();
-  *hrdParams = m_encHRD.getHRDParameters();
-
-  TimingInfo *timingInfo = vui->getTimingInfo();
-  *timingInfo = m_encHRD.getTimingInfo();
-#endif
 }
 
 void EncLib::xInitPPS(PPS &pps, const SPS &sps)
@@ -1425,18 +1173,14 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
     const int crQP =(int)(dcrQP + ( dcrQP < 0 ? -0.5 : 0.5) );
     pps.setQpOffset(COMPONENT_Cb, Clip3( -12, 12, min(0, cbQP) + m_chromaCbQpOffset ));
     pps.setQpOffset(COMPONENT_Cr, Clip3( -12, 12, min(0, crQP) + m_chromaCrQpOffset));
-#if JVET_N0054_JOINT_CHROMA
     pps.setQpOffset(JOINT_CbCr,   Clip3( -12, 12, ( min(0, cbQP) + min(0, crQP) ) / 2 + m_chromaCbCrQpOffset));
-#endif
   }
   else
   {
 #endif
   pps.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset );
   pps.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset );
-#if JVET_N0054_JOINT_CHROMA
   pps.setQpOffset(JOINT_CbCr, m_chromaCbCrQpOffset );
-#endif
 #if ER_CHROMA_QP_WCG_PPS
   }
 #endif
@@ -1468,20 +1212,12 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
     !pps.getSliceChromaQpFlag() && sps.getUseDualITree()
     && (getChromaFormatIdc() != CHROMA_400))
   {
-#if JVET_N0054_JOINT_CHROMA
     pps.setSliceChromaQpFlag(m_chromaCbQpOffsetDualTree != 0 || m_chromaCrQpOffsetDualTree != 0 || m_chromaCbCrQpOffsetDualTree != 0);
-#else
-    pps.setSliceChromaQpFlag(m_chromaCbQpOffsetDualTree != 0 || m_chromaCrQpOffsetDualTree != 0);
-#endif
   }
 
   pps.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag );
 
-#if JVET_N0857_TILES_BRICKS
   pps.setSingleTileInPicFlag((m_iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0));
-#else
-  pps.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) );
-#endif
 
   pps.setUseWP( m_useWeightedPred );
   pps.setWPBiPred( m_useWeightedBiPred );
@@ -1529,13 +1265,8 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
   }
   for( int i = 0; i < getGOPSize(); i++)
   {
-#if JVET_M0128
     CHECK(!(getRPLEntry(0, i).m_numRefPicsActive >= 0 && getRPLEntry(0, i).m_numRefPicsActive <= MAX_NUM_REF), "Unspecified error");
     histogram[getRPLEntry(0, i).m_numRefPicsActive]++;
-#else
-    CHECK(!(getGOPEntry(i).m_numRefPicsActive >= 0 && getGOPEntry(i).m_numRefPicsActive <= MAX_NUM_REF), "Unspecified error");
-    histogram[getGOPEntry(i).m_numRefPicsActive]++;
-#endif
   }
 
   int maxHist=-1;
@@ -1558,7 +1289,6 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
 
   xInitPPSforTiles(pps);
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   pps.setLoopFilterAcrossVirtualBoundariesDisabledFlag( m_loopFilterAcrossVirtualBoundariesDisabledFlag );
   pps.setNumVerVirtualBoundaries            ( m_numVerVirtualBoundaries );
   pps.setNumHorVirtualBoundaries            ( m_numHorVirtualBoundaries );
@@ -1570,12 +1300,9 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
   {
     pps.setVirtualBoundariesPosY            ( m_virtualBoundariesPosY[i], i );
   }
-#endif
 
   pps.pcv = new PreCalcValues( sps, pps, true );
-#if JVET_M0128
   pps.setRpl1IdxPresentFlag(sps.getRPL1IdxPresentFlag());
-#endif
 }
 
 void EncLib::xInitAPS(APS &aps)
@@ -1583,7 +1310,6 @@ void EncLib::xInitAPS(APS &aps)
   //Do nothing now
 }
 
-#if JVET_M0128
 void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
 {
   ReferencePictureList*      rpl;
@@ -1758,301 +1484,9 @@ void EncLib::selectReferencePictureList(Slice* slice, int POCCurr, int GOPid, in
   slice->setRPL0(rpl0);
   slice->setRPL1(rpl1);
 }
-#else
-//Function for initializing m_RPSList, a list of ReferencePictureSet, based on the GOPEntry objects read from the config file.
-void EncLib::xInitRPS(SPS &sps, bool isFieldCoding)
-{
-  ReferencePictureSet*      rps;
-
-  sps.createRPSList(getGOPSize() + m_extraRPSs + 1);
-  RPSList* rpsList = sps.getRPSList();
-
-  for( int i = 0; i < getGOPSize()+m_extraRPSs; i++)
-  {
-    const GOPEntry &ge = getGOPEntry(i);
-    rps = rpsList->getReferencePictureSet(i);
-    rps->setNumberOfPictures(ge.m_numRefPics);
-    rps->setNumRefIdc(ge.m_numRefIdc);
-    int numNeg = 0;
-    int numPos = 0;
-    for( int j = 0; j < ge.m_numRefPics; j++)
-    {
-      rps->setDeltaPOC(j,ge.m_referencePics[j]);
-      rps->setUsed(j,ge.m_usedByCurrPic[j]);
-      if(ge.m_referencePics[j]>0)
-      {
-        numPos++;
-      }
-      else
-      {
-        numNeg++;
-      }
-    }
-    rps->setNumberOfNegativePictures(numNeg);
-    rps->setNumberOfPositivePictures(numPos);
-
-    // handle inter RPS intialization from the config file.
-    rps->setInterRPSPrediction(ge.m_interRPSPrediction > 0);  // not very clean, converting anything > 0 to true.
-    rps->setDeltaRIdxMinus1(0);                               // index to the Reference RPS is always the previous one.
-    ReferencePictureSet*     RPSRef = i>0 ? rpsList->getReferencePictureSet(i-1): NULL;  // get the reference RPS
-
-    if (ge.m_interRPSPrediction == 2)  // Automatic generation of the inter RPS idc based on the RIdx provided.
-    {
-      CHECK(!(RPSRef!=NULL), "Unspecified error");
-      int deltaRPS = getGOPEntry(i-1).m_POC - ge.m_POC;  // the ref POC - current POC
-      int numRefDeltaPOC = RPSRef->getNumberOfPictures();
-
-      rps->setDeltaRPS(deltaRPS);           // set delta RPS
-      rps->setNumRefIdc(numRefDeltaPOC+1);  // set the numRefIdc to the number of pictures in the reference RPS + 1.
-      int count=0;
-      for (int j = 0; j <= numRefDeltaPOC; j++ ) // cycle through pics in reference RPS.
-      {
-        int RefDeltaPOC = (j<numRefDeltaPOC)? RPSRef->getDeltaPOC(j): 0;  // if it is the last decoded picture, set RefDeltaPOC = 0
-        rps->setRefIdc(j, 0);
-        for (int k = 0; k < rps->getNumberOfPictures(); k++ )  // cycle through pics in current RPS.
-        {
-          if (rps->getDeltaPOC(k) == ( RefDeltaPOC + deltaRPS))  // if the current RPS has a same picture as the reference RPS.
-          {
-              rps->setRefIdc(j, (rps->getUsed(k)?1:2));
-              count++;
-              break;
-          }
-        }
-      }
-      if (count != rps->getNumberOfPictures())
-      {
-        msg( WARNING, "Warning: Unable fully predict all delta POCs using the reference RPS index given in the config file.  Setting Inter RPS to false for this RPS.\n");
-        rps->setInterRPSPrediction(0);
-      }
-    }
-    else if (ge.m_interRPSPrediction == 1)  // inter RPS idc based on the RefIdc values provided in config file.
-    {
-      CHECK(!(RPSRef!=NULL), "Unspecified error");
-      rps->setDeltaRPS(ge.m_deltaRPS);
-      rps->setNumRefIdc(ge.m_numRefIdc);
-      for (int j = 0; j < ge.m_numRefIdc; j++ )
-      {
-        rps->setRefIdc(j, ge.m_refIdc[j]);
-      }
-      // the following code overwrite the deltaPOC and Used by current values read from the config file with the ones
-      // computed from the RefIdc.  A warning is printed if they are not identical.
-      numNeg = 0;
-      numPos = 0;
-      ReferencePictureSet      RPSTemp;  // temporary variable
-
-      for (int j = 0; j < ge.m_numRefIdc; j++ )
-      {
-        if (ge.m_refIdc[j])
-        {
-          int deltaPOC = ge.m_deltaRPS + ((j < RPSRef->getNumberOfPictures())? RPSRef->getDeltaPOC(j) : 0);
-          RPSTemp.setDeltaPOC((numNeg+numPos),deltaPOC);
-          RPSTemp.setUsed((numNeg+numPos),ge.m_refIdc[j]==1?1:0);
-          if (deltaPOC<0)
-          {
-            numNeg++;
-          }
-          else
-          {
-            numPos++;
-          }
-        }
-      }
-      if (numNeg != rps->getNumberOfNegativePictures())
-      {
-        msg( WARNING, "Warning: number of negative pictures in RPS is different between intra and inter RPS specified in the config file.\n");
-        rps->setNumberOfNegativePictures(numNeg);
-        rps->setNumberOfPictures(numNeg+numPos);
-      }
-      if (numPos != rps->getNumberOfPositivePictures())
-      {
-        msg( WARNING, "Warning: number of positive pictures in RPS is different between intra and inter RPS specified in the config file.\n");
-        rps->setNumberOfPositivePictures(numPos);
-        rps->setNumberOfPictures(numNeg+numPos);
-      }
-      RPSTemp.setNumberOfPictures(numNeg+numPos);
-      RPSTemp.setNumberOfNegativePictures(numNeg);
-      RPSTemp.sortDeltaPOC();     // sort the created delta POC before comparing
-      // check if Delta POC and Used are the same
-      // print warning if they are not.
-      for (int j = 0; j < ge.m_numRefIdc; j++ )
-      {
-        if (RPSTemp.getDeltaPOC(j) != rps->getDeltaPOC(j))
-        {
-          msg( WARNING, "Warning: delta POC is different between intra RPS and inter RPS specified in the config file.\n");
-          rps->setDeltaPOC(j,RPSTemp.getDeltaPOC(j));
-        }
-        if (RPSTemp.getUsed(j) != rps->getUsed(j))
-        {
-          msg( WARNING, "Warning: Used by Current in RPS is different between intra and inter RPS specified in the config file.\n");
-          rps->setUsed(j,RPSTemp.getUsed(j));
-        }
-      }
-    }
-  }
-  //In case of field coding, we need to set special parameters for the first bottom field of the sequence, since it is not specified in the cfg file.
-  //The position = GOPSize + extraRPSs which is (a priori) unused is reserved for this field in the RPS.
-  if (isFieldCoding)
-  {
-    rps = rpsList->getReferencePictureSet(getGOPSize()+m_extraRPSs);
-    rps->setNumberOfPictures(1);
-    rps->setNumberOfNegativePictures(1);
-    rps->setNumberOfPositivePictures(0);
-    rps->setNumberOfLongtermPictures(0);
-    rps->setDeltaPOC(0,-1);
-    rps->setPOC(0,0);
-    rps->setUsed(0,true);
-    rps->setInterRPSPrediction(false);
-    rps->setDeltaRIdxMinus1(0);
-    rps->setDeltaRPS(0);
-    rps->setNumRefIdc(0);
-  }
-}
-
-   // This is a function that
-   // determines what Reference Picture Set to use
-   // for a specific slice (with POC = POCCurr)
-void EncLib::selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid
-                                      , int ltPoc
-)
-{
-  bool isEncodeLtRef = (POCCurr == ltPoc);
-  if (m_compositeRefEnabled && isEncodeLtRef)
-  {
-    POCCurr++;
-  }
-  int rIdx = GOPid;
-  slice->setRPSidx(GOPid);
-
-  for(int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++)
-  {
-    if(m_uiIntraPeriod > 0 && getDecodingRefreshType() > 0)
-    {
-      int POCIndex = POCCurr%m_uiIntraPeriod;
-      if(POCIndex == 0)
-      {
-        POCIndex = m_uiIntraPeriod;
-      }
-      if(POCIndex == m_GOPList[extraNum].m_POC)
-      {
-        slice->setRPSidx(extraNum);
-        rIdx = extraNum;
-      }
-    }
-    else
-    {
-      if(POCCurr==m_GOPList[extraNum].m_POC)
-      {
-        slice->setRPSidx(extraNum);
-        rIdx = extraNum;
-      }
-    }
-  }
-
-  if(POCCurr == 1 && slice->getPic()->fieldPic)
-  {
-    slice->setRPSidx(m_iGOPSize+m_extraRPSs);
-    rIdx = m_iGOPSize + m_extraRPSs;
-  }
-
-  ReferencePictureSet *rps = const_cast<ReferencePictureSet *>(slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx()));
-  if (m_compositeRefEnabled && ltPoc != -1 && !isEncodeLtRef)
-  {
-    if (ltPoc != -1 && rps->getNumberOfLongtermPictures() != 1 && !isEncodeLtRef)
-    {
-      int idx = rps->getNumberOfPictures();
-      int maxPicOrderCntLSB = 1 << slice->getSPS()->getBitsForPOC();
-      int ltPocLsb = ltPoc % maxPicOrderCntLSB;
-
-      rps->setNumberOfPictures(rps->getNumberOfPictures() + 1);
-      rps->setNumberOfLongtermPictures(1);
-      rps->setPOC(idx, ltPoc);
-      rps->setPocLSBLT(idx, ltPocLsb);
-      rps->setDeltaPOC(idx, -POCCurr + ltPoc);
-      rps->setUsed(idx, true);
-    }
-  }
-  else if (m_compositeRefEnabled && isEncodeLtRef)
-  {
-    ReferencePictureSet* localRPS = slice->getLocalRPS();
-    (*localRPS) = ReferencePictureSet();
-    int refPics = rps->getNumberOfPictures();
-    localRPS->setNumberOfPictures(rps->getNumberOfPictures());
-    for (int i = 0; i < refPics; i++)
-    {
-      localRPS->setDeltaPOC(i, rps->getDeltaPOC(i) + 1);
-      localRPS->setUsed(i, rps->getUsed(i));
-    }
-    localRPS->setNumberOfNegativePictures(rps->getNumberOfNegativePictures());
-    localRPS->setNumberOfPositivePictures(rps->getNumberOfPositivePictures());
-    localRPS->setInterRPSPrediction(true);
-    int deltaRPS = 1;
-    int newIdc = 0;
-    for (int i = 0; i < refPics; i++)
-    {
-      int deltaPOC = ((i != refPics) ? rps->getDeltaPOC(i) : 0);  // check if the reference abs POC is >= 0
-      int refIdc = 0;
-      for (int j = 0; j < localRPS->getNumberOfPictures(); j++) // loop through the  pictures in the new RPS
-      {
-        if ((deltaPOC + deltaRPS) == localRPS->getDeltaPOC(j))
-        {
-          if (localRPS->getUsed(j))
-          {
-            refIdc = 1;
-          }
-          else
-          {
-            refIdc = 2;
-          }
-        }
-      }
-      localRPS->setRefIdc(i, refIdc);
-      newIdc++;
-    }
-    localRPS->setNumRefIdc(newIdc + 1);
-    localRPS->setRefIdc(newIdc, 0);
-    localRPS->setDeltaRPS(deltaRPS);
-    localRPS->setDeltaRIdxMinus1(slice->getSPS()->getRPSList()->getNumberOfReferencePictureSets() - 1 - rIdx);
-    slice->setRPS(localRPS);
-    slice->setRPSidx(-1);
-    return;
-  }
-  slice->setRPS(rps);
-}
-
-int EncLib::getReferencePictureSetIdxForSOP(int POCCurr, int GOPid )
-{
-  int rpsIdx = GOPid;
-
-  for(int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++)
-  {
-    if(m_uiIntraPeriod > 0 && getDecodingRefreshType() > 0)
-    {
-      int POCIndex = POCCurr%m_uiIntraPeriod;
-      if(POCIndex == 0)
-      {
-        POCIndex = m_uiIntraPeriod;
-      }
-      if(POCIndex == m_GOPList[extraNum].m_POC)
-      {
-        rpsIdx = extraNum;
-      }
-    }
-    else
-    {
-      if(POCCurr==m_GOPList[extraNum].m_POC)
-      {
-        rpsIdx = extraNum;
-      }
-    }
-  }
-
-  return rpsIdx;
-}
-#endif
 
 void  EncLib::xInitPPSforTiles(PPS &pps)
 {
-#if JVET_N0857_TILES_BRICKS
   if ( (m_iNumColumnsMinus1==0) && (m_iNumRowsMinus1==0) )
   {
     // one, no bricks
@@ -2065,12 +1499,9 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
     pps.setSingleTileInPicFlag(false);
     pps.setSingleBrickPerSliceFlag( m_sliceMode==SINGLE_BRICK_PER_SLICE );
     pps.setRectSliceFlag( m_sliceMode==SINGLE_BRICK_PER_SLICE );
-#if JVET_N0857_RECT_SLICES
     if (m_rectSliceFlag)
       pps.setRectSliceFlag(m_rectSliceFlag);
-#endif
   }
-#endif
   pps.setUniformTileSpacingFlag( m_tileUniformSpacingFlag );
   pps.setNumTileColumnsMinus1( m_iNumColumnsMinus1 );
   pps.setNumTileRowsMinus1( m_iNumRowsMinus1 );
@@ -2081,16 +1512,10 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
   }
   pps.setLoopFilterAcrossBricksEnabledFlag( m_loopFilterAcrossBricksEnabledFlag );
 
-#if JVET_N0857_TILES_BRICKS
   //pps.setRectSliceFlag( m_rectSliceFlag );
   pps.setNumSlicesInPicMinus1( m_numSlicesInPicMinus1 );
-#if JVET_N0857_RECT_SLICES
   pps.setTopLeftBrickIdx(m_topLeftBrickIdx);
   pps.setBottomRightBrickIdx(m_bottomRightBrickIdx);
-#else
-  pps.setTopLeftTileIdx( m_topLeftTileIdx );
-  pps.setBottomRightTileIdx( m_bottomRightTileIdx );
-#endif
   pps.setLoopFilterAcrossBricksEnabledFlag( m_loopFilterAcrossBricksEnabledFlag );
   pps.setLoopFilterAcrossSlicesEnabledFlag( m_loopFilterAcrossSlicesEnabledFlag );
   pps.setSignalledSliceIdFlag( m_signalledSliceIdFlag );
@@ -2100,9 +1525,7 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
   pps.setSliceId( m_sliceId );
 
   int numTiles= (m_iNumColumnsMinus1 + 1) * (m_iNumRowsMinus1 + 1);
-#if JVET_N0857_RECT_SLICES
   pps.setNumTilesInPic(numTiles);
-#endif
 
   if (m_brickSplitMap.empty())
   {
@@ -2194,7 +1617,6 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
     }
   }
 
-#endif
 }
 
 void  EncCfg::xCheckGSParameters()
@@ -2253,13 +1675,11 @@ void  EncCfg::xCheckGSParameters()
   }
 }
 
-#if JCTVC_Y0038_PARAMS
 void EncLib::setParamSetChanged(int spsId, int ppsId)
 {
   m_ppsMap.setChangedFlag(ppsId);
   m_spsMap.setChangedFlag(spsId);
 }
-#endif
 bool EncLib::APSNeedsWriting(int apsId)
 {
   bool isChanged = m_apsMap.getChangedFlag(apsId);
diff --git a/source/Lib/EncoderLib/EncLib.h b/source/Lib/EncoderLib/EncLib.h
index 48faedbd9..9d4b311c2 100644
--- a/source/Lib/EncoderLib/EncLib.h
+++ b/source/Lib/EncoderLib/EncLib.h
@@ -138,13 +138,9 @@ private:
   CacheModel                m_cacheModel;
 #endif
 
-#if JVET_N0415_CTB_ALF
   APS*                      m_apss[MAX_NUM_APS];
-#endif
 
-#if JVET_N0805_APS_LMCS
   APS*                      m_lmcsAPS;
-#endif
 
   EncHRD                    m_encHRD;
 
@@ -158,27 +154,19 @@ 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.
 #if HEVC_VPS
   void  xInitVPS          (VPS &vps, const SPS &sps); ///< initialize VPS from encoder options
-#elif JVET_N0278_HLS
+#else
   void  xInitVPS          (VPS &vps); ///< initialize VPS from encoder options
 #endif
-#if JVET_N0349_DPS
   void  xInitDPS          (DPS &dps, const SPS &sps, const int dpsId); ///< initialize DPS from encoder options
-#endif
   void  xInitSPS          (SPS &sps);                 ///< initialize SPS from encoder options
   void  xInitPPS          (PPS &pps, const SPS &sps); ///< initialize PPS from encoder options
   void  xInitAPS          (APS &aps);                 ///< initialize APS from encoder options
-#if HEVC_USE_SCALING_LISTS
   void  xInitScalingLists (SPS &sps, PPS &pps);   ///< initialize scaling lists
-#endif
   void  xInitPPSforLT(PPS& pps);
   void  xInitHrdParameters(SPS &sps);                 ///< initialize HRDParameters parameters
 
   void  xInitPPSforTiles  (PPS &pps);
-#if JVET_M0128
   void  xInitRPL(SPS &sps, bool isFieldCoding);           ///< initialize SPS from encoder options
-#else
-  void  xInitRPS          (SPS &sps, bool isFieldCoding);           ///< initialize PPS from encoder options
-#endif
 
 public:
   EncLib();
@@ -231,19 +219,10 @@ public:
   RateCtrl*               getRateCtrl           ()              { return  &m_cRateCtrl;            }
 
 
-#if JVET_M0128
   void                    getActiveRefPicListNumForPOC(const SPS *sps, int POCCurr, int GOPid, uint32_t *activeL0, uint32_t *activeL1);
   void                    selectReferencePictureList(Slice* slice, int POCCurr, int GOPid, int ltPoc);
-#else
-  void selectReferencePictureSet(Slice* slice, int POCCurr, int GOPid
-    , int ltPoc
-  );
-  int getReferencePictureSetIdxForSOP(int POCCurr, int GOPid );
-#endif
 
-#if JCTVC_Y0038_PARAMS
   void                   setParamSetChanged(int spsId, int ppsId);
-#endif
   bool                   APSNeedsWriting(int apsId);
   bool                   PPSNeedsWriting(int ppsId);
   bool                   SPSNeedsWriting(int spsId);
@@ -261,9 +240,7 @@ public:
   EncReshape*            getReshaper()                          { return  &m_cReshaper; }
 #endif
 
-#if JVET_N0415_CTB_ALF
   ParameterSetMap<APS>*  getApsMap() { return &m_apsMap; }
-#endif
   // -------------------------------------------------------------------------------------------------------------------
   // encoder function
   // -------------------------------------------------------------------------------------------------------------------
diff --git a/source/Lib/EncoderLib/EncModeCtrl.cpp b/source/Lib/EncoderLib/EncModeCtrl.cpp
index ebe9dc68c..1c1622bcd 100644
--- a/source/Lib/EncoderLib/EncModeCtrl.cpp
+++ b/source/Lib/EncoderLib/EncModeCtrl.cpp
@@ -625,31 +625,6 @@ static bool isTheSameNbHood( const CodingUnit &cu, const CodingStructure& cs, co
 
   const UnitArea &cmnAnc = ps[i - 1].parts[ps[i - 1].idx];
   const UnitArea cuArea  = CS::getArea( cs, cu, partitioner.chType );
-#if !JVET_N0266_SMALL_BLOCKS
-  bool sharedListReuseMode = true;
-  if(
-      pu.mergeFlag == true &&
-      cu.affine == false &&
-      cu.predMode == MODE_INTER
-    )
-  {
-    sharedListReuseMode = false;
-
-    if ((cu.lumaSize().width*cu.lumaSize().height) >= MRG_SHARELIST_SHARSIZE)
-    {
-      sharedListReuseMode = true;
-    }
-
-    if (((cmnAnc.lumaSize().width)*(cmnAnc.lumaSize().height) <= MRG_SHARELIST_SHARSIZE))
-    {
-      sharedListReuseMode = true;
-    }
-  }
-  else
-  {
-    sharedListReuseMode = true;
-  }
-#endif
 //#endif
 
   for( int i = 0; i < cmnAnc.blocks.size(); i++ )
@@ -659,12 +634,6 @@ static bool isTheSameNbHood( const CodingUnit &cu, const CodingStructure& cs, co
       return false;
     }
   }
-#if !JVET_N0266_SMALL_BLOCKS
-  if(!sharedListReuseMode)
-  {
-    return false;
-  }
-#endif
 
   return true;
 }
@@ -1351,11 +1320,7 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
   }
 
   // add first pass modes
-#if JVET_N0266_SMALL_BLOCKS
   if ( !m_slice->isIRAP() && !( cs.area.lwidth() == 4 && cs.area.lheight() == 4 ) )
-#else
-  if( !m_slice->isIRAP() )
-#endif
   {
     for( int qpLoop = maxQP; qpLoop >= minQP; qpLoop-- )
     {
@@ -1396,12 +1361,8 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
       }
       if (m_pcEncCfg->getUseHashME())
       {
-#if JVET_N0247_HASH_IMPROVE
         int minSize = min(cs.area.lwidth(), cs.area.lheight());
         if (minSize < 128 && minSize >= 4)
-#else
-        if ((cs.area.lwidth() == cs.area.lheight() && cs.area.lwidth() <= 64 && cs.area.lwidth() >= 4) || (cs.area.lwidth() == 4 && cs.area.lheight() == 8) || (cs.area.lwidth() == 8 && cs.area.lheight() == 4))
-#endif
         {
           m_ComprCUCtxList.back().testModes.push_back({ ETM_HASH_INTER, ETO_STANDARD, qp, lossless });
         }
@@ -1525,12 +1486,10 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
     // INTRA MODES
     if (cs.sps->getIBCFlag() && !cuECtx.bestTU)
       return true;
-#if JVET_N0266_SMALL_BLOCKS
     if ( partitioner.currArea().lumaSize().width == 4 && partitioner.currArea().lumaSize().height == 4 && !slice.isIntra() && !cuECtx.bestTU )
     {
       return true;
     }
-#endif
     if( !( slice.isIRAP() || bestMode.type == ETM_INTRA || !cuECtx.bestTU ||
       ((!m_pcEncCfg->getDisableIntraPUsInInterSlices()) && (!relatedCU.isInter || !relatedCU.isIBC) && (
                                          ( cuECtx.bestTU->cbf[0] != 0 ) ||
@@ -1551,11 +1510,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
     if( lastTestMode().type != ETM_INTRA && cuECtx.bestCS && cuECtx.bestCU && interHadActive( cuECtx ) )
     {
       // Get SATD threshold from best Inter-CU
-#if JVET_N0329_IBC_SEARCH_IMP
       if (!cs.slice->isIRAP() && m_pcEncCfg->getUsePbIntraFast() && !cs.slice->getDisableSATDForRD())
-#else
-      if( !cs.slice->isIRAP() && m_pcEncCfg->getUsePbIntraFast() )
-#endif
       {
         CodingUnit* bestCU = cuECtx.bestCU;
         if (bestCU && !CU::isIntra(*bestCU))
@@ -1594,11 +1549,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
   else if (encTestmode.type == ETM_IBC || encTestmode.type == ETM_IBC_MERGE)
   {
     // IBC MODES
-#if JVET_N0318_N0467_IBC_SIZE
     return sps.getIBCFlag() && (partitioner.currArea().lumaSize().width < 128 || partitioner.currArea().lumaSize().height < 128);
-#else
-    return sps.getIBCFlag() && width <= IBC_MAX_CAND_SIZE && partitioner.currArea().lumaSize().height <= IBC_MAX_CAND_SIZE;
-#endif
   }
   else if( isModeInter( encTestmode ) )
   {
@@ -1860,20 +1811,14 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
         if( CU::isInter( *bestCU ) )
         {
           relatedCU.isInter   = true;
-#if HM_CODED_CU_INFO
           relatedCU.isSkip   |= bestCU->skip;
           relatedCU.isMMVDSkip |= bestCU->mmvdSkip;
-#else
-          relatedCU.isSkip    = bestCU->skip;
-#endif
           relatedCU.GBiIdx    = bestCU->GBiIdx;
         }
         else if (CU::isIBC(*bestCU))
         {
           relatedCU.isIBC = true;
-#if HM_CODED_CU_INFO
           relatedCU.isSkip |= bestCU->skip;
-#endif
         }
         else if( CU::isIntra( *bestCU ) )
         {
@@ -1893,7 +1838,6 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
   }
 }
 
-#if JVET_N0193_LFNST
 bool EncModeCtrlMTnoRQT::checkSkipOtherLfnst( const EncTestMode& encTestmode, CodingStructure*& tempCS, Partitioner& partitioner )
 {
   xExtractFeatures( encTestmode, *tempCS );
@@ -1912,7 +1856,6 @@ bool EncModeCtrlMTnoRQT::checkSkipOtherLfnst( const EncTestMode& encTestmode, Co
 
   return skipOtherLfnst;
 }
-#endif
 
 bool EncModeCtrlMTnoRQT::useModeResult( const EncTestMode& encTestmode, CodingStructure*& tempCS, Partitioner& partitioner )
 {
@@ -1937,7 +1880,6 @@ bool EncModeCtrlMTnoRQT::useModeResult( const EncTestMode& encTestmode, CodingSt
   {
     cuECtx.set( BEST_TRIV_SPLIT_COST, tempCS->cost );
   }
-#if JVET_N0193_LFNST
   else if( encTestmode.type == ETM_INTRA )
   {
     const CodingUnit cu = *tempCS->getCU( partitioner.chType );
@@ -1951,7 +1893,6 @@ bool EncModeCtrlMTnoRQT::useModeResult( const EncTestMode& encTestmode, CodingSt
       cuECtx.bestCostMtsFirstPassNoIsp = tempCS->cost;
     }
   }
-#endif
 
   if( m_pcEncCfg->getIMV4PelFast() && m_pcEncCfg->getIMV() && encTestmode.type == ETM_INTER_ME )
   {
diff --git a/source/Lib/EncoderLib/EncModeCtrl.h b/source/Lib/EncoderLib/EncModeCtrl.h
index d7c0fc50c..9fe9e3189 100644
--- a/source/Lib/EncoderLib/EncModeCtrl.h
+++ b/source/Lib/EncoderLib/EncModeCtrl.h
@@ -188,21 +188,17 @@ struct ComprCUCtx
     , extraFeatures (            )
     , extraFeaturesd(            )
     , bestInterCost ( MAX_DOUBLE )
-#if JVET_N0193_LFNST
     , bestMtsSize2Nx2N1stPass
                     ( MAX_DOUBLE )
     , skipSecondMTSPass
                     ( false )
-#endif
     , interHad      (std::numeric_limits<Distortion>::max())
 #if ENABLE_SPLIT_PARALLELISM
     , isLevelSplitParallel
                     ( false )
 #endif
     , bestCostWithoutSplitFlags( MAX_DOUBLE )
-#if JVET_N0193_LFNST
     , bestCostMtsFirstPassNoIsp( MAX_DOUBLE )
-#endif
   {
     getAreaIdx( cs.area.Y(), *cs.pcv, cuX, cuY, cuW, cuH );
     partIdx = ( ( cuX << 8 ) | cuY );
@@ -227,18 +223,14 @@ struct ComprCUCtx
   static_vector<int64_t,  30>         extraFeatures;
   static_vector<double, 30>         extraFeaturesd;
   double                            bestInterCost;
-#if JVET_N0193_LFNST
   double                            bestMtsSize2Nx2N1stPass;
   bool                              skipSecondMTSPass;
-#endif
   Distortion                        interHad;
 #if ENABLE_SPLIT_PARALLELISM
   bool                              isLevelSplitParallel;
 #endif
   double                            bestCostWithoutSplitFlags;
-#if JVET_N0193_LFNST
   double                            bestCostMtsFirstPassNoIsp;
-#endif
 
   template<typename T> T    get( int ft )       const { return typeid(T) == typeid(double) ? (T&)extraFeaturesd[ft] : T(extraFeatures[ft]); }
   template<typename T> void set( int ft, T val )      { extraFeatures [ft] = int64_t( val ); }
@@ -284,9 +276,7 @@ protected:
 public:
 
   virtual bool useModeResult        ( const EncTestMode& encTestmode, CodingStructure*& tempCS,  Partitioner& partitioner ) = 0;
-#if JVET_N0193_LFNST
   virtual bool checkSkipOtherLfnst  ( const EncTestMode& encTestmode, CodingStructure*& tempCS,  Partitioner& partitioner ) = 0;
-#endif
 #if ENABLE_SPLIT_PARALLELISM
   virtual void copyState            ( const EncModeCtrl& other, const UnitArea& area );
   virtual int  getNumParallelJobs   ( const CodingStructure &cs, Partitioner& partitioner )                                 const { return 1;     }
@@ -318,17 +308,13 @@ public:
   double getBestInterCost             ()                  const { return m_ComprCUCtxList.back().bestInterCost;           }
   Distortion getInterHad              ()                  const { return m_ComprCUCtxList.back().interHad;                }
   void enforceInterHad                ( Distortion had )        {        m_ComprCUCtxList.back().interHad = had;          }
-#if JVET_N0193_LFNST
   double getMtsSize2Nx2NFirstPassCost ()                  const { return m_ComprCUCtxList.back().bestMtsSize2Nx2N1stPass; }
   bool   getSkipSecondMTSPass         ()                  const { return m_ComprCUCtxList.back().skipSecondMTSPass;       }
   void   setSkipSecondMTSPass         ( bool b )                { m_ComprCUCtxList.back().skipSecondMTSPass = b;          }
-#endif
   double getBestCostWithoutSplitFlags ()                  const { return m_ComprCUCtxList.back().bestCostWithoutSplitFlags;         }
   void   setBestCostWithoutSplitFlags ( double cost )           { m_ComprCUCtxList.back().bestCostWithoutSplitFlags = cost;         }
-#if JVET_N0193_LFNST
   double getMtsFirstPassNoIspCost     ()                  const { return m_ComprCUCtxList.back().bestCostMtsFirstPassNoIsp;         }
   void   setMtsFirstPassNoIspCost     ( double cost )           { m_ComprCUCtxList.back().bestCostMtsFirstPassNoIsp = cost;         }
-#endif
 
 protected:
   void xExtractFeatures ( const EncTestMode encTestmode, CodingStructure& cs );
@@ -555,9 +541,7 @@ public:
   virtual bool isParallelSplit    ( const CodingStructure &cs, Partitioner& partitioner ) const;
   virtual bool parallelJobSelector( const EncTestMode& encTestmode, const CodingStructure &cs, Partitioner& partitioner ) const;
 #endif
-#if JVET_N0193_LFNST
   virtual bool checkSkipOtherLfnst( const EncTestMode& encTestmode, CodingStructure*& tempCS, Partitioner& partitioner );
-#endif
 };
 
 
diff --git a/source/Lib/EncoderLib/EncReshape.cpp b/source/Lib/EncoderLib/EncReshape.cpp
index 3ba9da6bd..91c7b9cb1 100644
--- a/source/Lib/EncoderLib/EncReshape.cpp
+++ b/source/Lib/EncoderLib/EncReshape.cpp
@@ -111,20 +111,8 @@ void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const
   if (m_lumaBD >= 10)
   {
     m_sliceReshapeInfo.sliceReshaperEnableFlag = true;
-#if !JVET_N0805_APS_LMCS
-    if (reshapeCW.rspIntraPeriod == 1)
-    {
-      if (pcPic->getPOC() == 0)          { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true;  }
-      else                               { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = false; }
-    }
-    else
-    {
-#endif
       if (sliceType == I_SLICE )                                              { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true;  }
       else                                                                    { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = false; }
-#if !JVET_N0805_APS_LMCS
-    }
-#endif
     if (sliceType == I_SLICE  && isDualT)                                     { m_sliceReshapeInfo.enableChromaAdj = 0;                   }
     else                                                                      { m_sliceReshapeInfo.enableChromaAdj = 1;                   }
   }
diff --git a/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp b/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp
index 1d3fa7ebd..e0a29f765 100644
--- a/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp
+++ b/source/Lib/EncoderLib/EncSampleAdaptiveOffset.cpp
@@ -311,14 +311,12 @@ void EncSampleAdaptiveOffset::getStatistics(std::vector<SAOStatData**>& blkStats
       isBelowAvail      = (yPos + pcv.maxCUHeight < pcv.lumaHeight);
       isAboveRightAvail = ((yPos > 0) && (isRightAvail));
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
       int numHorVirBndry = 0, numVerVirBndry = 0;
       int horVirBndryPos[] = { -1,-1,-1 };
       int verVirBndryPos[] = { -1,-1,-1 };
       int horVirBndryPosComp[] = { -1,-1,-1 };
       int verVirBndryPosComp[] = { -1,-1,-1 };
       bool isCtuCrossedByVirtualBoundaries = isCrossedByVirtualBoundaries(xPos, yPos, width, height, numHorVirBndry, numVerVirBndry, horVirBndryPos, verVirBndryPos, cs.slice->getPPS());
-#endif
 
       for(int compIdx = 0; compIdx < numberOfComponents; compIdx++)
       {
@@ -331,7 +329,6 @@ void EncSampleAdaptiveOffset::getStatistics(std::vector<SAOStatData**>& blkStats
         int  orgStride  = orgYuv.get(compID).stride;
         Pel* orgBlk     = orgYuv.get(compID).bufAt( compArea );
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
         for (int i = 0; i < numHorVirBndry; i++)
         {
           horVirBndryPosComp[i] = (horVirBndryPos[i] >> ::getComponentScaleY(compID, area.chromaFormat)) - compArea.y;
@@ -340,15 +337,12 @@ void EncSampleAdaptiveOffset::getStatistics(std::vector<SAOStatData**>& blkStats
         {
           verVirBndryPosComp[i] = (verVirBndryPos[i] >> ::getComponentScaleX(compID, area.chromaFormat)) - compArea.x;
         }
-#endif
 
         getBlkStats(compID, cs.sps->getBitDepth(toChannelType(compID)), blkStats[ctuRsAddr][compID]
                   , srcBlk, orgBlk, srcStride, orgStride, compArea.width, compArea.height
                   , isLeftAvail,  isRightAvail, isAboveAvail, isBelowAvail, isAboveLeftAvail, isAboveRightAvail
                   , isCalculatePreDeblockSamples
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                   , isCtuCrossedByVirtualBoundaries, horVirBndryPosComp, verVirBndryPosComp, numHorVirBndry, numVerVirBndry
-#endif
                   );
       }
       ctuRsAddr++;
@@ -1158,9 +1152,7 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
                         , Pel* srcBlk, Pel* orgBlk, int srcStride, int orgStride, int width, int height
                         , bool isLeftAvail,  bool isRightAvail, bool isAboveAvail, bool isBelowAvail, bool isAboveLeftAvail, bool isAboveRightAvail
                         , bool isCalculatePreDeblockSamples
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                         , bool isCtuCrossedByVirtualBoundaries, int horVirBndryPos[], int verVirBndryPos[], int numHorVirBndry, int numVerVirBndry
-#endif
                         )
 {
   int x,y, startX, startY, endX, endY, edgeType, firstLineStartX, firstLineEndX;
@@ -1198,13 +1190,11 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
           for (x=startX; x<endX; x++)
           {
             signRight =  (int8_t)sgn(srcLine[x] - srcLine[x+1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, numVerVirBndry, 0, verVirBndryPos, horVirBndryPos))
             {
               signLeft = -signRight;
               continue;
             }
-#endif
             edgeType  =  signRight + signLeft;
             signLeft  = -signRight;
 
@@ -1227,13 +1217,11 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
               for (x=startX; x<endX; x++)
               {
                 signRight =  (int8_t)sgn(srcLine[x] - srcLine[x+1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                 if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, endY + y, numVerVirBndry, 0, verVirBndryPos, horVirBndryPos))
                 {
                   signLeft = -signRight;
                   continue;
                 }
-#endif
                 edgeType  =  signRight + signLeft;
                 signLeft  = -signRight;
 
@@ -1281,13 +1269,11 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
           for (x=startX; x<endX; x++)
           {
             signDown  = (int8_t)sgn(srcLine[x] - srcLineBelow[x]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, 0, numHorVirBndry, verVirBndryPos, horVirBndryPos))
             {
               signUpLine[x] = -signDown;
               continue;
             }
-#endif
             edgeType  = signDown + signUpLine[x];
             signUpLine[x]= -signDown;
 
@@ -1311,12 +1297,10 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
 
               for (x=startX; x<endX; x++)
               {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                 if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y + endY, 0, numHorVirBndry, verVirBndryPos, horVirBndryPos))
                 {
                   continue;
                 }
-#endif
                 edgeType = sgn(srcLine[x] - srcLineBelow[x]) + sgn(srcLine[x] - srcLineAbove[x]);
                 diff [edgeType] += (orgLine[x] - srcLine[x]);
                 count[edgeType] ++;
@@ -1360,12 +1344,10 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
         firstLineEndX   = (!isCalculatePreDeblockSamples) ? (isAboveAvail     ? endX : 1) : endX;
         for(x=firstLineStartX; x<firstLineEndX; x++)
         {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, 0, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
           {
             continue;
           }
-#endif
           edgeType = sgn(srcLine[x] - srcLineAbove[x-1]) - signUpLine[x+1];
           diff [edgeType] += (orgLine[x] - srcLine[x]);
           count[edgeType] ++;
@@ -1382,13 +1364,11 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
           for (x=startX; x<endX; x++)
           {
             signDown = (int8_t)sgn(srcLine[x] - srcLineBelow[x+1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
             {
               signDownLine[x + 1] = -signDown;
               continue;
             }
-#endif
             edgeType = signDown + signUpLine[x];
             diff [edgeType] += (orgLine[x] - srcLine[x]);
             count[edgeType] ++;
@@ -1418,12 +1398,10 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
 
               for (x=startX; x< endX; x++)
               {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                 if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y + endY, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
                 {
                   continue;
                 }
-#endif
                 edgeType = sgn(srcLine[x] - srcLineBelow[x+1]) + sgn(srcLine[x] - srcLineAbove[x-1]);
                 diff [edgeType] += (orgLine[x] - srcLine[x]);
                 count[edgeType] ++;
@@ -1467,12 +1445,10 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
                                                           ;
         for(x=firstLineStartX; x<firstLineEndX; x++)
         {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
           if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, 0, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
           {
             continue;
           }
-#endif
           edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) - signUpLine[x-1];
           diff [edgeType] += (orgLine[x] - srcLine[x]);
           count[edgeType] ++;
@@ -1489,13 +1465,11 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
           for(x=startX; x<endX; x++)
           {
             signDown = (int8_t)sgn(srcLine[x] - srcLineBelow[x-1]);
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
             if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
             {
               signUpLine[x - 1] = -signDown;
               continue;
             }
-#endif
             edgeType = signDown + signUpLine[x];
 
             diff [edgeType] += (orgLine[x] - srcLine[x]);
@@ -1521,12 +1495,10 @@ void EncSampleAdaptiveOffset::getBlkStats(const ComponentID compIdx, const int c
 
               for (x=startX; x<endX; x++)
               {
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                 if (isCtuCrossedByVirtualBoundaries && isProcessDisabled(x, y + endY, numVerVirBndry, numHorVirBndry, verVirBndryPos, horVirBndryPos))
                 {
                   continue;
                 }
-#endif
                 edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + sgn(srcLine[x] - srcLineAbove[x+1]);
                 diff [edgeType] += (orgLine[x] - srcLine[x]);
                 count[edgeType] ++;
diff --git a/source/Lib/EncoderLib/EncSampleAdaptiveOffset.h b/source/Lib/EncoderLib/EncSampleAdaptiveOffset.h
index c6f0f675b..b882a0519 100644
--- a/source/Lib/EncoderLib/EncSampleAdaptiveOffset.h
+++ b/source/Lib/EncoderLib/EncSampleAdaptiveOffset.h
@@ -116,9 +116,7 @@ private: //methods
                         const double saoEncodingRate, const double saoEncodingRateChroma );
 #endif
   void getBlkStats(const ComponentID compIdx, const int channelBitDepth, SAOStatData* statsDataTypes, Pel* srcBlk, Pel* orgBlk, int srcStride, int orgStride, int width, int height, bool isLeftAvail,  bool isRightAvail, bool isAboveAvail, bool isBelowAvail, bool isAboveLeftAvail, bool isAboveRightAvail, bool isCalculatePreDeblockSamples
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
                  , bool isCtuCrossedByVirtualBoundaries, int horVirBndryPos[], int verVirBndryPos[], int numHorVirBndry, int numVerVirBndry
-#endif
     );
   void deriveModeNewRDO(const BitDepths &bitDepths, int ctuRsAddr, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES], bool* sliceEnabled, std::vector<SAOStatData**>& blkStats, SAOBlkParam& modeParam, double& modeNormCost );
   void deriveModeMergeRDO(const BitDepths &bitDepths, int ctuRsAddr, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES], bool* sliceEnabled, std::vector<SAOStatData**>& blkStats, SAOBlkParam& modeParam, double& modeNormCost );
diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp
index 6aa643ba5..d184ab065 100644
--- a/source/Lib/EncoderLib/EncSlice.cpp
+++ b/source/Lib/EncoderLib/EncSlice.cpp
@@ -119,11 +119,7 @@ EncSlice::setUpLambda( Slice* slice, const double dLambda, int iQP)
     int chromaQPOffset       = slice->getPPS()->getQpOffset( compID ) + slice->getSliceChromaQpDelta( compID );
     int qpc                  = ( iQP + chromaQPOffset < 0 ) ? iQP : getScaledChromaQP( iQP + chromaQPOffset, m_pcCfg->getChromaFormatIdc() );
     double tmpWeight         = pow( 2.0, ( iQP - qpc ) / 3.0 );  // takes into account of the chroma qp mapping and chroma qp Offset
-#if JVET_N0193_LFNST
     if( m_pcCfg->getDepQuantEnabledFlag() && !( m_pcCfg->getLFNST() ) )
-#else
-    if( m_pcCfg->getDepQuantEnabledFlag() )
-#endif
     {
       tmpWeight *= ( m_pcCfg->getGOPSize() >= 8 ? pow( 2.0, 0.1/3.0 ) : pow( 2.0, 0.2/3.0 ) );  // increase chroma weight for dependent quantization (in order to reduce bit rate shift from chroma to luma)
     }
@@ -222,11 +218,7 @@ static int getGlaringColorQPOffset (Picture* const pcPic, const int ctuAddr, con
   {
     for (uint32_t ctuTsAddr = startAddr; ctuTsAddr < boundingAddr; ctuTsAddr++)
     {
-#if JVET_N0857_TILES_BRICKS
       const uint32_t ctuRsAddr = pcPic->brickMap->getCtuBsToRsAddrMap (ctuTsAddr);
-#else
-      const uint32_t ctuRsAddr = pcPic->tileMap->getCtuTsToRsAddrMap (ctuTsAddr);
-#endif
       avgLumaValue += pcPic->m_iOffsetCtu[ctuRsAddr];
     }
     avgLumaValue = (avgLumaValue + ((boundingAddr - startAddr) >> 1)) / (boundingAddr - startAddr);
@@ -353,9 +345,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
   }
   rpcSlice->setPOC( pocCurr );
   rpcSlice->setDepQuantEnabledFlag( m_pcCfg->getDepQuantEnabledFlag() );
-#if HEVC_USE_SIGN_HIDING
   rpcSlice->setSignDataHidingEnabledFlag( m_pcCfg->getSignDataHidingEnabledFlag() );
-#endif
 
 #if SHARP_LUMA_DELTA_QP
   pcPic->fieldPic = isField;
@@ -429,16 +419,6 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
   // Non-referenced frame marking
   // ------------------------------------------------------------------------------------------------------------------
 
-#if !JVET_M0101_HLS
-  if(pocLast == 0)
-  {
-    rpcSlice->setTemporalLayerNonReferenceFlag(false);
-  }
-  else
-  {
-    rpcSlice->setTemporalLayerNonReferenceFlag(!m_pcCfg->getGOPEntry(iGOPid).m_refPic);
-  }
-#endif
   pcPic->referenced = true;
 
   // ------------------------------------------------------------------------------------------------------------------
@@ -620,9 +600,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
   {
     rpcSlice->setSliceChromaQpDelta( COMPONENT_Cb, 0 );
     rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 );
-#if JVET_N0054_JOINT_CHROMA
     rpcSlice->setSliceChromaQpDelta( JOINT_CbCr, 0 );
-#endif
   }
 #endif
 
@@ -681,18 +659,11 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
 #if !W0038_CQP_ADJ
   rpcSlice->setSliceChromaQpDelta( COMPONENT_Cb, 0 );
   rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 );
-#if JVET_N0054_JOINT_CHROMA
   rpcSlice->setSliceChromaQpDelta( JOINT_CbCr,   0 );
-#endif
 #endif
   rpcSlice->setUseChromaQpAdj( rpcSlice->getPPS()->getPpsRangeExtension().getChromaQpOffsetListEnabledFlag() );
-#if JVET_M0128
   rpcSlice->setNumRefIdx(REF_PIC_LIST_0, m_pcCfg->getRPLEntry(0, iGOPid).m_numRefPicsActive);
   rpcSlice->setNumRefIdx(REF_PIC_LIST_1, m_pcCfg->getRPLEntry(1, iGOPid).m_numRefPicsActive);
-#else
-  rpcSlice->setNumRefIdx(REF_PIC_LIST_0,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive);
-  rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive);
-#endif
 
   if ( m_pcCfg->getDeblockingFilterMetric() )
   {
@@ -740,9 +711,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
   rpcSlice->setSliceArgument        ( m_pcCfg->getSliceArgument()        );
   rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()      );
   rpcSlice->setMaxNumAffineMergeCand( m_pcCfg->getMaxNumAffineMergeCand() );
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
   rpcSlice->setMaxNumTriangleCand   ( m_pcCfg->getMaxNumTriangleCand() );
-#endif
   rpcSlice->setSplitConsOverrideFlag(false);
   rpcSlice->setMinQTSize( rpcSlice->getSPS()->getMinQTSize(eSliceType));
   rpcSlice->setMaxBTDepth( rpcSlice->isIntra() ? rpcSlice->getSPS()->getMaxBTDepthI() : rpcSlice->getSPS()->getMaxBTDepth() );
@@ -755,9 +724,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
     rpcSlice->setMaxBTSizeIChroma( rpcSlice->getSPS()->getMaxBTSizeIChroma() );
     rpcSlice->setMaxTTSizeIChroma( rpcSlice->getSPS()->getMaxTTSizeIChroma() );
   }
-#if JVET_N0329_IBC_SEARCH_IMP
   rpcSlice->setDisableSATDForRD(false);
-#endif
 }
 
 
@@ -873,11 +840,7 @@ static bool applyQPAdaptation (Picture* const pcPic,       Slice* const pcSlice,
 {
   const int  bitDepth    = pcSlice->getSPS()->getBitDepth (CHANNEL_TYPE_LUMA);
   const int  iQPIndex    = pcSlice->getSliceQp(); // initial QP index for current slice, used in following loops
-#if JVET_N0857_TILES_BRICKS
   const BrickMap& tileMap = *pcPic->brickMap;
-#else
-  const TileMap& tileMap = *pcPic->tileMap;
-#endif
   bool   sliceQPModified = false;
   uint32_t   meanLuma    = MAX_UINT;
   double     hpEnerAvg   = 0.0;
@@ -888,11 +851,7 @@ static bool applyQPAdaptation (Picture* const pcPic,       Slice* const pcSlice,
   {
     for (uint32_t ctuTsAddr = startAddr; ctuTsAddr < boundingAddr; ctuTsAddr++)
     {
-#if JVET_N0857_TILES_BRICKS
       const uint32_t ctuRsAddr  = tileMap.getCtuBsToRsAddrMap (ctuTsAddr);
-#else
-      const uint32_t ctuRsAddr  = tileMap.getCtuTsToRsAddrMap (ctuTsAddr);
-#endif
       const Position pos ((ctuRsAddr % pcv.widthInCtus) * pcv.maxCUWidth, (ctuRsAddr / pcv.widthInCtus) * pcv.maxCUHeight);
       const CompArea ctuArea    = clipArea (CompArea (COMPONENT_Y, pcPic->chromaFormat, Area (pos.x, pos.y, pcv.maxCUWidth, pcv.maxCUHeight)), pcPic->Y());
       const CompArea fltArea    = clipArea (CompArea (COMPONENT_Y, pcPic->chromaFormat, Area (pos.x > 0 ? pos.x - 1 : 0, pos.y > 0 ? pos.y - 1 : 0, pcv.maxCUWidth + (pos.x > 0 ? 2 : 1), pcv.maxCUHeight + (pos.y > 0 ? 2 : 1))), pcPic->Y());
@@ -939,11 +898,7 @@ static bool applyQPAdaptation (Picture* const pcPic,       Slice* const pcSlice,
 
         for (uint32_t ctuTsAddr = startAddr; ctuTsAddr < boundingAddr; ctuTsAddr++)
         {
-#if JVET_N0857_TILES_BRICKS
           const uint32_t ctuRsAddr = tileMap.getCtuBsToRsAddrMap (ctuTsAddr);
-#else
-          const uint32_t ctuRsAddr = tileMap.getCtuTsToRsAddrMap (ctuTsAddr);
-#endif
 
           meanLuma += pcPic->m_iOffsetCtu[ctuRsAddr];  // CTU mean
         }
@@ -971,11 +926,7 @@ static bool applyQPAdaptation (Picture* const pcPic,       Slice* const pcSlice,
 
     for (uint32_t ctuTsAddr = startAddr; ctuTsAddr < boundingAddr; ctuTsAddr++)
     {
-#if JVET_N0857_TILES_BRICKS
       const uint32_t ctuRsAddr = tileMap.getCtuBsToRsAddrMap (ctuTsAddr);
-#else
-      const uint32_t ctuRsAddr = tileMap.getCtuTsToRsAddrMap (ctuTsAddr);
-#endif
 
       pcPic->m_iOffsetCtu[ctuRsAddr] = (Pel)iQPFixed; // fixed QPs
     }
@@ -984,11 +935,7 @@ static bool applyQPAdaptation (Picture* const pcPic,       Slice* const pcSlice,
   {
     for (uint32_t ctuTsAddr = startAddr; ctuTsAddr < boundingAddr; ctuTsAddr++)
     {
-#if JVET_N0857_TILES_BRICKS
       const uint32_t ctuRsAddr = tileMap.getCtuBsToRsAddrMap (ctuTsAddr);
-#else
-      const uint32_t ctuRsAddr = tileMap.getCtuTsToRsAddrMap (ctuTsAddr);
-#endif
 
       int iQPAdapt = Clip3 (0, MAX_QP, iQPIndex + apprI3Log2 (pcPic->m_uEnerHpCtu[ctuRsAddr] * hpEnerPic));
 
@@ -1019,11 +966,7 @@ static bool applyQPAdaptation (Picture* const pcPic,       Slice* const pcSlice,
         }
 
 #endif
-#if JVET_N0246_MODIFIED_QUANTSCALES
         const uint32_t uRefScale  = g_invQuantScales[0][iQPAdapt % 6] << ((iQPAdapt / 6) + bitDepth - 4);
-#else
-        const uint32_t uRefScale  = g_invQuantScales[iQPAdapt % 6] << ((iQPAdapt / 6) + bitDepth - 4);
-#endif
         const CompArea subArea    = clipArea (CompArea (COMPONENT_Y, pcPic->chromaFormat, Area ((ctuRsAddr % pcv.widthInCtus) * pcv.maxCUWidth, (ctuRsAddr / pcv.widthInCtus) * pcv.maxCUHeight, pcv.maxCUWidth, pcv.maxCUHeight)), pcPic->Y());
         const Pel*     pSrc       = pcPic->getOrigBuf (subArea).buf;
         const SizeType iSrcStride = pcPic->getOrigBuf (subArea).stride;
@@ -1312,11 +1255,7 @@ void EncSlice::calCostSliceI(Picture* pcPic) // TODO: this only analyses the fir
 {
   double         iSumHadSlice      = 0;
   Slice * const  pcSlice           = pcPic->slices[getSliceSegmentIdx()];
-#if JVET_N0857_TILES_BRICKS
   const BrickMap &tileMap          = *pcPic->brickMap;
-#else
-  const TileMap &tileMap           = *pcPic->tileMap;
-#endif
   const PreCalcValues& pcv         = *pcPic->cs->pcv;
   const SPS     &sps               = *(pcSlice->getSPS());
   const int      shift             = sps.getBitDepth(CHANNEL_TYPE_LUMA)-8;
@@ -1325,15 +1264,9 @@ void EncSlice::calCostSliceI(Picture* pcPic) // TODO: this only analyses the fir
 
   uint32_t startCtuTsAddr, boundingCtuTsAddr;
   xDetermineStartAndBoundingCtuTsAddr ( startCtuTsAddr, boundingCtuTsAddr, pcPic );
-#if JVET_N0857_TILES_BRICKS
   for( uint32_t ctuTsAddr = startCtuTsAddr, ctuRsAddr = tileMap.getCtuBsToRsAddrMap( startCtuTsAddr);
        ctuTsAddr < boundingCtuTsAddr;
        ctuRsAddr = tileMap.getCtuBsToRsAddrMap(++ctuTsAddr) )
-#else
-  for( uint32_t ctuTsAddr = startCtuTsAddr, ctuRsAddr = tileMap.getCtuTsToRsAddrMap( startCtuTsAddr);
-       ctuTsAddr < boundingCtuTsAddr;
-       ctuRsAddr = tileMap.getCtuTsToRsAddrMap(++ctuTsAddr) )
-#endif
   {
     Position pos( (ctuRsAddr % pcv.widthInCtus) * pcv.maxCUWidth, (ctuRsAddr / pcv.widthInCtus) * pcv.maxCUHeight);
 
@@ -1493,11 +1426,7 @@ void EncSlice::checkDisFracMmvd( Picture* pcPic, uint32_t startCtuTsAddr, uint32
   Slice* pcSlice                  = cs.slice;
   const PreCalcValues& pcv        = *cs.pcv;
   const uint32_t    widthInCtus   = pcv.widthInCtus;
-#if JVET_N0857_TILES_BRICKS
   const BrickMap&  tileMap         = *pcPic->brickMap;
-#else
-  const TileMap&  tileMap         = *pcPic->tileMap;
-#endif
   const uint32_t hashThreshold    = 20;
   uint32_t totalCtu               = 0;
   uint32_t hashRatio              = 0;
@@ -1509,11 +1438,7 @@ void EncSlice::checkDisFracMmvd( Picture* pcPic, uint32_t startCtuTsAddr, uint32
 
   for ( uint32_t ctuTsAddr = startCtuTsAddr; ctuTsAddr < boundingCtuTsAddr; ctuTsAddr++ )
   {
-#if JVET_N0857_TILES_BRICKS
     const uint32_t ctuRsAddr = tileMap.getCtuBsToRsAddrMap( ctuTsAddr );
-#else
-    const uint32_t ctuRsAddr = tileMap.getCtuTsToRsAddrMap( ctuTsAddr );
-#endif
     const uint32_t ctuXPosInCtus        = ctuRsAddr % widthInCtus;
     const uint32_t ctuYPosInCtus        = ctuRsAddr / widthInCtus;
 
@@ -1540,11 +1465,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
   Slice* pcSlice                  = cs.slice;
   const PreCalcValues& pcv        = *cs.pcv;
   const uint32_t        widthInCtus   = pcv.widthInCtus;
-#if JVET_N0857_TILES_BRICKS
   const BrickMap&  tileMap        = *pcPic->brickMap;
-#else
-  const TileMap&  tileMap         = *pcPic->tileMap;
-#endif
 #if ENABLE_QPA
   const int iQPIndex              = pcSlice->getSliceQpBase();
 #endif
@@ -1579,49 +1500,29 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
   if ( pcSlice->getSPS()->getFpelMmvdEnabledFlag() ||
       (pcSlice->getSPS()->getIBCFlag() && m_pcCuEncoder->getEncCfg()->getIBCHashSearch()))
   {
-#if JVET_N0329_IBC_SEARCH_IMP
     m_pcCuEncoder->getIbcHashMap().rebuildPicHashMap(cs.picture->getTrueOrigBuf());
     if (m_pcCfg->getIntraPeriod() != -1)
     {
       int hashBlkHitPerc = m_pcCuEncoder->getIbcHashMap().calHashBlkMatchPerc(cs.area.Y());
       cs.slice->setDisableSATDForRD(hashBlkHitPerc > 59);
     }
-#else
-    if (pcSlice->getSPS()->getUseReshaper() && m_pcLib->getReshaper()->getCTUFlag() && pcSlice->getSPS()->getIBCFlag())
-      cs.picture->getOrigBuf(COMPONENT_Y).rspSignal(m_pcLib->getReshaper()->getFwdLUT());
-    m_pcCuEncoder->getIbcHashMap().rebuildPicHashMap( cs.picture->getOrigBuf() );
-    if (pcSlice->getSPS()->getUseReshaper() && m_pcLib->getReshaper()->getCTUFlag() && pcSlice->getSPS()->getIBCFlag())
-      cs.picture->getOrigBuf().copyFrom(cs.picture->getTrueOrigBuf());
-#endif
   }
   checkDisFracMmvd( pcPic, startCtuTsAddr, boundingCtuTsAddr );
   // for every CTU in the slice segment (may terminate sooner if there is a byte limit on the slice-segment)
-#if JVET_N0857_RECT_SLICES
   uint32_t startSliceRsRow = tileMap.getCtuBsToRsAddrMap(startCtuTsAddr) / widthInCtus;
   uint32_t startSliceRsCol = tileMap.getCtuBsToRsAddrMap(startCtuTsAddr) % widthInCtus;
   uint32_t endSliceRsRow = tileMap.getCtuBsToRsAddrMap(boundingCtuTsAddr - 1) / widthInCtus;
   uint32_t endSliceRsCol = tileMap.getCtuBsToRsAddrMap(boundingCtuTsAddr - 1) % widthInCtus;
-#endif
   for( uint32_t ctuTsAddr = startCtuTsAddr; ctuTsAddr < boundingCtuTsAddr; ctuTsAddr++ )
   {
-#if JVET_N0857_TILES_BRICKS
     const int32_t ctuRsAddr = tileMap.getCtuBsToRsAddrMap( ctuTsAddr );
-#else
-    const int32_t ctuRsAddr = tileMap.getCtuTsToRsAddrMap( ctuTsAddr );
-#endif
-#if JVET_N0857_RECT_SLICES
     if (pcSlice->getPPS()->getRectSliceFlag() &&
       ((ctuRsAddr / widthInCtus) < startSliceRsRow || (ctuRsAddr / widthInCtus) > endSliceRsRow ||
       (ctuRsAddr % widthInCtus) < startSliceRsCol || (ctuRsAddr % widthInCtus) > endSliceRsCol))
       continue;
-#endif
 
     // update CABAC state
-#if JVET_N0857_TILES_BRICKS
     const uint32_t firstCtuRsAddrOfTile = tileMap.bricks[tileMap.getBrickIdxRsMap(ctuRsAddr)].getFirstCtuRsAddr();
-#else
-    const uint32_t firstCtuRsAddrOfTile = tileMap.tiles[tileMap.getTileIdxMap(ctuRsAddr)].getFirstCtuRsAddr();
-#endif
     const uint32_t tileXPosInCtus       = firstCtuRsAddrOfTile % widthInCtus;
     const uint32_t ctuXPosInCtus        = ctuRsAddr % widthInCtus;
     const uint32_t ctuYPosInCtus        = ctuRsAddr / widthInCtus;
@@ -1635,9 +1536,6 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
     {
       cs.motionLut.lut.resize(0);
       cs.motionLut.lutIbc.resize(0);
-#if !JVET_N0266_SMALL_BLOCKS
-      cs.motionLut.lutShare.resize(0);
-#endif
       cs.motionLut.lutShareIbc.resize(0);
     }
 
@@ -1654,19 +1552,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
     {
       // reset and then update contexts to the state at the end of the top-right CTU (if within current slice and tile).
       pCABACWriter->initCtxModels( *pcSlice );
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0150_ONE_CTU_DELAY_WPP
       if( cs.getCURestricted( pos.offset(0, -1), pos, pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) )
-#else
-      if( cs.getCURestricted( pos.offset(pcv.maxCUWidth, -1), pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) )
-#endif
-#else
-#if JVET_N0150_ONE_CTU_DELAY_WPP
-      if( cs.getCURestricted( pos.offset(0, -1), pos, pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) )
-#else
-      if( cs.getCURestricted( pos.offset(pcv.maxCUWidth, -1), pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) )
-#endif
-#endif
       {
         // Top-right is available, we use it.
         pCABACWriter->getCtx() = pEncLib->m_entropyCodingSyncContextState;
@@ -1813,11 +1699,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
 #endif
 
     // Store probabilities of second CTU in line into buffer - used only if wavefront-parallel-processing is enabled.
-#if JVET_N0150_ONE_CTU_DELAY_WPP
     if( ctuXPosInCtus == tileXPosInCtus && pEncLib->getEntropyCodingSyncEnabledFlag() )
-#else
-    if( ctuXPosInCtus == tileXPosInCtus + 1 && pEncLib->getEntropyCodingSyncEnabledFlag() )
-#endif
     {
       pEncLib->m_entropyCodingSyncContextState = pCABACWriter->getCtx();
     }
@@ -1903,11 +1785,7 @@ void EncSlice::encodeSlice   ( Picture* pcPic, OutputBitstream* pcSubstreams, ui
 {
 
   Slice *const pcSlice               = pcPic->slices[getSliceSegmentIdx()];
-#if JVET_N0857_TILES_BRICKS
   const BrickMap& tileMap            = *pcPic->brickMap;
-#else
-  const TileMap& tileMap             = *pcPic->tileMap;
-#endif
   const uint32_t startCtuTsAddr          = pcSlice->getSliceCurStartCtuTsAddr();
   const uint32_t boundingCtuTsAddr       = pcSlice->getSliceCurEndCtuTsAddr();
   const bool wavefrontsEnabled       = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag();
@@ -1925,41 +1803,26 @@ void EncSlice::encodeSlice   ( Picture* pcPic, OutputBitstream* pcSubstreams, ui
 
   const PreCalcValues& pcv = *cs.pcv;
   const uint32_t widthInCtus   = pcv.widthInCtus;
-#if JVET_N0857_RECT_SLICES
   uint32_t startSliceRsRow = tileMap.getCtuBsToRsAddrMap(startCtuTsAddr) / widthInCtus;
   uint32_t startSliceRsCol = tileMap.getCtuBsToRsAddrMap(startCtuTsAddr) % widthInCtus;
   uint32_t endSliceRsRow = tileMap.getCtuBsToRsAddrMap(boundingCtuTsAddr - 1) / widthInCtus;
   uint32_t endSliceRsCol = tileMap.getCtuBsToRsAddrMap(boundingCtuTsAddr - 1) % widthInCtus;
   uint32_t uiSubStrm = 0;
-#endif
 
   // for every CTU in the slice segment...
 
   for( uint32_t ctuTsAddr = startCtuTsAddr; ctuTsAddr < boundingCtuTsAddr; ctuTsAddr++ )
   {
-#if JVET_N0857_TILES_BRICKS
     const uint32_t ctuRsAddr            = tileMap.getCtuBsToRsAddrMap(ctuTsAddr);
     const Brick& currentTile            = tileMap.bricks[tileMap.getBrickIdxRsMap(ctuRsAddr)];
-#else
-    const uint32_t ctuRsAddr            = tileMap.getCtuTsToRsAddrMap(ctuTsAddr);
-    const Tile& currentTile         = tileMap.tiles[tileMap.getTileIdxMap(ctuRsAddr)];
-#endif
-#if JVET_N0857_RECT_SLICES
     if (pcSlice->getPPS()->getRectSliceFlag() &&
       ((ctuRsAddr / widthInCtus) < startSliceRsRow || (ctuRsAddr / widthInCtus) > endSliceRsRow ||
       (ctuRsAddr % widthInCtus) < startSliceRsCol || (ctuRsAddr % widthInCtus) > endSliceRsCol))
       continue;
-#endif
     const uint32_t firstCtuRsAddrOfTile = currentTile.getFirstCtuRsAddr();
     const uint32_t tileXPosInCtus       = firstCtuRsAddrOfTile % widthInCtus;
-#if !JVET_N0857_RECT_SLICES
-    const uint32_t tileYPosInCtus       = firstCtuRsAddrOfTile / widthInCtus;
-#endif
     const uint32_t ctuXPosInCtus        = ctuRsAddr % widthInCtus;
     const uint32_t ctuYPosInCtus        = ctuRsAddr / widthInCtus;
-#if !JVET_N0857_RECT_SLICES
-    const uint32_t uiSubStrm            = tileMap.getSubstreamForCtuAddr(ctuRsAddr, true, pcSlice);
-#endif
 
     DTRACE_UPDATE( g_trace_ctx, std::make_pair( "ctu", ctuRsAddr ) );
 
@@ -1982,19 +1845,7 @@ void EncSlice::encodeSlice   ( Picture* pcPic, OutputBitstream* pcSubstreams, ui
       {
         m_CABACWriter->initCtxModels( *pcSlice );
       }
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0150_ONE_CTU_DELAY_WPP
       if( cs.getCURestricted( pos.offset( 0, -1 ), pos, pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) )
-#else
-      if( cs.getCURestricted( pos.offset( pcv.maxCUWidth, -1 ), pcSlice->getIndependentSliceIdx(), tileMap.getBrickIdxRsMap( pos ), CH_L ) )
-#endif
-#else
-#if JVET_N0150_ONE_CTU_DELAY_WPP
-      if( cs.getCURestricted( pos.offset( 0, -1 ), pos, pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) )
-#else
-      if( cs.getCURestricted( pos.offset( pcv.maxCUWidth, -1 ), pcSlice->getIndependentSliceIdx(), tileMap.getTileIdxMap( pos ), CH_L ) )
-#endif
-#endif
       {
         // Top-right is available, so use it.
         m_CABACWriter->getCtx() = m_entropyCodingSyncContextState;
@@ -2010,55 +1861,28 @@ void EncSlice::encodeSlice   ( Picture* pcPic, OutputBitstream* pcSubstreams, ui
     m_CABACWriter->coding_tree_unit( cs, ctuArea, pcPic->m_prevQP, ctuRsAddr );
 
     // store probabilities of second CTU in line into buffer
-#if JVET_N0150_ONE_CTU_DELAY_WPP
     if( ctuXPosInCtus == tileXPosInCtus && wavefrontsEnabled )
-#else
-    if( ctuXPosInCtus == tileXPosInCtus + 1 && wavefrontsEnabled )
-#endif
     {
       m_entropyCodingSyncContextState = m_CABACWriter->getCtx();
     }
 
     // terminate the sub-stream, if required (end of slice-segment, end of tile, end of wavefront-CTU-row):
-#if JVET_N0857_TILES_BRICKS
-#if JVET_N0857_RECT_SLICES
     bool isLastCTUinBrick = tileMap.getBrickIdxBsMap(ctuTsAddr) != tileMap.getBrickIdxBsMap(ctuTsAddr + 1);
     bool isLastCTUinWPP = wavefrontsEnabled && ((ctuRsAddr + 1 % widthInCtus) == tileXPosInCtus);
     bool isMoreCTUsinSlice = ctuRsAddr != tileMap.getCtuBsToRsAddrMap(boundingCtuTsAddr - 1);
     if (isLastCTUinBrick || isLastCTUinWPP || !isMoreCTUsinSlice)         // this the the last CTU of either tile/brick/WPP/slice
-#else
-    if( ctuTsAddr + 1 == boundingCtuTsAddr ||
-        (  ctuXPosInCtus + 1 == tileXPosInCtus + currentTile.getWidthInCtus () &&
-        ( ctuYPosInCtus + 1 == tileYPosInCtus + currentTile.getHeightInCtus() || wavefrontsEnabled ) )
-      )
-#endif
-#else
-    if( ctuTsAddr + 1 == boundingCtuTsAddr ||
-         (  ctuXPosInCtus + 1 == tileXPosInCtus + currentTile.getTileWidthInCtus () &&
-          ( ctuYPosInCtus + 1 == tileYPosInCtus + currentTile.getTileHeightInCtus() || wavefrontsEnabled )
-         )
-       )
-#endif
     {
       m_CABACWriter->end_of_slice();  //This is actually end_of_brick_one_bit or end_of_subset_one_bit
 
       // Byte-alignment in slice_data() when new tile
       pcSubstreams[uiSubStrm].writeByteAlignment();
 
-#if JVET_N0857_RECT_SLICES
       if (isMoreCTUsinSlice) //Byte alignment only when it is not the last substream in the slice
       {
         // write sub-stream size
         pcSlice->addSubstreamSize((pcSubstreams[uiSubStrm].getNumberOfWrittenBits() >> 3) + pcSubstreams[uiSubStrm].countStartCodeEmulations());
       }
       uiSubStrm++;
-#else
-      // write sub-stream size
-      if( ctuTsAddr + 1 != boundingCtuTsAddr )
-      {
-        pcSlice->addSubstreamSize( (pcSubstreams[uiSubStrm].getNumberOfWrittenBits() >> 3) + pcSubstreams[uiSubStrm].countStartCodeEmulations() );
-      }
-#endif
     }
   } // CTU-loop
 
@@ -2079,11 +1903,7 @@ void EncSlice::calculateBoundingCtuTsAddrForSlice(uint32_t &startCtuTSAddrSlice,
                                                    Picture* pcPic, const int sliceMode, const int sliceArgument)
 {
   Slice* pcSlice = pcPic->slices[getSliceSegmentIdx()];
-#if JVET_N0857_TILES_BRICKS
   const BrickMap& tileMap = *( pcPic->brickMap );
-#else
-  const TileMap& tileMap = *( pcPic->tileMap );
-#endif
   const PPS &pps         = *( pcSlice->getPPS() );
   const uint32_t numberOfCtusInFrame = pcPic->cs->pcv->sizeInCtus;
   boundingCtuTSAddrSlice=0;
@@ -2102,7 +1922,6 @@ void EncSlice::calculateBoundingCtuTsAddrForSlice(uint32_t &startCtuTSAddrSlice,
       break;
     case FIXED_NUMBER_OF_TILES:
       {
-#if JVET_N0857_RECT_SLICES
       const uint32_t startBrickIdx = tileMap.getBrickIdxBsMap(startCtuTSAddrSlice);
       uint32_t endBrickIdx = -1;
       if (pps.getRectSliceFlag())  //rectangular slice
@@ -2133,36 +1952,8 @@ void EncSlice::calculateBoundingCtuTsAddrForSlice(uint32_t &startCtuTSAddrSlice,
       boundingCtuTSAddrSlice = (tmpAddr != -1) ? tmpAddr : numberOfCtusInFrame - 1;
       boundingCtuTSAddrSlice++;
       break;
-#else
-#if JVET_N0857_TILES_BRICKS
-      const uint32_t tileIdx        = tileMap.getBrickIdxRsMap( tileMap.getCtuBsToRsAddrMap(startCtuTSAddrSlice) );
-      const uint32_t tileTotalCount = (uint32_t) tileMap.bricks.size();
-#else
-        const uint32_t tileIdx        = tileMap.getTileIdxMap( tileMap.getCtuTsToRsAddrMap(startCtuTSAddrSlice) );
-        const uint32_t tileTotalCount = (pps.getNumTileColumnsMinus1()+1) * (pps.getNumTileRowsMinus1()+1);
-#endif
-        uint32_t ctuAddrIncrement   = 0;
-
-        for(uint32_t tileIdxIncrement = 0; tileIdxIncrement < sliceArgument; tileIdxIncrement++)
-        {
-          if((tileIdx + tileIdxIncrement) < tileTotalCount)
-          {
-#if JVET_N0857_TILES_BRICKS
-            uint32_t tileWidthInCtus    = tileMap.bricks[tileIdx + tileIdxIncrement].getWidthInCtus();
-            uint32_t tileHeightInCtus   = tileMap.bricks[tileIdx + tileIdxIncrement].getHeightInCtus();
-#else
-            uint32_t tileWidthInCtus    = tileMap.tiles[tileIdx + tileIdxIncrement].getTileWidthInCtus();
-            uint32_t tileHeightInCtus   = tileMap.tiles[tileIdx + tileIdxIncrement].getTileHeightInCtus();
-#endif
-            ctuAddrIncrement       += (tileWidthInCtus * tileHeightInCtus);
-          }
-        }
-
-        boundingCtuTSAddrSlice  = ((startCtuTSAddrSlice + ctuAddrIncrement) < numberOfCtusInFrame) ? (startCtuTSAddrSlice + ctuAddrIncrement) : numberOfCtusInFrame;
-#endif
       }
       break;
-#if JVET_N0857_TILES_BRICKS
     case SINGLE_BRICK_PER_SLICE:
       {
         const uint32_t brickIdx           = tileMap.getBrickIdxRsMap( tileMap.getCtuBsToRsAddrMap(startCtuTSAddrSlice) );
@@ -2172,7 +1963,6 @@ void EncSlice::calculateBoundingCtuTsAddrForSlice(uint32_t &startCtuTSAddrSlice,
         boundingCtuTSAddrSlice  = ((startCtuTSAddrSlice + ctuAddrIncrement) < numberOfCtusInFrame) ? (startCtuTSAddrSlice + ctuAddrIncrement) : numberOfCtusInFrame;
       }
       break;
-#endif
     default:
       boundingCtuTSAddrSlice    = numberOfCtusInFrame;
       break;
@@ -2184,21 +1974,12 @@ void EncSlice::calculateBoundingCtuTsAddrForSlice(uint32_t &startCtuTSAddrSlice,
   if ((sliceMode == FIXED_NUMBER_OF_CTU || sliceMode == FIXED_NUMBER_OF_BYTES) &&
       (pps.getNumTileRowsMinus1() > 0 || pps.getNumTileColumnsMinus1() > 0))
   {
-#if JVET_N0857_TILES_BRICKS
     const uint32_t  ctuRsAddr                  = tileMap.getCtuBsToRsAddrMap(startCtuTSAddrSlice);
     const uint32_t  startTileIdx               = tileMap.getBrickIdxRsMap(ctuRsAddr);
     const Brick&    startingTile               = tileMap.bricks[startTileIdx];
     const uint32_t  tileStartTsAddr            = tileMap.getCtuRsToBsAddrMap(startingTile.getFirstCtuRsAddr());
     const uint32_t  tileStartWidth             = startingTile.getWidthInCtus();
     const uint32_t  tileStartHeight            = startingTile.getHeightInCtus();
-#else
-    const uint32_t ctuRsAddr                   = tileMap.getCtuTsToRsAddrMap(startCtuTSAddrSlice);
-    const uint32_t startTileIdx                = tileMap.getTileIdxMap(ctuRsAddr);
-    const Tile& startingTile               = tileMap.tiles[startTileIdx];
-    const uint32_t  tileStartTsAddr            = tileMap.getCtuRsToTsAddrMap(startingTile.getFirstCtuRsAddr());
-    const uint32_t  tileStartWidth             = startingTile.getTileWidthInCtus();
-    const uint32_t  tileStartHeight            = startingTile.getTileHeightInCtus();
-#endif
     const uint32_t tileLastTsAddr_excl        = tileStartTsAddr + tileStartWidth*tileStartHeight;
     const uint32_t tileBoundingCtuTsAddrSlice = tileLastTsAddr_excl;
     const uint32_t ctuColumnOfStartingTile     = ((startCtuTSAddrSlice-tileStartTsAddr)%tileStartWidth);
@@ -2247,14 +2028,12 @@ void EncSlice::xDetermineStartAndBoundingCtuTsAddr  ( uint32_t& startCtuTsAddr,
   pcSlice->setSliceCurEndCtuTsAddr(   boundingCtuTsAddrSlice );
   pcSlice->setSliceCurStartCtuTsAddr( startCtuTsAddrSlice    );
 
-#if JVET_N0857_RECT_SLICES
   const BrickMap& tileMap = *(pcPic->brickMap);
   pcSlice->setSliceCurStartBrickIdx(tileMap.getBrickIdxBsMap(startCtuTsAddrSlice));
   if (pcSlice->getPPS()->getRectSliceFlag())
     pcSlice->setSliceCurEndBrickIdx(tileMap.getBrickIdxBsMap(boundingCtuTsAddrSlice - 1));
   else
     pcSlice->setSliceNumBricks(tileMap.getBrickIdxBsMap(boundingCtuTsAddrSlice - 1) - tileMap.getBrickIdxBsMap(startCtuTsAddrSlice) + 1);
-#endif
 
   startCtuTsAddr = startCtuTsAddrSlice;
   boundingCtuTsAddr = boundingCtuTsAddrSlice;
diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp
index 9aa399b99..b6b558381 100644
--- a/source/Lib/EncoderLib/InterSearch.cpp
+++ b/source/Lib/EncoderLib/InterSearch.cpp
@@ -198,15 +198,11 @@ void InterSearch::init( EncCfg*        pcEncCfg,
 {
   CHECK(m_isInitialized, "Already initialized");
   m_numBVs = 0;
-#if JVET_N0329_IBC_SEARCH_IMP
   for (int i = 0; i < IBC_NUM_CANDIDATES; i++)
   {
     m_defaultCachedBvs.m_bvCands[i].setZero();
   }
   m_defaultCachedBvs.currCnt = 0;
-#else
-  m_numBV16s = 0;
-#endif
   m_pcEncCfg                     = pcEncCfg;
   m_pcTrQuant                    = pcTrQuant;
   m_iSearchRange                 = iSearchRange;
@@ -755,11 +751,7 @@ Distortion InterSearch::xGetInterPredictionError( PredictionUnit& pu, PelUnitBuf
   DistParam cDistParam;
   cDistParam.applyWeight = false;
 
-#if JVET_N0329_IBC_SEARCH_IMP
   m_pcRdCost->setDistParam(cDistParam, origBuf.Y(), predBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, m_pcEncCfg->getUseHADME() && !pu.cu->transQuantBypass && !pu.cu->slice->getDisableSATDForRD());
-#else
-  m_pcRdCost->setDistParam( cDistParam, origBuf.Y(), predBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, m_pcEncCfg->getUseHADME() && !pu.cu->transQuantBypass );
-#endif
 
   return (Distortion)cDistParam.distFunc( cDistParam );
 }
@@ -817,12 +809,10 @@ int InterSearch::xIBCSearchMVChromaRefine(PredictionUnit& pu,
   UnitArea allCompBlocks(pu.chromaFormat, (Area)pu.block(COMPONENT_Y));
   for (int cand = 0; cand < CHROMA_REFINEMENT_CANDIDATES; cand++)
   {
-#if JVET_N0329_IBC_SEARCH_IMP
     if (sadBestCand[cand] == std::numeric_limits<Distortion>::max())
     {
       continue;
     }
-#endif
 
     if ((!cMVCand[cand].getHor()) && (!cMVCand[cand].getVer()))
       continue;
@@ -888,22 +878,14 @@ int InterSearch::xIBCSearchMVChromaRefine(PredictionUnit& pu,
   return bestCandIdx;
 }
 
-#if JVET_N0329_IBC_SEARCH_IMP
 static unsigned int xMergeCandLists(Mv *dst, unsigned int dn, unsigned int dstTotalLength, Mv *src, unsigned int sn)
 {
   for (unsigned int cand = 0; cand < sn && dn < dstTotalLength; cand++)
-#else
-static unsigned int xMergeCandLists(Mv *dst, unsigned int dn, Mv *src, unsigned int sn)
-{
-  for (unsigned int cand = 0; cand < sn && dn<IBC_NUM_CANDIDATES; cand++)
-#endif
   {
-#if JVET_N0329_IBC_SEARCH_IMP
     if (src[cand] == Mv())
     {
       continue;
     }
-#endif
     bool found = false;
     for (int j = 0; j<dn; j++)
     {
@@ -973,30 +955,13 @@ void InterSearch::xIntraPatternSearch(PredictionUnit& pu, IntTZSearchStruct&  cS
     Distortion tempSadBest = 0;
 
     int srLeft = srchRngHorLeft, srRight = srchRngHorRight, srTop = srchRngVerTop, srBottom = srchRngVerBottom;
-#if JVET_N0329_IBC_SEARCH_IMP
     m_numBVs = 0;
     m_numBVs = xMergeCandLists(m_acBVs, m_numBVs, (2 * IBC_NUM_CANDIDATES), m_defaultCachedBvs.m_bvCands, m_defaultCachedBvs.currCnt);
 
     Mv cMvPredEncOnly[IBC_NUM_CANDIDATES];
-#else
-    if (roiWidth>8 || roiHeight>8)
-    {
-      m_numBVs = 0;
-    }
-    else if (roiWidth + roiHeight == 16)
-    {
-      m_numBVs = m_numBV16s;
-    }
-
-    Mv cMvPredEncOnly[16];
-#endif
     int nbPreds = 0;
     PU::getIbcMVPsEncOnly(pu, cMvPredEncOnly, nbPreds);
-#if JVET_N0329_IBC_SEARCH_IMP
     m_numBVs = xMergeCandLists(m_acBVs, m_numBVs, (2 * IBC_NUM_CANDIDATES), cMvPredEncOnly, nbPreds);
-#else
-    m_numBVs = xMergeCandLists(m_acBVs, m_numBVs, cMvPredEncOnly, nbPreds);
-#endif
 
     for (unsigned int cand = 0; cand < m_numBVs; cand++)
     {
@@ -1237,7 +1202,6 @@ void InterSearch::xIntraPatternSearch(PredictionUnit& pu, IntTZSearchStruct&  cS
   ruiCost = sadBest;
 
 end:
-#if JVET_N0329_IBC_SEARCH_IMP
   m_numBVs = 0;
   m_numBVs = xMergeCandLists(m_acBVs, m_numBVs, (2 * IBC_NUM_CANDIDATES), m_defaultCachedBvs.m_bvCands, m_defaultCachedBvs.currCnt);
 
@@ -1253,17 +1217,6 @@ end:
     }
     m_ctuRecord[pu.lumaPos()][pu.lumaSize()].bvRecord[cMVCand[cand]] = sadBestCand[cand];
   }
-#else
-  if (roiWidth + roiHeight > 8)
-  {
-    m_numBVs = xMergeCandLists(m_acBVs, m_numBVs, cMVCand, CHROMA_REFINEMENT_CANDIDATES);
-
-    if (roiWidth + roiHeight == 32)
-    {
-      m_numBV16s = m_numBVs;
-    }
-  }
-#endif
 
   return;
 }
@@ -1277,7 +1230,6 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf,
   Distortion &ruiCost, const int localSearchRangeX, const int localSearchRangeY
 )
 {
-#if JVET_N0329_IBC_SEARCH_IMP
   const int iPicWidth = pu.cs->slice->getSPS()->getPicWidthInLumaSamples();
   const int iPicHeight = pu.cs->slice->getSPS()->getPicHeightInLumaSamples();
   const unsigned int  lcuWidth = pu.cs->slice->getSPS()->getMaxCUWidth();
@@ -1292,11 +1244,7 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf,
   CPelBuf  tmpPattern = pBuf->Y();
   CPelBuf* pcPatternKey = &tmpPattern;
 
-#if JVET_N0805_APS_LMCS
   if ((pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))
-#else
-  if ((pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag()))
-#endif
   {
     const CompArea &area = pu.blocks[COMPONENT_Y];
     CompArea    tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
@@ -1326,24 +1274,11 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf,
 
   m_cDistParam.useMR = false;
   m_pcRdCost->setDistParam(m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, cStruct.subShiftMode);
-#endif
   bool buffered = false;
   if (m_pcEncCfg->getIBCFastMethod() & IBC_FAST_METHOD_BUFFERBV)
   {
     ruiCost = MAX_UINT;
-#if !JVET_N0329_IBC_SEARCH_IMP
-    const int iPicWidth = pu.cs->slice->getSPS()->getPicWidthInLumaSamples();
-    const int iPicHeight = pu.cs->slice->getSPS()->getPicHeightInLumaSamples();
-    const int   cuPelX = pu.Y().x;
-    const int   cuPelY = pu.Y().y;
-
-    int          iRoiWidth = pu.lwidth();
-    int          iRoiHeight = pu.lheight();
-#endif
     std::unordered_map<Mv, Distortion>& history = m_ctuRecord[pu.lumaPos()][pu.lumaSize()].bvRecord;
-#if !JVET_N0329_IBC_SEARCH_IMP
-    const unsigned int  lcuWidth = pu.cs->slice->getSPS()->getMaxCUWidth();
-#endif
     for (std::unordered_map<Mv, Distortion>::iterator p = history.begin(); p != history.end(); p++)
     {
       const Mv& bv = p->first;
@@ -1352,7 +1287,6 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf,
       int yBv = bv.ver;
       if (PU::isBlockVectorValid(pu, cuPelX, cuPelY, iRoiWidth, iRoiHeight, iPicWidth, iPicHeight, 0, 0, xBv, yBv, lcuWidth))
       {
-#if JVET_N0329_IBC_SEARCH_IMP
         buffered = true;
         Distortion sad = m_pcRdCost->getBvCostMultiplePreds(xBv, yBv, pu.cs->sps->getAMVREnabledFlag());
         m_cDistParam.cur.buf = cStruct.piRefY + cStruct.iRefStride * yBv + xBv;
@@ -1372,28 +1306,9 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf,
             rcMv = bv;
           }
         }
-#else
-        if (p->second < ruiCost)
-        {
-          rcMv = bv;
-          ruiCost = p->second;
-          buffered = true;
-        }
-        else if (p->second == ruiCost)
-        {
-          // stabilise the search through the unordered list
-          if (bv.hor < rcMv.getHor()
-              || (bv.hor == rcMv.getHor() && bv.ver < rcMv.getVer()))
-          {
-            // update the vector.
-            rcMv = bv;
-          }
-        }
-#endif
       }
     }
 
-#if JVET_N0329_IBC_SEARCH_IMP
     if (buffered)
     {
       Mv cMvPredEncOnly[IBC_NUM_CANDIDATES];
@@ -1430,62 +1345,15 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf,
         }
       }
     }
-#endif
   }
 
   if (!buffered)
   {
-#if JVET_N0329_IBC_SEARCH_IMP
     Mv        cMvSrchRngLT;
     Mv        cMvSrchRngRB;
 
     // assume that intra BV is integer-pel precision
     xSetIntraSearchRange(pu, pu.lwidth(), pu.lheight(), localSearchRangeX, localSearchRangeY, cMvSrchRngLT, cMvSrchRngRB);
-#else
-    Mv        cMvSrchRngLT;
-    Mv        cMvSrchRngRB;
-
-    //cMvSrchRngLT.highPrec = false;
-    //cMvSrchRngRB.highPrec = false;
-
-    PelUnitBuf* pBuf = &origBuf;
-
-    //  Search key pattern initialization
-    CPelBuf  tmpPattern = pBuf->Y();
-    CPelBuf* pcPatternKey = &tmpPattern;
-
-    if ((pu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag()))
-    {
-      const CompArea &area = pu.blocks[COMPONENT_Y];
-      CompArea    tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
-      PelBuf tmpOrgLuma = m_tmpStorageLCU.getBuf(tmpArea);
-      tmpOrgLuma.copyFrom(tmpPattern);
-      tmpOrgLuma.rspSignal(m_pcReshape->getFwdLUT());
-      pcPatternKey = (CPelBuf*)&tmpOrgLuma;
-    }
-
-    m_lumaClpRng = pu.cs->slice->clpRng(COMPONENT_Y);
-    Picture* refPic = pu.cu->slice->getPic();
-
-    const CPelBuf refBuf = refPic->getRecoBuf(pu.blocks[COMPONENT_Y]);
-
-    IntTZSearchStruct cStruct;
-    cStruct.pcPatternKey = pcPatternKey;
-    cStruct.iRefStride = refBuf.stride;
-    cStruct.piRefY = refBuf.buf;
-    cStruct.imvShift = pu.cu->imv << 1;
-    cStruct.subShiftMode = 0; // used by intra pattern search function
-
-                              // assume that intra BV is integer-pel precision
-    xSetIntraSearchRange(pu, pu.lwidth(), pu.lheight(), localSearchRangeX, localSearchRangeY, cMvSrchRngLT, cMvSrchRngRB);
-
-    // disable weighted prediction
-    setWpScalingDistParam(-1, REF_PIC_LIST_X, pu.cs->slice);
-
-    m_pcRdCost->getMotionCost(0, pu.cu->transQuantBypass);
-    m_pcRdCost->setPredictors(pcMvPred);
-    m_pcRdCost->setCostScale(0);
-#endif
 
     //  Do integer search
     xIntraPatternSearch(pu, cStruct, rcMv, ruiCost, &cMvSrchRngLT, &cMvSrchRngRB, pcMvPred);
@@ -1502,7 +1370,6 @@ void InterSearch::xSetIntraSearchRange(PredictionUnit& pu, int iRoiWidth, int iR
   const int cuPelX = pu.Y().x;
   const int cuPelY = pu.Y().y;
 
-#if JVET_N0251_ITEM4_IBC_LOCAL_SEARCH_RANGE
   const int lcuWidth = pu.cs->slice->getSPS()->getMaxCUWidth();
   const int ctuSizeLog2 = g_aucLog2[lcuWidth];
   int numLeftCTUs = (1 << ((7 - ctuSizeLog2) << 1)) - ((ctuSizeLog2 < 7) ? 1 : 0);
@@ -1512,16 +1379,6 @@ void InterSearch::xSetIntraSearchRange(PredictionUnit& pu, int iRoiWidth, int iR
 
   srRight = lcuWidth - (cuPelX % lcuWidth) - iRoiWidth;
   srBottom = lcuWidth - (cuPelY % lcuWidth) - iRoiHeight;
-#else
-  const int iPicWidth = pu.cs->slice->getSPS()->getPicWidthInLumaSamples();
-  const int iPicHeight = pu.cs->slice->getSPS()->getPicHeightInLumaSamples();
-
-  srLeft = -std::min(cuPelX, localSearchRangeX);
-  srTop = -std::min(cuPelY, localSearchRangeY);
-
-  srRight = std::min(iPicWidth - cuPelX - iRoiWidth, localSearchRangeX);
-  srBottom = std::min(iPicHeight - cuPelY - iRoiHeight, localSearchRangeY);
-#endif
 
   rcMvSrchRngLT.setHor(srLeft);
   rcMvSrchRngLT.setVer(srTop);
@@ -1661,9 +1518,6 @@ bool InterSearch::predIBCSearch(CodingUnit& cu, Partitioner& partitioner, const
 
     pu.refIdx[REF_PIC_LIST_0] = MAX_NUM_REF;
 
-#if !JVET_N0329_IBC_SEARCH_IMP
-    m_ctuRecord[cu.lumaPos()][cu.lumaSize()].bvRecord[pu.bv] = cost;
-#endif
   }
 
   return true;
@@ -1721,13 +1575,9 @@ void InterSearch::xxIBCHashSearch(PredictionUnit& pu, Mv* mvPred, int numMvPred,
             int imvShift = 2;
             int offset = 1 << (imvShift - 1);
 
-#if JVET_N0335_N0085_MV_ROUNDING
             int x = (mvPred[n].hor + offset - (mvPred[n].hor >= 0)) >> 2;
             int y = (mvPred[n].ver + offset - (mvPred[n].ver >= 0)) >> 2;
             mvPredQuadPel.set(x, y);
-#else
-            mvPredQuadPel.set(((mvPred[n].hor + offset) >> 2), ((mvPred[n].ver + offset) >> 2));
-#endif
 
             m_pcRdCost->setPredictor(mvPredQuadPel);
 
@@ -1802,7 +1652,6 @@ void InterSearch::selectMatchesInter(const MapIterator& itBegin, int count, std:
     }
   }
 }
-#if JVET_N0247_HASH_IMPROVE
 void InterSearch::selectRectangleMatchesInter(const MapIterator& itBegin, int count, std::list<BlockHash>& listBlockHash, const BlockHash& currBlockHash, int width, int height, int idxNonSimple, unsigned int* &hashValues, int baseNum, int picWidth, int picHeight, bool isHorizontal, uint16_t* curHashPic)
 {
   const int maxReturnNumber = 5;
@@ -1994,13 +1843,8 @@ bool InterSearch::xRectHashInterEstimation(PredictionUnit& pu, RefPicList& bestR
           currAMVPInfo4Pel.mvCand[mvpIdxTemp].changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
         }
 
-#if     JVET_N0070_WRAPAROUND
         const Pel* refBufStart = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf(pu.cs->sps->getWrapAroundEnabledFlag()).get(COMPONENT_Y).buf;
         const int refStride = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf(pu.cs->sps->getWrapAroundEnabledFlag()).get(COMPONENT_Y).stride;
-#else
-        const Pel* refBufStart = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf().get(COMPONENT_Y).buf;
-        const int refStride = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf().get(COMPONENT_Y).stride;
-#endif
         m_cDistParam.cur.stride = refStride;
 
         m_pcRdCost->selectMotionLambda(pu.cu->transQuantBypass);
@@ -2107,62 +1951,15 @@ bool InterSearch::xRectHashInterEstimation(PredictionUnit& pu, RefPicList& bestR
   }
   return (bestCost < MAX_INT);
 }
-#else
-int InterSearch::xHashInterPredME(const PredictionUnit& pu, RefPicList currRefPicList, int currRefPicIndex, Mv bestMv[5])
-{
-  int width = pu.cu->lumaSize().width;
-  int height = pu.cu->lumaSize().height;
-  int xPos = pu.cu->lumaPos().x;
-  int yPos = pu.cu->lumaPos().y;
-
-  uint32_t hashValue1;
-  uint32_t hashValue2;
-
-  if (!TComHash::getBlockHashValue((pu.cs->picture->getOrigBuf()), width, height, xPos, yPos, pu.cu->slice->getSPS()->getBitDepths(), hashValue1, hashValue2))
-  {
-    return 0;
-  }
-  BlockHash currBlockHash;
-  currBlockHash.x = xPos;
-  currBlockHash.y = yPos;
-  currBlockHash.hashValue2 = hashValue2;
-
-  int count = static_cast<int>(pu.cu->slice->getRefPic(currRefPicList, currRefPicIndex)->getHashMap()->count(hashValue1));
-  if (count == 0)
-  {
-    return 0;
-  }
-
-  list<BlockHash> listBlockHash;
-  selectMatchesInter(pu.cu->slice->getRefPic(currRefPicList, currRefPicIndex)->getHashMap()->getFirstIterator(hashValue1), count, listBlockHash, currBlockHash);
-
-  if (listBlockHash.empty())
-  {
-    return 0;
-  }
-
-  int totalSize = 0;
-  list<BlockHash>::iterator it = listBlockHash.begin();
-  for (int i = 0; i < 5 && i < listBlockHash.size(); i++, it++)
-  {
-    bestMv[i].set((*it).x - currBlockHash.x, (*it).y - currBlockHash.y);
-    totalSize++;
-  }
-
-  return totalSize;
-}
-#endif
 
 bool InterSearch::xHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPicList, int& bestRefIndex, Mv& bestMv, Mv& bestMvd, int& bestMVPIndex, bool& isPerfectMatch)
 {
   int width = pu.cu->lumaSize().width;
   int height = pu.cu->lumaSize().height;
-#if JVET_N0247_HASH_IMPROVE
   if (width != height)
   {
     return xRectHashInterEstimation(pu, bestRefPicList, bestRefIndex, bestMv, bestMvd, bestMVPIndex, isPerfectMatch);
   }
-#endif
   int xPos = pu.cu->lumaPos().x;
   int yPos = pu.cu->lumaPos().y;
 
@@ -2202,9 +1999,7 @@ bool InterSearch::xHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPi
           bitsOnRefIdx--;
         }
       }
-#if JVET_N0247_HASH_IMPROVE
       m_numHashMVStoreds[eRefPicList][refIdx] = 0;
-#endif
 
       if (refList == 0 || pu.cu->slice->getList1IdxToList0Idx(refIdx) < 0)
       {
@@ -2216,9 +2011,7 @@ bool InterSearch::xHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPi
 
         list<BlockHash> listBlockHash;
         selectMatchesInter(pu.cu->slice->getRefPic(eRefPicList, refIdx)->getHashMap()->getFirstIterator(hashValue1), count, listBlockHash, currBlockHash);
-#if JVET_N0247_HASH_IMPROVE
         m_numHashMVStoreds[eRefPicList][refIdx] = (int)listBlockHash.size();
-#endif
         if (listBlockHash.empty())
         {
           continue;
@@ -2240,13 +2033,8 @@ bool InterSearch::xHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPi
           currAMVPInfo4Pel.mvCand[mvpIdxTemp].changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
         }
 
-#if JVET_N0070_WRAPAROUND
         const Pel* refBufStart = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf(pu.cs->sps->getWrapAroundEnabledFlag()).get(COMPONENT_Y).buf;
         const int refStride = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf(pu.cs->sps->getWrapAroundEnabledFlag()).get(COMPONENT_Y).stride;
-#else
-        const Pel* refBufStart = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf().get(COMPONENT_Y).buf;
-        const int refStride = pu.cu->slice->getRefPic(eRefPicList, refIdx)->getRecoBuf().get(COMPONENT_Y).stride;
-#endif
 
         m_cDistParam.cur.stride = refStride;
 
@@ -2254,17 +2042,13 @@ bool InterSearch::xHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPi
         m_pcRdCost->setCostScale(0);
 
         list<BlockHash>::iterator it;
-#if JVET_N0247_HASH_IMPROVE
         int countMV = 0;
-#endif
         for (it = listBlockHash.begin(); it != listBlockHash.end(); ++it)
         {
           int curMVPIdx = 0;
           unsigned int curMVPbits = MAX_UINT;
           Mv cMv((*it).x - currBlockHash.x, (*it).y - currBlockHash.y);
-#if JVET_N0247_HASH_IMPROVE
           m_hashMVStoreds[eRefPicList][refIdx][countMV++] = cMv;
-#endif
           cMv.changePrecision(MV_PRECISION_INT, MV_PRECISION_QUARTER);
 
           for (int mvpIdxTemp = 0; mvpIdxTemp < 2; mvpIdxTemp++)
@@ -3130,9 +2914,7 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
         // set hevc me result
         cu.affine = false;
         pu.mergeFlag = bMergeFlag;
-#if JVET_N0324_REGULAR_MRG_FLAG
         pu.regularMergeFlag = false;
-#endif
         pu.mergeIdx = uiMRGIndex;
         pu.interDir = uiInterDir;
         cu.smvdMode = iSymMode;
@@ -3405,15 +3187,9 @@ Distortion InterSearch::xGetAffineTemplateCost( PredictionUnit& pu, PelUnitBuf&
   }
 
   // calc distortion
-#if JVET_N0329_IBC_SEARCH_IMP
   enum DFunc distFunc = (pu.cu->transQuantBypass || pu.cs->slice->getDisableSATDForRD()) ? DF_SAD : DF_HAD;
-#endif
   uiCost  = m_pcRdCost->getDistPart( origBuf.Y(), predBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y
-#if JVET_N0329_IBC_SEARCH_IMP
     , distFunc
-#else
-    , DF_HAD
-#endif
   );
   uiCost += m_pcRdCost->getCost( m_auiMVPIdxCost[iMVPIdx][iMVPNum] );
   DTRACE( g_trace_ctx, D_COMMON, " (%d) affineTemplateCost=%d\n", DTRACE_GET_COUNTER(g_trace_ctx,D_COMMON), uiCost );
@@ -3458,11 +3234,7 @@ void InterSearch::xMotionEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, Ref
 
   m_lumaClpRng = pu.cs->slice->clpRng( COMPONENT_Y );
 
-#if JVET_N0070_WRAPAROUND
   CPelBuf buf = pu.cu->slice->getRefPic(eRefPicList, iRefIdxPred)->getRecoBuf(pu.blocks[COMPONENT_Y], pu.cs->sps->getWrapAroundEnabledFlag());
-#else
-  CPelBuf buf = pu.cu->slice->getRefPic(eRefPicList, iRefIdxPred)->getRecoBuf(pu.blocks[COMPONENT_Y]);
-#endif
 
   IntTZSearchStruct cStruct;
   cStruct.pcPatternKey  = pcPatternKey;
@@ -3816,7 +3588,6 @@ void InterSearch::xTZSearch( const PredictionUnit& pu,
       , cStruct
     );
   }
-#if JVET_N0247_HASH_IMPROVE
   if (m_pcEncCfg->getUseHashME() && (m_currRefPicList == 0 || pu.cu->slice->getList1IdxToList0Idx(m_currRefPicIndex) < 0))
   {
     int minSize = min(pu.cu->lumaSize().width, pu.cu->lumaSize().height);
@@ -3827,21 +3598,6 @@ void InterSearch::xTZSearch( const PredictionUnit& pu,
       {
         xTZSearchHelp(cStruct, m_hashMVStoreds[m_currRefPicList][m_currRefPicIndex][i].getHor(), m_hashMVStoreds[m_currRefPicList][m_currRefPicIndex][i].getVer(), 0, 0);
       }
-#else
-  if (m_pcEncCfg->getUseHashME())
-  {
-    int width = pu.cu->lumaSize().width;
-    int height = pu.cu->lumaSize().height;
-    if ((width == height && width <= 64 && width >= 4) || (width == 8 && height == 4) || (width == 4 && height == 8))
-    {
-      Mv otherMvps[5];
-      int numberOfOtherMvps;
-      numberOfOtherMvps = xHashInterPredME(pu, m_currRefPicList, m_currRefPicIndex, otherMvps);
-      for (int i = 0; i < numberOfOtherMvps; i++)
-      {
-        xTZSearchHelp(cStruct, otherMvps[i].getHor(), otherMvps[i].getVer(), 0, 0);
-      }
-#endif
       if (numberOfOtherMvps > 0)
       {
         // write out best match
@@ -4103,7 +3859,6 @@ void InterSearch::xTZSearchSelective( const PredictionUnit& pu,
       , cStruct
     );
   }
-#if JVET_N0247_HASH_IMPROVE
   if (m_pcEncCfg->getUseHashME() && (m_currRefPicList == 0 || pu.cu->slice->getList1IdxToList0Idx(m_currRefPicIndex) < 0))
   {
     int minSize = min(pu.cu->lumaSize().width, pu.cu->lumaSize().height);
@@ -4114,21 +3869,6 @@ void InterSearch::xTZSearchSelective( const PredictionUnit& pu,
       {
         xTZSearchHelp(cStruct, m_hashMVStoreds[m_currRefPicList][m_currRefPicIndex][i].getHor(), m_hashMVStoreds[m_currRefPicList][m_currRefPicIndex][i].getVer(), 0, 0);
       }
-#else
-  if (m_pcEncCfg->getUseHashME())
-  {
-    int width = pu.cu->lumaSize().width;
-    int height = pu.cu->lumaSize().height;
-    if ((width == height && width <= 64 && width >= 4) || (width == 8 && height == 4) || (width == 4 && height == 8))
-    {
-      Mv otherMvps[5];
-      int numberOfOtherMvps;
-      numberOfOtherMvps = xHashInterPredME(pu, m_currRefPicList, m_currRefPicIndex, otherMvps);
-      for (int i = 0; i < numberOfOtherMvps; i++)
-      {
-        xTZSearchHelp(cStruct, otherMvps[i].getHor(), otherMvps[i].getVer(), 0, 0);
-      }
-#endif
       if (numberOfOtherMvps > 0)
       {
         // write out best match
@@ -4221,11 +3961,7 @@ void InterSearch::xPatternSearchIntRefine(PredictionUnit& pu, IntTZSearchStruct&
   CHECK( amvpInfo.mvCand[riMVPIdx] != rcMvPred, "xPatternSearchIntRefine(): MvPred issue.");
 
   const SPS &sps = *pu.cs->sps;
-#if JVET_N0329_IBC_SEARCH_IMP
   m_pcRdCost->setDistParam(m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, 0, 1, m_pcEncCfg->getUseHADME() && !pu.cu->transQuantBypass && !pu.cs->slice->getDisableSATDForRD());
-#else
-  m_pcRdCost->setDistParam( m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, 0, 1, m_pcEncCfg->getUseHADME() && !pu.cu->transQuantBypass );
-#endif
 
   // -> set MV scale for cost calculation to QPEL (0)
   m_pcRdCost->setCostScale ( 0 );
@@ -4296,11 +4032,7 @@ void InterSearch::xPatternSearchIntRefine(PredictionUnit& pu, IntTZSearchStruct&
       Mv mv = cTestMv[iMVPIdx];
       mv.changeTransPrecInternal2Amvr(pu.cu->imv);
       iMvBits += m_pcRdCost->getBitsOfVectorWithPredictor( mv.getHor(), mv.getVer(), 0 );
-#if JVET_N0168_AMVR_ME_MODIFICATION
       uiDist += m_pcRdCost->getCost(iMvBits);
-#else
-      uiDist += m_pcRdCost->getCostOfVectorWithPredictor( cTestMv[iMVPIdx].getHor(), cTestMv[iMVPIdx].getVer(), cStruct.imvShift );
-#endif
 
       if (uiDist < uiBestDist)
       {
@@ -4330,9 +4062,6 @@ void InterSearch::xPatternSearchIntRefine(PredictionUnit& pu, IntTZSearchStruct&
   ruiCost = uiBestDist - m_pcRdCost->getCost(iBestBits) + m_pcRdCost->getCost(ruiBits);
   // taken from JEM 5.0
   // verify since it makes no sense to add rate for MVDs twicce
-#if JVET_N0168_AMVR_ME_MODIFICATION == 0
-  ruiBits += m_pcRdCost->getBitsOfVectorWithPredictor(rcMv.getHor(), rcMv.getVer(), cStruct.imvShift);
-#endif
 
   return;
 }
@@ -4360,22 +4089,14 @@ void InterSearch::xPatternSearchFracDIF(
     m_pcRdCost->setCostScale(0);
     xExtDIFUpSamplingH(&cPatternRoi);
     rcMvQter = rcMvInt;   rcMvQter <<= 2;    // for mv-cost
-#if JVET_N0329_IBC_SEARCH_IMP
     ruiCost = xPatternRefinement(cStruct.pcPatternKey, baseRefMv, 1, rcMvQter, !bIsLosslessCoded && !pu.cs->slice->getDisableSATDForRD());
-#else
-    ruiCost = xPatternRefinement(cStruct.pcPatternKey, baseRefMv, 1, rcMvQter, !bIsLosslessCoded);
-#endif
     return;
   }
 
 
   if (cStruct.imvShift || (m_useCompositeRef && cStruct.zeroMV))
   {
-#if JVET_N0329_IBC_SEARCH_IMP
     m_pcRdCost->setDistParam(m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY + iOffset, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, 0, 1, m_pcEncCfg->getUseHADME() && !bIsLosslessCoded && !pu.cs->slice->getDisableSATDForRD());
-#else
-    m_pcRdCost->setDistParam( m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY + iOffset, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, 0, 1, m_pcEncCfg->getUseHADME() && !bIsLosslessCoded );
-#endif
     ruiCost = m_cDistParam.distFunc( m_cDistParam );
     ruiCost += m_pcRdCost->getCostOfVectorWithPredictor( rcMvInt.getHor(), rcMvInt.getVer(), cStruct.imvShift );
     return;
@@ -4387,11 +4108,7 @@ void InterSearch::xPatternSearchFracDIF(
 
   rcMvHalf = rcMvInt;   rcMvHalf <<= 1;    // for mv-cost
   Mv baseRefMv(0, 0);
-#if JVET_N0329_IBC_SEARCH_IMP
   ruiCost = xPatternRefinement(cStruct.pcPatternKey, baseRefMv, 2, rcMvHalf, (!bIsLosslessCoded && !pu.cs->slice->getDisableSATDForRD()));
-#else
-  ruiCost = xPatternRefinement(cStruct.pcPatternKey, baseRefMv, 2, rcMvHalf, !bIsLosslessCoded);
-#endif
 
   //  quarter-pel refinement
   m_pcRdCost->setCostScale( 0 );
@@ -4401,11 +4118,7 @@ void InterSearch::xPatternSearchFracDIF(
 
   rcMvQter = rcMvInt;    rcMvQter <<= 1;    // for mv-cost
   rcMvQter += rcMvHalf;  rcMvQter <<= 1;
-#if JVET_N0329_IBC_SEARCH_IMP
   ruiCost = xPatternRefinement(cStruct.pcPatternKey, baseRefMv, 1, rcMvQter, (!bIsLosslessCoded && !pu.cs->slice->getDisableSATDForRD()));
-#else
-  ruiCost = xPatternRefinement( cStruct.pcPatternKey, baseRefMv, 1, rcMvQter, !bIsLosslessCoded );
-#endif
 }
 
 Distortion InterSearch::xGetSymmetricCost( PredictionUnit& pu, PelUnitBuf& origBuf, RefPicList eCurRefPicList, const MvField& cCurMvField, MvField& cTarMvField, int gbiIdx )
@@ -4434,12 +4147,8 @@ Distortion InterSearch::xGetSymmetricCost( PredictionUnit& pu, PelUnitBuf& origB
     bufTmp.Y().addAvg( predBufA.Y(), predBufB.Y(), pu.cu->slice->clpRng( COMPONENT_Y ) );
 
   // calc distortion
-#if JVET_N0329_IBC_SEARCH_IMP
   DFunc distFunc = (!pu.cu->transQuantBypass && !pu.cu->slice->getDisableSATDForRD()) ? DF_HAD : DF_SAD;
   cost = m_pcRdCost->getDistPart(bufTmp.Y(), origBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, distFunc);
-#else
-  cost = m_pcRdCost->getDistPart(bufTmp.Y(), origBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, DF_HAD);
-#endif
 
   return(cost);
 }
@@ -4647,9 +4356,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
 
   pu.cu->affine = true;
   pu.mergeFlag = false;
-#if JVET_N0324_REGULAR_MRG_FLAG
   pu.regularMergeFlag = false;
-#endif
   if( gbiIdx != GBI_DEFAULT )
   {
     pu.cu->GBiIdx = gbiIdx;
@@ -4659,9 +4366,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
   for ( int iRefList = 0; iRefList < iNumPredDir; iRefList++ )
   {
     RefPicList  eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
-#if JVET_N0068_AFFINE_MEM_BW
     pu.interDir = ( iRefList ? 2 : 1 );
-#endif
     for (int iRefIdxTemp = 0; iRefIdxTemp < slice.getNumRefIdx(eRefPicList); iRefIdxTemp++)
     {
       // Get RefIdx bits
@@ -4802,14 +4507,9 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
         int shift = MAX_CU_DEPTH;
         int vx2 = (mvFour[0].getHor() << shift) - ((mvFour[1].getVer() - mvFour[0].getVer()) << (shift + g_aucLog2[pu.lheight()] - g_aucLog2[pu.lwidth()]));
         int vy2 = (mvFour[0].getVer() << shift) + ((mvFour[1].getHor() - mvFour[0].getHor()) << (shift + g_aucLog2[pu.lheight()] - g_aucLog2[pu.lwidth()]));
-#if JVET_N0335_N0085_MV_ROUNDING
         int offset = (1 << (shift - 1));
         vx2 = (vx2 + offset - (vx2 >= 0)) >> shift;
         vy2 = (vy2 + offset - (vy2 >= 0)) >> shift;
-#else
-        vx2 >>= shift;
-        vy2 >>= shift;
-#endif
         mvFour[2].hor = vx2;
         mvFour[2].ver = vy2;
         mvFour[2].clipToStorageBitDepth();
@@ -4956,9 +4656,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
   if ( slice.isInterB() && !PU::isBipredRestriction(pu) )
   {
 	  tryBipred = 1;
-#if JVET_N0068_AFFINE_MEM_BW
     pu.interDir = 3;
-#endif
     // Set as best list0 and list1
     iRefIdxBi[0] = iRefIdx[0];
     iRefIdxBi[1] = iRefIdx[1];
@@ -5206,9 +4904,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
   {
     lastMode = 2;
     affineCost = uiCostBi;
-#if JVET_N0068_AFFINE_MEM_BW
     pu.interDir = 3;
-#endif
     PU::setAllAffineMv( pu, cMvBi[0][0], cMvBi[0][1], cMvBi[0][2], REF_PIC_LIST_0);
     PU::setAllAffineMv( pu, cMvBi[1][0], cMvBi[1][1], cMvBi[1][2], REF_PIC_LIST_1);
     pu.refIdx[REF_PIC_LIST_0] = iRefIdxBi[0];
@@ -5225,9 +4921,6 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
       }
     }
 
-#if !JVET_N0068_AFFINE_MEM_BW
-    pu.interDir = 3;
-#endif
 
     pu.mvpIdx[REF_PIC_LIST_0] = aaiMvpIdxBi[0][iRefIdxBi[0]];
     pu.mvpNum[REF_PIC_LIST_0] = aaiMvpNum[0][iRefIdxBi[0]];
@@ -5238,9 +4931,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
   {
     lastMode = 0;
     affineCost = uiCost[0];
-#if JVET_N0068_AFFINE_MEM_BW
     pu.interDir = 1;
-#endif
     PU::setAllAffineMv( pu, aacMv[0][0], aacMv[0][1], aacMv[0][2], REF_PIC_LIST_0);
     pu.refIdx[REF_PIC_LIST_0] = iRefIdx[0];
 
@@ -5252,9 +4943,6 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
         pu.mvdAffi[0][verIdx] = pu.mvdAffi[0][verIdx] - pu.mvdAffi[0][0];
       }
     }
-#if !JVET_N0068_AFFINE_MEM_BW
-    pu.interDir = 1;
-#endif
 
     pu.mvpIdx[REF_PIC_LIST_0] = aaiMvpIdx[0][iRefIdx[0]];
     pu.mvpNum[REF_PIC_LIST_0] = aaiMvpNum[0][iRefIdx[0]];
@@ -5263,9 +4951,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
   {
     lastMode = 1;
     affineCost = uiCost[1];
-#if JVET_N0068_AFFINE_MEM_BW
     pu.interDir = 2;
-#endif
     PU::setAllAffineMv( pu, aacMv[1][0], aacMv[1][1], aacMv[1][2], REF_PIC_LIST_1);
     pu.refIdx[REF_PIC_LIST_1] = iRefIdx[1];
 
@@ -5277,9 +4963,6 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
         pu.mvdAffi[1][verIdx] = pu.mvdAffi[1][verIdx] - pu.mvdAffi[1][0];
       }
     }
-#if !JVET_N0068_AFFINE_MEM_BW
-    pu.interDir = 2;
-#endif
 
     pu.mvpIdx[REF_PIC_LIST_1] = aaiMvpIdx[1][iRefIdx[1]];
     pu.mvpNum[REF_PIC_LIST_1] = aaiMvpNum[1][iRefIdx[1]];
@@ -5446,9 +5129,7 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
   double        fWeight       = 1.0;
 
   PelUnitBuf  origBufTmp = m_tmpStorageLCU.getBuf( UnitAreaRelative( *pu.cu, pu ) );
-#if JVET_N0329_IBC_SEARCH_IMP
   enum DFunc distFunc = (pu.cu->transQuantBypass || pu.cs->slice->getDisableSATDForRD()) ? DF_SAD : DF_HAD;
-#endif
 
   // if Bi, set to ( 2 * Org - ListX )
   if ( bBi )
@@ -5520,11 +5201,7 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
   xPredAffineBlk( COMPONENT_Y, pu, refPic, acMvTemp, predBuf, false, pu.cs->slice->clpRng( COMPONENT_Y ) );
 
   // get error
-#if JVET_N0329_IBC_SEARCH_IMP
   uiCostBest = m_pcRdCost->getDistPart(predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, distFunc);
-#else
-  uiCostBest = m_pcRdCost->getDistPart( predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, DF_HAD );
-#endif
 
   // get cost with mv
   m_pcRdCost->setCostScale(0);
@@ -5708,11 +5385,7 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
     xPredAffineBlk( COMPONENT_Y, pu, refPic, acMvTemp, predBuf, false, pu.cu->slice->clpRng( COMPONENT_Y ) );
 
     // get error
-#if JVET_N0329_IBC_SEARCH_IMP
     Distortion uiCostTemp = m_pcRdCost->getDistPart(predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, distFunc);
-#else
-    Distortion uiCostTemp = m_pcRdCost->getDistPart( predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, DF_HAD );
-#endif
     DTRACE( g_trace_ctx, D_COMMON, " (%d) uiCostTemp=%d\n", DTRACE_GET_COUNTER(g_trace_ctx,D_COMMON), uiCostTemp );
 
     // get cost with mv
@@ -5745,11 +5418,7 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
   {
     xPredAffineBlk(COMPONENT_Y, pu, refPic, ctrlPtMv, predBuf, false, pu.cu->slice->clpRng(COMPONENT_Y));
     // get error
-#if JVET_N0329_IBC_SEARCH_IMP
     Distortion costTemp = m_pcRdCost->getDistPart(predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, distFunc);
-#else
-    Distortion costTemp = m_pcRdCost->getDistPart(predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, DF_HAD);
-#endif
     // get cost with mv
     m_pcRdCost->setCostScale(0);
     uint32_t bitsTemp = ruiBits;
@@ -5792,11 +5461,7 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
               clipMv( acMvTemp[j], pu.cu->lumaPos(), pu.cu->lumaSize(), *pu.cs->sps );
               xPredAffineBlk( COMPONENT_Y, pu, refPic, acMvTemp, predBuf, false, pu.cu->slice->clpRng( COMPONENT_Y ) );
 
-#if JVET_N0329_IBC_SEARCH_IMP
               Distortion costTemp = m_pcRdCost->getDistPart(predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, distFunc);
-#else
-              Distortion costTemp = m_pcRdCost->getDistPart( predBuf.Y(), pBuf->Y(), pu.cs->sps->getBitDepth( CHANNEL_TYPE_LUMA ), COMPONENT_Y, DF_HAD );
-#endif
               uint32_t bitsTemp   = ruiBits;
               bitsTemp += xCalcAffineMVBits( pu, acMvTemp, acMvPred );
               costTemp = ( Distortion ) ( floor( fWeight * ( double ) costTemp ) + ( double ) m_pcRdCost->getCost( bitsTemp ) );
@@ -6560,9 +6225,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
 {
   const UnitArea& currArea = partitioner.currArea();
   const SPS &sps           = *cs.sps;
-#if JVET_N0671_RDCOST_FIX
   m_pcRdCost->setChromaFormat(sps.getChromaFormatIdc());
-#endif
 
   const uint32_t numValidComp  = getNumberValidComponents( sps.getChromaFormatIdc() );
   const uint32_t numTBlocks    = getNumberValidTBlocks   ( *cs.pcv );
@@ -6603,11 +6266,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
     tu.checkTuNoResidual( partitioner.currPartIdx() );
 
     const Slice           &slice = *cs.slice;
-#if JVET_N0805_APS_LMCS
     if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && slice.getLmcsChromaResidualScaleFlag())
-#else
-    if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && slice.getReshapeInfo().getSliceReshapeChromaAdj())
-#endif
     {
       const CompArea      &areaY = tu.blocks[COMPONENT_Y];
       PelBuf              piPredY = cs.getPredBuf(areaY);
@@ -6738,11 +6397,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
 #if RDOQ_CHROMA_LAMBDA
           m_pcTrQuant->selectLambda(compID);
 #endif
-#if JVET_N0805_APS_LMCS
           if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && isChroma(compID) && slice.getLmcsChromaResidualScaleFlag())
-#else
-          if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj())
-#endif
           {
             double cRescale = round((double)(1 << CSCALE_FP_PREC) / (double)(tu.getChromaAdj()));
             m_pcTrQuant->setLambda(m_pcTrQuant->getLambda() / (cRescale*cRescale));
@@ -6760,11 +6415,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
             PelBuf resiBuf = csFull->getResiBuf( compArea );
             crossComponentPrediction( tu, compID, lumaResi, resiBuf, resiBuf, false );
           }
-#if JVET_N0805_APS_LMCS
           if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && isChroma(compID) && slice.getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4)
-#else
-          if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() && tu.blocks[compID].width*tu.blocks[compID].height > 4 )
-#endif
           {
             PelBuf resiBuf = csFull->getResiBuf(compArea);
             resiBuf.scaleSignal(tu.getChromaAdj(), 1, tu.cu->cs->slice->clpRng(compID));
@@ -6849,11 +6500,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
             CPelBuf orgResiBuf = csFull->getOrgResiBuf(compArea);
 
             m_pcTrQuant->invTransformNxN(tu, compID, resiBuf, cQP);
-#if JVET_N0805_APS_LMCS
             if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && isChroma(compID) && slice.getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4)
-#else
-            if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() && tu.blocks[compID].width*tu.blocks[compID].height > 4 )
-#endif
             {
               resiBuf.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID));
             }
@@ -6920,11 +6567,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
               }
             }
 
-#if JVET_N0054_JOINT_CHROMA
             if( !isLastMode || (compID != COMPONENT_Y && !tu.noResidual) )
-#else
-            if( !isLastMode )
-#endif
             {
               bestTU.copyComponentFrom( tu, compID );
               saveCS.getResiBuf( compArea ).copyFrom( csFull->getResiBuf( compArea ) );
@@ -6947,7 +6590,6 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
       }
     } // component loop
 
-#if JVET_N0054_JOINT_CHROMA
     if ( chroma && tu.blocks[COMPONENT_Cb].valid() )
     {
       const CompArea& cbArea = tu.blocks[COMPONENT_Cb];
@@ -6989,11 +6631,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
         PelBuf crResi = csFull->getResiBuf( crArea );
 
         cbResi.subtractAndHalve( crResi );
-#if JVET_N0805_APS_LMCS
         bool reshape = slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && slice.getLmcsChromaResidualScaleFlag() && tu.blocks[COMPONENT_Cb].width*tu.blocks[COMPONENT_Cb].height > 4;
-#else
-        bool reshape = slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && slice.getReshapeInfo().getSliceReshapeChromaAdj() && tu.blocks[COMPONENT_Cb].width*tu.blocks[COMPONENT_Cb].height > 4 ;
-#endif
 
         if ( reshape )
         {
@@ -7057,7 +6695,6 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
         }
       }
     }
-#endif // JVET_N0054_JOINT_CHROMA
 
     m_CABACEstimator->getCtx() = ctxStart;
     m_CABACEstimator->resetBits();
@@ -7217,9 +6854,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
   , const bool luma, const bool chroma
 )
 {
-#if JVET_N0671_RDCOST_FIX
   m_pcRdCost->setChromaFormat(cs.sps->getChromaFormatIdc());
-#endif
 
   CodingUnit &cu = *cs.getCU( partitioner.chType );
 
@@ -7236,11 +6871,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
     cs.getResiBuf().fill(0);
     {
       cs.getRecoBuf().copyFrom(cs.getPredBuf() );
-#if JVET_N0805_APS_LMCS
       if (m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) && !cu.firstPU->mhIntraFlag && !CU::isIBC(cu))
-#else
-      if (m_pcEncCfg->getReshaper() && (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag()) && !cu.firstPU->mhIntraFlag && !CU::isIBC(cu))
-#endif
       {
         cs.getRecoBuf().Y().rspSignal(m_pcReshape->getFwdLUT());
       }
@@ -7262,11 +6893,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
       CPelBuf org  = cs.getOrgBuf  (compID);
 #if WCG_EXT
       if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (
-#if JVET_N0805_APS_LMCS
         m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) )
-#else
-        m_pcEncCfg->getReshaper() && (cs.slice->getReshapeInfo().getUseSliceReshaper()&& m_pcReshape->getCTUFlag())) )
-#endif
       {
         const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] );
         if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()))
@@ -7302,27 +6929,20 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
     }
     else
     {
-#if JVET_N0324_REGULAR_MRG_FLAG
       if (pu.regularMergeFlag)
       {
         m_CABACEstimator->merge_idx(pu);
       }
       else
       {
-#endif
         m_CABACEstimator->subblock_merge_flag( cu );
-#if !JVET_N0324_REGULAR_MRG_FLAG
-        m_CABACEstimator->triangle_mode ( cu );
-#endif
         if (cu.mmvdSkip)
         {
           m_CABACEstimator->mmvd_merge_idx(pu);
         }
         else
           m_CABACEstimator->merge_idx     ( pu );
-#if JVET_N0324_REGULAR_MRG_FLAG
       }
-#endif
     }
 
     cs.dist     = distortion;
@@ -7336,11 +6956,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
   if (luma)
   {
     cs.getResiBuf().bufs[0].copyFrom(cs.getOrgBuf().bufs[0]);
-#if JVET_N0805_APS_LMCS
     if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-    if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
     {
       const CompArea &areaY = cu.Y();
       CompArea      tmpArea(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size());
@@ -7442,11 +7058,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
 
   if (luma)
   {
-#if JVET_N0805_APS_LMCS
     if (cu.rootCbf && cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-    if (cu.rootCbf && cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
     {
       const CompArea &areaY = cu.Y();
       CompArea      tmpArea(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size());
@@ -7461,11 +7073,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
     else
     {
       cs.getRecoBuf().bufs[0].reconstruct(cs.getPredBuf().bufs[0], cs.getResiBuf().bufs[0], cs.slice->clpRngs().comp[0]);
-#if JVET_N0805_APS_LMCS
       if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && !cu.firstPU->mhIntraFlag && !CU::isIBC(cu))
-#else
-      if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && !cu.firstPU->mhIntraFlag && !CU::isIBC(cu))
-#endif
       {
         cs.getRecoBuf().bufs[0].rspSignal(m_pcReshape->getFwdLUT());
       }
@@ -7492,11 +7100,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
 
 #if WCG_EXT
     if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (
-#if JVET_N0805_APS_LMCS
       m_pcEncCfg->getReshaper() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())))
-#else
-      m_pcEncCfg->getReshaper() && (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() ) ) )
-#endif
     {
       const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] );
       if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()) )
@@ -7542,27 +7146,20 @@ uint64_t InterSearch::xGetSymbolFracBitsInter(CodingStructure &cs, Partitioner &
     }
 
     m_CABACEstimator->cu_skip_flag  ( cu );
-#if JVET_N0324_REGULAR_MRG_FLAG
     if (cu.firstPU->regularMergeFlag)
     {
       m_CABACEstimator->merge_idx(*cu.firstPU);
     }
     else
     {
-#endif
       m_CABACEstimator->subblock_merge_flag( cu );
-#if !JVET_N0324_REGULAR_MRG_FLAG
-      m_CABACEstimator->triangle_mode ( cu );
-#endif
       if (cu.mmvdSkip)
       {
         m_CABACEstimator->mmvd_merge_idx(*cu.firstPU);
       }
       else
         m_CABACEstimator->merge_idx     ( *cu.firstPU );
-#if JVET_N0324_REGULAR_MRG_FLAG
     }
-#endif
     fracBits   += m_CABACEstimator->getEstFracBits();
   }
   else
@@ -7758,12 +7355,8 @@ void InterSearch::symmvdCheckBestMvp(
         bufTmp.Y().addAvg(predBufA.Y(), predBufB.Y(), pu.cu->slice->clpRng(COMPONENT_Y));
 
       // calc distortion
-#if JVET_N0329_IBC_SEARCH_IMP
       DFunc distFunc = (!pu.cu->transQuantBypass && !pu.cu->slice->getDisableSATDForRD()) ? DF_HAD : DF_SAD;
       Distortion cost = m_pcRdCost->getDistPart(bufTmp.Y(), origBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, distFunc);
-#else
-      Distortion cost = m_pcRdCost->getDistPart(bufTmp.Y(), origBuf.Y(), pu.cs->sps->getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, DF_HAD);
-#endif
 
       Mv pred = amvpCur.mvCand[i];
       pred.changeTransPrecInternal2Amvr(pu.cu->imv);
@@ -7786,7 +7379,6 @@ void InterSearch::symmvdCheckBestMvp(
   }
 }
 
-#if JVET_N0327_MERGE_BIT_CALC_FIX
 uint64_t InterSearch::xCalcPuMeBits(PredictionUnit& pu)
 {
   assert(pu.mergeFlag);
@@ -7800,34 +7392,14 @@ uint64_t InterSearch::xCalcPuMeBits(PredictionUnit& pu)
       m_CABACEstimator->merge_idx(pu);
       return m_CABACEstimator->getEstFracBits();
     }
-#if JVET_N0324_REGULAR_MRG_FLAG
     if (pu.regularMergeFlag)
     {
       m_CABACEstimator->merge_idx(pu);
     }
     else
     {
-#endif
       m_CABACEstimator->subblock_merge_flag(*pu.cu);
       m_CABACEstimator->MHIntra_flag(pu);
-#if !JVET_N0302_SIMPLFIED_CIIP
-      if (pu.mhIntraFlag)
-      {
-        m_CABACEstimator->MHIntra_luma_pred_modes(*pu.cu);
-      }
-#if JVET_N0324_REGULAR_MRG_FLAG
-      else
-      {
-        if (!pu.cu->affine && !pu.mmvdMergeFlag && !pu.cu->mmvdSkip)
-        {
-          CHECK(!pu.cu->triangle, "triangle_flag must be true");
-        }
-      }
-#else
-      triangle_mode(*pu.cu);
-#endif
-#else
-#if JVET_N0324_REGULAR_MRG_FLAG
       if (!pu.mhIntraFlag)
       {
         if (!pu.cu->affine && !pu.mmvdMergeFlag && !pu.cu->mmvdSkip)
@@ -7835,20 +7407,13 @@ uint64_t InterSearch::xCalcPuMeBits(PredictionUnit& pu)
           CHECK(!pu.cu->triangle, "triangle_flag must be true");
         }
       }
-#else
-      triangle_mode(*pu.cu);
-#endif
-#endif
       if (pu.mmvdMergeFlag)
       {
         m_CABACEstimator->mmvd_merge_idx(pu);
       }
       else
         m_CABACEstimator->merge_idx(pu);
-#if JVET_N0324_REGULAR_MRG_FLAG
     }
-#endif
   }
   return m_CABACEstimator->getEstFracBits();
 }
-#endif
diff --git a/source/Lib/EncoderLib/InterSearch.h b/source/Lib/EncoderLib/InterSearch.h
index b414ce91d..fa1541039 100644
--- a/source/Lib/EncoderLib/InterSearch.h
+++ b/source/Lib/EncoderLib/InterSearch.h
@@ -118,9 +118,7 @@ private:
   int             m_affMVListMaxSize;
   Distortion      m_hevcCost;
   EncAffineMotion m_affineMotion;
-#if JVET_N0329_IBC_SEARCH_IMP
   PatentBvCand    m_defaultCachedBvs;
-#endif
 protected:
   // interface to option
   EncCfg*         m_pcEncCfg;
@@ -143,10 +141,8 @@ protected:
   RefPicList      m_currRefPicList;
   int             m_currRefPicIndex;
   bool            m_skipFracME;
-#if JVET_N0247_HASH_IMPROVE
   int             m_numHashMVStoreds[NUM_REF_PIC_LIST_01][MAX_NUM_REF];
   Mv              m_hashMVStoreds[NUM_REF_PIC_LIST_01][MAX_NUM_REF][5];
-#endif
 
   // Misc.
   Pel            *m_pTempPel;
@@ -158,13 +154,8 @@ protected:
 
   bool            m_isInitialized;
 
-#if JVET_N0329_IBC_SEARCH_IMP
   Mv              m_acBVs[2 * IBC_NUM_CANDIDATES];
   unsigned int    m_numBVs;
-#else
-  unsigned int    m_numBVs, m_numBV16s;
-  Mv              m_acBVs[IBC_NUM_CANDIDATES];
-#endif
   bool            m_useCompositeRef;
   Distortion      m_estMinDistSbt[NUMBER_SBT_MODE + 1]; // estimated minimum SSE value of the PU if using a SBT mode
   uint8_t         m_sbtRdoOrder[NUMBER_SBT_MODE];       // order of SBT mode in RDO
@@ -294,7 +285,6 @@ public:
   bool  predIBCSearch           ( CodingUnit& cu, Partitioner& partitioner, const int localSearchRangeX, const int localSearchRangeY, IbcHashMap& ibcHashMap);
   void  xIntraPatternSearch         ( PredictionUnit& pu, IntTZSearchStruct&  cStruct, Mv& rcMv, Distortion&  ruiCost, Mv* cMvSrchRngLT, Mv* cMvSrchRngRB, Mv* pcMvPred);
   void  xSetIntraSearchRange        ( PredictionUnit& pu, int iRoiWidth, int iRoiHeight, const int localSearchRangeX, const int localSearchRangeY, Mv& rcMvSrchRngLT, Mv& rcMvSrchRngRB);
-#if JVET_N0329_IBC_SEARCH_IMP
   void  resetIbcSearch()
   {
     for (int i = 0; i < IBC_NUM_CANDIDATES; i++)
@@ -303,21 +293,14 @@ public:
     }
     m_defaultCachedBvs.currCnt = 0;
   }
-#else
-  void  resetIbcSearch() { m_numBVs = m_numBV16s = 0; }
-#endif
   void  xIBCEstimation   ( PredictionUnit& pu, PelUnitBuf& origBuf, Mv     *pcMvPred, Mv     &rcMv, Distortion &ruiCost, const int localSearchRangeX, const int localSearchRangeY);
   void  xIBCSearchMVCandUpdate  ( Distortion  uiSad, int x, int y, Distortion* uiSadBestCand, Mv* cMVCand);
   int   xIBCSearchMVChromaRefine( PredictionUnit& pu, int iRoiWidth, int iRoiHeight, int cuPelX, int cuPelY, Distortion* uiSadBestCand, Mv*     cMVCand);
   void addToSortList(std::list<BlockHash>& listBlockHash, std::list<int>& listCost, int cost, const BlockHash& blockHash);
   bool predInterHashSearch(CodingUnit& cu, Partitioner& partitioner, bool& isPerfectMatch);
   bool xHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPicList, int& bestRefIndex, Mv& bestMv, Mv& bestMvd, int& bestMVPIndex, bool& isPerfectMatch);
-#if JVET_N0247_HASH_IMPROVE
   bool xRectHashInterEstimation(PredictionUnit& pu, RefPicList& bestRefPicList, int& bestRefIndex, Mv& bestMv, Mv& bestMvd, int& bestMVPIndex, bool& isPerfectMatch);
   void selectRectangleMatchesInter(const MapIterator& itBegin, int count, std::list<BlockHash>& listBlockHash, const BlockHash& currBlockHash, int width, int height, int idxNonSimple, unsigned int* &hashValues, int baseNum, int picWidth, int picHeight, bool isHorizontal, uint16_t* curHashPic);
-#else
-  int  xHashInterPredME(const PredictionUnit& pu, RefPicList currRefPicList, int currRefPicIndex, Mv bestMv[5]);
-#endif
   void selectMatchesInter(const MapIterator& itBegin, int count, std::list<BlockHash>& vecBlockHash, const BlockHash& currBlockHash);
 protected:
 
@@ -529,9 +512,7 @@ public:
     , const bool luma = true, const bool chroma = true
   );
   uint64_t xGetSymbolFracBitsInter  (CodingStructure &cs, Partitioner &partitioner);
-#if JVET_N0327_MERGE_BIT_CALC_FIX
   uint64_t xCalcPuMeBits            (PredictionUnit& pu);
-#endif
 
 };// END CLASS DEFINITION EncSearch
 
diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp
index 72720fc95..373027b68 100644
--- a/source/Lib/EncoderLib/IntraSearch.cpp
+++ b/source/Lib/EncoderLib/IntraSearch.cpp
@@ -266,11 +266,7 @@ void IntraSearch::init( EncCfg*        pcEncCfg,
 // INTRA PREDICTION
 //////////////////////////////////////////////////////////////////////////
 
-#if JVET_N0193_LFNST
 bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, const double bestCostSoFar, bool mtsCheckRangeFlag, int mtsFirstCheckId, int mtsLastCheckId, bool moreProbMTSIdxFirst )
-#else
-void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, const double bestCostSoFar )
-#endif
 {
   CodingStructure       &cs            = *cu.cs;
   const SPS             &sps           = *cs.sps;
@@ -284,24 +280,16 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
   //===== loop over partitions =====
 
   const TempCtx ctxStart          ( m_CtxCache, m_CABACEstimator->getCtx() );
-#if JVET_N0217_MATRIX_INTRAPRED
   const TempCtx ctxStartMipFlag    ( m_CtxCache, SubCtx( Ctx::MipFlag,          m_CABACEstimator->getCtx() ) );
   const TempCtx ctxStartMipMode    ( m_CtxCache, SubCtx( Ctx::MipMode,          m_CABACEstimator->getCtx() ) );
-#endif
   const TempCtx ctxStartIspMode    ( m_CtxCache, SubCtx( Ctx::ISPMode,          m_CABACEstimator->getCtx() ) );
-#if JVET_N0185_UNIFIED_MPM
   const TempCtx ctxStartPlanarFlag ( m_CtxCache, SubCtx( Ctx::IntraLumaPlanarFlag, m_CABACEstimator->getCtx() ) );
-#endif
   const TempCtx ctxStartIntraMode(m_CtxCache, SubCtx(Ctx::IntraLumaMpmFlag, m_CABACEstimator->getCtx()));
-#if !JVET_N0302_SIMPLFIED_CIIP
-  const TempCtx ctxStartMHIntraMode ( m_CtxCache, SubCtx( Ctx::MHIntraPredMode,        m_CABACEstimator->getCtx() ) );
-#endif
   const TempCtx ctxStartMrlIdx      ( m_CtxCache, SubCtx( Ctx::MultiRefLineIdx,        m_CABACEstimator->getCtx() ) );
 
   CHECK( !cu.firstPU, "CU has no PUs" );
   const bool keepResi   = cs.pps->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() || KEEP_PRED_AND_RESI_SIGNALS;
 
-#if JVET_N0193_LFNST
   // variables for saving fast intra modes scan results across multiple LFNST passes
   bool LFNSTLoadFlag = sps.getUseLFNST() && cu.lfnstIdx != 0;
   bool LFNSTSaveFlag = sps.getUseLFNST() && cu.lfnstIdx == 0;
@@ -309,13 +297,8 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
   LFNSTSaveFlag &= sps.getUseIntraMTS() ? cu.mtsFlag == 0 : true;
 
   const uint32_t lfnstIdx = cu.lfnstIdx;
-#endif
 
-#if !JVET_N0217_MATRIX_INTRAPRED
-  uint32_t extraModes = 0; // add two extra modes, which would be used after uiMode <= DC_IDX is removed for cu.nsstIdx == 3
-#endif
 
-#if JVET_N0193_LFNST
   const int width  = partitioner.currArea().lwidth();
   const int height = partitioner.currArea().lheight();
 
@@ -334,21 +317,10 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
   {
     mtsUsageFlag = 0;
   }
-#endif
-#if JVET_N0193_LFNST
 #if INCLUDE_ISP_CFG_FLAG
   int nOptionsForISP = ( sps.getUseISP() && cu.mtsFlag == 0 && cu.lfnstIdx == 0 ) ? NUM_INTRA_SUBPARTITIONS_MODES : 1;
 #else
   int nOptionsForISP = ( cu.mtsFlag == 0 && cu.lfnstIdx == 0 ) ? NUM_INTRA_SUBPARTITIONS_MODES : 1;
-#endif
-#else
-  const int width   = partitioner.currArea().lwidth();
-  const int height  = partitioner.currArea().lheight();
-#if INCLUDE_ISP_CFG_FLAG
-  int nOptionsForISP = sps.getUseISP() ? NUM_INTRA_SUBPARTITIONS_MODES : 1;
-#else
-  int nOptionsForISP = NUM_INTRA_SUBPARTITIONS_MODES;
-#endif
 #endif
   double bestCurrentCost = bestCostSoFar;
 
@@ -403,55 +375,28 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
     m_intraModeTestedNormalIntra.clear();
   }
 
-#if JVET_N0413_RDPCM
-#if JVET_N0193_LFNST
   const bool testBDPCM = m_pcEncCfg->getRDPCM() && CU::bdpcmAllowed( cu, ComponentID( partitioner.chType ) ) && cu.mtsFlag == 0 && cu.lfnstIdx == 0;
-#else
-  const bool testBDPCM = m_pcEncCfg->getRDPCM() && CU::bdpcmAllowed(cu, ComponentID(partitioner.chType));
-#endif
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
   static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiHadModeList;
-#else
-  static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM> uiHadModeList;
-#endif
   static_vector<double, FAST_UDI_MAX_RDMODE_NUM> CandCostList;
   static_vector<double, FAST_UDI_MAX_RDMODE_NUM> CandHadList;
 
-#if !JVET_N0217_MATRIX_INTRAPRED
-  static_vector<int, FAST_UDI_MAX_RDMODE_NUM> extendRefList;
-  static_vector<int, FAST_UDI_MAX_RDMODE_NUM>* nullList = NULL;
-#endif
 
   auto &pu = *cu.firstPU;
-#if JVET_N0193_LFNST
   bool validReturn = false;
-#endif
   {
     CandHadList.clear();
     CandCostList.clear();
     uiHadModeList.clear();
-#if !JVET_N0217_MATRIX_INTRAPRED
-    extendRefList.clear();
-#endif
 
     CHECK(pu.cu != &cu, "PU is not contained in the CU");
 
     //===== determine set of modes to be tested (using prediction signal only) =====
     int numModesAvailable = NUM_LUMA_MODE; // total number of Intra modes
-#if JVET_N0217_MATRIX_INTRAPRED
     const bool fastMip    = sps.getUseMIP() && m_pcEncCfg->getUseFastMIP();
-#if JVET_N0193_LFNST
     const bool mipAllowed = sps.getUseMIP() && ( cu.lfnstIdx == 0 ) && isLuma( partitioner.chType ) && pu.lwidth() <= MIP_MAX_WIDTH && pu.lheight() <= MIP_MAX_HEIGHT;
-#else
-    const bool mipAllowed = sps.getUseMIP() && isLuma( partitioner.chType ) && pu.lwidth() <= MIP_MAX_WIDTH && pu.lheight() <= MIP_MAX_HEIGHT;
-#endif
     const bool testMip    = mipAllowed && mipModesAvailable( pu.Y() ) && !(fastMip && (cu.lwidth() > 2 * cu.lheight() || cu.lheight() > 2 * cu.lwidth()));
 
     static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiRdModeList;
-#else
-    static_vector< uint32_t, FAST_UDI_MAX_RDMODE_NUM > uiRdModeList;
-#endif
 
     int numModesForFullRD = 3;
     numModesForFullRD = g_aucIntraModeNumFast_UseMPM_2D[uiWidthBit - MIN_CU_LOG2][uiHeightBit - MIN_CU_LOG2];
@@ -460,9 +405,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
     numModesForFullRD = numModesAvailable;
 #endif
 
-#if JVET_N0193_LFNST
     if( mtsUsageFlag != 2 )
-#endif
     {
       // this should always be true
       CHECK( !pu.Y().valid(), "PU is not valid" );
@@ -472,10 +415,6 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
 #endif
       pu.multiRefIdx = 0;
 
-#if !JVET_N0217_MATRIX_INTRAPRED
-      //===== init pattern for luma prediction =====
-      initIntraPatternChType( cu, pu.Y(), true);
-#endif
       if( numModesForFullRD != numModesAvailable )
       {
         CHECK( numModesForFullRD >= numModesAvailable, "Too many modes for full RD search" );
@@ -485,49 +424,26 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
         PelBuf piOrg         = cs.getOrgBuf(area);
         PelBuf piPred        = cs.getPredBuf(area);
 
-#if JVET_N0363_INTRA_COST_MOD
         DistParam distParamSad;
         DistParam distParamHad;
-#else
-        DistParam distParam;
-
-        const bool bUseHadamard = cu.transQuantBypass == 0;
-#endif
-#if JVET_N0805_APS_LMCS
         if (cu.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
-#else
-        if (cu.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag())
-#endif
         {
           CompArea      tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
           PelBuf tmpOrg = m_tmpStorageLCU.getBuf(tmpArea);
           tmpOrg.copyFrom(piOrg);
           tmpOrg.rspSignal(m_pcReshape->getFwdLUT());
-#if JVET_N0363_INTRA_COST_MOD
           m_pcRdCost->setDistParam(distParamSad, tmpOrg, piPred, sps.getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, false); // Use SAD cost
           m_pcRdCost->setDistParam(distParamHad, tmpOrg, piPred, sps.getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y,  true); // Use HAD (SATD) cost
-#else
-          m_pcRdCost->setDistParam(distParam, tmpOrg, piPred, sps.getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, bUseHadamard);
-#endif
         }
         else
-#if JVET_N0363_INTRA_COST_MOD
         {
           m_pcRdCost->setDistParam(distParamSad, piOrg, piPred, sps.getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, false); // Use SAD cost
           m_pcRdCost->setDistParam(distParamHad, piOrg, piPred, sps.getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y,  true); // Use HAD (SATD) cost
         }
-#else
-        m_pcRdCost->setDistParam(distParam, piOrg, piPred, sps.getBitDepth(CHANNEL_TYPE_LUMA), COMPONENT_Y, bUseHadamard);
-#endif
 
-#if JVET_N0363_INTRA_COST_MOD
         distParamSad.applyWeight = false;
         distParamHad.applyWeight = false;
-#else
-        distParam.applyWeight = false;
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
         if( testMip)
         {
           numModesForFullRD += fastMip? std::max(2, g_aucLog2[std::min(pu.lwidth(), pu.lheight())] - 1) : numModesForFullRD;
@@ -539,22 +455,15 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
 
         //===== init pattern for luma prediction =====
         initIntraPatternChType(cu, pu.Y(), true);
-#endif
         bool bSatdChecked[NUM_INTRA_MODE];
         memset( bSatdChecked, 0, sizeof( bSatdChecked ) );
 
-#if JVET_N0193_LFNST
         if( !LFNSTLoadFlag )
-#endif
         {
           for( int modeIdx = 0; modeIdx < numModesAvailable; modeIdx++ )
           {
             uint32_t       uiMode = modeIdx;
-#if JVET_N0363_INTRA_COST_MOD
             Distortion minSadHad = 0;
-#else
-            Distortion uiSad  = 0;
-#endif
 
             // Skip checking extended Angular modes in the first round of SATD
             if( uiMode > DC_IDX && ( uiMode & 1 ) )
@@ -575,64 +484,26 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
             {
               predIntraAng( COMPONENT_Y, piPred, pu);
             }
-#if JVET_N0363_INTRA_COST_MOD
             // Use the min between SAD and HAD as the cost criterion
             // SAD is scaled by 2 to align with the scaling of HAD
             minSadHad += std::min(distParamSad.distFunc(distParamSad)*2, distParamHad.distFunc(distParamHad));
-#else
-            // use Hadamard transform here
-            uiSad += distParam.distFunc(distParam);
-#endif
 
             // NB xFracModeBitsIntra will not affect the mode for chroma that may have already been pre-estimated.
-#if JVET_N0217_MATRIX_INTRAPRED
             m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
-#endif
             m_CABACEstimator->getCtx() = SubCtx( Ctx::ISPMode, ctxStartIspMode );
-#if JVET_N0185_UNIFIED_MPM
             m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
-#endif
             m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
-#if !JVET_N0302_SIMPLFIED_CIIP
-            m_CABACEstimator->getCtx() = SubCtx( Ctx::MHIntraPredMode, ctxStartMHIntraMode );
-#endif
             m_CABACEstimator->getCtx() = SubCtx( Ctx::MultiRefLineIdx, ctxStartMrlIdx );
 
             uint64_t fracModeBits = xFracModeBitsIntra(pu, uiMode, CHANNEL_TYPE_LUMA);
 
-#if JVET_N0363_INTRA_COST_MOD
             double cost = ( double ) minSadHad + (double)fracModeBits * sqrtLambdaForFirstPass;
 
             DTRACE(g_trace_ctx, D_INTRA_COST, "IntraHAD: %u, %llu, %f (%d)\n", minSadHad, fracModeBits, cost, uiMode);
-#else
-            double cost = ( double ) uiSad + ( double ) fracModeBits * sqrtLambdaForFirstPass;
-
-            DTRACE( g_trace_ctx, D_INTRA_COST, "IntraHAD: %u, %llu, %f (%d)\n", uiSad, fracModeBits, cost, uiMode );
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
             updateCandList( ModeInfo(false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), cost,          uiRdModeList,  CandCostList, numModesForFullRD );
-#if JVET_N0363_INTRA_COST_MOD
             updateCandList( ModeInfo(false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), (double)minSadHad, uiHadModeList, CandHadList,  numHadCand );
-#else
-            updateCandList( ModeInfo(false, 0, NOT_INTRA_SUBPARTITIONS, uiMode), (double)uiSad, uiHadModeList, CandHadList,  numHadCand );
-#endif
-#else
-            updateCandList( uiMode, cost,  uiRdModeList, CandCostList
-              , extendRefList, 0
-              , numModesForFullRD + extraModes );
-#if JVET_N0363_INTRA_COST_MOD
-            updateCandList(uiMode, (double) minSadHad, uiHadModeList, CandHadList
-              , *nullList, -1
-              , 3 + extraModes);
-#else
-            updateCandList(uiMode, (double) uiSad, uiHadModeList, CandHadList
-              , *nullList, -1
-              , 3 + extraModes);
-#endif
-#endif
           }
-#if JVET_N0193_LFNST
           if( LFNSTSaveFlag )
           {
             // save found best modes
@@ -642,14 +513,9 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
             // PBINTRA fast
             m_uiSavedHadModeListLFNST  = uiHadModeList;
             m_dSavedHadListLFNST       = CandHadList;
-#if !JVET_N0217_MATRIX_INTRAPRED
-            m_iSavedExtendRefListLFNST = extendRefList;
-#endif
             LFNSTSaveFlag              = false;
           }
-#endif
         } // NSSTFlag
-#if JVET_N0193_LFNST
         else
         {
           // restore saved modes
@@ -659,34 +525,17 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
           // PBINTRA fast
           uiHadModeList     = m_uiSavedHadModeListLFNST;
           CandHadList       = m_dSavedHadListLFNST;
-#if !JVET_N0217_MATRIX_INTRAPRED
-          extendRefList     = m_iSavedExtendRefListLFNST;
-#endif
 
           LFNSTLoadFlag     = false;
         } // !LFNSTFlag
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
         CHECK( uiRdModeList.size() != numModesForFullRD, "Error: RD mode list size" );
         static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> parentCandList = uiRdModeList;
-#else
-        // forget the extra modes
-        uiRdModeList.resize( numModesForFullRD );
-        CandCostList.resize(numModesForFullRD);
-        extendRefList.resize(numModesForFullRD);
-        static_vector<unsigned, FAST_UDI_MAX_RDMODE_NUM> parentCandList(FAST_UDI_MAX_RDMODE_NUM);
-        std::copy_n(uiRdModeList.begin(), numModesForFullRD, parentCandList.begin());
-#endif
 
         // Second round of SATD for extended Angular modes
         for (int modeIdx = 0; modeIdx < numModesForFullRD; modeIdx++)
         {
-#if JVET_N0217_MATRIX_INTRAPRED
           unsigned parentMode = parentCandList[modeIdx].modeId;
-#else
-          unsigned parentMode = parentCandList[modeIdx];
-#endif
           if (parentMode > (DC_IDX + 1) && parentMode < (NUM_LUMA_MODE - 1))
           {
             for (int subModeIdx = -1; subModeIdx <= 1; subModeIdx += 2)
@@ -708,59 +557,23 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
                   predIntraAng(COMPONENT_Y, piPred, pu );
                 }
 
-#if JVET_N0363_INTRA_COST_MOD
                 // Use the min between SAD and SATD as the cost criterion
                 // SAD is scaled by 2 to align with the scaling of HAD
                 Distortion minSadHad = std::min(distParamSad.distFunc(distParamSad)*2, distParamHad.distFunc(distParamHad));
-#else
-                // use Hadamard transform here
-                Distortion sad = distParam.distFunc(distParam);
-#endif
 
                 // NB xFracModeBitsIntra will not affect the mode for chroma that may have already been pre-estimated.
-#if JVET_N0217_MATRIX_INTRAPRED
                 m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
-#endif
                 m_CABACEstimator->getCtx() = SubCtx( Ctx::ISPMode, ctxStartIspMode );
-#if JVET_N0185_UNIFIED_MPM
                 m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
-#endif
                 m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
-#if !JVET_N0302_SIMPLFIED_CIIP
-                m_CABACEstimator->getCtx() = SubCtx( Ctx::MHIntraPredMode, ctxStartMHIntraMode );
-#endif
                 m_CABACEstimator->getCtx() = SubCtx( Ctx::MultiRefLineIdx, ctxStartMrlIdx );
 
                 uint64_t fracModeBits = xFracModeBitsIntra(pu, mode, CHANNEL_TYPE_LUMA);
 
-#if JVET_N0363_INTRA_COST_MOD
                 double cost = (double) minSadHad + (double) fracModeBits * sqrtLambdaForFirstPass;
-#else
-                double cost = (double) sad + (double) fracModeBits * sqrtLambdaForFirstPass;
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
                 updateCandList( ModeInfo( false, 0, NOT_INTRA_SUBPARTITIONS, mode ), cost,        uiRdModeList,  CandCostList, numModesForFullRD );
-#if JVET_N0363_INTRA_COST_MOD
                 updateCandList( ModeInfo( false, 0, NOT_INTRA_SUBPARTITIONS, mode ), (double)minSadHad, uiHadModeList, CandHadList,  numHadCand );
-#else
-                updateCandList( ModeInfo( false, 0, NOT_INTRA_SUBPARTITIONS, mode ), (double)sad, uiHadModeList, CandHadList,  numHadCand );
-#endif
-#else
-                updateCandList(mode, cost, uiRdModeList, CandCostList
-                  , extendRefList, 0
-                  , numModesForFullRD);
-#if JVET_N0363_INTRA_COST_MOD
-
-                updateCandList(mode, (double)minSadHad, uiHadModeList, CandHadList
-                  , *nullList, -1
-                  , 3);
-#else
-                updateCandList(mode, (double)sad, uiHadModeList, CandHadList
-                  , *nullList, -1
-                  , 3);
-#endif
-#endif
 
                 bSatdChecked[mode] = true;
               }
@@ -770,12 +583,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
         if( nOptionsForISP > 1 )
         {
           //we save the list with no mrl modes to keep only the Hadamard selected modes (no mpms)
-#if JVET_N0217_MATRIX_INTRAPRED
           m_rdModeListWithoutMrl = uiRdModeList;
-#else
-          m_rdModeListWithoutMrl.resize( numModesForFullRD );
-          std::copy_n( uiRdModeList.begin(), numModesForFullRD, m_rdModeListWithoutMrl.begin() );
-#endif
         }
 #if ENABLE_JVET_L0283_MRL
         pu.multiRefIdx = 1;
@@ -790,11 +598,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
           {
             initIntraPatternChType(cu, pu.Y(), true);
           }
-#if JVET_N0185_UNIFIED_MPM
           for (int x = 1; x < numMPMs; x++)
-#else
-          for (int x = 0; x < numMPMs; x++)
-#endif
           {
             uint32_t mode = multiRefMPM[x];
             {
@@ -810,56 +614,26 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
                 predIntraAng(COMPONENT_Y, piPred, pu);
               }
 
-#if JVET_N0363_INTRA_COST_MOD
               // Use the min between SAD and SATD as the cost criterion
               // SAD is scaled by 2 to align with the scaling of HAD
               Distortion minSadHad = std::min(distParamSad.distFunc(distParamSad)*2, distParamHad.distFunc(distParamHad));
-#else
-              // use Hadamard transform here
-              Distortion sad = distParam.distFunc(distParam);
-#endif
 
               // NB xFracModeBitsIntra will not affect the mode for chroma that may have already been pre-estimated.
-#if JVET_N0217_MATRIX_INTRAPRED
               m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
-#endif
               m_CABACEstimator->getCtx() = SubCtx( Ctx::ISPMode, ctxStartIspMode );
-#if JVET_N0185_UNIFIED_MPM
               m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
-#endif
               m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
-#if !JVET_N0302_SIMPLFIED_CIIP
-              m_CABACEstimator->getCtx() = SubCtx( Ctx::MHIntraPredMode, ctxStartMHIntraMode );
-#endif
               m_CABACEstimator->getCtx() = SubCtx( Ctx::MultiRefLineIdx, ctxStartMrlIdx );
 
               uint64_t fracModeBits = xFracModeBitsIntra(pu, mode, CHANNEL_TYPE_LUMA);
 
-#if JVET_N0363_INTRA_COST_MOD
               double cost = (double)minSadHad + (double)fracModeBits * sqrtLambdaForFirstPass;
-#else
-              double cost = (double)sad + (double)fracModeBits * sqrtLambdaForFirstPass;
-#endif
-#if JVET_N0217_MATRIX_INTRAPRED
               updateCandList( ModeInfo( false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode ), cost,        uiRdModeList,  CandCostList, numModesForFullRD );
-#if JVET_N0363_INTRA_COST_MOD
               updateCandList( ModeInfo( false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode ), (double)minSadHad, uiHadModeList, CandHadList,  numHadCand );
-#else
-              updateCandList( ModeInfo( false, multiRefIdx, NOT_INTRA_SUBPARTITIONS, mode ), (double)sad, uiHadModeList, CandHadList,  numHadCand );
-#endif
-#else
-              updateCandList(mode, cost, uiRdModeList, CandCostList, extendRefList, multiRefIdx, numModesForFullRD);
-#if JVET_N0363_INTRA_COST_MOD
-              updateCandList(mode, (double)minSadHad, uiHadModeList, CandHadList, *nullList, -1, 3);
-#else
-              updateCandList(mode, (double)sad, uiHadModeList, CandHadList, *nullList, -1, 3);
-#endif
-#endif
             }
           }
         }
 #endif
-#if JVET_N0217_MATRIX_INTRAPRED
         CHECKD( uiRdModeList.size() != numModesForFullRD, "Error: RD mode list size" );
 
           //*** Derive MIP candidates using Hadamard
@@ -875,40 +649,24 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
               pu.intraDir[CHANNEL_TYPE_LUMA] = uiMode;
               predIntraMip(COMPONENT_Y, piPred, pu);
 
-#if JVET_N0363_INTRA_COST_MOD
               // Use the min between SAD and HAD as the cost criterion
               // SAD is scaled by 2 to align with the scaling of HAD
               Distortion minSadHad = std::min(distParamSad.distFunc(distParamSad)*2, distParamHad.distFunc(distParamHad));
-#else
-              Distortion dist = distParam.distFunc(distParam);
-#endif
 
               m_CABACEstimator->getCtx() = SubCtx( Ctx::MipFlag, ctxStartMipFlag );
               m_CABACEstimator->getCtx() = SubCtx( Ctx::MipMode, ctxStartMipMode );
 
               uint64_t fracModeBits = xFracModeBitsIntra(pu, uiMode, CHANNEL_TYPE_LUMA);
 
-#if JVET_N0363_INTRA_COST_MOD
               double cost = double(minSadHad) + double(fracModeBits) * sqrtLambdaForFirstPass;
-#else
-              double cost = double(dist) + double(fracModeBits) * sqrtLambdaForFirstPass;
-#endif
 
               updateCandList(ModeInfo(true, 0, NOT_INTRA_SUBPARTITIONS, uiMode),        cost,  uiRdModeList,  CandCostList, numModesForFullRD);
-#if JVET_N0363_INTRA_COST_MOD
               updateCandList(ModeInfo(true, 0, NOT_INTRA_SUBPARTITIONS, uiMode), double(minSadHad), uiHadModeList, CandHadList, numHadCand);
-#else
-              updateCandList(ModeInfo(true, 0, NOT_INTRA_SUBPARTITIONS, uiMode), double(dist), uiHadModeList, CandHadList,  numHadCand);
-#endif
             }
 
             const double thresholdHadCost = 1.0 + 1.4 / sqrt((double)(pu.lwidth()*pu.lheight()));
             reduceHadCandList(uiRdModeList, CandCostList, numModesForFullRD, thresholdHadCost, 0.0);
           }
-#else
-        CandCostList.resize(numModesForFullRD);
-        extendRefList.resize(numModesForFullRD);
-#endif
 
         if( m_pcEncCfg->getFastUDIUseMPMEnabled() )
         {
@@ -922,31 +680,18 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
           for( int j = 0; j < numCand; j++ )
           {
             bool mostProbableModeIncluded = false;
-#if JVET_N0217_MATRIX_INTRAPRED
             ModeInfo mostProbableMode( false, 0, NOT_INTRA_SUBPARTITIONS, uiPreds[j] );
-#else
-            int  mostProbableMode         = uiPreds[j];
-#endif
 
 
             for( int i = 0; i < numModesForFullRD; i++ )
             {
-#if JVET_N0217_MATRIX_INTRAPRED
               mostProbableModeIncluded |= ( mostProbableMode == uiRdModeList[i] );
-#else
-              mostProbableModeIncluded |= (mostProbableMode == uiRdModeList[i] && extendRefList[i] == 0);
-#endif
             }
             if( !mostProbableModeIncluded )
             {
-#if !JVET_N0217_MATRIX_INTRAPRED
-              extendRefList.push_back(0);
-#endif
               numModesForFullRD++;
               uiRdModeList.push_back( mostProbableMode );
-#if JVET_N0217_MATRIX_INTRAPRED
               CandCostList.push_back(0);
-#endif
             }
           }
           if( nOptionsForISP > 1 )
@@ -954,16 +699,12 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
             //we add the ISP MPMs to the list without mrl modes
             m_rdModeListWithoutMrlHor = m_rdModeListWithoutMrl;
             m_rdModeListWithoutMrlVer = m_rdModeListWithoutMrl;
-#if JVET_N0217_MATRIX_INTRAPRED
             for (int k = 0; k < m_rdModeListWithoutMrl.size(); k++)
             {
               m_rdModeListWithoutMrlHor[k].ispMod = HOR_INTRA_SUBPARTITIONS;
               m_rdModeListWithoutMrlVer[k].ispMod = VER_INTRA_SUBPARTITIONS;
             }
             static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM>* listPointer;
-#else
-            static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM>* listPointer;
-#endif
             for( int k = 1; k < nOptionsForISP; k++ )
             {
               cu.ispMode = ispOptions[k];
@@ -972,11 +713,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
               for( int j = 0; j < numCandISP; j++ )
               {
                 bool mostProbableModeIncluded = false;
-#if JVET_N0217_MATRIX_INTRAPRED
                 ModeInfo mostProbableMode( false, 0, cu.ispMode, uiPreds[j] );
-#else
-                int  mostProbableMode = uiPreds[j];
-#endif
 
                 for( int i = 0; i < listPointer->size(); i++ )
                 {
@@ -991,7 +728,6 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
             cu.ispMode = NOT_INTRA_SUBPARTITIONS;
           }
         }
-#if JVET_N0217_MATRIX_INTRAPRED
         //*** Add MPMs for MIP to candidate list
         if (!fastMip && testMip && pu.lwidth() < 8 && pu.lheight() < 8)
         {
@@ -1014,32 +750,18 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
             }
           }
         }
-#endif
       }
       else
       {
-#if JVET_N0217_MATRIX_INTRAPRED
         THROW( "Full search not supported for MIP" );
-#else
-        for( int i = 0; i < numModesForFullRD; i++ )
-        {
-          uiRdModeList.push_back( i );
-        }
-#endif
       }
-#if JVET_N0193_LFNST
       if( sps.getUseLFNST() && mtsUsageFlag == 1 )
       {
         // Store the modes to be checked with RD
         m_savedNumRdModes[ lfnstIdx ]     = numModesForFullRD;
         std::copy_n( uiRdModeList.begin(),  numModesForFullRD, m_savedRdModeList[ lfnstIdx ] );
-#if !JVET_N0217_MATRIX_INTRAPRED
-        std::copy_n( extendRefList.begin(), numModesForFullRD, m_savedExtendRefList[ lfnstIdx ] );
-#endif
       }
-#endif
     }
-#if JVET_N0193_LFNST
     else //mtsUsage = 2 (here we potentially reduce the number of modes that will be full-RD checked)
     {
       if( m_pcEncCfg->getUseFastLFNST() || !cu.slice->isIntra() )
@@ -1054,9 +776,6 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
           if( m_modeCostStore[ lfnstIdx ][ i ] <= thresholdSkipMode * m_bestModeCostStore[ lfnstIdx ] )
           {
             uiRdModeList.push_back( m_savedRdModeList[ lfnstIdx ][ i ] );
-#if !JVET_N0217_MATRIX_INTRAPRED
-            extendRefList.push_back( m_savedExtendRefList[ lfnstIdx ][ i ] );
-#endif
             numModesForFullRD++;
           }
         }
@@ -1068,29 +787,16 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
         uiRdModeList.resize( numModesForFullRD );
         std::copy_n( m_savedRdModeList[ lfnstIdx ], m_savedNumRdModes[ lfnstIdx ], uiRdModeList.begin() );
         CandCostList.resize( numModesForFullRD );
-#if !JVET_N0217_MATRIX_INTRAPRED
-        extendRefList.resize( numModesForFullRD );
-        std::copy_n( m_savedExtendRefList[ lfnstIdx ], m_savedNumRdModes[ lfnstIdx ], extendRefList.begin() );
-#endif
       }
     }
-#endif
 
     if( nOptionsForISP > 1 ) // we remove the non-MPMs from the ISP lists
     {
-#if JVET_N0217_MATRIX_INTRAPRED
       static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiRdModeListCopyHor = m_rdModeListWithoutMrlHor;
       m_rdModeListWithoutMrlHor.clear();
       static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiRdModeListCopyVer = m_rdModeListWithoutMrlVer;
       m_rdModeListWithoutMrlVer.clear();
       static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> *listPointerCopy, *listPointer;
-#else
-      static_vector< uint32_t, FAST_UDI_MAX_RDMODE_NUM > uiRdModeListCopyHor = m_rdModeListWithoutMrlHor;
-      m_rdModeListWithoutMrlHor.clear();
-      static_vector< uint32_t, FAST_UDI_MAX_RDMODE_NUM > uiRdModeListCopyVer = m_rdModeListWithoutMrlVer;
-      m_rdModeListWithoutMrlVer.clear();
-      static_vector< uint32_t, FAST_UDI_MAX_RDMODE_NUM > *listPointerCopy, *listPointer;
-#endif
       for( int ispOptionIdx = 1; ispOptionIdx < nOptionsForISP; ispOptionIdx++ )
       {
         cu.ispMode = ispOptions[ispOptionIdx];
@@ -1109,11 +815,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
         {
           for( int q = 0; q < numMPMs; q++ )
           {
-#if JVET_N0217_MATRIX_INTRAPRED
             if (listPointerCopy->at(k) == ModeInfo( false, 0, cu.ispMode, uiPreds[q] ))
-#else
-            if( listPointerCopy->at( k ) == uiPreds[q] )
-#endif
             {
               listPointer->push_back( listPointerCopy->at( k ) );
               break;
@@ -1130,33 +832,14 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
     // after this point, don't use numModesForFullRD
 
     // PBINTRA fast
-#if JVET_N0193_LFNST
-#if JVET_N0329_IBC_SEARCH_IMP
     if( m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && uiRdModeList.size() < numModesAvailable && !cs.slice->getDisableSATDForRD() && ( mtsUsageFlag != 2 || lfnstIdx > 0 ) )
-#else
-    if( m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && uiRdModeList.size() < numModesAvailable && ( mtsUsageFlag != 2 || lfnstIdx > 0 ) )
-#endif
-#else
-#if JVET_N0329_IBC_SEARCH_IMP
-    if (m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && uiRdModeList.size() < numModesAvailable && !cs.slice->getDisableSATDForRD())
-#else
-    if( m_pcEncCfg->getUsePbIntraFast() && !cs.slice->isIntra() && uiRdModeList.size() < numModesAvailable )
-#endif
-#endif
     {
-#if JVET_N0217_MATRIX_INTRAPRED
-#if JVET_N0193_LFNST
       double pbintraRatio = (lfnstIdx > 0) ? 1.25 : PBINTRA_RATIO;
-#endif
       int maxSize = -1;
       const int numHadCand = (testMip ? 2 : 1) * 3;
       for (int k = numHadCand - 1; k >= 0; k--)
       {
-#if JVET_N0193_LFNST
         if (CandHadList.size() < (k + 1) || CandHadList[k] > cs.interHad * pbintraRatio) { maxSize = k; }
-#else
-        if (CandHadList.size() < (k + 1) || CandHadList[k] > cs.interHad * PBINTRA_RATIO) { maxSize = k; }
-#endif
       }
       if (maxSize > 0)
       {
@@ -1176,82 +859,12 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
         m_CABACEstimator->getCtx() = SubCtx(Ctx::MipFlag, ctxStartMipFlag);
         m_CABACEstimator->getCtx() = SubCtx(Ctx::MipMode, ctxStartMipMode);
         m_CABACEstimator->getCtx() = SubCtx(Ctx::ISPMode, ctxStartIspMode);
-#if JVET_N0185_UNIFIED_MPM
         m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
-#endif
         m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaMpmFlag, ctxStartIntraMode);
-#if !JVET_N0302_SIMPLFIED_CIIP
-        m_CABACEstimator->getCtx() = SubCtx(Ctx::MHIntraPredMode, ctxStartMHIntraMode);
-#endif
         m_CABACEstimator->getCtx() = SubCtx(Ctx::MultiRefLineIdx, ctxStartMrlIdx);
 
-#if JVET_N0193_LFNST
         return false;
-#else
-        return;
-#endif
-      }
-#else
-#if JVET_N0193_LFNST
-      double pbintraRatio = ( lfnstIdx > 0 ) ? 1.25 : PBINTRA_RATIO;
-      if( CandHadList.size() < 3 || CandHadList[ 2 ] > cs.interHad * pbintraRatio )
-#else
-      if( CandHadList.size() < 3 || CandHadList[2] > cs.interHad * PBINTRA_RATIO )
-#endif
-      {
-        uiRdModeList.resize( std::min<size_t>( uiRdModeList.size(), 2 ) );
-#if !JVET_N0217_MATRIX_INTRAPRED
-        extendRefList.resize( std::min<size_t>( extendRefList.size(), 2 ) );
-#endif
-        if( nOptionsForISP > 1 )
-        {
-          m_rdModeListWithoutMrlHor.resize( std::min<size_t>( m_rdModeListWithoutMrlHor.size(), 2 ) );
-          m_rdModeListWithoutMrlVer.resize( std::min<size_t>( m_rdModeListWithoutMrlVer.size(), 2 ) );
-        }
       }
-#if JVET_N0193_LFNST
-      if( CandHadList.size() < 2 || CandHadList[ 1 ] > cs.interHad * pbintraRatio )
-#else
-      if( CandHadList.size() < 2 || CandHadList[1] > cs.interHad * PBINTRA_RATIO )
-#endif
-      {
-        uiRdModeList.resize( std::min<size_t>( uiRdModeList.size(), 1 ) );
-#if !JVET_N0217_MATRIX_INTRAPRED
-        extendRefList.resize( std::min<size_t>( extendRefList.size(), 1 ) );
-#endif
-        if( nOptionsForISP > 1 )
-        {
-          m_rdModeListWithoutMrlHor.resize( std::min<size_t>( m_rdModeListWithoutMrlHor.size(), 1 ) );
-          m_rdModeListWithoutMrlVer.resize( std::min<size_t>( m_rdModeListWithoutMrlVer.size(), 1 ) );
-        }
-      }
-#if JVET_N0193_LFNST
-      if( CandHadList.size() < 1 || CandHadList[ 0 ] > cs.interHad * pbintraRatio )
-#else
-      if( CandHadList.size() < 1 || CandHadList[0] > cs.interHad * PBINTRA_RATIO )
-#endif
-      {
-        cs.dist = std::numeric_limits<Distortion>::max();
-        cs.interHad = 0;
-
-        //===== reset context models =====
-        m_CABACEstimator->getCtx() = SubCtx(Ctx::ISPMode, ctxStartIspMode);
-#if JVET_N0185_UNIFIED_MPM
-        m_CABACEstimator->getCtx() = SubCtx(Ctx::IntraLumaPlanarFlag, ctxStartPlanarFlag);
-#endif
-        m_CABACEstimator->getCtx() = SubCtx( Ctx::IntraLumaMpmFlag, ctxStartIntraMode );
-#if !JVET_N0302_SIMPLFIED_CIIP
-        m_CABACEstimator->getCtx() = SubCtx( Ctx::MHIntraPredMode, ctxStartMHIntraMode );
-#endif
-        m_CABACEstimator->getCtx() = SubCtx( Ctx::MultiRefLineIdx, ctxStartMrlIdx );
-
-#if JVET_N0193_LFNST
-        return false;
-#else
-        return;
-#endif
-      }
-#endif
     }
 
     if ( nOptionsForISP > 1 )
@@ -1260,13 +873,8 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
       auto* firstIspList  = ispOptions[1] == HOR_INTRA_SUBPARTITIONS ? &m_rdModeListWithoutMrlHor : &m_rdModeListWithoutMrlVer;
       auto* secondIspList = ispOptions[1] == HOR_INTRA_SUBPARTITIONS ? &m_rdModeListWithoutMrlVer : &m_rdModeListWithoutMrlHor;
 
-#if JVET_N0193_LFNST
       if( !sps.getUseLFNST() && m_pcEncCfg->getUseFastISP() )
-#else
-      if ( m_pcEncCfg->getUseFastISP() )
-#endif
       {
-#if JVET_N0217_MATRIX_INTRAPRED
         CHECKD( uiRdModeList.size() > CandCostList.size(), "Error: CandCostList size" );
         // find the first non-MRL, non-MIP mode
         int indexFirstMode = int(uiRdModeList.size()) - 1; // default is last mode
@@ -1287,51 +895,19 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
         //insert all ISP modes after the first non-mrl mode
         uiRdModeList.insert(uiRdModeList.begin() + 1, secondIspList->begin(), secondIspList->end());
         uiRdModeList.insert(uiRdModeList.begin() + 1, firstIspList->begin(), firstIspList->end());
-#else
-        // find the first non-MRL mode
-        size_t indexFirstMode = std::find( extendRefList.begin(), extendRefList.end(), 0 ) - extendRefList.begin();
-        // if not found, just take the last mode
-        if( indexFirstMode >= extendRefList.size() ) indexFirstMode = extendRefList.size() - 1;
-        // move the mode indicated by indexFirstMode to the beginning
-        for( int idx = ((int)indexFirstMode) - 1; idx >= 0; idx-- )
-        {
-          std::swap( extendRefList[idx], extendRefList[idx + 1] );
-          std::swap( uiRdModeList [idx], uiRdModeList [idx + 1] );
-        }
-        //insert all ISP modes after the first non-mrl mode
-        uiRdModeList.insert( uiRdModeList.begin() + 1, secondIspList->begin(), secondIspList->end() );
-        uiRdModeList.insert( uiRdModeList.begin() + 1, firstIspList->begin() , firstIspList->end()  );
-
-        extendRefList.insert( extendRefList.begin() + 1, secondIspList->size(), MRL_NUM_REF_LINES + ispOptions[2] );
-        extendRefList.insert( extendRefList.begin() + 1, firstIspList->size() , MRL_NUM_REF_LINES + ispOptions[1] );
-#endif
       }
       else
       {
         //insert all ISP modes at the end of the current list
         uiRdModeList.insert( uiRdModeList.end(), secondIspList->begin(), secondIspList->end() );
         uiRdModeList.insert( uiRdModeList.end(), firstIspList->begin() , firstIspList->end()  );
-#if !JVET_N0217_MATRIX_INTRAPRED
-        extendRefList.insert( extendRefList.end(), secondIspList->size(), MRL_NUM_REF_LINES + ispOptions[2] );
-        extendRefList.insert( extendRefList.end(), firstIspList->size() , MRL_NUM_REF_LINES + ispOptions[1] );
-#endif
       }
     }
-#if !JVET_N0217_MATRIX_INTRAPRED
-    CHECKD(uiRdModeList.size() != extendRefList.size(),"uiRdModeList and extendRefList do not have the same size!");
-#endif
 
     //===== check modes (using r-d costs) =====
-#if JVET_N0217_MATRIX_INTRAPRED
     ModeInfo       uiBestPUMode;
-#else
-    uint32_t       uiBestPUMode  = 0;
-    int            bestExtendRef = 0;
-#endif
-#if JVET_N0413_RDPCM
     int            bestBDPCMMode = 0;
     double         bestCostNonBDPCM = MAX_DOUBLE;
-#endif
 
     CodingStructure *csTemp = m_pTempCS[gp_sizeIdxInfo->idxFrom( cu.lwidth() )][gp_sizeIdxInfo->idxFrom( cu.lheight() )];
     CodingStructure *csBest = m_pBestCS[gp_sizeIdxInfo->idxFrom( cu.lwidth() )][gp_sizeIdxInfo->idxFrom( cu.lheight() )];
@@ -1341,11 +917,8 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
     csTemp->initStructData();
     csBest->initStructData();
 
-#if JVET_N0217_MATRIX_INTRAPRED
     m_bestCostNonMip = MAX_DOUBLE;
-#if JVET_N0193_LFNST
     static_vector<int, FAST_UDI_MAX_RDMODE_NUM> rdModeIdxList;
-#endif
     if (testMip)
     {
     static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiRdModeListTemp;
@@ -1354,9 +927,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
       if( !uiRdModeList[i].mipFlg && uiRdModeList[i].ispMod==NOT_INTRA_SUBPARTITIONS )
       {
         uiRdModeListTemp.push_back( uiRdModeList[i] );
-#if JVET_N0193_LFNST
         rdModeIdxList.push_back( i );
-#endif
       }
     }
     for( int i = 0; i < uiRdModeList.size(); i++)
@@ -1364,9 +935,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
       if( uiRdModeList[i].mipFlg || uiRdModeList[i].ispMod!=NOT_INTRA_SUBPARTITIONS )
       {
         uiRdModeListTemp.push_back( uiRdModeList[i] );
-#if JVET_N0193_LFNST
         rdModeIdxList.push_back( i );
-#endif
       }
     }
     for( int i = 0; i < uiRdModeList.size(); i++)
@@ -1374,25 +943,17 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
       uiRdModeList[i] = uiRdModeListTemp[i];
     }
     }
-#endif
     // just to be sure
     numModesForFullRD = ( int ) uiRdModeList.size();
     PartSplit intraSubPartitionsProcOrder = TU_NO_ISP;
     int       bestNormalIntraModeIndex    = -1;
-#if !JVET_N0217_MATRIX_INTRAPRED
-    uint8_t   bestIspOption               = NOT_INTRA_SUBPARTITIONS;
-#endif
     TUIntraSubPartitioner subTuPartitioner( partitioner );
-#if JVET_N0193_LFNST
     if( !cu.ispMode && !cu.mtsFlag )
     {
       m_modeCtrl->setMtsFirstPassNoIspCost( MAX_DOUBLE );
     }
-#endif
     bool      ispHorAllZeroCbfs = false, ispVerAllZeroCbfs = false;
 
-#if JVET_N0217_MATRIX_INTRAPRED
-#if JVET_N0413_RDPCM
     for (int mode = -2 * int(testBDPCM); mode < (int)uiRdModeList.size(); mode++)
     {
       // set CU/PU to luma prediction mode
@@ -1413,61 +974,15 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
       {
         cu.bdpcmMode = 0;
         uiOrgMode = uiRdModeList[mode];
-#else
-    for (uint32_t uiMode = 0; uiMode < uiRdModeList.size(); uiMode++)
-    {
-      // set CU/PU to luma prediction mode
-      ModeInfo uiOrgMode = uiRdModeList[uiMode];
-#endif
       cu.mipFlag                     = uiOrgMode.mipFlg;
       cu.ispMode                     = uiOrgMode.ispMod;
       pu.multiRefIdx                 = uiOrgMode.mRefId;
       pu.intraDir[CHANNEL_TYPE_LUMA] = uiOrgMode.modeId;
 
       CHECK(cu.mipFlag && pu.multiRefIdx, "Error: combination of MIP and MRL not supported");
-#if JVET_N0185_UNIFIED_MPM
       CHECK(pu.multiRefIdx && (pu.intraDir[0] == PLANAR_IDX), "Error: combination of MRL and Planar mode not supported");
-#else
-      CHECK(pu.multiRefIdx && (pu.intraDir[0] == DC_IDX || pu.intraDir[0] == PLANAR_IDX), "Error: combination of MRL and Planar/DC mode not supported");
-#endif
       CHECK(cu.ispMode && cu.mipFlag, "Error: combination of ISP and MIP not supported");
       CHECK(cu.ispMode && pu.multiRefIdx, "Error: combination of ISP and MRL not supported");
-#else
-#if JVET_N0413_RDPCM
-    for( int mode = -2 * int(testBDPCM); mode < numModesForFullRD; mode++ )
-#else
-    for (uint32_t uiMode = 0; uiMode < numModesForFullRD; uiMode++)
-#endif
-    {
-#if JVET_N0413_RDPCM
-      int multiRefIdx = 0;
-      uint32_t uiOrgMode;
-
-      if ( mode < 0 )
-    {
-        cu.bdpcmMode = -mode;
-        unsigned mpm_pred[NUM_MOST_PROBABLE_MODES];
-        PU::getIntraMPMs(pu, mpm_pred);
-        pu.intraDir[0] = mpm_pred[0];
-        uiOrgMode = mpm_pred[0];
-        cu.ispMode = NOT_INTRA_SUBPARTITIONS;
-      }
-      else
-      {
-        cu.bdpcmMode = 0;
-        uiOrgMode = uiRdModeList[mode];
-#else
-      // set luma prediction mode
-      uint32_t uiOrgMode = uiRdModeList[uiMode];
-#endif
-      cu.ispMode = extendRefList[mode] > MRL_NUM_REF_LINES ? extendRefList[mode] - MRL_NUM_REF_LINES : NOT_INTRA_SUBPARTITIONS;
-        pu.intraDir[0] = uiOrgMode;
-
-#if !JVET_N0413_RDPCM
-        int multiRefIdx = 0;
-#endif
-        pu.multiRefIdx = multiRefIdx;
-#endif
         if( cu.ispMode )
         {
           intraSubPartitionsProcOrder = CU::getISPType( cu, COMPONENT_Y );
@@ -1485,21 +1000,7 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
             continue;
           }
         }
-#if !JVET_N0217_MATRIX_INTRAPRED
-        else
-        {
-          multiRefIdx = extendRefList[mode];
-          pu.multiRefIdx = multiRefIdx;
-#if !JVET_N0185_UNIFIED_MPM
-          CHECK( pu.multiRefIdx && ( pu.intraDir[0] == DC_IDX || pu.intraDir[0] == PLANAR_IDX ), "ERL" );
-#else
-          CHECK( pu.multiRefIdx && (pu.intraDir[0] == PLANAR_IDX), "ERL" );
-#endif
-        }
-#endif
-#if JVET_N0413_RDPCM
       }
-#endif
 
       // set context models
       m_CABACEstimator->getCtx() = ctxStart;
@@ -1507,47 +1008,26 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
       // determine residual for partition
       cs.initSubStructure( *csTemp, partitioner.chType, cs.area, true );
 
-#if JVET_N0193_LFNST
       bool tmpValidReturn = false;
-#endif
       if( cu.ispMode )
       {
-#if JVET_N0193_LFNST
         tmpValidReturn = xRecurIntraCodingLumaQT( *csTemp, subTuPartitioner, bestCurrentCost, 0, intraSubPartitionsProcOrder, false,
                                                   mtsCheckRangeFlag, mtsFirstCheckId, mtsLastCheckId, moreProbMTSIdxFirst );
-#else
-        xRecurIntraCodingLumaQT( *csTemp, subTuPartitioner, bestCurrentCost, 0, intraSubPartitionsProcOrder );
-#endif
       }
       else
       {
-#if JVET_N0217_MATRIX_INTRAPRED
         if( ! fastMip )
         {
           m_bestCostNonMip = MAX_DOUBLE;
         }
-#if JVET_N0193_LFNST
         tmpValidReturn = xRecurIntraCodingLumaQT( *csTemp, partitioner, uiBestPUMode.ispMod ? bestCurrentCost : MAX_DOUBLE, -1, TU_NO_ISP, uiBestPUMode.ispMod,
                                                   mtsCheckRangeFlag, mtsFirstCheckId, mtsLastCheckId, moreProbMTSIdxFirst );
-#else
-        xRecurIntraCodingLumaQT(*csTemp, partitioner, uiBestPUMode.ispMod ? bestCurrentCost : MAX_DOUBLE, -1, TU_NO_ISP, uiBestPUMode.ispMod);
-#endif
-#else
-#if JVET_N0193_LFNST
-        tmpValidReturn = xRecurIntraCodingLumaQT( *csTemp, partitioner, bestIspOption ? bestCurrentCost : MAX_DOUBLE, -1, TU_NO_ISP, bestIspOption,
-                                                  mtsCheckRangeFlag, mtsFirstCheckId, mtsLastCheckId, moreProbMTSIdxFirst );
-#else
-        xRecurIntraCodingLumaQT( *csTemp, partitioner, bestIspOption ? bestCurrentCost : MAX_DOUBLE, -1, TU_NO_ISP, bestIspOption );
-#endif
-#endif
       }
 
       if( cu.ispMode && !csTemp->cus[0]->firstTU->cbf[COMPONENT_Y] )
       {
-#if JVET_N0193_LFNST
         if( !sps.getUseLFNST() )
         {
-#endif
           if ( cu.ispMode == HOR_INTRA_SUBPARTITIONS )
           {
             ispHorAllZeroCbfs |= ( m_pcEncCfg->getUseFastISP() && csTemp->tus[0]->lheight() > 2 && csTemp->cost >= bestCurrentCost );
@@ -1556,141 +1036,74 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
           {
             ispVerAllZeroCbfs |= ( m_pcEncCfg->getUseFastISP() && csTemp->tus[0]->lwidth() > 2 && csTemp->cost >= bestCurrentCost );
           }
-#if JVET_N0193_LFNST
         }
-#endif
         csTemp->cost = MAX_DOUBLE;
         csTemp->costDbOffset = 0;
-#if JVET_N0193_LFNST
         tmpValidReturn = false;
-#endif
       }
-#if JVET_N0193_LFNST
       validReturn |= tmpValidReturn;
 
-#if JVET_N0413_RDPCM
       if( sps.getUseLFNST() && mtsUsageFlag == 1 && !cu.ispMode && mode >= 0 )
       {
-#if JVET_N0217_MATRIX_INTRAPRED
         m_modeCostStore[ lfnstIdx ][ testMip ? rdModeIdxList[ mode ] : mode ] = tmpValidReturn ? csTemp->cost : ( MAX_DOUBLE / 2.0 ); //(MAX_DOUBLE / 2.0) ??
-#else
-        m_modeCostStore[ lfnstIdx ][ mode ] = tmpValidReturn ? csTemp->cost : ( MAX_DOUBLE / 2.0 ); //(MAX_DOUBLE / 2.0) ??
-#endif
-#else
-      if( sps.getUseLFNST() && mtsUsageFlag == 1 && !cu.ispMode )
-      {
-#if JVET_N0217_MATRIX_INTRAPRED
-        m_modeCostStore[ lfnstIdx ][ testMip ? rdModeIdxList[ uiMode ] : uiMode ] = tmpValidReturn ? csTemp->cost : ( MAX_DOUBLE / 2.0 ); //(MAX_DOUBLE / 2.0) ??
-#else
-        m_modeCostStore[ lfnstIdx ][ uiMode ] = tmpValidReturn ? csTemp->cost : ( MAX_DOUBLE / 2.0 ); //(MAX_DOUBLE / 2.0) ??
-#endif
-#endif
       }
-#endif
 
 
-#if JVET_N0217_MATRIX_INTRAPRED
       DTRACE( g_trace_ctx, D_INTRA_COST, "IntraCost T %f (%d) \n", csTemp->cost, uiOrgMode.modeId );
-#else
-      DTRACE( g_trace_ctx, D_INTRA_COST, "IntraCost T %f (%d) \n", csTemp->cost, uiOrgMode );
-#endif
 
 
-#if JVET_N0193_LFNST
       if( tmpValidReturn )
       {
-#endif
         // check r-d cost
         if( csTemp->cost < csBest->cost )
         {
           std::swap( csTemp, csBest );
 
           uiBestPUMode  = uiOrgMode;
-#if !JVET_N0217_MATRIX_INTRAPRED
-          bestExtendRef = multiRefIdx;
-          bestIspOption = cu.ispMode;
-#endif
-#if JVET_N0413_RDPCM
           bestBDPCMMode = cu.bdpcmMode;
-#endif
-#if JVET_N0193_LFNST
           if( sps.getUseLFNST() && mtsUsageFlag == 1 && !cu.ispMode )
           {
             m_bestModeCostStore[ lfnstIdx ] = csBest->cost; //cs.cost;
           }
-#endif
           if( csBest->cost < bestCurrentCost )
           {
             bestCurrentCost = csBest->cost;
           }
-#if !JVET_N0413_RDPCM
-          if( !cu.ispMode )
-          {
-            bestNormalIntraModeIndex = uiMode;
-          }
-#endif
-#if JVET_N0193_LFNST
           if( !cu.ispMode && !cu.mtsFlag )
           {
             m_modeCtrl->setMtsFirstPassNoIspCost( csBest->cost );
           }
-#endif
         }
-#if JVET_N0413_RDPCM
         if( !cu.ispMode && !cu.bdpcmMode && csBest->cost < bestCostNonBDPCM )
         {
           bestCostNonBDPCM = csBest->cost;
           bestNormalIntraModeIndex = mode;
         }
-#endif
-#if JVET_N0193_LFNST
       }
-#endif
 
       csTemp->releaseIntermediateData();
     } // Mode loop
-#if JVET_N0217_MATRIX_INTRAPRED
     cu.ispMode = uiBestPUMode.ispMod;
-#else
-    cu.ispMode = bestIspOption;
-#endif
 
-#if JVET_N0193_LFNST
     if( validReturn )
     {
-#endif
       cs.useSubStructure( *csBest, partitioner.chType, pu.singleChan( CHANNEL_TYPE_LUMA ), true, true, keepResi, keepResi );
-#if JVET_N0193_LFNST
     }
-#endif
     csBest->releaseIntermediateData();
-#if JVET_N0193_LFNST
     if( validReturn )
     {
-#endif
       //=== update PU data ====
-#if JVET_N0217_MATRIX_INTRAPRED
       cu.mipFlag = uiBestPUMode.mipFlg;
       pu.multiRefIdx = uiBestPUMode.mRefId;
       pu.intraDir[ CHANNEL_TYPE_LUMA ] = uiBestPUMode.modeId;
-#else
-      pu.intraDir[ 0 ] = uiBestPUMode;
-      pu.multiRefIdx = bestExtendRef;
-#endif
-#if JVET_N0413_RDPCM
       cu.bdpcmMode = bestBDPCMMode;
-#endif
-#if JVET_N0193_LFNST
     }
-#endif
   }
 
   //===== reset context models =====
   m_CABACEstimator->getCtx() = ctxStart;
 
-#if JVET_N0193_LFNST
   return validReturn;
-#endif
 }
 
 void IntraSearch::estIntraPredChromaQT( CodingUnit &cu, Partitioner &partitioner, const double maxCostAllowed )
@@ -1793,11 +1206,7 @@ void IntraSearch::estIntraPredChromaQT( CodingUnit &cu, Partitioner &partitioner
       }
 
       DistParam distParam;
-#if JVET_N0329_IBC_SEARCH_IMP
       const bool useHadamard = !cu.transQuantBypass;
-#else
-      const bool useHadamard = true;
-#endif
       pu.intraDir[1] = MDLM_L_IDX; // temporary assigned, just to indicate this is a MDLM mode. for luma down-sampling operation.
 
       initIntraPatternChType(cu, pu.Cb());
@@ -2027,11 +1436,7 @@ void IntraSearch::xEncPCM(CodingStructure &cs, Partitioner& partitioner, const C
   CompArea      tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
   PelBuf tempOrgBuf = m_tmpStorageLCU.getBuf(tmpArea);
   tempOrgBuf.copyFrom(orgBuf);
-#if JVET_N0805_APS_LMCS
   if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#else
-  if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#endif
   {
     tempOrgBuf.rspSignal(m_pcReshape->getFwdLUT());
   }
@@ -2073,9 +1478,7 @@ void IntraSearch::xEncIntraHeader( CodingStructure &cs, Partitioner &partitioner
         m_CABACEstimator->cu_skip_flag( cu );
         m_CABACEstimator->pred_mode   ( cu );
       }
-#if JVET_N0413_RDPCM
       m_CABACEstimator->bdpcm_mode  ( cu, ComponentID(partitioner.chType) );
-#endif
       if( CU::isIntra(cu) )
       {
         m_CABACEstimator->pcm_data( cu, partitioner );
@@ -2084,10 +1487,6 @@ void IntraSearch::xEncIntraHeader( CodingStructure &cs, Partitioner &partitioner
           return;
         }
       }
-#if !JVET_N0217_MATRIX_INTRAPRED
-      m_CABACEstimator->extend_ref_line(cu);
-      m_CABACEstimator->isp_mode      ( cu );
-#endif
     }
 
     PredictionUnit &pu = *cs.getPU(partitioner.currArea().lumaPos(), partitioner.chType);
@@ -2320,7 +1719,6 @@ uint64_t IntraSearch::xGetIntraFracBitsQTChroma(TransformUnit& currTU, const Com
     m_CABACEstimator->cross_comp_pred( currTU, compID );
   }
 
-#if JVET_N0054_JOINT_CHROMA
   // Include Cbf and jointCbCr flags here as we make decisions across components
   CodingStructure &cs = *currTU.cs;
 
@@ -2346,7 +1744,6 @@ uint64_t IntraSearch::xGetIntraFracBitsQTChroma(TransformUnit& currTU, const Com
       m_CABACEstimator->cbf_comp( cs, TU::getCbf( currTU, compID ), currTU.blocks[ compID ], currTU.depth, TU::getCbf( currTU, COMPONENT_Cb ) );
   }
 
-#endif
   if( TU::getCbf( currTU, compID ) )
   {
     m_CABACEstimator->residual_coding( currTU, compID );
@@ -2364,9 +1761,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
   }
 
   CodingStructure &cs                       = *tu.cs;
-#if JVET_N0671_RDCOST_FIX
   m_pcRdCost->setChromaFormat(cs.sps->getChromaFormatIdc());
-#endif
 
   const CompArea      &area                 = tu.blocks[compID];
   const SPS           &sps                  = *cs.sps;
@@ -2394,12 +1789,10 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
 
 
   //===== init availability pattern =====
-#if JVET_N0054_JOINT_CHROMA
   bool jointCbCr = tu.jointCbCr && compID == COMPONENT_Cb;
 
   if ( compID == COMPONENT_Y )
   {
-#endif
   PelBuf sharedPredTS( m_pSharedPredTransformSkip[compID], area );
   if( default0Save1Load2 != 2 )
   {
@@ -2415,18 +1808,14 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
     }
     else
     {
-#if JVET_N0217_MATRIX_INTRAPRED
       if( PU::isMIP( pu, chType ) )
       {
         predIntraMip( compID, piPred, pu );
       }
       else
       {
-#endif
       predIntraAng( compID, piPred, pu );
-#if JVET_N0217_MATRIX_INTRAPRED
       }
-#endif
     }
 
 
@@ -2441,25 +1830,15 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
     // load prediction
     piPred.copyFrom( sharedPredTS );
   }
-#if JVET_N0054_JOINT_CHROMA
   }
-#endif
 
 
   DTRACE( g_trace_ctx, D_PRED, "@(%4d,%4d) [%2dx%2d] IMode=%d\n", tu.lx(), tu.ly(), tu.lwidth(), tu.lheight(), uiChFinalMode );
   //DTRACE_PEL_BUF( D_PRED, piPred, tu, tu.cu->predMode, COMPONENT_Y );
 
   const Slice           &slice = *cs.slice;
-#if JVET_N0805_APS_LMCS
   bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
-#else
-  bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
-#endif
-#if JVET_N0805_APS_LMCS
   if (flag && slice.getLmcsChromaResidualScaleFlag() && isChroma(compID))
-#else
-  if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && isChroma(compID))
-#endif
   {
     const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size()));
     const CompArea &areaY = CompArea(COMPONENT_Y, tu.chromaFormat, area );
@@ -2471,11 +1850,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
   }
   //===== get residual signal =====
   piResi.copyFrom( piOrg  );
-#if JVET_N0805_APS_LMCS
   if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#else
-  if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && compID==COMPONENT_Y)
-#endif
   {
     CompArea      tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
     PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea);
@@ -2512,22 +1887,15 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
 #endif
 
   flag =flag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
-#if JVET_N0805_APS_LMCS
   if (flag && isChroma(compID) && slice.getLmcsChromaResidualScaleFlag() )
-#else
-  if (flag && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
-#endif
   {
     int cResScaleInv = tu.getChromaAdj();
     double cResScale = round((double)(1 << CSCALE_FP_PREC) / (double)cResScaleInv);
     m_pcTrQuant->setLambda(m_pcTrQuant->getLambda() / (cResScale*cResScale));
-#if JVET_N0054_JOINT_CHROMA
     if ( !jointCbCr ) // Joint CbCr signal is to be scaled in the case of joint chroma
-#endif
     piResi.scaleSignal(cResScaleInv, 1, tu.cu->cs->slice->clpRng(compID));
   }
 
-#if JVET_N0054_JOINT_CHROMA
   const CompArea &crArea = tu.blocks     [ COMPONENT_Cr ];
   PelBuf          crOrg  = cs.getOrgBuf  ( crArea );
   PelBuf          crPred = cs.getPredBuf ( crArea );
@@ -2544,11 +1912,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
     piResi.subtractAndHalve( crResi );
 
     // Scale the joint signal
-#if JVET_N0805_APS_LMCS
     if ( flag && slice.getLmcsChromaResidualScaleFlag() )
-#else
-    if ( flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
-#endif
       piResi.scaleSignal(tu.getChromaAdj(), 1, tu.cu->cs->slice->clpRng(compID));
 
     // Lambda is loosened for the joint mode with respect to single modes as the same residual is used for both chroma blocks
@@ -2556,7 +1920,6 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
   }
   else if ( isChroma(compID) && tu.cu->cs->slice->getSliceQp() > 18 )
     m_pcTrQuant->setLambda( 1.10 * m_pcTrQuant->getLambda() );
-#endif
 
   double diagRatio = 0, horVerRatio = 0;
 
@@ -2592,11 +1955,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
   }
 
   //===== reconstruction =====
-#if JVET_N0805_APS_LMCS
   if ( flag && uiAbsSum > 0 && isChroma(compID) && slice.getLmcsChromaResidualScaleFlag() )
-#else
-  if (flag && uiAbsSum > 0 && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
-#endif
   {
     piResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID));
   }
@@ -2605,11 +1964,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
     CrossComponentPrediction::crossComponentPrediction(tu, compID, cs.getResiBuf(tu.Y()), piResi, piResi, true);
   }
 
-#if JVET_N0805_APS_LMCS
   if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#else
-  if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
-#endif
   {
     CompArea      tmpArea(COMPONENT_Y, area.chromaFormat, Position(0,0), area.size());
     PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea);
@@ -2619,7 +1974,6 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
   else
   piReco.reconstruct(piPred, piResi, cs.slice->clpRng( compID ));
 
-#if JVET_N0054_JOINT_CHROMA
   if ( jointCbCr )
   {
     // Cr uses negative of the signalled Cb residual
@@ -2639,11 +1993,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
 #if WCG_EXT
     if ( m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() ||
         (m_pcEncCfg->getReshaper()
-#if JVET_N0805_APS_LMCS
           && slice.getLmcsEnabledFlag()
-#else
-         && slice.getReshapeInfo().getUseSliceReshaper()
-#endif
          && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD()))))
     {
       const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] );
@@ -2655,16 +2005,11 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
       ruiDist += m_pcRdCost->getDistPart( crOrg, crReco, bitDepth, COMPONENT_Cr, DF_SSE );
     }
   }
-#endif
 
   //===== update distortion =====
 #if WCG_EXT
   if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getReshaper()
-#if JVET_N0805_APS_LMCS
     && slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD()))))
-#else
-    && slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD()))))
-#endif
   {
     const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] );
     if (compID == COMPONENT_Y  && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()))
@@ -2685,20 +2030,14 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
   }
 }
 
-#if JVET_N0193_LFNST
 bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &partitioner, const double bestCostSoFar, const int subTuIdx, const PartSplit ispType, const bool ispIsCurrentWinner, bool mtsCheckRangeFlag, int mtsFirstCheckId, int mtsLastCheckId, bool moreProbMTSIdxFirst )
-#else
-void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &partitioner, const double bestCostSoFar, const int subTuIdx, const PartSplit ispType, const bool ispIsCurrentWinner )
-#endif
 {
         int   subTuCounter = subTuIdx;
   const UnitArea &currArea = partitioner.currArea();
   const CodingUnit     &cu = *cs.getCU( currArea.lumaPos(), partitioner.chType );
         bool  earlySkipISP = false;
   uint32_t currDepth       = partitioner.currTrDepth;
-#if JVET_N0193_LFNST
   const SPS &sps           = *cs.sps;
-#endif
   const PPS &pps           = *cs.pps;
   const bool keepResi      = pps.getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() || KEEP_PRED_AND_RESI_SIGNALS;
   bool bCheckFull          = true;
@@ -2713,7 +2052,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
   }
   uint32_t    numSig           = 0;
 
-#if JVET_N0193_LFNST
   double     dSingleCost                        = MAX_DOUBLE;
   Distortion uiSingleDistLuma                   = 0;
   uint64_t   singleFracBits                     = 0;
@@ -2721,12 +2059,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
   int        bestModeId[ MAX_NUM_COMPONENT ]    = { 0, 0, 0 };
   uint8_t    nNumTransformCands                 = cu.mtsFlag ? 4 : 1;
   uint8_t    numTransformIndexCands             = nNumTransformCands;
-#else
-  double     dSingleCost                        = MAX_DOUBLE;
-  Distortion uiSingleDistLuma                   = 0;
-  uint64_t   singleFracBits                     = 0;
-  int        bestModeId[MAX_NUM_COMPONENT]      = { 0, 0, 0 };
-#endif
 
   const TempCtx ctxStart  ( m_CtxCache, m_CABACEstimator->getCtx() );
   TempCtx       ctxBest   ( m_CtxCache );
@@ -2743,9 +2075,7 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
     csFull = &cs;
   }
 
-#if JVET_N0193_LFNST
   bool validReturnFull = false;
-#endif
 
   if( bCheckFull )
   {
@@ -2754,7 +2084,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
     TransformUnit &tu = csFull->addTU( CS::getArea( *csFull, currArea, partitioner.chType ), partitioner.chType );
     tu.depth = currDepth;
 
-#if JVET_N0193_LFNST
     const bool tsAllowed  = TU::isTSAllowed( tu, COMPONENT_Y );
     const bool mtsAllowed = TU::isMTSAllowed( tu, COMPONENT_Y );
     std::vector<TrMode> trModes;
@@ -2790,26 +2119,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
     }
 
     CHECK( !tu.Y().valid(), "Invalid TU" );
-#else
-    const bool tsAllowed  = TU::isTSAllowed ( tu, COMPONENT_Y );
-    const bool mtsAllowed = TU::isMTSAllowed( tu, COMPONENT_Y );
-    uint8_t nNumTransformCands = 1 + ( tsAllowed ? 1 : 0 ) + ( mtsAllowed ? 4 : 0 ); // DCT + TS + 4 MTS = 6 tests
-    std::vector<TrMode> trModes;
-    trModes.push_back( TrMode( 0, true ) ); //DCT2
-    if( tsAllowed )
-    {
-      trModes.push_back( TrMode( 1, true ) );
-    }
-    if( mtsAllowed )
-    {
-      for( int i = 2; i < 6; i++ )
-      {
-        trModes.push_back( TrMode( i, true) );
-      }
-    }
-
-    CHECK( !tu.Y().valid(), "Invalid TU" );
-#endif
 
     CodingStructure &saveCS = *m_pSaveCS[0];
 
@@ -2818,21 +2127,12 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
     Distortion singleDistTmpLuma = 0;
     uint64_t     singleTmpFracBits = 0;
     double     singleCostTmp     = 0;
-#if JVET_N0193_LFNST
     int        firstCheckId      = ( sps.getUseLFNST() && mtsCheckRangeFlag && cu.mtsFlag ) ? mtsFirstCheckId : 0;
-#else
-    int        firstCheckId      = 0;
-#endif
 
-#if JVET_N0193_LFNST
     //we add the MTS candidates to the loop. TransformSkip will still be the last one to be checked (when modeId == lastCheckId) as long as checkTransformSkip is true
     int        lastCheckId       = sps.getUseLFNST() ? ( ( mtsCheckRangeFlag && cu.mtsFlag ) ? ( mtsLastCheckId + ( int ) checkTransformSkip ) : ( numTransformIndexCands - ( firstCheckId + 1 ) + ( int ) checkTransformSkip ) ) :
                                    trModes[ nNumTransformCands - 1 ].first;
     bool isNotOnlyOneMode        = sps.getUseLFNST() ? lastCheckId != firstCheckId : nNumTransformCands != 1;
-#else
-    int       lastCheckId        = trModes[nNumTransformCands-1].first;
-    bool isNotOnlyOneMode        = nNumTransformCands != 1;
-#endif
 
     if( isNotOnlyOneMode )
     {
@@ -2843,15 +2143,12 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       tmpTU = &saveCS.addTU(currArea, partitioner.chType);
     }
 
-#if JVET_N0193_LFNST
     bool    cbfBestMode      = false;
     bool    cbfBestModeValid = false;
-#endif
     bool    cbfDCT2  = true;
 
     double bestDCT2cost = MAX_DOUBLE;
     double threshold = m_pcEncCfg->getUseFastISP() && !cu.ispMode && ispIsCurrentWinner && nNumTransformCands > 1 ? 1 + 1.4 / sqrt( cu.lwidth() * cu.lheight() ) : 1;
-#if JVET_N0193_LFNST
     for( int modeId = firstCheckId; modeId <= ( sps.getUseLFNST() ? lastCheckId : ( nNumTransformCands - 1 ) ); modeId++ )
     {
       uint8_t transformIndex = modeId;
@@ -2884,33 +2181,13 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
         }
         tu.mtsIdx = trModes[ modeId ].first;
       }
-#else
-    for( int modeId = firstCheckId; modeId < nNumTransformCands; modeId++ )
-    {
-      if( !cbfDCT2 || ( m_pcEncCfg->getUseTransformSkipFast() && bestModeId[COMPONENT_Y] == 1 ) )
-      {
-        break;
-      }
-      if( !trModes[modeId].second )
-      {
-        continue;
-      }
-      //we compare the DCT-II cost against the best ISP cost so far (except for TS)
-      if ( m_pcEncCfg->getUseFastISP() && !cu.ispMode && ispIsCurrentWinner && trModes[modeId].first != 0 && ( trModes[modeId].first != 1 || !tsAllowed ) && bestDCT2cost > bestCostSoFar * threshold )
-      {
-        continue;
-      }
-      tu.mtsIdx = trModes[modeId].first;
-#endif
 
-#if JVET_N0217_MATRIX_INTRAPRED
       //we compare the best cost for non lwip
       const double thresholdSkipMode = 1.0 + (1.4 / sqrt((double)(cu.lwidth() * cu.lheight())));
       if ( cu.mipFlag && tu.mtsIdx && m_bestCostNonMip != MAX_DOUBLE && m_bestCostNonMip * thresholdSkipMode < bestDCT2cost  )
       {
         continue;
       }
-#endif
 
       if ((modeId != firstCheckId) && isNotOnlyOneMode)
       {
@@ -2920,17 +2197,12 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       int default0Save1Load2 = 0;
       singleDistTmpLuma = 0;
 
-#if JVET_N0193_LFNST
       if( modeId == firstCheckId && ( sps.getUseLFNST() ? ( modeId != lastCheckId ) : ( nNumTransformCands > 1 ) ) )
-#else
-      if( modeId == firstCheckId && nNumTransformCands > 1 )
-#endif
       {
         default0Save1Load2 = 1;
       }
       else if (modeId != firstCheckId)
       {
-#if JVET_N0193_LFNST
         if( sps.getUseLFNST() && !cbfBestModeValid )
         {
           default0Save1Load2 = 1;
@@ -2939,15 +2211,11 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
         {
           default0Save1Load2 = 2;
         }
-#else
-        default0Save1Load2 = 2;
-#endif
       }
       if( cu.ispMode )
       {
         default0Save1Load2 = 0;
       }
-#if JVET_N0193_LFNST
       if( sps.getUseLFNST() )
       {
         if( cu.mtsFlag )
@@ -3022,33 +2290,9 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
           xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig );
         }
       }
-#else
-      if( nNumTransformCands > 1 )
-      {
-        xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig, modeId == 0 ? &trModes : nullptr, true );
-        if( modeId == 0 )
-        {
-          for( int i = 0; i < nNumTransformCands; i++ )
-          {
-            if( trModes[i].second )
-            {
-              lastCheckId = trModes[i].first;
-            }
-          }
-        }
-      }
-      else
-      {
-        xIntraCodingTUBlock( tu, COMPONENT_Y, false, singleDistTmpLuma, default0Save1Load2, &numSig );
-      }
-#endif
 
       //----- determine rate and r-d cost -----
-#if JVET_N0193_LFNST
       if( ( sps.getUseLFNST() ? ( modeId == lastCheckId && modeId != 0 && checkTransformSkip ) : ( trModes[ modeId ].first != 0 ) ) && !TU::getCbfAtDepth( tu, COMPONENT_Y, currDepth ) )
-#else
-      if( ( trModes[modeId].first != 0 && !TU::getCbfAtDepth( tu, COMPONENT_Y, currDepth ) ) )
-#endif
       {
         //In order not to code TS flag when cbf is zero, the case for TS with cbf being zero is forbidden.
         singleCostTmp = MAX_DOUBLE;
@@ -3070,12 +2314,10 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       {
         bestDCT2cost = singleCostTmp;
       }
-#if JVET_N0217_MATRIX_INTRAPRED
       if (!cu.ispMode && !cu.mipFlag && tu.mtsIdx == MTS_DCT2_DCT2 )
       {
         m_bestCostNonMip = std::min(m_bestCostNonMip, singleCostTmp);
       }
-#endif
 
       if (singleCostTmp < dSingleCost)
       {
@@ -3083,7 +2325,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
         uiSingleDistLuma  = singleDistTmpLuma;
         singleFracBits    = singleTmpFracBits;
 
-#if JVET_N0193_LFNST
         if( sps.getUseLFNST() )
         {
           bestModeId[ COMPONENT_Y ] = modeId;
@@ -3093,15 +2334,12 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
         }
         else
         {
-#endif
           bestModeId[ COMPONENT_Y ] = trModes[ modeId ].first;
           if( trModes[ modeId ].first == 0 )
           {
             cbfDCT2 = TU::getCbfAtDepth( tu, COMPONENT_Y, currDepth );
           }
-#if JVET_N0193_LFNST
         }
-#endif
 
         if( bestModeId[COMPONENT_Y] != lastCheckId )
         {
@@ -3121,7 +2359,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       }
     }
 
-#if JVET_N0193_LFNST
     if( sps.getUseLFNST() && !validReturnFull )
     {
       csFull->cost = MAX_DOUBLE;
@@ -3133,7 +2370,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
     }
     else
     {
-#endif
       if( bestModeId[COMPONENT_Y] != lastCheckId )
       {
         csFull->getPredBuf( tu.Y() ).copyFrom( saveCS.getPredBuf( tu.Y() ) );
@@ -3160,14 +2396,10 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       csFull->cost     += dSingleCost;
       csFull->dist     += uiSingleDistLuma;
       csFull->fracBits += singleFracBits;
-#if JVET_N0193_LFNST
     }
-#endif
   }
 
-#if JVET_N0193_LFNST
   bool validReturnSplit = false;
-#endif
   if( bCheckSplit )
   {
     //----- store full entropy coding status, load original entropy coding status -----
@@ -3191,7 +2423,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
     }
     do
     {
-#if JVET_N0193_LFNST
       bool tmpValidReturnSplit = xRecurIntraCodingLumaQT( *csSplit, partitioner, bestCostSoFar, subTuCounter, ispType, false, mtsCheckRangeFlag, mtsFirstCheckId, mtsLastCheckId );
       subTuCounter += subTuCounter != -1 ? 1 : 0;
       if( sps.getUseLFNST() && !tmpValidReturnSplit )
@@ -3199,10 +2430,6 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
         splitIsSelected = false;
         break;
       }
-#else
-      xRecurIntraCodingLumaQT( *csSplit, partitioner, bestCostSoFar, subTuCounter, ispType );
-      subTuCounter += subTuCounter != -1 ? 1 : 0;
-#endif
 
       if( !cu.ispMode )
       {
@@ -3263,21 +2490,15 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       //--- update cost ---
       csSplit->cost     = m_pcRdCost->calcRdCost(csSplit->fracBits, csSplit->dist);
 
-#if JVET_N0193_LFNST
       validReturnSplit = true;
-#endif
     }
   }
 
-#if JVET_N0193_LFNST
   bool retVal = false;
-#endif
   if( csFull || csSplit )
   {
-#if JVET_N0193_LFNST
     if( !sps.getUseLFNST() || validReturnFull || validReturnSplit )
     {
-#endif
       {
         // otherwise this would've happened in useSubStructure
         cs.picture->getRecoBuf( currArea.Y() ).copyFrom( cs.getRecoBuf( currArea.Y() ) );
@@ -3291,17 +2512,11 @@ void IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
       else
       {
         cs.cost = m_pcRdCost->calcRdCost( cs.fracBits, cs.dist );
-#if JVET_N0193_LFNST
         retVal = true;
-#endif
       }
-#if JVET_N0193_LFNST
     }
-#endif
   }
-#if JVET_N0193_LFNST
   return retVal;
-#endif
 }
 
 ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitioner& partitioner, const double bestCostSoFar, const PartSplit ispType )
@@ -3350,7 +2565,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
 
     const unsigned      numTBlocks  = ::getNumberValidTBlocks( *cs.pcv );
 
-#if JVET_N0054_JOINT_CHROMA
     CompArea&  cbArea         = currTU.blocks[COMPONENT_Cb];
     CompArea&  crArea         = currTU.blocks[COMPONENT_Cr];
     double     bestCostCb     = MAX_DOUBLE;
@@ -3387,7 +2601,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
       predIntraAng( COMPONENT_Cb, piPredCb, pu);
       predIntraAng( COMPONENT_Cr, piPredCr, pu);
     }
-#endif
 
     for( uint32_t c = COMPONENT_Cb; c < numTBlocks; c++)
     {
@@ -3396,9 +2609,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
 
       double     dSingleCost    = MAX_DOUBLE;
       int        bestModeId     = 0;
-#if !JVET_N0054_JOINT_CHROMA
-      Distortion singleDistC    = 0;
-#endif
       Distortion singleDistCTmp = 0;
       double     singleCostTmp  = 0;
 
@@ -3406,20 +2616,12 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
 
       const int  crossCPredictionModesToTest = checkCrossComponentPrediction ? 2 : 1;
       const int  totalModesToTest            = crossCPredictionModesToTest;
-#if JVET_N0054_JOINT_CHROMA
       const bool isOneMode                   = false;
       maxModesTested                         = totalModesToTest > maxModesTested ? totalModesToTest : maxModesTested;
-#else
-      const bool isOneMode                   = (totalModesToTest == 1);
-#endif
 
       int currModeId = 0;
       int default0Save1Load2 = 0;
 
-#if !JVET_N0054_JOINT_CHROMA
-      TempCtx ctxStart  ( m_CtxCache );
-      TempCtx ctxBest   ( m_CtxCache );
-#endif
 
       if (!isOneMode)
       {
@@ -3434,24 +2636,7 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
           currModeId++;
 
           const bool isFirstMode = (currModeId == 1);
-#if JVET_N0054_JOINT_CHROMA
           const bool isLastMode  = false; // Always store output to saveCS and tmpTU
-#else
-          const bool isLastMode  = (currModeId == totalModesToTest); // currModeId is indexed from 1
-
-          if (isOneMode)
-          {
-            default0Save1Load2 = 0;
-          }
-          else if (!isOneMode && (crossCPredictionModeId == 0))
-          {
-            default0Save1Load2 = 1; //save prediction on first mode
-          }
-          else
-          {
-            default0Save1Load2 = 2; //load it on subsequent modes
-          }
-#endif
 
           if (!isFirstMode) // if not first mode to be tested
           {
@@ -3483,7 +2668,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
 
           if( singleCostTmp < dSingleCost )
           {
-#if JVET_N0054_JOINT_CHROMA
             dSingleCost = singleCostTmp;
             bestModeId  = currModeId;
 
@@ -3497,11 +2681,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
               bestCostCr = singleCostTmp;
               bestDistCr = singleDistCTmp;
             }
-#else
-            dSingleCost = singleCostTmp;
-            singleDistC = singleDistCTmp;
-            bestModeId  = currModeId;
-#endif
 
             if( !isLastMode )
             {
@@ -3529,14 +2708,11 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
         //Luma + Cb cost is already larger than the best cost, so we don't need to test Cr
         cs.dist = MAX_UINT;
         m_CABACEstimator->getCtx() = ctxStart;
-#if JVET_N0054_JOINT_CHROMA
         earlyExitISP               = true;
-#endif
         break;
         //return cbfs;
       }
 
-#if JVET_N0054_JOINT_CHROMA
       // Done with one component of separate coding of Cr and Cb, just switch to the best Cb contexts if Cr coding is still to be done
       if ( c == COMPONENT_Cb && bestModeId < totalModesToTest)
       {
@@ -3544,35 +2720,8 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
 
         currTU.copyComponentFrom(tmpTU, COMPONENT_Cb); // Cbf of Cb is needed to estimate cost for Cr Cbf
       }
-#else
-      if (bestModeId < totalModesToTest)
-      {
-#if KEEP_PRED_AND_RESI_SIGNALS
-        cs.getPredBuf   (area).copyFrom(saveCS.getPredBuf   (area));
-        cs.getOrgResiBuf(area).copyFrom(saveCS.getOrgResiBuf(area));
-#endif
-        cs.getPredBuf   (area).copyFrom(saveCS.getPredBuf   (area));
-        if( keepResi )
-        {
-          cs.getResiBuf (area).copyFrom(saveCS.getResiBuf   (area));
-        }
-        cs.getRecoBuf   (area).copyFrom(saveCS.getRecoBuf   (area));
-
-        currTU.copyComponentFrom(tmpTU, compID);
-
-        m_CABACEstimator->getCtx() = ctxBest;
-      }
-
-      cs.picture->getPredBuf(area).copyFrom(cs.getPredBuf(area));
-      cs.picture->getRecoBuf(area).copyFrom(cs.getRecoBuf(area));
-
-      cbfs.cbf(compID) = TU::getCbf(currTU, compID);
-
-      cs.dist += singleDistC;
-#endif // not JVET_N0054_JOINT_CHROMA
     }
 
-#if JVET_N0054_JOINT_CHROMA
     if ( !earlyExitISP )
     {
       // Test using joint chroma residual coding
@@ -3641,7 +2790,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
       currTU.jointCbCr = cbfs.cbf(COMPONENT_Cb) ? bestJointCbCr : 0;
       cs.dist         += bestDistCbCr;
     }
-#endif // JVET_N0054_JOINT_CHROMA
   }
   else
   {
@@ -3709,18 +2857,8 @@ uint64_t IntraSearch::xFracModeBitsIntra(PredictionUnit &pu, const uint32_t &uiM
 
   if( isLuma( chType ) )
   {
-#if !JVET_N0302_SIMPLFIED_CIIP
-    if ( pu.mhIntraFlag )
-      m_CABACEstimator->MHIntra_luma_pred_modes(*pu.cu);
-    else
-#else
     if (!pu.mhIntraFlag)
-#endif
     {
-#if !JVET_N0217_MATRIX_INTRAPRED
-      m_CABACEstimator->extend_ref_line(pu);
-      m_CABACEstimator->isp_mode(*pu.cu);
-#endif
       m_CABACEstimator->intra_luma_pred_mode(pu);
     }
   }
@@ -3776,7 +2914,6 @@ bool IntraSearch::useDPCMForFirstPassIntraEstimation( const PredictionUnit &pu,
   return CU::isRDPCMEnabled( *pu.cu ) && pu.cu->transQuantBypass && (uiDirMode == HOR_IDX || uiDirMode == VER_IDX);
 }
 
-#if JVET_N0217_MATRIX_INTRAPRED
 template<typename T, size_t N>
 void IntraSearch::reduceHadCandList(static_vector<T, N>& candModeList, static_vector<double, N>& candCostList, int& numModesForFullRD, const double thresholdHadCost, const double thresholdHadCostConv)
 {
@@ -3833,4 +2970,3 @@ void IntraSearch::reduceHadCandList(static_vector<T, N>& candModeList, static_ve
   candCostList = tempCandCostList;
   numModesForFullRD = int(candModeList.size());
 }
-#endif
diff --git a/source/Lib/EncoderLib/IntraSearch.h b/source/Lib/EncoderLib/IntraSearch.h
index 568005bc9..fd005a552 100644
--- a/source/Lib/EncoderLib/IntraSearch.h
+++ b/source/Lib/EncoderLib/IntraSearch.h
@@ -76,7 +76,6 @@ private:
 
   CodingStructure **m_pSaveCS;
 
-#if JVET_N0217_MATRIX_INTRAPRED
   struct ModeInfo
   {
     bool     mipFlg; // CU::mipFlag
@@ -92,46 +91,22 @@ private:
   static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_rdModeListWithoutMrl;
   static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_rdModeListWithoutMrlHor;
   static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_rdModeListWithoutMrlVer;
-#else
-  static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM> m_rdModeListWithoutMrl;
-  static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM> m_rdModeListWithoutMrlHor;
-  static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM> m_rdModeListWithoutMrlVer;
-#endif
 
   //cost variables for the EMT algorithm and new modes list
-#if JVET_N0193_LFNST
   double     m_bestModeCostStore[ NUM_LFNST_NUM_PER_SET ];                                    // RD cost of the best mode for each PU using DCT2
   double     m_modeCostStore[ NUM_LFNST_NUM_PER_SET ][ NUM_LUMA_MODE ];                   // RD cost of each mode for each PU using DCT2
-#if JVET_N0217_MATRIX_INTRAPRED
   ModeInfo   m_savedRdModeList[ NUM_LFNST_NUM_PER_SET ][ NUM_LUMA_MODE ];
   int32_t    m_savedNumRdModes[ NUM_LFNST_NUM_PER_SET ];
-#else
-  uint32_t   m_savedRdModeList[ NUM_LFNST_NUM_PER_SET ][ NUM_LUMA_MODE ], m_savedNumRdModes[ NUM_LFNST_NUM_PER_SET ];
-#endif
-#if !JVET_N0217_MATRIX_INTRAPRED
-  int        m_savedExtendRefList[ NUM_LFNST_NUM_PER_SET ][ NUM_LUMA_MODE ];
-#endif
-#endif
 
   static_vector<double, FAST_UDI_MAX_RDMODE_NUM> m_intraModeDiagRatio;
   static_vector<double, FAST_UDI_MAX_RDMODE_NUM> m_intraModeHorVerRatio;
   static_vector<int,    FAST_UDI_MAX_RDMODE_NUM> m_intraModeTestedNormalIntra;
 
-#if JVET_N0193_LFNST
-#if JVET_N0217_MATRIX_INTRAPRED
   static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_uiSavedRdModeListLFNST;
   static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> m_uiSavedHadModeListLFNST;
-#else
-  static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM> m_uiSavedRdModeListLFNST;
-  static_vector<uint32_t, FAST_UDI_MAX_RDMODE_NUM> m_uiSavedHadModeListLFNST;
-#endif
   uint32_t                                         m_uiSavedNumRdModesLFNST;
   static_vector<double,   FAST_UDI_MAX_RDMODE_NUM> m_dSavedModeCostLFNST;
   static_vector<double,   FAST_UDI_MAX_RDMODE_NUM> m_dSavedHadListLFNST;
-#if !JVET_N0217_MATRIX_INTRAPRED
-  static_vector<int,      FAST_UDI_MAX_RDMODE_NUM> m_iSavedExtendRefListLFNST;
-#endif
-#endif
 
   PelStorage      m_tmpStorageLCU;
 protected:
@@ -175,11 +150,7 @@ public:
 
 public:
 
-#if JVET_N0193_LFNST
   bool estIntraPredLumaQT         ( CodingUnit &cu, Partitioner& pm, const double bestCostSoFar  = MAX_DOUBLE, bool mtsCheckRangeFlag = false, int mtsFirstCheckId = 0, int mtsLastCheckId = 0, bool moreProbMTSIdxFirst = false );
-#else
-  void estIntraPredLumaQT         ( CodingUnit &cu, Partitioner& pm, const double bestCostSoFar  = MAX_DOUBLE );
-#endif
   void estIntraPredChromaQT       ( CodingUnit &cu, Partitioner& pm, const double maxCostAllowed = MAX_DOUBLE );
   void IPCMSearch                 (CodingStructure &cs, Partitioner& partitioner);
   uint64_t xFracModeBitsIntra     (PredictionUnit &pu, const uint32_t &uiMode, const ChannelType &compID);
@@ -208,22 +179,16 @@ protected:
   void xIntraCodingTUBlock        (TransformUnit &tu, const ComponentID &compID, const bool &checkCrossCPrediction, Distortion& ruiDist, const int &default0Save1Load2 = 0, uint32_t* numSig = nullptr, std::vector<TrMode>* trModes=nullptr, const bool loadTr=false );
 
   ChromaCbfs xRecurIntraChromaCodingQT( CodingStructure &cs, Partitioner& pm, const double bestCostSoFar = MAX_DOUBLE,                          const PartSplit ispType = TU_NO_ISP );
-#if JVET_N0193_LFNST
   bool       xRecurIntraCodingLumaQT  ( CodingStructure &cs, Partitioner& pm, const double bestCostSoFar = MAX_DOUBLE, const int subTuIdx = -1, const PartSplit ispType = TU_NO_ISP, const bool ispIsCurrentWinner = false, bool mtsCheckRangeFlag = false, int mtsFirstCheckId = 0, int mtsLastCheckId = 0, bool moreProbMTSIdxFirst = false );
-#else
-  void       xRecurIntraCodingLumaQT  ( CodingStructure &cs, Partitioner& pm, const double bestCostSoFar = MAX_DOUBLE, const int subTuIdx = -1, const PartSplit ispType = TU_NO_ISP, const bool ispIsCurrentWinner = false );
-#endif
 
 
   void encPredIntraDPCM( const ComponentID &compID, PelBuf &pOrg, PelBuf &pDst, const uint32_t &uiDirMode );
   static bool useDPCMForFirstPassIntraEstimation( const PredictionUnit &pu, const uint32_t &uiDirMode );
 
-#if JVET_N0217_MATRIX_INTRAPRED
   template<typename T, size_t N>
   void reduceHadCandList(static_vector<T, N>& candModeList, static_vector<double, N>& candCostList, int& numModesForFullRD, const double thresholdHadCost, const double thresholdHadCostConv);
 
   double m_bestCostNonMip;
-#endif
 };// END CLASS DEFINITION EncSearch
 
 //! \}
diff --git a/source/Lib/EncoderLib/NALwrite.cpp b/source/Lib/EncoderLib/NALwrite.cpp
index 12c52ba4e..de6de5bb9 100644
--- a/source/Lib/EncoderLib/NALwrite.cpp
+++ b/source/Lib/EncoderLib/NALwrite.cpp
@@ -49,7 +49,6 @@ static const uint8_t emulation_prevention_three_byte = 3;
 void writeNalUnitHeader(ostream& out, OutputNALUnit& nalu)       // nal_unit_header()
 {
 OutputBitstream bsNALUHeader;
-#if JVET_N0067_NAL_Unit_Header
   bool zeroTidRequiredFlag = 0;
   if((nalu.m_nalUnitType >= 16) && (nalu.m_nalUnitType <= 31)) {
     zeroTidRequiredFlag = 1;
@@ -65,12 +64,6 @@ OutputBitstream bsNALUHeader;
 #endif
   bsNALUHeader.write(0, 1);                             // nuh_reserved_zero_bit
 
-#else
-  bsNALUHeader.write(0,1);                    // forbidden_zero_bit
-  bsNALUHeader.write(nalu.m_nalUnitType, 6);  // nal_unit_type
-  bsNALUHeader.write(nalu.m_nuhLayerId, 6);   // nuh_layer_id
-  bsNALUHeader.write(nalu.m_temporalId+1, 3); // nuh_temporal_id_plus1
-#endif
   out.write(reinterpret_cast<const char*>(bsNALUHeader.getByteStream()), bsNALUHeader.getByteStreamLength());
 }
 /**
diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp
index f88a0f2ed..a9afcce53 100644
--- a/source/Lib/EncoderLib/SEIEncoder.cpp
+++ b/source/Lib/EncoderLib/SEIEncoder.cpp
@@ -206,34 +206,6 @@ void SEIEncoder::initSEIToneMappingInfo(SEIToneMappingInfo *seiToneMappingInfo)
 
 void SEIEncoder::initSEISOPDescription(SEISOPDescription *sopDescriptionSEI, Slice *slice, int picInGOP, int lastIdr, int currGOPSize)
 {
-#if !JVET_M0128   //TODO: check if this SEI will be in VVC
-  CHECK(!(m_isInitialized), "Unspecified error");
-  CHECK(!(sopDescriptionSEI != NULL), "Unspecified error");
-  CHECK(!(slice != NULL), "Unspecified error");
-
-  int sopCurrPOC = slice->getPOC();
-  sopDescriptionSEI->m_sopSeqParameterSetId = slice->getSPS()->getSPSId();
-
-  int i = 0;
-  int prevEntryId = picInGOP;
-  for (int j = picInGOP; j < currGOPSize; j++)
-  {
-    int deltaPOC = m_pcCfg->getGOPEntry(j).m_POC - m_pcCfg->getGOPEntry(prevEntryId).m_POC;
-    if ((sopCurrPOC + deltaPOC) < m_pcCfg->getFramesToBeEncoded())
-    {
-      sopCurrPOC += deltaPOC;
-      sopDescriptionSEI->m_sopDescVclNaluType[i] = m_pcEncGOP->getNalUnitType(sopCurrPOC, lastIdr, slice->getPic()->fieldPic);
-      sopDescriptionSEI->m_sopDescTemporalId[i] = m_pcCfg->getGOPEntry(j).m_temporalId;
-      sopDescriptionSEI->m_sopDescStRpsIdx[i] = m_pcEncLib->getReferencePictureSetIdxForSOP(sopCurrPOC, j);
-      sopDescriptionSEI->m_sopDescPocDelta[i] = deltaPOC;
-
-      prevEntryId = j;
-      i++;
-    }
-  }
-
-  sopDescriptionSEI->m_numPicsInSopMinus1 = i - 1;
-#endif
 }
 
 void SEIEncoder::initSEIBufferingPeriod(SEIBufferingPeriod *bufferingPeriodSEI, Slice *slice)
@@ -248,13 +220,6 @@ void SEIEncoder::initSEIBufferingPeriod(SEIBufferingPeriod *bufferingPeriodSEI,
   bufferingPeriodSEI->m_initialCpbRemovalDelay      [0][1]     = uiInitialCpbRemovalDelay;
   bufferingPeriodSEI->m_initialCpbRemovalDelayOffset[0][1]     = uiInitialCpbRemovalDelay;
 
-#if !JVET_N0063_VUI
-  double dTmp = (double)slice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (double)slice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale();
-
-  uint32_t uiTmp = (uint32_t)( dTmp * 90000.0 );
-  uiInitialCpbRemovalDelay -= uiTmp;
-  uiInitialCpbRemovalDelay -= uiTmp / ( slice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2 );
-#endif
   bufferingPeriodSEI->m_initialAltCpbRemovalDelay      [0][0]  = uiInitialCpbRemovalDelay;
   bufferingPeriodSEI->m_initialAltCpbRemovalDelayOffset[0][0]  = uiInitialCpbRemovalDelay;
   bufferingPeriodSEI->m_initialAltCpbRemovalDelay      [0][1]  = uiInitialCpbRemovalDelay;
@@ -360,11 +325,7 @@ void SEIEncoder::initSEITempMotionConstrainedTileSets (SEITempMotionConstrainedT
   CHECK(!(sei!=NULL), "Unspecified error");
   CHECK(!(pps!=NULL), "Unspecified error");
 
-#if !JVET_N0857_TILES_BRICKS
-  if(pps->getTilesEnabledFlag())
-#else
   if(!pps->getSingleTileInPicFlag())
-#endif
   {
     if (m_pcCfg->getMCTSEncConstraint())
     {
diff --git a/source/Lib/EncoderLib/SEIwrite.cpp b/source/Lib/EncoderLib/SEIwrite.cpp
index 9d48630aa..8f1ce055b 100644
--- a/source/Lib/EncoderLib/SEIwrite.cpp
+++ b/source/Lib/EncoderLib/SEIwrite.cpp
@@ -246,7 +246,6 @@ void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei)
 
 void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const SPS *sps)
 {
-#if JVET_N0063_VUI
   WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
   if(sps->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
   {
@@ -257,30 +256,12 @@ void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const
   {
     WRITE_CODE(sei.m_picSptDpbOutputDuDelay, sps->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
   }
-#else
-  const VUI *vui = sps->getVuiParameters();
-  WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
-  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
-  {
-    WRITE_CODE( sei.m_duSptCpbRemovalDelay, (vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay_increment");
-  }
-  WRITE_FLAG( sei.m_dpbOutputDuDelayPresentFlag, "dpb_output_du_delay_present_flag");
-  if(sei.m_dpbOutputDuDelayPresentFlag)
-  {
-    WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
-  }
-#endif
 }
 
 void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const SPS *sps)
 {
   int i, nalOrVcl;
-#if JVET_N0063_VUI
   const HRDParameters *hrd = sps->getHrdParameters();
-#else
-  const VUI *vui = sps->getVuiParameters();
-  const HRDParameters *hrd = vui->getHrdParameters();
-#endif
 
   WRITE_UVLC( sei.m_bpSeqParameterSetId, "bp_seq_parameter_set_id" );
   if( !hrd->getSubPicCpbParamsPresentFlag() )
@@ -315,16 +296,8 @@ void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const SP
 void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const SPS *sps)
 {
   int i;
-#if JVET_N0063_VUI
   const HRDParameters *hrd = sps->getHrdParameters();
-#else
-  const VUI *vui = sps->getVuiParameters();
-  const HRDParameters *hrd = vui->getHrdParameters();
-#endif
 
-#if !JVET_N0063_VUI
-  if( vui->getFrameFieldInfoPresentFlag() )
-#endif
   {
     WRITE_CODE( sei.m_picStruct, 4,              "pic_struct" );
     WRITE_CODE( sei.m_sourceScanType, 2,         "source_scan_type" );
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 8f8f18e11..3436824ba 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -157,7 +157,6 @@ void AUDWriter::codeAUD(OutputBitstream& bs, const int pictureType)
   xWriteRbspTrailingBits();
 }
 
-#if JVET_M0128
 void HLSWriter::xCodeRefPicList(const ReferencePictureList* rpl, bool isLongTermPresent, uint32_t ltLsbBitsCount)
 {
   WRITE_UVLC(rpl->getNumberOfShorttermPictures() + rpl->getNumberOfLongtermPictures(), "num_ref_entries[ listIdx ][ rplsIdx ]");
@@ -192,60 +191,6 @@ void HLSWriter::xCodeRefPicList(const ReferencePictureList* rpl, bool isLongTerm
     }
   }
 }
-#else
-void HLSWriter::xCodeShortTermRefPicSet( const ReferencePictureSet* rps, bool calledFromSliceHeader, int idx)
-{
-  //int lastBits = getNumberOfWrittenBits();
-
-  if (idx > 0)
-  {
-    WRITE_FLAG( rps->getInterRPSPrediction(), "inter_ref_pic_set_prediction_flag" ); // inter_RPS_prediction_flag
-  }
-  if (rps->getInterRPSPrediction())
-  {
-    int deltaRPS = rps->getDeltaRPS();
-    if(calledFromSliceHeader)
-    {
-      WRITE_UVLC( rps->getDeltaRIdxMinus1(), "delta_idx_minus1" ); // delta index of the Reference Picture Set used for prediction minus 1
-    }
-
-    WRITE_CODE( (deltaRPS >=0 ? 0: 1), 1, "delta_rps_sign" ); //delta_rps_sign
-    WRITE_UVLC( abs(deltaRPS) - 1, "abs_delta_rps_minus1"); // absolute delta RPS minus 1
-
-    for(int j=0; j < rps->getNumRefIdc(); j++)
-    {
-      int refIdc = rps->getRefIdc(j);
-      WRITE_CODE( (refIdc==1? 1: 0), 1, "used_by_curr_pic_flag" ); //first bit is "1" if Idc is 1
-      if (refIdc != 1)
-      {
-        WRITE_CODE( refIdc>>1, 1, "use_delta_flag" ); //second bit is "1" if Idc is 2, "0" otherwise.
-      }
-    }
-  }
-  else
-  {
-    WRITE_UVLC( rps->getNumberOfNegativePictures(), "num_negative_pics" );
-    WRITE_UVLC( rps->getNumberOfPositivePictures(), "num_positive_pics" );
-    int prev = 0;
-    for(int j=0 ; j < rps->getNumberOfNegativePictures(); j++)
-    {
-      WRITE_UVLC( prev-rps->getDeltaPOC(j)-1, "delta_poc_s0_minus1" );
-      prev = rps->getDeltaPOC(j);
-      WRITE_FLAG( rps->getUsed(j), "used_by_curr_pic_s0_flag");
-    }
-    prev = 0;
-    for(int j=rps->getNumberOfNegativePictures(); j < rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures(); j++)
-    {
-      WRITE_UVLC( rps->getDeltaPOC(j)-prev-1, "delta_poc_s1_minus1" );
-      prev = rps->getDeltaPOC(j);
-      WRITE_FLAG( rps->getUsed(j), "used_by_curr_pic_s1_flag" );
-    }
-  }
-
-  //DTRACE( g_trace_ctx, D_RPSINFO, "irps=%d (%2d bits) ", rps->getInterRPSPrediction(), getNumberOfWrittenBits() - lastBits );
-  rps->printDeltaPOC();
-}
-#endif
 
 void HLSWriter::codePPS( const PPS* pcPPS )
 {
@@ -260,9 +205,7 @@ void HLSWriter::codePPS( const PPS* pcPPS )
   WRITE_FLAG( pcPPS->getCabacInitPresentFlag() ? 1 : 0,   "cabac_init_present_flag" );
   WRITE_UVLC( pcPPS->getNumRefIdxL0DefaultActive()-1,     "num_ref_idx_l0_default_active_minus1");
   WRITE_UVLC( pcPPS->getNumRefIdxL1DefaultActive()-1,     "num_ref_idx_l1_default_active_minus1");
-#if JVET_M0128
   WRITE_FLAG(pcPPS->getRpl1IdxPresentFlag() ? 1 : 0, "rpl1IdxPresentFlag");
-#endif
 
   WRITE_SVLC( pcPPS->getPicInitQPMinus26(),                  "init_qp_minus26");
   WRITE_FLAG( pcPPS->getConstrainedIntraPred() ? 1 : 0,      "constrained_intra_pred_flag" );
@@ -275,9 +218,7 @@ void HLSWriter::codePPS( const PPS* pcPPS )
 
   WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" );
   WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" );
-#if JVET_N0054_JOINT_CHROMA
   WRITE_SVLC( pcPPS->getQpOffset(JOINT_CbCr),   "pps_cb_cr_qp_offset" );
-#endif
 
   WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0,          "pps_slice_chroma_qp_offsets_present_flag" );
 
@@ -285,7 +226,6 @@ void HLSWriter::codePPS( const PPS* pcPPS )
   WRITE_FLAG( pcPPS->getWPBiPred() ? 1 : 0, "weighted_bipred_flag" );  // Use of Weighting Bi-Prediction (B_SLICE)
   WRITE_FLAG( pcPPS->getTransquantBypassEnabledFlag()  ? 1 : 0, "transquant_bypass_enabled_flag" );
 
-#if JVET_N0857_TILES_BRICKS
   WRITE_FLAG( pcPPS->getSingleTileInPicFlag() ? 1 : 0, "single_tile_in_pic_flag" );
   if (!pcPPS->getSingleTileInPicFlag())
   {
@@ -349,42 +289,15 @@ void HLSWriter::codePPS( const PPS* pcPPS )
       int numSlicesInPic = pcPPS->getNumSlicesInPicMinus1() + 1;
       int numTilesInPic = (pcPPS->getNumTileColumnsMinus1() + 1) * (pcPPS->getNumTileRowsMinus1() + 1);
       int codeLength = (int)ceil(log2(numTilesInPic));
-#if JVET_N0124_PROPOSAL2
       int codeLength2 = codeLength;
-#endif
       for (int i = 0; i < numSlicesInPic; ++i)
       {
         if (i > 0)
         {
-#if JVET_N0857_RECT_SLICES
           WRITE_CODE(pcPPS->getTopLeftBrickIdx(i), codeLength, "top_left_brick_idx ");
-#if JVET_N0124_PROPOSAL2
-#if JVET_N0857_RECT_SLICES
           codeLength2 = (int)ceil(log2((numTilesInPic - pcPPS->getTopLeftBrickIdx(i) < 2) ? 2 : numTilesInPic - pcPPS->getTopLeftBrickIdx(i)));
-#else
-          codeLength2 = (int)ceil(log2(numTilesInPic - pcPPS->getTopLeftBrickIdx(i)));
-#endif
-#endif
-#else
-          WRITE_CODE( pcPPS->getTopLeftTileIdx(i), codeLength, "top_left_brick_idx ");
-#if JVET_N0124_PROPOSAL2
-          codeLength2 = (int)ceil(log2(numTilesInPic - pcPPS->getTopLeftTileIdx(i)));
-#endif
-#endif
         }
-#if JVET_N0857_RECT_SLICES
-#if JVET_N0124_PROPOSAL2
         WRITE_CODE(pcPPS->getBottomRightBrickIdx(i) - pcPPS->getTopLeftBrickIdx(i), codeLength2, "bottom_right_brick_idx_delta");
-#else
-        WRITE_CODE(pcPPS->getBottomRightBrickIdx(i) - pcPPS->getTopLeftBrickIdx(i), codeLength, "bottom_right_brick_idx_delta");
-#endif
-#else
-#if JVET_N0124_PROPOSAL2
-        WRITE_CODE(pcPPS->getBottomeRightTileIdx(i) - pcPPS->getTopLeftTileIdx(i), codeLength2, "bottom_right_brick_idx_delta");
-#else
-        WRITE_CODE(pcPPS->getBottomeRightTileIdx(i) - pcPPS->getTopLeftTileIdx(i), codeLength, "bottom_right_brick_idx_delta");
-#endif
-#endif
       }
     }
 
@@ -396,10 +309,8 @@ void HLSWriter::codePPS( const PPS* pcPPS )
   }
   else
   {
-#if JVET_N0124_PROPOSAL1
 	// make sure single brick per slice is set by encoder such that the behaviour is same as for setting it to true
 	CHECK(pcPPS->getSingleBrickPerSliceFlag() != true, "SingleBrickPerSliceFlag must be set to 1 when not present");
-#endif
     // make sure rect_slice_flag is set
     CHECK (pcPPS->getRectSliceFlag()!=true, "RectSliceFlag must be equalt to 1 for single_tile_in_pic_flag equal to 1");
   }
@@ -418,32 +329,8 @@ void HLSWriter::codePPS( const PPS* pcPPS )
       }
     }
   }
-#endif
 
 
-#if !JVET_N0857_TILES_BRICKS
-  WRITE_FLAG( pcPPS->getTilesEnabledFlag() ? 1 : 0, "tiles_enabled_flag" );
-  if( pcPPS->getTilesEnabledFlag() )
-  {
-    WRITE_UVLC( pcPPS->getNumTileColumnsMinus1(),                                    "num_tile_columns_minus1" );
-    WRITE_UVLC( pcPPS->getNumTileRowsMinus1(),                                       "num_tile_rows_minus1" );
-    WRITE_FLAG( pcPPS->getUniformTileSpacingFlag(),                                  "uniform_spacing_flag" );
-    if( !pcPPS->getUniformTileSpacingFlag() )
-    {
-      for(uint32_t i=0; i<pcPPS->getNumTileColumnsMinus1(); i++)
-      {
-        WRITE_UVLC( pcPPS->getTileColumnWidth(i)-1,                                  "column_width_minus1" );
-      }
-      for(uint32_t i=0; i<pcPPS->getNumTileRowsMinus1(); i++)
-      {
-        WRITE_UVLC( pcPPS->getTileRowHeight(i)-1,                                    "row_height_minus1" );
-      }
-    }
-    CHECK ((pcPPS->getNumTileColumnsMinus1() + pcPPS->getNumTileRowsMinus1()) == 0, "Invalid tile parameters read");
-    WRITE_FLAG( pcPPS->getLoopFilterAcrossBricksEnabledFlag()?1 : 0,       "loop_filter_across_tiles_enabled_flag");
-  }
-  WRITE_FLAG( pcPPS->getLoopFilterAcrossSlicesEnabledFlag()?1 : 0,        "pps_loop_filter_across_slices_enabled_flag");
-#endif
   WRITE_FLAG( pcPPS->getEntropyCodingSyncEnabledFlag() ? 1 : 0, "entropy_coding_sync_enabled_flag" );
 
   WRITE_FLAG( pcPPS->getDeblockingFilterControlPresentFlag()?1 : 0,       "deblocking_filter_control_present_flag");
@@ -458,7 +345,6 @@ void HLSWriter::codePPS( const PPS* pcPPS )
     }
   }
 
-#if JVET_N0438_LOOP_FILTER_DISABLED_ACROSS_VIR_BOUND
   WRITE_FLAG( pcPPS->getLoopFilterAcrossVirtualBoundariesDisabledFlag() ? 1 : 0,     "pps_loop_filter_across_virtual_boundaries_disabled_flag" );
   if( pcPPS->getLoopFilterAcrossVirtualBoundariesDisabledFlag() )
   {
@@ -475,18 +361,12 @@ void HLSWriter::codePPS( const PPS* pcPPS )
       WRITE_CODE( pcPPS->getVirtualBoundariesPosY( i ) >> 3, numBits,                "pps_virtual_boundaries_pos_y" );
     }
   }
-#endif
 
-#if HEVC_USE_SCALING_LISTS
   WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" );
   if( pcPPS->getScalingListPresentFlag() )
   {
     codeScalingList( pcPPS->getScalingList() );
   }
-#endif
-#if !JVET_M0128
-  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
-#endif
   WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2");
   WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
 
@@ -571,7 +451,6 @@ void HLSWriter::codeAPS( APS* pcAPS )
   xTraceAPSHeader();
 #endif
 
-#if JVET_N0805_APS_LMCS
   WRITE_CODE(pcAPS->getAPSId(), 5, "adaptation_parameter_set_id");
   WRITE_CODE(pcAPS->getAPSType(), 3, "aps_params_type");
   
@@ -586,111 +465,18 @@ void HLSWriter::codeAPS( APS* pcAPS )
   }
   WRITE_FLAG(0, "aps_extension_flag");   //Implementation when this flag is equal to 1 should be added when it is needed. Currently in the spec we don't have case when this flag is equal to 1
   xWriteRbspTrailingBits();
-#else
-  AlfSliceParam param = pcAPS->getAlfAPSParam();
-#if !JVET_N0805_APS_LMCS
-  WRITE_CODE(pcAPS->getAPSId(), 5, "adaptation_parameter_set_id");
-#endif
-
-#if !JVET_N0415_CTB_ALF
-  const int alfChromaIdc = param.enabledFlag[COMPONENT_Cb] * 2 + param.enabledFlag[COMPONENT_Cr];
-  truncatedUnaryEqProb(alfChromaIdc, 3);   // alf_chroma_idc
-
-#if JVET_N0242_NON_LINEAR_ALF
-  WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip" );
-  if( alfChromaIdc )
-  {
-    WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_clip" );
-  }
-#endif
-#else
-  WRITE_FLAG(param.newFilterFlag[CHANNEL_TYPE_LUMA], "alf_luma_new_filter");
-  WRITE_FLAG(param.newFilterFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_new_filter");
-
-  if (param.newFilterFlag[CHANNEL_TYPE_LUMA])
-  {
-#if JVET_N0242_NON_LINEAR_ALF
-    WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip");
-#endif
-#endif
-
-  xWriteTruncBinCode(param.numLumaFilters - 1, MAX_NUM_ALF_CLASSES);  //number_of_filters_minus1
-  if (param.numLumaFilters > 1)
-  {
-    for (int i = 0; i < MAX_NUM_ALF_CLASSES; i++)
-    {
-      xWriteTruncBinCode((uint32_t)param.filterCoeffDeltaIdx[i], param.numLumaFilters);  //filter_coeff_delta[i]
-    }
-  }
-
-#if JVET_N0415_CTB_ALF
-  WRITE_FLAG(param.fixedFilterSetIndex > 0 ? 1 : 0, "fixed_filter_set_flag");
-  if (param.fixedFilterSetIndex > 0)
-  {
-    xWriteTruncBinCode(param.fixedFilterSetIndex - 1, NUM_FIXED_FILTER_SETS);
-    WRITE_FLAG(param.fixedFilterPattern, "fixed_filter_flag_pattern");
-    for (int classIdx = 0; classIdx < MAX_NUM_ALF_CLASSES; classIdx++)
-    {
-      if (param.fixedFilterPattern > 0)
-      {
-        WRITE_FLAG(param.fixedFilterIdx[classIdx], "fixed_filter_flag");
-      }
-      else
-      {
-        CHECK(param.fixedFilterIdx[classIdx] != 1, "Disabled fixed filter");
-      }
-    }
-  }
-#endif
-
-  alfFilter(param, false);
-
-#if JVET_N0415_CTB_ALF
-  }
-  if (param.newFilterFlag[CHANNEL_TYPE_CHROMA])
-  {
-#if JVET_N0242_NON_LINEAR_ALF
-    WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_clip");
-#endif
-#else
-  if (alfChromaIdc)
-  {
-#endif
-    alfFilter(param, true);
-  }
-  xWriteRbspTrailingBits();
-#endif
 }
 
-#if JVET_N0805_APS_LMCS
 void HLSWriter::codeAlfAps( APS* pcAPS )
 {
   AlfSliceParam param = pcAPS->getAlfAPSParam();
-#if !JVET_N0805_APS_LMCS
-  WRITE_CODE(pcAPS->getAPSId(), 5, "adaptation_parameter_set_id");
-#endif
 
-#if !JVET_N0415_CTB_ALF
-  const int alfChromaIdc = param.enabledFlag[COMPONENT_Cb] * 2 + param.enabledFlag[COMPONENT_Cr];
-  truncatedUnaryEqProb(alfChromaIdc, 3);   // alf_chroma_idc
-
-#if JVET_N0242_NON_LINEAR_ALF
-  WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip");
-  if (alfChromaIdc)
-  {
-    WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_clip");
-  }
-#endif
-#else
   WRITE_FLAG(param.newFilterFlag[CHANNEL_TYPE_LUMA], "alf_luma_new_filter");
   WRITE_FLAG(param.newFilterFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_new_filter");
 
   if (param.newFilterFlag[CHANNEL_TYPE_LUMA])
   {
-#if JVET_N0242_NON_LINEAR_ALF
     WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip");
-#endif
-#endif
 
     xWriteTruncBinCode(param.numLumaFilters - 1, MAX_NUM_ALF_CLASSES);  //number_of_filters_minus1
     if (param.numLumaFilters > 1)
@@ -701,7 +487,6 @@ void HLSWriter::codeAlfAps( APS* pcAPS )
       }
     }
 
-#if JVET_N0415_CTB_ALF
     WRITE_FLAG(param.fixedFilterSetIndex > 0 ? 1 : 0, "fixed_filter_set_flag");
     if (param.fixedFilterSetIndex > 0)
     {
@@ -719,21 +504,13 @@ void HLSWriter::codeAlfAps( APS* pcAPS )
         }
       }
     }
-#endif
 
     alfFilter(param, false);
 
-#if JVET_N0415_CTB_ALF
   }
   if (param.newFilterFlag[CHANNEL_TYPE_CHROMA])
   {
-#if JVET_N0242_NON_LINEAR_ALF
     WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_clip");
-#endif
-#else
-    if (alfChromaIdc)
-    {
-#endif
       alfFilter(param, true);
   }
 }
@@ -758,7 +535,6 @@ void HLSWriter::codeLmcsAps( APS* pcAPS )
     }
   }
 }
-#endif
 
 void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS )
 {
@@ -766,7 +542,6 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS )
   DTRACE( g_trace_ctx, D_HEADER, "----------- vui_parameters -----------\n");
 #endif
 
-#if JVET_N0063_VUI
 
   WRITE_FLAG(pcVUI->getAspectRatioInfoPresentFlag(),            "aspect_ratio_info_present_flag");
   if (pcVUI->getAspectRatioInfoPresentFlag())
@@ -810,88 +585,6 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS )
     WRITE_FLAG(pcVUI->getVideoFullRangeFlag(),                  "video_full_range_flag");
   }
 
-#else
-
-  WRITE_FLAG(pcVUI->getAspectRatioInfoPresentFlag(),            "aspect_ratio_info_present_flag");
-  if (pcVUI->getAspectRatioInfoPresentFlag())
-  {
-    WRITE_CODE(pcVUI->getAspectRatioIdc(), 8,                   "aspect_ratio_idc" );
-    if (pcVUI->getAspectRatioIdc() == 255)
-    {
-      WRITE_CODE(pcVUI->getSarWidth(), 16,                      "sar_width");
-      WRITE_CODE(pcVUI->getSarHeight(), 16,                     "sar_height");
-    }
-  }
-  WRITE_FLAG(pcVUI->getOverscanInfoPresentFlag(),               "overscan_info_present_flag");
-  if (pcVUI->getOverscanInfoPresentFlag())
-  {
-    WRITE_FLAG(pcVUI->getOverscanAppropriateFlag(),             "overscan_appropriate_flag");
-  }
-  WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(),            "video_signal_type_present_flag");
-  if (pcVUI->getVideoSignalTypePresentFlag())
-  {
-    WRITE_CODE(pcVUI->getVideoFormat(), 3,                      "video_format");
-    WRITE_FLAG(pcVUI->getVideoFullRangeFlag(),                  "video_full_range_flag");
-    WRITE_FLAG(pcVUI->getColourDescriptionPresentFlag(),        "colour_description_present_flag");
-    if (pcVUI->getColourDescriptionPresentFlag())
-    {
-      WRITE_CODE(pcVUI->getColourPrimaries(), 8,                "colour_primaries");
-      WRITE_CODE(pcVUI->getTransferCharacteristics(), 8,        "transfer_characteristics");
-      WRITE_CODE(pcVUI->getMatrixCoefficients(), 8,             "matrix_coeffs");
-    }
-  }
-
-  WRITE_FLAG(pcVUI->getChromaLocInfoPresentFlag(),              "chroma_loc_info_present_flag");
-  if (pcVUI->getChromaLocInfoPresentFlag())
-  {
-    WRITE_UVLC(pcVUI->getChromaSampleLocTypeTopField(),         "chroma_sample_loc_type_top_field");
-    WRITE_UVLC(pcVUI->getChromaSampleLocTypeBottomField(),      "chroma_sample_loc_type_bottom_field");
-  }
-
-  WRITE_FLAG(pcVUI->getNeutralChromaIndicationFlag(),           "neutral_chroma_indication_flag");
-  WRITE_FLAG(pcVUI->getFieldSeqFlag(),                          "field_seq_flag");
-  WRITE_FLAG(pcVUI->getFrameFieldInfoPresentFlag(),             "frame_field_info_present_flag");
-
-  Window defaultDisplayWindow = pcVUI->getDefaultDisplayWindow();
-  WRITE_FLAG(defaultDisplayWindow.getWindowEnabledFlag(),       "default_display_window_flag");
-  if( defaultDisplayWindow.getWindowEnabledFlag() )
-  {
-    WRITE_UVLC(defaultDisplayWindow.getWindowLeftOffset()  / SPS::getWinUnitX(pcSPS->getChromaFormatIdc()), "def_disp_win_left_offset");
-    WRITE_UVLC(defaultDisplayWindow.getWindowRightOffset() / SPS::getWinUnitX(pcSPS->getChromaFormatIdc()), "def_disp_win_right_offset");
-    WRITE_UVLC(defaultDisplayWindow.getWindowTopOffset()   / SPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_top_offset");
-    WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset()/ SPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_bottom_offset");
-  }
-  const TimingInfo *timingInfo = pcVUI->getTimingInfo();
-  WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(),          "vui_timing_info_present_flag");
-  if(timingInfo->getTimingInfoPresentFlag())
-  {
-    WRITE_CODE(timingInfo->getNumUnitsInTick(), 32,           "vui_num_units_in_tick");
-    WRITE_CODE(timingInfo->getTimeScale(),      32,           "vui_time_scale");
-    WRITE_FLAG(timingInfo->getPocProportionalToTimingFlag(),  "vui_poc_proportional_to_timing_flag");
-    if(timingInfo->getPocProportionalToTimingFlag())
-    {
-      WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(),   "vui_num_ticks_poc_diff_one_minus1");
-    }
-    WRITE_FLAG(pcVUI->getHrdParametersPresentFlag(),              "vui_hrd_parameters_present_flag");
-    if( pcVUI->getHrdParametersPresentFlag() )
-    {
-      codeHrdParameters(pcVUI->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
-    }
-  }
-
-  WRITE_FLAG(pcVUI->getBitstreamRestrictionFlag(),              "bitstream_restriction_flag");
-  if (pcVUI->getBitstreamRestrictionFlag())
-  {
-    WRITE_FLAG(pcVUI->getTilesFixedStructureFlag(),             "tiles_fixed_structure_flag");
-    WRITE_FLAG(pcVUI->getMotionVectorsOverPicBoundariesFlag(),  "motion_vectors_over_pic_boundaries_flag");
-    WRITE_FLAG(pcVUI->getRestrictedRefPicListsFlag(),           "restricted_ref_pic_lists_flag");
-    WRITE_UVLC(pcVUI->getMinSpatialSegmentationIdc(),           "min_spatial_segmentation_idc");
-    WRITE_UVLC(pcVUI->getMaxBytesPerPicDenom(),                 "max_bytes_per_pic_denom");
-    WRITE_UVLC(pcVUI->getMaxBitsPerMinCuDenom(),                "max_bits_per_min_cu_denom");
-    WRITE_UVLC(pcVUI->getLog2MaxMvLengthHorizontal(),           "log2_max_mv_length_horizontal");
-    WRITE_UVLC(pcVUI->getLog2MaxMvLengthVertical(),             "log2_max_mv_length_vertical");
-  }
-#endif
 }
 
 void HLSWriter::codeHrdParameters( const HRDParameters *hrd, bool commonInfPresentFlag, uint32_t maxNumSubLayersMinus1 )
@@ -965,85 +658,16 @@ void HLSWriter::codeHrdParameters( const HRDParameters *hrd, bool commonInfPrese
   }
 }
 
-#if !JVET_N0805_APS_LMCS
-void HLSWriter::codeReshaper(const SliceReshapeInfo& pSliceReshaperInfo, const SPS* pcSPS, const bool isIntra)
-{
-  WRITE_FLAG(pSliceReshaperInfo.getSliceReshapeModelPresentFlag() ? 1 : 0, "tile_group_reshaper_model_present_flag");
-  if (pSliceReshaperInfo.getSliceReshapeModelPresentFlag())
-  {
-    WRITE_UVLC(pSliceReshaperInfo.reshaperModelMinBinIdx, "reshaper_model_min_bin_idx");
-    WRITE_UVLC(PIC_CODE_CW_BINS - 1 - pSliceReshaperInfo.reshaperModelMaxBinIdx, "reshaper_model_delta_max_bin_idx");
-    assert(pSliceReshaperInfo.maxNbitsNeededDeltaCW > 0);
-    WRITE_UVLC(pSliceReshaperInfo.maxNbitsNeededDeltaCW - 1, "reshaper_model_bin_delta_abs_cw_prec_minus1");
-
-    for (int i = pSliceReshaperInfo.reshaperModelMinBinIdx; i <= pSliceReshaperInfo.reshaperModelMaxBinIdx; i++)
-    {
-      int deltaCW = pSliceReshaperInfo.reshaperModelBinCWDelta[i];
-      int signCW = (deltaCW < 0) ? 1 : 0;
-      int absCW = (deltaCW < 0) ? (-deltaCW) : deltaCW;
-      WRITE_CODE(absCW, pSliceReshaperInfo.maxNbitsNeededDeltaCW, "reshaper_model_bin_delta_abs_CW");
-      if (absCW > 0)
-      {
-        WRITE_FLAG(signCW, "reshaper_model_bin_delta_sign_CW_flag");
-      }
-    }
-  }
-
-  WRITE_FLAG(pSliceReshaperInfo.getUseSliceReshaper() ? 1 : 0, "tile_group_reshaper_enable_flag");
-
-  if (!pSliceReshaperInfo.getUseSliceReshaper())
-    return;
-
-  if (!(pcSPS->getUseDualITree() && isIntra))
-    WRITE_FLAG(pSliceReshaperInfo.getSliceReshapeChromaAdj(), "tile_group_reshaper_chroma_residual_scale_flag");
-};
-#endif
 
 void HLSWriter::codeSPS( const SPS* pcSPS )
 {
 #if ENABLE_TRACING
   xTraceSPSHeader ();
 #endif
-#if JVET_N0349_DPS
   WRITE_CODE( pcSPS->getDecodingParameterSetId (), 4,       "sps_decoding_parameter_set_id" );
-#endif
 #if HEVC_VPS
   WRITE_CODE( pcSPS->getVPSId (),          4,       "sps_video_parameter_set_id" );
 #endif
-#if !JVET_M0101_HLS
-  WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
-
-  WRITE_FLAG(pcSPS->getIntraOnlyConstraintFlag() ? 1 : 0, "intra_only_constraint_flag");
-  WRITE_CODE(pcSPS->getMaxBitDepthConstraintIdc(), 4, "max_bitdepth_constraint_idc");
-  WRITE_CODE(pcSPS->getMaxChromaFormatConstraintIdc(), 2, "max_chroma_format_constraint_idc");
-  WRITE_FLAG(pcSPS->getFrameConstraintFlag() ? 1 : 0, "frame_only_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoQtbttDualTreeIntraConstraintFlag() ? 1 : 0, "no_qtbtt_dual_tree_intra_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoSaoConstraintFlag() ? 1 : 0, "no_sao_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoAlfConstraintFlag() ? 1 : 0, "no_alf_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoPcmConstraintFlag() ? 1 : 0, "no_pcm_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoRefWraparoundConstraintFlag() ? 1 : 0, "no_ref_wraparound_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoTemporalMvpConstraintFlag() ? 1 : 0, "no_temporal_mvp_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoSbtmvpConstraintFlag() ? 1 : 0, "no_sbtmvp_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoAmvrConstraintFlag() ? 1 : 0, "no_amvr_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoBdofConstraintFlag() ? 1 : 0, "no_bdof_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoCclmConstraintFlag() ? 1 : 0, "no_cclm_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoMtsConstraintFlag() ? 1 : 0, "no_mts_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoAffineMotionConstraintFlag() ? 1 : 0, "no_affine_motion_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoGbiConstraintFlag() ? 1 : 0, "no_gbi_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoMhIntraConstraintFlag() ? 1 : 0, "no_mh_intra_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoTriangleConstraintFlag() ? 1 : 0, "no_triangle_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoLadfConstraintFlag() ? 1 : 0, "no_ladf_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoCurrPicRefConstraintFlag() ? 1 : 0, "no_curr_pic_ref_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoQpDeltaConstraintFlag() ? 1 : 0, "no_qp_delta_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoDepQuantConstraintFlag() ? 1 : 0, "no_dep_quant_constraint_flag");
-  WRITE_FLAG(pcSPS->getNoSignDataHidingConstraintFlag() ? 1 : 0, "no_sign_data_hiding_constraint_flag");
-
-  CHECK( pcSPS->getMaxTLayers() == 0, "Maximum number of temporal sub-layers is '0'" );
-  WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
-
-  WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0, "sps_temporal_id_nesting_flag" );
-  codePTL( pcSPS->getPTL(), true, pcSPS->getMaxTLayers() - 1 );
-#else
   CHECK(pcSPS->getMaxTLayers() == 0, "Maximum number of temporal sub-layers is '0'");
 
   WRITE_CODE(pcSPS->getMaxTLayers() - 1, 3, "sps_max_sub_layers_minus1");
@@ -1052,7 +676,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
   codeProfileTierLevel( pcSPS->getProfileTierLevel(), pcSPS->getMaxTLayers() - 1 );
 
   WRITE_UVLC(pcSPS->getSPSId (), "sps_seq_parameter_set_id");
-#endif
 
   WRITE_UVLC( int(pcSPS->getChromaFormatIdc ()),    "chroma_format_idc" );
 
@@ -1082,9 +705,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
   WRITE_UVLC( chromaEnabled ? (pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA) - 8):0,  "bit_depth_chroma_minus8" );
 
   WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
-#if JVET_N0047_Merge_IDR_Non_IDR
   WRITE_FLAG( pcSPS->getIDRRefParamListPresent(),                 "sps_idr_rpl_present_flag" );
-#endif
   // KJS: Marakech decision: sub-layers added back
   const bool subLayerOrderingInfoPresentFlag = 1;
   WRITE_FLAG(subLayerOrderingInfoPresentFlag,       "sps_sub_layer_ordering_info_present_flag");
@@ -1099,7 +720,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
     }
   }
   CHECK( pcSPS->getMaxCUWidth() != pcSPS->getMaxCUHeight(),                          "Rectangular CTUs not supported" );
-#if JVET_M0128
   WRITE_FLAG(pcSPS->getLongTermRefsPresent() ? 1 : 0, "long_term_ref_pics_flag");
   WRITE_FLAG(pcSPS->getRPL1CopyFromRPL0Flag() ? 1 : 0, "rpl1_copy_from_rpl0_flag");
 
@@ -1127,7 +747,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
       xCodeRefPicList(rpl, pcSPS->getLongTermRefsPresent(), pcSPS->getBitsForPOC());
     }
   }
-#endif
   WRITE_FLAG(pcSPS->getUseDualITree(), "qtbtt_dual_tree_intra_flag");
   WRITE_UVLC(g_aucLog2[pcSPS->getCTUSize()] - MIN_CU_LOG2, "log2_ctu_size_minus2");
   WRITE_UVLC(pcSPS->getLog2MinCodingBlockSize() - 2, "log2_min_luma_coding_block_size_minus2");
@@ -1174,18 +793,14 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
     WRITE_FLAG( pcSPS->getPCMFilterDisableFlag()?1 : 0,                              "pcm_loop_filter_disable_flag");
   }
 
-#if JVET_N0070_WRAPAROUND
   if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() )
   {    
-#endif
   WRITE_FLAG( pcSPS->getWrapAroundEnabledFlag() ? 1 : 0,                              "sps_ref_wraparound_enabled_flag" );
   if( pcSPS->getWrapAroundEnabledFlag() )
   {
     WRITE_UVLC( (pcSPS->getWrapAroundOffset()/(1 <<  pcSPS->getLog2MinCodingBlockSize()))-1,  "sps_ref_wraparound_offset_minus1" );
   }
-#if JVET_N0070_WRAPAROUND
   }
-#endif
 
   WRITE_FLAG( pcSPS->getSPSTemporalMVPEnabledFlag()  ? 1 : 0,                        "sps_temporal_mvp_enabled_flag" );
 
@@ -1201,9 +816,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
   WRITE_FLAG( pcSPS->getAffineAmvrEnabledFlag() ? 1 : 0,                             "sps_affine_amvr_enabled_flag" );
 
   WRITE_FLAG( pcSPS->getUseDMVR() ? 1 : 0,                                            "sps_dmvr_enable_flag" );
-#if JVET_N0127_MMVD_SPS_FLAG
   WRITE_FLAG(pcSPS->getUseMMVD() ? 1 : 0,                                             "sps_mmvd_enable_flag");
-#endif
   // KJS: sps_cclm_enabled_flag
   WRITE_FLAG( pcSPS->getUseLMChroma() ? 1 : 0,                                                 "lm_chroma_enabled_flag" );
   if ( pcSPS->getUseLMChroma() && pcSPS->getChromaFormatIdc() == CHROMA_420 )
@@ -1217,12 +830,8 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
     WRITE_FLAG( pcSPS->getUseIntraMTS() ? 1 : 0,                                               "mts_intra_enabled_flag" );
     WRITE_FLAG( pcSPS->getUseInterMTS() ? 1 : 0,                                               "mts_inter_enabled_flag" );
   }
-#if JVET_N0193_LFNST
   WRITE_FLAG( pcSPS->getUseLFNST() ? 1 : 0,                                                    "lfnst_enabled_flag" );
-#endif
-#if JVET_N0235_SMVD_SPS
   WRITE_FLAG( pcSPS->getUseSMVD() ? 1 : 0,                                                     "smvd_flag" );
-#endif
   // KJS: sps_affine_enabled_flag
   WRITE_FLAG( pcSPS->getUseAffine() ? 1 : 0,                                                   "affine_flag" );
   if ( pcSPS->getUseAffine() )
@@ -1235,20 +844,14 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
   // KJS: sps_ciip_enabled_flag
   WRITE_FLAG( pcSPS->getUseMHIntra() ? 1 : 0,                                                  "mhintra_flag" );
 
-#if JVET_N0127_MMVD_SPS_FLAG
   if ( pcSPS->getUseMMVD() )
   {
     WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0,                            "sps_fpel_mmvd_enabled_flag" );
   }
-#else
-  WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0,                            "sps_fpel_mmvd_enabled_flag" );
-#endif
 
   WRITE_FLAG( pcSPS->getUseTriangle() ? 1: 0,                                                  "triangle_flag" );
 
-#if JVET_N0217_MATRIX_INTRAPRED
   WRITE_FLAG( pcSPS->getUseMIP() ? 1: 0,                                                       "sps_mip_flag" );
-#endif
   // KJS: not in draft yet
   WRITE_FLAG( pcSPS->getUseSBT() ? 1 : 0,                                             "sbt_enable_flag");
   if( pcSPS->getUseSBT() )
@@ -1276,34 +879,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
 #endif
 
   // KJS: reference picture sets to be replaced
-#if !JVET_M0128
-  const RPSList* rpsList = pcSPS->getRPSList();
 
-  WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" );
-  for(int i=0; i < rpsList->getNumberOfReferencePictureSets(); i++)
-  {
-    const ReferencePictureSet*rps = rpsList->getReferencePictureSet(i);
-    xCodeShortTermRefPicSet( rps,false, i);
-  }
-  WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0,         "long_term_ref_pics_present_flag" );
-  if (pcSPS->getLongTermRefsPresent())
-  {
-    WRITE_UVLC(pcSPS->getNumLongTermRefPicSPS(), "num_long_term_ref_pics_sps" );
-    for (uint32_t k = 0; k < pcSPS->getNumLongTermRefPicSPS(); k++)
-    {
-      WRITE_CODE( pcSPS->getLtRefPicPocLsbSps(k), pcSPS->getBitsForPOC(), "lt_ref_pic_poc_lsb_sps");
-      WRITE_FLAG( pcSPS->getUsedByCurrPicLtSPSFlag(k), "used_by_curr_pic_lt_sps_flag[i]");
-    }
-  }
-#endif
-
-#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
-  WRITE_FLAG( pcSPS->getUseStrongIntraSmoothing(),             "strong_intra_smoothing_enable_flag" );
-
-#endif
 
   // KJS: remove scaling lists?
-#if HEVC_USE_SCALING_LISTS
   WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0,                                   "scaling_list_enabled_flag" );
   if(pcSPS->getScalingListFlag())
   {
@@ -1313,9 +891,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
       codeScalingList( pcSPS->getScalingList() );
     }
   }
-#endif
 
-#if JVET_N0063_VUI
   const TimingInfo *timingInfo = pcSPS->getTimingInfo();
   WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(),          "timing_info_present_flag");
   if(timingInfo->getTimingInfoPresentFlag())
@@ -1328,7 +904,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
       codeHrdParameters(pcSPS->getHrdParameters(), 1, pcSPS->getMaxTLayers() - 1 );
     }
   }
-#endif
 
   WRITE_FLAG( pcSPS->getVuiParametersPresentFlag(),            "vui_parameters_present_flag" );
   if (pcSPS->getVuiParametersPresentFlag())
@@ -1399,7 +974,6 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
   xWriteRbspTrailingBits();
 }
 
-#if JVET_N0349_DPS
 void HLSWriter::codeDPS( const DPS* dps )
 {
 #if ENABLE_TRACING
@@ -1415,7 +989,6 @@ void HLSWriter::codeDPS( const DPS* dps )
   WRITE_FLAG( 0,                                              "dps_extension_flag" );
   xWriteRbspTrailingBits();
 }
-#endif
 
 #if HEVC_VPS
 void HLSWriter::codeVPS( const VPS* pcVPS )
@@ -1491,7 +1064,7 @@ void HLSWriter::codeVPS( const VPS* pcVPS )
   //future extensions here..
   xWriteRbspTrailingBits();
 }
-#elif JVET_N0278_HLS
+#else
 void HLSWriter::codeVPS(const VPS* pcVPS)
 {
 #if ENABLE_TRACING
@@ -1523,37 +1096,11 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
   const uint32_t         numberValidComponents = getNumberValidComponents(format);
   const bool         chromaEnabled         = isChromaEnabled(format);
 
-#if !JVET_N0857_RECT_SLICES
-  //calculate number of bits required for slice address
-  int maxSliceSegmentAddress = cs.pcv->sizeInCtus;
-  int bitsSliceSegmentAddress = 0;
-  while(maxSliceSegmentAddress>(1<<bitsSliceSegmentAddress))
-  {
-    bitsSliceSegmentAddress++;
-  }
-  const int ctuTsAddress = pcSlice->getSliceCurStartCtuTsAddr();
-
-  //write slice address
-#if JVET_N0857_TILES_BRICKS
-  const int sliceSegmentRsAddress = pcSlice->getPic()->brickMap->getCtuBsToRsAddrMap(ctuTsAddress);
-#else
-  const int sliceSegmentRsAddress = pcSlice->getPic()->tileMap->getCtuTsToRsAddrMap(ctuTsAddress);
-#endif
-
-  WRITE_FLAG( sliceSegmentRsAddress==0, "first_slice_segment_in_pic_flag" );
-#endif
   if ( pcSlice->getRapPicFlag() )
   {
     WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" );
   }
   WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" );
-#if !JVET_N0857_RECT_SLICES
-  if(sliceSegmentRsAddress>0)
-  {
-    WRITE_CODE( sliceSegmentRsAddress, bitsSliceSegmentAddress, "slice_segment_address" );
-  }
-#endif
-#if JVET_N0857_RECT_SLICES
   int bitsSliceAddress = 1;
   if (!pcSlice->getPPS()->getRectSliceFlag())
   {
@@ -1591,7 +1138,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
   {
     WRITE_UVLC(pcSlice->getSliceNumBricks() - 1, "num_bricks_in_slice_minus1");
   }
-#endif
   
     for( int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++ )
     {
@@ -1608,13 +1154,8 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
     int pocBits = pcSlice->getSPS()->getBitsForPOC();
     int pocMask = (1 << pocBits) - 1;
     WRITE_CODE(pcSlice->getPOC() & pocMask, pocBits, "slice_pic_order_cnt_lsb");
-#if JVET_N0047_Merge_IDR_Non_IDR
     if( !pcSlice->getIdrPicFlag() || pcSlice->getSPS()->getIDRRefParamListPresent())
-#else
-     if( !pcSlice->getIdrPicFlag() )
-#endif
     {
-#if JVET_M0128
       //Write L0 related syntax elements
       if (pcSlice->getSPS()->getNumRPL0() > 0)
       {
@@ -1699,124 +1240,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
           }
         }
       }
-#else
-      const ReferencePictureSet* rps = pcSlice->getRPS();
-
-      // check for bitstream restriction stating that:
-      // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
-      // Ideally this process should not be repeated for each slice in a picture
-      if( pcSlice->isIRAP() )
-      {
-        for( int picIdx = 0; picIdx < rps->getNumberOfPictures(); picIdx++ )
-        {
-          CHECK( rps->getUsed( picIdx ), "Picture should not be used" );
-        }
-      }
-
-      if( pcSlice->getRPSidx() < 0 )
-      {
-        WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag" );
-        xCodeShortTermRefPicSet( rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets() );
-      }
-      else
-      {
-        WRITE_FLAG( 1, "short_term_ref_pic_set_sps_flag" );
-        int numBits = 0;
-        while( ( 1 << numBits ) < pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets() )
-        {
-          numBits++;
-        }
-        if( numBits > 0 )
-        {
-          WRITE_CODE( pcSlice->getRPSidx(), numBits, "short_term_ref_pic_set_idx" );
-        }
-      }
-      if( pcSlice->getSPS()->getLongTermRefsPresent() )
-      {
-        int numLtrpInSH = rps->getNumberOfLongtermPictures();
-        int ltrpInSPS[MAX_NUM_REF_PICS];
-        int numLtrpInSPS = 0;
-        uint32_t ltrpIndex;
-        int counter = 0;
-        // WARNING: The following code only works only if a matching long-term RPS is
-        //          found in the SPS for ALL long-term pictures
-        //          The problem is that the SPS coded long-term pictures are moved to the
-        //          beginning of the list which causes a mismatch when no reference picture
-        //          list reordering is used
-        //          NB: Long-term coding is currently not supported in general by the HM encoder
-        for( int k = rps->getNumberOfPictures() - 1; k > rps->getNumberOfPictures() - rps->getNumberOfLongtermPictures() - 1; k-- )
-        {
-          if( xFindMatchingLTRP( pcSlice, &ltrpIndex, rps->getPOC( k ), rps->getUsed( k ) ) )
-          {
-            ltrpInSPS[numLtrpInSPS] = ltrpIndex;
-            numLtrpInSPS++;
-          }
-          else
-          {
-            counter++;
-          }
-        }
-        numLtrpInSH -= numLtrpInSPS;
-        // check that either all long-term pictures are coded in SPS or in slice header (no mixing)
-        CHECK( numLtrpInSH != 0 && numLtrpInSPS != 0, "Long term picture not coded" );
-
-        int bitsForLtrpInSPS = 0;
-        while( pcSlice->getSPS()->getNumLongTermRefPicSPS() > ( 1 << bitsForLtrpInSPS ) )
-        {
-          bitsForLtrpInSPS++;
-        }
-        if( pcSlice->getSPS()->getNumLongTermRefPicSPS() > 0 )
-        {
-          WRITE_UVLC( numLtrpInSPS, "num_long_term_sps" );
-        }
-        WRITE_UVLC( numLtrpInSH, "num_long_term_pics" );
-        // Note that the LSBs of the LT ref. pic. POCs must be sorted before.
-        // Not sorted here because LT ref indices will be used in setRefPicList()
-        int prevDeltaMSB = 0, prevLSB = 0;
-        int offset = rps->getNumberOfNegativePictures() + rps->getNumberOfPositivePictures();
-        counter = 0;
-        // Warning: If some pictures are moved to ltrpInSPS, i is referring to a wrong index
-        //          (mapping would be required)
-        for( int i = rps->getNumberOfPictures() - 1; i > offset - 1; i--, counter++ )
-        {
-          if( counter < numLtrpInSPS )
-          {
-            if( bitsForLtrpInSPS > 0 )
-            {
-              WRITE_CODE( ltrpInSPS[counter], bitsForLtrpInSPS, "lt_idx_sps[i]" );
-            }
-          }
-          else
-          {
-            WRITE_CODE( rps->getPocLSBLT( i ), pcSlice->getSPS()->getBitsForPOC(), "poc_lsb_lt" );
-            WRITE_FLAG( rps->getUsed( i ), "used_by_curr_pic_lt_flag" );
-          }
-          WRITE_FLAG( rps->getDeltaPocMSBPresentFlag( i ), "delta_poc_msb_present_flag" );
-
-          if( rps->getDeltaPocMSBPresentFlag( i ) )
-          {
-            bool deltaFlag = false;
-            //  First LTRP from SPS                 ||  First LTRP from SH                              || curr LSB            != prev LSB
-            if( ( i == rps->getNumberOfPictures() - 1 ) || ( i == rps->getNumberOfPictures() - 1 - numLtrpInSPS ) || ( rps->getPocLSBLT( i ) != prevLSB ) )
-            {
-              deltaFlag = true;
-            }
-            if( deltaFlag )
-            {
-              WRITE_UVLC( rps->getDeltaPocMSBCycleLT( i ), "delta_poc_msb_cycle_lt[i]" );
-            }
-            else
-            {
-              int differenceInDeltaMSB = rps->getDeltaPocMSBCycleLT( i ) - prevDeltaMSB;
-              CHECK( differenceInDeltaMSB < 0, "Negative diff. delta MSB" );
-              WRITE_UVLC( differenceInDeltaMSB, "delta_poc_msb_cycle_lt[i]" );
-            }
-            prevLSB = rps->getPocLSBLT( i );
-            prevDeltaMSB = rps->getDeltaPocMSBCycleLT( i );
-          }
-        }
-      }
-#endif
       if( pcSlice->getSPS()->getSPSTemporalMVPEnabledFlag() )
       {
         WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enabled_flag" );
@@ -1833,7 +1256,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
 
     if( pcSlice->getSPS()->getALFEnabledFlag() )
     {
-#if JVET_N0415_CTB_ALF
       const int alfEnabled = pcSlice->getTileGroupAlfEnabledFlag(COMPONENT_Y);
       WRITE_FLAG(alfEnabled, "tile_group_alf_enabled_flag");
 
@@ -1869,14 +1291,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
           }
         }
       }
-#else
-      const int alfEnabled = pcSlice->getAPS()->getAlfAPSParam().enabledFlag[COMPONENT_Y] ? 1 : 0;
-      WRITE_FLAG( alfEnabled, "tile_group_alf_enabled_flag");
-      if (alfEnabled)
-      {
-        WRITE_CODE(pcSlice->getAPSId(), 5, "tile_group_aps_id");
-      }
-#endif
     }
 
     //check if numrefidxes match the defaults. If not, override
@@ -1904,54 +1318,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
       pcSlice->setNumRefIdx( REF_PIC_LIST_1, 0 );
     }
 
-#if !JVET_M0128
-    if( pcSlice->getPPS()->getListsModificationPresentFlag() && pcSlice->getNumRpsCurrTempList() > 1 )
-    {
-      RefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
-      if( !pcSlice->isIntra() )
-      {
-        WRITE_FLAG( pcSlice->getRefPicListModification()->getRefPicListModificationFlagL0() ? 1 : 0, "ref_pic_list_modification_flag_l0" );
-        if( pcSlice->getRefPicListModification()->getRefPicListModificationFlagL0() )
-        {
-          int numRpsCurrTempList0 = pcSlice->getNumRpsCurrTempList();
-          if( numRpsCurrTempList0 > 1 )
-          {
-            int length = 1;
-            numRpsCurrTempList0--;
-            while( numRpsCurrTempList0 >>= 1 )
-            {
-              length++;
-            }
-            for( int i = 0; i < pcSlice->getNumRefIdx( REF_PIC_LIST_0 ); i++ )
-            {
-              WRITE_CODE( refPicListModification->getRefPicSetIdxL0( i ), length, "list_entry_l0" );
-            }
-          }
-        }
-      }
-      if( pcSlice->isInterB() )
-      {
-        WRITE_FLAG( pcSlice->getRefPicListModification()->getRefPicListModificationFlagL1() ? 1 : 0, "ref_pic_list_modification_flag_l1" );
-        if( pcSlice->getRefPicListModification()->getRefPicListModificationFlagL1() )
-        {
-          int numRpsCurrTempList1 = pcSlice->getNumRpsCurrTempList();
-          if( numRpsCurrTempList1 > 1 )
-          {
-            int length = 1;
-            numRpsCurrTempList1--;
-            while( numRpsCurrTempList1 >>= 1 )
-            {
-              length++;
-            }
-            for( int i = 0; i < pcSlice->getNumRefIdx( REF_PIC_LIST_1 ); i++ )
-            {
-              WRITE_CODE( refPicListModification->getRefPicSetIdxL1( i ), length, "list_entry_l1" );
-            }
-          }
-        }
-      }
-    }
-#endif
 
     if( pcSlice->isInterB() )
     {
@@ -1989,7 +1355,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
       xCodePredWeightTable( pcSlice );
     }
     WRITE_FLAG( pcSlice->getDepQuantEnabledFlag() ? 1 : 0, "dep_quant_enabled_flag" );
-#if HEVC_USE_SIGN_HIDING
     if( !pcSlice->getDepQuantEnabledFlag() )
     {
       WRITE_FLAG( pcSlice->getSignDataHidingEnabledFlag() ? 1 : 0, "sign_data_hiding_enabled_flag" );
@@ -1998,7 +1363,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
     {
       CHECK( pcSlice->getSignDataHidingEnabledFlag(), "sign data hiding not supported when dependent quantization is enabled" );
     }
-#endif
     if (
       pcSlice->getSPS()->getSplitConsOverrideEnabledFlag()
       )
@@ -2058,7 +1422,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
       {
         WRITE_FLAG( pcSlice->getDisFracMMVD(), "tile_group_fracmmvd_disabled_flag" );
       }
-#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
       if (pcSlice->getSPS()->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
       {
         CHECK(pcSlice->getMaxNumMergeCand() < pcSlice->getMaxNumTriangleCand(), "Incorrrect max number of triangle candidates!");
@@ -2068,7 +1431,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
       {
         pcSlice->setMaxNumTriangleCand(0);
       }
-#endif
     }
     int iCode = pcSlice->getSliceQp() - ( pcSlice->getPPS()->getPicInitQPMinus26() + 26 );
     WRITE_SVLC( iCode, "slice_qp_delta" );
@@ -2081,9 +1443,7 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
       if (numberValidComponents > COMPONENT_Cr)
       {
         WRITE_SVLC( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr), "slice_cr_qp_offset" );
-#if JVET_N0054_JOINT_CHROMA
         WRITE_SVLC( pcSlice->getSliceChromaQpDelta(JOINT_CbCr),   "slice_cb_cr_qp_offset" );
-#endif
       }
       CHECK(numberValidComponents < COMPONENT_Cr+1, "Too many valid components");
     }
@@ -2120,7 +1480,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
 
     if (pcSlice->getSPS()->getUseReshaper())
     {
-#if JVET_N0805_APS_LMCS
       WRITE_FLAG( pcSlice->getLmcsEnabledFlag()? 1 : 0, "slice_lmcs_enabled_flag");
       if (pcSlice->getLmcsEnabledFlag())
       {
@@ -2128,9 +1487,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
         if (!(pcSlice->getSPS()->getUseDualITree() && pcSlice->isIntra()))
           WRITE_FLAG(pcSlice->getLmcsChromaResidualScaleFlag(), "slice_chroma_residual_scale_flag");
       }
-#else
-      codeReshaper(pcSlice->getReshapeInfo(), pcSlice->getSPS(), pcSlice->isIntra());
-#endif
     }
 
   if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
@@ -2140,7 +1496,6 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
 
 }
 
-#if JVET_M0101_HLS
 void  HLSWriter::codeConstraintInfo  ( const ConstraintInfo* cinfo )
 {
   WRITE_FLAG(cinfo->getProgressiveSourceFlag(),   "general_progressive_source_flag"         );
@@ -2153,9 +1508,7 @@ void  HLSWriter::codeConstraintInfo  ( const ConstraintInfo* cinfo )
   WRITE_CODE(cinfo->getMaxChromaFormatConstraintIdc(), 2, "max_chroma_format_constraint_idc" );
 
   WRITE_FLAG(cinfo->getNoQtbttDualTreeIntraConstraintFlag() ? 1 : 0, "no_qtbtt_dual_tree_intra_constraint_flag");
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_FLAG(cinfo->getNoPartitionConstraintsOverrideConstraintFlag() ? 1 : 0, "no_partition_constraints_override_constraint_flag");
-#endif
   WRITE_FLAG(cinfo->getNoSaoConstraintFlag() ? 1 : 0, "no_sao_constraint_flag");
   WRITE_FLAG(cinfo->getNoAlfConstraintFlag() ? 1 : 0, "no_alf_constraint_flag");
   WRITE_FLAG(cinfo->getNoPcmConstraintFlag() ? 1 : 0, "no_pcm_constraint_flag");
@@ -2164,31 +1517,18 @@ void  HLSWriter::codeConstraintInfo  ( const ConstraintInfo* cinfo )
   WRITE_FLAG(cinfo->getNoSbtmvpConstraintFlag() ? 1 : 0, "no_sbtmvp_constraint_flag");
   WRITE_FLAG(cinfo->getNoAmvrConstraintFlag() ? 1 : 0, "no_amvr_constraint_flag");
   WRITE_FLAG(cinfo->getNoBdofConstraintFlag() ? 1 : 0, "no_bdof_constraint_flag");
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_FLAG(cinfo->getNoDmvrConstraintFlag() ? 1 : 0, "no_dmvr_constraint_flag");
-#endif
   WRITE_FLAG(cinfo->getNoCclmConstraintFlag() ? 1 : 0, "no_cclm_constraint_flag");
   WRITE_FLAG(cinfo->getNoMtsConstraintFlag() ? 1 : 0, "no_mts_constraint_flag");
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_FLAG(cinfo->getNoSbtConstraintFlag() ? 1 : 0, "no_sbt_constraint_flag");
-#endif
   WRITE_FLAG(cinfo->getNoAffineMotionConstraintFlag() ? 1 : 0, "no_affine_motion_constraint_flag");
   WRITE_FLAG(cinfo->getNoGbiConstraintFlag() ? 1 : 0, "no_gbi_constraint_flag");
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_FLAG(cinfo->getNoIbcConstraintFlag() ? 1 : 0, "no_ibc_constraint_flag");
-#endif
   WRITE_FLAG(cinfo->getNoMhIntraConstraintFlag() ? 1 : 0, "no_mh_intra_constraint_flag");
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_FLAG(cinfo->getNoFPelMmvdConstraintFlag() ? 1 : 0, "no_fpel_mmvd_constraint_flag");
-#endif
   WRITE_FLAG(cinfo->getNoTriangleConstraintFlag() ? 1 : 0, "no_triangle_constraint_flag");
   WRITE_FLAG(cinfo->getNoLadfConstraintFlag() ? 1 : 0, "no_ladf_constraint_flag");
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_FLAG(cinfo->getNoTransformSkipConstraintFlag() ? 1 : 0, "no_transform_skip_constraint_flag");
-#endif
-#if !JVET_N0276_CONSTRAINT_FLAGS
-  WRITE_FLAG(cinfo->getNoCurrPicRefConstraintFlag() ? 1 : 0, "no_curr_pic_ref_constraint_flag");
-#endif
   WRITE_FLAG(cinfo->getNoQpDeltaConstraintFlag() ? 1 : 0, "no_qp_delta_constraint_flag");
   WRITE_FLAG(cinfo->getNoDepQuantConstraintFlag() ? 1 : 0, "no_dep_quant_constraint_flag");
   WRITE_FLAG(cinfo->getNoSignDataHidingConstraintFlag() ? 1 : 0, "no_sign_data_hiding_constraint_flag");
@@ -2199,9 +1539,7 @@ void  HLSWriter::codeProfileTierLevel    ( const ProfileTierLevel* ptl, int maxN
 {
   WRITE_CODE( int(ptl->getProfileIdc()), 7 ,   "general_profile_idc"                     );
   WRITE_FLAG( ptl->getTierFlag()==Level::HIGH, "general_tier_flag"                       );
-#if JVET_N0276_CONSTRAINT_FLAGS
   WRITE_CODE( ptl->getSubProfileIdc(), 24,      "general_sub_profile_idc"                );
-#endif
 
   codeConstraintInfo(ptl->getConstraintInfo());
 
@@ -2227,91 +1565,6 @@ void  HLSWriter::codeProfileTierLevel    ( const ProfileTierLevel* ptl, int maxN
 
 }
 
-#else
-void HLSWriter::codePTL( const PTL* pcPTL, bool profilePresentFlag, int maxNumSubLayersMinus1)
-{
-  if(profilePresentFlag)
-  {
-    codeProfileTier(pcPTL->getGeneralPTL(), false);    // general_...
-  }
-  WRITE_CODE( int(pcPTL->getGeneralPTL()->getLevelIdc()), 8, "general_level_idc" );
-
-  for (int i = 0; i < maxNumSubLayersMinus1; i++)
-  {
-    WRITE_FLAG( pcPTL->getSubLayerProfilePresentFlag(i), "sub_layer_profile_present_flag[i]" );
-    WRITE_FLAG( pcPTL->getSubLayerLevelPresentFlag(i),   "sub_layer_level_present_flag[i]" );
-  }
-
-  if (maxNumSubLayersMinus1 > 0)
-  {
-    for (int i = maxNumSubLayersMinus1; i < 8; i++)
-    {
-      WRITE_CODE(0, 2, "reserved_zero_2bits");
-    }
-  }
-
-  for(int i = 0; i < maxNumSubLayersMinus1; i++)
-  {
-    if( pcPTL->getSubLayerProfilePresentFlag(i) )
-    {
-      codeProfileTier(pcPTL->getSubLayerPTL(i), true);  // sub_layer_...
-    }
-    if( pcPTL->getSubLayerLevelPresentFlag(i) )
-    {
-      WRITE_CODE( int(pcPTL->getSubLayerPTL(i)->getLevelIdc()), 8, "sub_layer_level_idc[i]" );
-    }
-  }
-}
-
-#if ENABLE_TRACING || RExt__DECODER_DEBUG_BIT_STATISTICS
-void HLSWriter::codeProfileTier( const ProfileTierLevel* ptl, const bool bIsSubLayer )
-#define PTL_TRACE_TEXT(txt) bIsSubLayer?("sub_layer_" txt) : ("general_" txt)
-#else
-void HLSWriter::codeProfileTier( const ProfileTierLevel* ptl, const bool /*bIsSubLayer*/ )
-#define PTL_TRACE_TEXT(txt) txt
-#endif
-{
-  WRITE_CODE( ptl->getProfileSpace(), 2 ,      PTL_TRACE_TEXT("profile_space"                   ));
-  WRITE_FLAG( ptl->getTierFlag()==Level::HIGH, PTL_TRACE_TEXT("tier_flag"                       ));
-
-  WRITE_CODE( int(ptl->getProfileIdc()), 5 ,   PTL_TRACE_TEXT("profile_idc"                     ));
-  for(int j = 0; j < 32; j++)
-  {
-    WRITE_FLAG( ptl->getProfileCompatibilityFlag(j), PTL_TRACE_TEXT("profile_compatibility_flag[][j]" ));
-  }
-
-  WRITE_FLAG(ptl->getProgressiveSourceFlag(),   PTL_TRACE_TEXT("progressive_source_flag"         ));
-  WRITE_FLAG(ptl->getInterlacedSourceFlag(),    PTL_TRACE_TEXT("interlaced_source_flag"          ));
-  WRITE_FLAG(ptl->getNonPackedConstraintFlag(), PTL_TRACE_TEXT("non_packed_constraint_flag"      ));
-  WRITE_FLAG(ptl->getFrameOnlyConstraintFlag(), PTL_TRACE_TEXT("frame_only_constraint_flag"      ));
-
-  if (ptl->getProfileIdc() == Profile::MAINREXT || ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT )
-  {
-    const uint32_t         bitDepthConstraint=ptl->getBitDepthConstraint();
-    WRITE_FLAG(bitDepthConstraint<=12,          PTL_TRACE_TEXT("max_12bit_constraint_flag"       ));
-    WRITE_FLAG(bitDepthConstraint<=10,          PTL_TRACE_TEXT("max_10bit_constraint_flag"       ));
-    WRITE_FLAG(bitDepthConstraint<= 8,          PTL_TRACE_TEXT("max_8bit_constraint_flag"        ));
-    const ChromaFormat chromaFmtConstraint=ptl->getChromaFormatConstraint();
-    WRITE_FLAG(chromaFmtConstraint==CHROMA_422||chromaFmtConstraint==CHROMA_420||chromaFmtConstraint==CHROMA_400, PTL_TRACE_TEXT("max_422chroma_constraint_flag" ));
-    WRITE_FLAG(chromaFmtConstraint==CHROMA_420||chromaFmtConstraint==CHROMA_400,                                  PTL_TRACE_TEXT("max_420chroma_constraint_flag" ));
-    WRITE_FLAG(chromaFmtConstraint==CHROMA_400,                                                                   PTL_TRACE_TEXT("max_monochrome_constraint_flag"));
-    WRITE_FLAG(ptl->getIntraConstraintFlag(),          PTL_TRACE_TEXT("intra_constraint_flag"           ));
-    WRITE_FLAG(ptl->getOnePictureOnlyConstraintFlag(), PTL_TRACE_TEXT("one_picture_only_constraint_flag"));
-    WRITE_FLAG(ptl->getLowerBitRateConstraintFlag(),   PTL_TRACE_TEXT("lower_bit_rate_constraint_flag"  ));
-    WRITE_CODE(0 , 16, PTL_TRACE_TEXT("reserved_zero_34bits[0..15]"     ));
-    WRITE_CODE(0 , 16, PTL_TRACE_TEXT("reserved_zero_34bits[16..31]"    ));
-    WRITE_CODE(0 ,  2, PTL_TRACE_TEXT("reserved_zero_34bits[32..33]"    ));
-  }
-  else
-  {
-    WRITE_CODE(0x0000 , 16, PTL_TRACE_TEXT("reserved_zero_43bits[0..15]"     ));
-    WRITE_CODE(0x0000 , 16, PTL_TRACE_TEXT("reserved_zero_43bits[16..31]"    ));
-    WRITE_CODE(0x000  , 11, PTL_TRACE_TEXT("reserved_zero_43bits[32..42]"    ));
-  }
-  WRITE_FLAG(false,   PTL_TRACE_TEXT("reserved_zero_bit" ));
-#undef PTL_TRACE_TEXT
-}
-#endif
 
 /**
 * Write tiles and wavefront substreams sizes for the slice header (entry points).
@@ -2320,11 +1573,7 @@ void HLSWriter::codeProfileTier( const ProfileTierLevel* ptl, const bool /*bIsSu
 */
 void  HLSWriter::codeTilesWPPEntryPoint( Slice* pSlice )
 {
-#if !JVET_N0857_TILES_BRICKS
-  if (!pSlice->getPPS()->getTilesEnabledFlag() && !pSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
-#else
   if (pSlice->getPPS()->getSingleTileInPicFlag() && !pSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
-#endif
   {
     return;
   }
@@ -2445,7 +1694,6 @@ void HLSWriter::xCodePredWeightTable( Slice* pcSlice )
   }
 }
 
-#if HEVC_USE_SCALING_LISTS
 /** code quantization matrix
 *  \param scalingList quantization matrix information
 */
@@ -2454,36 +1702,22 @@ void HLSWriter::codeScalingList( const ScalingList &scalingList )
   //for each size
   for(uint32_t sizeId = SCALING_LIST_FIRST_CODED; sizeId <= SCALING_LIST_LAST_CODED; sizeId++)
   {
-#if JVET_N0847_SCALING_LISTS 
     const int predListStep = (sizeId > SCALING_LIST_32x32 ? (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) : 1); // if 64x64, skip over chroma entries.
-#else
-    const int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
-#endif
 
     for(uint32_t listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)
     {
-#if JVET_N0847_SCALING_LISTS
       if ((sizeId == SCALING_LIST_2x2) && ((listId % (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)) == 0)))
       {
         continue;
       }
-#endif
       bool scalingListPredModeFlag = scalingList.getScalingListPredModeFlag(sizeId, listId);
       WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" );
       if(!scalingListPredModeFlag)// Copy Mode
       {
-#if JVET_N0847_SCALING_LISTS
         if (sizeId > SCALING_LIST_32x32) //64x64 luma
-#else
-        if (sizeId == SCALING_LIST_32x32)
-#endif
         {
           // adjust the code, to cope with the missing chroma entries
-#if JVET_N0847_SCALING_LISTS
           WRITE_UVLC( ((int)listId - (int)scalingList.getRefMatrixId(sizeId, listId)) / (SCALING_LIST_NUM / (NUMBER_OF_PREDICTION_MODES - 1)), "scaling_list_pred_matrix_id_delta");
-#else
-          WRITE_UVLC( ((int)listId - (int)scalingList.getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta");
-#endif
         }
         else
         {
@@ -2506,11 +1740,7 @@ void HLSWriter::codeScalingList( const ScalingList &scalingList )
 void HLSWriter::xCodeScalingList(const ScalingList* scalingList, uint32_t sizeId, uint32_t listId)
 {
   int coefNum = std::min( MAX_MATRIX_COEF_NUM, ( int ) g_scalingListSize[sizeId] );
-#if JVET_N0847_SCALING_LISTS
   ScanElement *scan = g_scanOrder[SCAN_UNGROUPED][SCAN_DIAG][gp_sizeIdxInfo->idxFrom(1 << (sizeId == SCALING_LIST_2x2 ? 1 : (sizeId == SCALING_LIST_4x4 ? 2 : 3)))][gp_sizeIdxInfo->idxFrom(1 << (sizeId == SCALING_LIST_2x2 ? 1 : (sizeId == SCALING_LIST_4x4 ? 2 : 3)))];
-#else
-  uint32_t* scan = g_scanOrder[SCAN_UNGROUPED][SCAN_DIAG][gp_sizeIdxInfo->idxFrom( 1 << ( sizeId == SCALING_LIST_FIRST_CODED ? 2 : 3 ) )][gp_sizeIdxInfo->idxFrom( 1 << ( sizeId == SCALING_LIST_FIRST_CODED ? 2 : 3 ) )];
-#endif
   int nextCoef = SCALING_LIST_START_VALUE;
   int data;
   const int *src = scalingList->getScalingListAddress(sizeId, listId);
@@ -2521,15 +1751,10 @@ void HLSWriter::xCodeScalingList(const ScalingList* scalingList, uint32_t sizeId
   }
   for(int i=0;i<coefNum;i++)
   {
-#if JVET_N0847_SCALING_LISTS
     if (sizeId == SCALING_LIST_64x64 && scan[i].x >= 4 && scan[i].y >= 4)
       continue;
     data = src[scan[i].idx] - nextCoef;
     nextCoef = src[scan[i].idx];
-#else
-    data = src[scan[i]] - nextCoef;
-    nextCoef = src[scan[i]];
-#endif
     if(data > 127)
     {
       data = data - 256;
@@ -2542,7 +1767,6 @@ void HLSWriter::xCodeScalingList(const ScalingList* scalingList, uint32_t sizeId
     WRITE_SVLC( data,  "scaling_list_delta_coef");
   }
 }
-#endif
 
 bool HLSWriter::xFindMatchingLTRP(Slice* pcSlice, uint32_t *ltrpsIndex, int ltrpPOC, bool usedFlag)
 {
@@ -2559,11 +1783,7 @@ bool HLSWriter::xFindMatchingLTRP(Slice* pcSlice, uint32_t *ltrpsIndex, int ltrp
   return false;
 }
 
-#if JVET_N0242_NON_LINEAR_ALF
 void HLSWriter::alfGolombEncode( int coeff, int k, const bool signed_coeff )
-#else
-void HLSWriter::alfGolombEncode( int coeff, int k )
-#endif
 {
   int symbol = abs( coeff );
 
@@ -2583,11 +1803,7 @@ void HLSWriter::alfGolombEncode( int coeff, int k )
     symbol >>= 1;
   }
 
-#if JVET_N0242_NON_LINEAR_ALF
   if( signed_coeff && coeff != 0 )
-#else
-  if( coeff != 0 )
-#endif
   {
     int sign = ( coeff < 0 ) ? 1 : 0;
     xWriteFlag( sign );
@@ -2613,9 +1829,7 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
   AlfFilterShape alfShape( isChroma ? 5 : 7 );
   const int maxGolombIdx = AdaptiveLoopFilter::getMaxGolombIdx( alfShape.filterType );
   const short* coeff = isChroma ? alfSliceParam.chromaCoeff : alfSliceParam.lumaCoeff;
-#if JVET_N0242_NON_LINEAR_ALF
   const short* clipp = isChroma ? alfSliceParam.chromaClipp : alfSliceParam.lumaClipp;
-#endif
   const int numFilters = isChroma ? 1 : alfSliceParam.numLumaFilters;
 
   // vlc for all
@@ -2673,7 +1887,6 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
       alfGolombEncode( coeff[ind* MAX_NUM_ALF_LUMA_COEFF + i], kMinTab[alfShape.golombIdx[i]] );  // alf_coeff_chroma[i], alf_coeff_luma_delta[i][j]
     }
   }
-#if JVET_N0242_NON_LINEAR_ALF
 
   // Clipping values coding
   if( alfSliceParam.nonLinearFlag[isChroma] )
@@ -2748,7 +1961,6 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
       }
     }
   }
-#endif
 }
 
 void HLSWriter::xWriteTruncBinCode( uint32_t uiSymbol, const int uiMaxSymbol )
diff --git a/source/Lib/EncoderLib/VLCWriter.h b/source/Lib/EncoderLib/VLCWriter.h
index 358fd9cdf..6b80013c8 100644
--- a/source/Lib/EncoderLib/VLCWriter.h
+++ b/source/Lib/EncoderLib/VLCWriter.h
@@ -88,9 +88,7 @@ protected:
   void  xWriteFlagTr          ( uint32_t value,               const char *pSymbolName);
 #endif
   void  xWriteRbspTrailingBits();
-#if JVET_M0101_HLS
   bool isByteAligned()      { return (m_pcBitIf->getNumBitsUntilByteAligned() == 0); } ;
-#endif
 };
 
 
@@ -113,16 +111,10 @@ public:
   virtual ~HLSWriter() {}
 
 private:
-#if JVET_M0128
   void xCodeRefPicList(const ReferencePictureList* rpl, bool isLongTermPresent, uint32_t ltLsbBitsCount);
-#else
-  void xCodeShortTermRefPicSet  ( const ReferencePictureSet* pcRPS, bool calledFromSliceHeader, int idx );
-#endif
   bool xFindMatchingLTRP        ( Slice* pcSlice, uint32_t *ltrpsIndex, int ltrpPOC, bool usedFlag );
   void xCodePredWeightTable     ( Slice* pcSlice );
-#if HEVC_USE_SCALING_LISTS
   void xCodeScalingList         ( const ScalingList* scalingList, uint32_t sizeId, uint32_t listId);
-#endif
 public:
   void  setBitstream            ( OutputBitstream* p )  { m_pcBitIf = p;  }
   uint32_t  getNumberOfWrittenBits  ()                      { return m_pcBitIf->getNumberOfWrittenBits();  }
@@ -130,39 +122,22 @@ public:
   void  codeSPS                 ( const SPS* pcSPS );
   void  codePPS                 ( const PPS* pcPPS );
   void  codeAPS                 ( APS* pcAPS );
-#if JVET_N0805_APS_LMCS
   void  codeAlfAps              ( APS* pcAPS );
   void  codeLmcsAps             ( APS* pcAPS );
-#endif
-#if HEVC_VPS || JVET_N0278_HLS
   void  codeVPS                 ( const VPS* pcVPS );
-#endif
-#if JVET_N0349_DPS
   void  codeDPS                 ( const DPS* dps );
-#endif
   void  codeSliceHeader         ( Slice* pcSlice );
-#if !JVET_M0101_HLS
-  void  codePTL                 ( const PTL* pcPTL, bool profilePresentFlag, int maxNumSubLayersMinus1);
-  void  codeProfileTier         ( const ProfileTierLevel* ptl, const bool bIsSubLayer );
-#else
   void  codeConstraintInfo      ( const ConstraintInfo* cinfo );
   void  codeProfileTierLevel    ( const ProfileTierLevel* ptl, int maxNumSubLayersMinus1 );
-#endif
   void  codeHrdParameters       ( const HRDParameters *hrd, bool commonInfPresentFlag, uint32_t maxNumSubLayersMinus1 );
   void  codeTilesWPPEntryPoint  ( Slice* pSlice );
-#if HEVC_USE_SCALING_LISTS
   void  codeScalingList         ( const ScalingList &scalingList );
-#endif
 
   void alfFilter( const AlfSliceParam& alfSliceParam, const bool isChroma );
 
 private:
   void xWriteTruncBinCode( uint32_t uiSymbol, const int uiMaxSymbol );
-#if JVET_N0242_NON_LINEAR_ALF
   void alfGolombEncode( const int coeff, const int k, const bool signed_coeff=true );
-#else
-  void alfGolombEncode( const int coeff, const int k );
-#endif
   void truncatedUnaryEqProb( int symbol, int maxSymbol );
 
   void  codeReshaper            ( const SliceReshapeInfo& pSliceReshaperInfo, const SPS* pcSPS, const bool isIntra);
diff --git a/source/Lib/Utilities/VideoIOYuv.cpp b/source/Lib/Utilities/VideoIOYuv.cpp
index 2700ffa72..1afee99a2 100644
--- a/source/Lib/Utilities/VideoIOYuv.cpp
+++ b/source/Lib/Utilities/VideoIOYuv.cpp
@@ -904,9 +904,7 @@ bool VideoIOYuv::read ( PelUnitBuf& pic, PelUnitBuf& picOrg, const InputColourSp
   ColourSpaceConvert( picOrg, pic, ipcsc, true);
 #endif
 
-#if JVET_N0671_RGB
   picOrg.copyFrom(pic);
-#endif
 
   return true;
 }
-- 
GitLab