Commit 80daf0c4 authored by Yue Chen's avatar Yue Chen

Remove NCOBMC_ADAPT_WEIGHT from AV1

Development of this experiment will be deferred to AV2.

Change-Id: I3c4615a21b59508500bed8aab0a5c54413b4f284
parent 77fb5be1
......@@ -405,13 +405,6 @@ if (CONFIG_INTRA_EDGE)
"${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"
......
......@@ -160,14 +160,8 @@ AV1_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/highbd_convolve_2d_ssse3.c
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))
......@@ -84,35 +84,6 @@ static void free_seg_map(AV1_COMMON *cm) {
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 @@ void av1_free_context_buffers(AV1_COMMON *cm) {
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 @@ int av1_alloc_context_buffers(AV1_COMMON *cm, int width, int height) {
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.
......
......@@ -70,17 +70,6 @@ static INLINE int is_inter_mode(PREDICTION_MODE mode) {
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 @@ typedef struct MB_MODE_INFO {
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 @@ typedef struct macroblockd {
#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 @@ static INLINE int check_num_overlappable_neighbors(const MB_MODE_INFO *mbmi) {
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 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
#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;
}
......
......@@ -1851,46 +1851,6 @@ static const int intra_mode_context[INTRA_MODES] = {
};
#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
......
......@@ -928,158 +928,6 @@ static const aom_cdf_prob
};
#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 @@ static const aom_cdf_prob
{ 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 @@ static const aom_prob default_obmc_prob[BLOCK_SIZES_ALL] = {
#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 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#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 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
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]);
......
......@@ -218,17 +218,8 @@ typedef struct frame_contexts {
[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 @@ typedef struct FRAME_COUNTS {
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
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
......
......@@ -22,11 +22,7 @@ extern "C" {
#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 @@ typedef enum ATTRIBUTE_PACKED {
#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 {
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 {
......
This diff is collapsed.
/*
* 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_
......@@ -523,10 +523,6 @@ typedef struct AV1Common {
#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
......
This diff is collapsed.
......@@ -560,45 +560,6 @@ void av1_build_wedge_inter_predictor_from_buf(MACROBLOCKD *xd, BLOCK_SIZE bsize,
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
......
......@@ -480,94 +480,6 @@ static void decode_mbmi_block(AV1Decoder *const pbi, MACROBLOCKD *const xd,
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) {