Remove NCOBMC_ADAPT_WEIGHT from AV1

Development of this experiment will be deferred to AV2.

Change-Id: I3c4615a21b59508500bed8aab0a5c54413b4f284
diff --git a/av1/av1.cmake b/av1/av1.cmake
index 54dd08c..80e7aff 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -405,13 +405,6 @@
       "${AOM_ROOT}/av1/common/x86/intra_edge_sse4.c")
 endif ()
 
-if (CONFIG_NCOBMC_ADAPT_WEIGHT)
-  set(AOM_AV1_COMMON_SOURCES
-      ${AOM_AV1_COMMON_SOURCES}
-      "${AOM_ROOT}/av1/common/ncobmc_kernels.c"
-      "${AOM_ROOT}/av1/common/ncobmc_kernels.h")
-endif ()
-
 set(AOM_AV1_COMMON_SOURCES
     ${AOM_AV1_COMMON_SOURCES}
     "${AOM_ROOT}/av1/common/warped_motion.c"
diff --git a/av1/av1_common.mk b/av1/av1_common.mk
index 011cc45..43432c8 100644
--- a/av1/av1_common.mk
+++ b/av1/av1_common.mk
@@ -160,14 +160,8 @@
 endif
 endif
 
-
 ifeq ($(CONFIG_Q_ADAPT_PROBS),yes)
 AV1_COMMON_SRCS-yes += common/token_cdfs.h
 endif
 
-ifeq ($(CONFIG_NCOBMC_ADAPT_WEIGHT),yes)
-AV1_COMMON_SRCS-yes += common/ncobmc_kernels.h
-AV1_COMMON_SRCS-yes += common/ncobmc_kernels.c
-endif
-
 $(eval $(call rtcd_h_template,av1_rtcd,av1/common/av1_rtcd_defs.pl))
diff --git a/av1/common/alloccommon.c b/av1/common/alloccommon.c
index 353150a..30ccb08 100644
--- a/av1/common/alloccommon.c
+++ b/av1/common/alloccommon.c
@@ -84,35 +84,6 @@
   cm->seg_map_alloc_size = 0;
 }
 
-static void free_scratch_buffers(AV1_COMMON *cm) {
-  (void)cm;
-#if CONFIG_NCOBMC && CONFIG_NCOBMC_ADAPT_WEIGHT
-  for (int i = 0; i < 4; ++i) {
-    if (cm->ncobmcaw_buf[i]) {
-      aom_free(cm->ncobmcaw_buf[i]);
-      cm->ncobmcaw_buf[i] = NULL;
-    }
-  }
-#endif  // CONFIG_NCOBMC && CONFIG_NCOBMC_ADAPT_WEIGHT
-}
-
-static int alloc_scratch_buffers(AV1_COMMON *cm) {
-  (void)cm;
-#if CONFIG_NCOBMC && CONFIG_NCOBMC_ADAPT_WEIGHT
-  // If not allocated already, allocate
-  if (!cm->ncobmcaw_buf[0] && !cm->ncobmcaw_buf[1] && !cm->ncobmcaw_buf[2] &&
-      !cm->ncobmcaw_buf[3]) {
-    for (int i = 0; i < 4; ++i) {
-      CHECK_MEM_ERROR(
-          cm, cm->ncobmcaw_buf[i],
-          (uint8_t *)aom_memalign(
-              16, (1 + CONFIG_HIGHBITDEPTH) * MAX_MB_PLANE * MAX_SB_SQUARE));
-    }
-  }
-#endif  // CONFIG_NCOBMC && CONFIG_NCOBMC_ADAPT_WEIGHT
-  return 0;
-}
-
 void av1_free_ref_frame_buffers(BufferPool *pool) {
   int i;
 
@@ -222,7 +193,6 @@
   int i;
   cm->free_mi(cm);
   free_seg_map(cm);
-  free_scratch_buffers(cm);
   for (i = 0; i < MAX_MB_PLANE; i++) {
     aom_free(cm->above_context[i]);
     cm->above_context[i] = NULL;
@@ -254,7 +224,6 @@
     free_seg_map(cm);
     if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail;
   }
-  if (alloc_scratch_buffers(cm)) goto fail;
 
   if (cm->above_context_alloc_cols < cm->mi_cols) {
     // TODO(geza.lore): These are bigger than they need to be.
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index c091422..2af1ddd 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -70,17 +70,6 @@
   return mode >= NEARESTMV && mode <= NEW_NEWMV;
 }
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-typedef struct superblock_mi_boundaries {
-  int mi_row_begin;
-  int mi_col_begin;
-  int mi_row_end;
-  int mi_col_end;
-} SB_MI_BD;
-
-typedef struct { int16_t KERNEL[4][MAX_SB_SIZE][MAX_SB_SIZE]; } NCOBMC_KERNELS;
-#endif
-
 typedef struct {
   uint8_t *plane[MAX_MB_PLANE];
   int stride[MAX_MB_PLANE];
@@ -367,13 +356,6 @@
   SEG_MASK_TYPE mask_type;
   MOTION_MODE motion_mode;
   int overlappable_neighbors[2];
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  // Applying different weighting kernels in ncobmc
-  // In current implementation, interpolation modes only defined for squared
-  // blocks. A rectangular block is divided into two squared blocks and each
-  // squared block has an interpolation mode.
-  NCOBMC_MODE ncobmc_mode[2];
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   int_mv mv[2];
   int_mv pred_mv[2];
   uint8_t ref_mv_idx;
@@ -766,12 +748,6 @@
 #if CONFIG_CFL
   CFL_CTX *cfl;
 #endif
-
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  uint8_t *ncobmc_pred_buf[MAX_MB_PLANE];
-  int ncobmc_pred_buf_stride[MAX_MB_PLANE];
-  SB_MI_BD sb_mi_bd;
-#endif
 } MACROBLOCKD;
 
 static INLINE int get_bitdepth_data_path_index(const MACROBLOCKD *xd) {
@@ -1376,14 +1352,6 @@
   return !(mbmi->overlappable_neighbors[0] == 0 &&
            mbmi->overlappable_neighbors[1] == 0);
 }
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-static INLINE NCOBMC_MODE ncobmc_mode_allowed_bsize(BLOCK_SIZE bsize) {
-  if (bsize < BLOCK_8X8 || bsize >= BLOCK_64X64)
-    return NO_OVERLAP;
-  else
-    return MAX_NCOBMC_MODES;
-}
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
 
 static INLINE MOTION_MODE
 motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
@@ -1410,13 +1378,7 @@
 #endif
       return WARPED_CAUSAL;
     }
-
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-    if (ncobmc_mode_allowed_bsize(mbmi->sb_type) < NO_OVERLAP)
-      return NCOBMC_ADAPT_WEIGHT;
-    else
-#endif
-      return OBMC_CAUSAL;
+    return OBMC_CAUSAL;
   } else {
     return SIMPLE_TRANSLATION;
   }
diff --git a/av1/common/common_data.h b/av1/common/common_data.h
index ab8f25e..0eeefcb 100644
--- a/av1/common/common_data.h
+++ b/av1/common/common_data.h
@@ -1851,46 +1851,6 @@
 };
 #endif
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-// NCOBMC_ADAPT_INTRPL only supports block size >= BLOCK_8X8 and <= BLOCK_64X64
-static const ADAPT_OVERLAP_BLOCK adapt_overlap_block_lookup[BLOCK_SIZES_ALL] = {
-  ADAPT_OVERLAP_BLOCK_INVALID,  // BLOCK_2X2
-  ADAPT_OVERLAP_BLOCK_INVALID,  // BLOCK_2X4
-  ADAPT_OVERLAP_BLOCK_INVALID,  // BLOCK_4X2
-  ADAPT_OVERLAP_BLOCK_INVALID,  // BLOCK_4X4
-  ADAPT_OVERLAP_BLOCK_INVALID,  // BLOCK_4X8
-  ADAPT_OVERLAP_BLOCK_INVALID,  // BLOCK_8X4
-
-  // the rest of the block sizes round to the largest squared block less than
-  // the given block size
-  ADAPT_OVERLAP_BLOCK_8X8, ADAPT_OVERLAP_BLOCK_8X8, ADAPT_OVERLAP_BLOCK_8X8,
-  ADAPT_OVERLAP_BLOCK_16X16, ADAPT_OVERLAP_BLOCK_16X16,
-  ADAPT_OVERLAP_BLOCK_16X16, ADAPT_OVERLAP_BLOCK_32X32,
-  ADAPT_OVERLAP_BLOCK_32X32, ADAPT_OVERLAP_BLOCK_32X32,
-  ADAPT_OVERLAP_BLOCK_64X64,
-#if CONFIG_EXT_PARTITION
-  ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
-  ADAPT_OVERLAP_BLOCK_INVALID,
-#endif  // CONFIG_EXT_PARTITION
-  ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
-  ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
-  ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID,
-#if CONFIG_EXT_PARTITION
-  ADAPT_OVERLAP_BLOCK_INVALID, ADAPT_OVERLAP_BLOCK_INVALID
-#endif  // CONFIG_EXT_PARTITION
-};
-
-static const BLOCK_SIZE bsize_2_sqr_bsize[BLOCK_SIZES] = {
-  BLOCK_2X2,   BLOCK_2X2,   BLOCK_2X2,   BLOCK_4X4,   BLOCK_4X4,   BLOCK_4X4,
-  BLOCK_8X8,   BLOCK_8X8,   BLOCK_8X8,   BLOCK_16X16, BLOCK_16X16, BLOCK_16X16,
-  BLOCK_32X32, BLOCK_32X32, BLOCK_32X32, BLOCK_64X64,
-#if CONFIG_EXT_PARTITION
-  BLOCK_64X64, BLOCK_64X64,
-#endif
-};
-
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
 #if CONFIG_ADAPT_SCAN
 #define EOB_THRESHOLD_NUM 2
 #endif
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index ced99ae..674ab06 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -928,158 +928,6 @@
     };
 #endif  // CONFIG_NEW_MULTISYMBOL
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-#ifdef TWO_MODE
-const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)] = {
-  -NCOBMC_MODE_0, -NCOBMC_MODE_1
-};
-#else
-const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)] = {
-  -NCOBMC_MODE_0, 2,
-  -NCOBMC_MODE_1, 4,
-  -NCOBMC_MODE_2, 6,
-  -NCOBMC_MODE_3, 8,
-  -NCOBMC_MODE_4, 10,
-  -NCOBMC_MODE_5, 12,
-  -NCOBMC_MODE_6, -NCOBMC_MODE_7
-};
-#endif  // TWO_MODE
-
-// TODO(weitinglin): find default prob
-//                   right now setting the first mode with probability 1/255,
-//                   the last eight modes with equal probabilities
-static const aom_prob
-    default_ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1] = {
-#ifdef TWO_MODE
-      { 127 }, { 127 }, { 127 }, { 127 }
-#else
-      { 32, 36, 43, 51, 64, 85, 128 },  // 8x8
-      { 32, 36, 43, 51, 64, 85, 128 },  // 16X16
-      { 32, 36, 43, 51, 64, 85, 128 },  // 32X32
-      { 32, 36, 43, 51, 64, 85, 128 }   // 64X64
-#endif  // TWO_MODE
-    };
-static const aom_cdf_prob
-    default_ncobmc_mode_cdf[ADAPT_OVERLAP_BLOCKS][CDF_SIZE(MAX_NCOBMC_MODES)] =
-#ifdef TWO_MODE
-        { { AOM_ICDF(16256), AOM_ICDF(32768), 0 },
-          { AOM_ICDF(16256), AOM_ICDF(32768), 0 },
-          { AOM_ICDF(16256), AOM_ICDF(32768), 0 },
-          { AOM_ICDF(16256), AOM_ICDF(32768), 0 } };
-#else
-        { { AOM_ICDF(4096), AOM_ICDF(8192), AOM_ICDF(12288), AOM_ICDF(16384),
-            AOM_ICDF(20480), AOM_ICDF(24576), AOM_ICDF(28672), AOM_ICDF(32768),
-            0 },
-          { AOM_ICDF(4096), AOM_ICDF(8192), AOM_ICDF(12288), AOM_ICDF(16384),
-            AOM_ICDF(20480), AOM_ICDF(24576), AOM_ICDF(28672), AOM_ICDF(32768),
-            0 },
-          { AOM_ICDF(4096), AOM_ICDF(8192), AOM_ICDF(12288), AOM_ICDF(16384),
-            AOM_ICDF(20480), AOM_ICDF(24576), AOM_ICDF(28672), AOM_ICDF(32768),
-            0 },
-          { AOM_ICDF(4096), AOM_ICDF(8192), AOM_ICDF(12288), AOM_ICDF(16384),
-            AOM_ICDF(20480), AOM_ICDF(24576), AOM_ICDF(28672), AOM_ICDF(32768),
-            0 } };
-#endif  // TWO_MODEE
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-// Change this section appropriately once warped motion is supported
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-  -SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, 4, -NCOBMC_ADAPT_WEIGHT, -WARPED_CAUSAL
-};
-
-static const aom_prob default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES -
-                                                                1] = {
-  { 128, 128, 255 }, { 128, 128, 128 }, { 128, 128, 128 }, { 128, 128, 128 },
-  { 128, 128, 128 }, { 128, 128, 128 }, { 62, 115, 128 },  { 39, 131, 128 },
-  { 39, 132, 128 },  { 118, 94, 128 },  { 77, 125, 128 },  { 100, 121, 128 },
-  { 190, 66, 128 },  { 207, 102, 128 }, { 197, 100, 128 }, { 239, 76, 128 },
-#if CONFIG_EXT_PARTITION
-  { 252, 200, 128 }, { 252, 200, 128 }, { 252, 200, 128 },
-#endif  // CONFIG_EXT_PARTITION
-  { 208, 200, 128 }, { 208, 200, 128 }, { 208, 200, 128 }, { 208, 200, 128 }
-};
-static const aom_cdf_prob
-    default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = {
-      { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      /** Only these nine block sizes allow ncobmc_adapt_weight **/
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(8192), AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
-      /***********************************************************/
-      { AOM_ICDF(30592), AOM_ICDF(31238), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-#if CONFIG_EXT_PARTITION
-      { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-#endif
-      { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(32640), AOM_ICDF(32740), AOM_ICDF(32767), AOM_ICDF(32768), 0 }
-    };
-
-const aom_tree_index av1_ncobmc_tree[TREE_SIZE(OBMC_FAMILY_MODES)] = {
-  -SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -NCOBMC_ADAPT_WEIGHT
-};
-
-static const aom_prob
-    default_ncobmc_prob[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES - 1] = {
-      { 128, 255 }, { 128, 255 }, { 128, 255 }, { 128, 255 },
-      { 128, 255 }, { 128, 255 }, { 45, 255 },  { 79, 255 },
-      { 75, 255 },  { 130, 255 }, { 141, 255 }, { 144, 255 },
-      { 208, 255 }, { 201, 255 }, { 186, 255 }, { 231, 255 },
-#if CONFIG_EXT_PARTITION
-      { 252, 255 }, { 252, 255 }, { 252, 255 },
-#endif  // CONFIG_EXT_PARTITION
-      { 208, 255 }, { 208, 255 }, { 208, 255 }, { 208, 255 }
-    };
-
-static const aom_cdf_prob
-    default_ncobmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(OBMC_FAMILY_MODES)] = {
-      { AOM_ICDF(128 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(128 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(128 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(128 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(128 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(128 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      /** Only these nine block sizes allow ncobmc_adapt_weight **/
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(10922), AOM_ICDF(21845), AOM_ICDF(32768), 0 },
-      /***********************************************************/
-      { AOM_ICDF(231 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-#if CONFIG_EXT_PARTITION
-      { AOM_ICDF(252 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(252 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(252 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-#endif  // CONFIG_EXT_PARTITION
-      { AOM_ICDF(208 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(208 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(208 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(208 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(208 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 },
-      { AOM_ICDF(208 * 128), AOM_ICDF(32767), AOM_ICDF(32768), 0 }
-    };
-#else
 const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
   -SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -WARPED_CAUSAL,
 };
@@ -1133,7 +981,7 @@
       { AOM_ICDF(32256), AOM_ICDF(32656), AOM_ICDF(32768), 0 },
 #endif
     };
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
+
 // Probability for the case that only 1 additional motion mode is allowed
 static const aom_prob default_obmc_prob[BLOCK_SIZES_ALL] = {
   128, 128, 128, 128, 128, 128, 45, 79, 75, 130, 141, 144, 208, 201, 186, 231,
@@ -1146,7 +994,7 @@
 #endif  // CONFIG_EXT_PARTITION
 };
 
-#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NEW_MULTISYMBOL
 static const aom_cdf_prob default_obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)] = {
   { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
   { AOM_ICDF(128 * 128), AOM_ICDF(32768), 0 },
@@ -5958,18 +5806,10 @@
 #endif
   av1_copy(fc->motion_mode_prob, default_motion_mode_prob);
   av1_copy(fc->motion_mode_cdf, default_motion_mode_cdf);
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  av1_copy(fc->ncobmc_mode_prob, default_ncobmc_mode_prob);
-  av1_copy(fc->ncobmc_mode_cdf, default_ncobmc_mode_cdf);
-#endif
   av1_copy(fc->obmc_prob, default_obmc_prob);
-#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NEW_MULTISYMBOL
   av1_copy(fc->obmc_cdf, default_obmc_cdf);
 #endif
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  av1_copy(fc->ncobmc_prob, default_ncobmc_prob);
-  av1_copy(fc->ncobmc_cdf, default_ncobmc_cdf);
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   av1_copy(fc->inter_compound_mode_probs, default_inter_compound_mode_probs);
   av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf);
 #if CONFIG_COMPOUND_SINGLEREF
@@ -6115,14 +5955,6 @@
   for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i)
     aom_tree_merge_probs(av1_motion_mode_tree, pre_fc->motion_mode_prob[i],
                          counts->motion_mode[i], fc->motion_mode_prob[i]);
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  for (i = 0; i < ADAPT_OVERLAP_BLOCKS; ++i)
-    aom_tree_merge_probs(av1_ncobmc_mode_tree, pre_fc->ncobmc_mode_prob[i],
-                         counts->ncobmc_mode[i], fc->ncobmc_mode_prob[i]);
-  for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i)
-    aom_tree_merge_probs(av1_ncobmc_tree, pre_fc->ncobmc_prob[i],
-                         counts->ncobmc[i], fc->ncobmc_prob[i]);
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; ++i)
     fc->obmc_prob[i] =
         av1_mode_mv_merge_probs(pre_fc->obmc_prob[i], counts->obmc[i]);
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 0508164..ea97174 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -218,17 +218,8 @@
                                   [CDF_SIZE(INTERINTRA_MODES)];
   aom_prob motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1];
   aom_cdf_prob motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)];
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  aom_prob ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1];
-  aom_cdf_prob ncobmc_mode_cdf[ADAPT_OVERLAP_BLOCKS]
-                              [CDF_SIZE(MAX_NCOBMC_MODES)];
-#endif
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  aom_prob ncobmc_prob[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES - 1];
-  aom_cdf_prob ncobmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(OBMC_FAMILY_MODES)];
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   aom_prob obmc_prob[BLOCK_SIZES_ALL];
-#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NEW_MULTISYMBOL
   aom_cdf_prob obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)];
 #endif  // CONFIG_NEW_MULTISYMBOL
   aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
@@ -449,12 +440,6 @@
   unsigned int wedge_interintra[BLOCK_SIZES_ALL][2];
   unsigned int compound_interinter[BLOCK_SIZES_ALL][COMPOUND_TYPES];
   unsigned int motion_mode[BLOCK_SIZES_ALL][MOTION_MODES];
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  unsigned int ncobmc_mode[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES];
-#endif
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  unsigned int ncobmc[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES];
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   unsigned int obmc[BLOCK_SIZES_ALL][2];
   unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
   unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
@@ -603,10 +588,6 @@
 extern const aom_tree_index av1_ext_tx_tree[EXT_TX_SET_TYPES]
                                            [TREE_SIZE(TX_TYPES)];
 extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-extern const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)];
-extern const aom_tree_index av1_ncobmc_tree[TREE_SIZE(OBMC_FAMILY_MODES)];
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
 #if CONFIG_LOOP_RESTORATION
 #define RESTORE_NONE_SGRPROJ_PROB 64
 #define RESTORE_NONE_WIENER_PROB 64
diff --git a/av1/common/enums.h b/av1/common/enums.h
index 2dcb23f..45c5dbd 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -22,11 +22,7 @@
 
 #undef MAX_SB_SIZE
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-#define TWO_MODE
-#endif
-
-#if CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NCOBMC
 #define NC_MODE_INFO 1
 #else
 #define NC_MODE_INFO 0
@@ -251,35 +247,6 @@
 #define MAX_TX_BLOCKS_IN_MAX_SB_LOG2 ((MAX_SB_SIZE_LOG2 - MAX_TX_SIZE_LOG2) * 2)
 #define MAX_TX_BLOCKS_IN_MAX_SB (1 << MAX_TX_BLOCKS_IN_MAX_SB_LOG2)
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-typedef enum ATTRIBUTE_PACKED {
-  NCOBMC_MODE_0,
-  NCOBMC_MODE_1,
-  NCOBMC_MODE_2,
-  NCOBMC_MODE_3,
-  NCOBMC_MODE_4,
-  NCOBMC_MODE_5,
-  NCOBMC_MODE_6,
-  NCOBMC_MODE_7,
-  ALL_NCOBMC_MODES,
-#ifdef TWO_MODE
-  MAX_NCOBMC_MODES = NCOBMC_MODE_1 + 1,
-#else
-  MAX_NCOBMC_MODES = ALL_NCOBMC_MODES,
-#endif
-  NO_OVERLAP = MAX_NCOBMC_MODES + 1
-} NCOBMC_MODE;
-
-typedef enum ATTRIBUTE_PACKED {
-  ADAPT_OVERLAP_BLOCK_8X8,
-  ADAPT_OVERLAP_BLOCK_16X16,
-  ADAPT_OVERLAP_BLOCK_32X32,
-  ADAPT_OVERLAP_BLOCK_64X64,
-  ADAPT_OVERLAP_BLOCKS,
-  ADAPT_OVERLAP_BLOCK_INVALID = 255
-} ADAPT_OVERLAP_BLOCK;
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
 // frame transform mode
 #if CONFIG_SIMPLIFY_TX_MODE
 typedef enum ATTRIBUTE_PACKED {
@@ -564,16 +531,9 @@
 
 typedef enum ATTRIBUTE_PACKED {
   SIMPLE_TRANSLATION,
-  OBMC_CAUSAL,  // 2-sided OBMC
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  NCOBMC_ADAPT_WEIGHT,
-#endif            // CONFIG_NCOBMC_ADAPT_WEIGHT
+  OBMC_CAUSAL,    // 2-sided OBMC
   WARPED_CAUSAL,  // 2-sided WARPED
   MOTION_MODES
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  ,
-  OBMC_FAMILY_MODES = NCOBMC_ADAPT_WEIGHT + 1
-#endif
 } MOTION_MODE;
 
 typedef enum ATTRIBUTE_PACKED {
diff --git a/av1/common/ncobmc_kernels.c b/av1/common/ncobmc_kernels.c
deleted file mode 100644
index af95139..0000000
--- a/av1/common/ncobmc_kernels.c
+++ /dev/null
@@ -1,1181 +0,0 @@
-/*
- * Copyright (c) 2016, Alliance for Open Media. All rights reserved
- *
- * This source code is subject to the terms of the BSD 2 Clause License and
- * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
- * was not distributed with this source code in the LICENSE file, you can
- * obtain it at www.aomedia.org/license/software. If the Alliance for Open
- * Media Patent License 1.0 was not distributed with this source code in the
- * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- */
-
-#include "av1/common/ncobmc_kernels.h"
-
-// The kernels are only used in the experiment "ncobmc-adapt-weight", which
-// blends four predictions to form a final prediction for an inter-block
-// The indices of the default kernels correspond to
-// 1. the index of the size of the kernels (ADAPT_OVERLAP_BLOCKS )
-// 2. the interpolation modes (NCOBMC_MODE)
-// 3. the prediction the kernels applies to
-
-static int16_t default_ncobmc_krnl_0_0_0[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 5684, 3601, 1367, 364, 1509, 2313, 4007, 5080 },
-  { 3728, 2486, 827, 196, 1434, 2034, 2868, 3000 },
-  { 1643, 1465, 726, 208, 890, 1386, 1242, 1293 },
-  { 794, 723, 277, -237, 206, 487, 749, 896 },
-  { 1176, 730, 286, 136, 281, 262, 724, 953 },
-  { 2086, 1958, 783, 539, 751, 984, 1143, 1491 },
-  { 2665, 2520, 1402, 1037, 939, 1223, 1593, 1937 },
-  { 3451, 3172, 2350, 1291, 1069, 1916, 2672, 3223 }
-};
-static int16_t default_ncobmc_krnl_0_0_1[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 5541, 8123, 10470, 11908, 11291, 10382, 8800, 6446 },
-  { 3338, 5536, 7249, 8080, 7671, 6428, 5280, 3900 },
-  { 1732, 3087, 3842, 4325, 4034, 2929, 2318, 1800 },
-  { 744, 1217, 1559, 2215, 1957, 1352, 707, 322 },
-  { 685, 1082, 1792, 2300, 1975, 1350, 738, 671 },
-  { 1168, 2336, 3303, 3965, 3790, 3098, 2909, 2141 },
-  { 3005, 4370, 5806, 6716, 6282, 5553, 4782, 3453 },
-  { 4748, 6650, 7779, 9010, 9208, 8184, 6987, 5197 }
-};
-static int16_t default_ncobmc_krnl_0_0_2[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 6026, 4784, 2400, 1250, 1002, 2371, 3320, 5285 },
-  { 8638, 6094, 3257, 1498, 1297, 3145, 5252, 7625 },
-  { 10859, 7249, 3868, 1871, 1813, 3569, 6577, 8858 },
-  { 11432, 8123, 4216, 1786, 2477, 4370, 6669, 9366 },
-  { 11894, 8466, 4870, 1917, 2479, 4656, 7057, 9383 },
-  { 11109, 7432, 3924, 1288, 2018, 3946, 6660, 9877 },
-  { 10138, 6548, 2830, 461, 2087, 3810, 6170, 9255 },
-  { 8613, 5163, 1658, 279, 1694, 3082, 4807, 7897 }
-};
-static int16_t default_ncobmc_krnl_0_0_3[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { -833, -80, 2193, 2907, 2623, 1359, 298, -383 },
-  { 705, 2300, 5090, 6649, 6024, 4820, 3020, 1892 },
-  { 2189, 4625, 7990, 10015, 9679, 8539, 6284, 4464 },
-  { 3445, 6356, 10371, 12660, 11773, 10205, 8287, 5828 },
-  { 2664, 6149, 9483, 12064, 11681, 10156, 7908, 5409 },
-  { 2040, 4690, 8405, 10631, 9862, 8396, 5711, 2909 },
-  { 626, 2993, 6387, 8212, 7123, 5840, 3877, 1788 },
-  { -402, 1431, 4636, 5850, 4461, 3246, 1964, 122 }
-};
-static int16_t default_ncobmc_krnl_0_1_0[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 1465, 553, -76, 10, 635, 756, 1843, 3144 },
-  { 687, 117, -404, -300, 238, 280, 696, 1415 },
-  { 49, -38, -224, -241, -135, -209, -237, 382 },
-  { 48, 37, -266, -273, -235, -137, -208, -94 },
-  { 555, -3, -132, -172, -98, 93, 347, 313 },
-  { 887, 256, -266, -307, 304, 222, -98, 82 },
-  { 1701, 816, 454, 501, 119, 230, 450, 551 },
-  { 2732, 1502, 1174, 540, 323, 709, 1002, 936 }
-};
-static int16_t default_ncobmc_krnl_0_1_1[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 7707, 10467, 11036, 10942, 10165, 9420, 8728, 5835 },
-  { 3167, 5146, 5854, 5771, 4914, 4684, 4357, 3154 },
-  { 900, 1646, 2412, 2014, 1974, 1986, 1776, 1005 },
-  { -198, -179, 488, 737, 866, 784, 828, 236 },
-  { -469, 32, 402, 574, 738, 495, 242, -187 },
-  { 186, 1078, 1378, 1480, 1226, 1506, 1656, 745 },
-  { 1531, 2525, 3139, 3367, 3535, 3519, 3095, 2171 },
-  { 3152, 5453, 6176, 7089, 7310, 6879, 6483, 4916 }
-};
-static int16_t default_ncobmc_krnl_0_1_2[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 7378, 3775, 1232, 453, 133, 936, 1688, 4950 },
-  { 10336, 5944, 2400, 1175, 168, 954, 2894, 6436 },
-  { 11176, 6145, 2051, 829, 543, 1193, 3403, 6517 },
-  { 10387, 6062, 2036, 646, 507, 1077, 2998, 6029 },
-  { 10768, 6277, 2226, 677, 321, 982, 2845, 6378 },
-  { 10072, 5808, 1937, 873, 372, 1396, 3498, 7298 },
-  { 8951, 4724, 1216, 104, 656, 1830, 3722, 7558 },
-  { 7447, 3372, 468, -135, 99, 1177, 2980, 7260 }
-};
-static int16_t default_ncobmc_krnl_0_1_3[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { -229, 1545, 4135, 4921, 5405, 5226, 4081, 2418 },
-  { 2120, 5121, 8485, 9692, 11018, 10406, 8380, 5338 },
-  { 4205, 8593, 12099, 13717, 13936, 13366, 11402, 8436 },
-  { 6068, 10382, 14047, 15190, 15155, 14577, 12684, 10145 },
-  { 5458, 10012, 13836, 15243, 15361, 14752, 12876, 9818 },
-  { 5153, 9162, 13256, 14256, 14385, 13170, 11245, 8186 },
-  { 4140, 8257, 11521, 12362, 12028, 10762, 9062, 6053 },
-  { 2966, 5975, 8490, 8807, 8561, 7529, 5836, 3204 }
-};
-static int16_t default_ncobmc_krnl_1_0_0[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 4414, 2642, 2518, 1763, 1089, 644, 355, 254, -234, 454, 399, 228, 525, 785,
-    558, 919 },
-  { 2989, 3035, 2685, 1476, 1872, 768, 820, -309, -107, 273, 87, 286, 499, 638,
-    929, 1025 },
-  { 1779, 1672, 1713, 645, 953, 151, 617, 79, -91, 185, 18, 307, 794, 681, 484,
-    521 },
-  { 1429, 1571, 1893, 1493, 949, 288, -232, -248, -152, 179, -50, 74, 107, 329,
-    539, 822 },
-  { 1444, 852, 1022, 688, 850, 205, 135, -629, 334, 96, 106, 337, 259, 300, 150,
-    680 },
-  { 962, 367, 329, 921, 591, -79, 146, 201, 296, 179, -190, 143, 46, -107, 215,
-    853 },
-  { 915, 865, 463, 169, 498, -390, 12, 202, 225, 490, 410, 483, 52, 99, 293,
-    569 },
-  { 728, -135, 241, 383, 288, -69, 33, 421, 523, 506, 376, 58, 143, -4, 151,
-    218 },
-  { 337, 65, 255, 282, 173, 267, 237, 15, 38, 114, 253, 110, 32, 227, 92, -48 },
-  { 317, 115, 295, 231, 380, 435, 331, -97, 392, 393, 51, 59, 276, 41, -33,
-    46 },
-  { 31, -14, 86, 250, -36, -214, 210, -79, -117, 401, 193, 440, 171, 200, 8,
-    112 },
-  { 46, 19, 165, -6, 75, 180, 266, -98, 76, 276, 6, 29, 230, -49, 177, 168 },
-  { 104, -243, -121, 295, -8, 180, 16, -44, 232, 315, 176, 10, 0, -95, -154,
-    141 },
-  { 248, 201, 361, 430, -20, -45, 209, -44, 222, 540, 527, 297, 240, 625, 531,
-    409 },
-  { 91, 37, 193, 177, 233, 210, -299, 120, 327, 214, 293, 189, 86, 123, 206,
-    356 },
-  { 501, 779, 295, 199, 148, 81, -31, 70, 211, 309, 300, 110, 227, 30, 242,
-    261 }
-};
-static int16_t default_ncobmc_krnl_1_0_1[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 6603, 7905, 7762, 8159, 8426, 10334, 10792, 10984, 12097, 10534, 11216,
-    10624, 9514, 8715, 8672, 8846 },
-  { 5897, 6238, 6272, 7323, 7162, 8091, 9465, 9845, 9929, 9747, 10562, 10737,
-    9059, 7651, 7330, 7314 },
-  { 5572, 6017, 5568, 7112, 6617, 6501, 7334, 8494, 8900, 8826, 9852, 8034,
-    6956, 7691, 7513, 6106 },
-  { 4564, 3877, 4682, 4586, 5135, 5795, 7968, 7859, 7720, 6548, 6306, 5639,
-    6357, 6514, 6493, 5609 },
-  { 4142, 4154, 3332, 4193, 3873, 4977, 4685, 5787, 5707, 5300, 5854, 4720,
-    5452, 5642, 4810, 4250 },
-  { 2993, 3176, 3012, 2637, 2664, 4336, 4207, 3687, 4627, 4487, 4847, 4120,
-    4079, 3931, 3730, 3205 },
-  { 2479, 2268, 1858, 1737, 2266, 2806, 2919, 3017, 3231, 2964, 3181, 3423,
-    3096, 3025, 2684, 2353 },
-  { 1969, 2001, 1997, 1959, 1323, 1565, 1963, 1351, 1957, 1711, 2093, 2057,
-    1762, 1926, 1118, 1367 },
-  { 1473, 816, 655, 1628, 1252, 1764, 1723, 1675, 2559, 3029, 1951, 2160, 2305,
-    2299, 1688, 1048 },
-  { 3073, 1667, 1324, 1360, 1562, 1774, 2154, 2740, 3281, 3434, 3258, 4095,
-    2823, 2443, 2894, 2449 },
-  { 3813, 2830, 3352, 2125, 2627, 2974, 3847, 3720, 4592, 4846, 4787, 5066,
-    4598, 4229, 4032, 3478 },
-  { 3415, 2733, 3827, 3637, 3381, 3743, 3768, 4732, 5055, 5445, 5870, 5937,
-    5734, 5980, 5010, 4954 },
-  { 4878, 3604, 5532, 4558, 4210, 4880, 4847, 5771, 5136, 6486, 7096, 6426,
-    5765, 6824, 6094, 5753 },
-  { 6076, 5817, 5318, 5268, 5784, 5482, 6453, 6582, 6803, 7077, 8113, 8173,
-    8329, 7653, 6448, 6476 },
-  { 7549, 5758, 5554, 6383, 7113, 7664, 7123, 6712, 8539, 8997, 9047, 8794,
-    8700, 8760, 7600, 7995 },
-  { 7698, 7133, 7048, 7498, 7821, 8401, 9152, 8647, 8934, 8874, 8595, 8789,
-    8828, 8766, 9019, 8783 }
-};
-static int16_t default_ncobmc_krnl_1_0_2[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 5573, 5972, 5705, 5033, 5738, 3189, 2009, 1476, 2057, 2178, 1869, 2927,
-    3305, 4036, 4017, 5328 },
-  { 7539, 7568, 7302, 5564, 4410, 3954, 2153, 2693, 622, 1831, 1753, 1636, 3552,
-    4374, 4319, 6015 },
-  { 8753, 7544, 6620, 5710, 6142, 5819, 2731, 2898, 1702, 1487, 2249, 1688,
-    4110, 4483, 5108, 5621 },
-  { 9273, 7922, 6245, 6310, 6442, 5272, 3068, 2649, 1599, 2693, 3219, 4501,
-    4588, 4310, 5647, 6894 },
-  { 9697, 8245, 7267, 6551, 5199, 4626, 3466, 3256, 2099, 3125, 3608, 4297,
-    3944, 5468, 6056, 7545 },
-  { 8831, 8583, 7466, 6937, 6056, 5482, 3407, 3324, 1802, 3128, 3078, 4560,
-    4560, 5901, 6131, 7612 },
-  { 9556, 7457, 6602, 7342, 5370, 4431, 3573, 3339, 1668, 3172, 3779, 4564,
-    5744, 7244, 8522, 8407 },
-  { 10238, 8809, 7064, 6643, 4885, 4246, 2737, 2684, 2501, 3443, 3761, 6174,
-    5891, 6882, 7585, 8821 },
-  { 10151, 10001, 8289, 6859, 6054, 4903, 3809, 3540, 2644, 3424, 3542, 4649,
-    5389, 5384, 6733, 8360 },
-  { 9635, 9516, 7609, 7438, 6181, 4529, 4140, 3439, 2568, 3338, 3789, 5195,
-    5510, 6181, 7566, 8512 },
-  { 9988, 8848, 6807, 6731, 6139, 5355, 3797, 4097, 3364, 3319, 4230, 5136,
-    5581, 6125, 7748, 8229 },
-  { 10252, 9244, 7204, 7260, 6478, 6040, 4659, 3920, 2869, 3263, 4068, 5475,
-    5714, 7183, 7153, 8318 },
-  { 9682, 9366, 7096, 6059, 6036, 4463, 3898, 3477, 2065, 2704, 4434, 5167,
-    5502, 6743, 8002, 7443 },
-  { 9252, 8211, 6399, 6747, 6498, 5626, 4016, 3880, 2172, 2557, 3576, 4270,
-    4968, 5115, 6840, 7550 },
-  { 8753, 8157, 7097, 6500, 5779, 5174, 4190, 2645, 2380, 3239, 4155, 5263,
-    5437, 5337, 5663, 6667 },
-  { 9680, 7710, 6921, 5657, 4863, 3990, 3485, 2172, 2620, 3003, 3328, 4112,
-    4806, 6020, 6833, 7212 }
-};
-static int16_t default_ncobmc_krnl_1_0_3[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { -219, -121, 416, 1445, 1150, 2238, 3251, 3695, 2496, 3247, 2925, 2639, 3064,
-    2869, 3167, 1320 },
-  { -68, -450, 130, 2039, 2952, 3584, 3966, 4171, 5961, 4555, 3995, 3732, 3281,
-    3731, 3827, 2052 },
-  { 262, 1161, 2497, 2934, 2690, 3939, 5735, 4938, 5906, 5924, 4296, 6388, 4553,
-    3551, 3297, 4164 },
-  { 1091, 3025, 3566, 4005, 3874, 5040, 5600, 6151, 7241, 6990, 6924, 6186,
-    5356, 5256, 3726, 3083 },
-  { 1079, 3140, 4769, 4958, 6480, 6589, 8111, 7988, 8255, 7879, 6838, 7052,
-    6751, 5005, 5393, 3931 },
-  { 3566, 4255, 5572, 5909, 7098, 6653, 8641, 9199, 9689, 8617, 8673, 7591,
-    7733, 6676, 6324, 4737 },
-  { 3411, 5802, 7481, 7149, 8259, 9553, 9900, 9854, 11285, 9779, 9040, 7939,
-    7515, 6037, 4902, 5075 },
-  { 3417, 5718, 7095, 7425, 9913, 10666, 11679, 11951, 11429, 10749, 10173,
-    8116, 8610, 7605, 7548, 5992 },
-  { 4408, 5515, 7201, 7627, 8922, 9470, 10636, 11166, 11159, 9844, 10673, 9502,
-    8693, 8503, 7905, 7046 },
-  { 3340, 5097, 7171, 7366, 8273, 9660, 9784, 10332, 10155, 9232, 9301, 7056,
-    7798, 7746, 5981, 5402 },
-  { 2531, 4732, 6148, 7284, 7672, 8287, 8551, 8672, 8567, 7846, 7199, 5757,
-    6057, 5863, 4613, 4578 },
-  { 2646, 4394, 5195, 5511, 6471, 6443, 7713, 7854, 8408, 7427, 6461, 4968,
-    4731, 3294, 4066, 2960 },
-  { 1692, 3664, 3881, 5480, 6162, 6871, 7635, 7198, 8963, 6891, 4694, 4801,
-    5141, 2932, 2459, 3060 },
-  { 769, 2144, 4310, 3945, 4125, 5329, 5712, 5975, 7200, 6220, 4179, 3662, 2868,
-    3007, 2579, 1958 },
-  { -45, 2434, 3549, 3335, 3273, 3357, 5394, 6931, 5159, 3956, 2912, 2164, 2187,
-    2187, 2935, 1388 },
-  { -1514, 786, 2135, 3045, 3561, 3922, 3800, 5515, 4650, 4225, 4169, 3387,
-    2539, 1590, 317, 161 }
-};
-static int16_t default_ncobmc_krnl_1_1_0[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 2375, 1912, 1469, 213, 933, -507, -173, -369, -333, 187, -128, 427, 999,
-    1166, 1515, 2728 },
-  { 1857, 1085, 817, 454, 598, 479, 53, -218, -611, 240, 76, 31, 284, 1347,
-    1738, 1317 },
-  { 1911, 531, 453, 89, 639, -361, -331, -605, -162, 63, -154, 259, 446, 390,
-    708, 1113 },
-  { 818, 1304, 871, 665, 1006, -114, -405, -407, 331, 203, 304, 506, 476, 1053,
-    1155, 879 },
-  { 1054, 874, 714, -162, 624, -144, -306, -541, 30, -281, 296, 812, 418, 858,
-    755, 252 },
-  { 967, 388, 354, 878, 31, -691, -244, -307, 425, 281, 0, -50, 110, -107, 279,
-    255 },
-  { 152, -53, 156, 266, 192, -864, -236, -110, 397, 484, -129, 14, 22, 44, -90,
-    278 },
-  { 203, -54, 103, -142, -598, -741, -546, -26, 545, 253, -43, -234, -391, -504,
-    -158, -143 },
-  { 387, 275, 136, 69, -289, -9, -210, -364, 39, 3, 4, 61, -66, -102, -94,
-    -215 },
-  { 195, 213, 433, 158, 128, -131, -203, -266, -132, -285, -301, -367, -315,
-    -249, -144, -9 },
-  { 600, 145, 418, 277, 156, -118, 85, -20, 119, 260, 41, 72, -85, 316, -97,
-    -41 },
-  { 682, 610, 356, 880, 527, 272, 90, 92, -124, 314, -204, -339, -590, -384,
-    -248, -192 },
-  { 999, 423, 208, 752, 623, 409, 91, -57, -3, -124, 148, 255, -7, 112, -128,
-    -144 },
-  { 1007, 710, 609, 766, 264, -163, 324, 291, 219, -61, 24, 507, 74, 109, 127,
-    629 },
-  { 2211, 878, 853, 462, 86, 203, -71, 122, -36, 131, 308, 267, 210, 369, 50,
-    -96 },
-  { 1810, 1630, 1123, 645, 610, 217, -93, -37, -220, -341, -250, -110, 135, 0,
-    112, 93 }
-};
-static int16_t default_ncobmc_krnl_1_1_1[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 5824, 7106, 8063, 8929, 8632, 9731, 10164, 11047, 11088, 10239, 10606, 8987,
-    8411, 7117, 6115, 5322 },
-  { 4980, 6239, 7135, 7245, 7418, 8526, 9440, 9438, 8119, 8336, 7993, 8057,
-    6686, 5210, 4193, 4841 },
-  { 2436, 4500, 5019, 5908, 5578, 7270, 7391, 7974, 7281, 6871, 6705, 6327,
-    4867, 4521, 4286, 3605 },
-  { 2298, 3501, 4714, 4692, 4835, 5278, 5830, 4968, 4435, 4824, 4373, 4085,
-    3825, 2657, 2539, 2557 },
-  { 1643, 2741, 2604, 2664, 1877, 3334, 2995, 3162, 3367, 3104, 3356, 2827,
-    3577, 2359, 1755, 2140 },
-  { 742, 1397, 1315, 1332, 1864, 3032, 2472, 2253, 1692, 2071, 2260, 2426, 1951,
-    1610, 1189, 1275 },
-  { 482, 869, 598, 288, 769, 1490, 1284, 1692, 883, 1061, 1259, 1239, 1118, 585,
-    219, 571 },
-  { 178, 278, 580, 915, 717, 873, 1012, 721, 52, 348, 624, 540, 691, 102, -108,
-    383 },
-  { -718, -648, -223, -520, -1000, -754, -688, -639, -528, -414, -440, -365,
-    -268, -546, -672, -332 },
-  { -256, -226, -395, -158, -311, -325, -66, 87, 533, 705, 261, 344, 484, 692,
-    155, 507 },
-  { 204, 448, 131, -571, 889, 712, 626, 349, 261, 578, 240, 1012, 849, 900, 889,
-    977 },
-  { 132, 1395, 1847, 1181, 845, 1203, 1920, 2068, 2141, 2071, 1834, 2191, 2130,
-    2522, 1537, 1326 },
-  { 140, 1278, 2440, 2063, 1581, 2204, 2781, 2532, 1677, 2426, 2538, 2210, 1568,
-    2564, 2394, 1945 },
-  { 2943, 3776, 3833, 3310, 3900, 4118, 4161, 3571, 4059, 4143, 4145, 4273,
-    4034, 3940, 3720, 2418 },
-  { 3437, 3906, 4106, 4294, 5303, 5257, 4956, 4027, 5935, 5373, 4102, 4853,
-    5331, 5251, 3964, 4748 },
-  { 5493, 5799, 5966, 6535, 7015, 7397, 8011, 6526, 5832, 6257, 6247, 7097,
-    6499, 6272, 5963, 5593 }
-};
-static int16_t default_ncobmc_krnl_1_1_2[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 6049, 4906, 3617, 2960, 2187, 1950, 556, 497, 688, 355, 503, 1054, 1170,
-    1641, 2343, 4226 },
-  { 7459, 6408, 4326, 3635, 2042, 1565, 492, 572, 746, 338, 719, 797, 2540,
-    2283, 2301, 4089 },
-  { 8025, 6914, 5072, 4249, 2793, 1910, 430, 1137, -150, 451, 1061, 872, 1515,
-    2805, 3823, 4550 },
-  { 9615, 6936, 5226, 3388, 2611, 2061, 801, 1003, -537, 72, 736, 1347, 2215,
-    3509, 4262, 5097 },
-  { 9677, 6521, 5633, 5223, 2996, 2449, 1300, 1136, 160, 918, 488, 801, 2306,
-    3781, 4818, 6441 },
-  { 9988, 7509, 6019, 4950, 3376, 2777, 1427, 1395, -118, 310, 393, 1626, 3387,
-    3649, 4737, 7431 },
-  { 10542, 7745, 5192, 4494, 1637, 1960, 1212, 1056, -309, 383, 1166, 2107,
-    4048, 4030, 7206, 7851 },
-  { 9350, 7480, 4343, 3589, 1748, 1687, 1057, 898, 592, 776, 680, 1960, 3804,
-    4598, 5688, 7834 },
-  { 8769, 7236, 5518, 4182, 2776, 2412, 915, 1370, 789, 561, 520, 1146, 3139,
-    4730, 5542, 7514 },
-  { 9580, 7116, 5910, 4623, 3085, 2450, 1703, 745, 419, 600, 1077, 1208, 3256,
-    4261, 5611, 6709 },
-  { 9725, 7053, 5594, 4217, 2573, 1834, 562, 512, 496, 356, 883, 1360, 3323,
-    4866, 5632, 7594 },
-  { 10110, 7367, 5622, 3858, 3720, 2398, 1075, 1687, 616, 461, 1082, 1786, 2570,
-    4242, 5731, 8319 },
-  { 9416, 7582, 6054, 3915, 3283, 2035, 1335, 1138, 317, 92, 253, 483, 1715,
-    3597, 5613, 8103 },
-  { 8693, 6881, 4626, 3505, 2663, 1949, 751, 792, -343, 55, 303, 460, 2027,
-    3584, 6230, 8704 },
-  { 7368, 6609, 5087, 3861, 2790, 1746, 1487, 518, 497, -165, 439, 904, 2514,
-    3735, 6082, 6914 },
-  { 7004, 5321, 3472, 2621, 1221, 999, 1172, 377, 850, 864, 866, 647, 2574,
-    3977, 6416, 7777 }
-};
-static int16_t default_ncobmc_krnl_1_1_3[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 2085, 2421, 3201, 4245, 4593, 5179, 5800, 5172, 4904, 5558, 5357, 5889,
-    5769, 6415, 6377, 4080 },
-  { 2031, 2607, 4062, 5018, 6279, 5766, 6373, 6562, 8085, 7434, 7557, 7449,
-    6834, 7509, 8119, 6106 },
-  { 3960, 4394, 5800, 6108, 7339, 7531, 8876, 7849, 9371, 8973, 8753, 8896,
-    9525, 8636, 7540, 7092 },
-  { 3599, 4610, 5527, 7597, 7898, 9121, 10115, 10783, 12123, 11248, 10928,
-    10406, 9827, 9129, 8401, 7814 },
-  { 3953, 6203, 7382, 8619, 10852, 10722, 12369, 12580, 12777, 12605, 12198,
-    11899, 10047, 9350, 9018, 7521 },
-  { 4615, 7038, 8644, 9190, 11073, 11216, 12685, 13003, 14345, 13679, 13689,
-    12344, 10902, 11188, 10148, 7399 },
-  { 5141, 7775, 10402, 11309, 13751, 13759, 14094, 13720, 15371, 14418, 14061,
-    12988, 11166, 11692, 9019, 7665 },
-  { 6591, 8644, 11320, 11985, 14476, 14526, 14816, 14745, 15159, 14966, 15071,
-    14071, 12238, 12154, 10931, 8266 },
-  { 7897, 9483, 10910, 12615, 14865, 14701, 16336, 15966, 16036, 16200, 16266,
-    15506, 13546, 12270, 11580, 9377 },
-  { 6808, 9239, 10394, 11719, 13438, 14348, 14923, 15789, 15519, 15341, 15316,
-    15166, 12927, 11656, 10736, 9138 },
-  { 5796, 8696, 10198, 12417, 12722, 13926, 15077, 15506, 15468, 15155, 15184,
-    13906, 12262, 10270, 9924, 7815 },
-  { 5386, 6960, 8500, 10429, 11262, 12474, 13263, 12505, 13713, 13502, 13632,
-    12702, 12233, 9964, 9329, 6889 },
-  { 5768, 7049, 7630, 9626, 10868, 11697, 12128, 12718, 14351, 13953, 13402,
-    13389, 13063, 10072, 8470, 6445 },
-  { 3665, 4962, 7272, 8760, 9507, 10431, 11095, 11676, 12400, 12216, 11874,
-    11099, 10214, 8725, 6279, 4598 },
-  { 3293, 4948, 6288, 7711, 8156, 9140, 9976, 11683, 9946, 11003, 11496, 10325,
-    8287, 6988, 6251, 4796 },
-  { 2010, 3599, 5789, 6548, 7490, 7725, 7264, 9488, 9893, 9573, 9487, 8725,
-    7145, 6110, 3858, 2891 }
-};
-static int16_t default_ncobmc_krnl_2_0_0[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 3437, 3490, 4578, 2066,  1672, 1354, 1502, 2345, 2273, -600, 52,
-    272,  484,  2214, -1553, -197, 165,  278,  306,  384,  73,   415,
-    -213, 357,  497,  288,   714,  6,    -82,  -118, 170,  181 },
-  { 2505,  3488, 306,   3011,  2631, 181,  636,  2608, 1663, -964, 594,
-    -1455, 1057, -1198, -1647, 187,  404,  412,  177,  -32,  269,  -24,
-    148,   233,  -290,  -359,  -178, -164, -362, -19,  -408, 106 },
-  { 2588, 3528, 3391, 3134, 1812, 2387, -34, -298, -13,  -955, 40,
-    -475, 1243, 283,  -247, -484, 200,  -46, 36,   -642, -386, -438,
-    34,   295,  93,   -528, -13,  412,  -8,  41,   -457, 28 },
-  { 796, 3353, 435,  3473,  458,  1851, 519,  1061, 259,  942,  416,
-    195, 390,  -151, -1141, -710, 716,  -401, 33,   -771, -759, -336,
-    88,  -124, -139, -372,  -223, -505, -164, -100, -512, -465 },
-  { 3233,  3990, 2698, -107,  -448, 297, 331, -13, -530, -383, -464,
-    -1530, 715,  -899, -1978, -879, 43,  93,  -77, -138, -425, -97,
-    -167,  -348, -460, -95,   280,  -45, 235, 172, -357, -200 },
-  { 868,   4162,  1417,  487,  -1446, -355, 392, -159, 202,  704,  -814,
-    -3095, -1052, -1482, -745, -1403, -199, -27, -38,  -387, -208, 20,
-    -64,   -130,  -265,  81,   -20,   238,  49,  121,  -137, 495 },
-  { 2774, 3478, 2072, 1229, 819,  1359, 106,  -222, -1445, -1559, 924,
-    -98,  44,   -347, 455,  -862, -318, -288, -31,  281,   -144,  -107,
-    148,  103,  -171, -239, -134, 25,   125,  108,  -142,  -129 },
-  { 610,  990,  -703,  1003,  437,  -275, -179, -233, -2041, -445, -1145,
-    -488, 335,  -2684, -1339, -294, -176, -195, -36,  -65,   -276, 10,
-    -111, -277, -134,  -222,  -51,  31,   -369, -279, -105,  69 },
-  { 420,  2773, 375,   -372, 489,  989,  -900, 1075, 182,  119,  -529,
-    -470, -504, -2225, 225,  101,  -264, -417, -253, -459, -317, -205,
-    -528, -7,   -43,   -268, -116, -857, -608, -208, -216, 220 },
-  { 2969, 1927, -314,  -476, 402,   -637, -838, 835,  1229, 1200, 135,
-    -299, -324, -2136, 340,  -1563, -309, -98,  -408, -137, -154, 668,
-    101,  -90,  245,   112,  -51,   -37,  -525, -254, -244, -126 },
-  { 1404, -258, 2333,  2019,  309,   -29,  -2468, 18,   -494, 70,  -260,
-    245,  515,  -1984, -1759, -1003, -504, 104,   472,  197,  -38, 265,
-    378,  6,    50,    -183,  -204,  -17,  -383,  -318, -396, 142 },
-  { 807,  637,  712,   1237,  -971, -176, -1160, -210, -2072, -782, -959,
-    -372, -590, -1159, -1017, -889, -750, -399,  -98,  -15,   2,    -172,
-    -48,  -488, -628,  -12,   -25,  136,  229,   -200, -212,  -472 },
-  { -1464, 333,  -1978, -1394, -281, -1820, -124, 385,  97,   -297, -1497,
-    -3,    -916, -660,  -949,  -504, 117,   11,   86,   88,   2,    219,
-    333,   -120, -224,  71,    237,  -507,  13,   -381, -207, -113 },
-  { 1100, -717,  -1827, -1908, -1030, -1562, 404,  794,  4,    -682, -1306,
-    -612, -1197, 8,     -131,  525,   159,   -345, -91,  9,    -222, -482,
-    -69,  482,   593,   -32,   -239,  -408,  -522, -692, -126, 712 },
-  { -798, -735, -174, -1695, 819,   -737, -15, -426, -750, 876, 34,
-    -622, 448,  -71,  -950,  -2094, 74,   170, 18,   57,   156, 443,
-    -85,  -374, -416, -537,  -348,  -126, 62,  -381, 399,  -53 },
-  { -552, -1352, 536,  -1,    -322, -1094, -428, 309,  -142, -752, 354,
-    900,  473,   -137, -1263, -370, -731,  -864, -30,  -101, 354,  -321,
-    -523, 377,   9,    -415,  -87,  -145,  -154, -286, 100,  23 },
-  { 44,  607,  316,  -268, -246, -497, 267, 154, 160, 717,  324,
-    240, -130, -218, -107, -252, -64,  4,   113, -57, -162, 123,
-    -5,  143,  -312, -66,  -230, -33,  -57, 60,  153, 85 },
-  { 158,  14,  -307, -240, -85, -416, 304, -402, -461, -221, 193,
-    -123, 384, -142, 48,   -77, -378, 36,  -56,  20,   2,    -240,
-    -88,  -1,  -185, 87,   6,   94,   -22, 82,   191,  194 },
-  { 417,  259,  -85,  -170, -45,  -151, -402, 136, 28,   -40, 101,
-    224,  -337, 97,   98,   51,   -401, 95,   -77, -153, 357, -99,
-    -473, -142, -289, -80,  -349, -76,  -87,  97,  40,   198 },
-  { -236, 62,  -104, -8,  98,  68,  128, 116, 47,  54,  -121,
-    -150, -20, -120, 196, -80, 37,  290, 231, 247, 131, -113,
-    -126, -87, 65,   250, 260, 102, -68, 234, 76,  -87 },
-  { 245, 486, 38,   -10,  -135, 106, 217,  -187, -200, 96,   20,
-    117, -40, -97,  68,   -139, 276, 8,    -55,  -53,  -187, -20,
-    -41, 1,   -145, -246, -106, -45, -145, -353, 185,  -35 },
-  { 448,  -172, -496, -63, -84, -106, 151,  9,   -143, -180, -38,
-    -276, -223, 269,  100, 38,  -236, -66,  124, -59,  475,  -78,
-    -407, -20,  -119, -19, 162, -4,   -226, 101, 247,  78 },
-  { -348, -156, -324, -260, -173, 0,   -41,  63,  235,  -114, 109,
-    -362, -96,  279,  -277, 36,   394, 394,  240, 30,   -88,  209,
-    29,   176,  59,   -20,  -244, 50,  -104, 192, -157, 48 },
-  { -376, -176, 269, -426, -159, -108, -18,  -163, 93,  130, -222,
-    -40,  539,  176, 164,  -62,  -709, -354, 502,  664, 243, -414,
-    -51,  192,  33,  54,   -10,  -57,  -141, -3,   144, 71 },
-  { -137, -636, 627,  6,    -129, -159, -45, -150, -15,  402, 207,
-    20,   202,  1,    -203, 88,   183,  62,  -76,  120,  418, -196,
-    -104, -154, -433, -338, -73,  1,    -79, -14,  -200, 84 },
-  { 184, -334, 175,  114,  -274, -60, -429, 176,  36,   373, 468,
-    134, 110,  -11,  -201, -94,  352, 109,  115,  91,   187, -83,
-    21,  0,    -154, -180, 288,  0,   -61,  -197, -246, 42 },
-  { -143, 26,   190,  -110, -335, -385, -357, 27,   103,  -66, -96,
-    -189, -337, -150, 129,  -104, -176, -418, -216, -118, 28,  126,
-    -112, -130, 110,  17,   141,  111,  -82,  238,  22,   -50 },
-  { 104, -95, 48,   -239, -40, -148, -327, 244,  323,  -102, 244,
-    151, 113, -150, -74,  223, -81,  -328, -178, 140,  -233, -165,
-    182, 514, 216,  -129, -8,  141,  -81,  451,  -110, -71 },
-  { -116, 84,   -228, 177, 318, 62,   134, -3,   239,  14,  338,
-    278,  -439, -254, 3,   -82, -210, -62, -236, -124, 5,   -60,
-    112,  -18,  -115, -31, 5,   -65,  278, 4,    -19,  -130 },
-  { 236, -64,  -147, -519, 147,  -27, 71,  -567, -133, 24, -199,
-    229, -107, 126,  -141, -148, -35, -34, 68,   230,  8,  72,
-    40,  -148, 203,  97,   84,   107, 32,  17,   -58,  -18 },
-  { -43,  -408, -101, 120, 118, 168,  -170, -233, -323, -120, -339,
-    80,   -294, -151, 85,  52,  -420, 79,   -162, -233, -237, -47,
-    -131, -53,  -199, 14,  85,  -80,  93,   -150, -15,  318 },
-  { -106, 107,  -6,   189, 53,  -109, 22,  -474, -335, -102, -279,
-    -321, -66,  186,  -65, -13, 61,   167, 43,   -159, -57,  -13,
-    37,   -125, -137, 132, 161, -156, -27, -276, -89,  15 }
-};
-static int16_t default_ncobmc_krnl_2_0_1[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 5401, 5987, 4279, 6550, 4858, 4986,  5733,  7172,  8194, 7631, 7549,
-    6971, 9288, 7485, 8583, 9244, 12058, 11530, 10461, 8453, 8304, 11724,
-    8999, 9457, 5018, 6922, 8375, 7860,  7915,  6921,  7703, 8963 },
-  { 2308, 2670,  5018,  5298, 3883, 6449,  4267,  4119, 9252, 10082, 7844,
-    7414, 9050,  9261,  8739, 7808, 10974, 10279, 8627, 8840, 9203,  9406,
-    9360, 10574, 10156, 7673, 6238, 8876,  6800,  6423, 6931, 8589 },
-  { 6608,  4325, 3372, 5227, 6182, 3670, 5595, 5758, 8575, 8025, 8251,
-    10711, 5449, 6965, 5443, 7178, 9099, 8842, 7132, 7830, 5795, 9882,
-    8939,  8323, 7507, 7248, 8750, 6786, 6940, 4942, 7125, 6399 },
-  { 3977, 3060, 4962, 7094, 7211, 6388, 6256, 3960, 7672, 7814, 7711,
-    7237, 7088, 7232, 5716, 6040, 9565, 6643, 8113, 7841, 9849, 10144,
-    8297, 7676, 6792, 8447, 7805, 5475, 5499, 4728, 5379, 7645 },
-  { 4598, 4391, 3660, 6284, 6694, 8302, 5610,  5341, 7466, 6298, 6406,
-    7734, 5743, 5155, 5257, 6958, 9035, 11566, 9636, 7825, 8147, 9427,
-    6612, 5526, 7635, 7259, 7696, 7853, 5505,  6744, 9265, 5394 },
-  { 5980, 2356, 2746, 5955, 4045, 4283, 5117, 3799, 5386, 5594, 7671,
-    6984, 6232, 6028, 3101, 3391, 5757, 9530, 7408, 6206, 5512, 7867,
-    5144, 8011, 6690, 6994, 4877, 5063, 6175, 5205, 1965, 859 },
-  { 2619, 4096, 4225, 4712, 5637, 6418, 6649, 3904, 5463, 5102, 4785,
-    4100, 5127, 3858, 3419, 5301, 6002, 7649, 8260, 6241, 4168, 4551,
-    6153, 5016, 7113, 7845, 5201, 5455, 5069, 2335, 3311, 5194 },
-  { 1278, 4942, 4441, 3456, 3791, 5620, 5275, 2243, 5080, 4619, 5834,
-    4859, 4320, 5092, 1481, 846,  4969, 4835, 3646, 5940, 5736, 5862,
-    3628, 5918, 5865, 4945, 4385, 4699, 4342, 5415, 8383, 4711 },
-  { 3855, 1678, 2560, 4631, 2765, 1444, 1449, 1895, 4494, 5706, 4813,
-    4882, 3532, 2264, 3222, 5444, 4097, 5236, 5036, 3713, 6547, 4371,
-    5311, 2363, 5113, 6290, 3743, 5343, 5369, 2813, 2486, 1647 },
-  { -651, 1098, 2116, 3495, 2289, 1836, 4507, 4057, 5225, 4553, 2631,
-    2791, 2984, 3605, 3416, 3611, 4358, 4719, 3450, 4146, 3973, 3263,
-    3826, 5881, 6402, 4584, 4396, 3689, 2020, 1960, 2100, 4304 },
-  { -622, 1848, 379,  112,  -1474, 1013, 6023, 260,  1035, 1984, 3811,
-    2362, 1394, 2546, 3347, 2472,  1865, 755,  2251, 1139, 1933, 2252,
-    1163, 3003, 4091, 4792, 3801,  3517, 4247, 3798, 5216, 4543 },
-  { 1342, 2229, 1014, 1212, 260,  432,  1975, 99,   2798, 818,  2455,
-    3858, 2231, 3773, 136,  857,  2171, 815,  1966, 1825, 1711, 964,
-    2142, 2514, 5367, 3539, 3241, 3116, 3982, 3839, 3553, 3535 },
-  { 1800, 27,   321,  111,  1003, 528,  254,  979,  2444, 2413, 3807,
-    961,  1961, 1173, 2156, 3935, 259,  263,  1815, 1979, 1218, 2393,
-    3738, 1109, 4444, 3726, 3647, 3428, 2966, 4602, 4903, 5851 },
-  { 1340, 753,  317,  1318, 738,  1880,  -500, -691, 1108, 38,   412,
-    890,  494,  291,  -131, 759,  -111,  221,  -95,  2575, 3099, 3223,
-    3140, 3156, 3952, 1942, 2615, -2313, 2991, 6367, 5744, 4528 },
-  { 752,  490,  1255, 2396, 14,   3819, 1319,  1239, 3491, 2464, 3243,
-    3083, 392,  1273, 1712, -226, -931, -2130, 710,  864,  385,  265,
-    1431, 1796, 3063, 3531, 3879, 3986, 3503,  4045, 2539, 3489 },
-  { 1943, 170,  358,  1884, 2344, 1566, 92,   1721, 1381, 1115, 723,
-    1670, 2294, 1497, 1697, 973,  1286, 2306, 381,  2582, 2551, 3852,
-    2481, 3432, 2273, 3079, 2076, 3014, 3365, 3906, 2241, 2250 },
-  { 1741, -705, 595,  956, 2038, 793,  1518, 148,   -524, -881, -487,
-    711,  720,  773,  431, 2181, -435, -841, -1106, -552, 434,  -2007,
-    -41,  -234, -960, -23, 394,  -655, 792,  934,   1495, 1947 },
-  { 2086, 1360,  97,   1352, -95,  1800, -729, -916, -152, 956,  196,
-    1746, -1973, -690, 472,  1788, -28,  385,  781,  589,  -320, 1167,
-    -484, 66,    1136, 1038, 1741, 888,  3056, 2114, 3495, 1297 },
-  { 1900, 1373, 983,  3718, 1409,  2096, 932,  -604,  -1370, 1153, 109,
-    58,   104,  2851, 602,  -2071, 252,  -888, 1428,  2724,  1344, 1567,
-    563,  1902, 1370, 519,  -294,  393,  1153, -1032, 2129,  335 },
-  { 2652, 2620,  3178,  2344,  2466, 2241, 1145, -101, -635, 306, -1036,
-    638,  -2606, -1921, -1098, -328, -324, 2598, 1092, 1832, 493, 2507,
-    1152, 1461,  -796,  2126,  -742, 1182, 2078, 1549, 2665, 2366 },
-  { 1080, 798,  1934, 568,  1218, 3206, 155, 1844, 2313, 3509, 1090,
-    650,  1166, 2515, 1846, 1025, 259,  720, 1587, 3010, 4955, 6457,
-    2952, 2764, -396, 1937, 1563, 673,  828, 4062, 2711, 1548 },
-  { 871,  657,  2761, 1756, 2349, 198,   -1003, -1105, -1181, -69,  146,
-    3201, -27,  1493, 13,   291,  -2260, -468,  1178,  928,   2665, 3887,
-    3140, 1334, 1969, 2687, 544,  3842,  2885,  733,   3419,  1963 },
-  { 1491, 1698, 302,  2127, 1256, 907,  1607, 1833, 2061, -536, 988,
-    4380, 2723, -195, 962,  1769, 2466, 1735, 2707, -369, -713, 1599,
-    3031, 2924, 2023, 2045, 5259, 1733, 3517, 4274, 440,  412 },
-  { 2163, 1,    167,  1755, 5694, 3272, 739,  4235, 6123,  3811, 4611,
-    5800, 2424, 2409, 1458, 2152, 104,  115,  466,  -998,  -806, 2824,
-    4473, 2511, 4878, 3258, 5014, 3559, 1003, 2074, -2091, 1403 },
-  { 964,  1051, -1527, 1266, 3883, 2349, 1054, 1972,  1929, -249, 3796,
-    2861, 1542, 449,   539,  1942, -16,  58,   2080,  56,   1106, 4248,
-    580,  2540, 3095,  4536, 152,  354,  4067, -2246, 1505, 1981 },
-  { 1081, 1440, 324,  736,  2839, 2597, 3712, 2282, 3717, 2483,  1247,
-    4456, 3604, 3415, 2487, 3715, 2073, 2928, 2372, 828,  -2700, 2054,
-    4315, -125, 1777, 2211, 2992, 7336, 4216, 3571, 2657, 6780 },
-  { 1997, 2104, 1255, 1942, 1335, 1450, 3567, 1447, 3812, 6083, 5233,
-    4484, 3536, 3564, 3290, 4062, 2589, 2816, 3971, 4406, 3481, 2664,
-    1245, 1759, 3353, 1036, 2054, 1299, 2263, 4010, 4171, 3972 },
-  { 1519, 4826, -750, 988,  1338, 2999, 212,  3858, 5202, 5306,  5717,
-    3066, 2629, 6461, 6043, 6637, 8388, 7252, 4890, 4161, -1056, 4615,
-    2538, 5633, 3389, 6439, 2985, 7148, 5149, 4509, 8001, 8863 },
-  { 1047, 876,  2713, 3913, 2232, 1084, 1702, 2626, 1983,  3744, 2044,
-    3690, 2087, 4497, 2656, 5592, 6247, 4584, 4218, 6097,  6884, 6277,
-    2412, 5097, 7400, 2789, 6089, 6157, 7247, 9712, 11393, 5627 },
-  { 2876, 4288, 2443, 3081, 1569, 1823, 1050, 2325,  2558, 2591, 4223,
-    6300, 4237, 4354, 4411, 7502, 4175, 3350, 4208,  1100, 6473, 6664,
-    5460, 4207, 5297, 8047, 6850, 6496, 7866, 10375, 7455, 2868 },
-  { 3282, 5838, 6486, 6479, 3474, 4665, 3790, 2882,  5116, 4457, 4649,
-    4208, 4520, 7271, 4363, 7125, 8799, 6540, 10158, 5716, 6794, 5762,
-    6462, 8561, 2742, 7002, 9454, 8451, 8560, 7973,  7759, 6679 },
-  { 5957, 7221, 5126, 7057, 5824, 4274,  5374,  6023, 7549, 6239, 7666,
-    6368, 4014, 5338, 7150, 9793, 10608, 9838,  6748, 9691, 5465, 4631,
-    7964, 7692, 8173, 9362, 8989, 11677, 10282, 9960, 6666, 9276 }
-};
-static int16_t default_ncobmc_krnl_2_0_2[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 7499, 5941, 5384,  4566, 4006, 3634, 2288, 4112, 2127,  3001, 2639,
-    1927, 467,  -1639, 1484, 1143, 66,   -316, 626,  1721,  1208, 193,
-    1591, 3903, 8472,  3945, 1882, 4378, 6453, 8972, 11867, 10110 },
-  { 7919, 6226, 8601, 3825, 4644, 4380, 3957, 2964, 1316, 3586, 2268,
-    2802, 2193, 1427, 1479, 1353, -55,  373,  271,  979,  526,  1827,
-    2463, 1938, 3963, 4851, 5040, 4192, 3731, 4522, 8903, 6733 },
-  { 6373, 4994, 6414, 4822, 4923, 4881, 4383, 6117, 3342, 5068, 2353,
-    2370, 2231, 758,  1768, 1338, 742,  1498, 454,  1453, 1466, -213,
-    177,  1223, 512,  5366, 2462, 4667, 5671, 5039, 6065, 6874 },
-  { 9299, 8698, 12939, 6170, 7063, 3147, 3256, 3492, 2696, 4498, 3705,
-    3176, 2797, 1099,  2852, 1331, 527,  1272, -388, 1619, 110,  -406,
-    390,  3801, 4468,  3193, 2944, 7284, 7144, 4560, 6320, 8073 },
-  { 5937, 4572, 5212, 6678, 5291, 2561, 2752, 4892, 2713, 5203, 4202,
-    1527, -470, 2424, 2850, 1217, 401,  587,  191,  1122, 1314, 1854,
-    3860, 4579, 2455, 5427, 1614, 5037, 5073, 5074, 3101, 7734 },
-  { 7035, 5229, 7515, 6523, 7587, 5653, 5311, 4945, 4097, 4237, 2836,
-    2667, 1959, 4095, 1669, 1484, 57,   467,  1028, 642,  2843, 2782,
-    3604, -825, 1592, 4305, 2202, 4432, 4683, 3867, 3520, 9281 },
-  { 7248, 3787, 4243, 4710, 3288, 1975, 2766, 4057, 1506, 2644, 1436,
-    818,  1150, 2159, 787,  920,  98,   137,  1065, 306,  3880, 537,
-    3871, 1060, 3821, 3395, 2484, 3532, 4072, 3339, 2638, 3982 },
-  { 8810, 5802, 5538, 4090,  3659, 3742, 3818, 6827, 6474, 4756, 4093,
-    3735, 4063, 4586, -1945, 470,  328,  -163, 958,  511,  2541, 3057,
-    2972, 4349, 4754, 5115,  5847, 6843, 7299, 6652, 5891, 5655 },
-  { 9091, 5007, 6438, 4749, 5610, 3664, 6151, 5188, 3686, 2005, 2670,
-    -245, 1788, 3724, 2626, 679,  -52,  -839, -145, 356,  3488, 1970,
-    1988, 2126, 1099, 2578, 5401, 6965, 4908, 5526, 6748, 5968 },
-  { 6412, 7516, 8029, 8748, 6742, 7509, 6552, 4078, 4300, 5066, 4786,
-    3270, 4270, 3875, 2319, 4282, 1640, -843, -439, 427,  1587, 520,
-    -28,  2251, 3358, 3049, 4407, 7286, 8994, 7802, 5924, 6824 },
-  { 8467, 6838, 3934, 2952, 7200, 5407, 4593, 5882, 3353, 3865, 1870,
-    1535, 2130, 4121, 3527, 1799, -637, -937, 513,  247,  169,  607,
-    2947, 3530, 3717, 6082, 9703, 6867, 2729, 6292, 3084, 4879 },
-  { 9934, 8638, 7508, 6894, 7343, 5306, 6208, 6136, 5240, 7136, 3958,
-    1811, 3171, 1064, 2246, 882,  1681, 727,  1694, 769,  1700, 1370,
-    1901, 5812, 3852, 6468, 5875, 5416, 6007, 3348, 3600, 6661 },
-  { 10978, 9383, 9741, 10746, 5208, 8469, 4608, 5824, 4424, 3460, 3841,
-    4037,  3687, 1582, 3784,  988,  1974, 1292, 2272, 2128, 2210, 2888,
-    -967,  5864, 5568, 4693,  3796, 6361, 4816, 2697, 4559, 6437 },
-  { 8329, 9809, 8672, 9375, 7503, 5775, 3454, 4596, 5093, 5033, 4021,
-    2860, 2833, 2782, 3056, -617, 1644, 1759, 2434, 2570, 3312, 3807,
-    3518, 3521, 1126, 2830, 3378, 4432, 3261, 5211, 4073, 10050 },
-  { 9992, 8148, 7951, 7194, 5624, 5032, 3296, 2981, 5388, 3910, 2274,
-    1436, 1425, 1053, 2111, 2806, 1606, 1446, 1681, -211, 1877, 1541,
-    1700, 2736, 2088, 2551, 1045, 2977, 2632, 1719, 4896, 5378 },
-  { 9403, 8846, 8061, 7478, 5269, 6655, 6312, 4110, 3529, 5802, 3108,
-    3246, 1943, 909,  2436, 1678, 1513, 1243, 797,  213,  3888, 4015,
-    2775, 2082, 2395, 2792, 2136, 2475, 1657, 2156, 1878, 2587 },
-  { 9499, 9075, 5426, 6962, 8206, 8057, 3968, 5184, 2759, 2277, 2744,
-    3531, 2518, 367,  1075, 2118, 900,  901,  2964, 3641, 5282, 2186,
-    2416, 2312, 2366, 2149, 1024, 1912, 1119, 220,  401,  727 },
-  { 7615, 8271, 8148, 7699, 7063, 7658, 5473, 7497, 7302, 5841, 4165,
-    3092, 734,  2215, 3316, 2226, 1197, 1236, 2996, 5007, 2872, 3460,
-    2371, 1898, 1917, 1442, 853,  1412, 700,  620,  317,  1237 },
-  { 8331, 8530, 8633, 7185, 6863, 9076, 5328,  5045, 5378, 4004, 4089,
-    1469, 1341, -333, 2689, 1982, 115,  -1158, 383,  1548, 1118, 2864,
-    3154, 1803, 2079, 1676, 1450, 1165, 967,   795,  136,  1184 },
-  { 8763, 9102, 6716, 8961, 5448, 6366, 3438, 5722, 5374, 5651, 5422,
-    1728, 1751, 2444, 1024, 1118, 424,  2288, 3655, 2719, 2254, 1313,
-    3476, 1983, 1975, 1502, 1172, 2333, 937,  594,  122,  149 },
-  { 8146, 9931, 7629, 8882, 6328, 7491, 5646, 5494, 7238, 7355, 4478,
-    2019, 2646, 3486, 4193, 1121, 562,  1823, 2787, 1720, 2228, 3627,
-    4470, 3351, 2439, 2214, 1926, 2118, 1771, 767,  353,  1062 },
-  { 10816, 9814, 10917, 7424, 8207, 9717, 8537, 8728, 7356, 7376, 7246,
-    3223,  1981, 277,   1282, 951,  515,  222,  1392, 789,  4372, 2112,
-    4083,  2706, 3234,  2414, 2655, 1407, 702,  1369, 121,  676 },
-  { 11362, 10078, 7520, 7828, 10705, 7300, 7358,  6559, 8337, 7569, 5067,
-    3465,  2417,  1956, 2165, 759,   -106, -1282, 1822, 3225, 4767, 5619,
-    4119,  3383,  3877, 2702, 2410,  2459, 1441,  1392, 945,  216 },
-  { 10112, 8115, 3762, 5107, 7443, 7676, 7498, 7380, 6235, 7523, 6246,
-    3574,  2749, 3853, 303,  1558, 1896, 1107, 462,  2172, 2388, 4222,
-    2000,  1688, 3560, 2297, 1593, 3679, 3628, 1507, 1549, -188 },
-  { 7794, 6437, 6605, 5381, 6404, 4410, 6677, 4233, 4949, 3000, 2812,
-    3756, 1805, 2877, 2098, 1737, 1809, 1427, 378,  2031, 2115, 5006,
-    3159, 3602, 6343, 3503, 3356, 5971, 3138, 3932, 1028, 699 },
-  { 6757, 7738, 6538, 8248, 6959, 6557, 5264, 3092, 3765, 1895, 1865,
-    901,  2485, 2217, 1699, 1946, 3573, 1501, 2141, 2177, 180,  1003,
-    1816, 4793, 2112, 4560, 3820, 2881, 4376, 2091, 681,  623 },
-  { 9057, 8917, 7385, 7072, 6324, 5492, 5283, 5053, 5785, 4277, 3322,
-    1267, 1946, 1894, 3701, 472,  1658, 1154, 777,  2193, 2349, 3611,
-    3129, 3719, 1781, 5389, 3418, 2463, 3734, 3644, 3365, 2247 },
-  { 9444, 9439, 8598, 9152, 6982,  8451, 8279, 6129, 5172, 3730, 2416,
-    2483, 2775, 1913, 1041, -1110, -392, 1068, 556,  598,  4171, 2377,
-    1870, 1906, 5449, 5413, 2589,  3564, 6473, 6692, 3140, 2665 },
-  { 10567, 10001, 8225, 8289, 6898, 6856, 3920, 4547, 4297, 1456, 2348,
-    1526,  2343,  2863, 1429, 312,  57,   930,  1619, 1189, 596,  1815,
-    2589,  3141,  1662, 3349, 1311, 4091, 4596, 7321, 5911, 6965 },
-  { 9593, 9214, 9132, 8273, 8030, 8135, 5179,  5564,  4052, 4155, 4052,
-    2249, 2178, 1680, 439,  822,  -378, -1210, -1149, 3709, 2830, 747,
-    2987, 5873, 795,  5124, 4233, 3887, 5573,  5312,  7258, 11014 },
-  { 8373, 8033, 8934, 7880, 7434, 6144, 7528, 5163, 2591,  4301, 2489,
-    4137, 1295, 760,  703,  805,  -308, -320, 2205, -1113, 362,  581,
-    2567, 689,  5949, 2652, 1996, 2138, 7469, 4835, 8058,  11132 },
-  { 8586, 6026, 7656, 7201, 8141, 7249, 5995, 4896, 3152,  4255, 1711,
-    3498, 3933, 1852, 1444, 715,  -104, -695, 4021, 3937,  6478, 1755,
-    935,  384,  1002, 2595, 3359, 4532, 7103, 5192, 12241, 14373 }
-};
-static int16_t default_ncobmc_krnl_2_0_3[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { -18,  921,  2116, 3151, 5822, 6391, 6844, 2748, 3794,  6358, 6115,
-    7194, 6145, 8324, 7847, 6181, 4052, 4867, 4967, 5823,  6786, 4035,
-    5989, 2636, 2376, 5222, 5409, 4121, 2105, 626,  -3363, -2857 },
-  { 3594, 3991, 2433, 4231, 5187, 5335, 7496, 6672, 4132, 3625, 5649,
-    7621, 4052, 6868, 7772, 7010, 5041, 5311, 7273, 6593, 6376, 5150,
-    4421, 3618, 2523, 4188, 5275, 3469, 6209, 5459, 953,  947 },
-  { 786,  3510, 3161, 3162, 3435, 5439, 6415, 4784, 4467, 4232, 5708,
-    3775, 7437, 8362, 9398, 8331, 6300, 6049, 8740, 7748, 9508, 7139,
-    7232, 6528, 8257, 4296, 5180, 4497, 3755, 6329, 3620, 3050 },
-  { 2273, 1239, -1997, -385, 1641, 4987, 6332, 7869, 5742, 3115, 4523,
-    5739, 6076, 8184,  8936, 9733, 5577, 8872, 8635, 7679, 7192, 6961,
-    7586, 5022, 5256,  5107, 5842, 4127, 3898, 7191, 5184, 1097 },
-  { 2576, 3444,  4787, 3494,  4843, 5213, 7669, 6154, 6713, 5224, 6221,
-    8653, 10387, 9676, 10219, 9062, 6899, 4115, 6617, 7548, 7319, 5169,
-    6051, 6609,  6735, 3759,  6779, 3520, 5518, 4355, 4386, 3459 },
-  { 2457, 4623, 4686, 3390,  6167,  6776,  5546, 7755, 6678,  5831, 6667,
-    9797, 9222, 7728, 12319, 12899, 10764, 6383, 7947, 9907,  8225, 5677,
-    7690, 9312, 8324, 4971,  9288,  6616,  5448, 7180, 11014, 5709 },
-  { 3687,  5015,  5834,  5702,  6619,  6602,  6844, 8607,  10828, 10170, 9206,
-    11527, 10057, 10677, 11683, 11009, 10585, 8869, 7057,  9542,  8465,  11391,
-    6180,  10182, 5594,  5353,  8810,  7358,  7118, 10591, 10569, 7318 },
-  { 5659, 4619, 7090, 7819,  8483,  7258,  7446,  7530,  6847, 7424, 7586,
-    8261, 7644, 9373, 18173, 15351, 11259, 11899, 11787, 9977, 8370, 7422,
-    9853, 6375, 5873, 6503,  6194,  4792,  5082,  4563,  2192, 5942 },
-  { 3004,  6927,  6994,  7359,  7505,  10247, 9661,  8199,  7979,  8529, 9388,
-    12192, 11555, 12591, 10308, 10143, 12579, 12379, 11700, 12735, 6629, 10209,
-    9592,  11878, 10187, 7755,  7344,  4922,  6699,  8240,  7341,  8532 },
-  { 7590,  5795, 6512,  4587,  6933,  7660,  6141,  7410,  5605,  5542,  8790,
-    10597, 9438, 10999, 10270, 10028, 10678, 12591, 13767, 11933, 10966, 11898,
-    12452, 8305, 6352,  8621,  7598,  5409,  5869,  6860,  8606,  5371 },
-  { 7095,  7927,  9729,  11290, 10321, 9966,  8226,  10211, 12468, 10459, 10959,
-    12232, 12326, 11686, 11247, 13106, 15660, 16448, 13119, 14772, 14295, 13233,
-    11880, 9805,  8498,  5650,  3043,  5995,  9756,  6592,  8450,  6801 },
-  { 4251,  4844,  7130,  7033,  9742,  10794, 9341,  10350, 10410, 9188,  10907,
-    11059, 11547, 12685, 14995, 15511, 13256, 15229, 12788, 13792, 12937, 14179,
-    12355, 8519,  7767,  6376,  7293,  7706,  6134,  9392,  9423,  6656 },
-  { 5032,  6597,  8267,  6875,  10431, 9182,  11606, 9174,  9394,  10754, 10214,
-    11384, 11633, 14256, 11377, 11933, 13999, 14801, 12182, 12170, 12927, 10856,
-    13248, 9493,  6586,  7871,  8697,  7094,  8561,  9451,  7116,  4183 },
-  { 5550,  6479,  9188,  7562,  9126,  10236, 12984, 11667, 10146, 11981, 13257,
-    13227, 14228, 13278, 13571, 15730, 14696, 14740, 14122, 11230, 10186, 9795,
-    9766,  9187,  10707, 11612, 10594, 14651, 10618, 5465,  6640,  1085 },
-  { 6402,  8472,  7318,  8449,  9884,  8237,  11776, 12579, 8248,  9119,  10813,
-    12464, 14087, 14122, 13487, 15884, 15630, 16883, 13968, 15663, 13943, 14099,
-    13309, 12222, 11647, 10827, 11813, 9543,  10171, 10991, 8523,  7564 },
-  { 5558,  8716,  7398,  7003,  9081,  9234,  10389, 10222, 11602, 10189, 12165,
-    10551, 11676, 14110, 13499, 14107, 14297, 13673, 15239, 13669, 9564,  8809,
-    11609, 10482, 11688, 10885, 12257, 11025, 11490, 10586, 12134, 11499 },
-  { 5054,  7370,  10001, 8690,  6346,  7990,  10600, 10877, 13977, 14230, 13786,
-    11880, 13256, 15455, 14951, 12311, 15970, 16289, 14385, 13318, 10806, 16058,
-    14004, 14150, 15275, 14285, 15169, 15124, 14484, 15130, 14320, 13627 },
-  { 6472,  6714,  8422,  7520,  9468,  7309,  11310, 10173, 9680,  9775,  11809,
-    11641, 17217, 14973, 12511, 12431, 15565, 14706, 12653, 10736, 13799, 11984,
-    14576, 14406, 13494, 13775, 13748, 13952, 12627, 13551, 12343, 13637 },
-  { 5691,  6196,  6840,  5618,  8130,  5337,  10502, 11764, 12309, 11243, 12058,
-    14603, 15254, 13730, 12988, 16426, 16398, 18336, 14653, 12258, 13528, 12015,
-    13122, 12816, 13238, 14265, 15564, 14875, 14346, 16501, 14057, 14664 },
-  { 5142,  4576,  6578,  5068,  8343,  7665,  11649, 10611, 11541, 10331, 12078,
-    14129, 17221, 15930, 16224, 15649, 16231, 11200, 11389, 11572, 13476, 12629,
-    11861, 13013, 15114, 12486, 15663, 12735, 13401, 13979, 13507, 13952 },
-  { 6851,  5162,  6778,  6922,  8951,  5567,  10360, 9216,  7036,  5410, 10771,
-    13577, 12588, 10477, 10248, 14359, 15261, 13795, 12048, 11716, 9361, 6278,
-    8997,  10237, 14438, 12459, 12976, 13600, 13892, 11879, 13127, 13802 },
-  { 4195,  6070,  3151,  7247,  5889,  6549,  8672,  8715,  10338, 9229, 9026,
-    10246, 14651, 14345, 15001, 15116, 18364, 16684, 13657, 14718, 8840, 10437,
-    9581,  12367, 11264, 11291, 13002, 11111, 13027, 14172, 12590, 13651 },
-  { 3818, 4756,  8879,  6693,  4570,  8158,  7459,  7913,  5727,  9446,  10204,
-    8887, 11326, 14337, 13524, 13813, 13628, 15506, 11578, 13470, 12391, 8927,
-    9166, 9882,  10411, 11665, 8963,  12141, 11521, 10521, 15132, 15679 },
-  { 4425, 8428,  12163, 9947,  3396,  5526,  8133,  4898,  3913,  4891,  5711,
-    7034, 10657, 9932,  14435, 12716, 15058, 15501, 14937, 14530, 14536, 9746,
-    9923, 11968, 7869,  10734, 9735,  9164,  11842, 12786, 16768, 15073 },
-  { 7712,  9515,  10650, 9707,  6201,  9752,  8700,  10334, 9503,  13202, 9555,
-    9748,  12814, 13027, 13920, 12593, 14370, 14808, 13965, 14154, 12735, 7319,
-    12721, 10395, 7361,  8678,  12937, 10057, 9234,  14695, 14044, 13613 },
-  { 8309,  7528,  9323,  7254,  6829,  7276,  7831,  10824, 8851,  11605, 12763,
-    10865, 10153, 10736, 12379, 10799, 10370, 11817, 11734, 13290, 18692, 13378,
-    10209, 11690, 12616, 9779,  9257,  6142,  7818,  10903, 13276, 8893 },
-  { 5420,  5315,  7529,  7453, 9027,  9825,  7865,  9813,  6673, 6090,  7914,
-    10790, 11205, 11064, 9239, 11947, 12306, 12802, 11856, 9896, 10502, 9968,
-    12099, 11011, 11103, 9920, 10747, 12477, 10458, 8485,  8805, 10199 },
-  { 5275,  2169,  8448, 6454, 8077,  5060, 8189, 6133,  5673,  7424,  7993,
-    10659, 10836, 8138, 9347, 10570, 8447, 8359, 11071, 11453, 13480, 9521,
-    11755, 8294,  7308, 4637, 10781, 5515, 4843, 4737,  5330,  4893 },
-  { 4846,  5401,  5671, 3987,  6910,  8363,  10605, 9189,  9832, 11154, 11632,
-    10874, 12377, 9266, 12273, 10543, 10287, 10912, 10745, 9206, 8851,  8327,
-    11242, 8123,  7431, 10266, 8947,  6186,  4259,  -682,  -920, 3901 },
-  { 3634, 2920,  4925,  5515,  6626, 6450,  10063, 9047,  9880,  9577, 8277,
-    7582, 10044, 10186, 11630, 8182, 12589, 14249, 13236, 11328, 7042, 8880,
-    7868, 6442,  10067, 3096,  5190, 5874,  2890,  668,   1718,  2480 },
-  { 4732, 2901,  1056, 1878,  5356, 5406, 5212,  8538, 8974,  7742, 9588,
-    7933, 10867, 8487, 11203, 8392, 8301, 10070, 4166, 11993, 9436, 10071,
-    7464, 7158,  7848, 6669,  4825, 5838, 236,   3720, 562,   -1751 },
-  { 1899, 3004, 3605, 1918, 2347, 4957, 5010, 5918, 6020,  5972, 7291,
-    6820, 8455, 8985, 7833, 5877, 5796, 7048, 5548, 2886,  4467, 10008,
-    7443, 8399, 7314, 4277, 3852, 296,  -983, 1487, -2474, -7290 }
-};
-static int16_t default_ncobmc_krnl_2_1_0[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 4140, 3361, 5678, 1978,  3443, 3453, 2905, 2131, 4836, 2612, 1530,
-    -831, -257, 584,  -1193, -391, 107,  -47,  32,   125,  282,  684,
-    161,  23,   -22,  -95,   555,  -405, 569,  -268, -92,  105 },
-  { 4680, 4183, 4456, 4730, 4264, 4681, 2310, 2034, 3081, 2493, 2012,
-    1397, 1521, -881, -976, -668, -606, -768, -273, 256,  -4,   -290,
-    64,   -55,  -444, -989, -316, -496, 206,  -169, -158, -87 },
-  { 3199, 3846,  3775, 632,  2359, 3492, 3355, 53,   -1201, 145,  263,
-    -93,  -1435, 415,  -844, 954,  -241, -483, -165, -191,  -561, -185,
-    -300, -258,  -154, -654, 308,  -64,  -36,  -150, 95,    146 },
-  { 680,  2863, 889,  1721, 3444, 2472,  -27,  2458, 816,  -186, 123,
-    3214, 2029, 2485, -631, 323,  1030,  -275, 196,  -532, -537, 153,
-    274,  61,   -453, -283, -533, -1062, -145, -388, 158,  0 },
-  { 1962, 4004, 1406, -535, 1315, 2669, 2522, 654, 3394, 4205, 2731,
-    -40,  -118, 599,  -511, 618,  162,  840,  43,  253,  -59,  222,
-    64,   -21,  -671, -179, 241,  283,  902,  226, 305,  -204 },
-  { 516,  1205, 3201, -5,   1479, 945,  2129, -628, 3181, 900, 1439,
-    1128, 799,  -158, -431, 347,  -118, 527,  389,  268,  -73, 2,
-    534,  133,  -287, -19,  561,  329,  394,  -120, 38,   -461 },
-  { 2130, 2022, 1966, 210, 447,  402,  1249, 1677, 2353, 1113, 1723,
-    1300, 2060, -144, 420, 2008, -417, -74,  -197, 135,  217,  310,
-    152,  339,  -99,  -81, 279,  44,   54,   -160, -82,  4 },
-  { 2134, -1849, -990, -93,  1932, 2119, 2954, -371, -1021, -831, 1662,
-    1330, 1634,  246,  -777, 852,  130,  -67,  191,  -316,  -429, -240,
-    -147, -198,  92,   -15,  310,  141,  -10,  146,  35,    85 },
-  { 2763, 4779, 994, 1054, 2625, 2031, 1784, -161, 1142, 1052, 2300,
-    2462, 1943, 516, 816,  27,   18,   171,  158,  -311, -636, 20,
-    -463, -235, 145, 339,  240,  -354, -110, 41,   404,  353 },
-  { 3625, 3557, 2333, 950,  2020, 2445, 2562, 1506, 2571, 1559, 4781,
-    2030, 1325, 2507, 2045, 1896, -526, -22,  -272, -143, -189, 17,
-    10,   405,  143,  414,  -95,  -229, -215, 0,    -347, 83 },
-  { 2808, 1062, 1502, 411, 1139, 998, 1577, 1233, 1637, 998,  1846,
-    2487, 3868, 2225, 533, -51,  -6,  -180, -30,  186,  -175, 247,
-    352,  57,   83,   290, 330,  160, 165,  354,  -465, 131 },
-  { 2809, 2966, 2929, 1435, 2875, 1948, 130,  1168, 252,  1276, 2838,
-    3507, 3001, 1410, 312,  1941, -336, -431, -190, -194, -130, -336,
-    238,  75,   -472, -189, 123,  61,   -583, 147,  305,  200 },
-  { -23,  2306, 2169, 33,   1848, 1832, 2721, 49,  1435, 585, 1036,
-    2116, 1658, 1011, 815,  920,  101,  108,  262, 299,  283, 357,
-    268,  141,  -71,  -285, 205,  142,  -71,  224, 252,  156 },
-  { 1447, 2625, 4643, 2096, -847, -154, 2876, 1050, 104,  -873, -327,
-    146,  -596, 622,  -337, 1317, -61,  9,    -201, 110,  90,   644,
-    337,  204,  155,  278,  320,  -306, -504, 357,  -108, 132 },
-  { -16, 2815, 1344, -2044, 2236, -549, 586,  409, 30,  152,  1588,
-    243, -115, 291,  -30,   -170, -96,  -10,  433, 205, -134, 17,
-    528, -16,  -22,  -198,  -43,  -143, -224, 270, 153, 37 },
-  { 1478, 829,  628, 1055, 1323, -406, -282, -12,  418,  40,  -795,
-    -286, -627, -41, -448, 454,  -267, -258, -129, -57,  -44, -406,
-    -260, -67,  134, -196, -236, -125, 35,   -62,  -137, -5 },
-  { 220,  26,  -380, -257, -90,  -453, -196, -56,  -193, 37,   131,
-    151,  -88, -695, 66,   -113, -200, -144, 132,  -48,  -244, -207,
-    -178, 268, -107, -1,   69,   337,  -84,  -197, 87,   119 },
-  { 7,    3,   -85,  -185, 334,  -86, -69, 152, -320, -239, 587,
-    415,  246, 290,  -146, -134, -9,  -69, -66, -148, -41,  -206,
-    -148, 283, -144, -287, -73,  93,  -23, 247, 398,  174 },
-  { 46,  -256, -114, -61,  -532, 103,  32,   -223, 24,   -20,  132,
-    339, 61,   -381, -711, -160, -200, -334, 78,   173,  -281, -139,
-    -27, 134,  -120, 96,   110,  -251, -114, -32,  -299, -183 },
-  { -193, 28,  -134, 200,  155,  -316, -363, 285,  268, 665, 233,
-    -127, 436, -20,  -536, -163, 51,   -40,  162,  78,  -27, 192,
-    -34,  -40, -17,  -205, 203,  106,  -62,  -211, -84, 60 },
-  { -440, 312, -195, 221,  251, -388, -116, -252, -101, 92,  -244,
-    -694, -27, 198,  -3,   255, -257, -17,  0,    143,  -20, 48,
-    -68,  110, -130, -340, 136, -45,  -138, 251,  -111, -2 },
-  { 325,  219,  -68,  215,  -177, -206, 14,   108,  -291, 211, 92,
-    -62,  -166, -218, -158, -220, -279, 199,  113,  -263, 271, 153,
-    -433, -16,  19,   -322, -28,  258,  -295, -300, -285, -123 },
-  { -345, 543,  356, -541, -726, -205, -332, -397, -10, -132, 232,
-    132,  308,  324, 229,  79,   -151, 161,  143,  -40, -144, -464,
-    32,   -364, -11, -99,  -285, 61,   -258, 182,  -28, 107 },
-  { -55, 70,   -78,  -269, -709, -52,  351,  94,   80,  268, 249,
-    -56, 189,  -191, -60,  -88,  15,   -205, 111,  -62, 21,  85,
-    77,  -107, -35,  -13,  -107, -472, -546, -197, 5,   115 },
-  { -363, -297, 246,  -84, -419, -230, 283,  -128, 34,   -27, 112,
-    125,  166,  163,  176, -422, 14,   -238, -80,  -153, 313, -366,
-    -208, -54,  -260, 48,  -176, 21,   -91,  -295, -270, 40 },
-  { 85,   242,  107,  -41,  -283, -390, -105, 360, 181,  -720, -582,
-    27,   -96,  -350, -217, -189, -135, -12,  280, 86,   3,    25,
-    -126, -213, -384, 41,   -15,  101,  -68,  143, -211, 86 },
-  { -183, 13,  274,  -46, -86,  -633, 181,  -232, -90, -106, -22,
-    332,  -12, -16,  -30, 87,   5,    46,   37,   -99, 27,   292,
-    -74,  -94, -237, -16, -145, 76,   -106, 227,  -52, 168 },
-  { 40,  -258, -140, -6,   203,  146,  -64, -88, -183, 221,  62,
-    67,  114,  -216, -307, -560, -197, -46, 149, -126, -120, -316,
-    -36, -227, -200, 115,  -41,  -51,  97,  123, -47,  103 },
-  { -51, 44,  -99,  -230, -156, -46, -145, -412, -56,  48, -239,
-    222, 83,  -339, -196, -64,  175, 149,  -140, -316, 6,  -62,
-    -27, -56, -21,  -269, 229,  -7,  122,  -18,  -129, 86 },
-  { -372, 106, 18,  172,  364,  19,  -245, -73,  -124, 164, -9,
-    14,   214, -67, -217, -175, -45, 119,  -194, 36,   18,  -83,
-    126,  196, 112, -297, -102, 104, -74,  -152, 19,   199 },
-  { 314,  81,  -49,  -188, 48,  -82, -4,   107, -221, -4,  207,
-    -245, 197, -37,  -185, -50, -56, -214, 100, -231, -31, -2,
-    21,   -53, -215, -77,  168, -23, 82,   5,   155,  169 },
-  { 258, 188, -27,  -27,  165,  29,  -17,  100, -27, -80, -80,
-    196, 23,  -391, -533, -171, 84,  -137, 0,   14,  251, 99,
-    35,  88,  -28,  1,    144,  -96, -235, 176, 103, -85 }
-};
-static int16_t default_ncobmc_krnl_2_1_1[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 5724, 6155, 5101, 6937, 3616, 3940, 3066, 5662, 7104, 5021, 4979,
-    5907, 4968, 7085, 6582, 7719, 9143, 4128, 6447, 4879, 7061, 11362,
-    7837, 9965, 7152, 6477, 6581, 5803, 1819, 5309, 8559, 10776 },
-  { 1775, 3231, 4026, 2629, 4438, 6309, 5114, 2895, 5657, 6541, 6734,
-    5994, 7468, 4555, 9911, 5200, 5402, 1698, 4298, 6112, 6417, 6691,
-    4816, 6195, 4139, 5856, 3358, 1993, 1542, 661,  1660, 4762 },
-  { 1953, 726,  336,  2519, 4189, -753, 2993, 4957, 5850, 4298, 3651,
-    5353, 3255, 5491, 7815, 3406, 3928, 2987, 4148, 4276, 3530, 8058,
-    5079, 5821, 4622, 3354, 3146, 2460, 489,  1550, 1587, 1399 },
-  { -801, 328,  103,  886,  1381, 2280, 4320, 2452, 1215, 6261, 2206,
-    4849, 4488, 3829, 6128, 5213, 1739, 3173, 4425, 4567, 5845, 5197,
-    5910, 6147, 4260, 3730, 4240, 5420, 307,  672,  963,  3278 },
-  { -1721, -2596, -155, 3029, 3428, 2390, 2321, 3757, 1383, -1283, -1621,
-    1418,  2475,  4188, 5570, 3575, 799,  4017, 2856, 1426, 2012,  2722,
-    3669,  4104,  3800, 4116, 3275, 3739, 326,  95,   2421, 3075 },
-  { -551, -927, -520, 2944, 2518, -722, -215, 1875, 137,  2182, 2761,
-    159,  762,  3693, 1681, 2600, 880,  3273, 4470, 5007, 4272, 3074,
-    2474, 4254, 6828, 4219, 3671, 2407, 1044, 129,  -478, 2814 },
-  { -2686, -1229, 1372, 4761, 4668, 1462, 509,  2727, 930,  2438, 3542,
-    1456,  1961,  541,  1063, 1426, 3603, 2873, 2412, 2999, 2101, 3739,
-    2385,  5494,  5444, 5655, 5034, 381,  321,  90,   2585, 4160 },
-  { -4203, 479,  1122, 2688, 2124, 942,  -2136, -1643, -491, 2581, -2155,
-    -2375, 559,  582,  2202, 2081, 3774, 3330,  1101,  894,  3410, 3691,
-    2509,  5195, 6226, 5471, 5022, 2525, 778,   1212,  2736, 3350 },
-  { -2415, -2903, 4719, 5860, 4006, 2692, 4035, 4143, 2498, 4377, 2058,
-    488,   1429,  3199, -11,  2009, 2087, 2903, 155,  522,  4521, 2221,
-    2310,  3124,  2870, 1941, 3262, 2258, 1515, 2257, 1584, 1048 },
-  { -1469, -2652, -561,  2135, 389,  -522, -589, 447,  -847, 268,  -1641,
-    -1540, -1513, -1334, -599, -581, 2848, 2828, 1416, 2157, 2198, 925,
-    2421,  1437,  1963,  369,  2195, -548, 2051, 868,  824,  2683 },
-  { -2620, -3631, -4548, -885, 629, 523,  -528, -2178, -1743, 1644, 353,
-    -2687, -3041, -1722, 283,  178, 1594, 1190, 968,   -386,  2305, 1317,
-    245,   1443,  968,   800,  471, 521,  1564, 669,   903,   243 },
-  { -1791, -3282, -4140, -1753, -1006, -374, 1027,  -176,  -1477, -891, 191,
-    -912,  497,   96,    359,   1045,  1467, 172,   1303,  2510,  3516, 3671,
-    789,   -807,  2670,  1483,  547,   -521, -1219, -1856, 1008,  1053 },
-  { -1427, -2698, -3949, -436, 801,  -614, -1548, 523,  -176, -683, 423,
-    -871,  820,   -2279, -143, 375,  768,  2306,  5249, 1302, -338, -396,
-    -1590, -608,  1469,  2344, -187, -693, 599,   -661, -458, 160 },
-  { -3491, -3877, -2952, 1252, 767,   -3037, -3638, 188, 587,  710,  1416,
-    1176,  -319,  -473,  1873, -1997, 725,   596,   -94, 1875, 2992, -519,
-    -139,  1938,  1025,  521,  760,   1090,  3648,  392, 564,  902 },
-  { -2186, -3264, -1742, 2634, -36,  -51,  -1253, -314, -908, -459, -1701,
-    -1437, -991,  84,    1265, -964, 402,  1454,  -772, -927, 1765, 1543,
-    484,   2346,  3310,  1887, 1754, 3058, 1474,  728,  -466, -1646 },
-  { -1826, -332, 48,   744,  -618, -97, -165, -155, -908,  -143, 1285,
-    1739,  1185, 885,  1134, -531, -15, -526, 543,  1438,  2026, 3022,
-    558,   1827, -139, 1792, 2022, 769, 2400, 444,  -1572, 598 },
-  { 165,  -357, 15,  666, 1315, 1155, 376,  -7,  991,  213,  1687,
-    -34,  452,  352, 203, 1605, 1484, -498, 581, 533,  467,  1744,
-    1315, 874,  82,  900, 1437, -692, -417, 456, -271, -1132 },
-  { 646, 210,   320,  1208, 145,  971,   396, -448, 557, 1876, -1791,
-    913, -1288, -452, 1015, 925,  -1197, -49, -285, 442, 1093, -410,
-    125, 519,   -52,  513,  1497, -1337, 298, -402, 820, 732 },
-  { -796, 627, -1017, 2972, 4463, 2331, 1387, 1496, 1796, 1608, 1681,
-    -877, 881, -160,  -581, -433, 949,  471,  307,  140,  -946, -597,
-    247,  650, 1143,  694,  10,   -682, 890,  409,  617,  810 },
-  { 1653, 4435,  2388,  294,  2578, 1229, 1072, 1871, 465,  1650, 1524,
-    -430, -1195, -3427, -116, 1117, 217,  967,  -254, 259,  -55,  1425,
-    1583, -1261, -1773, 1232, 2886, 646,  1346, 1518, 2090, -837 },
-  { 2020, 728,   2038,  316, 5725, 4193, 890,  1490, 584,  2705, 694,
-    -892, 34,    2041,  972, 332,  -295, -218, -756, 2193, 1672, 1440,
-    2310, -2136, -2204, 399, -753, 743,  3155, 2521, 3534, 166 },
-  { 824,  1664, 991,  853,  700,  -80,   148, -908, -194, -620, 1053,
-    -368, 1616, 1250, 1449, 3140, -1065, 286, 2226, -590, -570, -1131,
-    477,  -61,  -708, 519,  586,  1148,  898, 1653, 4697, 1581 },
-  { 2014, 1921, -210, 556,  686,  -561, -1239, -1345, -664,  -138, -215,
-    -343, 1019, 1294, 519,  -179, 212,  -299,  -2160, -1450, -329, 293,
-    691,  162,  -645, 1079, 2005, 1466, 1127,  2263,  730,   179 },
-  { 5629, 4670, 597,  2030, 3873, 3698, 54,   2714, 62,   352,   2177,
-    908,  1306, 1504, 1464, -288, -106, -69,  -179, -900, -1340, -4,
-    877,  487,  2606, 358,  2055, 1131, 1421, 931,  -477, 1173 },
-  { 757,  -493, 1510, 2513, 4514, 4649, -478, 2069, 124, -1186, 2855,
-    1906, 1420, 1738, 19,   1916, 1195, -519, 32,   512, 230,   528,
-    43,   -263, 1314, 1350, 137,  -256, 939,  256,  168, -201 },
-  { 663, 947,  699,  3239, 4730, 5279, 1739, 1659, 2774,  -1660, -1677,
-    185, 3745, 1319, 2347, 477,  364,  531,  608,  -520,  -783,  -123,
-    -59, -345, 1202, 1766, 88,   883,  654,  1399, -1082, 658 },
-  { 4534, 5694, 5332, 4909, 4828, 4761, 7376, 3834, 2327, 4737, 7135,
-    5306, 6337, 5240, 5578, 4321, 2107, -205, 1387, 597,  1112, 904,
-    1567, 610,  461,  371,  250,  602,  358,  1807, -617, -59 },
-  { 6124, 8363, 9624, 5674, 7043, 4437, 3846, 3121, 3477, 2818, 5445,
-    3618, 5067, 3996, 5759, 7185, 2150, 785,  1581, 2084, 3321, 4828,
-    -545, 510,  2309, 2501, 1594, 2028, 528,  113,  248,  550 },
-  { 8154,  9890, 6292, 6421, 8295, 4403, 7503, 5496, 7256, 3699, 2845,
-    3725,  5365, 5905, 7170, 2903, 733,  4614, 3856, 4346, 7099, -902,
-    -1492, 1703, 2321, 1842, 3488, 1690, 982,  524,  -467, -687 },
-  { 5338, 10331, 7754, 7014, 3581, 5660, 5471, 5420, 3976, 2548, 6486,
-    9144, 6584,  5442, 6795, 4845, 5182, 2855, 8246, 3660, 5417, 1845,
-    1803, 288,   1434, 639,  1404, 2752, 923,  1055, 741,  -984 },
-  { 4457, 7110, 5195, 5959, 6818, 8562, 5548, 2071, 5544, 8734, 7080,
-    4737, 9481, 7672, 8374, 7638, 4204, 3562, 3758, 3598, 5016, 2863,
-    3927, 5001, 4677, 4444, 2481, 1773, 2525, 3142, 4840, 3965 },
-  { 1134, 3249, 4702, 5483, 4471, 7234, 7281, 6240, 5891, 7577, 3826,
-    5886, 4798, 7117, 6319, 7264, 4115, 5613, 4674, 4999, 4518, 2501,
-    6830, 4913, 2356, 789,  1926, 2190, 1914, 1434, 987,  1761 }
-};
-static int16_t default_ncobmc_krnl_2_1_2[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 6131, 7769, 6548, 6297, 4967, 4708, 3127, 5937, 697,  748,  1850,
-    2290, 2945, -80,  216,  377,  318,  1009, 2112, 2962, -886, 849,
-    510,  4160, 2257, 2875, 4589, 5345, 7363, 5350, 6815, 1644 },
-  { 6949, 8044, 7295, 7318, 3142, 2084, 1819, 3048, 1654, 1831, 1344,
-    3344, 2065, 2889, -88,  3746, 696,  1143, 232,  1444, 1587, 4125,
-    3991, 3840, 5642, 4933, 3560, 6540, 5865, 6663, 6729, 5520 },
-  { 7816, 4894, 7089, 7533, 4271, 6814, 1972, 3845,  3755, 3498, 3571,
-    1884, 3171, 1843, 70,   2358, 2622, 1241, 143,   2657, 3804, 2968,
-    1781, 262,  2864, 4345, 1302, 5434, 7815, 10560, 9211, 8202 },
-  { 10656, 7490, 8639, 7975, 4318, 7432, 6148,  3321, 3776, 2781, 3544,
-    246,   2350, 793,  1600, 1266, 2372, -1382, -983, 1926, 493,  447,
-    2275,  3510, 4789, 3766, 878,  2353, 3314,  6282, 5853, 3709 },
-  { 11083, 7270, 6211, 6170, 4927, 4198, 3939, 4605, 1734, 2009, 2950,
-    546,   722,  99,   550,  597,  2350, 41,   1314, 1148, -183, 1143,
-    5392,  3550, 3102, 1161, -556, 1700, 7598, 8412, 6019, 9654 },
-  { 10358, 7350, 6589, 5975, 3587, 6201, 4603, 3974, 2262, 886,  1815,
-    1899,  1642, 2894, 1557, 228,  1625, 1879, 838,  182,  919,  1168,
-    3272,  1155, 889,  2292, 128,  4478, 5205, 7668, 8767, 10921 },
-  { 8569, 4702, 5397, 5147, 2577, 4301, 2139, 1630, 721,  1721, -218,
-    1595, 275,  1133, 1051, -777, 1556, -245, 972,  106,  2205, 385,
-    1410, 366,  3348, 2139, -164, 3111, 2656, 5036, 6021, 4847 },
-  { 7654, 5535, 5975, 4580, 3005, 5483, 4637, 5560, 6252, 4946, 4508,
-    3600, 1824, 1528, 338,  131,  1290, 309,  344,  3110, 3607, 2484,
-    1062, 1267, 1426, -860, 1155, 6137, 2415, 5482, 6846, 4916 },
-  { 8060,  5296,  4396, 2040, 867,  1189, 3555, 3397, 3438, 664,  -1931,
-    -1938, -1414, 1317, 762,  -312, -655, -801, -243, 2795, 1663, 1314,
-    1478,  2856,  562,  1075, 3211, 7482, 2988, 3880, 4156, 3289 },
-  { 8146, 7596, 7056,  7622, 5755, 7181, 7862, 4736, 4932, 3146, 1043,
-    -422, -813, -2152, 1444, 441,  3599, 395,  2173, 755,  4245, 3047,
-    1545, 1062, 1159,  1621, 209,  6521, 7385, 7730, 6511, 8959 },
-  { 9567,  8044, 7535, 6969, 3284, 4284, 4734, 4758, 5177, 2342, 230,
-    -1852, -839, -769, 222,  255,  -315, -16,  1101, -28,  3561, 2004,
-    -260,  789,  1856, 1960, 4962, 4207, 2425, 8406, 6771, 7796 },
-  { 8019,  7612,  8357,  5521, 4711,  3374, 4391, 7093, 5013, 3608, 238,
-    -1564, -1662, -1373, -198, -1045, 100,  2694, 1251, 489,  2110, 1670,
-    188,   -1362, 953,   2340, 3361,  3595, 6405, 7676, 1634, 7730 },
-  { 10177, 6488, 5822, 5121, 2615,  2725, 3372, 4849, 2232, 2548, 2841,
-    874,   895,  307,  1293, -150,  411,  -981, -815, -24,  936,  -2339,
-    254,   3019, 5892, 4302, -2171, 6747, 7198, 5638, 4832, 9538 },
-  { 7260,  9945, 2818, 1106, 6179, 6331, 5106, 1814, 5997, 4045, 1456,
-    -230,  297,  1045, 1918, -126, 752,  1014, 999,  -506, 198,  -732,
-    -1900, 139,  749,  3999, 5614, 5241, 6339, 8316, 3673, 7681 },
-  { 11101, 6954, 7475,  5729, 4242, 6118, 4569, 2348, 5307, 3762, 2933,
-    -1610, 988,  -1178, -104, -151, -507, 491,  -906, 1236, 3075, 1525,
-    1631,  2901, 2758,  1303, 1578, 6405, 3807, 7189, 8468, 9262 },
-  { 6835, 4602, 5501, 5568, 4338, 6143, 4304, 3557, 3258, 3797, 1242,
-    968,  1683, -251, 1218, 301,  1257, 1924, 985,  1251, 3051, 433,
-    1756, 167,  -660, 3884, 3450, 7202, 6544, 5184, 7556, 9366 },
-  { 5991, 6762, 3854, 4856, 6714, 5701, 4072, 2489, 422,  -365, 1488,
-    1660, 725,  1157, -778, 654,  313,  -18,  3162, 3065, 2925, 2391,
-    827,  5547, 461,  2487, 1492, 5810, 7042, 5284, 3995, 6870 },
-  { 6435, 8283, 4732, 5896, 5599, 4229, 4798, 3309, 3128, 941,  2565,
-    394,  257,  2477, 721,  1494, 3161, 1409, 1306, 2534, 1261, 2719,
-    756,  4388, 570,  5416, 3719, 6067, 4092, 2565, 6299, 10504 },
-  { 6042, 7417, 5391, 4671, 3245, 7547,  3777,  3203, 2044, 583,  2083,
-    1971, 1721, 1948, -169, 1197, -1141, -480,  2155, 1033, 1313, 268,
-    1857, 4493, 3083, 2005, 5347, 4397,  10144, 4828, 6622, 9817 },
-  { 7202, 5045, 6601, 6937, 3704, 5796, 5061, 3575, 2383, 1389, 3111,
-    1751, 1603, 2813, 174,  706,  -569, 2620, 1735, 1418, 1871, -1542,
-    168,  2156, 5107, 6329, 4968, 7018, 6279, 6864, 5898, 9157 },
-  { 5722, 5683, 4189, 4814, 2883, 5508, 5100, 1625, 2169, 3680, 1884,
-    2109, 462,  1145, 334,  515,  191,  441,  1058, 917,  1528, -96,
-    1843, 5395, 4498, 5681, 4193, 5196, 8356, 5303, 7262, 10141 },
-  { 5879, 5779,  7257, 3873, 6911, 6238, 5672,  3583, 3261, 3048, 2536,
-    -310, -1046, -69,  -660, 417,  -719, -2058, 1740, 888,  2746, 1367,
-    1668, 1090,  1830, 1153, 5047, 7336, 3380,  7160, 4422, 9401 },
-  { 7809, 7945, 8385, 8535, 7803, 3953, 5065, 3185,  2013,  1659, 1648,
-    769,  292,  -135, 114,  -579, 713,  1407, -1181, 1569,  3525, 5630,
-    219,  3518, 3739, 3432, 7282, 6357, 619,  5779,  10116, 6448 },
-  { 9496,  7224, 5342, 5960, 5092,  4225, 4353, 3995, 3631, 1662, 1413,
-    762,   534,  126,  -551, -1025, 2327, 602,  -452, 1285, 2103, 2579,
-    -1369, 2724, 6353, 3925, 4631,  9139, 4974, 6630, 7755, 4125 },
-  { 5226, 7729, 5768,  5815, 4531, 2948, 3029,  2603, 2549, 1366, 119,
-    405,  21,   -1831, -327, -287, -415, -1317, -214, 3017, 1586, 2436,
-    868,  1094, 290,   668,  2117, 756,  1228,  2700, 5743, 8052 },
-  { 6262, 5531, 4454, 4616, 3913, 2022, 4240, 2241, 4201, 2506, 1810,
-    628,  -496, -779, -471, 394,  756,  1666, -445, 490,  575,  -478,
-    894,  1182, 822,  626,  1782, 1781, 5333, 5482, 1760, 8187 },
-  { 6488,  6875,  4960, 6837,  4564, 1871, 390,  2940, 4330, 1634, 131,
-    -1102, -1451, -928, -1067, -419, -614, -2,   1017, 1066, 1051, 917,
-    1097,  844,   465,  513,   2377, 1031, 3548, 5088, 4516, 10564 },
-  { 6497, 6047,  5649, 7156, 4974, 3683, 2875, 4421, 1502, 1244, 668,
-    -30,  -1465, -59,  -399, -721, 954,  -281, -2,   664,  1039, 814,
-    758,  1911,  319,  4247, 1848, 1606, 2536, 2189, 1372, 7759 },
-  { 5994, 5659,  6777, 6693, 4758, 2986, 1463, 1186, 2116, -166, 499,
-    73,   -1151, -164, 279,  -895, -169, 339,  1194, 1772, 752,  1649,
-    1696, -2615, 1581, 1740, 1789, 1832, 1899, 510,  2135, 7149 },
-  { 9107,  4250, 5418, 4334,  613,   2618, 3395, 4809, 1724, 873, -78,
-    -1146, -431, -547, -1104, -1128, -6,   -290, 945,  794,  564, 1670,
-    737,   4540, 1574, 6285,  2596,  2859, 1191, 1428, 5614, 8419 },
-  { 5905, 4490, 6470,  3636, 2119,  1731, 3532, 2461, 2391, 473,  176,
-    -562, 389,  -1300, -916, -1436, 371,  567,  1038, 866,  59,   195,
-    679,  -721, 2994,  3260, 1813,  1589, 850,  1982, 7410, 11546 },
-  { 7265, 8775, 6672, 6657, 6182, 3732, 3222, 4564, 2644, 790,  924,
-    -596, 628,  -681, -57,  -236, 103,  364,  603,  1420, 309,  787,
-    1257, 770,  2453, 3401, 1175, 434,  792,  4019, 8792, 11773 }
-};
-static int16_t default_ncobmc_krnl_2_1_3[MAX_SB_SIZE][MAX_SB_SIZE] = {
-  { 391,  -894, -939, 1155,  4362, 4297, 7296,  2684, 3758, 8010, 8044,
-    9041, 8748, 8816, 10796, 8701, 6840, 11306, 7814, 8456, 9952, 3511,
-    7870, 2227, 7018, 7148,  4672, 5660, 6657,  6007, 1098, 3866 },
-  { 2970, 945,  619,  1701, 4540, 3326,  7140,  8401,  6001, 5524, 6311,
-    5657, 5333, 9833, 7547, 8127, 10894, 14326, 12130, 8591, 8408, 5873,
-    7524, 6398, 7054, 6594, 9788, 8347,  8784,  9253,  8154, 6170 },
-  { 3423, 6928,  5192, 5699, 5575,  6852,  8083,  7546,  8019, 8464, 8910,
-    9251, 11401, 8637, 9356, 9671,  10065, 12652, 12275, 9662, 9627, 5550,
-    9836, 10565, 9075, 9350, 11656, 8549,  8120,  4437,  5501, 6658 },
-  { 5859, 5714, 6766, 5830, 7266,  4208,  5956,  8173,  10615, 7557,  10533,
-    8101, 7530, 9292, 9312, 9603,  11268, 14896, 12761, 10435, 10584, 10602,
-    7945, 6677, 7798, 9184, 11805, 9688,  12921, 9831,  9425,  9409 },
-  { 5068,  7732,  8953,  7750,  6739,  7145,  7635,  7400,  9896,  11465, 12344,
-    14483, 13309, 11497, 10778, 11614, 13096, 11519, 12197, 13573, 14652, 12324,
-    7270,  8764,  10162, 11289, 13446, 10681, 7564,  7663,  7650,  3879 },
-  { 6073,  8775,  7134, 7485,  8815,  9982,  9893,  11182, 10807, 12415, 10385,
-    13211, 13198, 9974, 13590, 13229, 14029, 10733, 10710, 10950, 11286, 12150,
-    10133, 10858, 8958, 9903,  12033, 9177,  9756,  8710,  8055,  3108 },
-  { 8368,  10916, 7650,  6261,  8713,  10236, 12507, 10373, 12385, 11135, 11343,
-    12039, 12114, 14871, 13861, 13742, 11649, 13839, 13207, 13160, 11863, 11950,
-    12423, 10188, 7712,  8705,  11270, 12864, 13370, 11422, 7881,  7390 },
-  { 10805, 12233, 10301, 9238,  9352,  7871,  10959, 12870, 11641, 9692, 12373,
-    13839, 12380, 14055, 14653, 13348, 11227, 12844, 14769, 12714, 9815, 10484,
-    12966, 10123, 8644,  11791, 9911,  7598,  13225, 9539,  6774,  8055 },
-  { 7987,  9257,  6281,  7446,  8911,  10506, 7039,  9031,  9319,  10294, 13979,
-    15391, 14445, 11372, 14852, 14690, 14954, 14129, 16319, 13385, 10855, 12837,
-    13065, 10647, 12815, 13043, 9686,  7003,  12028, 10211, 10237, 11699 },
-  { 6073,  7893,  7571,  5698,  8244,  7305,  6581,  9719,  9746,  11432, 12215,
-    16346, 17408, 17379, 13508, 14637, 10471, 13204, 13089, 13632, 10135, 12397,
-    12431, 13511, 13140, 13999, 14081, 10639, 7173,  7807,  9433,  4659 },
-  { 6634,  10941, 11920, 9920,  11356, 10608, 10624, 12593, 11330, 11413, 13971,
-    18455, 16400, 16654, 15373, 16023, 15144, 15413, 14357, 16626, 10718, 12841,
-    16053, 14104, 13496, 13334, 10605, 11490, 12221, 6956,  9178,  8213 },
-  { 7366,  9121,  9253,  11198, 9839,  11458, 10864, 8319,  12656, 12437, 13128,
-    15378, 14565, 16278, 15940, 14457, 15156, 13972, 14035, 13587, 10888, 11376,
-    15176, 18483, 13236, 12754, 12347, 13247, 11785, 10432, 13455, 7419 },
-  { 7665,  10318, 12372, 11702, 11166, 12470, 11859, 10983, 12921, 13947, 12106,
-    14300, 13037, 17367, 14444, 15259, 15107, 14974, 11715, 14835, 15525, 18775,
-    17479, 13835, 9101,  10034, 18554, 10201, 8666,  11181, 11767, 6530 },
-  { 11169, 7696,  11879, 11938, 10302, 13271, 12067, 13360, 9715,  12528, 13879,
-    15312, 17012, 15194, 12951, 17211, 14989, 14796, 15695, 14942, 13140, 17003,
-    18104, 14131, 14490, 11607, 9697,  10346, 6890,  7337,  12248, 7668 },
-  { 7494,  9902,  9327,  10081, 9955,  10895, 12521, 13971, 11975, 12950, 13579,
-    19214, 16537, 17208, 15292, 17698, 16633, 14485, 17676, 15920, 11698, 13314,
-    13747, 11163, 10360, 13396, 13119, 7073,  11331, 8217,  8258,  8754 },
-  { 9934,  11319, 10239, 9047,  11387, 10784, 12566, 13038, 13663, 12717, 14675,
-    14008, 14178, 15820, 14510, 16181, 15440, 15283, 15009, 13767, 11372, 13359,
-    14352, 14480, 17066, 10914, 11175, 8554,  7428,  10827, 10561, 6443 },
-  { 10016, 9986,  12912, 11133, 8475,  9995,  12150, 14006, 15182, 16531, 13117,
-    14634, 15313, 15598, 16928, 14269, 14814, 17080, 12532, 12849, 13261, 12479,
-    14442, 9716,  15960, 13029, 13398, 10927, 9854,  10849, 12580, 10547 },
-  { 9295,  7913,  11422, 9455,  10319, 11278, 11274, 13394, 13038, 13821, 15044,
-    14686, 17187, 14091, 14823, 14137, 14455, 15111, 15447, 13582, 14076, 14295,
-    15643, 11185, 16015, 10747, 11235, 11551, 12009, 13990, 8881,  5003 },
-  { 11095, 8615,  12138, 8821,  9239,  6419,  11207, 11937, 12556, 14236, 12501,
-    14976, 13740, 15006, 17876, 15826, 16800, 16761, 13880, 15072, 16296, 16857,
-    14333, 11125, 12310, 13605, 10932, 12928, 5472,  11185, 9435,  5957 },
-  { 7725,  6887,  7535,  8957,  9967,  9700,  10640, 10680, 13275, 12682, 11517,
-    15207, 15552, 17018, 16856, 14725, 16692, 12845, 14748, 14656, 14606, 16310,
-    14672, 15510, 13069, 9039,  8315,  8606,  8826,  8214,  8487,  7999 },
-  { 9071,  9686,  10375, 11046, 7539,  7106,  10540, 13531, 13747, 9927,  14071,
-    15876, 15935, 13026, 15104, 15296, 16773, 16198, 16098, 13165, 13227, 15002,
-    12319, 13015, 14240, 10673, 12818, 10497, 5016,  8298,  5706,  6088 },
-  { 9366,  8741,  8215,  11450, 8961,  10464, 10575, 13631, 13635, 13752, 12735,
-    17169, 16010, 15438, 15786, 13083, 18481, 17990, 12316, 16370, 13953, 16000,
-    14693, 15392, 15242, 15049, 10809, 7658,  12399, 7866,  7570,  5544 },
-  { 6903,  5972,  7864,  7864,  8655,  13231, 12904, 14949, 15064, 15007, 14738,
-    15847, 14769, 14910, 15543, 17103, 15630, 15115, 19594, 16319, 13352, 10936,
-    15453, 13064, 13305, 12008, 7408,  8514,  14898, 8171,  5583,  9657 },
-  { 1309,  4431,  10551, 8701,  8152,  8547,  11642, 9601,  12635, 14116, 12560,
-    14796, 14370, 14959, 15558, 17801, 14148, 16067, 16927, 16084, 15633, 13749,
-    16805, 13274, 7467,  12136, 9815,  6584,  10514, 9020,  9109,  10981 },
-  { 10778, 9464,  8877,  8157,  7779,  9056,  13584, 11871, 13714, 16259, 13305,
-    13956, 14785, 16328, 16541, 15199, 15586, 18478, 16668, 13019, 14279, 13814,
-    15684, 15613, 15050, 14345, 14327, 15869, 14316, 13744, 10738, 8497 },
-  { 9411,  9691,  11139, 8582,  8038,  9492,  10534, 12154, 9249,  16286, 16839,
-    15572, 13252, 16207, 14760, 15743, 15428, 14223, 15971, 16378, 16607, 16993,
-    15698, 15766, 14771, 13969, 14551, 13631, 10451, 9360,  15908, 7460 },
-  { 5565,  3814,  5832,  4698,  7091,  10412, 8442,  9852,  9831,  10137, 9167,
-    11864, 11520, 12092, 11930, 12431, 14914, 16568, 13978, 14847, 14215, 14290,
-    13812, 15033, 15711, 15541, 13908, 14681, 12577, 9266,  12542, 5718 },
-  { 3740,  2245,  1259,  3575,  4190,  8150,  9742,  8948,  11592, 12108, 10225,
-    12748, 12684, 12687, 11339, 10475, 13481, 15937, 14669, 13780, 12167, 11074,
-    16225, 14201, 13966, 9544,  12974, 12797, 13248, 13990, 14819, 7995 },
-  { 2296,  817,   3435,  3505,  3507,  9072,  7580,  10139, 7087,  12821, 13297,
-    12396, 12113, 10999, 9149,  14466, 15677, 11290, 11487, 10612, 8552,  15725,
-    16233, 17367, 12511, 13088, 10898, 12875, 13386, 15384, 14845, 9849 },
-  { 2320,  1714,  3209,  4858,  11853, 8126,  7775,  6246,  10834, 12812, 9996,
-    8379,  10020, 11558, 10914, 12851, 11272, 13723, 7409,  11919, 10393, 12987,
-    13756, 11382, 13258, 9754,  12513, 10697, 14356, 14065, 10023, 8748 },
-  { 5715,  4721,  4773,  6968, 7426,  6196,  7322,  11771, 8704,  7198,  8944,
-    12478, 6336,  10064, 9132, 10252, 11884, 12483, 11504, 12168, 11346, 13354,
-    11779, 12178, 8942,  8770, 11937, 13047, 12938, 11277, 4002,  710 },
-  { 7743,  4184,  5058,  4276,  5576,  5393,  5919,  5500,  7881, 8102,  11726,
-    10912, 10943, 10344, 10654, 9537,  12118, 10565, 11112, 9964, 11328, 13005,
-    8273,  10626, 11596, 12198, 13157, 13884, 13912, 10737, 6497, 2938 }
-};
-
-void get_default_ncobmc_kernels(AV1_COMMON *cm) {
-  av1_copy(cm->ncobmc_kernels[0][0].KERNEL[0], default_ncobmc_krnl_0_0_0);
-  av1_copy(cm->ncobmc_kernels[0][0].KERNEL[1], default_ncobmc_krnl_0_0_1);
-  av1_copy(cm->ncobmc_kernels[0][0].KERNEL[2], default_ncobmc_krnl_0_0_2);
-  av1_copy(cm->ncobmc_kernels[0][0].KERNEL[3], default_ncobmc_krnl_0_0_3);
-  av1_copy(cm->ncobmc_kernels[0][1].KERNEL[0], default_ncobmc_krnl_0_1_0);
-  av1_copy(cm->ncobmc_kernels[0][1].KERNEL[1], default_ncobmc_krnl_0_1_1);
-  av1_copy(cm->ncobmc_kernels[0][1].KERNEL[2], default_ncobmc_krnl_0_1_2);
-  av1_copy(cm->ncobmc_kernels[0][1].KERNEL[3], default_ncobmc_krnl_0_1_3);
-  av1_copy(cm->ncobmc_kernels[1][0].KERNEL[0], default_ncobmc_krnl_1_0_0);
-  av1_copy(cm->ncobmc_kernels[1][0].KERNEL[1], default_ncobmc_krnl_1_0_1);
-  av1_copy(cm->ncobmc_kernels[1][0].KERNEL[2], default_ncobmc_krnl_1_0_2);
-  av1_copy(cm->ncobmc_kernels[1][0].KERNEL[3], default_ncobmc_krnl_1_0_3);
-  av1_copy(cm->ncobmc_kernels[1][1].KERNEL[0], default_ncobmc_krnl_1_1_0);
-  av1_copy(cm->ncobmc_kernels[1][1].KERNEL[1], default_ncobmc_krnl_1_1_1);
-  av1_copy(cm->ncobmc_kernels[1][1].KERNEL[2], default_ncobmc_krnl_1_1_2);
-  av1_copy(cm->ncobmc_kernels[1][1].KERNEL[3], default_ncobmc_krnl_1_1_3);
-  av1_copy(cm->ncobmc_kernels[2][0].KERNEL[0], default_ncobmc_krnl_2_0_0);
-  av1_copy(cm->ncobmc_kernels[2][0].KERNEL[1], default_ncobmc_krnl_2_0_1);
-  av1_copy(cm->ncobmc_kernels[2][0].KERNEL[2], default_ncobmc_krnl_2_0_2);
-  av1_copy(cm->ncobmc_kernels[2][0].KERNEL[3], default_ncobmc_krnl_2_0_3);
-  av1_copy(cm->ncobmc_kernels[2][1].KERNEL[0], default_ncobmc_krnl_2_1_0);
-  av1_copy(cm->ncobmc_kernels[2][1].KERNEL[1], default_ncobmc_krnl_2_1_1);
-  av1_copy(cm->ncobmc_kernels[2][1].KERNEL[2], default_ncobmc_krnl_2_1_2);
-  av1_copy(cm->ncobmc_kernels[2][1].KERNEL[3], default_ncobmc_krnl_2_1_3);
-}
diff --git a/av1/common/ncobmc_kernels.h b/av1/common/ncobmc_kernels.h
deleted file mode 100644
index 358b7b7..0000000
--- a/av1/common/ncobmc_kernels.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2016, Alliance for Open Media. All rights reserved
- *
- * This source code is subject to the terms of the BSD 2 Clause License and
- * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
- * was not distributed with this source code in the LICENSE file, you can
- * obtain it at www.aomedia.org/license/software. If the Alliance for Open
- * Media Patent License 1.0 was not distributed with this source code in the
- * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- */
-
-#include <stdio.h>
-#include "av1/common/enums.h"
-#include "av1/common/onyxc_int.h"
-#include "av1/common/common.h"
-
-#ifndef AV1_COMMON_NCOBMC_KERNELS_H_
-#define AV1_COMMON_NCOBMC_KERNELS_H_
-
-void get_default_ncobmc_kernels(AV1_COMMON *cm);
-
-#endif  // AV1_COMMON_NCOBMC_KERNELS_H_
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index ddc7208..24686c2 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -523,10 +523,6 @@
 #if CONFIG_ANS && ANS_MAX_SYMBOLS
   int ans_window_size_log2;
 #endif
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  NCOBMC_KERNELS ncobmc_kernels[ADAPT_OVERLAP_BLOCKS][ALL_NCOBMC_MODES];
-  uint8_t *ncobmcaw_buf[4];
-#endif
 #if CONFIG_LV_MAP
   LV_MAP_CTX_TABLE coeff_ctx_table;
 #endif
diff --git a/av1/common/reconinter.c b/av1/common/reconinter.c
index 4175e85..e6aff66 100644
--- a/av1/common/reconinter.c
+++ b/av1/common/reconinter.c
@@ -2295,30 +2295,6 @@
 }
 #endif  // CONFIG_NCOBMC
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-void reset_xd_boundary(MACROBLOCKD *xd, int mi_row, int bh, int mi_col, int bw,
-                       int mi_rows, int mi_cols) {
-  xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8);
-  xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8;
-  xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8);
-  xd->mb_to_right_edge = ((mi_cols - bw - mi_col) * MI_SIZE) * 8;
-}
-void set_sb_mi_boundaries(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
-                          const int mi_row, const int mi_col) {
-  const BLOCK_SIZE sb = cm->sb_size;
-  const int num_mi_w = mi_size_wide[sb];
-  const int num_mi_h = mi_size_high[sb];
-
-  xd->sb_mi_bd.mi_col_begin = mi_col;
-  xd->sb_mi_bd.mi_row_begin = mi_row;
-  // points to the last mi
-  xd->sb_mi_bd.mi_col_end =
-      mi_col + num_mi_w > cm->mi_cols ? cm->mi_cols - 1 : mi_col + num_mi_w - 1;
-  xd->sb_mi_bd.mi_row_end =
-      mi_row + num_mi_h > cm->mi_rows ? cm->mi_rows - 1 : mi_row + num_mi_h - 1;
-}
-#endif
-
 /* clang-format off */
 #if CONFIG_EXT_PARTITION
 static const int ii_weights1d[MAX_SB_SIZE] = {
@@ -2775,690 +2751,3 @@
         ext_dst1[plane], ext_dst_stride1[plane]);
   }
 }
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-
-void alloc_ncobmc_pred_buffer(MACROBLOCKD *const xd) {
-  int i;
-  // allocate interpolated prediction buffer
-  for (i = 0; i < MAX_MB_PLANE; ++i) {
-    xd->ncobmc_pred_buf[i] = (uint8_t *)malloc(sizeof(uint8_t) * MAX_SB_SQUARE);
-    av1_zero_array(xd->ncobmc_pred_buf[i], MAX_SB_SQUARE);
-    xd->ncobmc_pred_buf_stride[i] = MAX_SB_SIZE;
-  }
-}
-
-void free_ncobmc_pred_buffer(MACROBLOCKD *const xd) {
-  for (int i = 0; i < MAX_MB_PLANE; ++i) free(xd->ncobmc_pred_buf[i]);
-}
-
-void get_pred_from_intrpl_buf(MACROBLOCKD *xd, int mi_row, int mi_col,
-                              BLOCK_SIZE bsize, int plane) {
-  uint8_t *dst = xd->plane[plane].dst.buf;
-  int ds = xd->plane[plane].dst.stride;
-  int ss_x = xd->plane[plane].subsampling_x;
-  int ss_y = xd->plane[plane].subsampling_y;
-
-  const int ip_wide = mi_size_wide[bsize] * MI_SIZE >> ss_x;
-  const int ip_high = mi_size_high[bsize] * MI_SIZE >> ss_y;
-  // relative coordinates of this MI in the superblock
-  int row_rlt = (mi_row - xd->sb_mi_bd.mi_row_begin) * MI_SIZE >> ss_y;
-  int col_rlt = (mi_col - xd->sb_mi_bd.mi_col_begin) * MI_SIZE >> ss_x;
-  int s = xd->ncobmc_pred_buf_stride[plane];
-  int r, c;
-
-  for (r = 0; r < ip_high; ++r) {
-    for (c = 0; c < ip_wide; ++c) {
-      dst[r * ds + c] =
-          xd->ncobmc_pred_buf[plane][(r + row_rlt) * s + c + col_rlt];
-    }
-  }
-}
-// scaling factors for ncobmc kernels
-#define KERNEL_SCALE_LOG 14
-
-void build_ncobmc_intrpl_pred(const AV1_COMMON *const cm, MACROBLOCKD *xd,
-                              int plane, int pxl_row, int pxl_col,
-                              BLOCK_SIZE bsize, uint8_t *preds[][MAX_MB_PLANE],
-                              int stride[MAX_MB_PLANE],  // pred buffer strides
-                              int mode) {
-  const ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[bsize];
-  const NCOBMC_KERNELS *const knls = &cm->ncobmc_kernels[ao_block][mode];
-  const int wide = mi_size_wide[bsize] * MI_SIZE;
-  const int high = mi_size_high[bsize] * MI_SIZE;
-  const int s = stride[plane];
-  const int ss_x = xd->plane[plane].subsampling_x;
-  const int ss_y = xd->plane[plane].subsampling_y;
-  int row_offset = (pxl_row - xd->sb_mi_bd.mi_row_begin * MI_SIZE) >> ss_y;
-  int col_offset = (pxl_col - xd->sb_mi_bd.mi_col_begin * MI_SIZE) >> ss_x;
-  int dst_stride = xd->ncobmc_pred_buf_stride[plane];
-  int dst_offset = row_offset * dst_stride + col_offset;
-
-#if CONFIG_HIGHBITDEPTH
-  const int is_hbd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? 1 : 0;
-#else
-  const int is_hbd = 0;
-#endif  // CONFIG_HIGHBITDEPTH
-
-  int r, c, k_r, k_c;
-  int64_t tmp;
-
-  for (r = 0; r < (high >> ss_x); ++r) {
-    for (c = 0; c < (wide >> ss_y); ++c) {
-      int pos = r * s + c;
-      int q_tmp;
-      uint8_t val;
-
-      // TODO(weitinglin): find out the optimal sub-sampling patterns for
-      //                   chroma
-      k_r = (r << ss_y) + ss_y;
-      k_c = (c << ss_x) + ss_x;
-      if (ss_y && k_r >= high) k_r -= 1;
-      if (ss_x && k_c >= wide) k_c -= 1;
-
-      if (!is_hbd) {
-        uint8_t *tmp_p[4];
-        int i;
-        for (i = 0; i < 4; ++i) tmp_p[i] = preds[i][plane];
-
-        tmp = 0;
-        for (i = 0; i < 4; ++i)
-          tmp += knls->KERNEL[i][k_r][k_c] * tmp_p[i][pos];
-
-      } else {
-        uint16_t *tmp_p[4];
-        int i;
-        for (i = 0; i < 4; ++i) tmp_p[i] = CONVERT_TO_SHORTPTR(preds[i][plane]);
-
-        tmp = 0;
-        for (i = 0; i < 4; ++i)
-          tmp += knls->KERNEL[i][k_r][k_c] * tmp_p[i][pos];
-      }
-
-      q_tmp = (tmp <= 0) ? 0 : ROUND_POWER_OF_TWO(tmp, KERNEL_SCALE_LOG);
-      val = clip_pixel(q_tmp);
-
-      xd->ncobmc_pred_buf[plane][r * dst_stride + c + dst_offset] = val;
-
-      assert(r * dst_stride + c + dst_offset < MAX_SB_SQUARE);
-    }
-  }
-}
-
-void get_pred_by_horz_neighbor(const AV1_COMMON *cm, MACROBLOCKD *xd, int bsize,
-                               int mi_row, int mi_col,
-                               uint8_t *dst_buf[MAX_MB_PLANE],
-                               int dst_stride[MAX_MB_PLANE]) {
-  const TileInfo *const tile = &xd->tile;
-  const int mb_to_bottom_edge_base = xd->mb_to_bottom_edge;
-  const int mb_to_top_edge_base = xd->mb_to_top_edge;
-  const int mb_to_left_edge_base = xd->mb_to_left_edge;
-  const int mb_to_right_edge_base = xd->mb_to_right_edge;
-  int overlappable_offset = -1;
-  const int mi_nums = AOMMIN(mi_size_high[bsize], cm->mi_rows - mi_row);
-
-  int i, j, mi_step, ref;
-
-  xd->mb_to_right_edge += mi_size_wide[bsize] * MI_SIZE * 4;
-
-  // build from left neighbors
-  for (i = 0; i < mi_nums; i += mi_step) {
-    int mi_row_offset = i;
-    int mi_col_offset = -1;
-    int mi_x, mi_y, bw, bh;
-    MODE_INFO *left_mi;
-    MB_MODE_INFO *left_mbmi, backup_mbmi;
-    BLOCK_SIZE l_bsize;
-
-    // create the original prediction if offset exceeds the boundary
-    if (mi_col == 0 || (mi_col - 1 < tile->mi_col_start)) mi_col_offset = 0;
-
-    left_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-    left_mbmi = &left_mi->mbmi;
-    l_bsize = AOMMAX(left_mbmi->sb_type, BLOCK_8X8);
-
-    mi_step = AOMMIN(xd->n8_h, mi_size_high[l_bsize]);
-
-    // reset the mi if it is not overlappble
-    if (!is_neighbor_overlappable(left_mbmi)) {
-      // use left_mbmi->sb_type instead of l_bsize to handle
-      // sub8x8 cases
-      int search_mi_step = mi_size_high[left_mbmi->sb_type];
-      while (!is_neighbor_overlappable(left_mbmi)) {
-        mi_row_offset += search_mi_step;
-        if (mi_row_offset < mi_nums) {
-          left_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          left_mbmi = &left_mi->mbmi;
-          search_mi_step = mi_size_high[left_mbmi->sb_type];
-        } else {
-          if (overlappable_offset >= 0) {
-            mi_row_offset = overlappable_offset;
-          } else {
-            mi_row_offset = 0;
-            mi_col_offset = 0;
-          }
-          left_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          left_mbmi = &left_mi->mbmi;
-          break;
-        }
-      }
-    } else {
-      // update the available overlappable mi
-      overlappable_offset = mi_row_offset;
-    }
-
-    backup_mbmi = *left_mbmi;
-    modify_neighbor_predictor_for_obmc(left_mbmi);
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      struct macroblockd_plane *const pd = &xd->plane[j];
-      setup_pred_plane(&pd->dst, l_bsize, dst_buf[j], MAX_SB_SIZE, MAX_SB_SIZE,
-                       dst_stride[j], i, 0, NULL, pd->subsampling_x,
-                       pd->subsampling_y);
-    }
-#if CONFIG_COMPOUND_SINGLEREF
-    for (ref = 0; ref < 1 + (is_inter_anyref_comp_mode(left_mbmi->mode));
-         ++ref) {
-      const MV_REFERENCE_FRAME frame = has_second_ref(left_mbmi)
-                                           ? left_mbmi->ref_frame[ref]
-                                           : left_mbmi->ref_frame[0];
-#else   // !(CONFIG_COMPOUND_SINGLEREF)
-    for (ref = 0; ref < 1 + has_second_ref(left_mbmi); ++ref) {
-      const MV_REFERENCE_FRAME frame = left_mbmi->ref_frame[ref];
-#endif  // CONFIG_COMPOUND_SINGLEREF
-      const RefBuffer *const ref_buf = &cm->frame_refs[frame - LAST_FRAME];
-
-      xd->block_refs[ref] = ref_buf;
-      if ((!av1_is_valid_scale(&ref_buf->sf)))
-        aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_BITSTREAM,
-                           "Reference frame has invalid dimensions");
-      av1_setup_pre_planes(xd, ref, ref_buf->buf, mi_row + i, mi_col,
-                           &ref_buf->sf);
-    }
-    xd->mb_to_top_edge = -((mi_row + i) * MI_SIZE * 8);
-    xd->mb_to_bottom_edge =
-        mb_to_bottom_edge_base + (mi_nums - i - mi_step) * MI_SIZE * 8;
-    mi_x = mi_col << MI_SIZE_LOG2;
-    mi_y = (mi_row + i) << MI_SIZE_LOG2;
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      const struct macroblockd_plane *pd = &xd->plane[j];
-      bw = mi_size_wide[bsize] << (MI_SIZE_LOG2 - 1) >> pd->subsampling_x;
-      bh = (mi_step << MI_SIZE_LOG2) >> pd->subsampling_y;
-
-      build_inter_predictors(cm, xd, j, left_mi, 1, 0, bw, bh, 0, 0, bw, bh,
-                             mi_x, mi_y);
-    }
-    *left_mbmi = backup_mbmi;
-  }
-
-  // build from right neighbors
-  xd->mb_to_right_edge = mb_to_right_edge_base;
-  xd->mb_to_left_edge -= mi_size_wide[bsize] * MI_SIZE * 4;
-
-  overlappable_offset = -1;
-
-  for (i = 0; i < mi_nums; i += mi_step) {
-    int mi_row_offset = i;
-    int mi_col_offset = mi_size_wide[bsize];
-    int mi_x, mi_y, bw, bh;
-    int mi_col_shift = mi_size_wide[bsize] >> 1;
-    MODE_INFO *right_mi;
-    MB_MODE_INFO *right_mbmi, backup_mbmi;
-    BLOCK_SIZE r_bsize;
-
-    // create the original prediction if offset exceeds the boundary
-    if (mi_col + mi_col_offset > xd->sb_mi_bd.mi_col_end) mi_col_offset = 0;
-
-    right_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-    right_mbmi = &right_mi->mbmi;
-    r_bsize = AOMMAX(right_mbmi->sb_type, BLOCK_8X8);
-
-    mi_step = AOMMIN(mi_nums, mi_size_high[r_bsize]);
-
-    if (!is_neighbor_overlappable(right_mbmi)) {
-      int search_mi_step = mi_size_high[right_mbmi->sb_type];
-      while (!is_neighbor_overlappable(right_mbmi)) {
-        mi_row_offset += search_mi_step;
-        if (mi_row_offset < mi_nums) {
-          right_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          right_mbmi = &right_mi->mbmi;
-          search_mi_step = mi_size_high[right_mbmi->sb_type];
-        } else {
-          if (overlappable_offset >= 0) {
-            mi_row_offset = overlappable_offset;
-          } else {
-            mi_row_offset = 0;
-            mi_col_offset = 0;
-          }
-          right_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          right_mbmi = &right_mi->mbmi;
-          break;
-        }
-      }
-    } else {
-      overlappable_offset = mi_row_offset;
-    }
-
-    backup_mbmi = *right_mbmi;
-    modify_neighbor_predictor_for_obmc(right_mbmi);
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      struct macroblockd_plane *const pd = &xd->plane[j];
-      setup_pred_plane(&pd->dst, r_bsize, dst_buf[j], MAX_SB_SIZE, MAX_SB_SIZE,
-                       dst_stride[j], i, mi_col_shift, NULL, pd->subsampling_x,
-                       pd->subsampling_y);
-    }
-#if CONFIG_COMPOUND_SINGLEREF
-    for (ref = 0; ref < 1 + (is_inter_anyref_comp_mode(right_mbmi->mode));
-         ++ref) {
-      const MV_REFERENCE_FRAME frame = has_second_ref(right_mbmi)
-                                           ? right_mbmi->ref_frame[ref]
-                                           : right_mbmi->ref_frame[0];
-#else   // !(CONFIG_COMPOUND_SINGLEREF)
-    for (ref = 0; ref < 1 + has_second_ref(right_mbmi); ++ref) {
-      const MV_REFERENCE_FRAME frame = right_mbmi->ref_frame[ref];
-#endif  // CONFIG_COMPOUND_SINGLEREF
-      const RefBuffer *const ref_buf = &cm->frame_refs[frame - LAST_FRAME];
-      xd->block_refs[ref] = ref_buf;
-      if ((!av1_is_valid_scale(&ref_buf->sf)))
-        aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_BITSTREAM,
-                           "Reference frame has invalid dimensions");
-      av1_setup_pre_planes(xd, ref, ref_buf->buf, mi_row + i,
-                           mi_col + mi_col_shift, &ref_buf->sf);
-    }
-    xd->mb_to_top_edge = -((mi_row + i) * MI_SIZE * 8);
-    xd->mb_to_bottom_edge =
-        mb_to_bottom_edge_base + (mi_nums - i - mi_step) * MI_SIZE * 8;
-    mi_x = (mi_col + mi_col_shift) << MI_SIZE_LOG2;
-    mi_y = (mi_row + i) << MI_SIZE_LOG2;
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      const struct macroblockd_plane *pd = &xd->plane[j];
-      bw = mi_size_wide[bsize] << (MI_SIZE_LOG2 - 1) >> pd->subsampling_x;
-      bh = (mi_step << MI_SIZE_LOG2) >> pd->subsampling_y;
-
-      build_inter_predictors(cm, xd, j, right_mi, 1, 0, bw, bh, 0, 0, bw, bh,
-                             mi_x, mi_y);
-    }
-
-    *right_mbmi = backup_mbmi;
-  }
-
-  // restore the boundaries
-  xd->mb_to_top_edge = mb_to_top_edge_base;
-  xd->mb_to_bottom_edge = mb_to_bottom_edge_base;
-  xd->mb_to_left_edge = mb_to_left_edge_base;
-  xd->mb_to_right_edge = mb_to_right_edge_base;
-}
-
-void get_pred_by_vert_neighbor(const AV1_COMMON *cm, MACROBLOCKD *xd, int bsize,
-                               int mi_row, int mi_col,
-                               uint8_t *dst_buf[MAX_MB_PLANE],
-                               int dst_stride[MAX_MB_PLANE]) {
-  const TileInfo *const tile = &xd->tile;
-  const int mb_to_bottom_edge_base = xd->mb_to_bottom_edge;
-  const int mb_to_top_edge_base = xd->mb_to_top_edge;
-  const int mb_to_left_edge_base = xd->mb_to_left_edge;
-  const int mb_to_right_edge_base = xd->mb_to_right_edge;
-  int overlappable_offset = -1;
-  const int mi_nums = AOMMIN(mi_size_wide[bsize], cm->mi_cols - mi_col);
-
-  int i, j, mi_step, ref;
-
-  xd->mb_to_bottom_edge += mi_nums * MI_SIZE * 4;
-
-  // build from above neighbors
-  for (i = 0; i < mi_nums; i += mi_step) {
-    int mi_row_offset = -1;
-    int mi_col_offset = i;
-    int mi_x, mi_y, bw, bh;
-    MODE_INFO *above_mi;
-    MB_MODE_INFO *above_mbmi, backup_mbmi;
-    BLOCK_SIZE a_bsize;
-
-    // create the original prediction if offset exceeds the boundary
-    if (mi_row <= tile->mi_row_start) mi_row_offset = 0;
-
-    above_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-    above_mbmi = &above_mi->mbmi;
-    a_bsize = AOMMAX(above_mbmi->sb_type, BLOCK_8X8);
-
-    mi_step = AOMMIN(mi_nums, mi_size_high[a_bsize]);
-
-    // reset the mi if it is not overlappble
-    if (!is_neighbor_overlappable(above_mbmi)) {
-      int search_mi_step = mi_size_high[above_mbmi->sb_type];
-      // backward search
-      while (!is_neighbor_overlappable(above_mbmi)) {
-        mi_col_offset += search_mi_step;
-        if (mi_col_offset < mi_nums) {
-          above_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          above_mbmi = &above_mi->mbmi;
-          search_mi_step = mi_size_high[above_mbmi->sb_type];
-        } else {
-          if (overlappable_offset >= 0) {
-            mi_col_offset = overlappable_offset;
-          } else {
-            mi_row_offset = 0;
-            mi_col_offset = 0;
-          }
-          above_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          above_mbmi = &above_mi->mbmi;
-          break;
-        }
-      }
-    } else {
-      // update the available overlappable mi
-      overlappable_offset = mi_col_offset;
-    }
-
-    backup_mbmi = *above_mbmi;
-    modify_neighbor_predictor_for_obmc(above_mbmi);
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      struct macroblockd_plane *const pd = &xd->plane[j];
-      setup_pred_plane(&pd->dst, a_bsize, dst_buf[j], MAX_SB_SIZE, MAX_SB_SIZE,
-                       dst_stride[j], 0, i, NULL, pd->subsampling_x,
-                       pd->subsampling_y);
-    }
-#if CONFIG_COMPOUND_SINGLEREF
-    for (ref = 0; ref < 1 + (is_inter_anyref_comp_mode(above_mbmi->mode));
-         ++ref) {
-      const MV_REFERENCE_FRAME frame = has_second_ref(above_mbmi)
-                                           ? above_mbmi->ref_frame[ref]
-                                           : above_mbmi->ref_frame[0];
-#else   // !(CONFIG_COMPOUND_SINGLEREF)
-    for (ref = 0; ref < 1 + has_second_ref(above_mbmi); ++ref) {
-      const MV_REFERENCE_FRAME frame = above_mbmi->ref_frame[ref];
-#endif  // CONFIG_COMPOUND_SINGLEREF
-      const RefBuffer *const ref_buf = &cm->frame_refs[frame - LAST_FRAME];
-
-      xd->block_refs[ref] = ref_buf;
-      if ((!av1_is_valid_scale(&ref_buf->sf)))
-        aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_BITSTREAM,
-                           "Reference frame has invalid dimensions");
-      av1_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col + i,
-                           &ref_buf->sf);
-    }
-
-    xd->mb_to_left_edge = -(((mi_col + i) * MI_SIZE) * 8);
-    xd->mb_to_right_edge =
-        mb_to_right_edge_base + (mi_nums - i - mi_step) * MI_SIZE * 8;
-    mi_x = (mi_col + i) << MI_SIZE_LOG2;
-    mi_y = mi_row << MI_SIZE_LOG2;
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      const struct macroblockd_plane *pd = &xd->plane[j];
-
-      bh = mi_size_high[bsize] << (MI_SIZE_LOG2 - 1) >> pd->subsampling_x;
-      bw = (mi_step << MI_SIZE_LOG2) >> pd->subsampling_y;
-
-      build_inter_predictors(cm, xd, j, above_mi, 1, 0, bw, bh, 0, 0, bw, bh,
-                             mi_x, mi_y);
-    }
-
-    *above_mbmi = backup_mbmi;
-  }
-
-  // build from bottom neighbors
-  xd->mb_to_bottom_edge = mb_to_bottom_edge_base;
-  xd->mb_to_top_edge -= mi_size_high[bsize] * MI_SIZE * 4;
-
-  overlappable_offset = -1;
-
-  for (i = 0; i < mi_nums; i += mi_step) {
-    int mi_row_offset = mi_size_high[bsize];
-    int mi_col_offset = i;
-    int mi_x, mi_y, bw, bh;
-    int mi_row_shift = mi_size_high[bsize] >> 1;
-    MODE_INFO *bottom_mi;
-    MB_MODE_INFO *bottom_mbmi, backup_mbmi;
-    BLOCK_SIZE b_bsize;
-
-    // create the original prediction if offset exceeds the boundary
-    if (mi_row + mi_row_offset > xd->sb_mi_bd.mi_row_end) mi_row_offset = 0;
-
-    bottom_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-    bottom_mbmi = &bottom_mi->mbmi;
-    b_bsize = AOMMAX(bottom_mbmi->sb_type, BLOCK_8X8);
-
-    mi_step = AOMMIN(mi_nums, mi_size_high[b_bsize]);
-
-    // reset the mi if it is not overlappble
-    if (!is_neighbor_overlappable(bottom_mbmi)) {
-      int search_mi_step = mi_size_high[bottom_mbmi->sb_type];
-      while (!is_neighbor_overlappable(bottom_mbmi)) {
-        mi_col_offset += search_mi_step;
-        if (mi_col_offset < mi_nums) {
-          bottom_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          bottom_mbmi = &bottom_mi->mbmi;
-          search_mi_step = mi_size_high[bottom_mbmi->sb_type];
-        } else {
-          if (overlappable_offset >= 0) {
-            mi_col_offset = overlappable_offset;
-          } else {
-            mi_col_offset = 0;
-            mi_row_offset = 0;
-          }
-          bottom_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-          bottom_mbmi = &bottom_mi->mbmi;
-          break;
-        }
-      }
-    } else {
-      // update the available overlappable mi
-      overlappable_offset = mi_col_offset;
-    }
-
-    backup_mbmi = *bottom_mbmi;
-    modify_neighbor_predictor_for_obmc(bottom_mbmi);
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      struct macroblockd_plane *const pd = &xd->plane[j];
-      setup_pred_plane(&pd->dst, b_bsize, dst_buf[j], MAX_SB_SIZE, MAX_SB_SIZE,
-                       dst_stride[j], mi_row_shift, i, NULL, pd->subsampling_x,
-                       pd->subsampling_y);
-    }
-#if CONFIG_COMPOUND_SINGLEREF
-    for (ref = 0; ref < 1 + (is_inter_anyref_comp_mode(bottom_mbmi->mode));
-         ++ref) {
-      const MV_REFERENCE_FRAME frame = has_second_ref(bottom_mbmi)
-                                           ? bottom_mbmi->ref_frame[ref]
-                                           : bottom_mbmi->ref_frame[0];
-#else   // !(CONFIG_COMPOUND_SINGLEREF)
-    for (ref = 0; ref < 1 + has_second_ref(bottom_mbmi); ++ref) {
-      const MV_REFERENCE_FRAME frame = bottom_mbmi->ref_frame[ref];
-#endif  // CONFIG_COMPOUND_SINGLEREF
-      const RefBuffer *const ref_buf = &cm->frame_refs[frame - LAST_FRAME];
-      xd->block_refs[ref] = ref_buf;
-      if ((!av1_is_valid_scale(&ref_buf->sf)))
-        aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_BITSTREAM,
-                           "Reference frame has invalid dimensions");
-      av1_setup_pre_planes(xd, ref, ref_buf->buf, mi_row + mi_row_shift,
-                           mi_col + i, &ref_buf->sf);
-    }
-
-    xd->mb_to_left_edge = -(((mi_col + i) * MI_SIZE) * 8);
-    xd->mb_to_right_edge =
-        mb_to_right_edge_base + (mi_nums - i - mi_step) * MI_SIZE * 8;
-    mi_x = (mi_col + i) << MI_SIZE_LOG2;
-    mi_y = (mi_row + mi_row_shift) << MI_SIZE_LOG2;
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      const struct macroblockd_plane *pd = &xd->plane[j];
-
-      bh = mi_size_high[bsize] << (MI_SIZE_LOG2 - 1) >> pd->subsampling_x;
-      bw = (mi_step << MI_SIZE_LOG2) >> pd->subsampling_y;
-
-      build_inter_predictors(cm, xd, j, bottom_mi, 1, 0, bw, bh, 0, 0, bw, bh,
-                             mi_x, mi_y);
-    }
-
-    *bottom_mbmi = backup_mbmi;
-  }
-  // restore the boundaries
-  xd->mb_to_top_edge = mb_to_top_edge_base;
-  xd->mb_to_bottom_edge = mb_to_bottom_edge_base;
-  xd->mb_to_left_edge = mb_to_left_edge_base;
-  xd->mb_to_right_edge = mb_to_right_edge_base;
-}
-
-void get_pred_by_corner_neighbor(const AV1_COMMON *cm, MACROBLOCKD *xd,
-                                 int bsize, int mi_row, int mi_col,
-                                 uint8_t *dst_buf[MAX_MB_PLANE],
-                                 int dst_stride[MAX_MB_PLANE]) {
-  const TileInfo *const tile = &xd->tile;
-  const int mb_to_bottom_edge_base = xd->mb_to_bottom_edge;
-  const int mb_to_top_edge_base = xd->mb_to_top_edge;
-  const int mb_to_left_edge_base = xd->mb_to_left_edge;
-  const int mb_to_right_edge_base = xd->mb_to_right_edge;
-  const int mi_wide = mi_size_wide[bsize];
-  const int mi_high = mi_size_high[bsize];
-
-  // location of four mi sources
-  const int mi_row_offsets[4] = { -1, -1, mi_high, mi_high };
-  const int mi_col_offsets[4] = { -1, mi_wide, -1, mi_wide };
-
-  MB_MODE_INFO backup_mbmi;
-  int mi_x, mi_y, bh, bw;
-  int i, j, ref;
-
-  assert(bsize >= BLOCK_8X8);
-
-  for (i = 0; i < 4; ++i) {
-    int mi_row_offset = mi_row_offsets[i];
-    int mi_col_offset = mi_col_offsets[i];
-    MODE_INFO *corner_mi;
-    MB_MODE_INFO *corner_mbmi;
-
-    if (mi_col + mi_col_offset < tile->mi_col_start ||
-        mi_col + mi_col_offset > xd->sb_mi_bd.mi_col_end)
-      mi_col_offset = 0;
-
-    if (mi_row + mi_row_offset < tile->mi_row_start ||
-        mi_row + mi_row_offset > xd->sb_mi_bd.mi_row_end)
-      mi_row_offset = 0;
-
-    corner_mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-    corner_mbmi = &corner_mi->mbmi;
-
-    // reset the mi if it is not overlappble
-    if (!is_neighbor_overlappable(corner_mbmi)) {
-      mi_row_offset = 0;
-      mi_col_offset = 0;
-      corner_mi = xd->mi[0];
-      corner_mbmi = &corner_mi->mbmi;
-    }
-
-    backup_mbmi = *corner_mbmi;
-    modify_neighbor_predictor_for_obmc(corner_mbmi);
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      struct macroblockd_plane *const pd = &xd->plane[j];
-      setup_pred_plane(&pd->dst, BLOCK_8X8, dst_buf[j], MAX_SB_SIZE,
-                       MAX_SB_SIZE, dst_stride[j], (i / 2) * (mi_high >> 1),
-                       (i % 2) * (mi_wide >> 1), NULL, pd->subsampling_x,
-                       pd->subsampling_y);
-    }
-
-#if CONFIG_COMPOUND_SINGLEREF
-    for (ref = 0; ref < 1 + (is_inter_anyref_comp_mode(corner_mbmi->mode));
-         ++ref) {
-      const MV_REFERENCE_FRAME frame = has_second_ref(corner_mbmi)
-                                           ? corner_mbmi->ref_frame[ref]
-                                           : corner_mbmi->ref_frame[0];
-#else
-    for (ref = 0; ref < 1 + has_second_ref(corner_mbmi); ++ref) {
-      const MV_REFERENCE_FRAME frame = corner_mbmi->ref_frame[ref];
-#endif
-      const RefBuffer *const ref_buf = &cm->frame_refs[frame - LAST_FRAME];
-      xd->block_refs[ref] = ref_buf;
-
-      if ((!av1_is_valid_scale(&ref_buf->sf)))
-        aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_BITSTREAM,
-                           "Reference frame has invalid dimensions");
-      av1_setup_pre_planes(xd, ref, ref_buf->buf,
-                           mi_row + (i / 2) * (mi_high >> 1),
-                           mi_col + (i % 2) * (mi_wide >> 1), &ref_buf->sf);
-    }
-    // adjust mi boundaries of this block
-    xd->mb_to_bottom_edge =
-        mb_to_bottom_edge_base + (1 - (i / 2)) * mi_high * MI_SIZE * 4;
-    xd->mb_to_top_edge = mb_to_top_edge_base - (i / 2) * mi_high * MI_SIZE * 4;
-    xd->mb_to_right_edge =
-        mb_to_right_edge_base + (1 - (i % 2)) * mi_wide * MI_SIZE * 4;
-    xd->mb_to_left_edge =
-        mb_to_left_edge_base - (i % 2) * mi_wide * MI_SIZE * 4;
-
-    mi_x = (mi_col + (i % 2) * mi_wide / 2) << MI_SIZE_LOG2;
-    mi_y = (mi_row + (i / 2) * mi_high / 2) << MI_SIZE_LOG2;
-
-    for (j = 0; j < MAX_MB_PLANE; ++j) {
-      const struct macroblockd_plane *pd = &xd->plane[j];
-      bh = mi_high << MI_SIZE_LOG2 >> (pd->subsampling_x + 1);
-      bw = mi_wide << MI_SIZE_LOG2 >> (pd->subsampling_y + 1);
-      build_inter_predictors(cm, xd, j, corner_mi, 1, 0, bw, bh, 0, 0, bw, bh,
-                             mi_x, mi_y);
-    }
-    *corner_mbmi = backup_mbmi;
-  }
-  // restore the boundaries
-  xd->mb_to_bottom_edge = mb_to_bottom_edge_base;
-  xd->mb_to_top_edge = mb_to_top_edge_base;
-  xd->mb_to_right_edge = mb_to_right_edge_base;
-  xd->mb_to_left_edge = mb_to_left_edge_base;
-}
-
-// get the stitched extra prediction for this block
-void av1_get_ext_blk_preds(const AV1_COMMON *cm, MACROBLOCKD *xd, int bsize,
-                           int mi_row, int mi_col,
-                           uint8_t *dst_buf[][MAX_MB_PLANE],
-                           int dst_stride[MAX_MB_PLANE]) {
-  get_pred_by_corner_neighbor(cm, xd, bsize, mi_row, mi_col, dst_buf[0],
-                              dst_stride);
-  get_pred_by_vert_neighbor(cm, xd, bsize, mi_row, mi_col, dst_buf[1],
-                            dst_stride);
-  get_pred_by_horz_neighbor(cm, xd, bsize, mi_row, mi_col, dst_buf[2],
-                            dst_stride);
-}
-
-void av1_get_ori_blk_pred(const AV1_COMMON *cm, MACROBLOCKD *xd, int bsize,
-                          int mi_row, int mi_col,
-                          uint8_t *dst_buf[MAX_MB_PLANE],
-                          int dst_stride[MAX_MB_PLANE]) {
-  MODE_INFO *const mi = xd->mi[0];
-  MB_MODE_INFO *const mbmi = &mi->mbmi;
-  int mi_x = mi_col << MI_SIZE_LOG2;
-  int mi_y = mi_row << MI_SIZE_LOG2;
-  int bw = block_size_wide[bsize];
-  int bh = block_size_high[bsize];
-  int i, ref;
-
-  for (i = 0; i < MAX_MB_PLANE; ++i) {
-    struct macroblockd_plane *const pd = &xd->plane[i];
-    setup_pred_plane(&pd->dst, BLOCK_8X8, dst_buf[i], MAX_SB_SIZE, MAX_SB_SIZE,
-                     dst_stride[i], 0, 0, NULL, pd->subsampling_x,
-                     pd->subsampling_y);
-  }
-
-  for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
-    const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
-    const RefBuffer *const ref_buf = &cm->frame_refs[frame - LAST_FRAME];
-    xd->block_refs[ref] = ref_buf;
-
-    if (!av1_is_valid_scale(&ref_buf->sf))
-      aom_internal_error(xd->error_info, AOM_CODEC_UNSUP_BITSTREAM,
-                         "Reference frame has invalid dimensions");
-
-    av1_setup_pre_planes(xd, ref, ref_buf->buf, mi_row, mi_col, &ref_buf->sf);
-  }
-
-  for (i = 0; i < MAX_MB_PLANE; ++i) {
-    const struct macroblockd_plane *pd = &xd->plane[i];
-    build_inter_predictors(
-        cm, xd, i, mi, 1, 0, bw >> pd->subsampling_x, bh >> pd->subsampling_y,
-        0, 0, bw >> pd->subsampling_x, bh >> pd->subsampling_y, mi_x, mi_y);
-  }
-}
-
-#endif
diff --git a/av1/common/reconinter.h b/av1/common/reconinter.h
index 2b42a8d..441fe79 100644
--- a/av1/common/reconinter.h
+++ b/av1/common/reconinter.h
@@ -560,45 +560,6 @@
                                               uint8_t *ext_dst1[3],
                                               int ext_dst_stride1[3]);
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-#define ASSIGN_ALIGNED_PTRS(p, a, s) \
-  p[0] = a;                          \
-  p[1] = a + s;                      \
-  p[2] = a + 2 * s;
-
-#define ASSIGN_ALIGNED_PTRS_HBD(p, a, s, l) \
-  p[0] = CONVERT_TO_BYTEPTR(a);             \
-  p[1] = CONVERT_TO_BYTEPTR(a + s * l);     \
-  p[2] = CONVERT_TO_BYTEPTR(a + 2 * s * l);
-
-void alloc_ncobmc_pred_buffer(MACROBLOCKD *const xd);
-void free_ncobmc_pred_buffer(MACROBLOCKD *const xd);
-void set_sb_mi_boundaries(const AV1_COMMON *const cm, MACROBLOCKD *const xd,
-                          const int mi_row, const int mi_col);
-
-void reset_xd_boundary(MACROBLOCKD *xd, int mi_row, int bh, int mi_col, int bw,
-                       int mi_rows, int mi_cols);
-
-void get_pred_from_intrpl_buf(MACROBLOCKD *xd, int mi_row, int mi_col,
-                              BLOCK_SIZE bsize, int plane);
-
-void build_ncobmc_intrpl_pred(const AV1_COMMON *const cm, MACROBLOCKD *xd,
-                              int plane, int pxl_row, int pxl_col,
-                              BLOCK_SIZE bsize, uint8_t *preds[][MAX_MB_PLANE],
-                              int ps[MAX_MB_PLANE],  // pred buffer strides
-                              int mode);
-
-void av1_get_ext_blk_preds(const AV1_COMMON *cm, MACROBLOCKD *xd, int bsize,
-                           int mi_row, int mi_col,
-                           uint8_t *dst_buf[][MAX_MB_PLANE],
-                           int dst_stride[MAX_MB_PLANE]);
-
-void av1_get_ori_blk_pred(const AV1_COMMON *cm, MACROBLOCKD *xd, int bsize,
-                          int mi_row, int mi_col,
-                          uint8_t *dst_buf[MAX_MB_PLANE],
-                          int dst_stride[MAX_MB_PLANE]);
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
 #ifdef __cplusplus
 }  // extern "C"
 #endif
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 29ef567..1d79c58 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -480,94 +480,6 @@
   aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
 }
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-static void set_mode_info_offsets(AV1_COMMON *const cm, MACROBLOCKD *const xd,
-                                  int mi_row, int mi_col) {
-  const int offset = mi_row * cm->mi_stride + mi_col;
-  xd->mi = cm->mi_grid_visible + offset;
-  xd->mi[0] = &cm->mi[offset];
-}
-
-static void get_ncobmc_recon(AV1_COMMON *const cm, MACROBLOCKD *xd, int mi_row,
-                             int mi_col, int bsize, int mode) {
-  uint8_t *pred_buf[4][MAX_MB_PLANE];
-  int pred_stride[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
-  // target block in pxl
-  int pxl_row = mi_row << MI_SIZE_LOG2;
-  int pxl_col = mi_col << MI_SIZE_LOG2;
-
-  int plane;
-#if CONFIG_HIGHBITDEPTH
-  if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
-    int len = sizeof(uint16_t);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[0], cm->ncobmcaw_buf[0], MAX_SB_SQUARE,
-                            len);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[1], cm->ncobmcaw_buf[1], MAX_SB_SQUARE,
-                            len);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[2], cm->ncobmcaw_buf[2], MAX_SB_SQUARE,
-                            len);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[3], cm->ncobmcaw_buf[3], MAX_SB_SQUARE,
-                            len);
-  } else {
-#endif  // CONFIG_HIGHBITDEPTH
-    ASSIGN_ALIGNED_PTRS(pred_buf[0], cm->ncobmcaw_buf[0], MAX_SB_SQUARE);
-    ASSIGN_ALIGNED_PTRS(pred_buf[1], cm->ncobmcaw_buf[1], MAX_SB_SQUARE);
-    ASSIGN_ALIGNED_PTRS(pred_buf[2], cm->ncobmcaw_buf[2], MAX_SB_SQUARE);
-    ASSIGN_ALIGNED_PTRS(pred_buf[3], cm->ncobmcaw_buf[3], MAX_SB_SQUARE);
-#if CONFIG_HIGHBITDEPTH
-  }
-#endif
-  av1_get_ext_blk_preds(cm, xd, bsize, mi_row, mi_col, pred_buf, pred_stride);
-  av1_get_ori_blk_pred(cm, xd, bsize, mi_row, mi_col, pred_buf[3], pred_stride);
-  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
-    build_ncobmc_intrpl_pred(cm, xd, plane, pxl_row, pxl_col, bsize, pred_buf,
-                             pred_stride, mode);
-  }
-}
-
-static void av1_get_ncobmc_recon(AV1_COMMON *const cm, MACROBLOCKD *const xd,
-                                 int bsize, const int mi_row, const int mi_col,
-                                 const NCOBMC_MODE modes) {
-  const int mi_width = mi_size_wide[bsize];
-  const int mi_height = mi_size_high[bsize];
-
-  assert(bsize >= BLOCK_8X8);
-
-  reset_xd_boundary(xd, mi_row, mi_height, mi_col, mi_width, cm->mi_rows,
-                    cm->mi_cols);
-  get_ncobmc_recon(cm, xd, mi_row, mi_col, bsize, modes);
-}
-
-static void recon_ncobmc_intrpl_pred(AV1_COMMON *const cm,
-                                     MACROBLOCKD *const xd, int mi_row,
-                                     int mi_col, BLOCK_SIZE bsize) {
-  MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
-  const int mi_width = mi_size_wide[bsize];
-  const int mi_height = mi_size_high[bsize];
-  const int hbs = AOMMAX(mi_size_wide[bsize] / 2, mi_size_high[bsize] / 2);
-  const BLOCK_SIZE sqr_blk = bsize_2_sqr_bsize[bsize];
-  if (mi_width > mi_height) {
-    // horizontal partition
-    av1_get_ncobmc_recon(cm, xd, sqr_blk, mi_row, mi_col, mbmi->ncobmc_mode[0]);
-    xd->mi += hbs;
-    av1_get_ncobmc_recon(cm, xd, sqr_blk, mi_row, mi_col + hbs,
-                         mbmi->ncobmc_mode[1]);
-  } else if (mi_height > mi_width) {
-    // vertical partition
-    av1_get_ncobmc_recon(cm, xd, sqr_blk, mi_row, mi_col, mbmi->ncobmc_mode[0]);
-    xd->mi += hbs * xd->mi_stride;
-    av1_get_ncobmc_recon(cm, xd, sqr_blk, mi_row + hbs, mi_col,
-                         mbmi->ncobmc_mode[1]);
-  } else {
-    av1_get_ncobmc_recon(cm, xd, sqr_blk, mi_row, mi_col, mbmi->ncobmc_mode[0]);
-  }
-  set_mode_info_offsets(cm, xd, mi_row, mi_col);
-  // restore dst buffer and mode info
-  av1_setup_dst_planes(xd->plane, bsize, get_frame_new_buffer(cm), mi_row,
-                       mi_col);
-}
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
 static void decode_token_and_recon_block(AV1Decoder *const pbi,
                                          MACROBLOCKD *const xd, int mi_row,
                                          int mi_col, aom_reader *r,
@@ -695,15 +607,6 @@
       av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
 #endif
     }
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-    if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT) {
-      int plane;
-      recon_ncobmc_intrpl_pred(cm, xd, mi_row, mi_col, bsize);
-      for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
-        get_pred_from_intrpl_buf(xd, mi_row, mi_col, bsize, plane);
-      }
-    }
-#endif
     // Reconstruction
     if (!mbmi->skip) {
       int eobtotal = 0;
@@ -2433,10 +2336,6 @@
 
         for (mi_col = tile_info.mi_col_start; mi_col < tile_info.mi_col_end;
              mi_col += cm->mib_size) {
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-          alloc_ncobmc_pred_buffer(&td->xd);
-          set_sb_mi_boundaries(cm, &td->xd, mi_row, mi_col);
-#endif
 #if CONFIG_SYMBOLRATE
           av1_record_superblock(td->xd.counts);
 #endif
@@ -2446,9 +2345,6 @@
           detoken_and_recon_sb(pbi, &td->xd, mi_row, mi_col, &td->bit_reader,
                                cm->sb_size);
 #endif
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-          free_ncobmc_pred_buffer(&td->xd);
-#endif
 #if CONFIG_LPF_SB
           if (USE_LOOP_FILTER_SUPERBLOCK) {
             // apply deblocking filtering right after each superblock is decoded
@@ -3493,10 +3389,6 @@
                  sizeof(cm->counts.compound_interinter)));
   assert(!memcmp(cm->counts.motion_mode, zero_counts.motion_mode,
                  sizeof(cm->counts.motion_mode)));
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  assert(!memcmp(cm->counts.ncobmc_mode, zero_counts.ncobmc_mode,
-                 sizeof(cm->counts.ncobmc_mode)));
-#endif
   assert(!memcmp(cm->counts.intra_inter, zero_counts.intra_inter,
                  sizeof(cm->counts.intra_inter)));
 #if CONFIG_COMPOUND_SINGLEREF
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 5dff0dc..b3bba59 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -278,7 +278,7 @@
 static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
                                     MODE_INFO *mi, aom_reader *r) {
   MB_MODE_INFO *mbmi = &mi->mbmi;
-#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NEW_MULTISYMBOL
   (void)cm;
 #endif
 
@@ -288,19 +288,7 @@
   FRAME_COUNTS *counts = xd->counts;
 
   if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return SIMPLE_TRANSLATION;
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  if (last_motion_mode_allowed == NCOBMC_ADAPT_WEIGHT) {
-    motion_mode = aom_read_symbol(r, xd->tile_ctx->ncobmc_cdf[mbmi->sb_type],
-                                  OBMC_FAMILY_MODES, ACCT_STR);
-    if (counts) ++counts->ncobmc[mbmi->sb_type][motion_mode];
-    return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
-  } else if (last_motion_mode_allowed == OBMC_CAUSAL) {
-    motion_mode =
-        aom_read_symbol(r, xd->tile_ctx->obmc_cdf[mbmi->sb_type], 2, ACCT_STR);
-    if (counts) ++counts->obmc[mbmi->sb_type][motion_mode];
-    return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
-  } else {
-#else
+
   if (last_motion_mode_allowed == OBMC_CAUSAL) {
 #if CONFIG_NEW_MULTISYMBOL
     motion_mode =
@@ -311,7 +299,6 @@
     if (counts) ++counts->obmc[mbmi->sb_type][motion_mode];
     return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
   } else {
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
     motion_mode =
         aom_read_symbol(r, xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
                         MOTION_MODES, ACCT_STR);
@@ -320,26 +307,6 @@
   }
 }
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-static void read_ncobmc_mode(MACROBLOCKD *xd, MODE_INFO *mi,
-                             NCOBMC_MODE ncobmc_mode[2], aom_reader *r) {
-  MB_MODE_INFO *mbmi = &mi->mbmi;
-  FRAME_COUNTS *counts = xd->counts;
-  ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[mbmi->sb_type];
-  if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT) return;
-
-  ncobmc_mode[0] = aom_read_symbol(r, xd->tile_ctx->ncobmc_mode_cdf[ao_block],
-                                   MAX_NCOBMC_MODES, ACCT_STR);
-  if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[0]];
-
-  if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
-    ncobmc_mode[1] = aom_read_symbol(r, xd->tile_ctx->ncobmc_mode_cdf[ao_block],
-                                     MAX_NCOBMC_MODES, ACCT_STR);
-    if (counts) ++counts->ncobmc_mode[ao_block][ncobmc_mode[1]];
-  }
-}
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
 static PREDICTION_MODE read_inter_compound_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
                                                 aom_reader *r, int16_t ctx) {
   (void)cm;
@@ -2523,10 +2490,6 @@
   if (mbmi->ref_frame[1] != INTRA_FRAME)
     mbmi->motion_mode = read_motion_mode(cm, xd, mi, r);
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  read_ncobmc_mode(xd, mi, mbmi->ncobmc_mode, r);
-#endif
-
 #if CONFIG_COMPOUND_SINGLEREF
   if (is_singleref_comp_mode) assert(mbmi->motion_mode == SIMPLE_TRANSLATION);
 #endif  // CONFIG_COMPOUND_SINGLEREF
diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c
index 5d31b3c..f9425a5 100644
--- a/av1/decoder/decoder.c
+++ b/av1/decoder/decoder.c
@@ -33,9 +33,6 @@
 
 #include "av1/decoder/decodeframe.h"
 #include "av1/decoder/decoder.h"
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-#include "av1/common/ncobmc_kernels.h"
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
 #include "av1/decoder/detokenize.h"
 
 static void initialize_dec(void) {
@@ -118,10 +115,6 @@
 
   av1_loop_filter_init(cm);
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  get_default_ncobmc_kernels(cm);
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
 #if CONFIG_AOM_QM
   aom_qm_init(cm);
 #endif
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 03ab38e..4924f0c 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -405,13 +405,6 @@
       motion_mode_allowed(0, cm->global_motion, xd, mi);
   switch (last_motion_mode_allowed) {
     case SIMPLE_TRANSLATION: break;
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-    case NCOBMC_ADAPT_WEIGHT:
-      aom_write_symbol(w, mbmi->motion_mode,
-                       xd->tile_ctx->ncobmc_cdf[mbmi->sb_type],
-                       OBMC_FAMILY_MODES);
-      break;
-#endif
     case OBMC_CAUSAL:
 #if CONFIG_NEW_MULTISYMBOL
       aom_write_symbol(w, mbmi->motion_mode == OBMC_CAUSAL,
@@ -421,7 +414,6 @@
                 cm->fc->obmc_prob[mbmi->sb_type]);
 #endif
       break;
-
     default:
       aom_write_symbol(w, mbmi->motion_mode,
                        xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
@@ -429,22 +421,6 @@
   }
 }
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-static void write_ncobmc_mode(MACROBLOCKD *xd, const MODE_INFO *mi,
-                              aom_writer *w) {
-  const MB_MODE_INFO *mbmi = &mi->mbmi;
-  ADAPT_OVERLAP_BLOCK ao_block = adapt_overlap_block_lookup[mbmi->sb_type];
-  if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT) return;
-
-  aom_write_symbol(w, mbmi->ncobmc_mode[0],
-                   xd->tile_ctx->ncobmc_mode_cdf[ao_block], MAX_NCOBMC_MODES);
-  if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
-    aom_write_symbol(w, mbmi->ncobmc_mode[1],
-                     xd->tile_ctx->ncobmc_mode_cdf[ao_block], MAX_NCOBMC_MODES);
-  }
-}
-#endif
-
 static void write_delta_qindex(const AV1_COMMON *cm, const MACROBLOCKD *xd,
                                int delta_qindex, aom_writer *w) {
   int sign = delta_qindex < 0;
@@ -1606,9 +1582,6 @@
     }
 
     if (mbmi->ref_frame[1] != INTRA_FRAME) write_motion_mode(cm, xd, mi, w);
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-    write_ncobmc_mode(xd, mi, w);
-#endif
 
     if (
 #if CONFIG_COMPOUND_SINGLEREF
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index 169038c..081c9e0 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -222,12 +222,6 @@
   int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
   int motion_mode_cost[BLOCK_SIZES_ALL][MOTION_MODES];
   int motion_mode_cost1[BLOCK_SIZES_ALL][2];
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  int motion_mode_cost2[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES];
-#endif
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  int ncobmc_mode_cost[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES];
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   int intra_uv_mode_cost[INTRA_MODES][UV_INTRA_MODES];
   int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES];
 #if CONFIG_FILTER_INTRA
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 4f0b6bf..2951fce 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -705,60 +705,7 @@
     default: assert(0 && "Invalid partition type."); break;
   }
 }
-
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-static void av1_get_ncobmc_mode_rd(const AV1_COMP *const cpi,
-                                   MACROBLOCK *const x, MACROBLOCKD *const xd,
-                                   int bsize, const int mi_row,
-                                   const int mi_col, NCOBMC_MODE *mode) {
-  const AV1_COMMON *const cm = &cpi->common;
-  const int mi_width = mi_size_wide[bsize];
-  const int mi_height = mi_size_high[bsize];
-
-  assert(bsize >= BLOCK_8X8);
-
-  reset_xd_boundary(xd, mi_row, mi_height, mi_col, mi_width, cm->mi_rows,
-                    cm->mi_cols);
-
-  // set up source buffers before calling the mode searching function
-  av1_setup_src_planes(x, cpi->source, mi_row, mi_col);
-
-  *mode = get_ncobmc_mode(cpi, x, xd, mi_row, mi_col, bsize);
-}
-static void get_ncobmc_intrpl_pred(const AV1_COMP *const cpi, ThreadData *td,
-                                   int mi_row, int mi_col, BLOCK_SIZE bsize) {
-  MACROBLOCK *const x = &td->mb;
-  MACROBLOCKD *const xd = &x->e_mbd;
-  MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
-  const int mi_width = mi_size_wide[bsize];
-  const int mi_height = mi_size_high[bsize];
-  const int hbs = AOMMAX(mi_size_wide[bsize] / 2, mi_size_high[bsize] / 2);
-  const BLOCK_SIZE sqr_blk = bsize_2_sqr_bsize[bsize];
-
-  if (mi_width > mi_height) {
-    // horizontal partition
-    av1_get_ncobmc_mode_rd(cpi, x, xd, sqr_blk, mi_row, mi_col,
-                           &mbmi->ncobmc_mode[0]);
-    xd->mi += hbs;
-    av1_get_ncobmc_mode_rd(cpi, x, xd, sqr_blk, mi_row, mi_col + hbs,
-                           &mbmi->ncobmc_mode[1]);
-  } else if (mi_height > mi_width) {
-    // vertical partition
-    av1_get_ncobmc_mode_rd(cpi, x, xd, sqr_blk, mi_row, mi_col,
-                           &mbmi->ncobmc_mode[0]);
-    xd->mi += hbs * xd->mi_stride;
-    av1_get_ncobmc_mode_rd(cpi, x, xd, sqr_blk, mi_row + hbs, mi_col,
-                           &mbmi->ncobmc_mode[1]);
-  } else {
-    av1_get_ncobmc_mode_rd(cpi, x, xd, sqr_blk, mi_row, mi_col,
-                           &mbmi->ncobmc_mode[0]);
-  }
-  // restore the info
-  av1_setup_src_planes(x, cpi->source, mi_row, mi_col);
-  set_mode_info_offsets(cpi, x, xd, mi_row, mi_col);
-}
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-#endif  // (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#endif
 
 void av1_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
                           int mi_row, int mi_col) {
@@ -1203,18 +1150,6 @@
             if (allow_update_cdf)
               update_cdf(fc->motion_mode_cdf[mbmi->sb_type], mbmi->motion_mode,
                          MOTION_MODES);
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-          } else if (motion_allowed == NCOBMC_ADAPT_WEIGHT) {
-            counts->ncobmc[mbmi->sb_type][mbmi->motion_mode]++;
-            if (allow_update_cdf)
-              update_cdf(fc->ncobmc_cdf[mbmi->sb_type], mbmi->motion_mode,
-                         OBMC_FAMILY_MODES);
-          } else if (motion_allowed == OBMC_CAUSAL) {
-            counts->obmc[mbmi->sb_type][mbmi->motion_mode == OBMC_CAUSAL]++;
-            if (allow_update_cdf)
-              update_cdf(fc->obmc_cdf[mbmi->sb_type], mbmi->motion_mode, 2);
-          }
-#else
           } else if (motion_allowed == OBMC_CAUSAL) {
             counts->obmc[mbmi->sb_type][mbmi->motion_mode == OBMC_CAUSAL]++;
 #if CONFIG_NEW_MULTISYMBOL
@@ -1223,26 +1158,8 @@
                          mbmi->motion_mode == OBMC_CAUSAL, 2);
 #endif
           }
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
         }
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-        if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT) {
-          ADAPT_OVERLAP_BLOCK ao_block =
-              adapt_overlap_block_lookup[mbmi->sb_type];
-          ++counts->ncobmc_mode[ao_block][mbmi->ncobmc_mode[0]];
-          if (allow_update_cdf)
-            update_cdf(fc->ncobmc_mode_cdf[ao_block], mbmi->ncobmc_mode[0],
-                       MAX_NCOBMC_MODES);
-          if (mi_size_wide[mbmi->sb_type] != mi_size_high[mbmi->sb_type]) {
-            ++counts->ncobmc_mode[ao_block][mbmi->ncobmc_mode[1]];
-            if (allow_update_cdf)
-              update_cdf(fc->ncobmc_mode_cdf[ao_block], mbmi->ncobmc_mode[1],
-                         MAX_NCOBMC_MODES);
-          }
-        }
-#endif
-
         if (
 #if CONFIG_COMPOUND_SINGLEREF
             is_inter_anyref_comp_mode(mbmi->mode)
@@ -1417,7 +1334,7 @@
                      PICK_MODE_CONTEXT *ctx, int *rate) {
   TileInfo *const tile = &tile_data->tile_info;
   MACROBLOCK *const x = &td->mb;
-#if (CONFIG_NCOBMC) | CONFIG_EXT_DELTA_Q | CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NCOBMC || CONFIG_EXT_DELTA_Q
   MACROBLOCKD *xd = &x->e_mbd;
   MB_MODE_INFO *mbmi;
 #if CONFIG_NCOBMC
@@ -1430,15 +1347,15 @@
   x->e_mbd.mi[0]->mbmi.partition = partition;
 #endif
   update_state(cpi, tile_data, td, ctx, mi_row, mi_col, bsize, dry_run);
-#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#if CONFIG_NCOBMC
   mbmi = &xd->mi[0]->mbmi;
   set_ref_ptrs(&cpi->common, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 #endif
 
-#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#if CONFIG_NCOBMC
   const MOTION_MODE motion_allowed =
       motion_mode_allowed(0, xd->global_motion, xd, xd->mi[0]);
-#endif  // (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#endif
 
 #if CONFIG_NCOBMC
   check_ncobmc = is_inter_block(mbmi) && motion_allowed >= OBMC_CAUSAL;
@@ -1453,17 +1370,6 @@
   av1_set_coeff_buffer(cpi, x, mi_row, mi_col);
 #endif
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  if (dry_run == OUTPUT_ENABLED && !frame_is_intra_only(&cpi->common)) {
-    if (motion_allowed >= NCOBMC_ADAPT_WEIGHT && is_inter_block(mbmi)) {
-      get_ncobmc_intrpl_pred(cpi, td, mi_row, mi_col, bsize);
-      av1_check_ncobmc_adapt_weight_rd(cpi, x, mi_row, mi_col);
-    }
-    av1_setup_dst_planes(x->e_mbd.plane, bsize,
-                         get_frame_new_buffer(&cpi->common), mi_row, mi_col);
-  }
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
   encode_superblock(cpi, tile_data, td, tp, dry_run, mi_row, mi_col, bsize,
                     rate);
 
@@ -3266,9 +3172,6 @@
       x->cb_offset = 0;
 #endif
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-      set_sb_mi_boundaries(cm, xd, mi_row, mi_col);
-#endif
       encode_sb(cpi, td, tile_data, tp, mi_row, mi_col, OUTPUT_ENABLED, bsize,
                 pc_tree, NULL);
     } else {
@@ -3875,10 +3778,6 @@
   }
 #endif
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  alloc_ncobmc_pred_buffer(xd);
-#endif
-
   av1_zero(rdc->global_motion_used);
   av1_zero(cpi->gmparams_cost);
   if (cpi->common.frame_type == INTER_FRAME && cpi->source &&
@@ -4112,9 +4011,6 @@
     aom_usec_timer_mark(&emr_timer);
     cpi->time_encode_sb_row += aom_usec_timer_elapsed(&emr_timer);
   }
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  free_ncobmc_pred_buffer(xd);
-#endif
 
 #if 0
   // Keep record of the total distortion this time around for future use
@@ -4768,7 +4664,6 @@
 
     av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, block_size);
 
-#if !CONFIG_NCOBMC_ADAPT_WEIGHT
     if (mbmi->motion_mode == OBMC_CAUSAL) {
 #if CONFIG_NCOBMC
       if (dry_run == OUTPUT_ENABLED)
@@ -4777,17 +4672,6 @@
 #endif
         av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
     }
-#else
-    if (mbmi->motion_mode == OBMC_CAUSAL) {
-      av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
-    } else if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT &&
-               dry_run == OUTPUT_ENABLED) {
-      int p;
-      for (p = 0; p < MAX_MB_PLANE; ++p) {
-        get_pred_from_intrpl_buf(xd, mi_row, mi_col, block_size, p);
-      }
-    }
-#endif
 
     av1_encode_sb((AV1_COMMON *)cm, x, block_size, mi_row, mi_col);
     if (mbmi->skip) mbmi->min_tx_size = get_min_tx_size(mbmi->tx_size);
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 0dab68d..076f880 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -49,9 +49,6 @@
 #include "av1/encoder/hash_motion.h"
 #endif
 #include "av1/encoder/mbgraph.h"
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-#include "av1/common/ncobmc_kernels.h"
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
 #include "av1/encoder/picklpf.h"
 #if CONFIG_LOOP_RESTORATION
 #include "av1/encoder/pickrst.h"
@@ -2572,10 +2569,6 @@
   cm->free_mi = enc_free_mi;
   cm->setup_mi = enc_setup_mi;
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  get_default_ncobmc_kernels(cm);
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-
   CHECK_MEM_ERROR(cm, cm->fc,
                   (FRAME_CONTEXT *)aom_memalign(32, sizeof(*cm->fc)));
   CHECK_MEM_ERROR(cm, cm->frame_contexts,
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index dc6af9e..0390b76 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -388,23 +388,13 @@
                                NULL);
     }
     for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; i++) {
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-      av1_cost_tokens_from_cdf(x->motion_mode_cost2[i], fc->ncobmc_cdf[i],
-                               NULL);
-#endif
-#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
+#if CONFIG_NEW_MULTISYMBOL
       av1_cost_tokens_from_cdf(x->motion_mode_cost1[i], fc->obmc_cdf[i], NULL);
 #else
       x->motion_mode_cost1[i][0] = av1_cost_bit(fc->obmc_prob[i], 0);
       x->motion_mode_cost1[i][1] = av1_cost_bit(fc->obmc_prob[i], 1);
 #endif
     }
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-    for (i = ADAPT_OVERLAP_BLOCK_8X8; i < ADAPT_OVERLAP_BLOCKS; ++i) {
-      av1_cost_tokens_from_cdf(x->ncobmc_mode_cost[i], fc->ncobmc_mode_cdf[i],
-                               NULL);
-    }
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   }
 }
 
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index e3520ad..91f4ef0 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -8120,14 +8120,6 @@
     int tmp_rate2 =
         motion_mode != SIMPLE_TRANSLATION ? rate2_bmc_nocoeff : rate2_nocoeff;
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-    // We cannot estimate the rd cost for the motion mode NCOBMC_ADAPT_WEIGHT
-    // right now since it requires mvs from all neighboring blocks. We will
-    // check if this mode is beneficial after all the mv's in the current
-    // superblock are selected.
-    if (motion_mode == NCOBMC_ADAPT_WEIGHT) continue;
-#endif
-
     *mbmi = base_mbmi;
     mbmi->motion_mode = motion_mode;
     if (mbmi->motion_mode == OBMC_CAUSAL) {
@@ -8450,11 +8442,6 @@
   int skip_txfm_sb = 0;
   int64_t skip_sse_sb = INT64_MAX;
   int16_t mode_ctx;
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  // dummy fillers
-  mbmi->ncobmc_mode[0] = NO_OVERLAP;
-  mbmi->ncobmc_mode[1] = NO_OVERLAP;
-#endif
 
   int compmode_interintra_cost = 0;
   mbmi->use_wedge_interintra = 0;
@@ -11668,273 +11655,3 @@
   }
 }
 #endif  // CONFIG_NCOBMC
-
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-int64_t get_prediction_rd_cost(const struct AV1_COMP *cpi, struct macroblock *x,
-                               int mi_row, int mi_col, int *skip_blk,
-                               MB_MODE_INFO *backup_mbmi) {
-  const AV1_COMMON *const cm = &cpi->common;
-  MACROBLOCKD *const xd = &x->e_mbd;
-  MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
-  BLOCK_SIZE bsize = mbmi->sb_type;
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  const MOTION_MODE motion_allowed =
-      motion_mode_allowed(0, xd->global_motion, xd, xd->mi[0]);
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-  RD_STATS rd_stats_y, rd_stats_uv;
-  const int skip_ctx = av1_get_skip_context(xd);
-  int rate_skip0 = x->skip_cost[skip_ctx][0];
-  int rate_skip1 = x->skip_cost[skip_ctx][1];
-  int64_t this_rd;
-  int ref;
-
-  x->skip_chroma_rd =
-      !is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x,
-                           xd->plane[1].subsampling_y);
-
-  set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
-  for (ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
-    YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi, mbmi->ref_frame[ref]);
-    assert(cfg != NULL);
-    av1_setup_pre_planes(xd, ref, cfg, mi_row, mi_col,
-                         &xd->block_refs[ref]->sf);
-  }
-  av1_setup_dst_planes(x->e_mbd.plane, bsize,
-                       get_frame_new_buffer(&cpi->common), mi_row, mi_col);
-
-  if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT)
-    av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, bsize);
-
-  if (mbmi->motion_mode == OBMC_CAUSAL) {
-#if CONFIG_NCOBMC
-    av1_build_ncobmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
-#else
-    av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
-#endif
-  }
-
-  if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT)
-    for (int plane = 0; plane < MAX_MB_PLANE; ++plane)
-      get_pred_from_intrpl_buf(xd, mi_row, mi_col, bsize, plane);
-  av1_subtract_plane(x, bsize, 0);
-
-  if (cm->tx_mode == TX_MODE_SELECT && !xd->lossless[mbmi->segment_id]) {
-    // ncobmc_adapt_weight
-    select_tx_type_yrd(cpi, x, &rd_stats_y, bsize, mi_row, mi_col, INT64_MAX);
-  } else {
-    int idx, idy;
-    super_block_yrd(cpi, x, &rd_stats_y, bsize, INT64_MAX);
-    for (idy = 0; idy < xd->n8_h; ++idy)
-      for (idx = 0; idx < xd->n8_w; ++idx)
-        mbmi->inter_tx_size[idy][idx] = mbmi->tx_size;
-    memset(x->blk_skip[0], rd_stats_y.skip,
-           sizeof(uint8_t) * xd->n8_h * xd->n8_w * 4);
-  }
-  inter_block_uvrd(cpi, x, &rd_stats_uv, bsize, INT64_MAX, 0);
-  assert(rd_stats_y.rate != INT_MAX && rd_stats_uv.rate != INT_MAX);
-
-  if (rd_stats_y.skip && rd_stats_uv.skip) {
-    rd_stats_y.rate = rate_skip1;
-    rd_stats_uv.rate = 0;
-    rd_stats_y.dist = rd_stats_y.sse;
-    rd_stats_uv.dist = rd_stats_uv.sse;
-    *skip_blk = 1;
-  } else if (RDCOST(x->rdmult,
-                    (rd_stats_y.rate + rd_stats_uv.rate + rate_skip0),
-                    (rd_stats_y.dist + rd_stats_uv.dist)) >
-             RDCOST(x->rdmult, rate_skip1,
-                    (rd_stats_y.sse + rd_stats_uv.sse))) {
-    rd_stats_y.rate = rate_skip1;
-    rd_stats_uv.rate = 0;
-    rd_stats_y.dist = rd_stats_y.sse;
-    rd_stats_uv.dist = rd_stats_uv.sse;
-    *skip_blk = 1;
-  } else {
-    rd_stats_y.rate += rate_skip0;
-    *skip_blk = 0;
-  }
-
-  if (backup_mbmi) *backup_mbmi = *mbmi;
-
-  this_rd = RDCOST(x->rdmult, (rd_stats_y.rate + rd_stats_uv.rate),
-                   (rd_stats_y.dist + rd_stats_uv.dist));
-  if (motion_allowed == NCOBMC_ADAPT_WEIGHT) {
-    assert(mbmi->motion_mode <= NCOBMC_ADAPT_WEIGHT);
-    this_rd +=
-        RDCOST(x->rdmult, x->motion_mode_cost2[bsize][mbmi->motion_mode], 0);
-  } else if (motion_allowed == OBMC_CAUSAL) {
-    assert(mbmi->motion_mode <= OBMC_CAUSAL);
-    this_rd +=
-        RDCOST(x->rdmult, x->motion_mode_cost1[bsize][mbmi->motion_mode], 0);
-  } else {
-    this_rd +=
-        RDCOST(x->rdmult, x->motion_mode_cost[bsize][mbmi->motion_mode], 0);
-  }
-  return this_rd;
-}
-
-void av1_check_ncobmc_adapt_weight_rd(const struct AV1_COMP *cpi,
-                                      struct macroblock *x, int mi_row,
-                                      int mi_col) {
-  MACROBLOCKD *const xd = &x->e_mbd;
-  MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
-  BLOCK_SIZE bsize = mbmi->sb_type;
-  const int n4 = bsize_to_num_blk(bsize);
-  uint8_t st_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE * 8];
-  uint8_t obmc_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE * 8];
-  uint8_t ncobmc_blk_skip[MAX_MIB_SIZE * MAX_MIB_SIZE * 8];
-  MB_MODE_INFO st_mbmi, obmc_mbmi, ncobmc_mbmi;
-  int st_skip, obmc_skip, ncobmc_skip;
-  int64_t st_rd, obmc_rd, ncobmc_rd;
-  const AV1_COMMON *const cm = &cpi->common;
-  const int is_warp_motion = mbmi->motion_mode == WARPED_CAUSAL;
-  const int rs = RDCOST(x->rdmult, av1_get_switchable_rate(cm, x, xd), 0);
-  MB_MODE_INFO warp_mbmi;
-  int64_t warp_rd;
-  int warp_skip;
-
-  // Recompute the rd for the motion mode decided in rd loop
-  mbmi->motion_mode = SIMPLE_TRANSLATION;
-  st_rd = get_prediction_rd_cost(cpi, x, mi_row, mi_col, &st_skip, &st_mbmi);
-  st_rd += rs;
-  memcpy(st_blk_skip, x->blk_skip[0], sizeof(st_blk_skip[0]) * n4);
-
-  mbmi->motion_mode = OBMC_CAUSAL;
-  obmc_rd =
-      get_prediction_rd_cost(cpi, x, mi_row, mi_col, &obmc_skip, &obmc_mbmi);
-  obmc_rd += rs;
-  memcpy(obmc_blk_skip, x->blk_skip[0], sizeof(obmc_blk_skip[0]) * n4);
-
-  // Compute the rd cost for ncobmc adaptive weight
-  mbmi->motion_mode = NCOBMC_ADAPT_WEIGHT;
-  ncobmc_rd = get_prediction_rd_cost(cpi, x, mi_row, mi_col, &ncobmc_skip,
-                                     &ncobmc_mbmi);
-  ncobmc_rd += rs;
-  // Calculate the ncobmc mode costs
-  {
-    ADAPT_OVERLAP_BLOCK aob = adapt_overlap_block_lookup[bsize];
-    ncobmc_rd +=
-        RDCOST(x->rdmult, x->ncobmc_mode_cost[aob][mbmi->ncobmc_mode[0]], 0);
-    if (mi_size_wide[bsize] != mi_size_high[bsize])
-      ncobmc_rd +=
-          RDCOST(x->rdmult, x->ncobmc_mode_cost[aob][mbmi->ncobmc_mode[1]], 0);
-  }
-  memcpy(ncobmc_blk_skip, x->blk_skip[0], sizeof(ncobmc_blk_skip[0]) * n4);
-
-  if (is_warp_motion) {
-    mbmi->motion_mode = WARPED_CAUSAL;
-    warp_rd =
-        get_prediction_rd_cost(cpi, x, mi_row, mi_col, &warp_skip, &warp_mbmi);
-  } else {
-    warp_rd = INT64_MAX;
-  }
-
-  if (AOMMIN(ncobmc_rd, warp_rd) < AOMMIN(st_rd, obmc_rd)) {
-    if (ncobmc_rd < warp_rd) {
-      x->skip = ncobmc_skip;
-      *mbmi = ncobmc_mbmi;
-      memcpy(x->blk_skip[0], ncobmc_blk_skip, sizeof(ncobmc_blk_skip[0]) * n4);
-    } else {
-      x->skip = warp_skip;
-      *mbmi = warp_mbmi;
-    }
-  } else {
-    if (obmc_rd < st_rd) {
-      *mbmi = obmc_mbmi;
-      x->skip = obmc_skip;
-      memcpy(x->blk_skip[0], obmc_blk_skip, sizeof(obmc_blk_skip[0]) * n4);
-    } else {
-      *mbmi = st_mbmi;
-      x->skip = st_skip;
-      memcpy(x->blk_skip[0], st_blk_skip, sizeof(st_blk_skip[0]) * n4);
-    }
-  }
-}
-
-int64_t get_ncobmc_error(MACROBLOCKD *xd, int pxl_row, int pxl_col,
-                         BLOCK_SIZE bsize, int plane, struct buf_2d *src) {
-  const int wide = AOMMIN(mi_size_wide[bsize] * MI_SIZE,
-                          (xd->sb_mi_bd.mi_col_end + 1) * MI_SIZE - pxl_col);
-  const int high = AOMMIN(mi_size_high[bsize] * MI_SIZE,
-                          (xd->sb_mi_bd.mi_row_end + 1) * MI_SIZE - pxl_row);
-  const int ss_x = xd->plane[plane].subsampling_x;
-  const int ss_y = xd->plane[plane].subsampling_y;
-  int row_offset = (pxl_row - xd->sb_mi_bd.mi_row_begin * MI_SIZE) >> ss_y;
-  int col_offset = (pxl_col - xd->sb_mi_bd.mi_col_begin * MI_SIZE) >> ss_x;
-  int dst_stride = xd->ncobmc_pred_buf_stride[plane];
-  int dst_offset = row_offset * dst_stride + col_offset;
-  int src_stride = src->stride;
-
-  int r, c;
-  int64_t tmp, error = 0;
-
-  for (r = 0; r < (high >> ss_y); ++r) {
-    for (c = 0; c < (wide >> ss_x); ++c) {
-      tmp = xd->ncobmc_pred_buf[plane][r * dst_stride + c + dst_offset] -
-            src->buf[r * src_stride + c];
-      error += tmp * tmp;
-    }
-  }
-  return error;
-}
-
-int get_ncobmc_mode(const AV1_COMP *const cpi, MACROBLOCK *const x,
-                    MACROBLOCKD *xd, int mi_row, int mi_col, int bsize) {
-  const AV1_COMMON *const cm = &cpi->common;
-  uint8_t *pred_buf[4][MAX_MB_PLANE];
-
-  // TODO(weitinglin): stride size needs to be fixed for high-bit depth
-  int pred_stride[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
-
-  // target block in pxl
-  int pxl_row = mi_row << MI_SIZE_LOG2;
-  int pxl_col = mi_col << MI_SIZE_LOG2;
-  int64_t error, best_error = INT64_MAX;
-  int plane, tmp_mode, best_mode = 0;
-#if CONFIG_HIGHBITDEPTH
-  if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
-    int len = sizeof(uint16_t);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[0], cm->ncobmcaw_buf[0], MAX_SB_SQUARE,
-                            len);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[1], cm->ncobmcaw_buf[1], MAX_SB_SQUARE,
-                            len);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[2], cm->ncobmcaw_buf[2], MAX_SB_SQUARE,
-                            len);
-    ASSIGN_ALIGNED_PTRS_HBD(pred_buf[3], cm->ncobmcaw_buf[3], MAX_SB_SQUARE,
-                            len);
-  } else {
-#endif  // CONFIG_HIGHBITDEPTH
-    ASSIGN_ALIGNED_PTRS(pred_buf[0], cm->ncobmcaw_buf[0], MAX_SB_SQUARE);
-    ASSIGN_ALIGNED_PTRS(pred_buf[1], cm->ncobmcaw_buf[1], MAX_SB_SQUARE);
-    ASSIGN_ALIGNED_PTRS(pred_buf[2], cm->ncobmcaw_buf[2], MAX_SB_SQUARE);
-    ASSIGN_ALIGNED_PTRS(pred_buf[3], cm->ncobmcaw_buf[3], MAX_SB_SQUARE);
-#if CONFIG_HIGHBITDEPTH
-  }
-#endif
-
-  av1_get_ext_blk_preds(cm, xd, bsize, mi_row, mi_col, pred_buf, pred_stride);
-  av1_get_ori_blk_pred(cm, xd, bsize, mi_row, mi_col, pred_buf[3], pred_stride);
-
-  for (tmp_mode = 0; tmp_mode < MAX_NCOBMC_MODES; ++tmp_mode) {
-    error = 0;
-    for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
-      build_ncobmc_intrpl_pred(cm, xd, plane, pxl_row, pxl_col, bsize, pred_buf,
-                               pred_stride, tmp_mode);
-      error += get_ncobmc_error(xd, pxl_row, pxl_col, bsize, plane,
-                                &x->plane[plane].src);
-    }
-    if (error < best_error) {
-      best_mode = tmp_mode;
-      best_error = error;
-    }
-  }
-
-  for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
-    build_ncobmc_intrpl_pred(cm, xd, plane, pxl_row, pxl_col, bsize, pred_buf,
-                             pred_stride, best_mode);
-  }
-
-  return best_mode;
-}
-
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
diff --git a/av1/encoder/rdopt.h b/av1/encoder/rdopt.h
index 57dff32..92d584f 100644
--- a/av1/encoder/rdopt.h
+++ b/av1/encoder/rdopt.h
@@ -126,13 +126,4 @@
                                int mi_row, int mi_col, int *skip_blk,
                                MB_MODE_INFO *backup_mbmi);
 
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-void av1_check_ncobmc_adapt_weight_rd(const struct AV1_COMP *cpi,
-                                      struct macroblock *x, int mi_row,
-                                      int mi_col);
-int get_ncobmc_mode(const AV1_COMP *const cpi, MACROBLOCK *const x,
-                    MACROBLOCKD *xd, int mi_row, int mi_col, int bsize);
-
-#endif
-
 #endif  // AV1_ENCODER_RDOPT_H_
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index f6bb38b..5e5236f 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -170,7 +170,6 @@
 set(CONFIG_MRC_TX 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_MV_COMPRESS 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_NCOBMC 0 CACHE NUMBER "AV1 experiment flag.")
-set(CONFIG_NCOBMC_ADAPT_WEIGHT 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_NEW_MULTISYMBOL 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_NEW_QUANT 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_NO_FRAME_CONTEXT_SIGNALING 0 CACHE NUMBER "AV1 experiment flag.")
diff --git a/configure b/configure
index f056c6f..4a30809 100755
--- a/configure
+++ b/configure
@@ -314,7 +314,6 @@
     smooth_hv
     lgt
     lgt_from_pred
-    ncobmc_adapt_weight
     bgsprite
     var_tx_no_tx_mode
     simplify_tx_mode
diff --git a/tools/aom_entropy_optimizer.c b/tools/aom_entropy_optimizer.c
index c985b39..c677349 100644
--- a/tools/aom_entropy_optimizer.c
+++ b/tools/aom_entropy_optimizer.c
@@ -524,29 +524,6 @@
   optimize_cdf_table(&fc.obmc[0][0], probsfile, 2, cts_each_dim,
                      "static const aom_cdf_prob "
                      "default_obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)]");
-#if CONFIG_NCOBMC_ADAPT_WEIGHT
-  cts_each_dim[0] = ADAPT_OVERLAP_BLOCKS;
-  cts_each_dim[1] = MAX_NCOBMC_MODES;
-  optimize_entropy_table(
-      &fc.ncobmc_mode[0][0], probsfile, 2, cts_each_dim, av1_ncobmc_mode_tree,
-      0,
-      "static const aom_prob default_ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS]"
-      "[MAX_NCOBMC_MODES - 1]");
-  optimize_cdf_table(&fc.ncobmc_mode[0][0], probsfile, 2, cts_each_dim,
-                     "static const aom_cdf_prob\n"
-                     "default_ncobmc_mode_cdf[ADAPT_OVERLAP_BLOCKS]"
-                     "[CDF_SIZE(MAX_NCOBMC_MODES)]");
-  cts_each_dim[0] = BLOCK_SIZES_ALL;
-  cts_each_dim[1] = OBMC_FAMILY_MODES;
-  optimize_entropy_table(
-      &fc.ncobmc[0][0], probsfile, 2, cts_each_dim, av1_ncobmc_tree, 0,
-      "static const aom_prob default_ncobmc_prob[BLOCK_SIZES_ALL]"
-      "[OBMC_FAMILY_MODES - 1]");
-  optimize_cdf_table(&fc.ncobmc[0][0], probsfile, 2, cts_each_dim,
-                     "static const aom_cdf_prob\n"
-                     "default_ncobmc_cdf[BLOCK_SIZES_ALL]"
-                     "[CDF_SIZE(OBMC_FAMILY_MODES)]");
-#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
 
   /* Intra/inter flag */
   cts_each_dim[0] = INTRA_INTER_CONTEXTS;