Commit 371968cd authored by Debargha Mukherjee's avatar Debargha Mukherjee Committed by Sebastien Alaiwan

Remove compound-segment/wedge config flags

Change-Id: I39cfbb135add0553cadf64481b13786831fbdddd
parent 78c229b4
......@@ -33,7 +33,6 @@ extern "C" {
#define MAX_MB_PLANE 3
#if CONFIG_COMPOUND_SEGMENT
// Set COMPOUND_SEGMENT_TYPE to one of the three
// 0: Uniform
// 1: Difference weighted
......@@ -52,8 +51,6 @@ typedef enum {
SEG_MASK_TYPES,
} SEG_MASK_TYPE;
#endif // CONFIG_COMPOUND_SEGMENT
typedef enum {
KEY_FRAME = 0,
INTER_FRAME = 1,
......@@ -214,24 +211,11 @@ static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
}
static INLINE int use_masked_motion_search(COMPOUND_TYPE type) {
#if CONFIG_WEDGE
return (type == COMPOUND_WEDGE);
#else
(void)type;
return 0;
#endif
}
static INLINE int is_masked_compound_type(COMPOUND_TYPE type) {
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
return (type == COMPOUND_WEDGE || type == COMPOUND_SEG);
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
return (type == COMPOUND_WEDGE);
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
return (type == COMPOUND_SEG);
#endif // CONFIG_COMPOUND_SEGMENT
(void)type;
return 0;
}
/* For keyframes, intra block modes are predicted by the (already decoded)
......@@ -295,14 +279,10 @@ typedef struct RD_STATS {
// This struct is used to group function args that are commonly
// sent together in functions related to interinter compound modes
typedef struct {
#if CONFIG_WEDGE
int wedge_index;
int wedge_sign;
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
SEG_MASK_TYPE mask_type;
uint8_t *seg_mask;
#endif // CONFIG_COMPOUND_SEGMENT
COMPOUND_TYPE interinter_compound_type;
} INTERINTER_COMPOUND_DATA;
......@@ -361,13 +341,9 @@ typedef struct MB_MODE_INFO {
int interintra_wedge_sign;
// interinter members
COMPOUND_TYPE interinter_compound_type;
#if CONFIG_WEDGE
int wedge_index;
int wedge_sign;
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
SEG_MASK_TYPE mask_type;
#endif // CONFIG_COMPOUND_SEGMENT
MOTION_MODE motion_mode;
#if CONFIG_MOTION_VAR
int overlappable_neighbors[2];
......@@ -766,9 +742,7 @@ typedef struct macroblockd {
const EobThresholdMD *eob_threshold_md;
#endif
#if CONFIG_COMPOUND_SEGMENT
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
#endif // CONFIG_COMPOUND_SEGMENT
#if CONFIG_MRC_TX
uint8_t *mrc_mask;
......
......@@ -2360,9 +2360,7 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
AVERAGE_TILE_CDFS(inter_compound_mode_cdf)
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
AVERAGE_TILE_CDFS(compound_type_cdf)
#endif // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if CONFIG_COMPOUND_SINGLEREF
AVERAGE_TILE_CDFS(inter_singleref_comp_mode_cdf)
#endif
......
......@@ -744,7 +744,6 @@ static const aom_cdf_prob
};
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = {
{ 128, 128 }, { 128, 128 }, { 128, 128 }, { 128, 128 },
......@@ -760,38 +759,7 @@ static const aom_prob
{ 208, 1 }, { 208, 1 }
#endif // CONFIG_EXT_PARTITION
};
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = {
{ 255 }, { 255 }, { 255 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 },
{ 208 }, { 216 }, { 216 }, { 216 }, { 224 }, { 224 }, { 240 }, { 240 },
#if CONFIG_EXT_PARTITION
{ 255 }, { 255 }, { 255 },
#endif // CONFIG_EXT_PARTITION
{ 208 }, { 208 }, { 208 }, { 208 }, { 255 }, { 255 },
#if CONFIG_EXT_PARTITION
{ 255 }, { 255 }
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
static const aom_prob
default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = {
{ 255 }, { 255 }, { 255 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 },
{ 208 }, { 216 }, { 216 }, { 216 }, { 224 }, { 224 }, { 240 }, { 240 },
#if CONFIG_EXT_PARTITION
{ 255 }, { 255 }, { 255 },
#endif // CONFIG_EXT_PARTITION
{ 208 }, { 208 }, { 208 }, { 208 }, { 208 }, { 208 },
#if CONFIG_EXT_PARTITION
{ 208 }, { 208 }
#endif // CONFIG_EXT_PARTITION
};
#else
static const aom_prob default_compound_type_probs[BLOCK_SIZES_ALL]
[COMPOUND_TYPES - 1];
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_cdf_prob
default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = {
{ AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(32768), 0 },
......@@ -826,77 +794,6 @@ static const aom_cdf_prob
{ AOM_ICDF(26624), AOM_ICDF(26648), AOM_ICDF(32768), 0 },
#endif
};
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
static const aom_cdf_prob
default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = {
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 }, // 216
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 }, // 224
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 }, // 240
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
static const aom_cdf_prob
default_compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)] = {
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 }, // 216
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(27648), AOM_ICDF(32768), 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 }, // 224
{ AOM_ICDF(28672), AOM_ICDF(32768), 0 },
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 }, // 240
{ AOM_ICDF(30720), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 }, // 255
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32640), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 }, // 208
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
#if CONFIG_EXT_PARTITION
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26624), AOM_ICDF(32768), 0 },
#endif // CONFIG_EXT_PARTITION
};
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
#if CONFIG_INTERINTRA
static const aom_prob default_interintra_prob[BLOCK_SIZE_GROUPS] = {
......@@ -1482,21 +1379,9 @@ const aom_tree_index av1_inter_singleref_comp_mode_tree
};
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, 2, -COMPOUND_WEDGE, -COMPOUND_SEG
};
#elif !CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, -COMPOUND_WEDGE
};
#elif CONFIG_COMPOUND_SEGMENT && !CONFIG_WEDGE
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, -COMPOUND_SEG
};
#else
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {};
#endif // CONFIG_COMPOUND_SEGMENT && CONFIG_WEDGE
/* clang-format on */
const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
......@@ -6301,9 +6186,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
default_inter_singleref_comp_mode_cdf);
#endif // CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->compound_type_prob, default_compound_type_probs);
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
av1_copy(fc->compound_type_cdf, default_compound_type_cdf);
#endif // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if CONFIG_INTERINTRA
av1_copy(fc->interintra_prob, default_interintra_prob);
av1_copy(fc->wedge_interintra_prob, default_wedge_interintra_prob);
......@@ -6476,17 +6359,14 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
av1_interintra_mode_tree, pre_fc->interintra_mode_prob[i],
counts->interintra_mode[i], fc->interintra_mode_prob[i]);
}
#if CONFIG_WEDGE
for (i = 0; i < BLOCK_SIZES_ALL; ++i) {
if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i))
fc->wedge_interintra_prob[i] = av1_mode_mv_merge_probs(
pre_fc->wedge_interintra_prob[i], counts->wedge_interintra[i]);
}
#endif // CONFIG_WEDGE
}
#endif // CONFIG_INTERINTRA
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
if (cm->allow_masked_compound) {
for (i = 0; i < BLOCK_SIZES_ALL; ++i) {
aom_tree_merge_probs(
......@@ -6494,7 +6374,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
counts->compound_interinter[i], fc->compound_type_prob[i]);
}
}
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#if CONFIG_JNT_COMP
for (i = 0; i < COMP_INDEX_CONTEXTS; ++i)
......
......@@ -206,9 +206,7 @@ typedef struct frame_contexts {
INTER_SINGLEREF_COMP_MODES)];
#endif // CONFIG_COMPOUND_SINGLEREF
aom_prob compound_type_prob[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1];
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
aom_cdf_prob compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)];
#endif // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if CONFIG_INTERINTRA
aom_prob interintra_prob[BLOCK_SIZE_GROUPS];
aom_prob wedge_interintra_prob[BLOCK_SIZES_ALL];
......
......@@ -601,12 +601,8 @@ typedef enum ATTRIBUTE_PACKED {
typedef enum {
COMPOUND_AVERAGE,
#if CONFIG_WEDGE
COMPOUND_WEDGE,
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
COMPOUND_SEG,
#endif // CONFIG_COMPOUND_SEGMENT
COMPOUND_TYPES,
} COMPOUND_TYPE;
......
......@@ -270,9 +270,7 @@ typedef struct AV1Common {
#if CONFIG_INTERINTRA
int allow_interintra_compound;
#endif // CONFIG_INTERINTRA
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
int allow_masked_compound;
#endif // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if !CONFIG_NO_FRAME_CONTEXT_SIGNALING
// Flag signaling which frame contexts should be reset to default values.
......
......@@ -317,7 +317,6 @@ const wedge_params_type wedge_params_lookup[BLOCK_SIZES_ALL] = {
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
#if CONFIG_WEDGE
{ 4, wedge_codebook_16_heqw, wedge_signflip_lookup[BLOCK_8X8], 0,
wedge_masks[BLOCK_8X8] },
{ 4, wedge_codebook_16_hgtw, wedge_signflip_lookup[BLOCK_8X16], 0,
......@@ -332,22 +331,6 @@ const wedge_params_type wedge_params_lookup[BLOCK_SIZES_ALL] = {
wedge_masks[BLOCK_32X16] },
{ 4, wedge_codebook_16_heqw, wedge_signflip_lookup[BLOCK_32X32], 0,
wedge_masks[BLOCK_32X32] },
#else
{ 0, wedge_codebook_16_heqw, wedge_signflip_lookup[BLOCK_8X8], 0,
wedge_masks[BLOCK_8X8] },
{ 0, wedge_codebook_16_hgtw, wedge_signflip_lookup[BLOCK_8X16], 0,
wedge_masks[BLOCK_8X16] },
{ 0, wedge_codebook_16_hltw, wedge_signflip_lookup[BLOCK_16X8], 0,
wedge_masks[BLOCK_16X8] },
{ 0, wedge_codebook_16_heqw, wedge_signflip_lookup[BLOCK_16X16], 0,
wedge_masks[BLOCK_16X16] },
{ 0, wedge_codebook_16_hgtw, wedge_signflip_lookup[BLOCK_16X32], 0,
wedge_masks[BLOCK_16X32] },
{ 0, wedge_codebook_16_hltw, wedge_signflip_lookup[BLOCK_32X16], 0,
wedge_masks[BLOCK_32X16] },
{ 0, wedge_codebook_16_heqw, wedge_signflip_lookup[BLOCK_32X32], 0,
wedge_masks[BLOCK_32X32] },
#endif // CONFIG_WEDGE
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
......@@ -356,7 +339,6 @@ const wedge_params_type wedge_params_lookup[BLOCK_SIZES_ALL] = {
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
#endif // CONFIG_EXT_PARTITION
#if CONFIG_WEDGE
{ 0, wedge_codebook_16_hgtw, wedge_signflip_lookup[BLOCK_4X16], 0,
wedge_masks[BLOCK_4X16] },
{ 0, wedge_codebook_16_hltw, wedge_signflip_lookup[BLOCK_16X4], 0,
......@@ -365,16 +347,6 @@ const wedge_params_type wedge_params_lookup[BLOCK_SIZES_ALL] = {
wedge_masks[BLOCK_8X32] },
{ 4, wedge_codebook_16_hltw, wedge_signflip_lookup[BLOCK_32X8], 0,
wedge_masks[BLOCK_32X8] },
#else
{ 0, wedge_codebook_16_hgtw, wedge_signflip_lookup[BLOCK_4X16], 0,
wedge_masks[BLOCK_4X16] },
{ 0, wedge_codebook_16_hltw, wedge_signflip_lookup[BLOCK_16X4], 0,
wedge_masks[BLOCK_16X4] },
{ 0, wedge_codebook_16_hgtw, wedge_signflip_lookup[BLOCK_8X32], 0,
wedge_masks[BLOCK_8X32] },
{ 0, wedge_codebook_16_hltw, wedge_signflip_lookup[BLOCK_32X8], 0,
wedge_masks[BLOCK_32X8] },
#endif // CONFIG_WEDGE
{ 0, NULL, NULL, 0, NULL },
{ 0, NULL, NULL, 0, NULL },
#if CONFIG_EXT_PARTITION
......@@ -413,7 +385,6 @@ const uint8_t *av1_get_soft_mask(int wedge_index, int wedge_sign,
return mask;
}
#if CONFIG_COMPOUND_SEGMENT
static uint8_t *invert_mask(uint8_t *mask_inv_buffer, const uint8_t *const mask,
int h, int w, int stride) {
int i, j;
......@@ -425,26 +396,18 @@ static uint8_t *invert_mask(uint8_t *mask_inv_buffer, const uint8_t *const mask,
}
return mask_inv_buffer;
}
#endif // CONFIG_COMPOUND_SEGMENT
const uint8_t *av1_get_compound_type_mask_inverse(
const INTERINTER_COMPOUND_DATA *const comp_data,
#if CONFIG_COMPOUND_SEGMENT
uint8_t *mask_buffer, int h, int w, int stride,
#endif
BLOCK_SIZE sb_type) {
const INTERINTER_COMPOUND_DATA *const comp_data, uint8_t *mask_buffer,
int h, int w, int stride, BLOCK_SIZE sb_type) {
assert(is_masked_compound_type(comp_data->interinter_compound_type));
(void)sb_type;
switch (comp_data->interinter_compound_type) {
#if CONFIG_WEDGE
case COMPOUND_WEDGE:
return av1_get_contiguous_soft_mask(comp_data->wedge_index,
!comp_data->wedge_sign, sb_type);
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
case COMPOUND_SEG:
return invert_mask(mask_buffer, comp_data->seg_mask, h, w, stride);
#endif // CONFIG_COMPOUND_SEGMENT
default: assert(0); return NULL;
}
}
......@@ -454,19 +417,14 @@ const uint8_t *av1_get_compound_type_mask(
assert(is_masked_compound_type(comp_data->interinter_compound_type));
(void)sb_type;
switch (comp_data->interinter_compound_type) {
#if CONFIG_WEDGE
case COMPOUND_WEDGE:
return av1_get_contiguous_soft_mask(comp_data->wedge_index,
comp_data->wedge_sign, sb_type);
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
case COMPOUND_SEG: return comp_data->seg_mask;
#endif // CONFIG_COMPOUND_SEGMENT
default: assert(0); return NULL;
}
}
#if CONFIG_COMPOUND_SEGMENT
#if COMPOUND_SEGMENT_TYPE == 0
static void uniform_mask(uint8_t *mask, int which_inverse, BLOCK_SIZE sb_type,
int h, int w, int mask_val) {
......@@ -553,7 +511,7 @@ static void build_compound_seg_mask_d32(uint8_t *mask, SEG_MASK_TYPE mask_type,
default: assert(0);
}
}
#endif
#endif // CONFIG_CONVOLVE_ROUND
static void diffwtd_mask(uint8_t *mask, int which_inverse, int mask_base,
const uint8_t *src0, int src0_stride,
......@@ -628,7 +586,6 @@ void build_compound_seg_mask_highbd(uint8_t *mask, SEG_MASK_TYPE mask_type,
}
#endif // CONFIG_HIGHBITDEPTH
#endif // COMPOUND_SEGMENT_TYPE
#endif // CONFIG_COMPOUND_SEGMENT
#if MASK_MASTER_SIZE == 64
static const uint8_t wedge_master_oblique_odd[NSMOOTHERS][MASK_MASTER_SIZE] = {
......@@ -861,14 +818,7 @@ void av1_make_masked_inter_predictor(
const MODE_INFO *mi = xd->mi[0];
const INTERINTER_COMPOUND_DATA comp_data = {
#if CONFIG_WEDGE
mi->mbmi.wedge_index,
mi->mbmi.wedge_sign,
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
mi->mbmi.mask_type,
xd->seg_mask,
#endif // CONFIG_COMPOUND_SEGMENT
mi->mbmi.wedge_index, mi->mbmi.wedge_sign, mi->mbmi.mask_type, xd->seg_mask,
mi->mbmi.interinter_compound_type
};
......@@ -921,7 +871,6 @@ void av1_make_masked_inter_predictor(
#endif
xs, ys, xd);
#if CONFIG_COMPOUND_SEGMENT
if (!plane && comp_data.interinter_compound_type == COMPOUND_SEG) {
#if CONFIG_CONVOLVE_ROUND
if (is_conv_no_round) {
......@@ -948,7 +897,6 @@ void av1_make_masked_inter_predictor(
}
#endif
}
#endif // CONFIG_COMPOUND_SEGMENT
#if CONFIG_CONVOLVE_ROUND
if (is_conv_no_round) {
......@@ -2867,17 +2815,10 @@ static void build_wedge_inter_predictor_from_buf(
MACROBLOCKD_PLANE *const pd = &xd->plane[plane];
struct buf_2d *const dst_buf = &pd->dst;
uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x;
const INTERINTER_COMPOUND_DATA comp_data = {
#if CONFIG_WEDGE
mbmi->wedge_index,
mbmi->wedge_sign,
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
mbmi->mask_type,
xd->seg_mask,
#endif // CONFIG_COMPOUND_SEGMENT
mbmi->interinter_compound_type
};
const INTERINTER_COMPOUND_DATA comp_data = { mbmi->wedge_index,
mbmi->wedge_sign,
mbmi->mask_type, xd->seg_mask,
mbmi->interinter_compound_type };
#if CONFIG_COMPOUND_SINGLEREF
if ((is_compound || is_inter_singleref_comp_mode(mbmi->mode)) &&
......@@ -2886,7 +2827,6 @@ static void build_wedge_inter_predictor_from_buf(
if (is_compound && is_masked_compound_type(mbmi->interinter_compound_type))
#endif // CONFIG_COMPOUND_SINGLEREF
{
#if CONFIG_COMPOUND_SEGMENT
if (!plane && comp_data.interinter_compound_type == COMPOUND_SEG) {
#if CONFIG_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
......@@ -2901,7 +2841,6 @@ static void build_wedge_inter_predictor_from_buf(
ext_dst0, ext_dst_stride0, ext_dst1,
ext_dst_stride1, mbmi->sb_type, h, w);
}
#endif // CONFIG_COMPOUND_SEGMENT
#if CONFIG_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
......
......@@ -231,13 +231,9 @@ static INLINE int is_interinter_compound_used(COMPOUND_TYPE type,
(void)sb_type;
switch (type) {
case COMPOUND_AVERAGE: return sb_type >= BLOCK_4X4;
#if CONFIG_WEDGE
case COMPOUND_WEDGE: return wedge_params_lookup[sb_type].bits > 0;
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
case COMPOUND_SEG:
return AOMMIN(block_size_wide[sb_type], block_size_high[sb_type]) >= 8;
#endif // CONFIG_COMPOUND_SEGMENT
default: assert(0); return 0;
}
}
......@@ -271,7 +267,6 @@ static INLINE int get_interintra_wedge_bits(BLOCK_SIZE sb_type) {
return wedge_params_lookup[sb_type].bits;
}
#if CONFIG_COMPOUND_SEGMENT
void build_compound_seg_mask(uint8_t *mask, SEG_MASK_TYPE mask_type,
const uint8_t *src0, int src0_stride,
const uint8_t *src1, int src1_stride,
......@@ -282,7 +277,6 @@ void build_compound_seg_mask_highbd(uint8_t *mask, SEG_MASK_TYPE mask_type,
const uint8_t *src1, int src1_stride,
BLOCK_SIZE sb_type, int h, int w, int bd);
#endif // CONFIG_HIGHBITDEPTH
#endif // CONFIG_COMPOUND_SEGMENT
void av1_make_masked_inter_predictor(
const uint8_t *pre, int pre_stride, uint8_t *dst, int dst_stride,
......@@ -527,11 +521,8 @@ const uint8_t *av1_get_soft_mask(int wedge_index, int wedge_sign,
int wedge_offset_y);
const uint8_t *av1_get_compound_type_mask_inverse(
const INTERINTER_COMPOUND_DATA *const comp_data,
#if CONFIG_COMPOUND_SEGMENT
uint8_t *mask_buffer, int h, int w, int stride,
#endif
BLOCK_SIZE sb_type);
const INTERINTER_COMPOUND_DATA *const comp_data, uint8_t *mask_buffer,
int h, int w, int stride, BLOCK_SIZE sb_type);
const uint8_t *av1_get_compound_type_mask(
const INTERINTER_COMPOUND_DATA *const comp_data, BLOCK_SIZE sb_type);
......
......@@ -2740,7 +2740,6 @@ static void read_compound_tools(AV1_COMMON *cm,
cm->allow_interintra_compound = 0;
}
#endif // CONFIG_INTERINTRA
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if CONFIG_COMPOUND_SINGLEREF
if (!frame_is_intra_only(cm)) {
#else // !CONFIG_COMPOUND_SINGLEREF
......@@ -2750,7 +2749,6 @@ static void read_compound_tools(AV1_COMMON *cm,
} else {
cm->allow_masked_compound = 0;
}
#endif // CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
}
#if CONFIG_VAR_REFS
......@@ -3548,7 +3546,7 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
}
}
#endif
#if CONFIG_WEDGE && !CONFIG_NEW_MULTISYMBOL
#if !CONFIG_NEW_MULTISYMBOL
#if CONFIG_EXT_PARTITION_TYPES
int block_sizes_to_update = BLOCK_SIZES_ALL;
#else
......@@ -3559,7 +3557,7 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
av1_diff_update_prob(&r, &fc->wedge_interintra_prob[i], ACCT_STR);
}
}
#endif // CONFIG_WEDGE
#endif // !CONFIG_NEW_MULTISYMBOL
}
#endif // CONFIG_INTERINTRA
......@@ -3613,10 +3611,8 @@ static void debug_check_frame_counts(const AV1_COMMON *const cm) {
#if CONFIG_INTERINTRA
assert(!memcmp(cm->counts.interintra, zero_counts.interintra,
sizeof(cm->counts.interintra)));
#if CONFIG_WEDGE
assert(!memcmp(cm->counts.wedge_interintra, zero_counts.wedge_interintra,
sizeof(cm->counts.wedge_interintra)));
#endif // CONFIG_WEDGE
#endif // CONFIG_INTERINTRA
assert(!memcmp(cm->counts.compound_interinter,
zero_counts.compound_interinter,
......
......@@ -2611,36 +2611,28 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
#endif // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
) {
if (is_any_masked_compound_used(bsize)) {
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#if CONFIG_JNT_COMP
if (cm->allow_masked_compound && mbmi->compound_idx)
#else
if (cm->allow_masked_compound)
#endif // CONFIG_JNT_COMP
{
#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
if (!is_interinter_compound_used(COMPOUND_WEDGE, bsize))
mbmi->interinter_compound_type =
aom_read_bit(r, ACCT_STR) ? COMPOUND_AVERAGE : COMPOUND_SEG;
else
#endif // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
mbmi->interinter_compound_type = aom_read_symbol(
r, ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES, ACCT_STR);
#if CONFIG_WEDGE
if (mbmi->interinter_compound_type == COMPOUND_WEDGE) {
assert(is_interinter_compound_used(COMPOUND_WEDGE, bsize));
mbmi->wedge_index =
aom_read_literal(r, get_wedge_bits_lookup(bsize), ACCT_STR);
mbmi->wedge_sign = aom_read_bit(r, ACCT_STR);
}
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
mbmi->mask_type = aom_read_literal(r, MAX_SEG_MASK_BITS, ACCT_STR);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
} else {
mbmi->interinter_compound_type = COMPOUND_AVERAGE;
}
......
......@@ -76,9 +76,7 @@ static INLINE void write_uniform(aom_writer *w, int n, int v) {
#if CONFIG_INTERINTRA
static struct av1_token interintra_mode_encodings[INTERINTRA_MODES];
#endif
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
static struct av1_token compound_type_encodings[COMPOUND_TYPES];
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#if CONFIG_LOOP_RESTORATION
static void loop_restoration_write_sb_coeffs(const AV1_COMMON *const cm,
MACROBLOCKD *xd,
......@@ -110,9 +108,7 @@ void av1_encode_token_init(void) {
av1_tokens_from_tree(inter_singleref_comp_mode_encodings,
av1_inter_singleref_comp_mode_tree);
#endif // CONFIG_COMPOUND_SINGLEREF
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
av1_tokens_from_tree(compound_type_encodings, av1_compound_type_tree);
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
}
static void write_intra_mode_kf(const AV1_COMMON *cm, FRAME_CONTEXT *frame_ctx,
......@@ -1757,34 +1753,26 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const int mi_row,
mbmi->motion_mode == SIMPLE_TRANSLATION &&
#endif // CONFIG_MOTION_VAR
is_any_masked_compound_used(bsize)) {
#if CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
#if CONFIG_JNT_COMP
if (cm->allow_masked_compound && mbmi->compound_idx)
#else
if (cm->allow_masked_compound)
#endif // CONFIG_JNT_COMP
{
#if CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
if (!is_interinter_compound_used(COMPOUND_WEDGE, bsize))
aom_write_bit(w, mbmi->interinter_compound_type == COMPOUND_AVERAGE);
else
#endif // CONFIG_WEDGE && CONFIG_COMPOUND_SEGMENT
aom_write_symbol(w, mbmi->interinter_compound_type,
ec_ctx->compound_type_cdf[bsize], COMPOUND_TYPES);
#if CONFIG_WEDGE
if (is_interinter_compound_used(COMPOUND_WEDGE, bsize) &&
mbmi->interinter_compound_type == COMPOUND_WEDGE) {
aom_write_literal(w, mbmi->wedge_index, get_wedge_bits_lookup(bsize));
aom_write_bit(w, mbmi->wedge_sign);
}
#endif // CONFIG_WEDGE
#if CONFIG_COMPOUND_SEGMENT
if (mbmi->interinter_compound_type == COMPOUND_SEG) {
aom_write_literal(w, mbmi->mask_type, MAX_SEG_MASK_BITS);
}
#endif // CONFIG_COMPOUND_SEGMENT
}
#endif // CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE
}
write_mb_interp_filter(cpi, xd, w);
......@@ -3824,7 +3812,6 @@ static void write_compound_tools(const AV1_COMMON *cm,
assert(cm->allow_interintra_compound == 0);
}
#endif // CONFIG_INTERINTRA
#if CONFIG_WEDGE || CONFIG_COMPOUND_SEGMENT
#if CONFIG_COMPOUND_SINGLEREF
if (!frame_is_intra_only(cm)) {