Commit 365e644a authored by Sebastien Alaiwan's avatar Sebastien Alaiwan
Browse files

Remove compile guards for CONFIG_EXT_REFS

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

Change-Id: I4705652ac8231ee25f960e8096dc97c2aeed1d20
parent 259d4422
...@@ -412,7 +412,6 @@ enum aome_enc_control_id { ...@@ -412,7 +412,6 @@ enum aome_enc_control_id {
/*!\brief Codec control function to enable automatic set and use /*!\brief Codec control function to enable automatic set and use
* bwd-pred frames. * bwd-pred frames.
* *
* Experiment: EXT_REFS
*/ */
AOME_SET_ENABLEAUTOBWDREF, AOME_SET_ENABLEAUTOBWDREF,
......
...@@ -28,9 +28,7 @@ ...@@ -28,9 +28,7 @@
struct av1_extracfg { struct av1_extracfg {
int cpu_used; // available cpu percentage in 1/16 int cpu_used; // available cpu percentage in 1/16
unsigned int enable_auto_alt_ref; unsigned int enable_auto_alt_ref;
#if CONFIG_EXT_REFS
unsigned int enable_auto_bwd_ref; unsigned int enable_auto_bwd_ref;
#endif // CONFIG_EXT_REFS
unsigned int noise_sensitivity; unsigned int noise_sensitivity;
unsigned int sharpness; unsigned int sharpness;
unsigned int static_thresh; unsigned int static_thresh;
...@@ -93,14 +91,12 @@ struct av1_extracfg { ...@@ -93,14 +91,12 @@ struct av1_extracfg {
static struct av1_extracfg default_extra_cfg = { static struct av1_extracfg default_extra_cfg = {
0, // cpu_used 0, // cpu_used
1, // enable_auto_alt_ref 1, // enable_auto_alt_ref
#if CONFIG_EXT_REFS 0, // enable_auto_bwd_ref
0, // enable_auto_bwd_ref 0, // noise_sensitivity
#endif // CONFIG_EXT_REFS 0, // sharpness
0, // noise_sensitivity 0, // static_thresh
0, // sharpness 0, // tile_columns
0, // static_thresh 0, // tile_rows
0, // tile_columns
0, // tile_rows
#if CONFIG_DEPENDENT_HORZTILES #if CONFIG_DEPENDENT_HORZTILES
0, // Dependent Horizontal tiles 0, // Dependent Horizontal tiles
#endif #endif
...@@ -275,9 +271,7 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx, ...@@ -275,9 +271,7 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
RANGE_CHECK_HI(extra_cfg, motion_vector_unit_test, 2); RANGE_CHECK_HI(extra_cfg, motion_vector_unit_test, 2);
RANGE_CHECK_HI(extra_cfg, enable_auto_alt_ref, 2); RANGE_CHECK_HI(extra_cfg, enable_auto_alt_ref, 2);
#if CONFIG_EXT_REFS
RANGE_CHECK_HI(extra_cfg, enable_auto_bwd_ref, 2); RANGE_CHECK_HI(extra_cfg, enable_auto_bwd_ref, 2);
#endif // CONFIG_EXT_REFS
RANGE_CHECK(extra_cfg, cpu_used, 0, 8); RANGE_CHECK(extra_cfg, cpu_used, 0, 8);
RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6); RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6);
RANGE_CHECK(extra_cfg, superblock_size, AOM_SUPERBLOCK_SIZE_64X64, RANGE_CHECK(extra_cfg, superblock_size, AOM_SUPERBLOCK_SIZE_64X64,
...@@ -561,9 +555,7 @@ static aom_codec_err_t set_encoder_config( ...@@ -561,9 +555,7 @@ static aom_codec_err_t set_encoder_config(
oxcf->speed = extra_cfg->cpu_used; oxcf->speed = extra_cfg->cpu_used;
oxcf->enable_auto_arf = extra_cfg->enable_auto_alt_ref; oxcf->enable_auto_arf = extra_cfg->enable_auto_alt_ref;
#if CONFIG_EXT_REFS
oxcf->enable_auto_brf = extra_cfg->enable_auto_bwd_ref; oxcf->enable_auto_brf = extra_cfg->enable_auto_bwd_ref;
#endif // CONFIG_EXT_REFS
oxcf->noise_sensitivity = extra_cfg->noise_sensitivity; oxcf->noise_sensitivity = extra_cfg->noise_sensitivity;
oxcf->sharpness = extra_cfg->sharpness; oxcf->sharpness = extra_cfg->sharpness;
...@@ -741,14 +733,12 @@ static aom_codec_err_t ctrl_set_enable_auto_alt_ref(aom_codec_alg_priv_t *ctx, ...@@ -741,14 +733,12 @@ static aom_codec_err_t ctrl_set_enable_auto_alt_ref(aom_codec_alg_priv_t *ctx,
return update_extra_cfg(ctx, &extra_cfg); return update_extra_cfg(ctx, &extra_cfg);
} }
#if CONFIG_EXT_REFS
static aom_codec_err_t ctrl_set_enable_auto_bwd_ref(aom_codec_alg_priv_t *ctx, static aom_codec_err_t ctrl_set_enable_auto_bwd_ref(aom_codec_alg_priv_t *ctx,
va_list args) { va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg; struct av1_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.enable_auto_bwd_ref = CAST(AOME_SET_ENABLEAUTOBWDREF, args); extra_cfg.enable_auto_bwd_ref = CAST(AOME_SET_ENABLEAUTOBWDREF, args);
return update_extra_cfg(ctx, &extra_cfg); return update_extra_cfg(ctx, &extra_cfg);
} }
#endif // CONFIG_EXT_REFS
static aom_codec_err_t ctrl_set_noise_sensitivity(aom_codec_alg_priv_t *ctx, static aom_codec_err_t ctrl_set_noise_sensitivity(aom_codec_alg_priv_t *ctx,
va_list args) { va_list args) {
...@@ -1163,17 +1153,8 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx, ...@@ -1163,17 +1153,8 @@ static aom_codec_err_t encoder_encode(aom_codec_alg_priv_t *ctx,
// TODO(jzern) the checks related to cpi's validity should be treated as a // TODO(jzern) the checks related to cpi's validity should be treated as a
// failure condition, encoder setup is done fully in init() currently. // failure condition, encoder setup is done fully in init() currently.
if (res == AOM_CODEC_OK) { if (res == AOM_CODEC_OK) {
#if CONFIG_EXT_REFS
size_t data_sz = ALIGN_POWER_OF_TWO(ctx->cfg.g_w, 5) * size_t data_sz = ALIGN_POWER_OF_TWO(ctx->cfg.g_w, 5) *
ALIGN_POWER_OF_TWO(ctx->cfg.g_h, 5) * get_image_bps(img); ALIGN_POWER_OF_TWO(ctx->cfg.g_h, 5) * get_image_bps(img);
#else
// There's no codec control for multiple alt-refs so check the encoder
// instance for its status to determine the compressed data size.
size_t data_sz = ALIGN_POWER_OF_TWO(ctx->cfg.g_w, 5) *
ALIGN_POWER_OF_TWO(ctx->cfg.g_h, 5) *
get_image_bps(img) / 8 *
(cpi->multi_arf_allowed ? 8 : 2);
#endif // CONFIG_EXT_REFS
if (data_sz < kMinCompressedSize) data_sz = kMinCompressedSize; if (data_sz < kMinCompressedSize) data_sz = kMinCompressedSize;
if (ctx->cx_data == NULL || ctx->cx_data_sz < data_sz) { if (ctx->cx_data == NULL || ctx->cx_data_sz < data_sz) {
ctx->cx_data_sz = data_sz; ctx->cx_data_sz = data_sz;
...@@ -1558,9 +1539,7 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = { ...@@ -1558,9 +1539,7 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{ AOME_SET_SCALEMODE, ctrl_set_scale_mode }, { AOME_SET_SCALEMODE, ctrl_set_scale_mode },
{ AOME_SET_CPUUSED, ctrl_set_cpuused }, { AOME_SET_CPUUSED, ctrl_set_cpuused },
{ AOME_SET_ENABLEAUTOALTREF, ctrl_set_enable_auto_alt_ref }, { AOME_SET_ENABLEAUTOALTREF, ctrl_set_enable_auto_alt_ref },
#if CONFIG_EXT_REFS
{ AOME_SET_ENABLEAUTOBWDREF, ctrl_set_enable_auto_bwd_ref }, { AOME_SET_ENABLEAUTOBWDREF, ctrl_set_enable_auto_bwd_ref },
#endif // CONFIG_EXT_REFS
{ AOME_SET_SHARPNESS, ctrl_set_sharpness }, { AOME_SET_SHARPNESS, ctrl_set_sharpness },
{ AOME_SET_STATIC_THRESHOLD, ctrl_set_static_thresh }, { AOME_SET_STATIC_THRESHOLD, ctrl_set_static_thresh },
{ AV1E_SET_TILE_COLUMNS, ctrl_set_tile_columns }, { AV1E_SET_TILE_COLUMNS, ctrl_set_tile_columns },
......
...@@ -50,8 +50,8 @@ struct loopfilter { ...@@ -50,8 +50,8 @@ struct loopfilter {
uint8_t mode_ref_delta_enabled; uint8_t mode_ref_delta_enabled;
uint8_t mode_ref_delta_update; uint8_t mode_ref_delta_update;
// 0 = Intra, Last, Last2+Last3(CONFIG_EXT_REFS), // 0 = Intra, Last, Last2+Last3,
// GF, BRF(CONFIG_EXT_REFS), ARF2(CONFIG_EXT_REFS), ARF // GF, BRF, ARF2, ARF
int8_t ref_deltas[TOTAL_REFS_PER_FRAME]; int8_t ref_deltas[TOTAL_REFS_PER_FRAME];
int8_t last_ref_deltas[TOTAL_REFS_PER_FRAME]; int8_t last_ref_deltas[TOTAL_REFS_PER_FRAME];
......
...@@ -2339,11 +2339,9 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, ...@@ -2339,11 +2339,9 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(comp_inter_cdf) AVERAGE_TILE_CDFS(comp_inter_cdf)
#if CONFIG_EXT_REFS
AVERAGE_TILE_CDFS(comp_ref_cdf) AVERAGE_TILE_CDFS(comp_ref_cdf)
AVERAGE_TILE_CDFS(comp_bwdref_cdf) AVERAGE_TILE_CDFS(comp_bwdref_cdf)
#endif #endif
#endif
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
AVERAGE_TILE_CDFS(single_ref_cdf) AVERAGE_TILE_CDFS(single_ref_cdf)
......
...@@ -1844,7 +1844,6 @@ static const aom_cdf_prob ...@@ -1844,7 +1844,6 @@ static const aom_cdf_prob
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_EXT_COMP_REFS #endif // CONFIG_EXT_COMP_REFS
#if CONFIG_EXT_REFS
static const aom_prob default_comp_ref_p[REF_CONTEXTS][FWD_REFS - 1] = { static const aom_prob default_comp_ref_p[REF_CONTEXTS][FWD_REFS - 1] = {
{ 28, 10, 8 }, { 28, 10, 8 },
{ 77, 27, 26 }, { 77, 27, 26 },
...@@ -1892,39 +1891,17 @@ static const aom_cdf_prob ...@@ -1892,39 +1891,17 @@ static const aom_cdf_prob
}; };
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
#else // !CONFIG_EXT_REFS
static const aom_prob default_comp_ref_p[REF_CONTEXTS][COMP_REFS - 1] = {
{ 43 }, { 100 }, { 137 }, { 212 }, { 229 },
};
#if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob
default_comp_ref_cdf[REF_CONTEXTS][COMP_REFS - 1][CDF_SIZE(2)] = {
{ { AOM_ICDF(43 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(100 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(137 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(212 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(229 * 128), AOM_ICDF(32768), 0 } }
};
#endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_EXT_REFS
static const aom_prob default_single_ref_p[REF_CONTEXTS][SINGLE_REFS - 1] = { static const aom_prob default_single_ref_p[REF_CONTEXTS][SINGLE_REFS - 1] = {
#if CONFIG_EXT_REFS
{ 36, 16, 32, 57, 11, 14 }, { 36, 16, 32, 57, 11, 14 },
{ 68, 128, 73, 128, 49, 124 }, { 68, 128, 73, 128, 49, 124 },
{ 136, 236, 127, 170, 81, 238 }, { 136, 236, 127, 170, 81, 238 },
{ 128, 128, 191, 211, 115, 128 }, { 128, 128, 191, 211, 115, 128 },
{ 224, 128, 230, 242, 208, 128 } { 224, 128, 230, 242, 208, 128 }
#else // !CONFIG_EXT_REFS
{ 31, 25 }, { 72, 80 }, { 147, 148 }, { 197, 191 }, { 235, 247 },
#endif // CONFIG_EXT_REFS
}; };
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
static const aom_cdf_prob static const aom_cdf_prob
default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)] = { default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)] = {
#if CONFIG_EXT_REFS
{ { AOM_ICDF(4623), AOM_ICDF(32768), 0 }, { { AOM_ICDF(4623), AOM_ICDF(32768), 0 },
{ AOM_ICDF(2110), AOM_ICDF(32768), 0 }, { AOM_ICDF(2110), AOM_ICDF(32768), 0 },
{ AOM_ICDF(4132), AOM_ICDF(32768), 0 }, { AOM_ICDF(4132), AOM_ICDF(32768), 0 },
...@@ -1955,18 +1932,6 @@ static const aom_cdf_prob ...@@ -1955,18 +1932,6 @@ static const aom_cdf_prob
{ AOM_ICDF(30969), AOM_ICDF(32768), 0 }, { AOM_ICDF(30969), AOM_ICDF(32768), 0 },
{ AOM_ICDF(26676), AOM_ICDF(32768), 0 }, { AOM_ICDF(26676), AOM_ICDF(32768), 0 },
{ AOM_ICDF(32768), AOM_ICDF(32768), 0 } } { AOM_ICDF(32768), AOM_ICDF(32768), 0 } }
#else // !CONFIG_EXT_REFS
{ { AOM_ICDF(31 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(25 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(72 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(80 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(147 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(148 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(197 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(191 * 128), AOM_ICDF(32768), 0 } },
{ { AOM_ICDF(235 * 128), AOM_ICDF(32768), 0 },
{ AOM_ICDF(247 * 128), AOM_ICDF(32768), 0 } }
#endif // CONFIG_EXT_REFS
}; };
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
...@@ -6526,12 +6491,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -6526,12 +6491,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_init_txb_probs(fc); av1_init_txb_probs(fc);
#endif // LV_MAP_PROB #endif // LV_MAP_PROB
#endif #endif
#if CONFIG_EXT_REFS
av1_copy(fc->comp_bwdref_prob, default_comp_bwdref_p); av1_copy(fc->comp_bwdref_prob, default_comp_bwdref_p);
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->comp_bwdref_cdf, default_comp_bwdref_cdf); av1_copy(fc->comp_bwdref_cdf, default_comp_bwdref_cdf);
#endif #endif
#endif // CONFIG_EXT_REFS
av1_copy(fc->single_ref_prob, default_single_ref_p); av1_copy(fc->single_ref_prob, default_single_ref_p);
#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);
...@@ -6685,7 +6648,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { ...@@ -6685,7 +6648,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
pre_fc->uni_comp_ref_prob[i][j], counts->uni_comp_ref[i][j]); pre_fc->uni_comp_ref_prob[i][j], counts->uni_comp_ref[i][j]);
#endif // CONFIG_EXT_COMP_REFS #endif // CONFIG_EXT_COMP_REFS
#if CONFIG_EXT_REFS
for (i = 0; i < REF_CONTEXTS; i++) for (i = 0; i < REF_CONTEXTS; i++)
for (j = 0; j < (FWD_REFS - 1); j++) for (j = 0; j < (FWD_REFS - 1); j++)
fc->comp_ref_prob[i][j] = mode_mv_merge_probs(pre_fc->comp_ref_prob[i][j], fc->comp_ref_prob[i][j] = mode_mv_merge_probs(pre_fc->comp_ref_prob[i][j],
...@@ -6694,12 +6656,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) { ...@@ -6694,12 +6656,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
for (j = 0; j < (BWD_REFS - 1); j++) for (j = 0; j < (BWD_REFS - 1); j++)
fc->comp_bwdref_prob[i][j] = mode_mv_merge_probs( fc->comp_bwdref_prob[i][j] = mode_mv_merge_probs(
pre_fc->comp_bwdref_prob[i][j], counts->comp_bwdref[i][j]); pre_fc->comp_bwdref_prob[i][j], counts->comp_bwdref[i][j]);
#else
for (i = 0; i < REF_CONTEXTS; i++)
for (j = 0; j < (COMP_REFS - 1); j++)
fc->comp_ref_prob[i][j] = mode_mv_merge_probs(pre_fc->comp_ref_prob[i][j],
counts->comp_ref[i][j]);
#endif // CONFIG_EXT_REFS
for (i = 0; i < REF_CONTEXTS; i++) for (i = 0; i < REF_CONTEXTS; i++)
for (j = 0; j < (SINGLE_REFS - 1); j++) for (j = 0; j < (SINGLE_REFS - 1); j++)
...@@ -6920,15 +6876,11 @@ static void set_default_lf_deltas(struct loopfilter *lf) { ...@@ -6920,15 +6876,11 @@ static void set_default_lf_deltas(struct loopfilter *lf) {
lf->ref_deltas[INTRA_FRAME] = 1; lf->ref_deltas[INTRA_FRAME] = 1;
lf->ref_deltas[LAST_FRAME] = 0; lf->ref_deltas[LAST_FRAME] = 0;
#if CONFIG_EXT_REFS
lf->ref_deltas[LAST2_FRAME] = lf->ref_deltas[LAST_FRAME]; lf->ref_deltas[LAST2_FRAME] = lf->ref_deltas[LAST_FRAME];
lf->ref_deltas[LAST3_FRAME] = lf->ref_deltas[LAST_FRAME]; lf->ref_deltas[LAST3_FRAME] = lf->ref_deltas[LAST_FRAME];
lf->ref_deltas[BWDREF_FRAME] = lf->ref_deltas[LAST_FRAME]; lf->ref_deltas[BWDREF_FRAME] = lf->ref_deltas[LAST_FRAME];
#endif // CONFIG_EXT_REFS
lf->ref_deltas[GOLDEN_FRAME] = -1; lf->ref_deltas[GOLDEN_FRAME] = -1;
#if CONFIG_EXT_REFS
lf->ref_deltas[ALTREF2_FRAME] = -1; lf->ref_deltas[ALTREF2_FRAME] = -1;
#endif // CONFIG_EXT_REFS
lf->ref_deltas[ALTREF_FRAME] = -1; lf->ref_deltas[ALTREF_FRAME] = -1;
lf->mode_deltas[0] = 0; lf->mode_deltas[0] = 0;
......
...@@ -294,19 +294,11 @@ typedef struct frame_contexts { ...@@ -294,19 +294,11 @@ typedef struct frame_contexts {
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
#endif // CONFIG_EXT_COMP_REFS #endif // CONFIG_EXT_COMP_REFS
aom_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS - 1]; aom_prob single_ref_prob[REF_CONTEXTS][SINGLE_REFS - 1];
#if CONFIG_EXT_REFS
aom_prob comp_ref_prob[REF_CONTEXTS][FWD_REFS - 1]; aom_prob comp_ref_prob[REF_CONTEXTS][FWD_REFS - 1];
aom_prob comp_bwdref_prob[REF_CONTEXTS][BWD_REFS - 1]; aom_prob comp_bwdref_prob[REF_CONTEXTS][BWD_REFS - 1];
#else
aom_prob comp_ref_prob[REF_CONTEXTS][COMP_REFS - 1];
#endif // CONFIG_EXT_REFS
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
#if CONFIG_EXT_REFS
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)];
#else
aom_cdf_prob comp_ref_cdf[REF_CONTEXTS][COMP_REFS - 1][CDF_SIZE(2)];
#endif // CONFIG_EXT_REFS
#endif #endif
#if CONFIG_COMPOUND_SINGLEREF #if CONFIG_COMPOUND_SINGLEREF
aom_prob comp_inter_mode_prob[COMP_INTER_MODE_CONTEXTS]; aom_prob comp_inter_mode_prob[COMP_INTER_MODE_CONTEXTS];
...@@ -505,12 +497,8 @@ typedef struct FRAME_COUNTS { ...@@ -505,12 +497,8 @@ typedef struct FRAME_COUNTS {
unsigned int uni_comp_ref[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1][2]; unsigned int uni_comp_ref[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1][2];
#endif // CONFIG_EXT_COMP_REFS #endif // CONFIG_EXT_COMP_REFS
unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS - 1][2]; unsigned int single_ref[REF_CONTEXTS][SINGLE_REFS - 1][2];
#if CONFIG_EXT_REFS
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];
#else
unsigned int comp_ref[REF_CONTEXTS][COMP_REFS - 1][2];
#endif // CONFIG_EXT_REFS
#if CONFIG_COMPOUND_SINGLEREF #if CONFIG_COMPOUND_SINGLEREF
unsigned int comp_inter_mode[COMP_INTER_MODE_CONTEXTS][2]; unsigned int comp_inter_mode[COMP_INTER_MODE_CONTEXTS][2];
#endif // CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
......
...@@ -389,7 +389,6 @@ typedef enum { ...@@ -389,7 +389,6 @@ typedef enum {
typedef enum { typedef enum {
AOM_LAST_FLAG = 1 << 0, AOM_LAST_FLAG = 1 << 0,
#if CONFIG_EXT_REFS
AOM_LAST2_FLAG = 1 << 1, AOM_LAST2_FLAG = 1 << 1,
AOM_LAST3_FLAG = 1 << 2, AOM_LAST3_FLAG = 1 << 2,
AOM_GOLD_FLAG = 1 << 3, AOM_GOLD_FLAG = 1 << 3,
...@@ -397,11 +396,6 @@ typedef enum { ...@@ -397,11 +396,6 @@ typedef enum {
AOM_ALT2_FLAG = 1 << 5, AOM_ALT2_FLAG = 1 << 5,
AOM_ALT_FLAG = 1 << 6, AOM_ALT_FLAG = 1 << 6,
AOM_REFFRAME_ALL = (1 << 7) - 1 AOM_REFFRAME_ALL = (1 << 7) - 1
#else // !CONFIG_EXT_REFS
AOM_GOLD_FLAG = 1 << 1,
AOM_ALT_FLAG = 1 << 2,
AOM_REFFRAME_ALL = (1 << 3) - 1
#endif // CONFIG_EXT_REFS
} AOM_REFFRAME; } AOM_REFFRAME;
#if CONFIG_EXT_COMP_REFS #if CONFIG_EXT_COMP_REFS
...@@ -686,7 +680,6 @@ typedef uint8_t TXFM_CONTEXT; ...@@ -686,7 +680,6 @@ typedef uint8_t TXFM_CONTEXT;
#define INTRA_FRAME 0 #define INTRA_FRAME 0
#define LAST_FRAME 1 #define LAST_FRAME 1
#if CONFIG_EXT_REFS
#define LAST2_FRAME 2 #define LAST2_FRAME 2
#define LAST3_FRAME 3 #define LAST3_FRAME 3
#define GOLDEN_FRAME 4 #define GOLDEN_FRAME 4
...@@ -694,23 +687,14 @@ typedef uint8_t TXFM_CONTEXT; ...@@ -694,23 +687,14 @@ typedef uint8_t TXFM_CONTEXT;
#define ALTREF2_FRAME 6 #define ALTREF2_FRAME 6
#define ALTREF_FRAME 7 #define ALTREF_FRAME 7
#define LAST_REF_FRAMES (LAST3_FRAME - LAST_FRAME + 1) #define LAST_REF_FRAMES (LAST3_FRAME - LAST_FRAME + 1)
#else // !CONFIG_EXT_REFS
#define GOLDEN_FRAME 2
#define ALTREF_FRAME 3
#endif // CONFIG_EXT_REFS
#define INTER_REFS_PER_FRAME (ALTREF_FRAME - LAST_FRAME + 1) #define INTER_REFS_PER_FRAME (ALTREF_FRAME - LAST_FRAME + 1)
#define TOTAL_REFS_PER_FRAME (ALTREF_FRAME - INTRA_FRAME + 1) #define TOTAL_REFS_PER_FRAME (ALTREF_FRAME - INTRA_FRAME + 1)
#define FWD_REFS (GOLDEN_FRAME - LAST_FRAME + 1) #define FWD_REFS (GOLDEN_FRAME - LAST_FRAME + 1)
#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME) #define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
#if CONFIG_EXT_REFS
#define BWD_REFS (ALTREF_FRAME - BWDREF_FRAME + 1) #define BWD_REFS (ALTREF_FRAME - BWDREF_FRAME + 1)
#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME) #define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
#else
#define BWD_REFS 1
#define BWD_RF_OFFSET(ref) (ref - ALTREF_FRAME)
#endif // CONFIG_EXT_REFS
#define SINGLE_REFS (FWD_REFS + BWD_REFS) #define SINGLE_REFS (FWD_REFS + BWD_REFS)
#if CONFIG_EXT_COMP_REFS #if CONFIG_EXT_COMP_REFS
......
...@@ -1534,12 +1534,10 @@ void av1_setup_frame_buf_refs(AV1_COMMON *cm) { ...@@ -1534,12 +1534,10 @@ void av1_setup_frame_buf_refs(AV1_COMMON *cm) {
int lst_buf_idx = cm->frame_refs[LAST_FRAME - LAST_FRAME].idx; int lst_buf_idx = cm->frame_refs[LAST_FRAME - LAST_FRAME].idx;
int gld_buf_idx = cm->frame_refs[GOLDEN_FRAME - LAST_FRAME].idx; int gld_buf_idx = cm->frame_refs[GOLDEN_FRAME - LAST_FRAME].idx;
#if CONFIG_EXT_REFS
int lst2_buf_idx = cm->frame_refs[LAST2_FRAME - LAST_FRAME].idx; int lst2_buf_idx = cm->frame_refs[LAST2_FRAME - LAST_FRAME].idx;
int lst3_buf_idx = cm->frame_refs[LAST3_FRAME - LAST_FRAME].idx; int lst3_buf_idx = cm->frame_refs[LAST3_FRAME - LAST_FRAME].idx;
int bwd_buf_idx = cm->frame_refs[BWDREF_FRAME - LAST_FRAME].idx; int bwd_buf_idx = cm->frame_refs[BWDREF_FRAME - LAST_FRAME].idx;
int alt2_buf_idx = cm->frame_refs[ALTREF2_FRAME - LAST_FRAME].idx; int alt2_buf_idx = cm->frame_refs[ALTREF2_FRAME - LAST_FRAME].idx;
#endif
if (alt_buf_idx >= 0) if (alt_buf_idx >= 0)
cm->cur_frame->alt_frame_offset = cm->cur_frame->alt_frame_offset =
...@@ -1553,7 +1551,6 @@ void av1_setup_frame_buf_refs(AV1_COMMON *cm) { ...@@ -1553,7 +1551,6 @@ void av1_setup_frame_buf_refs(AV1_COMMON *cm) {
cm->cur_frame->gld_frame_offset = cm->cur_frame->gld_frame_offset =
cm->buffer_pool->frame_bufs[gld_buf_idx].cur_frame_offset; cm->buffer_pool->frame_bufs[gld_buf_idx].cur_frame_offset;
#if CONFIG_EXT_REFS
if (lst2_buf_idx >= 0) if (lst2_buf_idx >= 0)
cm->cur_frame->lst2_frame_offset = cm->cur_frame->lst2_frame_offset =
cm->buffer_pool->frame_bufs[lst2_buf_idx].cur_frame_offset; cm->buffer_pool->frame_bufs[lst2_buf_idx].cur_frame_offset;
...@@ -1569,7 +1566,6 @@ void av1_setup_frame_buf_refs(AV1_COMMON *cm) { ...@@ -1569,7 +1566,6 @@ void av1_setup_frame_buf_refs(AV1_COMMON *cm) {
if (alt2_buf_idx >= 0) if (alt2_buf_idx >= 0)
cm->cur_frame->alt2_frame_offset = cm->cur_frame->alt2_frame_offset =
cm->buffer_pool->frame_bufs[alt2_buf_idx].cur_frame_offset; cm->buffer_pool->frame_bufs[alt2_buf_idx].cur_frame_offset;
#endif
} }
#if CONFIG_FRAME_SIGN_BIAS #if CONFIG_FRAME_SIGN_BIAS
...@@ -1643,10 +1639,8 @@ static uint32_t mv_sign_reverse(int_mv ref) { ...@@ -1643,10 +1639,8 @@ static uint32_t mv_sign_reverse(int_mv ref) {
void av1_setup_motion_field(AV1_COMMON *cm) { void av1_setup_motion_field(AV1_COMMON *cm) {
int cur_frame_index = cm->cur_frame->cur_frame_offset; int cur_frame_index = cm->cur_frame->cur_frame_offset;
int lst_frame_index = 0, alt_frame_index = 0, gld_frame_index = 0; int lst_frame_index = 0, alt_frame_index = 0, gld_frame_index = 0;
#if CONFIG_EXT_REFS
int lst2_frame_index = 0, lst3_frame_index = 0; int lst2_frame_index = 0, lst3_frame_index = 0;
int bwd_frame_index = 0, alt2_frame_index = 0; int bwd_frame_index = 0, alt2_frame_index = 0;
#endif
TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs; TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
for (int ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) { for (int ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
...@@ -1660,12 +1654,10 @@ void av1_setup_motion_field(AV1_COMMON *cm) { ...@@ -1660,12 +1654,10 @@ void av1_setup_motion_field(AV1_COMMON *cm) {
int alt_buf_idx = cm->frame_refs[ALTREF_FRAME - LAST_FRAME].idx; int alt_buf_idx = cm->frame_refs[ALTREF_FRAME - LAST_FRAME].idx;
int lst_buf_idx = cm->frame_refs[LAST_FRAME - LAST_FRAME].idx; int lst_buf_idx = cm->frame_refs[LAST_FRAME - LAST_FRAME].idx;
int gld_buf_idx = cm->frame_refs[GOLDEN_FRAME - LAST_FRAME].idx; int gld_buf_idx = cm->frame_refs[GOLDEN_FRAME - LAST_FRAME].idx;
#if CONFIG_EXT_REFS
int lst2_buf_idx = cm->frame_refs[LAST2_FRAME - LAST_FRAME].idx; int lst2_buf_idx = cm->frame_refs[LAST2_FRAME - LAST_FRAME].idx;
int lst3_buf_idx = cm->frame_refs[LAST3_FRAME - LAST_FRAME].idx; int lst3_buf_idx = cm->frame_refs[LAST3_FRAME - LAST_FRAME].idx;
int bwd_buf_idx = cm->frame_refs[BWDREF_FRAME - LAST_FRAME].idx; int bwd_buf_idx = cm->frame_refs[BWDREF_FRAME - LAST_FRAME].idx;
int alt2_buf_idx = cm->frame_refs[ALTREF2_FRAME - LAST_FRAME].idx; int alt2_buf_idx = cm->frame_refs[ALTREF2_FRAME - LAST_FRAME].idx;
#endif
if (alt_buf_idx >= 0) if (alt_buf_idx >= 0)
alt_frame_index = cm->buffer_pool->frame_bufs[alt_buf_idx].cur_frame_offset; alt_frame_index = cm->buffer_pool->frame_bufs[alt_buf_idx].cur_frame_offset;
...@@ -1676,7 +1668,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) { ...@@ -1676,7 +1668,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) {
if (gld_buf_idx >= 0) if (gld_buf_idx >= 0)
gld_frame_index = cm->buffer_pool->frame_bufs[gld_buf_idx].cur_frame_offset; gld_frame_index = cm->buffer_pool->frame_bufs[gld_buf_idx].cur_frame_offset;
#if CONFIG_EXT_REFS
if (lst2_buf_idx >= 0) if (lst2_buf_idx >= 0)
lst2_frame_index = lst2_frame_index =
cm->buffer_pool->frame_bufs[lst2_buf_idx].cur_frame_offset; cm->buffer_pool->frame_bufs[lst2_buf_idx].cur_frame_offset;
...@@ -1691,7 +1682,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) { ...@@ -1691,7 +1682,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) {
if (alt2_buf_idx >= 0) if (alt2_buf_idx >= 0)
alt2_frame_index = alt2_frame_index =
cm->buffer_pool->frame_bufs[alt2_buf_idx].cur_frame_offset; cm->buffer_pool->frame_bufs[alt2_buf_idx].cur_frame_offset;
#endif
if (alt_frame_index < cur_frame_index) return; if (alt_frame_index < cur_frame_index) return;
...@@ -1706,7 +1696,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) { ...@@ -1706,7 +1696,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) {
cm->buffer_pool->frame_bufs[lst_buf_idx].alt_frame_offset; cm->buffer_pool->frame_bufs[lst_buf_idx].alt_frame_offset;
const int gld_frame_idx = const int gld_frame_idx =
cm->buffer_pool->frame_bufs[lst_buf_idx].gld_frame_offset; cm->buffer_pool->frame_bufs[lst_buf_idx].gld_frame_offset;
#if CONFIG_EXT_REFS
const int lst2_frame_idx = const int lst2_frame_idx =
cm->buffer_pool->frame_bufs[lst_buf_idx].lst2_frame_offset; cm->buffer_pool->frame_bufs[lst_buf_idx].lst2_frame_offset;
const int lst3_frame_idx = const int lst3_frame_idx =
...@@ -1715,7 +1704,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) { ...@@ -1715,7 +1704,6 @@ void av1_setup_motion_field(AV1_COMMON *cm) {
cm->buffer_pool->frame_bufs[lst_buf_idx].bwd_frame_offset; cm->buffer_pool->frame_bufs[lst_buf_idx].bwd_frame_offset;
const int alt2_frame_idx = const int alt2_frame_idx =
cm->buffer_pool->frame_bufs[lst_buf_idx].alt2_frame_offset; cm->buffer_pool->frame_bufs[lst_buf_idx].alt2_frame_offset;
#endif