Commit 1bc94fcc authored by Sebastien Alaiwan's avatar Sebastien Alaiwan Committed by Debargha Mukherjee

Remove experimental flag of MOTION_VAR

This experiment has been adopted, we can simplify the code
by dropping the associated preprocessor conditionals.

Change-Id: I2dce80e1e1b2116708b6ba9feeacaacc12af8fc4
parent 42e7a334
......@@ -460,12 +460,10 @@ if (CONFIG_LOOP_RESTORATION)
endif ()
endif ()
if (CONFIG_MOTION_VAR)
set(AOM_DSP_ENCODER_INTRIN_SSE4_1
${AOM_DSP_ENCODER_INTRIN_SSE4_1}
"${AOM_ROOT}/aom_dsp/x86/obmc_sad_sse4.c"
"${AOM_ROOT}/aom_dsp/x86/obmc_variance_sse4.c")
endif ()
set(AOM_DSP_ENCODER_INTRIN_SSE4_1
${AOM_DSP_ENCODER_INTRIN_SSE4_1}
"${AOM_ROOT}/aom_dsp/x86/obmc_sad_sse4.c"
"${AOM_ROOT}/aom_dsp/x86/obmc_variance_sse4.c")
# Creates aom_dsp build targets. Must not be called until after libaom target
# has been created.
......
......@@ -361,10 +361,8 @@ endif
ifeq ($(CONFIG_AV1_ENCODER),yes)
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_sad_intrin_ssse3.c
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c
ifeq ($(CONFIG_MOTION_VAR),yes)
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_sad_sse4.c
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_variance_sse4.c
endif #CONFIG_MOTION_VAR
ifeq ($(CONFIG_EXT_PARTITION),yes)
DSP_SRCS-$(HAVE_AVX2) += x86/sad_impl_avx2.c
endif
......
......@@ -920,22 +920,20 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
#
# OBMC SAD
#
if (aom_config("CONFIG_MOTION_VAR") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_obmc_sad${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask";
if (! (($w == 128 && $h == 32) || ($w == 32 && $h == 128))) {
specialize "aom_obmc_sad${w}x${h}", qw/sse4_1/;
}
}
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_obmc_sad${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask";
add_proto qw/unsigned int/, "aom_highbd_obmc_sad${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask";
if (! (($w == 128 && $h == 32) || ($w == 32 && $h == 128))) {
specialize "aom_obmc_sad${w}x${h}", qw/sse4_1/;
}
}
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_highbd_obmc_sad${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask";
if (! (($w == 128 && $h == 32) || ($w == 32 && $h == 128))) {
specialize "aom_highbd_obmc_sad${w}x${h}", qw/sse4_1/;
}
specialize "aom_highbd_obmc_sad${w}x${h}", qw/sse4_1/;
}
}
}
......@@ -1255,22 +1253,20 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
#
# OBMC Variance / OBMC Subpixel Variance
#
if (aom_config("CONFIG_MOTION_VAR") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_obmc_variance${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
add_proto qw/unsigned int/, "aom_obmc_sub_pixel_variance${w}x${h}", "const uint8_t *pre, int pre_stride, int xoffset, int yoffset, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
specialize "aom_obmc_variance${w}x${h}", q/sse4_1/;
}
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_obmc_variance${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
add_proto qw/unsigned int/, "aom_obmc_sub_pixel_variance${w}x${h}", "const uint8_t *pre, int pre_stride, int xoffset, int yoffset, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
specialize "aom_obmc_variance${w}x${h}", q/sse4_1/;
}
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
foreach $bd ("_", "_10_", "_12_") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_highbd${bd}obmc_variance${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
add_proto qw/unsigned int/, "aom_highbd${bd}obmc_sub_pixel_variance${w}x${h}", "const uint8_t *pre, int pre_stride, int xoffset, int yoffset, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
specialize "aom_highbd${bd}obmc_variance${w}x${h}", qw/sse4_1/;
}
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
foreach $bd ("_", "_10_", "_12_") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_highbd${bd}obmc_variance${w}x${h}", "const uint8_t *pre, int pre_stride, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
add_proto qw/unsigned int/, "aom_highbd${bd}obmc_sub_pixel_variance${w}x${h}", "const uint8_t *pre, int pre_stride, int xoffset, int yoffset, const int32_t *wsrc, const int32_t *mask, unsigned int *sse";
specialize "aom_highbd${bd}obmc_variance${w}x${h}", qw/sse4_1/;
}
}
}
......
......@@ -492,7 +492,7 @@ HIGHBD_MASKSADMXN(128, 32)
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR
#if CONFIG_AV1
// pre: predictor being evaluated
// wsrc: target weighted prediction (has been *4096 to keep precision)
// mask: 2d weights (scaled by 4096)
......@@ -613,4 +613,4 @@ HIGHBD_OBMCSADMXN(128, 32)
#endif
/* clang-format on */
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_MOTION_VAR
#endif // CONFIG_AV1
......@@ -1043,7 +1043,7 @@ HIGHBD_MASK_SUBPIX_VAR(128, 32)
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR
#if CONFIG_AV1
static INLINE void obmc_variance(const uint8_t *pre, int pre_stride,
const int32_t *wsrc, const int32_t *mask,
int w, int h, unsigned int *sse, int *sum) {
......@@ -1363,4 +1363,4 @@ HIGHBD_OBMC_SUBPIX_VAR(128, 32)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_MOTION_VAR
#endif // CONFIG_AV1
......@@ -66,7 +66,7 @@ typedef unsigned int (*aom_masked_subpixvariance_fn_t)(
const uint8_t *msk, int msk_stride, int invert_mask, unsigned int *sse);
#endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR
#if CONFIG_AV1
typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride,
const int32_t *wsrc,
const int32_t *msk);
......@@ -78,7 +78,7 @@ typedef unsigned int (*aom_obmc_variance_fn_t)(const uint8_t *pred,
typedef unsigned int (*aom_obmc_subpixvariance_fn_t)(
const uint8_t *pred, int pred_stride, int xoffset, int yoffset,
const int32_t *wsrc, const int32_t *msk, unsigned int *sse);
#endif // CONFIG_AV1 && CONFIG_MOTION_VAR
#endif // CONFIG_AV1
#if CONFIG_AV1
typedef struct aom_variance_vtable {
......@@ -92,11 +92,9 @@ typedef struct aom_variance_vtable {
aom_sad_multi_d_fn_t sdx4df;
aom_masked_sad_fn_t msdf;
aom_masked_subpixvariance_fn_t msvf;
#if CONFIG_MOTION_VAR
aom_obmc_sad_fn_t osdf;
aom_obmc_variance_fn_t ovf;
aom_obmc_subpixvariance_fn_t osvf;
#endif // CONFIG_MOTION_VAR
} aom_variance_fn_ptr_t;
#endif // CONFIG_AV1
......
......@@ -122,9 +122,7 @@ AV1_COMMON_SRCS-yes += common/cfl.h
AV1_COMMON_SRCS-yes += common/cfl.c
endif
ifeq ($(CONFIG_MOTION_VAR),yes)
AV1_COMMON_SRCS-yes += common/obmc.h
endif
# common (msa)
AV1_COMMON_SRCS-$(HAVE_MSA) += common/mips/msa/av1_idct4x4_msa.c
......
......@@ -345,7 +345,6 @@ typedef struct MB_MODE_INFO {
int wedge_sign;
SEG_MASK_TYPE mask_type;
MOTION_MODE motion_mode;
#if CONFIG_MOTION_VAR
int overlappable_neighbors[2];
#if CONFIG_NCOBMC_ADAPT_WEIGHT
// Applying different weighting kernels in ncobmc
......@@ -354,7 +353,6 @@ typedef struct MB_MODE_INFO {
// squared block has an interpolation mode.
NCOBMC_MODE ncobmc_mode[2];
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR
int_mv mv[2];
int_mv pred_mv[2];
uint8_t ref_mv_idx;
......@@ -1368,7 +1366,6 @@ static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi,
return max_txsize;
}
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
return AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
}
......@@ -1385,7 +1382,6 @@ static INLINE int is_motion_variation_allowed_compound(
return 0;
}
#if CONFIG_MOTION_VAR
// input: log2 of length, 0(4), 1(8), ...
static const int max_neighbor_obmc[6] = { 0, 1, 2, 3, 4, 4 };
......@@ -1401,7 +1397,6 @@ static INLINE NCOBMC_MODE ncobmc_mode_allowed_bsize(BLOCK_SIZE bsize) {
return MAX_NCOBMC_MODES;
}
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR
static INLINE MOTION_MODE
motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
......@@ -1421,9 +1416,7 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
if (is_motion_variation_allowed_bsize(mbmi->sb_type) &&
is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
is_motion_variation_allowed_compound(mbmi)) {
#if CONFIG_MOTION_VAR
if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
#endif
#if CONFIG_WARPED_MOTION
if (!has_second_ref(mbmi) && mbmi->num_proj_ref[0] >= 1 &&
!av1_is_scaled(&(xd->block_refs[0]->sf))) {
......@@ -1436,16 +1429,12 @@ motion_mode_allowed(int block, const WarpedMotionParams *gm_params,
}
#endif // CONFIG_WARPED_MOTION
#if CONFIG_MOTION_VAR
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (ncobmc_mode_allowed_bsize(mbmi->sb_type) < NO_OVERLAP)
return NCOBMC_ADAPT_WEIGHT;
else
#endif
return OBMC_CAUSAL;
#else
return SIMPLE_TRANSLATION;
#endif // CONFIG_MOTION_VAR
} else {
return SIMPLE_TRANSLATION;
}
......@@ -1469,12 +1458,9 @@ static INLINE void assert_motion_mode_valid(MOTION_MODE mode, int block,
assert(0 && "Illegal motion mode selected");
}
#if CONFIG_MOTION_VAR
static INLINE int is_neighbor_overlappable(const MB_MODE_INFO *mbmi) {
return (is_inter_block(mbmi));
}
#endif // CONFIG_MOTION_VAR
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static INLINE int av1_allow_palette(int allow_screen_content_tools,
BLOCK_SIZE sb_type) {
......
......@@ -2382,13 +2382,11 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
}
#if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(intra_inter_cdf)
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
AVERAGE_TILE_CDFS(motion_mode_cdf)
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
AVERAGE_TILE_CDFS(obmc_cdf)
#endif
#endif
#endif
#if CONFIG_MRC_TX
AVERAGE_TILE_CDFS(mrc_mask_inter_cdf)
#endif // CONFIG_MRC_TX
......
......@@ -928,7 +928,7 @@ static const aom_cdf_prob
#endif // TWO_MODEE
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
// Change this section appropriately once warped motion is supported
#if CONFIG_MOTION_VAR && !CONFIG_WARPED_MOTION
#if !CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, 2, -OBMC_CAUSAL, -NCOBMC_ADAPT_WEIGHT,
......@@ -1057,61 +1057,7 @@ static const aom_cdf_prob
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#elif !CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)] = {
-SIMPLE_TRANSLATION, -WARPED_CAUSAL
};
static const aom_prob
default_motion_mode_prob[BLOCK_SIZES_ALL][MOTION_MODES - 1] = {
{ 255 }, { 255 }, { 255 }, { 255 }, { 255 }, { 255 }, { 151 }, { 153 },
{ 144 }, { 178 }, { 165 }, { 160 }, { 207 }, { 195 }, { 168 }, { 244 },
#if CONFIG_EXT_PARTITION
{ 252 }, { 252 }, { 252 },
#endif // CONFIG_EXT_PARTITION
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 },
#if CONFIG_EXT_PARTITION
{ 252 }, { 252 }
#endif // CONFIG_EXT_PARTITION
};
static const aom_cdf_prob
default_motion_mode_cdf[BLOCK_SIZES_ALL][CDF_SIZE(MOTION_MODES)] = {
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(151 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(153 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(144 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(178 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(165 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(160 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(207 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(195 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(168 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(244 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(252 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(255 * 128), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#elif CONFIG_WARPED_MOTION
#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
......@@ -6159,14 +6105,13 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->refmv_cdf, default_refmv_cdf);
av1_copy(fc->drl_cdf, default_drl_cdf);
#endif
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
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 && CONFIG_MOTION_VAR
#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
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
av1_copy(fc->obmc_prob, default_obmc_prob);
#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
av1_copy(fc->obmc_cdf, default_obmc_cdf);
......@@ -6175,8 +6120,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->ncobmc_prob, default_ncobmc_prob);
av1_copy(fc->ncobmc_cdf, default_ncobmc_cdf);
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
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
......@@ -6315,7 +6259,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
fc->drl_prob[i] =
av1_mode_mv_merge_probs(pre_fc->drl_prob[i], counts->drl_mode[i]);
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
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]);
......@@ -6329,12 +6272,11 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
counts->ncobmc[i], fc->ncobmc_prob[i]);
#endif
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
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]);
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
aom_tree_merge_probs(
......
......@@ -218,15 +218,14 @@ typedef struct frame_contexts {
aom_cdf_prob interintra_mode_cdf[BLOCK_SIZE_GROUPS]
[CDF_SIZE(INTERINTRA_MODES)];
#endif // CONFIG_INTERINTRA
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
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 && CONFIG_MOTION_VAR
#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_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
#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)];
......@@ -235,8 +234,7 @@ typedef struct frame_contexts {
#if CONFIG_NEW_MULTISYMBOL || CONFIG_NCOBMC_ADAPT_WEIGHT
aom_cdf_prob obmc_cdf[BLOCK_SIZES_ALL][CDF_SIZE(2)];
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
aom_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
aom_prob comp_inter_prob[COMP_INTER_CONTEXTS];
aom_cdf_prob palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)];
......@@ -455,18 +453,16 @@ typedef struct FRAME_COUNTS {
unsigned int wedge_interintra[BLOCK_SIZES_ALL][2];
#endif // CONFIG_INTERINTRA
unsigned int compound_interinter[BLOCK_SIZES_ALL][COMPOUND_TYPES];
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
unsigned int motion_mode[BLOCK_SIZES_ALL][MOTION_MODES];
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
#if CONFIG_NCOBMC_ADAPT_WEIGHT
unsigned int ncobmc_mode[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES];
#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
#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];
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
#if CONFIG_EXT_COMP_REFS
......@@ -642,9 +638,7 @@ extern const aom_tree_index av1_ext_tx_tree[EXT_TX_SET_TYPES]
#else
extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
#endif // CONFIG_EXT_TX
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
extern const aom_tree_index av1_ncobmc_mode_tree[TREE_SIZE(MAX_NCOBMC_MODES)];
#if CONFIG_WARPED_MOTION
......
......@@ -573,12 +573,10 @@ typedef enum ATTRIBUTE_PACKED {
typedef enum ATTRIBUTE_PACKED {
SIMPLE_TRANSLATION,
#if CONFIG_MOTION_VAR
OBMC_CAUSAL, // 2-sided OBMC
#if CONFIG_NCOBMC_ADAPT_WEIGHT
NCOBMC_ADAPT_WEIGHT,
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR
#if CONFIG_WARPED_MOTION
WARPED_CAUSAL, // 2-sided WARPED
#endif // CONFIG_WARPED_MOTION
......
......@@ -12,7 +12,6 @@
#ifndef AV1_COMMON_OBMC_H_
#define AV1_COMMON_OBMC_H_
#if CONFIG_MOTION_VAR
typedef void (*overlappable_nb_visitor_t)(MACROBLOCKD *xd, int rel_mi_pos,
uint8_t nb_mi_size, MODE_INFO *nb_mi,
void *fun_ctxt);
......@@ -88,5 +87,4 @@ static INLINE void foreach_overlappable_nb_left(const AV1_COMMON *cm,
}
}
#endif // CONFIG_MOTION_VAR
#endif // AV1_COMMON_OBMC_H_
This diff is collapsed.
......@@ -18,13 +18,11 @@
#include "av1/common/warped_motion.h"
#include "aom/aom_integer.h"
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
#define WARP_WM_NEIGHBORS_WITH_OBMC 0
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
#if CONFIG_MOTION_VAR
#define WARP_GM_NEIGHBORS_WITH_OBMC 0
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#define AOM_LEFT_TOP_MARGIN_SCALED \
((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS)
......@@ -475,7 +473,6 @@ static INLINE int av1_is_interp_search_needed(const MACROBLOCKD *const xd) {
return 0;
}
#if CONFIG_MOTION_VAR
const uint8_t *av1_get_obmc_mask(int length);
void av1_count_overlappable_neighbors(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col);
......@@ -503,7 +500,6 @@ void av1_build_obmc_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
void av1_build_ncobmc_inter_predictors_sb(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col);
#endif
#endif // CONFIG_MOTION_VAR
#define MASK_MASTER_SIZE ((MAX_WEDGE_SIZE) << 1)
#define MASK_MASTER_STRIDE (MASK_MASTER_SIZE)
......
......@@ -835,7 +835,6 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, bsize);
#if CONFIG_MOTION_VAR
if (mbmi->motion_mode == OBMC_CAUSAL) {
#if CONFIG_NCOBMC
av1_build_ncobmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
......@@ -843,7 +842,6 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
#endif
}
#endif // CONFIG_MOTION_VAR
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT) {
int plane;
......@@ -920,7 +918,7 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
aom_merge_corrupted_flag(&xd->corrupted, reader_corrupted_flag);
}
#if NC_MODE_INFO && CONFIG_MOTION_VAR
#if NC_MODE_INFO
static void detoken_and_recon_sb(AV1Decoder *const pbi, MACROBLOCKD *const xd,
int mi_row, int mi_col, aom_reader *r,
BLOCK_SIZE bsize) {
......@@ -1003,7 +1001,7 @@ static void decode_block(AV1Decoder *const pbi, MACROBLOCKD *const xd,
#endif
bsize);
#if !(CONFIG_MOTION_VAR && NC_MODE_INFO)
#if !(NC_MODE_INFO)
decode_token_and_recon_block(pbi, xd, mi_row, mi_col, r, bsize);
#endif
}
......@@ -2554,7 +2552,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
#endif
decode_partition(pbi, &td->xd, mi_row, mi_col, &td->bit_reader,
cm->sb_size);
#if NC_MODE_INFO && CONFIG_MOTION_VAR
#if NC_MODE_INFO
detoken_and_recon_sb(pbi, &td->xd, mi_row, mi_col, &td->bit_reader,
cm->sb_size);
#endif
......@@ -3618,11 +3616,9 @@ static void debug_check_frame_counts(const AV1_COMMON *const cm) {
assert(!memcmp(cm->counts.compound_interinter,
zero_counts.compound_interinter,
sizeof(cm->counts.compound_interinter)));
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
assert(!memcmp(cm->counts.motion_mode, zero_counts.motion_mode,
sizeof(cm->counts.motion_mode)));
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
#if CONFIG_NCOBMC_ADAPT_WEIGHT
assert(!memcmp(cm->counts.ncobmc_mode, zero_counts.ncobmc_mode,
sizeof(cm->counts.ncobmc_mode)));
#endif
......
......@@ -280,11 +280,10 @@ static void read_drl_idx(FRAME_CONTEXT *ec_ctx, MACROBLOCKD *xd,
}
}
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
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_MOTION_VAR || !CONFIG_WARPED_MOTION || CONFIG_NEW_MULTISYMBOL || \
#if !CONFIG_WARPED_MOTION || CONFIG_NEW_MULTISYMBOL || \
CONFIG_NCOBMC_ADAPT_WEIGHT
(void)cm;
#endif
......@@ -299,7 +298,7 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
FRAME_COUNTS *counts = xd->counts;
if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return SIMPLE_TRANSLATION;
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
#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],
......@@ -324,15 +323,15 @@ static MOTION_MODE read_motion_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
} else {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
motion_mode =
aom_read_symbol(r, xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
MOTION_MODES, ACCT_STR);
if (counts) ++counts->motion_mode[mbmi->sb_type][motion_mode];
return (MOTION_MODE)(SIMPLE_TRANSLATION + motion_mode);
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
}
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT
......@@ -354,7 +353,6 @@ static void read_ncobmc_mode(MACROBLOCKD *xd, MODE_INFO *mi,
}
}
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static PREDICTION_MODE read_inter_compound_mode(AV1_COMMON *cm, MACROBLOCKD *xd,
aom_reader *r, int16_t ctx) {
......@@ -2571,7 +2569,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
}
#endif
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
mbmi->motion_mode = SIMPLE_TRANSLATION;
#if CONFIG_WARPED_MOTION
if (mbmi->sb_type >= BLOCK_8X8 && !has_second_ref(mbmi))
......@@ -2582,9 +2579,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts, pts_inref);
#endif // CONFIG_EXT_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
#if CONFIG_MOTION_VAR
av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
#endif
if (mbmi->ref_frame[1] != INTRA_FRAME)
mbmi->motion_mode = read_motion_mode(cm, xd, mi, r);
......@@ -2596,7 +2591,6 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#if CONFIG_COMPOUND_SINGLEREF
if (is_singleref_comp_mode) assert(mbmi->motion_mode == SIMPLE_TRANSLATION);
#endif // CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
mbmi->interinter_compound_type = COMPOUND_AVERAGE;
if (
......@@ -2606,10 +2600,7 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
cm->reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode)
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
&& mbmi->motion_mode == SIMPLE_TRANSLATION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
) {
&& mbmi->motion_mode == SIMPLE_TRANSLATION) {
if (is_any_masked_compound_used(bsize)) {
#if CONFIG_JNT_COMP
if (cm->allow_masked_compound && mbmi->compound_idx)
......
......@@ -400,7 +400,6 @@ static void write_is_inter(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
}
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
const MODE_INFO *mi, aom_writer *w) {
const MB_MODE_INFO *mbmi = &mi->mbmi;
......@@ -412,7 +411,7 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
#endif
mi);
if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return;
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
#if CONFIG_NCOBMC_ADAPT_WEIGHT
if (last_motion_mode_allowed == NCOBMC_ADAPT_WEIGHT) {
aom_write_symbol(w, mbmi->motion_mode,
......@@ -433,13 +432,13 @@ static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
#endif
} else {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
aom_write_symbol(w, mbmi->motion_mode,
xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
MOTION_MODES);
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#if CONFIG_WARPED_MOTION
}
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_WARPED_MOTION
}
#if CONFIG_NCOBMC_ADAPT_WEIGHT
......@@ -457,7 +456,6 @@ static void write_ncobmc_mode(MACROBLOCKD *xd, const MODE_INFO *mi,
}
}
#endif
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
static void write_delta_qindex(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int delta_qindex, aom_writer *w) {
......@@ -1735,12 +1733,10 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
}
#endif // CONFIG_INTERINTRA
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
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
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
if (
#if CONFIG_COMPOUND_SINGLEREF
......@@ -1749,9 +1745,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
cpi->common.reference_mode != SINGLE_REFERENCE &&
is_inter_compound_mode(mbmi->mode) &&
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_MOTION_VAR
mbmi->motion_mode == SIMPLE_TRANSLATION &&
#endif // CONFIG_MOTION_VAR
is_any_masked_compound_used(bsize)) {
#if CONFIG_JNT_COMP
if (cm->allow_masked_compound && mbmi->compound_idx)
......@@ -2332,7 +2326,7 @@ static void write_tokens_b(AV1_COMP *cpi, const TileInfo *const tile,
#endif // CONFIG_COEF_INTERLEAVE
}
#if CONFIG_MOTION_VAR && NC_MODE_INFO
#if NC_MODE_INFO
static void write_tokens_sb(AV1_COMP *cpi, const TileInfo *const tile,
aom_writer *w, const TOKENEXTRA **tok,
const TOKENEXTRA *const tok_end, int mi_row,
......@@ -2406,7 +2400,7 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
int mi_col) {
write_mbmi_b(cpi, tile, w, mi_row, mi_col);
#if CONFIG_MOTION_VAR && NC_MODE_INFO
#if NC_MODE_INFO
(void)tok;
(void)tok_end;
#else
......@@ -2713,7 +2707,7 @@ static void write_modes(AV1_COMP *const cpi, const TileInfo *const tile,
for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += cm->mib_size) {
write_modes_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col, cm->sb_size);
#if CONFIG_MOTION_VAR && NC_MODE_INFO
#if NC_MODE_INFO