From b27d62a741db38f3b49c539f86f21cf1b44095d1 Mon Sep 17 00:00:00 2001
From: Frank Bossen <fbossen@gmail.com>
Date: Sat, 13 Oct 2018 07:53:04 +0800
Subject: [PATCH] Remove JVET_K_AFFINE macro

---
 source/App/EncoderApp/EncApp.cpp              |   4 +-
 source/App/EncoderApp/EncAppCfg.cpp           |  13 +-
 source/App/EncoderApp/EncAppCfg.h             |   4 +-
 source/Lib/CommonLib/CodingStatistics.h       |   4 -
 source/Lib/CommonLib/CommonDef.h              |   4 -
 source/Lib/CommonLib/ContextModelling.cpp     |   2 -
 source/Lib/CommonLib/ContextModelling.h       |   2 -
 source/Lib/CommonLib/Contexts.cpp             |   2 -
 source/Lib/CommonLib/Contexts.h               |   2 -
 source/Lib/CommonLib/InterPrediction.cpp      |  31 +----
 source/Lib/CommonLib/InterPrediction.h        |   2 -
 source/Lib/CommonLib/InterpolationFilter.cpp  |  42 -------
 source/Lib/CommonLib/InterpolationFilter.h    |   5 -
 source/Lib/CommonLib/LoopFilter.cpp           |   6 -
 source/Lib/CommonLib/MotionInfo.h             |   2 -
 source/Lib/CommonLib/Mv.cpp                   |   2 +-
 source/Lib/CommonLib/Mv.h                     |  22 ++--
 source/Lib/CommonLib/RdCost.h                 |   2 +-
 source/Lib/CommonLib/Slice.cpp                |   4 -
 source/Lib/CommonLib/Slice.h                  |   8 --
 source/Lib/CommonLib/TypeDef.h                |   7 --
 source/Lib/CommonLib/Unit.cpp                 |  10 --
 source/Lib/CommonLib/Unit.h                   |   4 -
 source/Lib/CommonLib/UnitTools.cpp            |  26 +---
 source/Lib/CommonLib/UnitTools.h              |   9 --
 .../Lib/CommonLib/dtrace_blockstatistics.cpp  |  32 -----
 source/Lib/CommonLib/dtrace_blockstatistics.h |   4 -
 source/Lib/DecoderLib/CABACReader.cpp         |  14 ---
 source/Lib/DecoderLib/CABACReader.h           |   2 -
 source/Lib/DecoderLib/DecCu.cpp               |  80 -------------
 source/Lib/DecoderLib/VLCReader.cpp           |   4 -
 source/Lib/EncoderLib/CABACWriter.cpp         |  14 +--
 source/Lib/EncoderLib/CABACWriter.h           |   2 -
 source/Lib/EncoderLib/EncCfg.h                |   8 --
 source/Lib/EncoderLib/EncCu.cpp               |   4 -
 source/Lib/EncoderLib/EncCu.h                 |   2 -
 source/Lib/EncoderLib/EncLib.cpp              |   7 --
 source/Lib/EncoderLib/EncModeCtrl.cpp         |  10 --
 source/Lib/EncoderLib/EncModeCtrl.h           |   6 -
 source/Lib/EncoderLib/InterSearch.cpp         | 113 +-----------------
 source/Lib/EncoderLib/InterSearch.h           |   2 -
 source/Lib/EncoderLib/VLCWriter.cpp           |   4 -
 42 files changed, 26 insertions(+), 501 deletions(-)

diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index ccbf1c2fb..a53b6f830 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -225,13 +225,11 @@ void EncApp::xInitLibCfg()
 #endif
   m_cEncLib.setSubPuMvpLog2Size                                  ( m_SubPuMvpLog2Size );
 #endif
-#if JVET_K_AFFINE
   m_cEncLib.setAffine                                            ( m_Affine );
 #if JVET_K0337_AFFINE_6PARA
   m_cEncLib.setAffineType                                        ( m_AffineType );
 #endif
-#endif
-#if (JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   m_cEncLib.setHighPrecisionMv                                   (m_highPrecisionMv);
 #endif
   m_cEncLib.setDisableMotionCompression                          ( m_DisableMotionCompression );
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index 9ac6d57ed..b08040bbf 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -817,14 +817,12 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("HighPrecMv",                                     m_highPrecisionMv,                                false, "High precision motion vectors for temporal merging (0:off, 1:on)  [default: off]")
 #endif
 #endif
-#if JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC 
   ("HighPrecMv",                                     m_highPrecisionMv,                                false, "High precision motion vectors for temporal merging (0:off, 1:on)  [default: off]")
 #endif
   ("Affine",                                          m_Affine,                                        false, "Enable affine prediction (0:off, 1:on)  [default: off]")
 #if JVET_K0337_AFFINE_6PARA
   ( "AffineType",                                     m_AffineType,                                     true,  "Enable affine type prediction (0:off, 1:on)  [default: on]" )
-#endif
 #endif
   ("DisableMotCompression",                           m_DisableMotionCompression,                       false, "Disable motion data compression for all modes")
 #if JVET_K0357_AMVR
@@ -1924,12 +1922,9 @@ bool EncAppCfg::xCheckParameter()
 #if JVET_K0346
     xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" );
 #endif
-#if JVET_K_AFFINE && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     xConfirmPara( m_highPrecisionMv, "High precision MV for temporal merging can only be used with NEXT profile" );
     xConfirmPara( m_Affine, "Affine is only allowed with NEXT profile" );
-#endif
-#if JVET_K0346 && !JVET_K_AFFINE && !REMOVE_MV_ADAPT_PREC
-    xConfirmPara(m_highPrecisionMv, "High precision MV for temporal merging can only be used with NEXT profile");
 #endif
     xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" );
     xConfirmPara( m_MTT, "Multi type tree is only allowed with NEXT profile" );
@@ -1976,10 +1971,8 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara( m_useSaveLoadSplitDecision && !m_QTBT, "Encoder split decision saving can only be applied with QTBT" );
 
 #endif
-#if JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC 
     xConfirmPara(m_Affine && !m_highPrecisionMv, "Affine is not yet implemented for HighPrecMv off.");
-#endif
 #endif
 
   }
@@ -3156,7 +3149,6 @@ void EncAppCfg::xPrintParameter()
   if( m_profile == Profile::NEXT )
   {
     msg( VERBOSE, "\nNEXT TOOL CFG: " );
-#if JVET_K_AFFINE
     msg( VERBOSE, "Affine:%d ", m_Affine );
 #if JVET_K0337_AFFINE_6PARA
     if ( m_Affine )
@@ -3164,7 +3156,6 @@ void EncAppCfg::xPrintParameter()
       msg( VERBOSE, "AffineType:%d ", m_AffineType );
     }
 #endif
-#endif
 #if JVET_K0346
     msg(VERBOSE, "SubPuMvp:%d+%d ", m_SubPuMvpMode & 1, (m_SubPuMvpMode & 2) == 2);
     if (m_SubPuMvpMode != 0)
@@ -3179,10 +3170,8 @@ void EncAppCfg::xPrintParameter()
     msg( VERBOSE, "IMV:%d ", m_ImvMode );
     if( !m_QTBT ) msg( VERBOSE, "IMVMaxCand:%d ", m_ImvMaxCand );
 #endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC 
     msg(VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv);
-#endif
 #endif
     msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression );
     msg( VERBOSE, "MTT:%d ", m_MTT );
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index 11a80172b..8d6a008d5 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -208,13 +208,11 @@ protected:
   int       m_SubPuMvpMode;
   unsigned  m_SubPuMvpLog2Size;
 #endif
-#if JVET_K_AFFINE
   bool      m_Affine;
 #if JVET_K0337_AFFINE_6PARA
   bool      m_AffineType;
 #endif
-#endif
-#if (JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   bool      m_highPrecisionMv;
 #endif
   bool      m_DisableMotionCompression;
diff --git a/source/Lib/CommonLib/CodingStatistics.h b/source/Lib/CommonLib/CodingStatistics.h
index 57fd73d87..2f61340bd 100644
--- a/source/Lib/CommonLib/CodingStatistics.h
+++ b/source/Lib/CommonLib/CodingStatistics.h
@@ -94,12 +94,10 @@ enum CodingStatisticsType
   STATS__CABAC_BITS__OTHER,
   STATS__CABAC_BITS__INVALID,
   STATS__TOOL_TOTAL_FRAME,// This is a special case and is not included in the report.
-#if JVET_K_AFFINE
   STATS__CABAC_BITS__AFFINE_FLAG,
   STATS__TOOL_AFF,
 #if JVET_K0337_AFFINE_6PARA
   STATS__CABAC_BITS__AFFINE_TYPE,
-#endif
 #endif
   STATS__CABAC_BITS__PAR_FLAG,
   STATS__CABAC_BITS__ALF,
@@ -146,11 +144,9 @@ static inline const char* getName(CodingStatisticsType name)
     "CABAC_BITS__REF_FRM_IDX",
     "CABAC_BITS__MVD",
     "CABAC_BITS__MVD_EP",
-#if JVET_K_AFFINE
     "CABAC_BITS__AFFINE_FLAG",
 #if JVET_K0337_AFFINE_6PARA
     "CABAC_BITS__AFFINE_TYPE",
-#endif
 #endif
     "CABAC_BITS__TRANSFORM_SUBDIV_FLAG",
     "CABAC_BITS__QT_ROOT_CBF",
diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h
index 6eb176dc6..9a48b74e6 100644
--- a/source/Lib/CommonLib/CommonDef.h
+++ b/source/Lib/CommonLib/CommonDef.h
@@ -239,9 +239,7 @@ static const int CABAC_INIT_PRESENT_FLAG =                          1;
 
 static const int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS   = 4;
 static const int CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 8;
-#if JVET_K0346 || JVET_K_AFFINE
 static const int VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE         = 2;   ///< additional precision bit for MV storage
-#endif
 
 static const int MAX_NUM_LONG_TERM_REF_PICS =                      33;
 static const int NUM_LONG_TERM_REF_PIC_SPS =                        0;
@@ -300,13 +298,11 @@ static const int CONTEXT_STATE_BITS =                               6;
 static const int LAST_SIGNIFICANT_GROUPS =                         14;
 static const int MAX_GR_ORDER_RESIDUAL =                           10;
 
-#if JVET_K_AFFINE
 static const int AFFINE_MAX_NUM_V0 =                                3; ///< max number of motion candidates in top-left corner
 static const int AFFINE_MAX_NUM_V1 =                                2; ///< max number of motion candidates in top-right corner
 static const int AFFINE_MAX_NUM_V2 =                                2; ///< max number of motion candidates in left-bottom corner
 static const int AFFINE_MAX_NUM_COMB =                             12; ///< max number of combined motion candidates
 static const int AFFINE_MIN_BLOCK_SIZE =                            4; ///< Minimum affine MC block size
-#endif
 
 
 #if W0038_DB_OPT
diff --git a/source/Lib/CommonLib/ContextModelling.cpp b/source/Lib/CommonLib/ContextModelling.cpp
index f929799b8..b8af58ba2 100644
--- a/source/Lib/CommonLib/ContextModelling.cpp
+++ b/source/Lib/CommonLib/ContextModelling.cpp
@@ -254,7 +254,6 @@ unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
   return pu.cu->qtDepth;
 }
 
-#if JVET_K_AFFINE
 unsigned DeriveCtx::CtxAffineFlag( const CodingUnit& cu )
 {
   const CodingStructure *cs = cu.cs;
@@ -268,7 +267,6 @@ unsigned DeriveCtx::CtxAffineFlag( const CodingUnit& cu )
 
   return ctxId;
 }
-#endif
 unsigned DeriveCtx::CtxSkipFlag( const CodingUnit& cu )
 {
   const CodingStructure *cs = cu.cs;
diff --git a/source/Lib/CommonLib/ContextModelling.h b/source/Lib/CommonLib/ContextModelling.h
index 95bc012dc..c17b6ed31 100644
--- a/source/Lib/CommonLib/ContextModelling.h
+++ b/source/Lib/CommonLib/ContextModelling.h
@@ -292,9 +292,7 @@ unsigned CtxSkipFlag  ( const CodingUnit& cu );
 #if JVET_K0357_AMVR
 unsigned CtxIMVFlag   ( const CodingUnit& cu );
 #endif
-#if JVET_K_AFFINE
 unsigned CtxAffineFlag( const CodingUnit& cu );
-#endif
 }
 
 #endif // __CONTEXTMODELLING__
diff --git a/source/Lib/CommonLib/Contexts.cpp b/source/Lib/CommonLib/Contexts.cpp
index 6d84519bf..09433300a 100644
--- a/source/Lib/CommonLib/Contexts.cpp
+++ b/source/Lib/CommonLib/Contexts.cpp
@@ -353,7 +353,6 @@ const CtxSet ContextSetCfg::RefPic = ContextSetCfg::addCtxSet
   {  CNU, CNU,},
 });
 
-#if JVET_K_AFFINE
 const CtxSet ContextSetCfg::AffineFlag = ContextSetCfg::addCtxSet
 ({
   {  197, 185, 201,},
@@ -369,7 +368,6 @@ const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
   { CNU, },
 });
 #endif
-#endif
 
 
 const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
diff --git a/source/Lib/CommonLib/Contexts.h b/source/Lib/CommonLib/Contexts.h
index 5dd4b3d33..e63f8b044 100644
--- a/source/Lib/CommonLib/Contexts.h
+++ b/source/Lib/CommonLib/Contexts.h
@@ -166,11 +166,9 @@ public:
   static const CtxSet   DeltaQP;
   static const CtxSet   InterDir;
   static const CtxSet   RefPic;
-#if JVET_K_AFFINE
   static const CtxSet   AffineFlag;
 #if JVET_K0337_AFFINE_6PARA
   static const CtxSet   AffineType;
-#endif
 #endif
   static const CtxSet   Mvd;
   static const CtxSet   TransSubdivFlag;
diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp
index 25bbf77e0..47d859f50 100644
--- a/source/Lib/CommonLib/InterPrediction.cpp
+++ b/source/Lib/CommonLib/InterPrediction.cpp
@@ -156,11 +156,7 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC )
 #endif
 }
 
-#if JVET_K_AFFINE
 bool checkIdenticalMotion( const PredictionUnit &pu, bool checkAffine )
-#else
-bool checkIdenticalMotion( const PredictionUnit &pu )
-#endif
 {
   const Slice &slice = *pu.cs->slice;
 
@@ -173,16 +169,13 @@ bool checkIdenticalMotion( const PredictionUnit &pu )
 
       if( RefPOCL0 == RefPOCL1 )
       {
-#if JVET_K_AFFINE
         if( !pu.cu->affine )
-#endif
         {
           if( pu.mv[0] == pu.mv[1] )
           {
             return true;
           }
         }
-#if JVET_K_AFFINE
         else
         {
           CHECK( !checkAffine, "In this case, checkAffine should be on." );
@@ -201,7 +194,6 @@ bool checkIdenticalMotion( const PredictionUnit &pu )
             return true;
           }
         }
-#endif
       }
     }
   }
@@ -226,16 +218,13 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
 
       if( RefPOCL0 == RefPOCL1 )
       {
-#if JVET_K_AFFINE
         if( !pu.cu->affine )
-#endif
         {
           if( pu.mv[0] == pu.mv[1] )
           {
             return true;
           }
         }
-#if JVET_K_AFFINE
         else
         {
           const CMotionBuf &mb = pu.getMotionBuf();
@@ -253,7 +242,6 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
             return true;
           }
         }
-#endif
       }
     }
   }
@@ -373,7 +361,6 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
   int iRefIdx = pu.refIdx[eRefPicList];
   Mv mv[3];
 
-#if JVET_K_AFFINE
   if( pu.cu->affine )
   {
     CHECK( iRefIdx < 0, "iRefIdx incorrect." );
@@ -388,11 +375,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
 #endif
   }
   else
-#endif
   {
     mv[0] = pu.mv[eRefPicList];
   }
-#if JVET_K_AFFINE && JVET_K_AFFINE_BUG_FIXES
+#if JVET_K_AFFINE_BUG_FIXES
   if ( !pu.cu->affine )
 #endif
   clipMv(mv[0], pu.cu->lumaPos(), sps);
@@ -401,13 +387,11 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
   for( uint32_t comp = COMPONENT_Y; comp < pcYuvPred.bufs.size() && comp <= m_maxCompIDToPred; comp++ )
   {
     const ComponentID compID = ComponentID( comp );
-#if JVET_K_AFFINE
     if ( pu.cu->affine )
     {
       xPredAffineBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv, pcYuvPred, bi, pu.cu->slice->clpRng( compID ) );
     }
     else
-#endif
     {
       xPredInterBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv[0], pcYuvPred, bi, pu.cu->slice->clpRng( compID )
                     );
@@ -481,7 +465,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
                                     )
 {
   JVET_J0090_SET_REF_PICTURE( refPic, compID );
-#if JVET_K0346 || JVET_K_AFFINE
   const ChromaFormat  chFmt = pu.chromaFormat;
   const bool          rndRes = !bi;
 
@@ -509,16 +492,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
   CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv() && ((xFrac & 3) != 0), "Invalid fraction");
   CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv() && ((yFrac & 3) != 0), "Invalid fraction");
 #endif
-#else
-  const ChromaFormat  chFmt  = pu.chromaFormat;
-  const bool          rndRes = !bi;
-
-  int shiftHor = 2 + ::getComponentScaleX( compID, chFmt );
-  int shiftVer = 2 + ::getComponentScaleY( compID, chFmt );
-  
-  int xFrac = _mv.hor & ( ( 1 << shiftHor ) - 1 );
-  int yFrac = _mv.ver & ( ( 1 << shiftVer ) - 1 );
-#endif
 
   PelBuf &dstBuf  = dstPic.bufs[compID];
   unsigned width  = dstBuf.width;
@@ -550,7 +523,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
   }
 }
 
-#if JVET_K_AFFINE
 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_K0337_AFFINE_6PARA
@@ -726,7 +698,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
     }
   }
 }
-#endif
 
 int getMSB( unsigned x )
 {
diff --git a/source/Lib/CommonLib/InterPrediction.h b/source/Lib/CommonLib/InterPrediction.h
index cbe87a516..d89d5813e 100644
--- a/source/Lib/CommonLib/InterPrediction.h
+++ b/source/Lib/CommonLib/InterPrediction.h
@@ -89,9 +89,7 @@ protected:
                                  );
   
   void xWeightedAverage         ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs );
-#if JVET_K_AFFINE
   void xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng );
-#endif
 
   static bool xCheckIdenticalMotion( const PredictionUnit& pu );
 
diff --git a/source/Lib/CommonLib/InterpolationFilter.cpp b/source/Lib/CommonLib/InterpolationFilter.cpp
index faea0e737..32e4d9d75 100644
--- a/source/Lib/CommonLib/InterpolationFilter.cpp
+++ b/source/Lib/CommonLib/InterpolationFilter.cpp
@@ -55,13 +55,8 @@ CacheModel* InterpolationFilter::m_cacheModel;
 // Tables
 // ====================================================================================================================
 
-#if JVET_K0346 || JVET_K_AFFINE
 const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_LUMA] =
-#else
-const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
-#endif
 {
-#if JVET_K0346 || JVET_K_AFFINE
   {  0, 0,   0, 64,  0,   0,  0,  0 },
   {  0, 1,  -3, 63,  4,  -2,  1,  0 },
   { -1, 2,  -5, 62,  8,  -3,  1,  0 },
@@ -78,21 +73,10 @@ const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_S
   {  0, 1,  -4, 13, 60,  -8,  3, -1 },
   {  0, 1,  -3,  8, 62,  -5,  2, -1 },
   {  0, 1,  -2,  4, 63,  -3,  1,  0 }
-#else
-  {  0, 0,   0, 64,  0,   0, 0,  0 },
-  { -1, 4, -10, 58, 17,  -5, 1,  0 },
-  { -1, 4, -11, 40, 40, -11, 4, -1 },
-  {  0, 1,  -5, 17, 58, -10, 4, -1 }
-#endif
 };
 
-#if JVET_K0346 || JVET_K_AFFINE
 const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_CHROMA] =
-#else
-const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA] =
-#endif
 {
-#if JVET_K0346 || JVET_K_AFFINE
   {  0, 64,  0,  0 },
   { -1, 63,  2,  0 },
   { -2, 62,  4,  0 },
@@ -125,16 +109,6 @@ const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILT
   { -1,  7, 60, -2 },
   {  0,  4, 62, -2 },
   {  0,  2, 63, -1 },
-#else
-  {  0, 64,  0,  0 },
-  { -2, 58, 10, -2 },
-  { -4, 54, 16, -2 },
-  { -6, 46, 28, -4 },
-  { -4, 36, 36, -4 },
-  { -4, 28, 46, -6 },
-  { -2, 16, 54, -4 },
-  { -2, 10, 58, -2 }
-#endif
 };
 
 // ====================================================================================================================
@@ -477,11 +451,7 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
   }
   else if( isLuma( compID ) )
   {
-#if JVET_K0346 || JVET_K_AFFINE
     CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
-#else
-    CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
-#endif
     {
       filterHor<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac] );
     }
@@ -489,11 +459,7 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
   else
   {
     const uint32_t csx = getComponentScaleX( compID, fmt );
-#if JVET_K0346 || JVET_K_AFFINE
     CHECK( frac < 0 || csx >= 2 || ( frac << ( 1 - csx ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
-#else
-    CHECK( frac < 0 || csx >= 2 || ( frac << ( 1 - csx ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
-#endif
     filterHor<NTAPS_CHROMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac << ( 1 - csx )] );
   }
 }
@@ -523,11 +489,7 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
   }
   else if( isLuma( compID ) )
   {
-#if JVET_K0346 || JVET_K_AFFINE
     CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
-#else
-    CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
-#endif
     {
       filterVer<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac] );
     }
@@ -535,11 +497,7 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
   else
   {
     const uint32_t csy = getComponentScaleY( compID, fmt );
-#if JVET_K0346 || JVET_K_AFFINE
     CHECK( frac < 0 || csy >= 2 || ( frac << ( 1 - csy ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
-#else
-    CHECK( frac < 0 || csy >= 2 || ( frac << ( 1 - csy ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
-#endif
     filterVer<NTAPS_CHROMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac << ( 1 - csy )] );
   }
 }
diff --git a/source/Lib/CommonLib/InterpolationFilter.h b/source/Lib/CommonLib/InterpolationFilter.h
index 6ca4de5bb..e74310633 100644
--- a/source/Lib/CommonLib/InterpolationFilter.h
+++ b/source/Lib/CommonLib/InterpolationFilter.h
@@ -54,13 +54,8 @@
  */
 class InterpolationFilter
 {
-#if JVET_K0346 || JVET_K_AFFINE
   static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_LUMA]; ///< Luma filter taps
   static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_CHROMA]; ///< Chroma filter taps
-#else
-  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
-#endif
 public:
   template<bool isFirst, bool isLast>
   static void filterCopy( const ClpRng& clpRng, const Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height );
diff --git a/source/Lib/CommonLib/LoopFilter.cpp b/source/Lib/CommonLib/LoopFilter.cpp
index a4b47b866..0e01d027e 100644
--- a/source/Lib/CommonLib/LoopFilter.cpp
+++ b/source/Lib/CommonLib/LoopFilter.cpp
@@ -265,7 +265,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
 
   }
 
-#if JVET_K_AFFINE
   if ( cu.affine )
   {
     const int widthInBaseUnits = cu.Y().width >> pcv.minCUWidthLog2;
@@ -281,7 +280,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
       xSetEdgefilterMultiple( cu, EDGE_HOR, affiBlockH, m_stLFCUParam.internalEdge, 1 );
     }
   }
-#endif
   const unsigned uiPelsInPart = pcv.minCUWidth;
 
   for( int y = 0; y < area.height; y += uiPelsInPart )
@@ -445,7 +443,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
     if( 0 <= miQ.refIdx[1] ) { mvQ1 = miQ.mv[1]; }
 
     int nThreshold = 4;
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
     if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
     {
@@ -457,7 +454,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
       nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
 #if !REMOVE_MV_ADAPT_PREC
   }
-#endif
 #endif
     unsigned uiBs = 0;
 
@@ -512,7 +508,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
   Mv mvQ0 = miQ.mv[0];
 
   int nThreshold = 4;
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
   {
@@ -522,7 +517,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
     nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
 #if !REMOVE_MV_ADAPT_PREC
   }
-#endif
 #endif
   return ( ( abs( mvQ0.getHor() - mvP0.getHor() ) >= nThreshold ) || ( abs( mvQ0.getVer() - mvP0.getVer() ) >= nThreshold ) ) ? 1 : 0;
 }
diff --git a/source/Lib/CommonLib/MotionInfo.h b/source/Lib/CommonLib/MotionInfo.h
index d90715d12..d41a93712 100644
--- a/source/Lib/CommonLib/MotionInfo.h
+++ b/source/Lib/CommonLib/MotionInfo.h
@@ -56,7 +56,6 @@ struct AMVPInfo
   unsigned numCand;                       ///< number of motion vector predictor candidates
 };
 
-#if JVET_K_AFFINE
 struct AffineAMVPInfo
 {
   Mv       mvCandLT[ AMVP_MAX_NUM_CANDS_MEM ];  ///< array of affine motion vector predictor candidates for left-top corner
@@ -64,7 +63,6 @@ struct AffineAMVPInfo
   Mv       mvCandLB[ AMVP_MAX_NUM_CANDS_MEM ];  ///< array of affine motion vector predictor candidates for left-bottom corner
   unsigned numCand;                       ///< number of motion vector predictor candidates
 };
-#endif
 
 // ====================================================================================================================
 // Class definition
diff --git a/source/Lib/CommonLib/Mv.cpp b/source/Lib/CommonLib/Mv.cpp
index eb8466e12..083674b3d 100644
--- a/source/Lib/CommonLib/Mv.cpp
+++ b/source/Lib/CommonLib/Mv.cpp
@@ -65,7 +65,7 @@ void roundAffineMv( int& mvx, int& mvy, int nShift )
 
 void clipMv( Mv& rcMv, const Position& pos, const SPS& sps )
 {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   int iMvShift = 2 + (rcMv.highPrec ? VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : 0);
 #else
   int iMvShift = 2;
diff --git a/source/Lib/CommonLib/Mv.h b/source/Lib/CommonLib/Mv.h
index b87e8034f..a07f25512 100644
--- a/source/Lib/CommonLib/Mv.h
+++ b/source/Lib/CommonLib/Mv.h
@@ -53,7 +53,7 @@ class Mv
 public:
   int   hor;     ///< horizontal component of motion vector
   int   ver;     ///< vertical component of motion vector
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   bool  highPrec;///< true if the vector is high precision
 #endif
 
@@ -61,7 +61,7 @@ public:
   // constructors
   // ------------------------------------------------------------------------------------------------------------------
 
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   Mv(                                            ) : hor( 0    ), ver( 0    ), highPrec( false     ) {}
   Mv( int iHor, int iVer, bool _highPrec = false ) : hor( iHor ), ver( iVer ), highPrec( _highPrec ) {}
 #else
@@ -93,7 +93,7 @@ public:
 
   const Mv& operator += (const Mv& _rcMv)
   {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     if( highPrec == _rcMv.highPrec )
     {
       hor += _rcMv.hor;
@@ -104,7 +104,7 @@ public:
     {
       Mv rcMv = _rcMv;
 
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
       if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
       if( !highPrec && rcMv.highPrec )      setHighPrec();
 #endif
@@ -116,7 +116,7 @@ public:
 
   const Mv& operator-= (const Mv& _rcMv)
   {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     if( highPrec == _rcMv.highPrec )
     {
       hor -= _rcMv.hor;
@@ -127,7 +127,7 @@ public:
     {
       Mv rcMv = _rcMv;
 
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
       if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
       if( !highPrec && rcMv.highPrec )      setHighPrec();
 #endif
@@ -166,7 +166,7 @@ public:
 
   const Mv operator - ( const Mv& rcMv ) const
   {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     if( rcMv.highPrec == highPrec )
     {
       return Mv( hor - rcMv.hor, ver - rcMv.ver, highPrec );
@@ -185,7 +185,7 @@ public:
 
   const Mv operator + ( const Mv& rcMv ) const
   {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     if( rcMv.highPrec == highPrec )
     {
       return Mv( hor + rcMv.hor, ver + rcMv.ver, highPrec );
@@ -204,7 +204,7 @@ public:
 
   bool operator== ( const Mv& rcMv ) const
   {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     if( rcMv.highPrec == highPrec )
     {
       return ( hor == rcMv.hor && ver == rcMv.ver );
@@ -231,14 +231,13 @@ public:
   {
     const int mvx = Clip3( -32768, 32767, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8 );
     const int mvy = Clip3( -32768, 32767, (iScale * getVer() + 127 + (iScale * getVer() < 0)) >> 8 );
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     return Mv( mvx, mvy, highPrec );
 #else
     return Mv( mvx, mvy );
 #endif
   }
 
-#if JVET_K0346 || JVET_K_AFFINE
   void roundMV2SignalPrecision()
   {
 #if REMOVE_MV_ADAPT_PREC
@@ -273,7 +272,6 @@ public:
     highPrec = true;
   }
 #endif
-#endif
 };// END CLASS DEFINITION MV
 #if JVET_K0357_AMVR
 void roundMV( Mv& rcMv, unsigned imvShift );
diff --git a/source/Lib/CommonLib/RdCost.h b/source/Lib/CommonLib/RdCost.h
index fa325bd81..5d81ad10c 100644
--- a/source/Lib/CommonLib/RdCost.h
+++ b/source/Lib/CommonLib/RdCost.h
@@ -161,7 +161,7 @@ public:
   void           setPredictor             ( const Mv& rcMv )
   {
     m_mvPredictor = rcMv;
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     if( m_mvPredictor.highPrec )
     {
       m_mvPredictor = Mv( m_mvPredictor.hor >> VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, m_mvPredictor.ver >> VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false );
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index c21822cfd..86aaf6b42 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -1652,20 +1652,16 @@ SPSNext::SPSNext( SPS& sps )
 #if JVET_K0357_AMVR
   , m_IMV                       ( false )
 #endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   , m_highPrecMv                ( false )
-#endif
 #endif
   , m_DisableMotionCompression  ( false )
   , m_LMChroma                  ( false )
   , m_IntraEMT                  ( false )
   , m_InterEMT                  ( false )
-#if JVET_K_AFFINE
   , m_Affine                    ( false )
 #if JVET_K0337_AFFINE_6PARA
   , m_AffineType                ( false )
-#endif
 #endif
   , m_MTTEnabled                ( false )
 #if ENABLE_WPP_PARALLELISM
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 3c53b3e4b..ead9bdbd0 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -805,20 +805,16 @@ private:
 #if JVET_K0357_AMVR
   bool              m_IMV;                        // 9
 #endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   bool              m_highPrecMv;
-#endif
 #endif
   bool              m_DisableMotionCompression;   // 13
   bool              m_LMChroma;                   // 17
   bool              m_IntraEMT;                   // 18
   bool              m_InterEMT;                   // 19
-#if JVET_K_AFFINE
   bool              m_Affine;
 #if JVET_K0337_AFFINE_6PARA
   bool              m_AffineType;
-#endif
 #endif
   bool              m_MTTEnabled;                 //
 #if ENABLE_WPP_PARALLELISM
@@ -875,19 +871,15 @@ public:
   void      setUseIMV             ( bool b )                                        { m_IMV = b; }
   bool      getUseIMV             ()                                      const     { return m_IMV; }
 #endif
-#if JVET_K_AFFINE
   void      setUseAffine          ( bool b )                                        { m_Affine = b; }
   bool      getUseAffine          ()                                      const     { return m_Affine; }
 #if JVET_K0337_AFFINE_6PARA
   void      setUseAffineType      ( bool b )                                        { m_AffineType = b; }
   bool      getUseAffineType      ()                                      const     { return m_AffineType; }
 #endif
-#endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   void      setUseHighPrecMv(bool b) { m_highPrecMv = b; }
   bool      getUseHighPrecMv()                                      const { return m_highPrecMv; }
-#endif
 #endif
   void      setDisableMotCompress ( bool b )                                        { m_DisableMotionCompression = b; }
   bool      getDisableMotCompress ()                                      const     { return m_DisableMotionCompression; }
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 143fd9235..8464abeb2 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -84,8 +84,6 @@
 
 #define JVET_K0251_QP_EXT                                 1 // Extending the QP parameter value range for coarse quantization
 
-#define JVET_K_AFFINE                                     1
-#if JVET_K_AFFINE
 #define JVET_K0367_AFFINE_FIX_POINT                       1 // bit-exact SIMD optimization for affine ME
 #define JVET_K_AFFINE_BUG_FIXES                           1 // several affine bug fixes from JVET-K0052, JVET-K0103, JVET-K0367
 
@@ -93,10 +91,7 @@
 #define JVET_K0337_AFFINE_MVP_IMPROVE                     1 // CE4.1.3 Affine MVP construction
 #define JVET_K0337_AFFINE_MVD_PREDICTION                  1 // CE4.1.3 Affine MVD prediction
 #define JVET_K0337_AFFINE_6PARA                           1 // CE4.1.3 CU level 4-para/6-para switching
-#if JVET_K0337_AFFINE_6PARA
 #define JVET_K0185_AFFINE_6PARA_ENC                       1 // CE4.1.5 Affine 6-para encoder
-#endif
-#endif
 
 #define JVET_K0357_AMVR                                   1 // Adaptive motion vector resolution separated from JEM_TOOLS macro
 
@@ -275,9 +270,7 @@
 #define ENABLE_SIMD_OPT_MCIF                            ( 1 && ENABLE_SIMD_OPT )                            ///< SIMD optimization for the interpolation filter, no impact on RD performance
 #define ENABLE_SIMD_OPT_BUFFER                          ( 1 && ENABLE_SIMD_OPT )                            ///< SIMD optimization for the buffer operations, no impact on RD performance
 #define ENABLE_SIMD_OPT_DIST                            ( 1 && ENABLE_SIMD_OPT )                            ///< SIMD optimization for the distortion calculations(SAD,SSE,HADAMARD), no impact on RD performance
-#if JVET_K0367_AFFINE_FIX_POINT
 #define ENABLE_SIMD_OPT_AFFINE_ME                       ( 1 && ENABLE_SIMD_OPT )                            ///< SIMD optimization for affine ME, no impact on RD performance
-#endif
 #define ENABLE_SIMD_OPT_ALF                             ( 1 && ENABLE_SIMD_OPT )                            ///< SIMD optimization for ALF
 // End of SIMD optimizations
 
diff --git a/source/Lib/CommonLib/Unit.cpp b/source/Lib/CommonLib/Unit.cpp
index 86333927d..676277d51 100644
--- a/source/Lib/CommonLib/Unit.cpp
+++ b/source/Lib/CommonLib/Unit.cpp
@@ -253,11 +253,9 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
   mtDepth           = other.mtDepth;
   splitSeries       = other.splitSeries;
   skip              = other.skip;
-#if JVET_K_AFFINE
   affine            = other.affine;
 #if JVET_K0337_AFFINE_6PARA
   affineType        = other.affineType;
-#endif
 #endif
   transQuantBypass  = other.transQuantBypass;
   ipcm              = other.ipcm;
@@ -285,11 +283,9 @@ void CodingUnit::initData()
   mtDepth           = 0;
   splitSeries       = 0;
   skip              = false;
-#if JVET_K_AFFINE
   affine            = false;
 #if JVET_K0337_AFFINE_6PARA
   affineType        = 0;
-#endif
 #endif
   transQuantBypass  = false;
   ipcm              = false;
@@ -332,12 +328,10 @@ void PredictionUnit::initData()
     refIdx[i] = -1;
     mv[i]     .setZero();
     mvd[i]    .setZero();
-#if JVET_K_AFFINE
     for( uint32_t j = 0; j < 3; j++ )
     {
       mvdAffi[i][j].setZero();
     }
-#endif
   }
 }
 
@@ -364,12 +358,10 @@ PredictionUnit& PredictionUnit::operator=(const InterPredictionData& predData)
     mv[i]       = predData.mv[i];
     mvd[i]      = predData.mvd[i];
     refIdx[i]   = predData.refIdx[i];
-#if JVET_K_AFFINE
     for( uint32_t j = 0; j < 3; j++ )
     {
       mvdAffi[i][j] = predData.mvdAffi[i][j];
     }
-#endif
   }
 
   return *this;
@@ -393,12 +385,10 @@ PredictionUnit& PredictionUnit::operator=( const PredictionUnit& other )
     mv[i]       = other.mv[i];
     mvd[i]      = other.mvd[i];
     refIdx[i]   = other.refIdx[i];
-#if JVET_K_AFFINE
     for( uint32_t j = 0; j < 3; j++ )
     {
       mvdAffi[i][j] = other.mvdAffi[i][j];
     }
-#endif
   }
 
   return *this;
diff --git a/source/Lib/CommonLib/Unit.h b/source/Lib/CommonLib/Unit.h
index 2e18f344d..9638f70f3 100644
--- a/source/Lib/CommonLib/Unit.h
+++ b/source/Lib/CommonLib/Unit.h
@@ -295,11 +295,9 @@ struct CodingUnit : public UnitArea
   int8_t          qp;
   SplitSeries    splitSeries;
   bool           skip;
-#if JVET_K_AFFINE
   bool           affine;
 #if JVET_K0337_AFFINE_6PARA
   int            affineType;
-#endif
 #endif
   bool           transQuantBypass;
   bool           ipcm;
@@ -358,9 +356,7 @@ struct InterPredictionData
   Mv        mv      [NUM_REF_PIC_LIST_01];
   int16_t     refIdx  [NUM_REF_PIC_LIST_01];
   MergeType mergeType;
-#if JVET_K_AFFINE
   Mv        mvdAffi [NUM_REF_PIC_LIST_01][3];
-#endif
 };
 
 struct PredictionUnit : public UnitArea, public IntraPredictionData, public InterPredictionData
diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp
index b03a0d083..999813df7 100644
--- a/source/Lib/CommonLib/UnitTools.cpp
+++ b/source/Lib/CommonLib/UnitTools.cpp
@@ -1078,7 +1078,7 @@ bool PU::getColocatedMVP(const PredictionUnit &pu, const RefPicList &eRefPicList
     }
     else
     {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
       if( pu.cs->sps->getSpsNext().getUseHighPrecMv() )
       {
         // allow extended precision for temporal scaling
@@ -1279,7 +1279,7 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
 
   while (pInfo->numCand < AMVP_MAX_NUM_CANDS)
   {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
     const bool prec = pInfo->mvCand[pInfo->numCand].highPrec;
     pInfo->mvCand[pInfo->numCand] = Mv( 0, 0, prec );
 #else
@@ -1315,7 +1315,7 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
     }
   }
 #endif
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   if (pu.cs->sps->getSpsNext().getUseHighPrecMv())
   {
     for (Mv &mv : pInfo->mvCand)
@@ -1327,7 +1327,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
 }
 
 
-#if JVET_K_AFFINE
 #if JVET_K0337_AFFINE_MVP_IMPROVE
 const int getAvailableAffineNeighbours( const PredictionUnit &pu, const PredictionUnit* npu[] )
 {
@@ -1858,13 +1857,8 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
     }
   }
 }
-#endif
 
-#if JVET_K_AFFINE
 bool PU::addMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &info, bool affine )
-#else
-bool PU::addMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &info )
-#endif
 {
         CodingStructure &cs    = *pu.cs;
   const PredictionUnit *neibPU = NULL;
@@ -1910,7 +1904,6 @@ bool PU::addMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &eRefPic
 
     if( neibRefIdx >= 0 && currRefPOC == cs.slice->getRefPOC( eRefPicListIndex, neibRefIdx ) )
     {
-#if JVET_K_AFFINE
       if( affine )
       {
         int i = 0;
@@ -1933,7 +1926,6 @@ bool PU::addMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &eRefPic
         }
       }
       else
-#endif
       {
         info.mvCand[info.numCand++] = neibMi.mv[eRefPicListIndex];
         return true;
@@ -1953,11 +1945,7 @@ bool PU::addMVPCandUnscaled( const PredictionUnit &pu, const RefPicList &eRefPic
 * \param eDir
 * \returns bool
 */
-#if JVET_K_AFFINE
 bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &info, bool affine )
-#else
-bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &info )
-#endif
 {
         CodingStructure &cs    = *pu.cs;
   const Slice &slice           = *cs.slice;
@@ -2020,7 +2008,7 @@ bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRef
 
           if( scale != 4096 )
           {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
             if( slice.getSPS()->getSpsNext().getUseHighPrecMv() )
             {
               cMv.setHighPrec();
@@ -2030,7 +2018,6 @@ bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRef
           }
         }
 
-#if JVET_K_AFFINE
         if( affine )
         {
           int i;
@@ -2049,7 +2036,6 @@ bool PU::addMVPCandWithScaling( const PredictionUnit &pu, const RefPicList &eRef
           }
         }
         else
-#endif
         {
           info.mvCand[info.numCand++] = cMv;
           return true;
@@ -2077,7 +2063,6 @@ bool PU::isBipredRestriction(const PredictionUnit &pu)
 }
 
 
-#if JVET_K_AFFINE
 const PredictionUnit* getFirstAvailableAffineNeighbour( const PredictionUnit &pu )
 {
   const Position posLT = pu.Y().topLeft();
@@ -2288,7 +2273,6 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
   }
 #endif
 }
-#endif
 
 #if JVET_K0346
 static bool deriveScaledMotionTemporal( const Slice&      slice,
@@ -2743,7 +2727,6 @@ void PU::spanMotionInfo( PredictionUnit &pu, const MergeCtx &mrgCtx )
       }
     }
 
-#if JVET_K_AFFINE
     if( pu.cu->affine )
     {
       for( int y = 0; y < mb.height; y++ )
@@ -2766,7 +2749,6 @@ void PU::spanMotionInfo( PredictionUnit &pu, const MergeCtx &mrgCtx )
       }
     }
     else
-#endif
     {
       mb.fill( mi );
     }
diff --git a/source/Lib/CommonLib/UnitTools.h b/source/Lib/CommonLib/UnitTools.h
index fcbbf5a17..66cb9e6f8 100644
--- a/source/Lib/CommonLib/UnitTools.h
+++ b/source/Lib/CommonLib/UnitTools.h
@@ -108,26 +108,18 @@ namespace PU
 
   void getInterMergeCandidates        (const PredictionUnit &pu, MergeCtx& mrgCtx, const int& mrgCandIdx = -1 );
   bool isDiffMER                      (const PredictionUnit &pu, const PredictionUnit &pu2);
-#if JVET_K_AFFINE
   bool getColocatedMVP                (const PredictionUnit &pu, const RefPicList &eRefPicList, const Position &pos, Mv& rcMv, const int &refIdx);
   void fillMvpCand                    (      PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AMVPInfo &amvpInfo );
   void fillAffineMvpCand              (      PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AffineAMVPInfo &affiAMVPInfo);
   bool addMVPCandUnscaled             (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo, bool affine = false);
   bool addMVPCandWithScaling          (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo, bool affine = false);
   void xInheritedAffineMv             ( const PredictionUnit &pu, const PredictionUnit* puNeighbour, RefPicList eRefPicList, Mv rcMv[3] );
-#else
-  void fillMvpCand                    (      PredictionUnit &pu, const RefPicList &eRefPicList, const int &refIdx, AMVPInfo &amvpInfo);
-  bool addMVPCandUnscaled             (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo);
-  bool addMVPCandWithScaling          (const PredictionUnit &pu, const RefPicList &eRefPicList, const int &iRefIdx, const Position &pos, const MvpDir &eDir, AMVPInfo &amvpInfo);
-  bool getColocatedMVP                (const PredictionUnit &pu, const RefPicList &eRefPicList, const Position &pos, Mv& rcMv, const int &refIdx );
-#endif
   bool isBipredRestriction            (const PredictionUnit &pu);
   void spanMotionInfo                 (      PredictionUnit &pu, const MergeCtx &mrgCtx = MergeCtx() );
 #if JVET_K0357_AMVR
   void applyImv                       (      PredictionUnit &pu, MergeCtx &mrgCtx, InterPrediction *interPred = NULL );
 #endif
   void getAffineMergeCand             (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand );
-#if JVET_K_AFFINE
   bool isAffineMrgFlagCoded           (const PredictionUnit &pu );
   void getAffineMergeCand             (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand );
   void setAllAffineMvField            (      PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
@@ -136,7 +128,6 @@ namespace PU
     , bool setHighPrec = false
 #endif 
   );
-#endif
 #if JVET_K0346
   bool getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx &mrgCtx, bool& LICFlag, const int count
   );
diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp
index 32ef7304b..e5a75b4ce 100644
--- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp
+++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp
@@ -358,11 +358,9 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeIdx),  pu.mergeIdx);
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeType), pu.mergeType);
             }
-#if JVET_K_AFFINE
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineFlag), pu.cu->affine);
 #if JVET_K0337_AFFINE_6PARA
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineType), pu.cu->affineType);
-#endif
 #endif
             DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::InterDir), pu.interDir);
 
@@ -376,15 +374,12 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MVPIdxL1), pu.mvpIdx[REF_PIC_LIST_1]);
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::RefIdxL1), pu.refIdx[REF_PIC_LIST_1]);
             }
-#if JVET_K_AFFINE
             if (!pu.cu->affine)
             {
-#endif
               if (pu.interDir != 2 /* PRED_L1 */)
               {
                 Mv mv = pu.mv[REF_PIC_LIST_0];
                 Mv mvd = pu.mvd[REF_PIC_LIST_0];
-#if JVET_K0346 || JVET_K_AFFINE
 #if REMOVE_MV_ADAPT_PREC
                 mv.hor = mv.hor >= 0 ? (mv.hor + nOffset) >> nShift : -((-mv.hor + nOffset) >> nShift);
                 mv.ver = mv.ver >= 0 ? (mv.ver + nOffset) >> nShift : -((-mv.ver + nOffset) >> nShift);
@@ -393,7 +388,6 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
 #else
                 mv.setLowPrec();
                 mvd.setLowPrec();
-#endif
 #endif
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MVDL0), mvd.hor, mvd.ver);
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MVL0), mv.hor, mv.ver);
@@ -402,7 +396,6 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
               {
                 Mv mv = pu.mv[REF_PIC_LIST_1];
                 Mv mvd = pu.mvd[REF_PIC_LIST_1];
-#if JVET_K0346 || JVET_K_AFFINE
 #if REMOVE_MV_ADAPT_PREC
                 mv.hor = mv.hor >= 0 ? (mv.hor + nOffset) >> nShift : -((-mv.hor + nOffset) >> nShift);
                 mv.ver = mv.ver >= 0 ? (mv.ver + nOffset) >> nShift : -((-mv.ver + nOffset) >> nShift);
@@ -411,12 +404,10 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
 #else
                 mv.setLowPrec();
                 mvd.setLowPrec();
-#endif
 #endif
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MVDL1), mvd.hor, mvd.ver);
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MVL1), mv.hor, mv.ver);
               }
-#if JVET_K_AFFINE
             }
             else
             {
@@ -427,7 +418,6 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
                 mv[0] = mb.at(0, 0).mv[REF_PIC_LIST_0];
                 mv[1] = mb.at(mb.width - 1, 0).mv[REF_PIC_LIST_0];
                 mv[2] = mb.at(0, mb.height - 1).mv[REF_PIC_LIST_0];
-#if JVET_K0346 || JVET_K_AFFINE
                 // motion vectors should use low precision or they will appear to large
 #if REMOVE_MV_ADAPT_PREC
                 mv[0].hor = mv[0].hor >= 0 ? (mv[0].hor + nOffset) >> nShift : -((-mv[0].hor + nOffset) >> nShift);
@@ -440,7 +430,6 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
                 mv[0].setLowPrec();
                 mv[1].setLowPrec();
                 mv[2].setLowPrec();
-#endif
 #endif
                 DTRACE_BLOCK_AFFINETF(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineMVL0), mv[0].hor, mv[0].ver, mv[1].hor, mv[1].ver, mv[2].hor, mv[2].ver);
               }
@@ -451,7 +440,6 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
                 mv[0] = mb.at(0, 0).mv[REF_PIC_LIST_1];
                 mv[1] = mb.at(mb.width - 1, 0).mv[REF_PIC_LIST_1];
                 mv[2] = mb.at(0, mb.height - 1).mv[REF_PIC_LIST_1];
-#if JVET_K0346 || JVET_K_AFFINE
                 // motion vectors should use low precision or they will appear to large
 #if REMOVE_MV_ADAPT_PREC
                 mv[0].hor = mv[0].hor >= 0 ? (mv[0].hor + nOffset) >> nShift : -((-mv[0].hor + nOffset) >> nShift);
@@ -464,12 +452,10 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
                 mv[0].setLowPrec();
                 mv[1].setLowPrec();
                 mv[2].setLowPrec();
-#endif
 #endif
                 DTRACE_BLOCK_AFFINETF(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineMVL1), mv[0].hor, mv[0].ver, mv[1].hor, mv[1].ver, mv[2].hor, mv[2].ver);
               }
             }
-#endif        
           }
 #if JVET_K0357_AMVR
           DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
@@ -637,7 +623,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
             if (pu.mergeFlag)
             {
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MergeType), pu.mergeType);
-#if JVET_K_AFFINE
               if (!(cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N)
                 && !(!cu.firstPU->mergeFlag && !(cu.lumaSize().width > 8 && cu.lumaSize().height > 8))
                 && !(cu.firstPU->mergeFlag && !PU::isAffineMrgFlagCoded(*cu.firstPU)))
@@ -648,10 +633,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                   DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineType), pu.cu->affineType);
                 }
               }
-#endif
-#if JVET_K_AFFINE
               if (!(pu.cu->affine))
-#endif
               {
                 DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MergeIdx), pu.mergeIdx);
               }
@@ -662,7 +644,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
               {
                 DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::InterDir), pu.interDir);
               }
-#if JVET_K_AFFINE
               if (!(cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N)
                 && !(!cu.firstPU->mergeFlag && !(cu.lumaSize().width > 8 && cu.lumaSize().height > 8))
                 && !(cu.firstPU->mergeFlag && !PU::isAffineMrgFlagCoded(*cu.firstPU)))
@@ -673,7 +654,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                   DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineType), pu.cu->affineType);
                 }
               }
-#endif
             }
             if (pu.interDir != 2 /* PRED_L1 */)
             {
@@ -686,15 +666,12 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
               DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::RefIdxL1), pu.refIdx[REF_PIC_LIST_1]);
             }
 
-#if JVET_K_AFFINE
             if (!pu.cu->affine)
             {
-#endif
               if (pu.interDir != 2 /* PRED_L1 */)
               {
                 Mv mv = pu.mv[REF_PIC_LIST_0];
                 Mv mvd = pu.mvd[REF_PIC_LIST_0];
-#if JVET_K0346 || JVET_K_AFFINE
 #if REMOVE_MV_ADAPT_PREC
                 mv.hor = mv.hor >= 0 ? (mv.hor + nOffset) >> nShift : -((-mv.hor + nOffset) >> nShift);
                 mv.ver = mv.ver >= 0 ? (mv.ver + nOffset) >> nShift : -((-mv.ver + nOffset) >> nShift);
@@ -703,7 +680,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
 #else
                 mv.setLowPrec();
                 mvd.setLowPrec();
-#endif
 #endif
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MVDL0), mvd.hor, mvd.ver);
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MVL0), mv.hor, mv.ver);
@@ -712,7 +688,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
               {
                 Mv mv = pu.mv[REF_PIC_LIST_1];
                 Mv mvd = pu.mvd[REF_PIC_LIST_1];
-#if JVET_K0346 || JVET_K_AFFINE
 #if REMOVE_MV_ADAPT_PREC
                 mv.hor = mv.hor >= 0 ? (mv.hor + nOffset) >> nShift : -((-mv.hor + nOffset) >> nShift);
                 mv.ver = mv.ver >= 0 ? (mv.ver + nOffset) >> nShift : -((-mv.ver + nOffset) >> nShift);
@@ -721,12 +696,10 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
 #else
                 mv.setLowPrec();
                 mvd.setLowPrec();
-#endif
 #endif
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MVDL1), mvd.hor, mvd.ver);
                 DTRACE_BLOCK_VECTOR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::MVL1), mv.hor, mv.ver);
               }
-#if JVET_K_AFFINE
             }
             else
             {
@@ -737,7 +710,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                 mv[0] = mb.at(0, 0).mv[REF_PIC_LIST_0];
                 mv[1] = mb.at(mb.width - 1, 0).mv[REF_PIC_LIST_0];
                 mv[2] = mb.at(0, mb.height - 1).mv[REF_PIC_LIST_0];
-#if JVET_K0346 || JVET_K_AFFINE
                 // motion vectors should use low precision or they will appear to large
 #if REMOVE_MV_ADAPT_PREC
                 mv[0].hor = mv[0].hor >= 0 ? (mv[0].hor + nOffset) >> nShift : -((-mv[0].hor + nOffset) >> nShift);
@@ -751,7 +723,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                 mv[1].setLowPrec();
                 mv[2].setLowPrec();
 #endif
-  #endif
                 DTRACE_BLOCK_AFFINETF(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineMVL0), mv[0].hor, mv[0].ver, mv[1].hor, mv[1].ver, mv[2].hor, mv[2].ver);
               }
               if (pu.interDir != 1 /* PRED_L1 */)
@@ -761,7 +732,6 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                 mv[0] = mb.at(0, 0).mv[REF_PIC_LIST_1];
                 mv[1] = mb.at(mb.width - 1, 0).mv[REF_PIC_LIST_1];
                 mv[2] = mb.at(0, mb.height - 1).mv[REF_PIC_LIST_1];
-#if JVET_K0346 || JVET_K_AFFINE
                 // motion vectors should use low precision or they will appear to large
 #if REMOVE_MV_ADAPT_PREC
                 mv[0].hor = mv[0].hor >= 0 ? (mv[0].hor + nOffset) >> nShift : -((-mv[0].hor + nOffset) >> nShift);
@@ -775,11 +745,9 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
                 mv[1].setLowPrec();
                 mv[2].setLowPrec();
 #endif
-  #endif
                 DTRACE_BLOCK_AFFINETF(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineMVL1), mv[0].hor, mv[0].ver, mv[1].hor, mv[1].ver, mv[2].hor, mv[2].ver);
               }
             }
-#endif
 #if JVET_K0357_AMVR
             if (cu.cs->sps->getSpsNext().getUseIMV() && CU::hasSubCUNonZeroMVd(cu))
             {
diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.h b/source/Lib/CommonLib/dtrace_blockstatistics.h
index 2567fcc5e..9b446de27 100644
--- a/source/Lib/CommonLib/dtrace_blockstatistics.h
+++ b/source/Lib/CommonLib/dtrace_blockstatistics.h
@@ -93,14 +93,12 @@ enum class BlockStatistic {
   MVDL1,
   RefIdxL0,
   RefIdxL1,
-#if JVET_K_AFFINE
   AffineFlag,
   AffineMVL0,
   AffineMVL1,
 #if JVET_K0337_AFFINE_6PARA
   AffineType,
 #endif
-#endif
 
 // for dual tree
   // general
@@ -168,13 +166,11 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
 #if JVET_K0357_AMVR
   { BlockStatistic::IMVMode,                std::tuple<std::string, BlockStatisticType, std::string>{"IMVMode",                     BlockStatisticType::Integer,                "[0, 2]"}},
 #endif
-#if JVET_K_AFFINE
   { BlockStatistic::AffineFlag,             std::tuple<std::string, BlockStatisticType, std::string>{"AffineFlag",                  BlockStatisticType::Flag,                   ""}},
   { BlockStatistic::AffineMVL0,             std::tuple<std::string, BlockStatisticType, std::string>{"AffineMVL0",                  BlockStatisticType::AffineTFVectors,        "Scale: 4"}},
   { BlockStatistic::AffineMVL1,             std::tuple<std::string, BlockStatisticType, std::string>{"AffineMVL1",                  BlockStatisticType::AffineTFVectors,        "Scale: 4"}},
 #if JVET_K0337_AFFINE_6PARA
   { BlockStatistic::AffineType,             std::tuple<std::string, BlockStatisticType, std::string>{"AffineType",                  BlockStatisticType::Flag,                   ""} },
-#endif
 #endif
   { BlockStatistic::EMTFlag,                std::tuple<std::string, BlockStatisticType, std::string>{"EMTFlag",                     BlockStatisticType::Flag,                   ""}},
 
diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp
index f25f7e48d..472d730ba 100644
--- a/source/Lib/DecoderLib/CABACReader.cpp
+++ b/source/Lib/DecoderLib/CABACReader.cpp
@@ -1121,22 +1121,17 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
   }
   if( pu.mergeFlag )
   {
-#if JVET_K_AFFINE
     affine_flag  ( *pu.cu );
-#endif
     merge_data   ( pu );
   }
   else
   {
     inter_pred_idc( pu );
-#if JVET_K_AFFINE
     affine_flag   ( *pu.cu );
-#endif
 
     if( pu.interDir != 2 /* PRED_L1 */ )
     {
       ref_idx     ( pu, REF_PIC_LIST_0 );
-#if JVET_K_AFFINE
       if( pu.cu->affine )
       {
         mvd_coding( pu.mvdAffi[REF_PIC_LIST_0][0] );
@@ -1149,7 +1144,6 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
 #endif
       }
       else
-#endif
       {
         mvd_coding( pu.mvd[REF_PIC_LIST_0] );
       }
@@ -1162,13 +1156,10 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
       if( pu.cu->cs->slice->getMvdL1ZeroFlag() && pu.interDir == 3 /* PRED_BI */ )
       {
         pu.mvd[ REF_PIC_LIST_1 ] = Mv();
-#if JVET_K_AFFINE
         pu.mvdAffi[REF_PIC_LIST_1][0] = Mv();
         pu.mvdAffi[REF_PIC_LIST_1][1] = Mv();
         pu.mvdAffi[REF_PIC_LIST_1][2] = Mv();
-#endif
       }
-#if JVET_K_AFFINE
       else if( pu.cu->affine )
       {
         mvd_coding( pu.mvdAffi[REF_PIC_LIST_1][0] );
@@ -1180,7 +1171,6 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
         }
 #endif
       }
-#endif
       else
       {
         mvd_coding( pu.mvd[REF_PIC_LIST_1] );
@@ -1198,7 +1188,6 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
   PU::spanMotionInfo( pu, mrgCtx );
 }
 
-#if JVET_K_AFFINE
 void CABACReader::affine_flag( CodingUnit& cu )
 {
   if( cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N )
@@ -1238,7 +1227,6 @@ void CABACReader::affine_flag( CodingUnit& cu )
   }
 #endif
 }
-#endif
 
 void CABACReader::merge_flag( PredictionUnit& pu )
 {
@@ -1252,12 +1240,10 @@ void CABACReader::merge_flag( PredictionUnit& pu )
 
 void CABACReader::merge_data( PredictionUnit& pu )
 {
-#if JVET_K_AFFINE
   if ( pu.cu->affine )
   {
     return;
   }
-#endif
 
   merge_idx( pu );
 }
diff --git a/source/Lib/DecoderLib/CABACReader.h b/source/Lib/DecoderLib/CABACReader.h
index a982c0c8b..8c42dd8b7 100644
--- a/source/Lib/DecoderLib/CABACReader.h
+++ b/source/Lib/DecoderLib/CABACReader.h
@@ -96,9 +96,7 @@ public:
   void        prediction_unit           ( PredictionUnit&               pu,     MergeCtx&       mrgCtx );
   void        merge_flag                ( PredictionUnit&               pu );
   void        merge_data                ( PredictionUnit&               pu );
-#if JVET_K_AFFINE
   void        affine_flag               ( CodingUnit&                   cu );
-#endif
   void        merge_idx                 ( PredictionUnit&               pu );
 #if JVET_K0357_AMVR
   void        imv_mode                  ( CodingUnit&                   cu,     MergeCtx&       mrgCtx );
diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp
index 312e04cfc..85488b774 100644
--- a/source/Lib/DecoderLib/DecCu.cpp
+++ b/source/Lib/DecoderLib/DecCu.cpp
@@ -395,7 +395,6 @@ void DecCu::xDecodeInterTexture(CodingUnit &cu)
   }
 }
 
-#if JVET_K0346 || JVET_K_AFFINE
 void DecCu::xDeriveCUMV( CodingUnit &cu )
 {
   for( auto &pu : CU::traversePUs( cu ) )
@@ -403,17 +402,14 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
     MergeCtx mrgCtx;
 
 #if RExt__DECODER_DEBUG_TOOL_STATISTICS
-#if JVET_K_AFFINE
     if( pu.cu->affine )
     {
       CodingStatistics::IncrementStatisticTool( CodingStatisticsClassType{ STATS__TOOL_AFF, pu.Y().width, pu.Y().height } );
     }
-#endif
 #endif
     if( pu.mergeFlag )
     {
       {
-#if JVET_K_AFFINE
         if( pu.cu->affine )
         {
           pu.mergeIdx = 0;
@@ -437,7 +433,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
           PU::spanMotionInfo( pu, mrgCtx );
         }
         else
-#endif
         {
 #if JVET_K0346
           if( pu.cs->sps->getSpsNext().getUseSubPuMvp() )
@@ -493,7 +488,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
         else
 #endif
       {
-#if JVET_K_AFFINE
         if( pu.cu->affine )
         {
           for ( uint32_t uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
@@ -560,7 +554,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
           }
         }
         else
-#endif
         {
           for ( uint32_t uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
           {
@@ -572,7 +565,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
               pu.mvpNum [eRefList] = amvpInfo.numCand;
               pu.mv     [eRefList] = amvpInfo.mvCand[pu.mvpIdx [eRefList]] + pu.mvd[eRefList];
 
-#if JVET_K_AFFINE
               if( pu.cs->sps->getSpsNext().getUseAffine() )
               {
 #if REMOVE_MV_ADAPT_PREC
@@ -582,7 +574,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
                 pu.mv[eRefList].setHighPrec();
 #endif
               }
-#endif
             }
           }
         }
@@ -591,75 +582,4 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
     }
   }
 }
-#else
-void DecCu::xDeriveCUMV( CodingUnit &cu )
-{
-  for( auto &pu : CU::traversePUs( cu ) )
-  {
-    MergeCtx mrgCtx;
-
-    if( pu.mergeFlag )
-    {
-      if( cu.cs->pps->getLog2ParallelMergeLevelMinus2() && cu.partSize != SIZE_2Nx2N && cu.lumaSize().width <= 8 )
-      {
-        if( !mrgCtx.hasMergedCandList )
-        {
-          // temporarily set size to 2Nx2N
-          PartSize                 tmpPS    = SIZE_2Nx2N;
-          PredictionUnit           tmpPU    = pu;
-          static_cast<UnitArea&> ( tmpPU )  = cu;
-          std::swap( tmpPS, cu.partSize );
-          PU::getInterMergeCandidates( tmpPU, mrgCtx, pu.mergeIdx );
-          std::swap( tmpPS, cu.partSize );
-          mrgCtx.hasMergedCandList          = true;
-        }
-      }
-      else
-      {
-        PU::getInterMergeCandidates( pu, mrgCtx, pu.mergeIdx );
-      }
-          
-      mrgCtx.setMergeInfo( pu, pu.mergeIdx );
-          
-      if( pu.interDir == 3 /* PRED_BI */ && PU::isBipredRestriction(pu) )
-      {
-        pu.mv    [REF_PIC_LIST_1] = Mv(0, 0);
-        pu.refIdx[REF_PIC_LIST_1] = -1;
-        pu.interDir               =  1;
-      }
-      PU::spanMotionInfo( pu, mrgCtx );      
-    }
-    else
-    {
-#if JVET_K0357_AMVR
-#if REUSE_CU_RESULTS
-      if (cu.imv && !cu.cs->pcv->isEncoder)
-#else
-      if (cu.imv)
-#endif
-      {
-        PU::applyImv(pu, mrgCtx, m_pcInterPred);
-      }
-      else
-      {
-#endif
-        for ( uint32_t uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
-        {
-          RefPicList eRefList = RefPicList( uiRefListIdx );
-          if ( pu.cs->slice->getNumRefIdx( eRefList ) > 0 && ( pu.interDir & ( 1 << uiRefListIdx ) ) )
-          {
-            AMVPInfo amvpInfo;
-            PU::fillMvpCand( pu, eRefList, pu.refIdx[eRefList], amvpInfo );
-            pu.mvpNum [eRefList] = amvpInfo.numCand;
-            pu.mv     [eRefList] = amvpInfo.mvCand[pu.mvpIdx [eRefList]] + pu.mvd[eRefList];
-          }
-        }
-        PU::spanMotionInfo( pu, mrgCtx );
-      }
-#if JVET_K0357_AMVR
-    }
-#endif
-  }
-}
-#endif
 //! \}
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 66bd7a7f3..8573d6deb 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -796,23 +796,19 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
 #if JVET_K0357_AMVR
   READ_FLAG( symbol,    "imv_enable_flag" );                        spsNext.setUseIMV                 ( symbol != 0 );
 #endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   READ_FLAG( symbol, "high_precision_motion_vectors" );             spsNext.setUseHighPrecMv(symbol != 0);
-#endif
 #endif
   READ_FLAG( symbol,    "disable_motion_compression_flag" );        spsNext.setDisableMotCompress     ( symbol != 0 );
   READ_FLAG( symbol,    "lm_chroma_enabled_flag" );                 spsNext.setUseLMChroma            ( symbol != 0 );
   READ_FLAG( symbol,    "emt_intra_enabled_flag" );                 spsNext.setUseIntraEMT            ( symbol != 0 );
   READ_FLAG( symbol,    "emt_inter_enabled_flag" );                 spsNext.setUseInterEMT            ( symbol != 0 );
-#if JVET_K_AFFINE
   READ_FLAG( symbol,    "affine_flag" );                            spsNext.setUseAffine              ( symbol != 0 );
 #if JVET_K0337_AFFINE_6PARA
   if ( spsNext.getUseAffine() )
   {
     READ_FLAG( symbol,  "affine_type_flag" );                       spsNext.setUseAffineType          ( symbol != 0 );
   }
-#endif
 #endif
   for( int k = 0; k < SPSNext::NumReservedFlags; k++ )
   {
diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp
index 69f2fa280..0f8184fdc 100644
--- a/source/Lib/EncoderLib/CABACWriter.cpp
+++ b/source/Lib/EncoderLib/CABACWriter.cpp
@@ -1102,21 +1102,16 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
   }
   if( pu.mergeFlag )
   {
-#if JVET_K_AFFINE
     affine_flag  ( *pu.cu );
-#endif
     merge_idx    ( pu );
   }
   else
   {
     inter_pred_idc( pu );
-#if JVET_K_AFFINE
     affine_flag   ( *pu.cu );
-#endif
     if( pu.interDir != 2 /* PRED_L1 */ )
     {
       ref_idx     ( pu, REF_PIC_LIST_0 );
-#if JVET_K_AFFINE
       if ( pu.cu->affine )
       {
 #if JVET_K0357_AMVR
@@ -1138,7 +1133,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
 #endif
       }
       else
-#endif
       {
 #if JVET_K0357_AMVR
         mvd_coding( pu.mvd[REF_PIC_LIST_0], pu.cu->imv );
@@ -1153,7 +1147,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
       ref_idx     ( pu, REF_PIC_LIST_1 );
       if( !pu.cs->slice->getMvdL1ZeroFlag() || pu.interDir != 3 /* PRED_BI */ )
       {
-#if JVET_K_AFFINE
         if ( pu.cu->affine )
         {
 #if JVET_K0357_AMVR
@@ -1175,7 +1168,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
 #endif
         }
         else
-#endif
         {
 #if JVET_K0357_AMVR
           mvd_coding( pu.mvd[REF_PIC_LIST_1], pu.cu->imv );
@@ -1189,7 +1181,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
   }
 }
 
-#if JVET_K_AFFINE
 void CABACWriter::affine_flag( const CodingUnit& cu )
 {
   if( cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N )
@@ -1226,7 +1217,6 @@ void CABACWriter::affine_flag( const CodingUnit& cu )
   }
 #endif
 }
-#endif
 
 void CABACWriter::merge_flag( const PredictionUnit& pu )
 {
@@ -1267,12 +1257,10 @@ void CABACWriter::imv_mode( const CodingUnit& cu )
 
 void CABACWriter::merge_idx( const PredictionUnit& pu )
 {
-#if JVET_K_AFFINE
   if ( pu.cu->affine )
   {
     return;
   }
-#endif
 
   int numCandminus1 = int( pu.cs->slice->getMaxNumMergeCand() ) - 1;
   if( numCandminus1 > 0 )
@@ -1634,7 +1622,7 @@ void CABACWriter::mvd_coding( const Mv &rMvd )
   unsigned  horAbs  = unsigned( horMvd < 0 ? -horMvd : horMvd );
   unsigned  verAbs  = unsigned( verMvd < 0 ? -verMvd : verMvd );
 
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   if (rMvd.highPrec)
   {
     CHECK(horAbs & ((1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE) - 1), "mvd-x has high precision fractional part.");
diff --git a/source/Lib/EncoderLib/CABACWriter.h b/source/Lib/EncoderLib/CABACWriter.h
index 7894e8e4a..06d018759 100644
--- a/source/Lib/EncoderLib/CABACWriter.h
+++ b/source/Lib/EncoderLib/CABACWriter.h
@@ -117,9 +117,7 @@ public:
   // prediction unit (clause 7.3.8.6)
   void        prediction_unit           ( const PredictionUnit&         pu );
   void        merge_flag                ( const PredictionUnit&         pu );
-#if JVET_K_AFFINE
   void        affine_flag               ( const CodingUnit&             cu );
-#endif
   void        merge_idx                 ( const PredictionUnit&         pu );
 #if JVET_K0357_AMVR
   void        imv_mode                  ( const CodingUnit&             cu );
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index 003c475f8..cc4d975f4 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -194,16 +194,12 @@ protected:
   int       m_SubPuMvpMode;
   unsigned  m_SubPuMvpLog2Size;
 #endif
-#if JVET_K_AFFINE
   bool      m_Affine;
 #if JVET_K0337_AFFINE_6PARA
   bool      m_AffineType;
 #endif
-#endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   bool      m_highPrecMv;
-#endif
 #endif
   bool      m_DisableMotionCompression;
   unsigned  m_MTTMode;
@@ -626,19 +622,15 @@ public:
   unsigned  getSubPuMvpLog2Size()      const { return m_SubPuMvpLog2Size; }
 #endif
 
-#if JVET_K_AFFINE
   void      setAffine                       ( bool b )       { m_Affine = b; }
   bool      getAffine                       ()         const { return m_Affine; }
 #if JVET_K0337_AFFINE_6PARA
   void      setAffineType( bool b )                          { m_AffineType = b; }
   bool      getAffineType()                            const { return m_AffineType; }
 #endif
-#endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   void      setHighPrecisionMv              ( bool b )       { m_highPrecMv = b; }
   bool      getHighPrecisionMv              ()               { return m_highPrecMv; }
-#endif
 #endif
   void      setDisableMotionCompression     ( bool b )       { m_DisableMotionCompression = b; }
   bool      getDisableMotionCompression     ()         const { return m_DisableMotionCompression; }
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index 1bc5b7f42..bdb7f0662 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -616,12 +616,10 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par
       }
 
     }
-#if JVET_K_AFFINE
     else if( currTestMode.type == ETM_AFFINE )
     {
       xCheckRDCostAffineMerge2Nx2N( tempCS, bestCS, partitioner, currTestMode );
     }
-#endif
 #if REUSE_CU_RESULTS
     else if( currTestMode.type == ETM_RECO_CACHED )
     {
@@ -1696,7 +1694,6 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
   }
 }
 
-#if JVET_K_AFFINE
 void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode )
 {
   if( m_modeCtrl->getFastDeltaQp() )
@@ -1775,7 +1772,6 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
       , &hasNoResidual);
   }
 }
-#endif
 void EncCu::xCheckRDCostInter( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode )
 {
   tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
diff --git a/source/Lib/EncoderLib/EncCu.h b/source/Lib/EncoderLib/EncCu.h
index 221f1a8af..92f5e5878 100644
--- a/source/Lib/EncoderLib/EncCu.h
+++ b/source/Lib/EncoderLib/EncCu.h
@@ -188,10 +188,8 @@ protected:
   void xCheckDQP              ( CodingStructure& cs, Partitioner& partitioner, bool bKeepCtx = false);
   void xFillPCMBuffer         ( CodingUnit &cu);
 
-#if JVET_K_AFFINE
   void xCheckRDCostAffineMerge2Nx2N
                               ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &partitioner, const EncTestMode& encTestMode );
-#endif
   void xCheckRDCostInter      ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, const EncTestMode& encTestMode );
 #if JVET_K0357_AMVR
   bool xCheckRDCostInterIMV   ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, const EncTestMode& encTestMode );
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index 70cb6a94b..43f186f36 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -871,19 +871,12 @@ void EncLib::xInitSPS(SPS &sps)
   sps.getSpsNext().setImvMode               ( ImvMode(m_ImvMode) );
   sps.getSpsNext().setUseIMV                ( m_ImvMode != IMV_OFF );
 #endif
-#if JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   sps.getSpsNext().setUseHighPrecMv         ( m_highPrecMv );
 #endif
   sps.getSpsNext().setUseAffine             ( m_Affine );
 #if JVET_K0337_AFFINE_6PARA
   sps.getSpsNext().setUseAffineType         ( m_AffineType );
-#endif
-#endif
-#if JVET_K0346 && !JVET_K_AFFINE
-#if !REMOVE_MV_ADAPT_PREC
-  sps.getSpsNext().setUseHighPrecMv         ( m_highPrecMv );
-#endif
 #endif
   sps.getSpsNext().setDisableMotCompress    ( m_DisableMotionCompression );
   sps.getSpsNext().setMTTMode               ( m_MTTMode );
diff --git a/source/Lib/EncoderLib/EncModeCtrl.cpp b/source/Lib/EncoderLib/EncModeCtrl.cpp
index 8bd35331f..126bef866 100644
--- a/source/Lib/EncoderLib/EncModeCtrl.cpp
+++ b/source/Lib/EncoderLib/EncModeCtrl.cpp
@@ -864,7 +864,6 @@ unsigned SaveLoadEncInfoCtrl::getSaveLoadInterDir( const UnitArea& area )
 }
 
 
-#if JVET_K_AFFINE
 unsigned SaveLoadEncInfoCtrl::getSaveLoadAffineFlag( const UnitArea& area )
 {
   unsigned idx1, idx2, idx3, idx4;
@@ -873,7 +872,6 @@ unsigned SaveLoadEncInfoCtrl::getSaveLoadAffineFlag( const UnitArea& area )
   return m_saveLoadInfo[idx3][idx4].affineFlag;
 }
 #endif
-#endif
 
 static bool interHadActive( const ComprCUCtx& ctx )
 {
@@ -1203,12 +1201,10 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
       if( m_pcEncCfg->getUseEarlySkipDetection() )
       {
         m_ComprCUCtxList.back().testModes.push_back( { ETM_MERGE_SKIP,  SIZE_2Nx2N, ETO_STANDARD, qp, lossless } );
-#if JVET_K_AFFINE
         if( cs.sps->getSpsNext().getUseAffine() )
         {
           m_ComprCUCtxList.back().testModes.push_back( { ETM_AFFINE,      SIZE_2Nx2N, ETO_STANDARD, qp, lossless } );
         }
-#endif
         m_ComprCUCtxList.back().testModes.push_back( { ETM_INTER_ME,    SIZE_2Nx2N, ETO_STANDARD, qp, lossless } );
       }
       else
@@ -1216,12 +1212,10 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
         m_ComprCUCtxList.back().testModes.push_back( { ETM_INTER_ME,    SIZE_2Nx2N, ETO_STANDARD, qp, lossless } );
 
         m_ComprCUCtxList.back().testModes.push_back( { ETM_MERGE_SKIP,  SIZE_2Nx2N, ETO_STANDARD, qp, lossless } );
-#if JVET_K_AFFINE
         if( cs.sps->getSpsNext().getUseAffine() )
         {
           m_ComprCUCtxList.back().testModes.push_back( { ETM_AFFINE,      SIZE_2Nx2N, ETO_STANDARD, qp, lossless } );
         }
-#endif
       }
     }
   }
@@ -1522,7 +1516,6 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
 #endif
     }
 
-#if JVET_K_AFFINE
 #if JVET_K0220_ENC_CTRL
     if ( encTestmode.type == ETM_AFFINE && relatedCU.isIntra )
 #else
@@ -1531,7 +1524,6 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
     {
       return false;
     }
-#endif
     return true;
   }
   else if( isModeSplit( encTestmode ) )
@@ -1850,9 +1842,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
 #if JVET_K0357_AMVR
           sls.imv        = bestCU->imv;
 #endif
-#if JVET_K_AFFINE
           sls.affineFlag = bestCU->affine;
-#endif
         }
         else
         {
diff --git a/source/Lib/EncoderLib/EncModeCtrl.h b/source/Lib/EncoderLib/EncModeCtrl.h
index 0c4e0eae1..05f399f8d 100644
--- a/source/Lib/EncoderLib/EncModeCtrl.h
+++ b/source/Lib/EncoderLib/EncModeCtrl.h
@@ -56,9 +56,7 @@ enum EncTestModeType
 {
   ETM_MERGE_SKIP,
   ETM_INTER_ME,
-#if JVET_K_AFFINE
   ETM_AFFINE,
-#endif
   ETM_INTRA,
   ETM_IPCM,
   ETM_SPLIT_QT,
@@ -139,9 +137,7 @@ inline bool isModeInter( const EncTestMode& encTestmode ) // perhaps remove
 {
   return (   encTestmode.type == ETM_INTER_ME
           || encTestmode.type == ETM_MERGE_SKIP
-#if JVET_K_AFFINE
           || encTestmode.type == ETM_AFFINE
-#endif
          );
 }
 
@@ -336,9 +332,7 @@ struct SaveLoadStruct
   unsigned        imv;
 #endif
   unsigned        partIdx;
-#if JVET_K_AFFINE
   bool            affineFlag;
-#endif
 };
 
 class SaveLoadEncInfoCtrl
diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp
index 4d6a81485..a4d8103d2 100644
--- a/source/Lib/EncoderLib/InterSearch.cpp
+++ b/source/Lib/EncoderLib/InterSearch.cpp
@@ -768,9 +768,7 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
   Mv           cMv[2];
   Mv           cMvBi[2];
   Mv           cMvTemp[2][33];
-#if JVET_K_AFFINE
   Mv           cMvHevcTemp[2][33];
-#endif
   int          iNumPredDir = cs.slice->isInterP() ? 1 : 2;
 
   Mv           cMvPred[2][33];
@@ -789,9 +787,7 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
   uint32_t         uiMbBits[3] = {1, 1, 0};
 
   uint32_t         uiLastMode = 0;
-#if JVET_K_AFFINE
   uint32_t         uiLastModeTemp = 0;
-#endif
   int          iRefStart, iRefEnd;
 
   int          bestBiPRefIdxL1 = 0;
@@ -822,10 +818,8 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
 #endif
 
     PU::spanMotionInfo( pu );
-#if JVET_K_AFFINE
     Distortion   uiHevcCost = std::numeric_limits<Distortion>::max();
     Distortion   uiAffineCost = std::numeric_limits<Distortion>::max();
-#endif
     Distortion   uiCost[2] = { std::numeric_limits<Distortion>::max(), std::numeric_limits<Distortion>::max() };
     Distortion   uiCostBi  =   std::numeric_limits<Distortion>::max();
     Distortion   uiCostTemp;
@@ -860,7 +854,6 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
     }
 
 #endif
-#if JVET_K_AFFINE
 #if !JVET_K0220_ENC_CTRL
     bool bFastSkipAffine = false;
     if( pu.cs->sps->getSpsNext().getUseQTBT() && m_pcEncCfg->getUseSaveLoadEncInfo() )
@@ -869,7 +862,6 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
       bFastSkipAffine = modeCtrl && LOAD_ENC_INFO == modeCtrl->getSaveLoadTag( pu ) && !modeCtrl->getSaveLoadAffineFlag( pu );
     }
 #endif
-#endif
 #if JVET_K0357_AMVR
     unsigned imvShift = pu.cu->imv << 1;
 #endif
@@ -979,7 +971,6 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
       {
         ::memcpy( cMvHevcTemp, cMvTemp, sizeof( cMvTemp ) );
       }
-#if JVET_K_AFFINE
 #if JVET_K0220_ENC_CTRL
       if ( cu.Y().width > 8 && cu.Y().height > 8 && cu.partSize == SIZE_2Nx2N && cu.slice->getSPS()->getSpsNext().getUseAffine() )
 #else
@@ -988,7 +979,6 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
       {
         ::memcpy( cMvHevcTemp, cMvTemp, sizeof( cMvTemp ) );
       }
-#endif
       //  Bi-predictive Motion estimation
 #if JVET_K0220_ENC_CTRL
       if( ( cs.slice->isInterB() ) && ( PU::isBipredRestriction( pu ) == false ) )
@@ -1201,9 +1191,7 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
     uiCost [1] = costValidList1;
 
 
-#if JVET_K_AFFINE
       uiLastModeTemp = uiLastMode;
-#endif
       if ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1])
       {
         uiLastMode = 2;
@@ -1286,18 +1274,13 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
       {
         pu = savedPU;
       }
-#if JVET_K_AFFINE
       uiHevcCost = ( uiMRGCost < uiMECost ) ? uiMRGCost : uiMECost;
-#endif
     }
-#if JVET_K_AFFINE
     if( cu.cs->pcv->only2Nx2N || cu.partSize == SIZE_2Nx2N )
     {
       uiHevcCost = ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1] ) ? uiCostBi : ( ( uiCost[0] <= uiCost[1] ) ? uiCost[0] : uiCost[1] );
     }
-#endif
     CHECK( !( !cu.cs->pcv->only2Nx2N || cu.partSize == SIZE_2Nx2N ), "Unexpected part size for QTBT." );
-#if JVET_K_AFFINE
 #if JVET_K0220_ENC_CTRL
 #if JVET_K0357_AMVR
     if (cu.Y().width > 8 && cu.Y().height > 8 && cu.partSize == SIZE_2Nx2N && cu.slice->getSPS()->getSpsNext().getUseAffine() && cu.imv == 0)
@@ -1450,7 +1433,6 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
         uiLastMode = uiLastModeTemp;
       }
     }
-#endif
 
 
     m_maxCompIDToPred = MAX_NUM_COMPONENT;
@@ -1678,7 +1660,6 @@ Distortion InterSearch::xGetTemplateCost( const PredictionUnit& pu,
   return uiCost;
 }
 
-#if JVET_K_AFFINE
 Distortion InterSearch::xGetAffineTemplateCost( PredictionUnit& pu, PelUnitBuf& origBuf, PelUnitBuf& predBuf, Mv acMvCand[3], int iMVPIdx, int iMVPNum, RefPicList eRefPicList, int iRefIdx )
 {
   Distortion uiCost = std::numeric_limits<Distortion>::max();
@@ -1711,7 +1692,6 @@ Distortion InterSearch::xGetAffineTemplateCost( PredictionUnit& pu, PelUnitBuf&
   DTRACE( g_trace_ctx, D_COMMON, " (%d) affineTemplateCost=%d\n", DTRACE_GET_COUNTER(g_trace_ctx,D_COMMON), uiCost );
   return uiCost;
 }
-#endif
 
 void InterSearch::xMotionEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, RefPicList eRefPicList, Mv& rcMvPred, int iRefIdxPred, Mv& rcMv, int& riMVPIdx, uint32_t& ruiBits, Distortion& ruiCost, const AMVPInfo& amvpInfo, bool bBi)
 {
@@ -1878,7 +1858,7 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu,
 #endif
 )
 {
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   const int iMvShift = cMvPred.highPrec ? 4 : 2;
 #else
 #if REMOVE_MV_ADAPT_PREC
@@ -1894,7 +1874,7 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu,
 #endif
   clipMv( cFPMvPred, pu.cu->lumaPos(), *pu.cs->sps );
 
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   Mv mvTL(cFPMvPred.getHor() - (iSrchRng << iMvShift), cFPMvPred.getVer() - (iSrchRng << iMvShift), cFPMvPred.highPrec);
   Mv mvBR(cFPMvPred.getHor() + (iSrchRng << iMvShift), cFPMvPred.getVer() + (iSrchRng << iMvShift), cFPMvPred.highPrec);
 #else
@@ -1985,7 +1965,7 @@ void InterSearch::xPatternSearch( IntTZSearchStruct&    cStruct,
     }
     piRef += cStruct.iRefStride;
   }
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   CHECK(rcMv.highPrec, "Unexpected high precision MV.");
 #endif
   rcMv.set( iBestX, iBestY );
@@ -2314,7 +2294,7 @@ void InterSearch::xTZSearch( const PredictionUnit& pu,
   }
 
   // write out best match
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   CHECK(rcMv.highPrec, "Unexpected high precision MV.");
 #endif
   rcMv.set( cStruct.iBestX, cStruct.iBestY );
@@ -2481,7 +2461,7 @@ void InterSearch::xTZSearchSelective( const PredictionUnit& pu,
   }
 
   // write out best match
-#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
+#if !REMOVE_MV_ADAPT_PREC
   CHECK(rcMv.highPrec, "Unexpected high precision MV.");
 #endif
   rcMv.set( cStruct.iBestX, cStruct.iBestY );
@@ -2646,7 +2626,6 @@ void InterSearch::xPatternSearchFracDIF(
   ruiCost = xPatternRefinement( cStruct.pcPatternKey, baseRefMv, 1, rcMvQter, !bIsLosslessCoded );
 }
 
-#if JVET_K_AFFINE
 
 void InterSearch::xPredAffineInterSearch( PredictionUnit&       pu,
                                           PelUnitBuf&           origBuf,
@@ -4022,7 +4001,6 @@ void InterSearch::xCopyAffineAMVPInfo (AffineAMVPInfo& src, AffineAMVPInfo& dst)
   ::memcpy( dst.mvCandRT, src.mvCandRT, sizeof(Mv)*src.numCand );
   ::memcpy( dst.mvCandLB, src.mvCandLB, sizeof(Mv)*src.numCand );
 }
-#endif
 
 
 /**
@@ -4048,7 +4026,6 @@ void InterSearch::xExtDIFUpSamplingH( CPelBuf* pattern )
 
   const ChromaFormat chFmt = m_currChromaFormat;
 
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, m_filteredBlockTmp[0][0], intStride, width + 1, height + filterSize, 0 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, chFmt, clpRng);
   m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, m_filteredBlockTmp[2][0], intStride, width + 1, height + filterSize, 2 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, chFmt, clpRng);
 
@@ -4067,26 +4044,6 @@ void InterSearch::xExtDIFUpSamplingH( CPelBuf* pattern )
   intPtr = m_filteredBlockTmp[2][0] + (halfFilterSize - 1) * intStride;
   dstPtr = m_filteredBlock[2][2][0];
   m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width + 1, height + 1, 2 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-  m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, m_filteredBlockTmp[0][0], intStride, width + 1, height + filterSize, 0, false, chFmt, clpRng);
-  m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, m_filteredBlockTmp[2][0], intStride, width + 1, height + filterSize, 2, false, chFmt, clpRng);
-
-  intPtr = m_filteredBlockTmp[0][0] + halfFilterSize * intStride + 1;
-  dstPtr = m_filteredBlock[0][0][0];
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width + 0, height + 0, 0, false, true, chFmt, clpRng);
-
-  intPtr = m_filteredBlockTmp[0][0] + (halfFilterSize - 1) * intStride + 1;
-  dstPtr = m_filteredBlock[2][0][0];
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width + 0, height + 1, 2, false, true, chFmt, clpRng);
-
-  intPtr = m_filteredBlockTmp[2][0] + halfFilterSize * intStride;
-  dstPtr = m_filteredBlock[0][2][0];
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width + 1, height + 0, 0, false, true, chFmt, clpRng);
-
-  intPtr = m_filteredBlockTmp[2][0] + (halfFilterSize - 1) * intStride;
-  dstPtr = m_filteredBlock[2][2][0];
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width + 1, height + 1, 2, false, true, chFmt, clpRng);
-#endif
 }
 
 
@@ -4131,11 +4088,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
   {
     srcPtr += 1;
   }
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, intPtr, intStride, width, extHeight, 1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, chFmt, clpRng);
-#else
-  m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, intPtr, intStride, width, extHeight, 1, false, chFmt, clpRng);
-#endif
 
   // Horizontal filter 3/4
   srcPtr = pattern->buf - halfFilterSize*srcStride - 1;
@@ -4148,11 +4101,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
   {
     srcPtr += 1;
   }
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, intPtr, intStride, width, extHeight, 3 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, chFmt, clpRng);
-#else
-  m_if.filterHor(COMPONENT_Y, srcPtr, srcStride, intPtr, intStride, width, extHeight, 3, false, chFmt, clpRng);
-#endif
 
   // Generate @ 1,1
   intPtr = m_filteredBlockTmp[1][0] + (halfFilterSize-1) * intStride;
@@ -4161,20 +4110,12 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
   {
     intPtr += intStride;
   }
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1, false, true, chFmt, clpRng);
-#endif
 
   // Generate @ 3,1
   intPtr = m_filteredBlockTmp[1][0] + (halfFilterSize-1) * intStride;
   dstPtr = m_filteredBlock[3][1][0];
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3, false, true, chFmt, clpRng);
-#endif
 
   if (halfPelRef.getVer() != 0)
   {
@@ -4185,11 +4126,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
     {
       intPtr += intStride;
     }
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 2 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 2, false, true, chFmt, clpRng);
-#endif
 
     // Generate @ 2,3
     intPtr = m_filteredBlockTmp[3][0] + (halfFilterSize - 1) * intStride;
@@ -4198,31 +4135,19 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
     {
       intPtr += intStride;
     }
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 2 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 2, false, true, chFmt, clpRng);
-#endif
   }
   else
   {
     // Generate @ 0,1
     intPtr = m_filteredBlockTmp[1][0] + halfFilterSize * intStride;
     dstPtr = m_filteredBlock[0][1][0];
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 0 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 0, false, true, chFmt, clpRng);
-#endif
 
     // Generate @ 0,3
     intPtr = m_filteredBlockTmp[3][0] + halfFilterSize * intStride;
     dstPtr = m_filteredBlock[0][3][0];
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 0 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 0, false, true, chFmt, clpRng);
-#endif
   }
 
   if (halfPelRef.getHor() != 0)
@@ -4238,11 +4163,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
     {
       intPtr += intStride;
     }
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1, false, true, chFmt, clpRng);
-#endif
 
     // Generate @ 3,2
     intPtr = m_filteredBlockTmp[2][0] + (halfFilterSize - 1) * intStride;
@@ -4255,11 +4176,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
     {
       intPtr += intStride;
     }
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3, false, true, chFmt, clpRng);
-#endif
   }
   else
   {
@@ -4270,11 +4187,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
     {
       intPtr += intStride;
     }
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1, false, true, chFmt, clpRng);
-#endif
 
     // Generate @ 3,0
     intPtr = m_filteredBlockTmp[0][0] + (halfFilterSize - 1) * intStride + 1;
@@ -4283,11 +4196,7 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
     {
       intPtr += intStride;
     }
-#if JVET_K0346 || JVET_K_AFFINE
     m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-    m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3, false, true, chFmt, clpRng);
-#endif
   }
 
   // Generate @ 1,3
@@ -4297,20 +4206,12 @@ void InterSearch::xExtDIFUpSamplingQ( CPelBuf* pattern, Mv halfPelRef )
   {
     intPtr += intStride;
   }
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 1, false, true, chFmt, clpRng);
-#endif
 
   // Generate @ 3,3
   intPtr = m_filteredBlockTmp[3][0] + (halfFilterSize - 1) * intStride;
   dstPtr = m_filteredBlock[3][3][0];
-#if JVET_K0346 || JVET_K_AFFINE
   m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE, false, true, chFmt, clpRng);
-#else
-  m_if.filterVer(COMPONENT_Y, intPtr, intStride, dstPtr, dstStride, width, height, 3, false, true, chFmt, clpRng);
-#endif
 }
 
 
@@ -4966,9 +4867,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
     PredictionUnit &pu = *cs.getPU( partitioner.chType );
 
     m_CABACEstimator->cu_skip_flag  ( cu );
-#if JVET_K_AFFINE
     m_CABACEstimator->affine_flag( cu );
-#endif
     m_CABACEstimator->merge_idx     ( pu );
 
 
@@ -5092,9 +4991,7 @@ uint64_t InterSearch::xGetSymbolFracBitsInter(CodingStructure &cs, Partitioner &
     }
 
     m_CABACEstimator->cu_skip_flag  ( cu );
-#if JVET_K_AFFINE
     m_CABACEstimator->affine_flag   ( cu );
-#endif
     m_CABACEstimator->merge_idx     ( *cu.firstPU );
     fracBits   += m_CABACEstimator->getEstFracBits();
   }
diff --git a/source/Lib/EncoderLib/InterSearch.h b/source/Lib/EncoderLib/InterSearch.h
index cbdaaf21a..d1ad725a6 100644
--- a/source/Lib/EncoderLib/InterSearch.h
+++ b/source/Lib/EncoderLib/InterSearch.h
@@ -327,7 +327,6 @@ protected:
                                     Distortion&           ruiCost
                                   );
 
-#if JVET_K_AFFINE
   void xPredAffineInterSearch     ( PredictionUnit&       pu,
                                     PelUnitBuf&           origBuf,
                                     int                   puIdx,
@@ -370,7 +369,6 @@ protected:
   void xCopyAffineAMVPInfo        ( AffineAMVPInfo& src, AffineAMVPInfo& dst );
   void xCheckBestAffineMVP        ( PredictionUnit &pu, AffineAMVPInfo &affineAMVPInfo, RefPicList eRefPicList, Mv acMv[3], Mv acMvPred[3], int& riMVPIdx, uint32_t& ruiBits, Distortion& ruiCost );
 
-#endif
 
 
   void xExtDIFUpSamplingH         ( CPelBuf* pcPattern );
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index f57532132..9be1c1782 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -536,23 +536,19 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
 #if JVET_K0357_AMVR
   WRITE_FLAG( spsNext.getUseIMV() ? 1 : 0,                                                      "imv_enable_flag" );
 #endif
-#if JVET_K0346 || JVET_K_AFFINE
 #if !REMOVE_MV_ADAPT_PREC
   WRITE_FLAG( spsNext.getUseHighPrecMv() ? 1 : 0,                                               "high_precision_motion_vectors");
-#endif
 #endif
   WRITE_FLAG( spsNext.getDisableMotCompress() ? 1 : 0,                                          "disable_motion_compression_flag" );
   WRITE_FLAG( spsNext.getUseLMChroma() ? 1 : 0,                                                 "lm_chroma_enabled_flag" );
   WRITE_FLAG( spsNext.getUseIntraEMT() ? 1 : 0,                                                 "emt_intra_enabled_flag" );
   WRITE_FLAG( spsNext.getUseInterEMT() ? 1 : 0,                                                 "emt_inter_enabled_flag" );
-#if JVET_K_AFFINE
   WRITE_FLAG( spsNext.getUseAffine() ? 1 : 0,                                                   "affine_flag" );
 #if JVET_K0337_AFFINE_6PARA
   if ( spsNext.getUseAffine() )
   {
     WRITE_FLAG( spsNext.getUseAffineType() ? 1 : 0,                                             "affine_type_flag" );
   }
-#endif
 #endif
 
   for( int k = 0; k < SPSNext::NumReservedFlags; k++ )
-- 
GitLab