Commit 0bdea0d8 authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove compile guards for CONFIG_EXT_INTER

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

Change-Id: Ic077963f72e8cc2ae9872b58c8a0241988384110
parent 355a7a71
......@@ -369,12 +369,10 @@ if (CONFIG_AV1_ENCODER)
"${AOM_ROOT}/aom_dsp/mips/variance_msa.c"
"${AOM_ROOT}/aom_dsp/mips/sub_pixel_variance_msa.c")
if (CONFIG_EXT_INTER)
set(AOM_DSP_ENCODER_INTRIN_SSSE3
${AOM_DSP_ENCODER_INTRIN_SSSE3}
"${AOM_ROOT}/aom_dsp/x86/masked_sad_intrin_ssse3.c"
"${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c")
endif ()
if (CONFIG_HIGHBITDEPTH)
set(AOM_DSP_ENCODER_INTRIN_SSE2
......
......@@ -354,10 +354,8 @@ DSP_SRCS-$(HAVE_AVX2) += x86/sad_highbd_avx2.c
endif
ifeq ($(CONFIG_AV1_ENCODER),yes)
ifeq ($(CONFIG_EXT_INTER),yes)
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_sad_intrin_ssse3.c
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c
endif #CONFIG_EXT_INTER
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
......
......@@ -811,7 +811,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
#
# Masked SAD
#
if (aom_config("CONFIG_EXT_INTER") eq "yes") {
foreach (@block_sizes) {
($w, $h) = @$_;
add_proto qw/unsigned int/, "aom_masked_sad${w}x${h}", "const uint8_t *src, int src_stride, const uint8_t *ref, int ref_stride, const uint8_t *second_pred, const uint8_t *msk, int msk_stride, int invert_mask";
......@@ -825,7 +824,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
specialize "aom_highbd_masked_sad${w}x${h}", qw/ssse3/;
}
}
}
#
# OBMC SAD
......@@ -1143,7 +1141,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
}
} # CONFIG_HIGHBITDEPTH
if (aom_config("CONFIG_EXT_INTER") eq "yes") {
#
# Masked Variance / Masked Subpixel Variance
#
......@@ -1162,7 +1159,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
}
}
}
}
#
# OBMC Variance / OBMC Subpixel Variance
......@@ -1601,14 +1597,12 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
} # CONFIG_HIGHBITDEPTH
if (aom_config("CONFIG_EXT_INTER") eq "yes") {
add_proto qw/void aom_comp_mask_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, const uint8_t *ref, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
add_proto qw/void aom_comp_mask_upsampled_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
add_proto qw/void aom_highbd_comp_mask_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, const uint8_t *ref8, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask";
add_proto qw/void aom_highbd_comp_mask_upsampled_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, int subsample_x_q3, int subsample_y_q3, const uint8_t *ref8, int ref_stride, const uint8_t *mask, int mask_stride, int invert_mask, int bd";
}
}
} # CONFIG_AV1_ENCODER
......
......@@ -348,7 +348,7 @@ highbd_sadMxNx4D(128, 32)
/* clang-format on */
#endif // CONFIG_HIGHBITDEPTH
#if CONFIG_AV1 && CONFIG_EXT_INTER
#if CONFIG_AV1
static INLINE
unsigned int masked_sad(const uint8_t *src, int src_stride,
const uint8_t *a, int a_stride, const uint8_t *b,
......@@ -490,7 +490,7 @@ HIGHBD_MASKSADMXN(32, 128)
HIGHBD_MASKSADMXN(128, 32)
#endif
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
#endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR
// pre: predictor being evaluated
......
......@@ -773,7 +773,7 @@ void aom_highbd_comp_avg_upsampled_pred_c(uint16_t *comp_pred,
}
#endif // CONFIG_HIGHBITDEPTH
#if CONFIG_AV1 && CONFIG_EXT_INTER
#if CONFIG_AV1
void aom_comp_mask_pred_c(uint8_t *comp_pred, const uint8_t *pred, int width,
int height, const uint8_t *ref, int ref_stride,
const uint8_t *mask, int mask_stride,
......@@ -1011,7 +1011,7 @@ HIGHBD_MASK_SUBPIX_VAR(128, 32)
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
#endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR
static INLINE void obmc_variance(const uint8_t *pre, int pre_stride,
......
......@@ -54,7 +54,7 @@ typedef unsigned int (*aom_subp_avg_variance_fn_t)(
const uint8_t *a, int a_stride, int xoffset, int yoffset, const uint8_t *b,
int b_stride, unsigned int *sse, const uint8_t *second_pred);
#if CONFIG_AV1 && CONFIG_EXT_INTER
#if CONFIG_AV1
typedef unsigned int (*aom_masked_sad_fn_t)(const uint8_t *src, int src_stride,
const uint8_t *ref, int ref_stride,
const uint8_t *second_pred,
......@@ -64,7 +64,7 @@ typedef unsigned int (*aom_masked_subpixvariance_fn_t)(
const uint8_t *src, int src_stride, int xoffset, int yoffset,
const uint8_t *ref, int ref_stride, const uint8_t *second_pred,
const uint8_t *msk, int msk_stride, int invert_mask, unsigned int *sse);
#endif // CONFIG_AV1 && CONFIG_EXT_INTER
#endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR
typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride,
......@@ -90,10 +90,8 @@ typedef struct aom_variance_vtable {
aom_sad_multi_fn_t sdx3f;
aom_sad_multi_fn_t sdx8f;
aom_sad_multi_d_fn_t sdx4df;
#if CONFIG_EXT_INTER
aom_masked_sad_fn_t msdf;
aom_masked_subpixvariance_fn_t msvf;
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR
aom_obmc_sad_fn_t osdf;
aom_obmc_variance_fn_t ovf;
......
......@@ -298,7 +298,6 @@ if (CONFIG_CONVOLVE_ROUND)
"${AOM_ROOT}/av1/common/x86/convolve_avx2.c")
endif ()
if (CONFIG_EXT_INTER)
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/wedge_utils.c")
......@@ -306,7 +305,6 @@ if (CONFIG_EXT_INTER)
set(AOM_AV1_ENCODER_INTRIN_SSE2
${AOM_AV1_ENCODER_INTRIN_SSE2}
"${AOM_ROOT}/av1/encoder/x86/wedge_utils_sse2.c")
endif ()
if (CONFIG_FILTER_INTRA)
set(AOM_AV1_COMMON_INTRIN_SSE4_1
......
......@@ -152,10 +152,8 @@ AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/av1_highbd_quantize_sse4.c
AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/highbd_fwd_txfm_sse4.c
ifeq ($(CONFIG_EXT_INTER),yes)
AV1_CX_SRCS-yes += encoder/wedge_utils.c
AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/wedge_utils_sse2.c
endif
AV1_CX_SRCS-$(HAVE_AVX2) += encoder/x86/error_intrin_avx2.c
......
......@@ -592,14 +592,12 @@ static const int mode_lf_lut[] = {
0, 0,
#endif // CONFIG_SMOOTH_HV
1, 1, 0, 1, // INTER_MODES (ZEROMV == 0)
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SINGLEREF
// 1, 1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES
// NOTE(zoeliu): Remove SR_NEAREST_NEWMV
1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES
#endif // CONFIG_COMPOUND_SINGLEREF
1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (ZERO_ZEROMV == 0)
#endif // CONFIG_EXT_INTER
};
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
......
......@@ -492,14 +492,12 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
# End av1_high encoder functions
if (aom_config("CONFIG_EXT_INTER") eq "yes") {
add_proto qw/uint64_t av1_wedge_sse_from_residuals/, "const int16_t *r1, const int16_t *d, const uint8_t *m, int N";
specialize qw/av1_wedge_sse_from_residuals sse2/;
add_proto qw/int av1_wedge_sign_from_residuals/, "const int16_t *ds, const uint8_t *m, int N, int64_t limit";
specialize qw/av1_wedge_sign_from_residuals sse2/;
add_proto qw/void av1_wedge_compute_delta_squares/, "int16_t *d, const int16_t *a, const int16_t *b, int N";
specialize qw/av1_wedge_compute_delta_squares sse2/;
}
}
# end encoder functions
......
......@@ -43,8 +43,6 @@ extern "C" {
#define MAX_MB_PLANE 3
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SEGMENT
// Set COMPOUND_SEGMENT_TYPE to one of the three
// 0: Uniform
......@@ -65,7 +63,6 @@ typedef enum {
} SEG_MASK_TYPE;
#endif // CONFIG_COMPOUND_SEGMENT
#endif // CONFIG_EXT_INTER
typedef enum {
KEY_FRAME = 0,
......@@ -87,11 +84,7 @@ static INLINE int is_comp_ref_allowed(BLOCK_SIZE bsize) {
}
static INLINE int is_inter_mode(PREDICTION_MODE mode) {
#if CONFIG_EXT_INTER
return mode >= NEARESTMV && mode <= NEW_NEWMV;
#else
return mode >= NEARESTMV && mode <= NEWMV;
#endif // CONFIG_EXT_INTER
}
#if CONFIG_PVQ
......@@ -136,7 +129,6 @@ typedef struct {
int stride[MAX_MB_PLANE];
} BUFFER_SET;
#if CONFIG_EXT_INTER
static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) {
return mode >= NEARESTMV && mode <= NEWMV;
}
......@@ -282,17 +274,6 @@ static INLINE int is_masked_compound_type(COMPOUND_TYPE type) {
return 0;
}
#else // !CONFIG_EXT_INTER
static INLINE int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
return (mode == NEARMV);
}
static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
return (mode == NEWMV);
}
#endif // CONFIG_EXT_INTER
/* For keyframes, intra block modes are predicted by the (already decoded)
modes for the Y blocks to the left and above us; for interframes, there
is a single probability table. */
......@@ -301,9 +282,7 @@ typedef struct {
PREDICTION_MODE as_mode;
int_mv as_mv[2]; // first, second inter predictor motion vectors
int_mv pred_mv[2];
#if CONFIG_EXT_INTER
int_mv ref_mv[2];
#endif // CONFIG_EXT_INTER
} b_mode_info;
typedef int8_t MV_REFERENCE_FRAME;
......@@ -353,7 +332,6 @@ typedef struct RD_STATS {
#endif // CONFIG_RD_DEBUG
} RD_STATS;
#if CONFIG_EXT_INTER
// This struct is used to group function args that are commonly
// sent together in functions related to interinter compound modes
typedef struct {
......@@ -367,7 +345,6 @@ typedef struct {
#endif // CONFIG_COMPOUND_SEGMENT
COMPOUND_TYPE interinter_compound_type;
} INTERINTER_COMPOUND_DATA;
#endif // CONFIG_EXT_INTER
// This structure now relates to 8x8 block regions.
typedef struct MB_MODE_INFO {
......@@ -425,7 +402,6 @@ typedef struct MB_MODE_INFO {
#endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
// interintra members
INTERINTRA_MODE interintra_mode;
......@@ -443,7 +419,6 @@ typedef struct MB_MODE_INFO {
#if CONFIG_COMPOUND_SEGMENT
SEG_MASK_TYPE mask_type;
#endif // CONFIG_COMPOUND_SEGMENT
#endif // CONFIG_EXT_INTER
MOTION_MODE motion_mode;
#if CONFIG_MOTION_VAR
int overlappable_neighbors[2];
......@@ -597,12 +572,8 @@ static INLINE int is_global_mv_block(const MODE_INFO *mi, int block,
const int block_size_allowed =
AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
#endif // GLOBAL_SUB8X8_USED
#if CONFIG_EXT_INTER
return (mode == ZEROMV || mode == ZERO_ZEROMV) && type > TRANSLATION &&
block_size_allowed;
#else
return mode == ZEROMV && type > TRANSLATION && block_size_allowed;
#endif // CONFIG_EXT_INTER
}
#endif // CONFIG_GLOBAL_MOTION
......@@ -839,9 +810,9 @@ typedef struct macroblockd {
const EobThresholdMD *eob_threshold_md;
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT
#if CONFIG_COMPOUND_SEGMENT
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT
#endif // CONFIG_COMPOUND_SEGMENT
#if CONFIG_MRC_TX
uint8_t *mrc_mask;
......@@ -1424,7 +1395,6 @@ void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
int plane, TX_SIZE tx_size, int has_eob, int aoff,
int loff);
#if CONFIG_EXT_INTER
static INLINE int is_interintra_allowed_bsize(const BLOCK_SIZE bsize) {
#if CONFIG_INTERINTRA
// TODO(debargha): Should this be bsize < BLOCK_LARGEST?
......@@ -1473,7 +1443,6 @@ static INLINE int is_interintra_allowed_bsize_group(int group) {
static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) {
return (mbmi->ref_frame[1] == INTRA_FRAME) && is_interintra_allowed(mbmi);
}
#endif // CONFIG_EXT_INTER
#if CONFIG_VAR_TX
static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi,
......@@ -1509,11 +1478,11 @@ static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
static INLINE int is_motion_variation_allowed_compound(
const MB_MODE_INFO *mbmi) {
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
if (!has_second_ref(mbmi) && !is_inter_singleref_comp_mode(mbmi->mode))
#else
if (!has_second_ref(mbmi))
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
return 1;
else
return 0;
......@@ -1556,14 +1525,9 @@ static INLINE MOTION_MODE motion_mode_allowed(
#if CONFIG_AMVR
}
#endif
#if CONFIG_EXT_INTER
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)) {
#else
if (is_motion_variation_allowed_bsize(mbmi->sb_type) &&
is_inter_mode(mbmi->mode) && is_motion_variation_allowed_compound(mbmi)) {
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR
if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
#endif
......@@ -1684,23 +1648,13 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) {
// First check if all modes are ZEROMV
if (mbmi->sb_type >= BLOCK_8X8 || unify_bsize) {
#if CONFIG_EXT_INTER
if (mbmi->mode != ZEROMV && mbmi->mode != ZERO_ZEROMV) return 0;
#else
if (mbmi->mode != ZEROMV) return 0;
#endif // CONFIG_EXT_INTER
} else {
#if CONFIG_EXT_INTER
if ((mi->bmi[0].as_mode != ZEROMV && mi->bmi[0].as_mode != ZERO_ZEROMV) ||
(mi->bmi[1].as_mode != ZEROMV && mi->bmi[1].as_mode != ZERO_ZEROMV) ||
(mi->bmi[2].as_mode != ZEROMV && mi->bmi[2].as_mode != ZERO_ZEROMV) ||
(mi->bmi[3].as_mode != ZEROMV && mi->bmi[3].as_mode != ZERO_ZEROMV))
return 0;
#else
if (mi->bmi[0].as_mode != ZEROMV || mi->bmi[1].as_mode != ZEROMV ||
mi->bmi[2].as_mode != ZEROMV || mi->bmi[3].as_mode != ZEROMV)
return 0;
#endif // CONFIG_EXT_INTER
}
#if !GLOBAL_SUB8X8_USED
......
......@@ -2339,9 +2339,8 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#endif
#endif
// FIXME: cdfs not defined for super_tx
// FIXME: cdfs not defined for super_tx
#if CONFIG_EXT_INTER
AVERAGE_TILE_CDFS(inter_compound_mode_cdf)
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
......@@ -2358,7 +2357,6 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#endif
AVERAGE_TILE_CDFS(interintra_mode_cdf)
#endif
#endif // CONFIG_EXT_INTER
/* NB: kf_y_cdf is discarded after use, so no need
for backwards update */
......
......@@ -888,7 +888,6 @@ static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = {
};
#endif
#if CONFIG_EXT_INTER
static const aom_prob default_inter_compound_mode_probs
[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = {
{ 154, 167, 233, 165, 143, 170, 167 }, // 0 = both zero mv
......@@ -1207,7 +1206,6 @@ static const aom_cdf_prob
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_NCOBMC_ADAPT_WEIGHT
#ifdef TWO_MODE
......@@ -1706,7 +1704,6 @@ const int av1_intra_mode_inv[INTRA_MODES] = {
};
#endif // CONFIG_SMOOTH_HV
#if CONFIG_EXT_INTER
/* clang-format off */
#if CONFIG_INTERINTRA
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = {
......@@ -1764,7 +1761,6 @@ const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {};
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
/* clang-format on */
#endif // CONFIG_EXT_INTER
const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
-PARTITION_NONE, 2, -PARTITION_HORZ, 4, -PARTITION_VERT, -PARTITION_SPLIT
......@@ -2015,13 +2011,13 @@ static const aom_cdf_prob
};
#endif // CONFIG_NEW_MULTISYMBOL
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): Default values to be further adjusted based on the collected
// stats.
static const aom_prob default_comp_inter_mode_p[COMP_INTER_MODE_CONTEXTS] = {
40, 110, 160, 220
};
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
// TODO(huisu): tune these cdfs
const aom_cdf_prob
......@@ -4960,9 +4956,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->single_ref_cdf, default_single_ref_cdf);
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->comp_inter_mode_prob, default_comp_inter_mode_p);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
fc->quarter_tx_size_prob = default_quarter_tx_size_prob;
#endif
......@@ -5001,7 +4997,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
#if CONFIG_EXT_INTER
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
......@@ -5024,7 +5019,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->interintra_mode_prob, default_interintra_mode_prob);
av1_copy(fc->interintra_mode_cdf, default_interintra_mode_cdf);
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_SUPERTX
av1_copy(fc->supertx_prob, default_supertx_prob);
#endif // CONFIG_SUPERTX
......@@ -5120,12 +5114,12 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
fc->single_ref_prob[i][j] = av1_mode_mv_merge_probs(
pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]);
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
for (i = 0; i < COMP_INTER_MODE_CONTEXTS; i++)
fc->comp_inter_mode_prob[i] = av1_mode_mv_merge_probs(
pre_fc->comp_inter_mode_prob[i], counts->comp_inter_mode[i]);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i)
fc->newmv_prob[i] =
......@@ -5171,7 +5165,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
}
#endif // CONFIG_SUPERTX
#if CONFIG_EXT_INTER
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
aom_tree_merge_probs(
av1_inter_compound_mode_tree, pre_fc->inter_compound_mode_probs[i],
......@@ -5214,7 +5207,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
}
}
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#endif // CONFIG_EXT_INTER
}
void av1_adapt_intra_frame_probs(AV1_COMMON *cm) {
......
......@@ -33,12 +33,10 @@ extern "C" {
#define TX_SIZE_CONTEXTS 2
#define INTER_OFFSET(mode) ((mode)-NEARESTMV)
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SINGLEREF
#define INTER_SINGLEREF_COMP_OFFSET(mode) ((mode)-SR_NEAREST_NEARMV)
#endif // CONFIG_COMPOUND_SINGLEREF
#define INTER_COMPOUND_OFFSET(mode) ((mode)-NEAREST_NEARESTMV)
#endif // CONFIG_EXT_INTER
// Number of possible contexts for a color index.
// As can be seen from av1_get_palette_color_index_context(), the possible
......@@ -214,7 +212,6 @@ typedef struct frame_contexts {
aom_cdf_prob drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)];
#endif
#if CONFIG_EXT_INTER
aom_prob inter_compound_mode_probs[INTER_MODE_CONTEXTS]
[INTER_COMPOUND_MODES - 1];
aom_cdf_prob inter_compound_mode_cdf[INTER_MODE_CONTEXTS]
......@@ -240,7 +237,6 @@ typedef struct frame_contexts {
aom_cdf_prob interintra_mode_cdf[BLOCK_SIZE_GROUPS]
[CDF_SIZE(INTERINTRA_MODES)];
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#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)];
......@@ -308,9 +304,9 @@ typedef struct frame_contexts {
aom_cdf_prob comp_ref_cdf[REF_CONTEXTS][COMP_REFS - 1][CDF_SIZE(2)];
#endif // CONFIG_EXT_REFS
#endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
aom_prob comp_inter_mode_prob[COMP_INTER_MODE_CONTEXTS];
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
aom_prob quarter_tx_size_prob;
#endif
......@@ -450,7 +446,6 @@ typedef struct FRAME_COUNTS {
unsigned int refmv_mode[REFMV_MODE_CONTEXTS][2];
unsigned int drl_mode[DRL_MODE_CONTEXTS][2];
#if CONFIG_EXT_INTER
unsigned int inter_compound_mode[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES];
#if CONFIG_COMPOUND_SINGLEREF
unsigned int inter_singleref_comp_mode[INTER_MODE_CONTEXTS]
......@@ -462,7 +457,6 @@ typedef struct FRAME_COUNTS {
unsigned int wedge_interintra[BLOCK_SIZES_ALL][2];
#endif // CONFIG_INTERINTRA
unsigned int compound_interinter[BLOCK_SIZES_ALL][COMPOUND_TYPES];
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
unsigned int motion_mode[BLOCK_SIZES_ALL][MOTION_MODES];
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
......@@ -488,9 +482,9 @@ typedef struct FRAME_COUNTS {
#else
unsigned int comp_ref[REF_CONTEXTS][COMP_REFS - 1][2];
#endif // CONFIG_EXT_REFS
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
unsigned int comp_inter_mode[COMP_INTER_MODE_CONTEXTS][2];
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
// TODO(urvang): Only needed for !CONFIG_VAR_TX case. So can be removed when
// CONFIG_VAR_TX flag is removed.
unsigned int tx_size[MAX_TX_DEPTH][TX_SIZE_CONTEXTS][MAX_TX_DEPTH + 1];
......@@ -553,7 +547,6 @@ extern int av1_ext_tx_ind[EXT_TX_SET_TYPES][TX_TYPES];
extern int av1_ext_tx_inv[EXT_TX_SET_TYPES][TX_TYPES];
#endif
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
extern const aom_tree_index
av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)];
......@@ -565,7 +558,6 @@ extern const aom_tree_index
av1_inter_singleref_comp_mode_tree[TREE_SIZE(INTER_SINGLEREF_COMP_MODES)];
#endif // CONFIG_COMPOUND_SINGLEREF
extern const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)];
#endif // CONFIG_EXT_INTER
extern const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)];
#if CONFIG_EXT_PARTITION_TYPES
extern const aom_tree_index
......
......@@ -486,7 +486,6 @@ typedef enum ATTRIBUTE_PACKED {
NEARMV,
ZEROMV,
NEWMV,
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SINGLEREF
// Single ref compound modes
SR_NEAREST_NEARMV,
......@@ -504,7 +503,6 @@ typedef enum ATTRIBUTE_PACKED {
NEW_NEARMV,
ZERO_ZEROMV,
NEW_NEWMV,
#endif // CONFIG_EXT_INTER
MB_MODE_COUNT,
INTRA_MODES = TM_PRED + 1, // TM_PRED has to be the last intra mode.
INTRA_INVALID = MB_MODE_COUNT // For uv_mode in inter blocks
......@@ -558,7 +556,6 @@ typedef enum {
#endif
} MOTION_MODE;
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
typedef enum {
II_DC_PRED = 0,
......@@ -579,7 +576,6 @@ typedef enum {
#endif // CONFIG_COMPOUND_SEGMENT
COMPOUND_TYPES,
} COMPOUND_TYPE;
#endif // CONFIG_EXT_INTER
// TODO(huisu): Consider adding FILTER_SMOOTH_PRED to "FILTER_INTRA_MODE".
#if CONFIG_FILTER_INTRA
......@@ -604,13 +600,11 @@ typedef enum {
#define INTER_MODES (1 + NEWMV - NEARESTMV)
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SINGLEREF
#define INTER_SINGLEREF_COMP_MODES (1 + SR_NEW_NEWMV - SR_NEAREST_NEARMV)
#endif // CONFIG_COMPOUND_SINGLEREF
#define INTER_COMPOUND_MODES (1 + NEW_NEWMV - NEAREST_NEARESTMV)
#endif // CONFIG_EXT_INTER
#define SKIP_CONTEXTS 3
......@@ -662,9 +656,9 @@ typedef enum {
#define UNI_COMP_REF_CONTEXTS 3
#endif // CONFIG_EXT_COMP_REFS
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SINGLEREF
#define COMP_INTER_MODE_CONTEXTS 4
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_VAR_TX
#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 2)
......
......@@ -123,12 +123,7 @@ static uint8_t add_ref_mv_candidate(const MODE_INFO *const candidate_mi,
ref_mv_stack[index].weight = weight * len;
++(*refmv_count);
#if CONFIG_EXT_INTER
if (candidate->mode == NEW_NEWMV)
#else
if (candidate->mode == NEWMV)
#endif // CONFIG_EXT_INTER
++newmv_count;
if (candidate->mode == NEW_NEWMV) ++newmv_count;
}
if (candidate_mi->mbmi.sb_type < BLOCK_8X8 && block >= 0 &&
......@@ -164,12 +159,7 @@ static uint8_t add_ref_mv_candidate(const MODE_INFO *const candidate_mi,
ref_mv_stack[index].weight = len;
++(*refmv_count);
#if CONFIG_EXT_INTER
if (candidate->mode == NEW_NEWMV)
#else
if (candidate->mode == NEWMV)
#endif // CONFIG_EXT_INTER
++newmv_count;
if (candidate->mode == NEW_NEWMV) ++newmv_count;
}
}
}
......@@ -1043,7 +1033,6 @@ Done:
mv_ref_list[i].as_int = zeromv.as_int;
}
#if CONFIG_EXT_INTER
// This function keeps a mode count for a given MB/SB
void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
......@@ -1093,17 +1082,13 @@ Done:
if (mode_context)
mode_context[ref_frame] = counter_to_context[context_counter];
}
#endif // CONFIG_EXT_INTER
void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
uint8_t *ref_mv_count, CANDIDATE_MV *ref_mv_stack,
#if CONFIG_EXT_INTER
int16_t *compound_mode_context,
#endif // CONFIG_EXT_INTER
int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data,
int16_t *mode_context) {
int16_t *compound_mode_context, int_mv *mv_ref_list,
int mi_row, int mi_col, find_mv_refs_sync sync,
void *const data, int16_t *mode_context) {
int_mv zeromv[2];
#if CONFIG_GLOBAL_MOTION
BLOCK_SIZE bsize = mi->mbmi.sb_type;
......@@ -1113,10 +1098,8 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MV_REFERENCE_FRAME rf[2];
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_EXT_INTER
av1_update_mv_context(cm, xd, mi, ref_frame, mv_ref_list, -1, mi_row, mi_col,
compound_mode_context);
#endif // CONFIG_EXT_INTER
#if CONFIG_GLOBAL_MOTION
if (!CONFIG_INTRABC || ref_frame != INTRA_FRAME) {
......@@ -1206,14 +1189,8 @@ void av1_find_best_ref_mvs(int allow_hp, int_mv *mvlist, int_mv *nearest_mv,
void av1_append_sub8x8_mvs_for_idx(const AV1_COMMON *cm, MACROBLOCKD *xd,
int block, int ref, int mi_row, int mi_col,
CANDIDATE_MV *ref_mv_stack,
uint8_t *ref_mv_count,
#if CONFIG_EXT_INTER
int_mv *mv_list,
#endif // CONFIG_EXT_INTER
uint8_t *ref_mv_count, int_mv *mv_list,
int_mv *nearest_mv, int_mv *near_mv) {
#if !CONFIG_EXT_INTER
int_mv mv_list[MAX_MV_REF_CANDIDATES];
#endif // !CONFIG_EXT_INTER
MODE_INFO *const mi = xd->mi[0];
b_mode_info *bmi = mi->bmi;
int n;
......
......@@ -63,7 +63,6 @@ static const int mode_2_counter[] = {
0, // NEARMV
3, // ZEROMV
1, // NEWMV
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SINGLEREF
0, // SR_NEAREST_NEARMV
// 1, // SR_NEAREST_NEWMV
......@@ -79,7 +78,6 @@ static const int mode_2_counter[] = {
1, // NEW_NEARMV
3, // ZERO_ZEROMV
1, // NEW_NEWMV
#endif // CONFIG_EXT_INTER
};
// There are 3^3 different combinations of 3 counts that can be either 0,1 or
......@@ -401,12 +399,9 @@ typedef void (*find_mv_refs_sync)(void *const data, int mi_row);
void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
uint8_t *ref_mv_count, CANDIDATE_MV *ref_mv_stack,
#if CONFIG_EXT_INTER
int16_t *compound_mode_context,
#endif // CONFIG_EXT_INTER
int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync