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) ...@@ -369,12 +369,10 @@ if (CONFIG_AV1_ENCODER)
"${AOM_ROOT}/aom_dsp/mips/variance_msa.c" "${AOM_ROOT}/aom_dsp/mips/variance_msa.c"
"${AOM_ROOT}/aom_dsp/mips/sub_pixel_variance_msa.c") "${AOM_ROOT}/aom_dsp/mips/sub_pixel_variance_msa.c")
if (CONFIG_EXT_INTER)
set(AOM_DSP_ENCODER_INTRIN_SSSE3 set(AOM_DSP_ENCODER_INTRIN_SSSE3
${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_sad_intrin_ssse3.c"
"${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c") "${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c")
endif ()
if (CONFIG_HIGHBITDEPTH) if (CONFIG_HIGHBITDEPTH)
set(AOM_DSP_ENCODER_INTRIN_SSE2 set(AOM_DSP_ENCODER_INTRIN_SSE2
......
...@@ -354,10 +354,8 @@ DSP_SRCS-$(HAVE_AVX2) += x86/sad_highbd_avx2.c ...@@ -354,10 +354,8 @@ DSP_SRCS-$(HAVE_AVX2) += x86/sad_highbd_avx2.c
endif endif
ifeq ($(CONFIG_AV1_ENCODER),yes) 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_sad_intrin_ssse3.c
DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c DSP_SRCS-$(HAVE_SSSE3) += x86/masked_variance_intrin_ssse3.c
endif #CONFIG_EXT_INTER
ifeq ($(CONFIG_MOTION_VAR),yes) ifeq ($(CONFIG_MOTION_VAR),yes)
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_sad_sse4.c DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_sad_sse4.c
DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_variance_sse4.c DSP_SRCS-$(HAVE_SSE4_1) += x86/obmc_variance_sse4.c
......
...@@ -811,7 +811,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { ...@@ -811,7 +811,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
# #
# Masked SAD # Masked SAD
# #
if (aom_config("CONFIG_EXT_INTER") eq "yes") {
foreach (@block_sizes) { foreach (@block_sizes) {
($w, $h) = @$_; ($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"; 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") { ...@@ -825,7 +824,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
specialize "aom_highbd_masked_sad${w}x${h}", qw/ssse3/; specialize "aom_highbd_masked_sad${w}x${h}", qw/ssse3/;
} }
} }
}
# #
# OBMC SAD # OBMC SAD
...@@ -1143,7 +1141,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { ...@@ -1143,7 +1141,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
} }
} # CONFIG_HIGHBITDEPTH } # CONFIG_HIGHBITDEPTH
if (aom_config("CONFIG_EXT_INTER") eq "yes") {
# #
# Masked Variance / Masked Subpixel Variance # Masked Variance / Masked Subpixel Variance
# #
...@@ -1162,7 +1159,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { ...@@ -1162,7 +1159,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
} }
} }
} }
}
# #
# OBMC Variance / OBMC Subpixel Variance # OBMC Variance / OBMC Subpixel Variance
...@@ -1601,14 +1597,12 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { ...@@ -1601,14 +1597,12 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
} # CONFIG_HIGHBITDEPTH } # 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_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"; 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") { 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_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"; 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 } # CONFIG_AV1_ENCODER
......
...@@ -348,7 +348,7 @@ highbd_sadMxNx4D(128, 32) ...@@ -348,7 +348,7 @@ highbd_sadMxNx4D(128, 32)
/* clang-format on */ /* clang-format on */
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
#if CONFIG_AV1 && CONFIG_EXT_INTER #if CONFIG_AV1
static INLINE static INLINE
unsigned int masked_sad(const uint8_t *src, int src_stride, unsigned int masked_sad(const uint8_t *src, int src_stride,
const uint8_t *a, int a_stride, const uint8_t *b, const uint8_t *a, int a_stride, const uint8_t *b,
...@@ -490,7 +490,7 @@ HIGHBD_MASKSADMXN(32, 128) ...@@ -490,7 +490,7 @@ HIGHBD_MASKSADMXN(32, 128)
HIGHBD_MASKSADMXN(128, 32) HIGHBD_MASKSADMXN(128, 32)
#endif #endif
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER #endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR #if CONFIG_AV1 && CONFIG_MOTION_VAR
// pre: predictor being evaluated // pre: predictor being evaluated
......
...@@ -773,7 +773,7 @@ void aom_highbd_comp_avg_upsampled_pred_c(uint16_t *comp_pred, ...@@ -773,7 +773,7 @@ void aom_highbd_comp_avg_upsampled_pred_c(uint16_t *comp_pred,
} }
#endif // CONFIG_HIGHBITDEPTH #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, 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, int height, const uint8_t *ref, int ref_stride,
const uint8_t *mask, int mask_stride, const uint8_t *mask, int mask_stride,
...@@ -1011,7 +1011,7 @@ HIGHBD_MASK_SUBPIX_VAR(128, 32) ...@@ -1011,7 +1011,7 @@ HIGHBD_MASK_SUBPIX_VAR(128, 32)
#endif // CONFIG_EXT_PARTITION #endif // CONFIG_EXT_PARTITION
#endif // CONFIG_EXT_PARTITION_TYPES #endif // CONFIG_EXT_PARTITION_TYPES
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_AV1 && CONFIG_EXT_INTER #endif // CONFIG_AV1
#if CONFIG_AV1 && CONFIG_MOTION_VAR #if CONFIG_AV1 && CONFIG_MOTION_VAR
static INLINE void obmc_variance(const uint8_t *pre, int pre_stride, 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)( ...@@ -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, 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); 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, 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 *ref, int ref_stride,
const uint8_t *second_pred, const uint8_t *second_pred,
...@@ -64,7 +64,7 @@ typedef unsigned int (*aom_masked_subpixvariance_fn_t)( ...@@ -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 *src, int src_stride, int xoffset, int yoffset,
const uint8_t *ref, int ref_stride, const uint8_t *second_pred, 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); 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 #if CONFIG_AV1 && CONFIG_MOTION_VAR
typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride, typedef unsigned int (*aom_obmc_sad_fn_t)(const uint8_t *pred, int pred_stride,
...@@ -90,10 +90,8 @@ typedef struct aom_variance_vtable { ...@@ -90,10 +90,8 @@ typedef struct aom_variance_vtable {
aom_sad_multi_fn_t sdx3f; aom_sad_multi_fn_t sdx3f;
aom_sad_multi_fn_t sdx8f; aom_sad_multi_fn_t sdx8f;
aom_sad_multi_d_fn_t sdx4df; aom_sad_multi_d_fn_t sdx4df;
#if CONFIG_EXT_INTER
aom_masked_sad_fn_t msdf; aom_masked_sad_fn_t msdf;
aom_masked_subpixvariance_fn_t msvf; aom_masked_subpixvariance_fn_t msvf;
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR #if CONFIG_MOTION_VAR
aom_obmc_sad_fn_t osdf; aom_obmc_sad_fn_t osdf;
aom_obmc_variance_fn_t ovf; aom_obmc_variance_fn_t ovf;
......
...@@ -298,7 +298,6 @@ if (CONFIG_CONVOLVE_ROUND) ...@@ -298,7 +298,6 @@ if (CONFIG_CONVOLVE_ROUND)
"${AOM_ROOT}/av1/common/x86/convolve_avx2.c") "${AOM_ROOT}/av1/common/x86/convolve_avx2.c")
endif () endif ()
if (CONFIG_EXT_INTER)
set(AOM_AV1_ENCODER_SOURCES set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES} ${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/wedge_utils.c") "${AOM_ROOT}/av1/encoder/wedge_utils.c")
...@@ -306,7 +305,6 @@ if (CONFIG_EXT_INTER) ...@@ -306,7 +305,6 @@ if (CONFIG_EXT_INTER)
set(AOM_AV1_ENCODER_INTRIN_SSE2 set(AOM_AV1_ENCODER_INTRIN_SSE2
${AOM_AV1_ENCODER_INTRIN_SSE2} ${AOM_AV1_ENCODER_INTRIN_SSE2}
"${AOM_ROOT}/av1/encoder/x86/wedge_utils_sse2.c") "${AOM_ROOT}/av1/encoder/x86/wedge_utils_sse2.c")
endif ()
if (CONFIG_FILTER_INTRA) if (CONFIG_FILTER_INTRA)
set(AOM_AV1_COMMON_INTRIN_SSE4_1 set(AOM_AV1_COMMON_INTRIN_SSE4_1
......
...@@ -152,10 +152,8 @@ AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/av1_highbd_quantize_sse4.c ...@@ -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 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-yes += encoder/wedge_utils.c
AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/wedge_utils_sse2.c AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/wedge_utils_sse2.c
endif
AV1_CX_SRCS-$(HAVE_AVX2) += encoder/x86/error_intrin_avx2.c AV1_CX_SRCS-$(HAVE_AVX2) += encoder/x86/error_intrin_avx2.c
......
...@@ -592,14 +592,12 @@ static const int mode_lf_lut[] = { ...@@ -592,14 +592,12 @@ static const int mode_lf_lut[] = {
0, 0, 0, 0,
#endif // CONFIG_SMOOTH_HV #endif // CONFIG_SMOOTH_HV
1, 1, 0, 1, // INTER_MODES (ZEROMV == 0) 1, 1, 0, 1, // INTER_MODES (ZEROMV == 0)
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SINGLEREF #if CONFIG_COMPOUND_SINGLEREF
// 1, 1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES // 1, 1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES
// NOTE(zoeliu): Remove SR_NEAREST_NEWMV // NOTE(zoeliu): Remove SR_NEAREST_NEWMV
1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES 1, 1, 1, 1, // INTER_SINGLEREF_COMP_MODES
#endif // CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (ZERO_ZEROMV == 0) 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) { static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
......
...@@ -492,14 +492,12 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { ...@@ -492,14 +492,12 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
# End av1_high encoder functions # 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"; 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/; 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"; 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/; 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"; 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/; specialize qw/av1_wedge_compute_delta_squares sse2/;
}
} }
# end encoder functions # end encoder functions
......
...@@ -43,8 +43,6 @@ extern "C" { ...@@ -43,8 +43,6 @@ extern "C" {
#define MAX_MB_PLANE 3 #define MAX_MB_PLANE 3
#if CONFIG_EXT_INTER
#if CONFIG_COMPOUND_SEGMENT #if CONFIG_COMPOUND_SEGMENT
// Set COMPOUND_SEGMENT_TYPE to one of the three // Set COMPOUND_SEGMENT_TYPE to one of the three
// 0: Uniform // 0: Uniform
...@@ -65,7 +63,6 @@ typedef enum { ...@@ -65,7 +63,6 @@ typedef enum {
} SEG_MASK_TYPE; } SEG_MASK_TYPE;
#endif // CONFIG_COMPOUND_SEGMENT #endif // CONFIG_COMPOUND_SEGMENT
#endif // CONFIG_EXT_INTER
typedef enum { typedef enum {
KEY_FRAME = 0, KEY_FRAME = 0,
...@@ -87,11 +84,7 @@ static INLINE int is_comp_ref_allowed(BLOCK_SIZE bsize) { ...@@ -87,11 +84,7 @@ static INLINE int is_comp_ref_allowed(BLOCK_SIZE bsize) {
} }
static INLINE int is_inter_mode(PREDICTION_MODE mode) { static INLINE int is_inter_mode(PREDICTION_MODE mode) {
#if CONFIG_EXT_INTER
return mode >= NEARESTMV && mode <= NEW_NEWMV; return mode >= NEARESTMV && mode <= NEW_NEWMV;
#else
return mode >= NEARESTMV && mode <= NEWMV;
#endif // CONFIG_EXT_INTER
} }
#if CONFIG_PVQ #if CONFIG_PVQ
...@@ -136,7 +129,6 @@ typedef struct { ...@@ -136,7 +129,6 @@ typedef struct {
int stride[MAX_MB_PLANE]; int stride[MAX_MB_PLANE];
} BUFFER_SET; } BUFFER_SET;
#if CONFIG_EXT_INTER
static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) { static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) {
return mode >= NEARESTMV && mode <= NEWMV; return mode >= NEARESTMV && mode <= NEWMV;
} }
...@@ -282,17 +274,6 @@ static INLINE int is_masked_compound_type(COMPOUND_TYPE type) { ...@@ -282,17 +274,6 @@ static INLINE int is_masked_compound_type(COMPOUND_TYPE type) {
return 0; 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) /* 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 modes for the Y blocks to the left and above us; for interframes, there
is a single probability table. */ is a single probability table. */
...@@ -301,9 +282,7 @@ typedef struct { ...@@ -301,9 +282,7 @@ typedef struct {
PREDICTION_MODE as_mode; PREDICTION_MODE as_mode;
int_mv as_mv[2]; // first, second inter predictor motion vectors int_mv as_mv[2]; // first, second inter predictor motion vectors
int_mv pred_mv[2]; int_mv pred_mv[2];
#if CONFIG_EXT_INTER
int_mv ref_mv[2]; int_mv ref_mv[2];
#endif // CONFIG_EXT_INTER
} b_mode_info; } b_mode_info;
typedef int8_t MV_REFERENCE_FRAME; typedef int8_t MV_REFERENCE_FRAME;
...@@ -353,7 +332,6 @@ typedef struct RD_STATS { ...@@ -353,7 +332,6 @@ typedef struct RD_STATS {
#endif // CONFIG_RD_DEBUG #endif // CONFIG_RD_DEBUG
} RD_STATS; } RD_STATS;
#if CONFIG_EXT_INTER
// This struct is used to group function args that are commonly // This struct is used to group function args that are commonly
// sent together in functions related to interinter compound modes // sent together in functions related to interinter compound modes
typedef struct { typedef struct {
...@@ -367,7 +345,6 @@ typedef struct { ...@@ -367,7 +345,6 @@ typedef struct {
#endif // CONFIG_COMPOUND_SEGMENT #endif // CONFIG_COMPOUND_SEGMENT
COMPOUND_TYPE interinter_compound_type; COMPOUND_TYPE interinter_compound_type;
} INTERINTER_COMPOUND_DATA; } INTERINTER_COMPOUND_DATA;
#endif // CONFIG_EXT_INTER
// This structure now relates to 8x8 block regions. // This structure now relates to 8x8 block regions.
typedef struct MB_MODE_INFO { typedef struct MB_MODE_INFO {
...@@ -425,7 +402,6 @@ typedef struct MB_MODE_INFO { ...@@ -425,7 +402,6 @@ typedef struct MB_MODE_INFO {
#endif // CONFIG_INTRA_INTERP #endif // CONFIG_INTRA_INTERP
#endif // CONFIG_EXT_INTRA #endif // CONFIG_EXT_INTRA
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
// interintra members // interintra members
INTERINTRA_MODE interintra_mode; INTERINTRA_MODE interintra_mode;
...@@ -443,7 +419,6 @@ typedef struct MB_MODE_INFO { ...@@ -443,7 +419,6 @@ typedef struct MB_MODE_INFO {
#if CONFIG_COMPOUND_SEGMENT #if CONFIG_COMPOUND_SEGMENT
SEG_MASK_TYPE mask_type; SEG_MASK_TYPE mask_type;
#endif // CONFIG_COMPOUND_SEGMENT #endif // CONFIG_COMPOUND_SEGMENT
#endif // CONFIG_EXT_INTER
MOTION_MODE motion_mode; MOTION_MODE motion_mode;
#if CONFIG_MOTION_VAR #if CONFIG_MOTION_VAR
int overlappable_neighbors[2]; int overlappable_neighbors[2];
...@@ -597,12 +572,8 @@ static INLINE int is_global_mv_block(const MODE_INFO *mi, int block, ...@@ -597,12 +572,8 @@ static INLINE int is_global_mv_block(const MODE_INFO *mi, int block,
const int block_size_allowed = const int block_size_allowed =
AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8; AOMMIN(block_size_wide[bsize], block_size_high[bsize]) >= 8;
#endif // GLOBAL_SUB8X8_USED #endif // GLOBAL_SUB8X8_USED
#if CONFIG_EXT_INTER
return (mode == ZEROMV || mode == ZERO_ZEROMV) && type > TRANSLATION && return (mode == ZEROMV || mode == ZERO_ZEROMV) && type > TRANSLATION &&
block_size_allowed; block_size_allowed;
#else
return mode == ZEROMV && type > TRANSLATION && block_size_allowed;
#endif // CONFIG_EXT_INTER
} }
#endif // CONFIG_GLOBAL_MOTION #endif // CONFIG_GLOBAL_MOTION
...@@ -839,9 +810,9 @@ typedef struct macroblockd { ...@@ -839,9 +810,9 @@ typedef struct macroblockd {
const EobThresholdMD *eob_threshold_md; const EobThresholdMD *eob_threshold_md;
#endif #endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT #if CONFIG_COMPOUND_SEGMENT
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]); 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 #if CONFIG_MRC_TX
uint8_t *mrc_mask; uint8_t *mrc_mask;
...@@ -1424,7 +1395,6 @@ void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, ...@@ -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 plane, TX_SIZE tx_size, int has_eob, int aoff,
int loff); int loff);
#if CONFIG_EXT_INTER
static INLINE int is_interintra_allowed_bsize(const BLOCK_SIZE bsize) { static INLINE int is_interintra_allowed_bsize(const BLOCK_SIZE bsize) {
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
// TODO(debargha): Should this be bsize < BLOCK_LARGEST? // TODO(debargha): Should this be bsize < BLOCK_LARGEST?
...@@ -1473,7 +1443,6 @@ static INLINE int is_interintra_allowed_bsize_group(int group) { ...@@ -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) { static INLINE int is_interintra_pred(const MB_MODE_INFO *mbmi) {
return (mbmi->ref_frame[1] == INTRA_FRAME) && is_interintra_allowed(mbmi); return (mbmi->ref_frame[1] == INTRA_FRAME) && is_interintra_allowed(mbmi);
} }
#endif // CONFIG_EXT_INTER
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
static INLINE int get_vartx_max_txsize(const MB_MODE_INFO *const mbmi, 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) { ...@@ -1509,11 +1478,11 @@ static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) {
static INLINE int is_motion_variation_allowed_compound( static INLINE int is_motion_variation_allowed_compound(
const MB_MODE_INFO *mbmi) { 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)) if (!has_second_ref(mbmi) && !is_inter_singleref_comp_mode(mbmi->mode))
#else #else
if (!has_second_ref(mbmi)) if (!has_second_ref(mbmi))
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
return 1; return 1;
else else
return 0; return 0;
...@@ -1556,14 +1525,9 @@ static INLINE MOTION_MODE motion_mode_allowed( ...@@ -1556,14 +1525,9 @@ static INLINE MOTION_MODE motion_mode_allowed(
#if CONFIG_AMVR #if CONFIG_AMVR
} }
#endif #endif
#if CONFIG_EXT_INTER
if (is_motion_variation_allowed_bsize(mbmi->sb_type) && if (is_motion_variation_allowed_bsize(mbmi->sb_type) &&
is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME && is_inter_mode(mbmi->mode) && mbmi->ref_frame[1] != INTRA_FRAME &&
is_motion_variation_allowed_compound(mbmi)) { 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 CONFIG_MOTION_VAR
if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION; if (!check_num_overlappable_neighbors(mbmi)) return SIMPLE_TRANSLATION;
#endif #endif
...@@ -1684,23 +1648,13 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) { ...@@ -1684,23 +1648,13 @@ static INLINE int is_nontrans_global_motion(const MACROBLOCKD *xd) {
// First check if all modes are ZEROMV // First check if all modes are ZEROMV
if (mbmi->sb_type >= BLOCK_8X8 || unify_bsize) { if (mbmi->sb_type >= BLOCK_8X8 || unify_bsize) {
#if CONFIG_EXT_INTER
if (mbmi->mode != ZEROMV && mbmi->mode != ZERO_ZEROMV) return 0; if (mbmi->mode != ZEROMV && mbmi->mode != ZERO_ZEROMV) return 0;
#else
if (mbmi->mode != ZEROMV) return 0;
#endif // CONFIG_EXT_INTER
} else { } else {
#if CONFIG_EXT_INTER
if ((mi->bmi[0].as_mode != ZEROMV && mi->bmi[0].as_mode != ZERO_ZEROMV) || 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[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[2].as_mode != ZEROMV && mi->bmi[2].as_mode != ZERO_ZEROMV) ||
(mi->bmi[3].as_mode != ZEROMV && mi->bmi[3].as_mode != ZERO_ZEROMV)) (mi->bmi[3].as_mode != ZEROMV && mi->bmi[3].as_mode != ZERO_ZEROMV))
return 0; 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 #if !GLOBAL_SUB8X8_USED
......
...@@ -2339,9 +2339,8 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, ...@@ -2339,9 +2339,8 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#endif #endif
#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) AVERAGE_TILE_CDFS(inter_compound_mode_cdf)
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT #if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
...@@ -2358,7 +2357,6 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, ...@@ -2358,7 +2357,6 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#endif #endif
AVERAGE_TILE_CDFS(interintra_mode_cdf) AVERAGE_TILE_CDFS(interintra_mode_cdf)
#endif #endif
#endif // CONFIG_EXT_INTER
/* NB: kf_y_cdf is discarded after use, so no need /* NB: kf_y_cdf is discarded after use, so no need
for backwards update */ for backwards update */
......
...@@ -888,7 +888,6 @@ static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = { ...@@ -888,7 +888,6 @@ static const aom_cdf_prob default_drl_cdf[DRL_MODE_CONTEXTS][CDF_SIZE(2)] = {
}; };
#endif #endif
#if CONFIG_EXT_INTER
static const aom_prob default_inter_compound_mode_probs static const aom_prob default_inter_compound_mode_probs
[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = { [INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = {
{ 154, 167, 233, 165, 143, 170, 167 }, // 0 = both zero mv { 154, 167, 233, 165, 143, 170, 167 }, // 0 = both zero mv
...@@ -1207,7 +1206,6 @@ static const aom_cdf_prob ...@@ -1207,7 +1206,6 @@ static const aom_cdf_prob
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_INTERINTRA #endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_NCOBMC_ADAPT_WEIGHT #if CONFIG_NCOBMC_ADAPT_WEIGHT
#ifdef TWO_MODE #ifdef TWO_MODE
...@@ -1706,7 +1704,6 @@ const int av1_intra_mode_inv[INTRA_MODES] = { ...@@ -1706,7 +1704,6 @@ const int av1_intra_mode_inv[INTRA_MODES] = {
}; };
#endif // CONFIG_SMOOTH_HV #endif // CONFIG_SMOOTH_HV
#if CONFIG_EXT_INTER
/* clang-format off */ /* clang-format off */
#if CONFIG_INTERINTRA #if CONFIG_INTERINTRA
const aom_tree_index av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)] = { 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)] = { ...@@ -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)] = {}; const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {};
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE #endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
/* clang-format on */ /* clang-format on */
#endif // CONFIG_EXT_INTER
const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)] = { const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
-PARTITION_NONE, 2, -PARTITION_HORZ, 4, -PARTITION_VERT, -PARTITION_SPLIT -PARTITION_NONE, 2, -PARTITION_HORZ, 4, -PARTITION_VERT, -PARTITION_SPLIT
...@@ -2015,13 +2011,13 @@ static const aom_cdf_prob ...@@ -2015,13 +2011,13 @@ static const aom_cdf_prob
}; };
#endif // CONFIG_NEW_MULTISYMBOL #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 // TODO(zoeliu): Default values to be further adjusted based on the collected
// stats. // stats.
static const aom_prob default_comp_inter_mode_p[COMP_INTER_MODE_CONTEXTS] = { static const aom_prob default_comp_inter_mode_p[COMP_INTER_MODE_CONTEXTS] = {
40, 110, 160, 220 40, 110, 160, 220
}; };
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
// TODO(huisu): tune these cdfs // TODO(huisu): tune these cdfs
const aom_cdf_prob const aom_cdf_prob
...@@ -4960,9 +4956,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -4960,9 +4956,9 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->single_ref_cdf, default_single_ref_cdf); av1_copy(fc->single_ref_cdf, default_single_ref_cdf);
#endif #endif
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF #if CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->comp_inter_mode_prob, default_comp_inter_mode_p); 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) #if CONFIG_RECT_TX_EXT && (CONFIG_EXT_TX || CONFIG_VAR_TX)
fc->quarter_tx_size_prob = default_quarter_tx_size_prob; fc->quarter_tx_size_prob = default_quarter_tx_size_prob;
#endif #endif
...@@ -5001,7 +4997,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -5001,7 +4997,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT #endif // CONFIG_NCOBMC_ADAPT_WEIGHT
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION #endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#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_probs, default_inter_compound_mode_probs);
av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf);