Commit 34d5566a authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Remove COMPOUND_SINGLEREF experiment

This experiment has been abandonned for AV1.

Change-Id: I3501181d096873dec35ea58e4b55530fa76e683f
parent 35a4db38
...@@ -316,11 +316,6 @@ static const uint16_t above_border_uv = 0x000f; ...@@ -316,11 +316,6 @@ static const uint16_t above_border_uv = 0x000f;
static const int mode_lf_lut[] = { static const int mode_lf_lut[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES
1, 1, 0, 1, // INTER_MODES (GLOBALMV == 0) 1, 1, 0, 1, // INTER_MODES (GLOBALMV == 0)
#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 (GLOBAL_GLOBALMV == 0) 1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (GLOBAL_GLOBALMV == 0)
}; };
......
...@@ -81,14 +81,6 @@ static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) { ...@@ -81,14 +81,6 @@ static INLINE int is_inter_singleref_mode(PREDICTION_MODE mode) {
static INLINE int is_inter_compound_mode(PREDICTION_MODE mode) { static INLINE int is_inter_compound_mode(PREDICTION_MODE mode) {
return mode >= NEAREST_NEARESTMV && mode <= NEW_NEWMV; return mode >= NEAREST_NEARESTMV && mode <= NEW_NEWMV;
} }
#if CONFIG_COMPOUND_SINGLEREF
static INLINE int is_inter_singleref_comp_mode(PREDICTION_MODE mode) {
return mode >= SR_NEAREST_NEARMV && mode <= SR_NEW_NEWMV;
}
static INLINE int is_inter_anyref_comp_mode(PREDICTION_MODE mode) {
return is_inter_compound_mode(mode) || is_inter_singleref_comp_mode(mode);
}
#endif // CONFIG_COMPOUND_SINGLEREF
static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) { static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
static PREDICTION_MODE lut[] = { static PREDICTION_MODE lut[] = {
...@@ -109,28 +101,17 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) { ...@@ -109,28 +101,17 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // NEARMV MB_MODE_COUNT, // NEARMV
MB_MODE_COUNT, // GLOBALMV MB_MODE_COUNT, // GLOBALMV
MB_MODE_COUNT, // NEWMV MB_MODE_COUNT, // NEWMV
#if CONFIG_COMPOUND_SINGLEREF NEARESTMV, // NEAREST_NEARESTMV
NEARESTMV, // SR_NEAREST_NEARMV NEARMV, // NEAR_NEARMV
// NEARESTMV, // SR_NEAREST_NEWMV NEARESTMV, // NEAREST_NEWMV
NEARMV, // SR_NEAR_NEWMV NEWMV, // NEW_NEARESTMV
GLOBALMV, // SR_ZERO_NEWMV NEARMV, // NEAR_NEWMV
NEWMV, // SR_NEW_NEWMV NEWMV, // NEW_NEARMV
#endif // CONFIG_COMPOUND_SINGLEREF GLOBALMV, // GLOBAL_GLOBALMV
NEARESTMV, // NEAREST_NEARESTMV NEWMV, // NEW_NEWMV
NEARMV, // NEAR_NEARMV
NEARESTMV, // NEAREST_NEWMV
NEWMV, // NEW_NEARESTMV
NEARMV, // NEAR_NEWMV
NEWMV, // NEW_NEARMV
GLOBALMV, // GLOBAL_GLOBALMV
NEWMV, // NEW_NEWMV
}; };
assert(NELEMENTS(lut) == MB_MODE_COUNT); assert(NELEMENTS(lut) == MB_MODE_COUNT);
#if CONFIG_COMPOUND_SINGLEREF
assert(is_inter_anyref_comp_mode(mode));
#else // !CONFIG_COMPOUND_SINGLEREF
assert(is_inter_compound_mode(mode)); assert(is_inter_compound_mode(mode));
#endif // CONFIG_COMPOUND_SINGLEREF
return lut[mode]; return lut[mode];
} }
...@@ -153,45 +134,27 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) { ...@@ -153,45 +134,27 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
MB_MODE_COUNT, // NEARMV MB_MODE_COUNT, // NEARMV
MB_MODE_COUNT, // GLOBALMV MB_MODE_COUNT, // GLOBALMV
MB_MODE_COUNT, // NEWMV MB_MODE_COUNT, // NEWMV
#if CONFIG_COMPOUND_SINGLEREF NEARESTMV, // NEAREST_NEARESTMV
NEARMV, // SR_NEAREST_NEARMV NEARMV, // NEAR_NEARMV
// NEWMV, // SR_NEAREST_NEWMV NEWMV, // NEAREST_NEWMV
NEWMV, // SR_NEAR_NEWMV NEARESTMV, // NEW_NEARESTMV
NEWMV, // SR_ZERO_NEWMV NEWMV, // NEAR_NEWMV
NEWMV, // SR_NEW_NEWMV NEARMV, // NEW_NEARMV
#endif // CONFIG_COMPOUND_SINGLEREF GLOBALMV, // GLOBAL_GLOBALMV
NEARESTMV, // NEAREST_NEARESTMV NEWMV, // NEW_NEWMV
NEARMV, // NEAR_NEARMV
NEWMV, // NEAREST_NEWMV
NEARESTMV, // NEW_NEARESTMV
NEWMV, // NEAR_NEWMV
NEARMV, // NEW_NEARMV
GLOBALMV, // GLOBAL_GLOBALMV
NEWMV, // NEW_NEWMV
}; };
assert(NELEMENTS(lut) == MB_MODE_COUNT); assert(NELEMENTS(lut) == MB_MODE_COUNT);
#if CONFIG_COMPOUND_SINGLEREF
assert(is_inter_anyref_comp_mode(mode));
#else // !CONFIG_COMPOUND_SINGLEREF
assert(is_inter_compound_mode(mode)); assert(is_inter_compound_mode(mode));
#endif // CONFIG_COMPOUND_SINGLEREF
return lut[mode]; return lut[mode];
} }
static INLINE int have_nearmv_in_inter_mode(PREDICTION_MODE mode) { static INLINE int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV || return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV ||
#if CONFIG_COMPOUND_SINGLEREF
mode == SR_NEAREST_NEARMV || mode == SR_NEAR_NEWMV ||
#endif // CONFIG_COMPOUND_SINGLEREF
mode == NEW_NEARMV); mode == NEW_NEARMV);
} }
static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) { static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
return (mode == NEWMV || mode == NEW_NEWMV || mode == NEAREST_NEWMV || return (mode == NEWMV || mode == NEW_NEWMV || mode == NEAREST_NEWMV ||
#if CONFIG_COMPOUND_SINGLEREF
/* mode == SR_NEAREST_NEWMV || */ mode == SR_NEAR_NEWMV ||
mode == SR_ZERO_NEWMV || mode == SR_NEW_NEWMV ||
#endif // CONFIG_COMPOUND_SINGLEREF
mode == NEW_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV); mode == NEW_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV);
} }
...@@ -1277,11 +1240,7 @@ static INLINE int is_motion_variation_allowed_bsize(BLOCK_SIZE bsize) { ...@@ -1277,11 +1240,7 @@ 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_COMPOUND_SINGLEREF
if (!has_second_ref(mbmi) && !is_inter_singleref_comp_mode(mbmi->mode))
#else
if (!has_second_ref(mbmi)) if (!has_second_ref(mbmi))
#endif // CONFIG_COMPOUND_SINGLEREF
return 1; return 1;
else else
return 0; return 0;
......
...@@ -1795,9 +1795,6 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, ...@@ -1795,9 +1795,6 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
AVERAGE_TILE_CDFS(inter_compound_mode_cdf) AVERAGE_TILE_CDFS(inter_compound_mode_cdf)
AVERAGE_TILE_CDFS(compound_type_cdf) AVERAGE_TILE_CDFS(compound_type_cdf)
#if CONFIG_COMPOUND_SINGLEREF
AVERAGE_TILE_CDFS(inter_singleref_comp_mode_cdf)
#endif
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(interintra_cdf) AVERAGE_TILE_CDFS(interintra_cdf)
......
...@@ -814,41 +814,6 @@ static const aom_cdf_prob ...@@ -814,41 +814,6 @@ static const aom_cdf_prob
{ AOM_CDF8(3456, 9067, 14069, 16907, 18817, 21214, 23139) } { AOM_CDF8(3456, 9067, 14069, 16907, 18817, 21214, 23139) }
}; };
#if CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): Default values to be further adjusted based on the collected
// stats.
/*
static const aom_prob default_inter_singleref_comp_mode_probs
[INTER_MODE_CONTEXTS][INTER_SINGLEREF_COMP_MODES - 1] = {
{ 2, 173, 68, 180 }, // 0 = both zero mv
{ 7, 145, 160, 180 }, // 1 = 1 zero + 1 predicted
{ 7, 166, 126, 180 }, // 2 = two predicted mvs
{ 7, 94, 132, 180 }, // 3 = 1 pred/zero, 1 new
{ 8, 64, 64, 180 }, // 4 = two new mvs
{ 17, 81, 52, 180 }, // 5 = one intra neighbour
{ 25, 29, 50, 180 }, // 6 = two intra neighbours
};*/
static const aom_prob default_inter_singleref_comp_mode_probs
[INTER_MODE_CONTEXTS][INTER_SINGLEREF_COMP_MODES - 1] = {
{ 2, 173, 68 }, // 0 = both zero mv
{ 7, 145, 160 }, // 1 = 1 zero + 1 predicted
{ 7, 166, 126 }, // 2 = two predicted mvs
{ 7, 94, 132 }, // 3 = 1 pred/zero, 1 new
{ 8, 64, 64 }, // 4 = two new mvs
{ 17, 81, 52 }, // 5 = one intra neighbour
{ 25, 29, 50 }, // 6 = two intra neighbours
};
static const aom_cdf_prob
default_inter_singleref_comp_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(
INTER_SINGLEREF_COMP_MODES)] = {
{ AOM_CDF4(21971, 24771, 25027) }, { AOM_CDF4(18053, 26690, 27586) },
{ AOM_CDF4(20667, 26182, 27078) }, { AOM_CDF4(11703, 22103, 22999) },
{ AOM_CDF4(7936, 13888, 14912) }, { AOM_CDF4(9679, 13927, 16103) },
{ AOM_CDF4(3349, 8470, 11670) }
};
#endif // CONFIG_COMPOUND_SINGLEREF
static const aom_prob static const aom_prob
default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = { default_compound_type_probs[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1] = {
{ 128, 128 }, { 128, 128 }, { 128, 128 }, { 128, 128 }, { 128, 128 }, { 128, 128 }, { 128, 128 }, { 128, 128 },
...@@ -1058,26 +1023,6 @@ const aom_tree_index av1_inter_compound_mode_tree ...@@ -1058,26 +1023,6 @@ const aom_tree_index av1_inter_compound_mode_tree
-INTER_COMPOUND_OFFSET(NEAR_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARMV) -INTER_COMPOUND_OFFSET(NEAR_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARMV)
}; };
#if CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): To redesign the tree structure once the number of mode changes.
/*
const aom_tree_index av1_inter_singleref_comp_mode_tree
[TREE_SIZE(INTER_SINGLEREF_COMP_MODES)] = {
-INTER_SINGLEREF_COMP_OFFSET(SR_ZERO_NEWMV), 2,
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEARMV), 4,
6, -INTER_SINGLEREF_COMP_OFFSET(SR_NEW_NEWMV),
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEWMV),
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAR_NEWMV)
};*/
const aom_tree_index av1_inter_singleref_comp_mode_tree
[TREE_SIZE(INTER_SINGLEREF_COMP_MODES)] = {
-INTER_SINGLEREF_COMP_OFFSET(SR_ZERO_NEWMV), 2,
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAREST_NEARMV), 4,
-INTER_SINGLEREF_COMP_OFFSET(SR_NEAR_NEWMV),
-INTER_SINGLEREF_COMP_OFFSET(SR_NEW_NEWMV)
};
#endif // CONFIG_COMPOUND_SINGLEREF
const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = { const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)] = {
-COMPOUND_AVERAGE, 2, -COMPOUND_WEDGE, -COMPOUND_SEG -COMPOUND_AVERAGE, 2, -COMPOUND_WEDGE, -COMPOUND_SEG
...@@ -1241,14 +1186,6 @@ static const aom_cdf_prob default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1] ...@@ -1241,14 +1186,6 @@ static const aom_cdf_prob default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1]
}; };
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
#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_COMPOUND_SINGLEREF
// TODO(huisu): tune these cdfs // TODO(huisu): tune these cdfs
const aom_cdf_prob const aom_cdf_prob
default_palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)] = { default_palette_y_size_cdf[PALETTE_BLOCK_SIZES][CDF_SIZE(PALETTE_SIZES)] = {
...@@ -3243,9 +3180,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -3243,9 +3180,6 @@ 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_COMPOUND_SINGLEREF
av1_copy(fc->comp_inter_mode_prob, default_comp_inter_mode_p);
#endif // CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->txfm_partition_prob, default_txfm_partition_probs); av1_copy(fc->txfm_partition_prob, default_txfm_partition_probs);
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->txfm_partition_cdf, default_txfm_partition_cdf); av1_copy(fc->txfm_partition_cdf, default_txfm_partition_cdf);
...@@ -3274,12 +3208,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -3274,12 +3208,6 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif #endif
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); av1_copy(fc->inter_compound_mode_cdf, default_inter_compound_mode_cdf);
#if CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->inter_singleref_comp_mode_probs,
default_inter_singleref_comp_mode_probs);
av1_copy(fc->inter_singleref_comp_mode_cdf,
default_inter_singleref_comp_mode_cdf);
#endif // CONFIG_COMPOUND_SINGLEREF
av1_copy(fc->compound_type_prob, default_compound_type_probs); av1_copy(fc->compound_type_prob, default_compound_type_probs);
av1_copy(fc->compound_type_cdf, default_compound_type_cdf); av1_copy(fc->compound_type_cdf, default_compound_type_cdf);
av1_copy(fc->interintra_prob, default_interintra_prob); av1_copy(fc->interintra_prob, default_interintra_prob);
...@@ -3393,13 +3321,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { ...@@ -3393,13 +3321,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
fc->single_ref_prob[i][j] = av1_mode_mv_merge_probs( fc->single_ref_prob[i][j] = av1_mode_mv_merge_probs(
pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]); pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]);
#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_COMPOUND_SINGLEREF
for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i) for (i = 0; i < NEWMV_MODE_CONTEXTS; ++i)
fc->newmv_prob[i] = fc->newmv_prob[i] =
av1_mode_mv_merge_probs(pre_fc->newmv_prob[i], counts->newmv_mode[i]); av1_mode_mv_merge_probs(pre_fc->newmv_prob[i], counts->newmv_mode[i]);
...@@ -3425,13 +3346,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { ...@@ -3425,13 +3346,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
aom_tree_merge_probs( aom_tree_merge_probs(
av1_inter_compound_mode_tree, pre_fc->inter_compound_mode_probs[i], av1_inter_compound_mode_tree, pre_fc->inter_compound_mode_probs[i],
counts->inter_compound_mode[i], fc->inter_compound_mode_probs[i]); counts->inter_compound_mode[i], fc->inter_compound_mode_probs[i]);
#if CONFIG_COMPOUND_SINGLEREF
for (i = 0; i < INTER_MODE_CONTEXTS; i++)
aom_tree_merge_probs(av1_inter_singleref_comp_mode_tree,
pre_fc->inter_singleref_comp_mode_probs[i],
counts->inter_singleref_comp_mode[i],
fc->inter_singleref_comp_mode_probs[i]);
#endif // CONFIG_COMPOUND_SINGLEREF
if (cm->allow_interintra_compound) { if (cm->allow_interintra_compound) {
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i) { for (i = 0; i < BLOCK_SIZE_GROUPS; ++i) {
if (is_interintra_allowed_bsize_group(i)) if (is_interintra_allowed_bsize_group(i))
......
...@@ -27,9 +27,6 @@ extern "C" { ...@@ -27,9 +27,6 @@ extern "C" {
#define TX_SIZE_CONTEXTS 2 #define TX_SIZE_CONTEXTS 2
#define INTER_OFFSET(mode) ((mode)-NEARESTMV) #define INTER_OFFSET(mode) ((mode)-NEARESTMV)
#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) #define INTER_COMPOUND_OFFSET(mode) ((mode)-NEAREST_NEARESTMV)
// Number of possible contexts for a color index. // Number of possible contexts for a color index.
...@@ -200,12 +197,6 @@ typedef struct frame_contexts { ...@@ -200,12 +197,6 @@ typedef struct frame_contexts {
[INTER_COMPOUND_MODES - 1]; [INTER_COMPOUND_MODES - 1];
aom_cdf_prob inter_compound_mode_cdf[INTER_MODE_CONTEXTS] aom_cdf_prob inter_compound_mode_cdf[INTER_MODE_CONTEXTS]
[CDF_SIZE(INTER_COMPOUND_MODES)]; [CDF_SIZE(INTER_COMPOUND_MODES)];
#if CONFIG_COMPOUND_SINGLEREF
aom_prob inter_singleref_comp_mode_probs[INTER_MODE_CONTEXTS]
[INTER_SINGLEREF_COMP_MODES - 1];
aom_cdf_prob inter_singleref_comp_mode_cdf[INTER_MODE_CONTEXTS][CDF_SIZE(
INTER_SINGLEREF_COMP_MODES)];
#endif // CONFIG_COMPOUND_SINGLEREF
aom_prob compound_type_prob[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1]; aom_prob compound_type_prob[BLOCK_SIZES_ALL][COMPOUND_TYPES - 1];
aom_cdf_prob compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)]; aom_cdf_prob compound_type_cdf[BLOCK_SIZES_ALL][CDF_SIZE(COMPOUND_TYPES)];
aom_prob interintra_prob[BLOCK_SIZE_GROUPS]; aom_prob interintra_prob[BLOCK_SIZE_GROUPS];
...@@ -263,9 +254,6 @@ typedef struct frame_contexts { ...@@ -263,9 +254,6 @@ typedef struct frame_contexts {
aom_cdf_prob comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)]; aom_cdf_prob comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)];
aom_cdf_prob comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)]; aom_cdf_prob comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)];
#endif #endif
#if CONFIG_COMPOUND_SINGLEREF
aom_prob comp_inter_mode_prob[COMP_INTER_MODE_CONTEXTS];
#endif // CONFIG_COMPOUND_SINGLEREF
aom_prob txfm_partition_prob[TXFM_PARTITION_CONTEXTS]; aom_prob txfm_partition_prob[TXFM_PARTITION_CONTEXTS];
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob txfm_partition_cdf[TXFM_PARTITION_CONTEXTS][CDF_SIZE(2)]; aom_cdf_prob txfm_partition_cdf[TXFM_PARTITION_CONTEXTS][CDF_SIZE(2)];
...@@ -431,10 +419,6 @@ typedef struct FRAME_COUNTS { ...@@ -431,10 +419,6 @@ typedef struct FRAME_COUNTS {
unsigned int drl_mode[DRL_MODE_CONTEXTS][2]; unsigned int drl_mode[DRL_MODE_CONTEXTS][2];
unsigned int inter_compound_mode[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES]; unsigned int inter_compound_mode[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES];
#if CONFIG_COMPOUND_SINGLEREF
unsigned int inter_singleref_comp_mode[INTER_MODE_CONTEXTS]
[INTER_SINGLEREF_COMP_MODES];
#endif // CONFIG_COMPOUND_SINGLEREF
unsigned int interintra[BLOCK_SIZE_GROUPS][2]; unsigned int interintra[BLOCK_SIZE_GROUPS][2];
unsigned int interintra_mode[BLOCK_SIZE_GROUPS][INTERINTRA_MODES]; unsigned int interintra_mode[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
unsigned int wedge_interintra[BLOCK_SIZES_ALL][2]; unsigned int wedge_interintra[BLOCK_SIZES_ALL][2];
...@@ -450,9 +434,6 @@ typedef struct FRAME_COUNTS { ...@@ -450,9 +434,6 @@ typedef struct FRAME_COUNTS {
unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS - 1][2]; unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS - 1][2];
unsigned int comp_ref[REF_CONTEXTS][FWD_REFS - 1][2]; unsigned int comp_ref[REF_CONTEXTS][FWD_REFS - 1][2];
unsigned int comp_bwdref[REF_CONTEXTS][BWD_REFS - 1][2]; unsigned int comp_bwdref[REF_CONTEXTS][BWD_REFS - 1][2];
#if CONFIG_COMPOUND_SINGLEREF
unsigned int comp_inter_mode[COMP_INTER_MODE_CONTEXTS][2];
#endif // CONFIG_COMPOUND_SINGLEREF
unsigned int txfm_partition[TXFM_PARTITION_CONTEXTS][2]; unsigned int txfm_partition[TXFM_PARTITION_CONTEXTS][2];
#if CONFIG_EXT_SKIP #if CONFIG_EXT_SKIP
unsigned int skip_mode[SKIP_MODE_CONTEXTS][2]; unsigned int skip_mode[SKIP_MODE_CONTEXTS][2];
...@@ -566,10 +547,6 @@ extern const aom_tree_index ...@@ -566,10 +547,6 @@ extern const aom_tree_index
av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)]; av1_interintra_mode_tree[TREE_SIZE(INTERINTRA_MODES)];
extern const aom_tree_index extern const aom_tree_index
av1_inter_compound_mode_tree[TREE_SIZE(INTER_COMPOUND_MODES)]; av1_inter_compound_mode_tree[TREE_SIZE(INTER_COMPOUND_MODES)];
#if CONFIG_COMPOUND_SINGLEREF
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)]; extern const aom_tree_index av1_compound_type_tree[TREE_SIZE(COMPOUND_TYPES)];
extern const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)]; extern const aom_tree_index av1_partition_tree[TREE_SIZE(PARTITION_TYPES)];
#if CONFIG_EXT_PARTITION_TYPES #if CONFIG_EXT_PARTITION_TYPES
......
...@@ -494,14 +494,6 @@ typedef enum ATTRIBUTE_PACKED { ...@@ -494,14 +494,6 @@ typedef enum ATTRIBUTE_PACKED {
NEARMV, NEARMV,
GLOBALMV, GLOBALMV,
NEWMV, NEWMV,
#if CONFIG_COMPOUND_SINGLEREF
// Single ref compound modes
SR_NEAREST_NEARMV,
// SR_NEAREST_NEWMV,
SR_NEAR_NEWMV,
SR_ZERO_NEWMV,
SR_NEW_NEWMV,
#endif // CONFIG_COMPOUND_SINGLEREF
// Compound ref compound modes // Compound ref compound modes
NEAREST_NEARESTMV, NEAREST_NEARESTMV,
NEAR_NEARMV, NEAR_NEARMV,
...@@ -590,10 +582,6 @@ typedef enum ATTRIBUTE_PACKED { ...@@ -590,10 +582,6 @@ typedef enum ATTRIBUTE_PACKED {
#define INTER_MODES (1 + NEWMV - NEARESTMV) #define INTER_MODES (1 + NEWMV - NEARESTMV)
#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) #define INTER_COMPOUND_MODES (1 + NEW_NEWMV - NEAREST_NEARESTMV)
#define SKIP_CONTEXTS 3 #define SKIP_CONTEXTS 3
...@@ -653,10 +641,6 @@ typedef enum ATTRIBUTE_PACKED { ...@@ -653,10 +641,6 @@ typedef enum ATTRIBUTE_PACKED {
#define UNI_COMP_REF_CONTEXTS 3 #define UNI_COMP_REF_CONTEXTS 3
#endif // CONFIG_EXT_COMP_REFS #endif // CONFIG_EXT_COMP_REFS
#if CONFIG_COMPOUND_SINGLEREF
#define COMP_INTER_MODE_CONTEXTS 4
#endif // CONFIG_COMPOUND_SINGLEREF
#define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 2) #define TXFM_PARTITION_CONTEXTS ((TX_SIZES - TX_8X8) * 6 - 2)
typedef uint8_t TXFM_CONTEXT; typedef uint8_t TXFM_CONTEXT;
......
...@@ -61,21 +61,14 @@ static const int mode_2_counter[] = { ...@@ -61,21 +61,14 @@ static const int mode_2_counter[] = {
0, // NEARMV 0, // NEARMV
3, // GLOBALMV 3, // GLOBALMV
1, // NEWMV 1, // NEWMV
#if CONFIG_COMPOUND_SINGLEREF 0, // NEAREST_NEARESTMV
0, // SR_NEAREST_NEARMV 0, // NEAR_NEARMV
// 1, // SR_NEAREST_NEWMV 1, // NEAREST_NEWMV
1, // SR_NEAR_NEWMV 1, // NEW_NEARESTMV
3, // SR_ZERO_NEWMV 1, // NEAR_NEWMV
1, // SR_NEW_NEWMV 1, // NEW_NEARMV
#endif // CONFIG_COMPOUND_SINGLEREF 3, // GLOBAL_GLOBALMV
0, // NEAREST_NEARESTMV 1, // NEW_NEWMV
0, // NEAR_NEARMV
1, // NEAREST_NEWMV
1, // NEW_NEARESTMV
1, // NEAR_NEWMV
1, // NEW_NEARMV
3, // GLOBAL_GLOBALMV
1, // NEW_NEWMV
}; };
// There are 3^3 different combinations of 3 counts that can be either 0,1 or // There are 3^3 different combinations of 3 counts that can be either 0,1 or
......
...@@ -172,42 +172,6 @@ int av1_get_intra_inter_context(const MACROBLOCKD *xd) { ...@@ -172,42 +172,6 @@ int av1_get_intra_inter_context(const MACROBLOCKD *xd) {
} }
} }
#if CONFIG_COMPOUND_SINGLEREF
// The compound/single mode info data structure has one element border above and
// to the left of the entries corresponding to real macroblocks.
// The prediction flags in these dummy entries are initialized to 0.
int av1_get_inter_mode_context(const MACROBLOCKD *xd) {
const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
const MB_MODE_INFO *const left_mbmi = xd->left_mbmi;
const int has_above = xd->up_available;
const int has_left = xd->left_available;
if (has_above && has_left) { // both edges available
const int above_inter_comp_mode =
is_inter_anyref_comp_mode(above_mbmi->mode);
const int left_inter_comp_mode = is_inter_anyref_comp_mode(left_mbmi->mode);
if (above_inter_comp_mode && left_inter_comp_mode)
return 0;
else if (above_inter_comp_mode || left_inter_comp_mode)
return 1;
else if (!is_inter_block(above_mbmi) && !is_inter_block(left_mbmi))
return 2;
else
return 3;
} else if (has_above || has_left) { // one edge available
const MB_MODE_INFO *const edge_mbmi = has_above ? above_mbmi : left_mbmi;
if (is_inter_anyref_comp_mode(edge_mbmi->mode))
return 1;
else if (!is_inter_block(edge_mbmi))
return 2;
else
return 3;
} else { // no edge available
return 2;
}
}
#endif // CONFIG_COMPOUND_SINGLEREF
#define CHECK_BACKWARD_REFS(ref_frame) \ #define CHECK_BACKWARD_REFS(ref_frame) \
(((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME)) (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame) #define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
......
...@@ -409,15 +409,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p6( ...@@ -409,15 +409,6 @@ static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p6(
} }
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
#if CONFIG_COMPOUND_SINGLEREF
int av1_get_inter_mode_context(const MACROBLOCKD *xd);
static INLINE aom_prob av1_get_inter_mode_prob(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->comp_inter_mode_prob[av1_get_inter_mode_context(xd)];
}
#endif // CONFIG_COMPOUND_SINGLEREF
// Returns a context number for the given MB prediction signal // Returns a context number for the given MB prediction signal
// The mode info data structure has a one element border above and to the // The mode info data structure has a one element border above and to the
// left of the entries corresponding to real blocks. // left of the entries corresponding to real blocks.
......
...@@ -78,17 +78,7 @@ static INLINE void av1_make_inter_predictor( ...@@ -78,17 +78,7 @@ static INLINE void av1_make_inter_predictor(
WarpedMotionParams final_warp_params; WarpedMotionParams final_warp_params;
const int do_warp = const int do_warp =
(w >= 8 && h >= 8 && (w >= 8 && h >= 8 &&
allow_warp(mi, warp_types, allow_warp(mi, warp_types, &xd->global_motion[mi->mbmi.ref_frame[ref]],
#if CONFIG_COMPOUND_SINGLEREF
// TODO(zoeliu): To further check the single
// ref comp mode to work together with
// global motion.
has_second_ref(&mi->mbmi)
? &xd->global_motion[mi->mbmi.ref_frame[ref]]
: &xd->global_motion[mi->mbmi.ref_frame[0]],
#else // !(CONFIG_COMPOUND_SINGLEREF)
&xd->global_motion[mi->mbmi.ref_frame[ref]],
#endif // CONFIG_COMPOUND_SINGLEREF
build_for_obmc, xs, ys, &final_warp_params)); build_for_obmc, xs, ys, &final_warp_params));
if (do_warp if (do_warp
#if CONFIG_AMVR #if CONFIG_AMVR
...@@ -997,10 +987,6 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd, ...@@ -997,10 +987,6 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
int mi_x, int mi_y) { int mi_x, int mi_y) {
struct macroblockd_plane *const pd = &xd->plane[plane]; struct macroblockd_plane *const pd = &xd->plane[plane];
int is_compound = has_second_ref(&mi->mbmi); int is_compound = has_second_ref(&mi->mbmi);
#if CONFIG_COMPOUND_SINGLEREF
int is_comp_mode_pred =
is_compound || is_inter_singleref_comp_mode(mi->mbmi.mode);
#endif // CONFIG_COMPOUND_SINGLEREF
int ref; int ref;
#if CONFIG_INTRABC #if CONFIG_INTRABC
const int is_intrabc = is_intrabc_block(&mi->mbmi); const int is_intrabc = is_intrabc_block(&mi->mbmi);
...@@ -1011,9 +997,6 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd, ...@@ -1011,9 +997,6 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
WarpedMotionParams *const wm = &xd->global_motion[mi->mbmi.ref_frame[ref]]; WarpedMotionParams *const wm = &xd->global_motion[mi->mbmi.ref_frame[ref]];
is_global[ref] = is_global_mv_block(mi, block, wm->wmtype); is_global[ref] = is_global_mv_block(mi, block, wm->wmtype);
} }
#if CONFIG_COMPOUND_SINGLEREF
if (!is_compound && is_comp_mode_pred) is_global[1] = is_global[0];
#endif // CONFIG_COMPOUND_SINGLEREF
(void)block; (void)block;
(void)cm; (void)cm;
...@@ -1194,17 +1177,10 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd, ...@@ -1194,17 +1177,10 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
xd->bd); xd->bd);
else else
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
#if CONFIG_COMPOUND_SINGLEREF
av1_convolve_rounding( av1_convolve_rounding(
tmp_dst, tmp_dst_stride, dst, dst_buf->stride, b4_w, b4_h, tmp_dst, tmp_dst_stride, dst, dst_buf->stride, b4_w, b4_h,
FILTER_BITS * 2 + is_comp_mode_pred - conv_params.round_0 - FILTER_BITS * 2 + is_compound - conv_params.round_0 -
conv_params.round_1); conv_params.round_1);
#else // !(CONFIG_COMPOUND_SINGLEREF)
av1_convolve_rounding(tmp_dst, tmp_dst_stride, dst, dst_buf->stride,
b4_w, b4_h,
FILTER_BITS * 2 + is_compound -
conv_params.round_0 - conv_params.round_1);
#endif // CONFIG_COMPOUND_SINGLEREF
} }
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND
++col; ++col;
...@@ -1225,12 +1201,7 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd, ...@@ -1225,12 +1201,7 @@ static INLINE void build_inter_predictors(const AV1_COMMON *cm, MACROBLOCKD *xd,
DECLARE_ALIGNED(16, int32_t, tmp_dst[MAX_SB_SIZE * MAX_SB_SIZE]); DECLARE_ALIGNED(16, int32_t, tmp_dst[MAX_SB_SIZE * MAX_SB_SIZE]);
#endif // CONFIG_CONVOLVE_ROUND #endif // CONFIG_CONVOLVE_ROUND