Remove CONFIG_NEW_REF_SIGNALING and cleanups
Remove CONFIG_NEW_REF_SIGNALING compiler flag and some cleanups, such as removing encoder/rdopt_data_defs.h
diff --git a/aom/aom_encoder.h b/aom/aom_encoder.h
index f2e3802..efb0267 100644
--- a/aom/aom_encoder.h
+++ b/aom/aom_encoder.h
@@ -526,12 +526,10 @@
*
*/
unsigned int enable_reduced_reference_set;
-#if CONFIG_NEW_REF_SIGNALING
/*!\brief explicitly signal reference frame mapping
*
*/
unsigned int explicit_ref_frame_map;
-#endif // CONFIG_NEW_REF_SIGNALING
/*!\brief use reduced transform type set
*
*/
diff --git a/aom/aomcx.h b/aom/aomcx.h
index de25f40..df789d1 100644
--- a/aom/aomcx.h
+++ b/aom/aomcx.h
@@ -101,35 +101,12 @@
*/
#define AOM_EFLAG_NO_REF_ARF2 (1 << 22)
-#if CONFIG_NEW_REF_SIGNALING
/*!\brief Don't update reference frames
*
* When this flag is set, the encoder will not update all the ref frames with
* the contents of the current frame.
*/
#define AOM_EFLAG_NO_UPD_ALL (1 << 23)
-#else
-/*!\brief Don't update the last frame
- *
- * When this flag is set, the encoder will not update the last frame with
- * the contents of the current frame.
- */
-#define AOM_EFLAG_NO_UPD_LAST (1 << 23)
-
-/*!\brief Don't update the golden frame
- *
- * When this flag is set, the encoder will not update the golden frame with
- * the contents of the current frame.
- */
-#define AOM_EFLAG_NO_UPD_GF (1 << 24)
-
-/*!\brief Don't update the alternate reference frame
- *
- * When this flag is set, the encoder will not update the alt ref frame with
- * the contents of the current frame.
- */
-#define AOM_EFLAG_NO_UPD_ARF (1 << 25)
-#endif // CONFIG_NEW_REF_SIGNALING
/*!\brief Disable entropy update
*
diff --git a/apps/aomenc.c b/apps/aomenc.c
index ebfdc3d..1ec3c2b 100644
--- a/apps/aomenc.c
+++ b/apps/aomenc.c
@@ -458,9 +458,7 @@
#if CONFIG_IBP_DC || CONFIG_IBP_DIR
&g_av1_codec_arg_defs.enable_ibp,
#endif
-#if CONFIG_NEW_REF_SIGNALING
&g_av1_codec_arg_defs.explicit_ref_frame_map,
-#endif // CONFIG_NEW_REF_SIGNALING
&g_av1_codec_arg_defs.max_drl_refmvs,
#if CONFIG_REF_MV_BANK
&g_av1_codec_arg_defs.enable_refmvbank,
@@ -718,9 +716,7 @@
#if CONFIG_OPTFLOW_REFINEMENT
config->enable_opfl_refine = 1;
#endif // CONFIG_OPTFLOW_REFINEMENT
-#if CONFIG_NEW_REF_SIGNALING
config->explicit_ref_frame_map = 0;
-#endif // CONFIG_NEW_REF_SIGNALING
config->enable_intra_edge_filter = 1;
config->enable_tx64 = 1;
config->enable_smooth_interintra = 1;
diff --git a/av1/arg_defs.c b/av1/arg_defs.c
index 44e55ed..c7f0d6e 100644
--- a/av1/arg_defs.c
+++ b/av1/arg_defs.c
@@ -675,12 +675,10 @@
ARG_DEF(NULL, "reduced-reference-set", 1,
"Use reduced set of single and compound references (0: off "
"(default), 1: on)"),
-#if CONFIG_NEW_REF_SIGNALING
.explicit_ref_frame_map =
ARG_DEF(NULL, "explicit-ref-frame-map", 1,
"Explicitly signal the reference frame mapping (0: off "
"(default), 1: on)"),
-#endif // CONFIG_NEW_REF_SIGNALING
.target_seq_level_idx = ARG_DEF(
NULL, "target-seq-level-idx", 1,
"Target sequence level index. "
diff --git a/av1/arg_defs.h b/av1/arg_defs.h
index feb1774..4afdfd6 100644
--- a/av1/arg_defs.h
+++ b/av1/arg_defs.h
@@ -266,9 +266,7 @@
arg_def_t gf_max_pyr_height;
arg_def_t max_reference_frames;
arg_def_t reduced_reference_set;
-#if CONFIG_NEW_REF_SIGNALING
arg_def_t explicit_ref_frame_map;
-#endif // CONFIG_NEW_REF_SIGNALING
arg_def_t target_seq_level_idx;
arg_def_t set_min_cr;
arg_def_t input_color_primaries;
diff --git a/av1/av1.cmake b/av1/av1.cmake
index 8a3a2cd..87796e5 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -251,7 +251,6 @@
"${AOM_ROOT}/av1/encoder/rd.h"
"${AOM_ROOT}/av1/encoder/rdopt.c"
"${AOM_ROOT}/av1/encoder/rdopt.h"
- "${AOM_ROOT}/av1/encoder/rdopt_data_defs.h"
"${AOM_ROOT}/av1/encoder/rdopt_utils.h"
"${AOM_ROOT}/av1/encoder/reconinter_enc.c"
"${AOM_ROOT}/av1/encoder/reconinter_enc.h"
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index caf4f12..cd6aa58 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -175,9 +175,7 @@
int enable_flip_idtx; // enable flip and identity transform types
int max_reference_frames; // maximum number of references per frame
int enable_reduced_reference_set; // enable reduced set of references
-#if CONFIG_NEW_REF_SIGNALING
int explicit_ref_frame_map; // explicitly signal reference frame mapping
-#endif // CONFIG_NEW_REF_SIGNALING
int enable_ref_frame_mvs; // sequence level
int allow_ref_frame_mvs; // frame level
int enable_masked_comp; // enable masked compound for sequence
@@ -513,20 +511,18 @@
7, // max_reference_frames
0, // enable_reduced_reference_set
-#if CONFIG_NEW_REF_SIGNALING
- 0, // explicit_ref_frame_map
-#endif // CONFIG_NEW_REF_SIGNALING
- 1, // enable_ref_frame_mvs sequence level
- 1, // allow ref_frame_mvs frame level
- 1, // enable masked compound at sequence level
- 1, // enable one sided compound at sequence level
- 1, // enable interintra compound at sequence level
- 1, // enable smooth interintra mode
- 1, // enable difference-weighted compound
- 1, // enable interinter wedge compound
- 1, // enable interintra wedge compound
- 1, // enable_global_motion usage
- 1, // enable_warped_motion at sequence level
+ 0, // explicit_ref_frame_map
+ 1, // enable_ref_frame_mvs sequence level
+ 1, // allow ref_frame_mvs frame level
+ 1, // enable masked compound at sequence level
+ 1, // enable one sided compound at sequence level
+ 1, // enable interintra compound at sequence level
+ 1, // enable smooth interintra mode
+ 1, // enable difference-weighted compound
+ 1, // enable interinter wedge compound
+ 1, // enable interintra wedge compound
+ 1, // enable_global_motion usage
+ 1, // enable_warped_motion at sequence level
#if CONFIG_EXTENDED_WARP_PREDICTION
1, // enable_warped_causal at sequence level
1, // enable_warp_delta at sequence level
@@ -843,9 +839,7 @@
RANGE_CHECK(extra_cfg, max_reference_frames, 3, 7);
RANGE_CHECK(extra_cfg, enable_reduced_reference_set, 0, 1);
-#if CONFIG_NEW_REF_SIGNALING
RANGE_CHECK(extra_cfg, explicit_ref_frame_map, 0, 1);
-#endif // CONFIG_NEW_REF_SIGNALING
RANGE_CHECK_HI(extra_cfg, chroma_subsampling_x, 1);
RANGE_CHECK_HI(extra_cfg, chroma_subsampling_y, 1);
@@ -1039,9 +1033,7 @@
(extra_cfg->allow_ref_frame_mvs || extra_cfg->enable_ref_frame_mvs);
cfg->enable_onesided_comp = extra_cfg->enable_onesided_comp;
cfg->enable_reduced_reference_set = extra_cfg->enable_reduced_reference_set;
-#if CONFIG_NEW_REF_SIGNALING
cfg->explicit_ref_frame_map = extra_cfg->explicit_ref_frame_map;
-#endif // CONFIG_NEW_REF_SIGNALING
cfg->reduced_tx_type_set = extra_cfg->reduced_tx_type_set;
cfg->max_drl_refmvs = extra_cfg->max_drl_refmvs;
#if CONFIG_REF_MV_BANK
@@ -1160,9 +1152,7 @@
extra_cfg->enable_ref_frame_mvs = cfg->enable_ref_frame_mvs;
extra_cfg->enable_onesided_comp = cfg->enable_onesided_comp;
extra_cfg->enable_reduced_reference_set = cfg->enable_reduced_reference_set;
-#if CONFIG_NEW_REF_SIGNALING
extra_cfg->explicit_ref_frame_map = cfg->explicit_ref_frame_map;
-#endif // CONFIG_NEW_REF_SIGNALING
extra_cfg->reduced_tx_type_set = cfg->reduced_tx_type_set;
extra_cfg->max_drl_refmvs = cfg->max_drl_refmvs;
#if CONFIG_REF_MV_BANK
@@ -1621,9 +1611,7 @@
oxcf->ref_frm_cfg.enable_reduced_reference_set =
extra_cfg->enable_reduced_reference_set;
oxcf->ref_frm_cfg.enable_onesided_comp = extra_cfg->enable_onesided_comp;
-#if CONFIG_NEW_REF_SIGNALING
oxcf->ref_frm_cfg.explicit_ref_frame_map = extra_cfg->explicit_ref_frame_map;
-#endif // CONFIG_NEW_REF_SIGNALING
oxcf->row_mt = extra_cfg->row_mt;
@@ -2895,13 +2883,8 @@
if (!cm->show_existing_frame) {
// Get reference frame information
int ref_poc[INTER_REFS_PER_FRAME];
-#if CONFIG_NEW_REF_SIGNALING
for (int ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
const int ref_idx = ref_frame;
-#else
- for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- const int ref_idx = ref_frame - LAST_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
ref_poc[ref_idx] = buf ? (int)buf->absolute_poc : -1;
ref_poc[ref_idx] = (ref_poc[ref_idx] == (int)cm->cur_frame->absolute_poc)
@@ -3926,12 +3909,10 @@
argv, err_string)) {
extra_cfg.enable_reduced_reference_set =
arg_parse_int_helper(&arg, err_string);
-#if CONFIG_NEW_REF_SIGNALING
} else if (arg_match_helper(&arg,
&g_av1_codec_arg_defs.explicit_ref_frame_map,
argv, err_string)) {
extra_cfg.explicit_ref_frame_map = arg_parse_int_helper(&arg, err_string);
-#endif // CONFIG_NEW_REF_SIGNALING
} else if (arg_match_helper(&arg, &g_av1_codec_arg_defs.enable_ref_frame_mvs,
argv, err_string)) {
extra_cfg.enable_ref_frame_mvs = arg_parse_int_helper(&arg, err_string);
@@ -4399,11 +4380,7 @@
#if CONFIG_OPTFLOW_REFINEMENT
1,
#endif // CONFIG_OPTFLOW_REFINEMENT
- 1, 1, 1, 1, 1, 1, 3, 1, 1,
-#if CONFIG_NEW_REF_SIGNALING
- 0,
-#endif // CONFIG_NEW_REF_SIGNALING
- 0, 0,
+ 1, 1, 1, 1, 1, 1, 3, 1, 1, 0, 0, 0,
#if CONFIG_REF_MV_BANK
1,
#endif // CONFIG_REF_MV_BANK
diff --git a/av1/common/av1_common_int.h b/av1/common/av1_common_int.h
index 2f21118..cc8236a 100644
--- a/av1/common/av1_common_int.h
+++ b/av1/common/av1_common_int.h
@@ -95,7 +95,6 @@
#define TXCOEFF_TIMER 0
#define TXCOEFF_COST_TIMER 0
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
// Some arrays (e.g. x->pred_sse and yv12_mb) are defined such that their
// indices 0-8 correspond to inter ref0, ref1,... ref6, intra ref, and TIP ref.
@@ -118,19 +117,6 @@
// corresponds to an unused slot allocated for convenience.
#define COMPACT_INDEX1_NRS(r) \
(!is_inter_ref_frame((r)) ? INTRA_FRAME_INDEX : (r))
-#else
-#if CONFIG_TIP
-// Some arrays (e.g. x->pred_sse and yv12_mb) are defined such that their
-// indices 0-8 correspond to intra ref, inter ref0, ref1,... ref6, and TIP ref.
-// This macros maps the ref_frame indices to corresponding array indices, where
-// tip ref_frame index, TIP_FRAME (REF_FRAMES + TOTAL_COMP_REFS) is
-// mapped to TIP_FRAME_INDEX (8)
-#define COMPACT_INDEX0_NRS(r) (((r) == TIP_FRAME) ? TIP_FRAME_INDEX : (r))
-// This macro is similar to the previous one, but also maps NONE_FRAME to 0,
-// which typically corresponds to an unused slot allocated for convenience.
-#define COMPACT_INDEX1_NRS(r) (((r) == NONE_FRAME) ? 0 : (r))
-#endif // CONFIG_TIP
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP || CONFIG_PEF
// MI unit is 4x4, TMVP unit is 8x8, so there is 1 shift
@@ -261,13 +247,8 @@
int ref_count;
unsigned int order_hint;
-#if CONFIG_NEW_REF_SIGNALING
int ref_order_hints[INTER_REFS_PER_FRAME];
int ref_display_order_hint[INTER_REFS_PER_FRAME];
-#else
- unsigned int ref_order_hints[INTER_REFS_PER_FRAME];
- unsigned int ref_display_order_hint[INTER_REFS_PER_FRAME];
-#endif // CONFIG_NEW_REF_SIGNALING
// These variables are used only in encoder and compare the absolute
// display order hint to compute the relative distance and overcome
@@ -287,11 +268,7 @@
// the sizes that can be derived from the buf structure)
int width;
int height;
-#if CONFIG_NEW_REF_SIGNALING
WarpedMotionParams global_motion[INTER_REFS_PER_FRAME];
-#else
- WarpedMotionParams global_motion[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
int showable_frame; // frame can be used as show existing frame in future
uint8_t film_grain_params_present;
aom_film_grain_t film_grain_params;
@@ -310,9 +287,7 @@
int8_t mode_deltas[MAX_MODE_LF_DELTAS];
FRAME_CONTEXT frame_context;
-#if CONFIG_NEW_REF_SIGNALING
int base_qindex;
-#endif // CONFIG_NEW_REF_SIGNALING
FrameHash raw_frame_hash;
FrameHash grain_frame_hash;
@@ -433,17 +408,15 @@
uint8_t frame_id_numbers_present_flag;
int frame_id_length;
int delta_frame_id_length;
- BLOCK_SIZE sb_size; // Size of the superblock used for this frame
- int mib_size; // Size of the superblock in units of MI blocks
- int mib_size_log2; // Log 2 of above.
-#if CONFIG_NEW_REF_SIGNALING
+ BLOCK_SIZE sb_size; // Size of the superblock used for this frame
+ int mib_size; // Size of the superblock in units of MI blocks
+ int mib_size_log2; // Log 2 of above.
int explicit_ref_frame_map; // Explicitly signal the reference frame mapping
int max_reference_frames; // Number of reference frames allowed
#if CONFIG_ALLOW_SAME_REF_COMPOUND
int num_same_ref_compound; // Number of the allowed same reference frames for
// the compound mode
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#endif
OrderHintInfo order_hint_info;
@@ -599,9 +572,6 @@
unsigned int frame_number;
SkipModeInfo skip_mode_info;
int refresh_frame_flags; // Which ref frames are overwritten by this frame
-#if !CONFIG_NEW_REF_SIGNALING
- int frame_refs_short_signaling;
-#endif // !CONFIG_NEW_REF_SIGNALING
} CurrentFrame;
/*!\endcond */
@@ -1207,7 +1177,6 @@
};
#endif // CONFIG_THROUGHPUT_ANALYSIS
-#if CONFIG_NEW_REF_SIGNALING
/*!
* \brief Structure to contain information about the reference frame mapping
* scheme.
@@ -1257,7 +1226,6 @@
int num_same_ref_compound;
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
} RefFramesInfo;
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
/*!
@@ -1440,7 +1408,6 @@
*/
RefCntBuffer *cur_frame;
-#if CONFIG_NEW_REF_SIGNALING
/*!
* An alternative to remapped_ref_idx (above) which contains a mapping to
* ref_frame_map[] according to a "usefulness" score. It also contains all
@@ -1468,29 +1435,6 @@
* have a remapped index for the same.
*/
int remapped_ref_idx[REF_FRAMES];
-#else
- /*!
- * For encoder, we have a two-level mapping from reference frame type to the
- * corresponding buffer in the buffer pool:
- * * 'remapped_ref_idx[i - 1]' maps reference type 'i' (range: LAST_FRAME ...
- * EXTREF_FRAME) to a remapped index 'j' (in range: 0 ... REF_FRAMES - 1)
- * * Later, 'cm->ref_frame_map[j]' maps the remapped index 'j' to a pointer to
- * the reference counted buffer structure RefCntBuffer, taken from the buffer
- * pool cm->buffer_pool->frame_bufs.
- *
- * LAST_FRAME, ..., EXTREF_FRAME
- * | |
- * v v
- * remapped_ref_idx[LAST_FRAME - 1], ..., remapped_ref_idx[EXTREF_FRAME - 1]
- * | |
- * v v
- * ref_frame_map[], ..., ref_frame_map[]
- *
- * Note: INTRA_FRAME always refers to the current frame, so there's no need to
- * have a remapped index for the same.
- */
- int remapped_ref_idx[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* Scale of the current frame with respect to itself.
@@ -1628,11 +1572,7 @@
/*!
* Global motion parameters for each reference frame.
*/
-#if CONFIG_NEW_REF_SIGNALING
WarpedMotionParams global_motion[INTER_REFS_PER_FRAME];
-#else
- WarpedMotionParams global_motion[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* Elements part of the sequence header, that are applicable for all the
@@ -1693,21 +1633,13 @@
* ref_frame_sign_bias[k] is 1 if relative distance between reference 'k' and
* current frame is positive; and 0 otherwise.
*/
-#if CONFIG_NEW_REF_SIGNALING
int ref_frame_sign_bias[INTER_REFS_PER_FRAME];
-#else
- int ref_frame_sign_bias[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* ref_frame_side[k] is 1 if relative distance between reference 'k' and
* current frame is positive, -1 if relative distance is 0; and 0 otherwise.
* TODO(jingning): This can be combined with sign_bias later.
*/
-#if CONFIG_NEW_REF_SIGNALING
int8_t ref_frame_side[INTER_REFS_PER_FRAME];
-#else
- int8_t ref_frame_side[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
/*!
* relative distance between reference 'k' and current frame.
@@ -1929,24 +1861,12 @@
return cm->current_frame.frame_type == S_FRAME;
}
-#if CONFIG_NEW_REF_SIGNALING
static INLINE int get_ref_frame_map_idx(const AV1_COMMON *const cm,
const int ref_frame) {
return (ref_frame >= 0 && ref_frame < REF_FRAMES)
? cm->remapped_ref_idx[ref_frame]
: INVALID_IDX;
}
-#else
-// This function takes a reference frame label between LAST_FRAME and
-// EXTREF_FRAME inclusive. Note that this is different to the indexing
-// previously used by the frame_refs[] array.
-static INLINE int get_ref_frame_map_idx(const AV1_COMMON *const cm,
- const MV_REFERENCE_FRAME ref_frame) {
- return (ref_frame >= LAST_FRAME && ref_frame <= EXTREF_FRAME)
- ? cm->remapped_ref_idx[ref_frame - LAST_FRAME]
- : INVALID_IDX;
-}
-#endif // CONFIG_NEW_REF_SIGNALING
static INLINE RefCntBuffer *get_ref_frame_buf(
const AV1_COMMON *const cm, const MV_REFERENCE_FRAME ref_frame) {
@@ -1992,11 +1912,7 @@
return cm->tip_ref.tip_frame;
}
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
const int map_idx = get_ref_frame_map_idx(cm, primary_ref_frame);
-#else
- const int map_idx = get_ref_frame_map_idx(cm, primary_ref_frame + 1);
-#endif // CONFIG_NEW_REF_SIGNALING
return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : NULL;
}
diff --git a/av1/common/av1_loopfilter.c b/av1/common/av1_loopfilter.c
index a0deb78..9ada1e6 100644
--- a/av1/common/av1_loopfilter.c
+++ b/av1/common/av1_loopfilter.c
@@ -150,26 +150,16 @@
int plane, const MB_MODE_INFO *mbmi) {
const int segment_id = mbmi->segment_id;
-// TODO(Andrey): non-CTC conditions
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
+ // TODO(Andrey): non-CTC conditions
return lfi_n->q_thr[plane][segment_id][dir_idx][COMPACT_INDEX0_NRS(
mbmi->ref_frame[0])][mode_lf_lut[mbmi->mode]];
-#else
- return lfi_n->q_thr[plane][segment_id][dir_idx][mbmi->ref_frame[0]]
- [mode_lf_lut[mbmi->mode]];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
uint16_t av1_get_filter_side(const loop_filter_info_n *lfi_n, const int dir_idx,
int plane, const MB_MODE_INFO *mbmi) {
const int segment_id = mbmi->segment_id;
-// TODO(Andrey): non-CTC conditions
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
+ // TODO(Andrey): non-CTC conditions
return lfi_n->side_thr[plane][segment_id][dir_idx][COMPACT_INDEX0_NRS(
mbmi->ref_frame[0])][mode_lf_lut[mbmi->mode]];
-#else
- return lfi_n->side_thr[plane][segment_id][dir_idx][mbmi->ref_frame[0]]
- [mode_lf_lut[mbmi->mode]];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
#else
@@ -202,27 +192,16 @@
if (cm->lf.mode_ref_delta_enabled) {
const int scale = 1 << (lvl_seg >> 5);
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
lvl_seg +=
cm->lf.ref_deltas[COMPACT_INDEX0_NRS(mbmi->ref_frame[0])] * scale;
if (is_inter_ref_frame(mbmi->ref_frame[0]))
lvl_seg += cm->lf.mode_deltas[mode_lf_lut[mbmi->mode]] * scale;
-#else
- lvl_seg += cm->lf.ref_deltas[mbmi->ref_frame[0]] * scale;
- if (is_inter_ref_frame(mbmi->ref_frame[0]))
- lvl_seg += cm->lf.mode_deltas[mode_lf_lut[mbmi->mode]] * scale;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
lvl_seg = clamp(lvl_seg, 0, MAX_LOOP_FILTER);
}
return lvl_seg;
} else {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
return lfi_n->lvl[plane][segment_id][dir_idx][COMPACT_INDEX0_NRS(
mbmi->ref_frame[0])][mode_lf_lut[mbmi->mode]];
-#else
- return lfi_n->lvl[plane][segment_id][dir_idx][mbmi->ref_frame[0]]
- [mode_lf_lut[mbmi->mode]];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
}
#endif // CONFIG_NEW_DF
@@ -373,18 +352,11 @@
// zero when not in use; encoder always uses deltas
#if CONFIG_NEW_DF
int ref, mode;
-#if CONFIG_NEW_REF_SIGNALING
lfi->q_thr[plane][seg_id][dir][INTRA_FRAME_INDEX][0] = q_thr_seg;
lfi->side_thr[plane][seg_id][dir][INTRA_FRAME_INDEX][0] =
side_thr_seg;
for (ref = 0; ref < INTER_REFS_PER_FRAME; ++ref) {
-#else
- lfi->q_thr[plane][seg_id][dir][INTRA_FRAME][0] = q_thr_seg;
- lfi->side_thr[plane][seg_id][dir][INTRA_FRAME][0] = side_thr_seg;
-
- for (ref = LAST_FRAME; ref < REF_FRAMES; ++ref) {
-#endif // CONFIG_NEW_REF_SIGNALING
for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
lfi->q_thr[plane][seg_id][dir][ref][mode] = q_thr_seg;
lfi->side_thr[plane][seg_id][dir][ref][mode] = side_thr_seg;
@@ -407,7 +379,6 @@
// zero when not in use; encoder always uses deltas
const int scale = 4;
int ref, mode;
-#if CONFIG_NEW_REF_SIGNALING
lfi->q_thr[plane][seg_id][dir][INTRA_FRAME_INDEX][0] =
df_quant_from_qindex(
q_ind_seg + lf->ref_deltas[INTRA_FRAME_INDEX] * scale,
@@ -418,17 +389,6 @@
cm->seq_params.bit_depth); // TODO: use a different delta?
for (ref = 0; ref < INTER_REFS_PER_FRAME; ++ref) {
-#else
- lfi->q_thr[plane][seg_id][dir][INTRA_FRAME][0] = df_quant_from_qindex(
- q_ind_seg + lf->ref_deltas[INTRA_FRAME] * scale,
- cm->seq_params.bit_depth);
- lfi->side_thr[plane][seg_id][dir][INTRA_FRAME][0] =
- df_side_from_qindex(
- side_ind_seg + lf->ref_deltas[INTRA_FRAME] * scale,
- cm->seq_params.bit_depth); // TODO: use a different delta?
-
- for (ref = LAST_FRAME; ref < REF_FRAMES; ++ref) {
-#endif // CONFIG_NEW_REF_SIGNALING
for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
lfi->q_thr[plane][seg_id][dir][ref][mode] =
df_quant_from_qindex(q_ind_seg + lf->ref_deltas[ref] * scale +
@@ -458,18 +418,11 @@
#else
int ref, mode;
const int scale = 1 << (lvl_seg >> 5);
-#if CONFIG_NEW_REF_SIGNALING
const int intra_lvl =
lvl_seg + lf->ref_deltas[INTRA_FRAME_INDEX] * scale;
lfi->lvl[plane][seg_id][dir][INTRA_FRAME_INDEX][0] =
clamp(intra_lvl, 0, MAX_LOOP_FILTER);
for (ref = 0; ref < INTER_REFS_PER_FRAME; ++ref) {
-#else
- const int intra_lvl = lvl_seg + lf->ref_deltas[INTRA_FRAME] * scale;
- lfi->lvl[plane][seg_id][dir][INTRA_FRAME][0] =
- clamp(intra_lvl, 0, MAX_LOOP_FILTER);
- for (ref = LAST_FRAME; ref < REF_FRAMES; ++ref) {
-#endif // CONFIG_NEW_REF_SIGNALING
for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
const int inter_lvl = lvl_seg + lf->ref_deltas[ref] * scale +
lf->mode_deltas[mode] * scale;
@@ -547,18 +500,11 @@
} else {
int ref, mode;
const int scale = 1 << (lvl_seg >> 5);
-#if CONFIG_NEW_REF_SIGNALING
const int intra_lvl =
lvl_seg + lf->ref_deltas[INTRA_FRAME_INDEX] * scale;
lfi->lvl[plane][seg_id][dir][INTRA_FRAME_INDEX][0] =
clamp(intra_lvl, 0, MAX_LOOP_FILTER);
for (ref = 0; ref < INTER_REFS_PER_FRAME; ++ref) {
-#else
- const int intra_lvl = lvl_seg + lf->ref_deltas[INTRA_FRAME] * scale;
- lfi->lvl[plane][seg_id][dir][INTRA_FRAME][0] =
- clamp(intra_lvl, 0, MAX_LOOP_FILTER);
- for (ref = LAST_FRAME; ref < REF_FRAMES; ++ref) {
-#endif // CONFIG_NEW_REF_SIGNALING
for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
const int inter_lvl = lvl_seg + lf->ref_deltas[ref] * scale +
lf->mode_deltas[mode] * scale;
diff --git a/av1/common/av1_loopfilter.h b/av1/common/av1_loopfilter.h
index 898ad0e..094bbb4 100644
--- a/av1/common/av1_loopfilter.h
+++ b/av1/common/av1_loopfilter.h
@@ -128,11 +128,7 @@
uint8_t mode_ref_delta_enabled;
uint8_t mode_ref_delta_update;
-#if CONFIG_NEW_REF_SIGNALING
// The order is based on the ranked references.
-#else
- // 0 = Intra, Last, Last2+Last3, GF, BRF, ARF2, ARF
-#endif // CONFIG_NEW_REF_SIGNALING
int8_t ref_deltas[SINGLE_REF_FRAMES];
// 0 = ZERO_MV, MV
diff --git a/av1/common/blockd.h b/av1/common/blockd.h
index 7fa62ce..ba3925f 100644
--- a/av1/common/blockd.h
+++ b/av1/common/blockd.h
@@ -708,12 +708,8 @@
}
static INLINE int is_inter_ref_frame(MV_REFERENCE_FRAME ref_frame) {
-#if CONFIG_NEW_REF_SIGNALING
return ref_frame != INTRA_FRAME && ref_frame != INTRA_FRAME_INDEX &&
ref_frame != NONE_FRAME;
-#else
- return ref_frame > INTRA_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
}
#if CONFIG_TIP
@@ -914,45 +910,6 @@
return is_inter_ref_frame(mbmi->ref_frame[1]);
}
-#if !CONFIG_NEW_REF_SIGNALING
-static INLINE int has_uni_comp_refs(const MB_MODE_INFO *mbmi) {
- return has_second_ref(mbmi) && (!((mbmi->ref_frame[0] >= BWDREF_FRAME) ^
- (mbmi->ref_frame[1] >= BWDREF_FRAME)));
-}
-
-static INLINE MV_REFERENCE_FRAME comp_ref0(int ref_idx) {
- static const MV_REFERENCE_FRAME lut[] = {
- LAST_FRAME, // LAST_LAST2_FRAMES,
- LAST_FRAME, // LAST_LAST3_FRAMES,
- LAST_FRAME, // LAST_GOLDEN_FRAMES,
- BWDREF_FRAME, // BWDREF_ALTREF_FRAMES,
- LAST2_FRAME, // LAST2_LAST3_FRAMES
- LAST2_FRAME, // LAST2_GOLDEN_FRAMES,
- LAST3_FRAME, // LAST3_GOLDEN_FRAMES,
- BWDREF_FRAME, // BWDREF_ALTREF2_FRAMES,
- ALTREF2_FRAME, // ALTREF2_ALTREF_FRAMES,
- };
- assert(NELEMENTS(lut) == TOTAL_UNIDIR_COMP_REFS);
- return lut[ref_idx];
-}
-
-static INLINE MV_REFERENCE_FRAME comp_ref1(int ref_idx) {
- static const MV_REFERENCE_FRAME lut[] = {
- LAST2_FRAME, // LAST_LAST2_FRAMES,
- LAST3_FRAME, // LAST_LAST3_FRAMES,
- GOLDEN_FRAME, // LAST_GOLDEN_FRAMES,
- ALTREF_FRAME, // BWDREF_ALTREF_FRAMES,
- LAST3_FRAME, // LAST2_LAST3_FRAMES
- GOLDEN_FRAME, // LAST2_GOLDEN_FRAMES,
- GOLDEN_FRAME, // LAST3_GOLDEN_FRAMES,
- ALTREF2_FRAME, // BWDREF_ALTREF2_FRAMES,
- ALTREF_FRAME, // ALTREF2_ALTREF_FRAMES,
- };
- assert(NELEMENTS(lut) == TOTAL_UNIDIR_COMP_REFS);
- return lut[ref_idx];
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
#if CONFIG_AIMC
PREDICTION_MODE av1_get_joint_mode(const MB_MODE_INFO *mi);
#else
@@ -2089,11 +2046,7 @@
* Counts of each reference frame in the above and left neighboring blocks.
* NOTE: Take into account both single and comp references.
*/
-#if CONFIG_NEW_REF_SIGNALING
uint8_t neighbors_ref_counts[INTER_REFS_PER_FRAME];
-#else
- uint8_t neighbors_ref_counts[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* Current CDFs of all the symbols for the current tile.
diff --git a/av1/common/entropy.c b/av1/common/entropy.c
index 2ac8cd3..34fd0fb 100644
--- a/av1/common/entropy.c
+++ b/av1/common/entropy.c
@@ -225,15 +225,8 @@
RESET_CDF_COUNTER(fc->palette_uv_mode_cdf, 2);
RESET_CDF_COUNTER(fc->comp_inter_cdf, 2);
RESET_CDF_COUNTER(fc->single_ref_cdf, 2);
-#if CONFIG_NEW_REF_SIGNALING
RESET_CDF_COUNTER(fc->comp_ref0_cdf, 2);
RESET_CDF_COUNTER(fc->comp_ref1_cdf, 2);
-#else
- RESET_CDF_COUNTER(fc->comp_ref_cdf, 2);
- RESET_CDF_COUNTER(fc->comp_ref_type_cdf, 2);
- RESET_CDF_COUNTER(fc->uni_comp_ref_cdf, 2);
- RESET_CDF_COUNTER(fc->comp_bwdref_cdf, 2);
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_NEW_TX_PARTITION
// Square blocks
RESET_CDF_COUNTER(fc->inter_4way_txfm_partition_cdf[0], 4);
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index 40bda79..6d3ecec 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -1964,7 +1964,6 @@
{ AOM_CDF2(2901) } };
#endif // CONFIG_NEW_CONTEXT_MODELING
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_NEW_CONTEXT_MODELING
static const aom_cdf_prob
default_single_ref_cdf[REF_CONTEXTS][INTER_REFS_PER_FRAME - 1]
@@ -2183,60 +2182,6 @@
{ AOM_CDF2(1696) } } }
};
#endif // CONFIG_NEW_CONTEXT_MODELING
-#else
-static const aom_cdf_prob default_comp_ref_type_cdf[COMP_REF_TYPE_CONTEXTS]
- [CDF_SIZE(2)] = {
- { AOM_CDF2(1198) },
- { AOM_CDF2(2070) },
- { AOM_CDF2(9166) },
- { AOM_CDF2(7499) },
- { AOM_CDF2(22475) }
- };
-
-static const aom_cdf_prob
- default_uni_comp_ref_cdf[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS -
- 1][CDF_SIZE(2)] = {
- { { AOM_CDF2(5284) }, { AOM_CDF2(3865) }, { AOM_CDF2(3128) } },
- { { AOM_CDF2(23152) }, { AOM_CDF2(14173) }, { AOM_CDF2(15270) } },
- { { AOM_CDF2(31774) }, { AOM_CDF2(25120) }, { AOM_CDF2(26710) } }
- };
-
-static const aom_cdf_prob default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1]
- [CDF_SIZE(2)] = {
- { { AOM_CDF2(4897) },
- { AOM_CDF2(1555) },
- { AOM_CDF2(4236) },
- { AOM_CDF2(8650) },
- { AOM_CDF2(904) },
- { AOM_CDF2(1444) } },
- { { AOM_CDF2(16973) },
- { AOM_CDF2(16751) },
- { AOM_CDF2(19647) },
- { AOM_CDF2(24773) },
- { AOM_CDF2(11014) },
- { AOM_CDF2(15087) } },
- { { AOM_CDF2(29744) },
- { AOM_CDF2(30279) },
- { AOM_CDF2(31194) },
- { AOM_CDF2(31895) },
- { AOM_CDF2(26875) },
- { AOM_CDF2(30304) } }
- };
-
-static const aom_cdf_prob
- default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)] = {
- { { AOM_CDF2(4946) }, { AOM_CDF2(9468) }, { AOM_CDF2(1503) } },
- { { AOM_CDF2(19891) }, { AOM_CDF2(22441) }, { AOM_CDF2(15160) } },
- { { AOM_CDF2(30731) }, { AOM_CDF2(31059) }, { AOM_CDF2(27544) } }
- };
-
-static const aom_cdf_prob
- default_comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)] = {
- { { AOM_CDF2(2235) }, { AOM_CDF2(1423) } },
- { { AOM_CDF2(17182) }, { AOM_CDF2(15175) } },
- { { AOM_CDF2(30606) }, { AOM_CDF2(30489) } }
- };
-#endif // CONFIG_NEW_REF_SIGNALING
static const aom_cdf_prob
default_palette_y_size_cdf[PALATTE_BSIZE_CTXS][CDF_SIZE(PALETTE_SIZES)] = {
@@ -3098,15 +3043,8 @@
av1_copy(fc->palette_y_mode_cdf, default_palette_y_mode_cdf);
av1_copy(fc->palette_uv_mode_cdf, default_palette_uv_mode_cdf);
av1_copy(fc->single_ref_cdf, default_single_ref_cdf);
-#if CONFIG_NEW_REF_SIGNALING
av1_copy(fc->comp_ref0_cdf, default_comp_ref0_cdf);
av1_copy(fc->comp_ref1_cdf, default_comp_ref1_cdf);
-#else
- av1_copy(fc->comp_ref_cdf, default_comp_ref_cdf);
- av1_copy(fc->comp_ref_type_cdf, default_comp_ref_type_cdf);
- av1_copy(fc->uni_comp_ref_cdf, default_uni_comp_ref_cdf);
- av1_copy(fc->comp_bwdref_cdf, default_comp_bwdref_cdf);
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_NEW_TX_PARTITION
av1_copy(fc->inter_4way_txfm_partition_cdf,
default_inter_4way_txfm_partition_cdf);
@@ -3286,7 +3224,6 @@
void av1_set_default_ref_deltas(int8_t *ref_deltas) {
assert(ref_deltas != NULL);
-#if CONFIG_NEW_REF_SIGNALING
ref_deltas[0] = -1;
ref_deltas[1] = -1;
ref_deltas[2] = -1;
@@ -3295,16 +3232,6 @@
ref_deltas[5] = 0;
ref_deltas[6] = 0;
ref_deltas[INTRA_FRAME_INDEX] = 1;
-#else
- ref_deltas[INTRA_FRAME] = 1;
- ref_deltas[LAST_FRAME] = 0;
- ref_deltas[LAST2_FRAME] = ref_deltas[LAST_FRAME];
- ref_deltas[LAST3_FRAME] = ref_deltas[LAST_FRAME];
- ref_deltas[BWDREF_FRAME] = ref_deltas[LAST_FRAME];
- ref_deltas[GOLDEN_FRAME] = -1;
- ref_deltas[ALTREF2_FRAME] = -1;
- ref_deltas[ALTREF_FRAME] = -1;
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
ref_deltas[TIP_FRAME_INDEX] = 0;
#endif // CONFIG_TIP
@@ -3340,11 +3267,7 @@
// TODO(jack.haughton@argondesign.com): don't think this should be necessary,
// but could do with fuller testing
if (cm->tiles.large_scale) {
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
RefCntBuffer *const buf = get_ref_frame_buf(cm, i);
if (buf != NULL) buf->frame_context = *cm->fc;
}
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 2dafcf9..06369e1b 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -72,7 +72,6 @@
#define FSC_BSIZE_CONTEXTS 5
#endif // CONFIG_FORWARDSKIP
-#if CONFIG_NEW_REF_SIGNALING
#define COMPREF_BIT_TYPES 2
#define RANKED_REF0_TO_PRUNE 3
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -81,7 +80,6 @@
// coumpound prediction
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
#define MAX_REFS_ARF 4
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_WIENER_NONSEP
#define WIENERNS_REDUCE_STEPS 5
@@ -250,7 +248,6 @@
[CDF_SIZE(2)];
aom_cdf_prob palette_uv_mode_cdf[PALETTE_UV_MODE_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(2)];
-#if CONFIG_NEW_REF_SIGNALING
aom_cdf_prob single_ref_cdf[REF_CONTEXTS][INTER_REFS_PER_FRAME - 1]
[CDF_SIZE(2)];
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -264,14 +261,6 @@
aom_cdf_prob comp_ref1_cdf[REF_CONTEXTS][COMPREF_BIT_TYPES]
[INTER_REFS_PER_FRAME - 2][CDF_SIZE(2)];
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#else
- aom_cdf_prob single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)];
- aom_cdf_prob comp_ref_type_cdf[COMP_REF_TYPE_CONTEXTS][CDF_SIZE(2)];
- aom_cdf_prob uni_comp_ref_cdf[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_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)];
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_NEW_TX_PARTITION
aom_cdf_prob inter_4way_txfm_partition_cdf[2][TXFM_PARTITION_INTER_CONTEXTS]
[CDF_SIZE(4)];
diff --git a/av1/common/enums.h b/av1/common/enums.h
index d71820a..966a471 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -605,19 +605,6 @@
#define INTRA_TX_SET2 5
#endif // CONFIG_FORWARDSKIP
-#if !CONFIG_NEW_REF_SIGNALING
-enum {
- AOM_LAST_FLAG = 1 << 0,
- AOM_LAST2_FLAG = 1 << 1,
- AOM_LAST3_FLAG = 1 << 2,
- AOM_GOLD_FLAG = 1 << 3,
- AOM_BWD_FLAG = 1 << 4,
- AOM_ALT2_FLAG = 1 << 5,
- AOM_ALT_FLAG = 1 << 6,
- AOM_REFFRAME_ALL = (1 << 7) - 1
-} UENUM1BYTE(AOM_REFFRAME);
-#endif // !CONFIG_NEW_REF_SIGNALING
-
enum {
UNIDIR_COMP_REFERENCE,
BIDIR_COMP_REFERENCE,
@@ -981,7 +968,6 @@
#define TIP_CONTEXTS 3
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
#define INTER_REFS_PER_FRAME 7
#define REF_FRAMES (INTER_REFS_PER_FRAME + 1)
// NOTE: A limited number of unidirectional reference pairs can be signalled for
@@ -1021,46 +1007,6 @@
#define INTRA_FRAME_INDEX INTER_REFS_PER_FRAME
#define NONE_FRAME INVALID_IDX
#define AOM_REFFRAME_ALL ((1 << INTER_REFS_PER_FRAME) - 1)
-#else
-// An enum for single reference types (and some derived values).
-enum {
- NONE_FRAME = -1,
- INTRA_FRAME,
- LAST_FRAME,
- LAST2_FRAME,
- LAST3_FRAME,
- GOLDEN_FRAME,
- BWDREF_FRAME,
- ALTREF2_FRAME,
- ALTREF_FRAME,
- REF_FRAMES,
-
- // Extra/scratch reference frame. It may be:
- // - used to update the ALTREF2_FRAME ref (see lshift_bwd_ref_frames()), or
- // - updated from ALTREF2_FRAME ref (see rshift_bwd_ref_frames()).
- EXTREF_FRAME = REF_FRAMES,
-
- // Number of inter (non-intra) reference types.
- INTER_REFS_PER_FRAME = ALTREF_FRAME - LAST_FRAME + 1,
-
- // Number of forward (aka past) reference types.
- FWD_REFS = GOLDEN_FRAME - LAST_FRAME + 1,
-
- // Number of backward (aka future) reference types.
- BWD_REFS = ALTREF_FRAME - BWDREF_FRAME + 1,
-
- SINGLE_REFS = FWD_REFS + BWD_REFS,
-};
-
-// NOTE: A limited number of unidirectional reference pairs can be signalled for
-// compound prediction. The use of skip mode, on the other hand, makes it
-// possible to have a reference pair not listed for explicit signaling.
-#if CONFIG_TIP
-#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS + 1)
-#else
-#define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
-#endif // CONFIG_TIP
-#endif // CONFIG_NEW_REF_SIGNALING
#define REF_FRAMES_LOG2 3
@@ -1072,24 +1018,6 @@
#define FWD_RF_OFFSET(ref) (ref - LAST_FRAME)
#define BWD_RF_OFFSET(ref) (ref - BWDREF_FRAME)
-#if !CONFIG_NEW_REF_SIGNALING
-enum {
- LAST_LAST2_FRAMES, // { LAST_FRAME, LAST2_FRAME }
- LAST_LAST3_FRAMES, // { LAST_FRAME, LAST3_FRAME }
- LAST_GOLDEN_FRAMES, // { LAST_FRAME, GOLDEN_FRAME }
- BWDREF_ALTREF_FRAMES, // { BWDREF_FRAME, ALTREF_FRAME }
- LAST2_LAST3_FRAMES, // { LAST2_FRAME, LAST3_FRAME }
- LAST2_GOLDEN_FRAMES, // { LAST2_FRAME, GOLDEN_FRAME }
- LAST3_GOLDEN_FRAMES, // { LAST3_FRAME, GOLDEN_FRAME }
- BWDREF_ALTREF2_FRAMES, // { BWDREF_FRAME, ALTREF2_FRAME }
- ALTREF2_ALTREF_FRAMES, // { ALTREF2_FRAME, ALTREF_FRAME }
- TOTAL_UNIDIR_COMP_REFS,
- // NOTE: UNIDIR_COMP_REFS is the number of uni-directional reference pairs
- // that are explicitly signaled.
- UNIDIR_COMP_REFS = BWDREF_ALTREF_FRAMES + 1,
-} UENUM1BYTE(UNIDIR_COMP_REF);
-#endif // !CONFIG_NEW_REF_SIGNALING
-
#define TOTAL_COMP_REFS (FWD_REFS * BWD_REFS + TOTAL_UNIDIR_COMP_REFS)
#define COMP_REFS (FWD_REFS * BWD_REFS + UNIDIR_COMP_REFS)
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index af1d237..7352ada 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -427,7 +427,6 @@
#if CONFIG_SKIP_MODE_DRL_WITH_REF_IDX
if (mbmi->skip_mode) {
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
if (!is_tip_ref_frame(candidate->ref_frame[0]) &&
!is_tip_ref_frame(candidate->ref_frame[1]) &&
@@ -437,10 +436,6 @@
if (is_inter_ref_frame(candidate->ref_frame[0]) &&
is_inter_ref_frame(candidate->ref_frame[1])) {
#endif
-#else
- if (candidate->ref_frame[0] >= LAST_FRAME ||
- candidate->ref_frame[1] >= LAST_FRAME) {
-#endif // CONFIG_NEW_REF_SIGNALING
int_mv this_refmv[2];
for (ref = 0; ref < 2; ++ref) {
if (is_global_mv_block(candidate, gm_params[rf[ref]].wmtype))
@@ -2833,11 +2828,7 @@
const int allow_high_precision_mv = cm->features.allow_high_precision_mv;
const int force_integer_mv = cm->features.cur_frame_force_integer_mv;
#endif
-#if CONFIG_NEW_REF_SIGNALING
if (ref_frame < INTER_REFS_PER_FRAME) {
-#else
- if (ref_frame < REF_FRAMES) {
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_FLEX_MVRES
gm_mv[0] = get_warp_motion_vector(&cm->global_motion[ref_frame],
fr_mv_precision, bsize, mi_col, mi_row);
@@ -2961,7 +2952,6 @@
cm->cur_frame->pyramid_level = cm->current_frame.pyramid_level;
MV_REFERENCE_FRAME ref_frame;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
if (buf != NULL && ref_frame < cm->ref_frames_info.num_total_refs) {
@@ -2973,42 +2963,15 @@
cm->cur_frame->ref_display_order_hint[ref_frame] = -1;
}
}
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
- if (buf != NULL) {
- cm->cur_frame->ref_order_hints[ref_frame - LAST_FRAME] = buf->order_hint;
- cm->cur_frame->ref_display_order_hint[ref_frame - LAST_FRAME] =
- buf->display_order_hint;
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
void av1_setup_frame_sign_bias(AV1_COMMON *cm) {
-#if CONFIG_NEW_REF_SIGNALING
memset(&cm->ref_frame_sign_bias, 0, sizeof(cm->ref_frame_sign_bias));
for (int ref_frame = 0; ref_frame < cm->ref_frames_info.num_future_refs;
++ref_frame) {
const int index = cm->ref_frames_info.future_refs[ref_frame];
cm->ref_frame_sign_bias[index] = 1;
}
-#else
- MV_REFERENCE_FRAME ref_frame;
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
- if (cm->seq_params.order_hint_info.enable_order_hint && buf != NULL) {
- const int ref_order_hint = buf->order_hint;
- cm->ref_frame_sign_bias[ref_frame] =
- (get_relative_dist(&cm->seq_params.order_hint_info, ref_order_hint,
- (int)cm->current_frame.order_hint) <= 0)
- ? 0
- : 1;
- } else {
- cm->ref_frame_sign_bias[ref_frame] = 0;
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
#if !CONFIG_TIP
@@ -3059,11 +3022,7 @@
MV_REFERENCE_FRAME start_frame, int dir,
int overwrite_mv) {
TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
-#if CONFIG_NEW_REF_SIGNALING
int ref_offset[INTER_REFS_PER_FRAME] = { 0 };
-#else
- int ref_offset[REF_FRAMES] = { 0 };
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const start_frame_buf =
get_ref_frame_buf(cm, start_frame);
@@ -3087,7 +3046,6 @@
assert(start_frame_buf->width == cm->width &&
start_frame_buf->height == cm->height);
-#if CONFIG_NEW_REF_SIGNALING
const int *const ref_order_hints = &start_frame_buf->ref_order_hints[0];
for (MV_REFERENCE_FRAME rf = 0; rf < INTER_REFS_PER_FRAME; ++rf) {
if (ref_order_hints[rf] != -1) {
@@ -3100,19 +3058,6 @@
start_to_current_frame_offset, ref_abs_offset[rf]);
}
}
-#else
- const unsigned int *const ref_order_hints =
- &start_frame_buf->ref_order_hints[0];
- for (MV_REFERENCE_FRAME rf = LAST_FRAME; rf <= INTER_REFS_PER_FRAME; ++rf) {
- ref_offset[rf] = get_relative_dist(&cm->seq_params.order_hint_info,
- start_frame_order_hint,
- ref_order_hints[rf - LAST_FRAME]);
- has_bwd_ref |= (ref_offset[rf] < 0);
- ref_abs_offset[rf] = abs(ref_offset[rf]);
- temporal_scale_factor[rf] = tip_derive_scale_factor(
- start_to_current_frame_offset, ref_abs_offset[rf]);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
if (has_bwd_ref == 0) return 0;
MV_REF *mv_ref_base = start_frame_buf->mvs;
@@ -3168,11 +3113,7 @@
MV_REFERENCE_FRAME start_frame, int dir,
int overwrite_mv) {
TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
-#if CONFIG_NEW_REF_SIGNALING
int ref_offset[INTER_REFS_PER_FRAME] = { 0 };
-#else
- int ref_offset[REF_FRAMES] = { 0 };
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const start_frame_buf =
get_ref_frame_buf(cm, start_frame);
@@ -3195,7 +3136,6 @@
assert(start_frame_buf->width == cm->width &&
start_frame_buf->height == cm->height);
-#if CONFIG_NEW_REF_SIGNALING
const int *const ref_order_hints = &start_frame_buf->ref_order_hints[0];
for (MV_REFERENCE_FRAME rf = 0; rf < INTER_REFS_PER_FRAME; ++rf) {
if (ref_order_hints[rf] != -1) {
@@ -3207,18 +3147,6 @@
start_to_current_frame_offset, ref_abs_offset[rf]);
}
}
-#else
- const unsigned int *const ref_order_hints =
- &start_frame_buf->ref_order_hints[0];
- for (MV_REFERENCE_FRAME rf = LAST_FRAME; rf <= INTER_REFS_PER_FRAME; ++rf) {
- ref_offset[rf] = get_relative_dist(&cm->seq_params.order_hint_info,
- start_frame_order_hint,
- ref_order_hints[rf - LAST_FRAME]);
- ref_abs_offset[rf] = abs(ref_offset[rf]);
- temporal_scale_factor[rf] = tip_derive_scale_factor(
- start_to_current_frame_offset, ref_abs_offset[rf]);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
MV_REF *mv_ref_base = start_frame_buf->mvs;
const int mvs_rows =
@@ -3276,11 +3204,7 @@
MV_REFERENCE_FRAME start_frame, int dir,
int overwrite_mv) {
TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
-#if CONFIG_NEW_REF_SIGNALING
int ref_offset[INTER_REFS_PER_FRAME] = { 0 };
-#else
- int ref_offset[REF_FRAMES] = { 0 };
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const start_frame_buf =
get_ref_frame_buf(cm, start_frame);
@@ -3294,7 +3218,6 @@
assert(start_frame_buf->width == cm->width &&
start_frame_buf->height == cm->height);
-#if CONFIG_NEW_REF_SIGNALING
const int *const ref_order_hints = &start_frame_buf->ref_order_hints[0];
for (MV_REFERENCE_FRAME rf = 0; rf < INTER_REFS_PER_FRAME; ++rf) {
if (ref_order_hints[rf] != -1)
@@ -3302,15 +3225,6 @@
get_relative_dist(&cm->seq_params.order_hint_info,
start_frame_order_hint, ref_order_hints[rf]);
}
-#else
- const unsigned int *const ref_order_hints =
- &start_frame_buf->ref_order_hints[0];
- for (MV_REFERENCE_FRAME rf = LAST_FRAME; rf <= INTER_REFS_PER_FRAME; ++rf) {
- ref_offset[rf] = get_relative_dist(&cm->seq_params.order_hint_info,
- start_frame_order_hint,
- ref_order_hints[rf - LAST_FRAME]);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
if (dir == 2) start_to_current_frame_offset = -start_to_current_frame_offset;
@@ -3365,11 +3279,7 @@
MV_REFERENCE_FRAME start_frame, int dir,
int overwrite_mv) {
TPL_MV_REF *tpl_mvs_base = cm->tpl_mvs;
-#if CONFIG_NEW_REF_SIGNALING
int ref_offset[INTER_REFS_PER_FRAME] = { 0 };
-#else
- int ref_offset[REF_FRAMES] = { 0 };
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const start_frame_buf =
get_ref_frame_buf(cm, start_frame);
@@ -3383,7 +3293,6 @@
assert(start_frame_buf->width == cm->width &&
start_frame_buf->height == cm->height);
-#if CONFIG_NEW_REF_SIGNALING
const int *const ref_order_hints = &start_frame_buf->ref_order_hints[0];
for (MV_REFERENCE_FRAME rf = 0; rf < INTER_REFS_PER_FRAME; ++rf) {
if (ref_order_hints[rf] != -1)
@@ -3391,15 +3300,6 @@
get_relative_dist(&cm->seq_params.order_hint_info,
start_frame_order_hint, ref_order_hints[rf]);
}
-#else
- const unsigned int *const ref_order_hints =
- &start_frame_buf->ref_order_hints[0];
- for (MV_REFERENCE_FRAME rf = LAST_FRAME; rf <= INTER_REFS_PER_FRAME; ++rf) {
- ref_offset[rf] = get_relative_dist(&cm->seq_params.order_hint_info,
- start_frame_order_hint,
- ref_order_hints[rf - LAST_FRAME]);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
if (dir == 2) start_to_current_frame_offset = -start_to_current_frame_offset;
@@ -3446,7 +3346,6 @@
}
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
// Check if a reference frame is an overlay frame (i.e., has the same
// order_hint as the current frame).
static INLINE int is_ref_overlay(const AV1_COMMON *const cm, int ref) {
@@ -3464,7 +3363,6 @@
}
return 0;
}
-#endif // CONFIG_NEW_REF_SIGNALING
void av1_setup_motion_field(AV1_COMMON *cm) {
const OrderHintInfo *const order_hint_info = &cm->seq_params.order_hint_info;
@@ -3490,7 +3388,6 @@
const RefCntBuffer *ref_buf[INTER_REFS_PER_FRAME];
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; i++) {
ref_buf[i] = NULL;
cm->ref_frame_side[i] = 0;
@@ -3529,56 +3426,15 @@
cm->ref_frame_relative_dist[ref_frame] = abs(relative_dist);
#endif // CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
}
-#else
- int ref_order_hint[INTER_REFS_PER_FRAME];
- const int cur_order_hint = cm->cur_frame->order_hint;
-
-#if CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- int has_bwd_ref = 0;
-#endif // CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
- const int ref_idx = ref_frame - LAST_FRAME;
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
- int order_hint = 0;
-
- if (buf != NULL) order_hint = buf->order_hint;
-
- ref_buf[ref_idx] = buf;
- ref_order_hint[ref_idx] = order_hint;
-#if CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
- const int relative_dist =
- get_relative_dist(order_hint_info, order_hint, cur_order_hint);
- if (relative_dist > 0) {
-#else
- if (get_relative_dist(order_hint_info, order_hint, cur_order_hint) > 0) {
-#endif // CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
- cm->ref_frame_side[ref_frame] = 1;
-#if CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- has_bwd_ref = 1;
-#endif // CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- } else if (order_hint == cur_order_hint) {
- cm->ref_frame_side[ref_frame] = -1;
- }
-
-#if CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
- cm->ref_frame_relative_dist[ref_frame] = abs(relative_dist);
-#endif // CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
- }
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
cm->has_bwd_ref = cm->ref_frames_info.num_future_refs ? 1 : 0;
-#else
- cm->has_bwd_ref = has_bwd_ref;
-#endif // CONFIG_NEW_REF_SIGNALING
if (cm->seq_params.enable_tip) {
av1_derive_tip_nearest_ref_frames_motion_projection(cm);
}
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
int n_refs_used = 0;
// Implements a strategy where the closest references in the past
@@ -3654,78 +3510,6 @@
n_refs_used += ret;
}
#endif // CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
-#else
- int ref_stamp = MFMV_STACK_SIZE - 1;
-
-#if CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- int overwrite_mv = 0;
- if (has_bwd_ref) {
- if (ref_buf[LAST_FRAME - LAST_FRAME] != NULL) {
- const int alt_of_lst_order_hint =
- ref_buf[LAST_FRAME - LAST_FRAME]
- ->ref_order_hints[ALTREF_FRAME - LAST_FRAME];
-
- const int is_lst_overlay =
- (alt_of_lst_order_hint == ref_order_hint[GOLDEN_FRAME - LAST_FRAME]);
- if (!is_lst_overlay)
- motion_field_projection_bwd(cm, LAST_FRAME, 2, overwrite_mv);
- }
- }
-#else
- int overwrite_mv = 1;
- if (ref_buf[LAST_FRAME - LAST_FRAME] != NULL) {
- const int alt_of_lst_order_hint =
- ref_buf[LAST_FRAME - LAST_FRAME]
- ->ref_order_hints[ALTREF_FRAME - LAST_FRAME];
-
- const int is_lst_overlay =
- (alt_of_lst_order_hint == ref_order_hint[GOLDEN_FRAME - LAST_FRAME]);
- if (!is_lst_overlay)
- motion_field_projection(cm, LAST_FRAME, 2, overwrite_mv);
- --ref_stamp;
- }
-#endif // CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
-
- if (get_relative_dist(order_hint_info,
- ref_order_hint[BWDREF_FRAME - LAST_FRAME],
- cur_order_hint) > 0) {
- if (motion_field_projection(cm, BWDREF_FRAME, 0, overwrite_mv)) --ref_stamp;
- }
-
- if (get_relative_dist(order_hint_info,
- ref_order_hint[ALTREF2_FRAME - LAST_FRAME],
- cur_order_hint) > 0) {
- if (motion_field_projection(cm, ALTREF2_FRAME, 0, overwrite_mv))
- --ref_stamp;
- }
-
-#if CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- if (ref_buf[LAST_FRAME - LAST_FRAME] != NULL) {
- const int alt_of_lst_order_hint =
- ref_buf[LAST_FRAME - LAST_FRAME]
- ->ref_order_hints[ALTREF_FRAME - LAST_FRAME];
-
- const int is_lst_overlay =
- (alt_of_lst_order_hint == ref_order_hint[GOLDEN_FRAME - LAST_FRAME]);
- if (!is_lst_overlay)
- motion_field_projection(cm, LAST_FRAME, 2, overwrite_mv);
- --ref_stamp;
- }
-#endif // CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
-
- if (get_relative_dist(order_hint_info,
- ref_order_hint[ALTREF_FRAME - LAST_FRAME],
- cur_order_hint) > 0 &&
- ref_stamp >= 0)
- if (motion_field_projection(cm, ALTREF_FRAME, 0, overwrite_mv)) --ref_stamp;
-
-#if CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- if (has_bwd_ref && ref_stamp >= 0) {
- motion_field_projection_bwd(cm, LAST2_FRAME, 2, overwrite_mv);
- }
-#endif // CONFIG_TMVP_IMPROVEMENT || CONFIG_TIP
- if (ref_stamp >= 0) motion_field_projection(cm, LAST2_FRAME, 2, overwrite_mv);
-#endif // CONFIG_NEW_REF_SIGNALING
}
#if CONFIG_SMVP_IMPROVEMENT || CONFIG_JOINT_MVD
@@ -3737,12 +3521,8 @@
const int cur_order_hint = cm->cur_frame->order_hint;
-#if CONFIG_NEW_REF_SIGNALING
for (int ref_frame = 0; ref_frame < cm->ref_frames_info.num_total_refs;
ref_frame++) {
-#else
- for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
int order_hint = 0;
@@ -4064,15 +3844,9 @@
int ref_order_hints[2] = { -1, INT_MAX };
int ref_idx[2] = { INVALID_IDX, INVALID_IDX };
-#if CONFIG_NEW_REF_SIGNALING
// Identify the top ranked forward and backward references.
for (int i = 0; i < cm->ref_frames_info.num_total_refs; ++i) {
const RefCntBuffer *const buf = get_ref_frame_buf(cm, i);
-#else
- // Identify the nearest forward and backward references.
- for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, LAST_FRAME + i);
-#endif // CONFIG_NEW_REF_SIGNALING
if (buf == NULL) continue;
const int ref_order_hint = buf->order_hint;
@@ -4100,23 +3874,19 @@
if (ref_idx[0] != INVALID_IDX && ref_idx[1] != INVALID_IDX) {
// == Bi-directional prediction ==
skip_mode_info->skip_mode_allowed = 1;
-#if CONFIG_NEW_REF_SIGNALING && CONFIG_SKIP_MODE_ENHANCEMENT
+#if CONFIG_SKIP_MODE_ENHANCEMENT
skip_mode_info->ref_frame_idx_0 = ref_idx[0];
skip_mode_info->ref_frame_idx_1 = ref_idx[1];
#else
skip_mode_info->ref_frame_idx_0 = AOMMIN(ref_idx[0], ref_idx[1]);
skip_mode_info->ref_frame_idx_1 = AOMMAX(ref_idx[0], ref_idx[1]);
-#endif // CONFIG_NEW_REF_SIGNALING && CONFIG_SKIP_MODE_ENHANCEMENT
+#endif // CONFIG_SKIP_MODE_ENHANCEMENT
} else if (ref_idx[0] != INVALID_IDX && ref_idx[1] == INVALID_IDX) {
// == Forward prediction only ==
// Identify the second nearest forward reference.
ref_order_hints[1] = -1;
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#if CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const buf = get_ref_frame_buf(cm, i);
-#else
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, LAST_FRAME + i);
-#endif // CONFIG_NEW_REF_SIGNALING
if (buf == NULL) continue;
const int ref_order_hint = buf->order_hint;
@@ -4133,210 +3903,18 @@
}
if (ref_order_hints[1] != -1) {
skip_mode_info->skip_mode_allowed = 1;
-#if CONFIG_NEW_REF_SIGNALING && CONFIG_SKIP_MODE_ENHANCEMENT
+#if CONFIG_SKIP_MODE_ENHANCEMENT
skip_mode_info->ref_frame_idx_0 = ref_idx[0];
skip_mode_info->ref_frame_idx_1 = ref_idx[1];
#else
skip_mode_info->ref_frame_idx_0 = AOMMIN(ref_idx[0], ref_idx[1]);
skip_mode_info->ref_frame_idx_1 = AOMMAX(ref_idx[0], ref_idx[1]);
-#endif // CONFIG_NEW_REF_SIGNALING && CONFIG_SKIP_MODE_ENHANCEMENT
+#endif // CONFIG_SKIP_MODE_ENHANCEMENT
}
}
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
}
-#if !CONFIG_NEW_REF_SIGNALING
-typedef struct {
- int map_idx; // frame map index
- RefCntBuffer *buf; // frame buffer
- int sort_idx; // index based on the offset to be used for sorting
-} REF_FRAME_INFO;
-
-// Compares the sort_idx fields. If they are equal, then compares the map_idx
-// fields to break the tie. This ensures a stable sort.
-static int compare_ref_frame_info(const void *arg_a, const void *arg_b) {
- const REF_FRAME_INFO *info_a = (REF_FRAME_INFO *)arg_a;
- const REF_FRAME_INFO *info_b = (REF_FRAME_INFO *)arg_b;
-
- const int sort_idx_diff = info_a->sort_idx - info_b->sort_idx;
- if (sort_idx_diff != 0) return sort_idx_diff;
- return info_a->map_idx - info_b->map_idx;
-}
-
-static AOM_INLINE void set_ref_frame_info(int *remapped_ref_idx, int frame_idx,
- REF_FRAME_INFO *ref_info) {
- assert(frame_idx >= 0 && frame_idx < INTER_REFS_PER_FRAME);
-
- remapped_ref_idx[frame_idx] = ref_info->map_idx;
-}
-
-void av1_set_frame_refs(AV1_COMMON *const cm, int *remapped_ref_idx,
- int lst_map_idx, int gld_map_idx) {
- int lst_frame_sort_idx = -1;
- int gld_frame_sort_idx = -1;
-
- assert(cm->seq_params.order_hint_info.enable_order_hint);
- assert(cm->seq_params.order_hint_info.order_hint_bits_minus_1 >= 0);
- const int cur_order_hint = (int)cm->current_frame.order_hint;
- const int cur_frame_sort_idx =
- 1 << cm->seq_params.order_hint_info.order_hint_bits_minus_1;
-
- REF_FRAME_INFO ref_frame_info[REF_FRAMES];
- int ref_flag_list[INTER_REFS_PER_FRAME] = { 0, 0, 0, 0, 0, 0, 0 };
-
- for (int i = 0; i < REF_FRAMES; ++i) {
- const int map_idx = i;
-
- ref_frame_info[i].map_idx = map_idx;
- ref_frame_info[i].sort_idx = -1;
-
- RefCntBuffer *const buf = cm->ref_frame_map[map_idx];
- ref_frame_info[i].buf = buf;
-
- if (buf == NULL) continue;
- // If this assertion fails, there is a reference leak.
- assert(buf->ref_count > 0);
-
- const int offset = (int)buf->order_hint;
- ref_frame_info[i].sort_idx =
- (offset == -1) ? -1
- : cur_frame_sort_idx +
- get_relative_dist(&cm->seq_params.order_hint_info,
- offset, cur_order_hint);
- assert(ref_frame_info[i].sort_idx >= -1);
-
- if (map_idx == lst_map_idx) lst_frame_sort_idx = ref_frame_info[i].sort_idx;
- if (map_idx == gld_map_idx) gld_frame_sort_idx = ref_frame_info[i].sort_idx;
- }
-
- // Confirm both LAST_FRAME and GOLDEN_FRAME are valid forward reference
- // frames.
- if (lst_frame_sort_idx == -1 || lst_frame_sort_idx >= cur_frame_sort_idx) {
- aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
- "Inter frame requests a look-ahead frame as LAST");
- }
- if (gld_frame_sort_idx == -1 || gld_frame_sort_idx >= cur_frame_sort_idx) {
- aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
- "Inter frame requests a look-ahead frame as GOLDEN");
- }
-
- // Sort ref frames based on their frame_offset values.
- qsort(ref_frame_info, REF_FRAMES, sizeof(REF_FRAME_INFO),
- compare_ref_frame_info);
-
- // Identify forward and backward reference frames.
- // Forward reference: offset < order_hint
- // Backward reference: offset >= order_hint
- int fwd_start_idx = 0, fwd_end_idx = REF_FRAMES - 1;
-
- for (int i = 0; i < REF_FRAMES; i++) {
- if (ref_frame_info[i].sort_idx == -1) {
- fwd_start_idx++;
- continue;
- }
-
- if (ref_frame_info[i].sort_idx >= cur_frame_sort_idx) {
- fwd_end_idx = i - 1;
- break;
- }
- }
-
- int bwd_start_idx = fwd_end_idx + 1;
- int bwd_end_idx = REF_FRAMES - 1;
-
- // === Backward Reference Frames ===
-
- // == ALTREF_FRAME ==
- if (bwd_start_idx <= bwd_end_idx) {
- set_ref_frame_info(remapped_ref_idx, ALTREF_FRAME - LAST_FRAME,
- &ref_frame_info[bwd_end_idx]);
- ref_flag_list[ALTREF_FRAME - LAST_FRAME] = 1;
- bwd_end_idx--;
- }
-
- // == BWDREF_FRAME ==
- if (bwd_start_idx <= bwd_end_idx) {
- set_ref_frame_info(remapped_ref_idx, BWDREF_FRAME - LAST_FRAME,
- &ref_frame_info[bwd_start_idx]);
- ref_flag_list[BWDREF_FRAME - LAST_FRAME] = 1;
- bwd_start_idx++;
- }
-
- // == ALTREF2_FRAME ==
- if (bwd_start_idx <= bwd_end_idx) {
- set_ref_frame_info(remapped_ref_idx, ALTREF2_FRAME - LAST_FRAME,
- &ref_frame_info[bwd_start_idx]);
- ref_flag_list[ALTREF2_FRAME - LAST_FRAME] = 1;
- }
-
- // === Forward Reference Frames ===
-
- for (int i = fwd_start_idx; i <= fwd_end_idx; ++i) {
- // == LAST_FRAME ==
- if (ref_frame_info[i].map_idx == lst_map_idx) {
- set_ref_frame_info(remapped_ref_idx, LAST_FRAME - LAST_FRAME,
- &ref_frame_info[i]);
- ref_flag_list[LAST_FRAME - LAST_FRAME] = 1;
- }
-
- // == GOLDEN_FRAME ==
- if (ref_frame_info[i].map_idx == gld_map_idx) {
- set_ref_frame_info(remapped_ref_idx, GOLDEN_FRAME - LAST_FRAME,
- &ref_frame_info[i]);
- ref_flag_list[GOLDEN_FRAME - LAST_FRAME] = 1;
- }
- }
-
- assert(ref_flag_list[LAST_FRAME - LAST_FRAME] == 1 &&
- ref_flag_list[GOLDEN_FRAME - LAST_FRAME] == 1);
-
- // == LAST2_FRAME ==
- // == LAST3_FRAME ==
- // == BWDREF_FRAME ==
- // == ALTREF2_FRAME ==
- // == ALTREF_FRAME ==
-
- // Set up the reference frames in the anti-chronological order.
- static const MV_REFERENCE_FRAME ref_frame_list[INTER_REFS_PER_FRAME - 2] = {
- LAST2_FRAME, LAST3_FRAME, BWDREF_FRAME, ALTREF2_FRAME, ALTREF_FRAME
- };
-
- int ref_idx;
- for (ref_idx = 0; ref_idx < (INTER_REFS_PER_FRAME - 2); ref_idx++) {
- const MV_REFERENCE_FRAME ref_frame = ref_frame_list[ref_idx];
-
- if (ref_flag_list[ref_frame - LAST_FRAME] == 1) continue;
-
- while (fwd_start_idx <= fwd_end_idx &&
- (ref_frame_info[fwd_end_idx].map_idx == lst_map_idx ||
- ref_frame_info[fwd_end_idx].map_idx == gld_map_idx)) {
- fwd_end_idx--;
- }
- if (fwd_start_idx > fwd_end_idx) break;
-
- set_ref_frame_info(remapped_ref_idx, ref_frame - LAST_FRAME,
- &ref_frame_info[fwd_end_idx]);
- ref_flag_list[ref_frame - LAST_FRAME] = 1;
-
- fwd_end_idx--;
- }
-
- // Assign all the remaining frame(s), if any, to the earliest reference
- // frame.
- for (; ref_idx < (INTER_REFS_PER_FRAME - 2); ref_idx++) {
- const MV_REFERENCE_FRAME ref_frame = ref_frame_list[ref_idx];
- if (ref_flag_list[ref_frame - LAST_FRAME] == 1) continue;
- set_ref_frame_info(remapped_ref_idx, ref_frame - LAST_FRAME,
- &ref_frame_info[fwd_start_idx]);
- ref_flag_list[ref_frame - LAST_FRAME] = 1;
- }
-
- for (int i = 0; i < INTER_REFS_PER_FRAME; i++) {
- assert(ref_flag_list[i] == 1);
- }
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
#if CONFIG_REF_MV_BANK
static INLINE void update_ref_mv_bank(const MB_MODE_INFO *const mbmi,
REF_MV_BANK *ref_mv_bank) {
diff --git a/av1/common/mvref_common.h b/av1/common/mvref_common.h
index 94ae928..e450578 100644
--- a/av1/common/mvref_common.h
+++ b/av1/common/mvref_common.h
@@ -156,7 +156,6 @@
}
#endif
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_ALLOW_SAME_REF_COMPOUND
// Converts a pair of distinct indices (rf) each in [0, n-1],
// to a combined index in [0, n*(n+1)/2].
@@ -269,79 +268,6 @@
}
return;
}
-#else
-static INLINE int8_t get_uni_comp_ref_idx(const MV_REFERENCE_FRAME *const rf) {
- // Single ref pred
- if (!is_inter_ref_frame(rf[1])) return -1;
-
- // Bi-directional comp ref pred
- if ((rf[0] < BWDREF_FRAME) && (rf[1] >= BWDREF_FRAME)) return -1;
-
- for (int8_t ref_idx = 0; ref_idx < TOTAL_UNIDIR_COMP_REFS; ++ref_idx) {
- if (rf[0] == comp_ref0(ref_idx) && rf[1] == comp_ref1(ref_idx))
- return ref_idx;
- }
- return -1;
-}
-
-static INLINE int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
- if (is_inter_ref_frame(rf[1])) {
- const int8_t uni_comp_ref_idx = get_uni_comp_ref_idx(rf);
- if (uni_comp_ref_idx >= 0) {
- assert((REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx) <
- MODE_CTX_REF_FRAMES);
- return REF_FRAMES + FWD_REFS * BWD_REFS + uni_comp_ref_idx;
- } else {
- return REF_FRAMES + FWD_RF_OFFSET(rf[0]) +
- BWD_RF_OFFSET(rf[1]) * FWD_REFS;
- }
- }
-
- return rf[0];
-}
-
-// clang-format off
-static MV_REFERENCE_FRAME ref_frame_map[TOTAL_COMP_REFS][2] = {
- { LAST_FRAME, BWDREF_FRAME }, { LAST2_FRAME, BWDREF_FRAME },
- { LAST3_FRAME, BWDREF_FRAME }, { GOLDEN_FRAME, BWDREF_FRAME },
-
- { LAST_FRAME, ALTREF2_FRAME }, { LAST2_FRAME, ALTREF2_FRAME },
- { LAST3_FRAME, ALTREF2_FRAME }, { GOLDEN_FRAME, ALTREF2_FRAME },
-
- { LAST_FRAME, ALTREF_FRAME }, { LAST2_FRAME, ALTREF_FRAME },
- { LAST3_FRAME, ALTREF_FRAME }, { GOLDEN_FRAME, ALTREF_FRAME },
-
- { LAST_FRAME, LAST2_FRAME }, { LAST_FRAME, LAST3_FRAME },
- { LAST_FRAME, GOLDEN_FRAME }, { BWDREF_FRAME, ALTREF_FRAME },
-
- // NOTE: Following reference frame pairs are not supported to be explicitly
- // signalled, but they are possibly chosen by the use of skip_mode,
- // which may use the most recent one-sided reference frame pair.
- { LAST2_FRAME, LAST3_FRAME }, { LAST2_FRAME, GOLDEN_FRAME },
- { LAST3_FRAME, GOLDEN_FRAME }, {BWDREF_FRAME, ALTREF2_FRAME},
- { ALTREF2_FRAME, ALTREF_FRAME }
-};
-// clang-format on
-
-static INLINE void av1_set_ref_frame(MV_REFERENCE_FRAME *rf,
- MV_REFERENCE_FRAME ref_frame_type) {
-#if CONFIG_TIP
- if (is_tip_ref_frame(ref_frame_type)) {
- rf[0] = ref_frame_type;
- rf[1] = NONE_FRAME;
- return;
- }
-#endif // CONFIG_TIP
- if (ref_frame_type >= REF_FRAMES) {
- rf[0] = ref_frame_map[ref_frame_type - REF_FRAMES][0];
- rf[1] = ref_frame_map[ref_frame_type - REF_FRAMES][1];
- } else {
- assert(ref_frame_type > NONE_FRAME);
- rf[0] = ref_frame_type;
- rf[1] = NONE_FRAME;
- }
-}
-#endif // CONFIG_NEW_REF_SIGNALING
#if !CONFIG_C076_INTER_MOD_CTX
static uint16_t compound_mode_ctx_map[3][COMP_NEWMV_CTXS] = {
@@ -424,10 +350,6 @@
void av1_setup_frame_sign_bias(AV1_COMMON *cm);
void av1_setup_skip_mode_allowed(AV1_COMMON *cm);
void av1_setup_motion_field(AV1_COMMON *cm);
-#if !CONFIG_NEW_REF_SIGNALING
-void av1_set_frame_refs(AV1_COMMON *const cm, int *remapped_ref_idx,
- int lst_map_idx, int gld_map_idx);
-#endif // !CONFIG_NEW_REF_SIGNALING
#if CONFIG_SMVP_IMPROVEMENT
void av1_setup_ref_frame_sides(AV1_COMMON *cm);
#endif // CONFIG_SMVP_IMPROVEMENT
diff --git a/av1/common/pred_common.c b/av1/common/pred_common.c
index bf0b38b..39f5548 100644
--- a/av1/common/pred_common.c
+++ b/av1/common/pred_common.c
@@ -16,7 +16,6 @@
#include "av1/common/reconintra.h"
#include "av1/common/seg_common.h"
-#if CONFIG_NEW_REF_SIGNALING
// Comparison function to sort reference frames in ascending score order
static int compare_score_data_asc(const void *a, const void *b) {
if (((RefScoreData *)a)->score == ((RefScoreData *)b)->score) {
@@ -204,243 +203,6 @@
if (cm->remapped_ref_idx[i] == INVALID_IDX) cm->remapped_ref_idx[i] = 0;
}
}
-#else
-/*!\cond */
-// Struct to keep track of relevant reference frame data
-typedef struct {
- int map_idx;
- int disp_order;
- int pyr_level;
- int used;
-} RefBufMapData;
-/*!\endcond */
-
-// Comparison function to sort reference frames in ascending display order
-static int compare_map_idx_pair_asc(const void *a, const void *b) {
- if (((RefBufMapData *)a)->disp_order == ((RefBufMapData *)b)->disp_order) {
- return 0;
- } else if (((const RefBufMapData *)a)->disp_order >
- ((const RefBufMapData *)b)->disp_order) {
- return 1;
- } else {
- return -1;
- }
-}
-
-// Checks to see if a particular reference frame is already in the reference
-// frame map
-static int is_in_ref_map(RefBufMapData *map, int disp_order, int n_frames) {
- for (int i = 0; i < n_frames; i++) {
- if (disp_order == map[i].disp_order) return 1;
- }
- return 0;
-}
-
-// Add a reference buffer index to a named reference slot
-static void add_ref_to_slot(RefBufMapData *ref, int *const remapped_ref_idx,
- int frame) {
- remapped_ref_idx[frame - LAST_FRAME] = ref->map_idx;
- ref->used = 1;
-}
-
-// Threshold dictating when we are allowed to start considering
-// leaving lowest level frames unmapped
-#define LOW_LEVEL_FRAMES_TR 5
-
-// Find which reference buffer should be left out of the named mapping.
-// This is because there are 8 reference buffers and only 7 named slots.
-static void set_unmapped_ref(RefBufMapData *buffer_map, int n_bufs,
- int n_min_level_refs, int min_level,
- int cur_frame_disp) {
- int max_dist = 0;
- int unmapped_idx = -1;
- if (n_bufs <= ALTREF_FRAME) return;
- for (int i = 0; i < n_bufs; i++) {
- if (buffer_map[i].used) continue;
- if (buffer_map[i].pyr_level != min_level ||
- n_min_level_refs >= LOW_LEVEL_FRAMES_TR) {
- int dist = abs(cur_frame_disp - buffer_map[i].disp_order);
- if (dist > max_dist) {
- max_dist = dist;
- unmapped_idx = i;
- }
- }
- }
- assert(unmapped_idx >= 0 && "Unmapped reference not found");
- buffer_map[unmapped_idx].used = 1;
-}
-
-void av1_get_ref_frames(AV1_COMMON *const cm, int cur_frame_disp,
- RefFrameMapPair *ref_frame_map_pairs) {
- int *const remapped_ref_idx = cm->remapped_ref_idx;
-
- int buf_map_idx = 0;
-
- // Initialize reference frame mappings
- for (int i = 0; i < REF_FRAMES; ++i) remapped_ref_idx[i] = INVALID_IDX;
-
- RefBufMapData buffer_map[REF_FRAMES];
- int n_bufs = 0;
- memset(buffer_map, 0, REF_FRAMES * sizeof(buffer_map[0]));
- int min_level = INT_MAX;
- int max_level = 0;
-
- // Go through current reference buffers and store display order, pyr level,
- // and map index.
- for (int map_idx = 0; map_idx < REF_FRAMES; map_idx++) {
- // Get reference frame buffer
- RefFrameMapPair ref_pair = ref_frame_map_pairs[map_idx];
- if (ref_pair.disp_order == -1) continue;
- const int frame_order = ref_pair.disp_order;
- // Avoid duplicates
- if (is_in_ref_map(buffer_map, frame_order, n_bufs)) continue;
- const int reference_frame_level = ref_pair.pyr_level;
-
- // Keep track of the lowest and highest levels that currently exist
- if (reference_frame_level < min_level) min_level = reference_frame_level;
- if (reference_frame_level > max_level) max_level = reference_frame_level;
-
- buffer_map[n_bufs].map_idx = map_idx;
- buffer_map[n_bufs].disp_order = frame_order;
- buffer_map[n_bufs].pyr_level = reference_frame_level;
- buffer_map[n_bufs].used = 0;
- n_bufs++;
- }
-
- // Sort frames in ascending display order
- qsort(buffer_map, n_bufs, sizeof(buffer_map[0]), compare_map_idx_pair_asc);
-
- int n_min_level_refs = 0;
- int n_past_high_level = 0;
- int closest_past_ref = -1;
- int golden_idx = -1;
- int altref_idx = -1;
-
- // Find the GOLDEN_FRAME and BWDREF_FRAME.
- // Also collect various stats about the reference frames for the remaining
- // mappings
- for (int i = n_bufs - 1; i >= 0; i--) {
- if (buffer_map[i].pyr_level == min_level) {
- // Keep track of the number of lowest level frames
- n_min_level_refs++;
- if (buffer_map[i].disp_order < cur_frame_disp && golden_idx == -1 &&
- remapped_ref_idx[GOLDEN_FRAME - LAST_FRAME] == INVALID_IDX) {
- // Save index for GOLDEN
- golden_idx = i;
- } else if (buffer_map[i].disp_order > cur_frame_disp &&
- altref_idx == -1 &&
- remapped_ref_idx[ALTREF_FRAME - LAST_FRAME] == INVALID_IDX) {
- // Save index for ALTREF
- altref_idx = i;
- }
- } else if (buffer_map[i].disp_order == cur_frame_disp) {
- // Map the BWDREF_FRAME if this is the show_existing_frame
- add_ref_to_slot(&buffer_map[i], remapped_ref_idx, BWDREF_FRAME);
- }
-
- // Keep track of the number of past frames that are not at the lowest level
- if (buffer_map[i].disp_order < cur_frame_disp &&
- buffer_map[i].pyr_level != min_level)
- n_past_high_level++;
-
- // Keep track of where the frames change from being past frames to future
- // frames
- if (buffer_map[i].disp_order < cur_frame_disp && closest_past_ref < 0)
- closest_past_ref = i;
- }
-
- // Do not map GOLDEN and ALTREF based on their pyramid level if all reference
- // frames have the same level
- if (n_min_level_refs <= n_bufs) {
- // Map the GOLDEN_FRAME
- if (golden_idx > -1)
- add_ref_to_slot(&buffer_map[golden_idx], remapped_ref_idx, GOLDEN_FRAME);
- // Map the ALTREF_FRAME
- if (altref_idx > -1)
- add_ref_to_slot(&buffer_map[altref_idx], remapped_ref_idx, ALTREF_FRAME);
- }
-
- // Find the buffer to be excluded from the mapping
- set_unmapped_ref(buffer_map, n_bufs, n_min_level_refs, min_level,
- cur_frame_disp);
-
- // Place past frames in LAST_FRAME, LAST2_FRAME, and LAST3_FRAME
- for (int frame = LAST_FRAME; frame < GOLDEN_FRAME; frame++) {
- // Continue if the current ref slot is already full
- if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
- // Find the next unmapped reference buffer
- // in decreasing ouptut oreder relative to current picture
- int next_buf_max = 0;
- int next_disp_order = INT_MIN;
- for (buf_map_idx = n_bufs - 1; buf_map_idx >= 0; buf_map_idx--) {
- if (!buffer_map[buf_map_idx].used &&
- buffer_map[buf_map_idx].disp_order < cur_frame_disp &&
- buffer_map[buf_map_idx].disp_order > next_disp_order) {
- next_disp_order = buffer_map[buf_map_idx].disp_order;
- next_buf_max = buf_map_idx;
- }
- }
- buf_map_idx = next_buf_max;
- if (buf_map_idx < 0) break;
- if (buffer_map[buf_map_idx].used) break;
- add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
- }
-
- // Place future frames (if there are any) in BWDREF_FRAME and ALTREF2_FRAME
- for (int frame = BWDREF_FRAME; frame < REF_FRAMES; frame++) {
- // Continue if the current ref slot is already full
- if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
- // Find the next unmapped reference buffer
- // in increasing ouptut oreder relative to current picture
- int next_buf_max = 0;
- int next_disp_order = INT_MAX;
- for (buf_map_idx = n_bufs - 1; buf_map_idx >= 0; buf_map_idx--) {
- if (!buffer_map[buf_map_idx].used &&
- buffer_map[buf_map_idx].disp_order > cur_frame_disp &&
- buffer_map[buf_map_idx].disp_order < next_disp_order) {
- next_disp_order = buffer_map[buf_map_idx].disp_order;
- next_buf_max = buf_map_idx;
- }
- }
- buf_map_idx = next_buf_max;
- if (buf_map_idx < 0) break;
- if (buffer_map[buf_map_idx].used) break;
- add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
- }
-
- // Place remaining past frames
- buf_map_idx = closest_past_ref;
- for (int frame = LAST_FRAME; frame < REF_FRAMES; frame++) {
- // Continue if the current ref slot is already full
- if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
- // Find the next unmapped reference buffer
- for (; buf_map_idx >= 0; buf_map_idx--) {
- if (!buffer_map[buf_map_idx].used) break;
- }
- if (buf_map_idx < 0) break;
- if (buffer_map[buf_map_idx].used) break;
- add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
- }
-
- // Place remaining future frames
- buf_map_idx = n_bufs - 1;
- for (int frame = ALTREF_FRAME; frame >= LAST_FRAME; frame--) {
- // Continue if the current ref slot is already full
- if (remapped_ref_idx[frame - LAST_FRAME] != INVALID_IDX) continue;
- // Find the next unmapped reference buffer
- for (; buf_map_idx > closest_past_ref; buf_map_idx--) {
- if (!buffer_map[buf_map_idx].used) break;
- }
- if (buf_map_idx < 0) break;
- if (buffer_map[buf_map_idx].used) break;
- add_ref_to_slot(&buffer_map[buf_map_idx], remapped_ref_idx, frame);
- }
-
- // Fill any slots that are empty (should only happen for the first 7 frames)
- for (int i = 0; i < REF_FRAMES; ++i)
- if (remapped_ref_idx[i] == INVALID_IDX) remapped_ref_idx[i] = 0;
-}
-#endif // CONFIG_NEW_REF_SIGNALING
// Returns a context number for the given MB prediction signal
static InterpFilter get_ref_filter_type(const MB_MODE_INFO *ref_mbmi,
@@ -576,14 +338,8 @@
}
}
-#if CONFIG_NEW_REF_SIGNALING
#define IS_BACKWARD_REF_FRAME(ref_frame) \
(get_dir_rank(cm, ref_frame, NULL) == 1)
-#else
-#define CHECK_BACKWARD_REFS(ref_frame) \
- (((ref_frame) >= BWDREF_FRAME) && ((ref_frame) <= ALTREF_FRAME))
-#define IS_BACKWARD_REF_FRAME(ref_frame) CHECK_BACKWARD_REFS(ref_frame)
-#endif // CONFIG_NEW_REF_SIGNALING
int av1_get_reference_mode_context(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
@@ -627,7 +383,6 @@
return ctx;
}
-#if CONFIG_NEW_REF_SIGNALING
// The context for reference frame is defined by comparing A) the count of
// rank n references and B) the count of rank > n references in the neighboring
// blocks. Context will be 0 if A<B, 1 if A=B, and 2 if A>B.
@@ -651,317 +406,3 @@
assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
return pred_context;
}
-#else
-int av1_get_comp_reference_type_context(const MACROBLOCKD *xd) {
- int ctx = 0;
- const MB_MODE_INFO *const neighbor0 = xd->neighbors[0];
- const MB_MODE_INFO *const neighbor1 = xd->neighbors[1];
-
- if (neighbor0 && neighbor1) { // both neighbors available
- const int is_neighbor0_intra = !is_inter_block(neighbor0, xd->tree_type);
- const int is_neighbor1_intra = !is_inter_block(neighbor1, xd->tree_type);
-
- if (is_neighbor0_intra && is_neighbor1_intra) { // intra/intra
- ctx = 2;
- } else if (is_neighbor0_intra || is_neighbor1_intra) { // intra/inter
- const MB_MODE_INFO *inter_mbmi =
- is_neighbor0_intra ? neighbor1 : neighbor0;
-
- if (!has_second_ref(inter_mbmi)) // single pred
- ctx = 2;
- else // comp pred
- ctx = 1 + 2 * has_uni_comp_refs(inter_mbmi);
- } else { // inter/inter
- const int a_sg = !has_second_ref(neighbor0);
- const int l_sg = !has_second_ref(neighbor1);
- const MV_REFERENCE_FRAME frfa = neighbor0->ref_frame[0];
- const MV_REFERENCE_FRAME frfl = neighbor1->ref_frame[0];
-
- if (a_sg && l_sg) { // single/single
- ctx = 1 + 2 * (!(IS_BACKWARD_REF_FRAME(frfa) ^
- IS_BACKWARD_REF_FRAME(frfl)));
- } else if (l_sg || a_sg) { // single/comp
- const int uni_rfc =
- a_sg ? has_uni_comp_refs(neighbor1) : has_uni_comp_refs(neighbor0);
-
- if (!uni_rfc) // comp bidir
- ctx = 1;
- else // comp unidir
- ctx = 3 +
- (!(IS_BACKWARD_REF_FRAME(frfa) ^ IS_BACKWARD_REF_FRAME(frfl)));
- } else { // comp/comp
- const int a_uni_rfc = has_uni_comp_refs(neighbor0);
- const int l_uni_rfc = has_uni_comp_refs(neighbor1);
-
- if (!a_uni_rfc && !l_uni_rfc) // bidir/bidir
- ctx = 0;
- else if (!a_uni_rfc || !l_uni_rfc) // unidir/bidir
- ctx = 2;
- else // unidir/unidir
- ctx = 3 + (!((frfa == BWDREF_FRAME) ^ (frfl == BWDREF_FRAME)));
- }
- }
- } else if (neighbor0 || neighbor1) { // one neighbor available
- const MB_MODE_INFO *neighbor = neighbor0 ? neighbor0 : neighbor1;
- if (!is_inter_block(neighbor, xd->tree_type)) { // intra
- ctx = 2;
- } else { // inter
- if (!has_second_ref(neighbor)) // single pred
- ctx = 2;
- else // comp pred
- ctx = 4 * has_uni_comp_refs(neighbor);
- }
- } else { // no neighbors available
- ctx = 2;
- }
-
- assert(ctx >= 0 && ctx < COMP_REF_TYPE_CONTEXTS);
- return ctx;
-}
-
-// Returns a context number for the given MB prediction signal
-//
-// Signal the uni-directional compound reference frame pair as either
-// (BWDREF, ALTREF), or (LAST, LAST2) / (LAST, LAST3) / (LAST, GOLDEN),
-// conditioning on the pair is known as uni-directional.
-//
-// 3 contexts: Voting is used to compare the count of forward references with
-// that of backward references from the spatial neighbors.
-int av1_get_pred_context_uni_comp_ref_p(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of forward references (L, L2, L3, or G)
- const int frf_count = ref_counts[LAST_FRAME] + ref_counts[LAST2_FRAME] +
- ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
- // Count of backward references (B or A)
- const int brf_count = ref_counts[BWDREF_FRAME] + ref_counts[ALTREF2_FRAME] +
- ref_counts[ALTREF_FRAME];
-
- const int pred_context =
- (frf_count == brf_count) ? 1 : ((frf_count < brf_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < UNI_COMP_REF_CONTEXTS);
- return pred_context;
-}
-
-// Returns a context number for the given MB prediction signal
-//
-// Signal the uni-directional compound reference frame pair as
-// either (LAST, LAST2), or (LAST, LAST3) / (LAST, GOLDEN),
-// conditioning on the pair is known as one of the above three.
-//
-// 3 contexts: Voting is used to compare the count of LAST2_FRAME with the
-// total count of LAST3/GOLDEN from the spatial neighbors.
-int av1_get_pred_context_uni_comp_ref_p1(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of LAST2
- const int last2_count = ref_counts[LAST2_FRAME];
- // Count of LAST3 or GOLDEN
- const int last3_or_gld_count =
- ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
-
- const int pred_context = (last2_count == last3_or_gld_count)
- ? 1
- : ((last2_count < last3_or_gld_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < UNI_COMP_REF_CONTEXTS);
- return pred_context;
-}
-
-// Returns a context number for the given MB prediction signal
-//
-// Signal the uni-directional compound reference frame pair as
-// either (LAST, LAST3) or (LAST, GOLDEN),
-// conditioning on the pair is known as one of the above two.
-//
-// 3 contexts: Voting is used to compare the count of LAST3_FRAME with the
-// total count of GOLDEN_FRAME from the spatial neighbors.
-int av1_get_pred_context_uni_comp_ref_p2(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of LAST3
- const int last3_count = ref_counts[LAST3_FRAME];
- // Count of GOLDEN
- const int gld_count = ref_counts[GOLDEN_FRAME];
-
- const int pred_context =
- (last3_count == gld_count) ? 1 : ((last3_count < gld_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < UNI_COMP_REF_CONTEXTS);
- return pred_context;
-}
-
-// == Common context functions for both comp and single ref ==
-//
-// Obtain contexts to signal a reference frame to be either LAST/LAST2 or
-// LAST3/GOLDEN.
-static int get_pred_context_ll2_or_l3gld(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of LAST + LAST2
- const int last_last2_count = ref_counts[LAST_FRAME] + ref_counts[LAST2_FRAME];
- // Count of LAST3 + GOLDEN
- const int last3_gld_count =
- ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
-
- const int pred_context = (last_last2_count == last3_gld_count)
- ? 1
- : ((last_last2_count < last3_gld_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
- return pred_context;
-}
-
-// Obtain contexts to signal a reference frame to be either LAST or LAST2.
-static int get_pred_context_last_or_last2(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of LAST
- const int last_count = ref_counts[LAST_FRAME];
- // Count of LAST2
- const int last2_count = ref_counts[LAST2_FRAME];
-
- const int pred_context =
- (last_count == last2_count) ? 1 : ((last_count < last2_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
- return pred_context;
-}
-
-// Obtain contexts to signal a reference frame to be either LAST3 or GOLDEN.
-static int get_pred_context_last3_or_gld(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of LAST3
- const int last3_count = ref_counts[LAST3_FRAME];
- // Count of GOLDEN
- const int gld_count = ref_counts[GOLDEN_FRAME];
-
- const int pred_context =
- (last3_count == gld_count) ? 1 : ((last3_count < gld_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
- return pred_context;
-}
-
-// Obtain contexts to signal a reference frame be either BWDREF/ALTREF2, or
-// ALTREF.
-static int get_pred_context_brfarf2_or_arf(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Counts of BWDREF, ALTREF2, or ALTREF frames (B, A2, or A)
- const int brfarf2_count =
- ref_counts[BWDREF_FRAME] + ref_counts[ALTREF2_FRAME];
- const int arf_count = ref_counts[ALTREF_FRAME];
-
- const int pred_context =
- (brfarf2_count == arf_count) ? 1 : ((brfarf2_count < arf_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
- return pred_context;
-}
-
-// Obtain contexts to signal a reference frame be either BWDREF or ALTREF2.
-static int get_pred_context_brf_or_arf2(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of BWDREF frames (B)
- const int brf_count = ref_counts[BWDREF_FRAME];
- // Count of ALTREF2 frames (A2)
- const int arf2_count = ref_counts[ALTREF2_FRAME];
-
- const int pred_context =
- (brf_count == arf2_count) ? 1 : ((brf_count < arf2_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
- return pred_context;
-}
-
-// == Context functions for comp ref ==
-//
-// Returns a context number for the given MB prediction signal
-// Signal the first reference frame for a compound mode be either
-// GOLDEN/LAST3, or LAST/LAST2.
-int av1_get_pred_context_comp_ref_p(const MACROBLOCKD *xd) {
- return get_pred_context_ll2_or_l3gld(xd);
-}
-
-// Returns a context number for the given MB prediction signal
-// Signal the first reference frame for a compound mode be LAST,
-// conditioning on that it is known either LAST/LAST2.
-int av1_get_pred_context_comp_ref_p1(const MACROBLOCKD *xd) {
- return get_pred_context_last_or_last2(xd);
-}
-
-// Returns a context number for the given MB prediction signal
-// Signal the first reference frame for a compound mode be GOLDEN,
-// conditioning on that it is known either GOLDEN or LAST3.
-int av1_get_pred_context_comp_ref_p2(const MACROBLOCKD *xd) {
- return get_pred_context_last3_or_gld(xd);
-}
-
-// Signal the 2nd reference frame for a compound mode be either
-// ALTREF, or ALTREF2/BWDREF.
-int av1_get_pred_context_comp_bwdref_p(const MACROBLOCKD *xd) {
- return get_pred_context_brfarf2_or_arf(xd);
-}
-
-// Signal the 2nd reference frame for a compound mode be either
-// ALTREF2 or BWDREF.
-int av1_get_pred_context_comp_bwdref_p1(const MACROBLOCKD *xd) {
- return get_pred_context_brf_or_arf2(xd);
-}
-
-// == Context functions for single ref ==
-//
-// For the bit to signal whether the single reference is a forward reference
-// frame or a backward reference frame.
-int av1_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
- const uint8_t *const ref_counts = &xd->neighbors_ref_counts[0];
-
- // Count of forward reference frames
- const int fwd_count = ref_counts[LAST_FRAME] + ref_counts[LAST2_FRAME] +
- ref_counts[LAST3_FRAME] + ref_counts[GOLDEN_FRAME];
- // Count of backward reference frames
- const int bwd_count = ref_counts[BWDREF_FRAME] + ref_counts[ALTREF2_FRAME] +
- ref_counts[ALTREF_FRAME];
-
- const int pred_context =
- (fwd_count == bwd_count) ? 1 : ((fwd_count < bwd_count) ? 0 : 2);
-
- assert(pred_context >= 0 && pred_context < REF_CONTEXTS);
- return pred_context;
-}
-
-// For the bit to signal whether the single reference is ALTREF_FRAME or
-// non-ALTREF backward reference frame, knowing that it shall be either of
-// these 2 choices.
-int av1_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
- return get_pred_context_brfarf2_or_arf(xd);
-}
-
-// For the bit to signal whether the single reference is LAST3/GOLDEN or
-// LAST2/LAST, knowing that it shall be either of these 2 choices.
-int av1_get_pred_context_single_ref_p3(const MACROBLOCKD *xd) {
- return get_pred_context_ll2_or_l3gld(xd);
-}
-
-// For the bit to signal whether the single reference is LAST2_FRAME or
-// LAST_FRAME, knowing that it shall be either of these 2 choices.
-int av1_get_pred_context_single_ref_p4(const MACROBLOCKD *xd) {
- return get_pred_context_last_or_last2(xd);
-}
-
-// For the bit to signal whether the single reference is GOLDEN_FRAME or
-// LAST3_FRAME, knowing that it shall be either of these 2 choices.
-int av1_get_pred_context_single_ref_p5(const MACROBLOCKD *xd) {
- return get_pred_context_last3_or_gld(xd);
-}
-
-// For the bit to signal whether the single reference is ALTREF2_FRAME or
-// BWDREF_FRAME, knowing that it shall be either of these 2 choices.
-int av1_get_pred_context_single_ref_p6(const MACROBLOCKD *xd) {
- return get_pred_context_brf_or_arf2(xd);
-}
-#endif // CONFIG_NEW_REF_SIGNALING
diff --git a/av1/common/pred_common.h b/av1/common/pred_common.h
index d87fcd8..dc4eebb 100644
--- a/av1/common/pred_common.h
+++ b/av1/common/pred_common.h
@@ -25,9 +25,7 @@
typedef struct {
int pyr_level;
int disp_order;
-#if CONFIG_NEW_REF_SIGNALING
int base_qindex;
-#endif // CONFIG_NEW_REF_SIGNALING
} RefFrameMapPair;
static INLINE void init_ref_map_pair(AV1_COMMON *cm,
@@ -45,9 +43,7 @@
if (buf == NULL) {
ref_frame_map_pairs[map_idx].disp_order = -1;
ref_frame_map_pairs[map_idx].pyr_level = -1;
-#if CONFIG_NEW_REF_SIGNALING
ref_frame_map_pairs[map_idx].base_qindex = -1;
-#endif // CONFIG_NEW_REF_SIGNALING
continue;
} else if (buf->ref_count > 1) {
// Once the keyframe is coded, the slots in ref_frame_map will all
@@ -60,21 +56,16 @@
if (buf2 == buf) {
ref_frame_map_pairs[idx2].disp_order = -1;
ref_frame_map_pairs[idx2].pyr_level = -1;
-#if CONFIG_NEW_REF_SIGNALING
ref_frame_map_pairs[idx2].base_qindex = -1;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
}
ref_frame_map_pairs[map_idx].disp_order = (int)buf->display_order_hint;
ref_frame_map_pairs[map_idx].pyr_level = buf->pyramid_level;
-#if CONFIG_NEW_REF_SIGNALING
ref_frame_map_pairs[map_idx].base_qindex = buf->base_qindex;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
-#if CONFIG_NEW_REF_SIGNALING
/*!\cond */
typedef struct {
// Scoring function for usefulness of references (the lower score, the more
@@ -181,10 +172,6 @@
if (cm->ref_frames_info.cur_refs[0] == refrank) return 0;
return -1;
}
-#else
-void av1_get_ref_frames(AV1_COMMON *const cm, int cur_frame_disp,
- RefFrameMapPair *ref_frame_map_pairs);
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
static INLINE int get_tip_ctx(const MACROBLOCKD *xd) {
@@ -277,19 +264,12 @@
static INLINE int derive_comp_one_ref_context(const AV1_COMMON *cm,
const MB_MODE_INFO *const mi) {
-#if CONFIG_NEW_REF_SIGNALING
MV_REFERENCE_FRAME furthest_future_ref = get_furthest_future_ref_index(cm);
-#else
- (void)cm;
-#endif // CONFIG_NEW_REF_SIGNALING
int ctx = 0;
if (mi) {
- if (has_second_ref(mi)) ctx = mi->comp_group_idx;
-#if CONFIG_NEW_REF_SIGNALING
+ if (has_second_ref(mi))
+ ctx = mi->comp_group_idx;
else if (mi->ref_frame[0] == furthest_future_ref)
-#else
- else if (mi->ref_frame[0] == ALTREF_FRAME)
-#endif // CONFIG_NEW_REF_SIGNALING
ctx = 2;
}
@@ -483,7 +463,6 @@
return xd->tile_ctx->skip_txfm_cdfs[av1_get_skip_txfm_context(xd)];
}
-#if CONFIG_NEW_REF_SIGNALING
int av1_get_ref_pred_context(const MACROBLOCKD *xd, MV_REFERENCE_FRAME ref,
int num_total_refs);
@@ -531,127 +510,6 @@
xd, ref, num_total_refs)][bit_type][ref - 1];
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
}
-#else
-int av1_get_comp_reference_type_context(const MACROBLOCKD *xd);
-
-// == Uni-directional contexts ==
-
-int av1_get_pred_context_uni_comp_ref_p(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_uni_comp_ref_p1(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_uni_comp_ref_p2(const MACROBLOCKD *xd);
-
-static INLINE aom_cdf_prob *av1_get_comp_reference_type_cdf(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_comp_reference_type_context(xd);
- return xd->tile_ctx->comp_ref_type_cdf[pred_context];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_uni_comp_ref_p(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_uni_comp_ref_p(xd);
- return xd->tile_ctx->uni_comp_ref_cdf[pred_context][0];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_uni_comp_ref_p1(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_uni_comp_ref_p1(xd);
- return xd->tile_ctx->uni_comp_ref_cdf[pred_context][1];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_uni_comp_ref_p2(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_uni_comp_ref_p2(xd);
- return xd->tile_ctx->uni_comp_ref_cdf[pred_context][2];
-}
-
-// == Bi-directional contexts ==
-
-int av1_get_pred_context_comp_ref_p(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_comp_ref_p1(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_comp_ref_p2(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_comp_bwdref_p(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_comp_bwdref_p1(const MACROBLOCKD *xd);
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p(const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_comp_ref_p(xd);
- return xd->tile_ctx->comp_ref_cdf[pred_context][0];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p1(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_comp_ref_p1(xd);
- return xd->tile_ctx->comp_ref_cdf[pred_context][1];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p2(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_comp_ref_p2(xd);
- return xd->tile_ctx->comp_ref_cdf[pred_context][2];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_bwdref_p(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_comp_bwdref_p(xd);
- return xd->tile_ctx->comp_bwdref_cdf[pred_context][0];
-}
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_bwdref_p1(
- const MACROBLOCKD *xd) {
- const int pred_context = av1_get_pred_context_comp_bwdref_p1(xd);
- return xd->tile_ctx->comp_bwdref_cdf[pred_context][1];
-}
-
-// == Single contexts ==
-
-int av1_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_single_ref_p3(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_single_ref_p4(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_single_ref_p5(const MACROBLOCKD *xd);
-
-int av1_get_pred_context_single_ref_p6(const MACROBLOCKD *xd);
-
-static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p1(
- const MACROBLOCKD *xd) {
- return xd->tile_ctx
- ->single_ref_cdf[av1_get_pred_context_single_ref_p1(xd)][0];
-}
-static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p2(
- const MACROBLOCKD *xd) {
- return xd->tile_ctx
- ->single_ref_cdf[av1_get_pred_context_single_ref_p2(xd)][1];
-}
-static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p3(
- const MACROBLOCKD *xd) {
- return xd->tile_ctx
- ->single_ref_cdf[av1_get_pred_context_single_ref_p3(xd)][2];
-}
-static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p4(
- const MACROBLOCKD *xd) {
- return xd->tile_ctx
- ->single_ref_cdf[av1_get_pred_context_single_ref_p4(xd)][3];
-}
-static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p5(
- const MACROBLOCKD *xd) {
- return xd->tile_ctx
- ->single_ref_cdf[av1_get_pred_context_single_ref_p5(xd)][4];
-}
-static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p6(
- const MACROBLOCKD *xd) {
- return xd->tile_ctx
- ->single_ref_cdf[av1_get_pred_context_single_ref_p6(xd)][5];
-}
-#endif // CONFIG_NEW_REF_SIGNALING
// Returns a context number for the given MB prediction signal
// The mode info data structure has a one element border above and to the
diff --git a/av1/common/seg_common.c b/av1/common/seg_common.c
index 5d707c9..dcc80ad 100644
--- a/av1/common/seg_common.c
+++ b/av1/common/seg_common.c
@@ -17,22 +17,11 @@
#include "av1/common/seg_common.h"
#include "av1/common/quant_common.h"
-static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 1, 1, 1,
-#if !CONFIG_NEW_REF_SIGNALING
- 0,
-#endif // !CONFIG_NEW_REF_SIGNALING
- 0, 0 };
+static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 1, 1, 1, 0, 0 };
-static const int seg_feature_data_max[SEG_LVL_MAX] = { MAXQ,
- MAX_LOOP_FILTER,
- MAX_LOOP_FILTER,
- MAX_LOOP_FILTER,
- MAX_LOOP_FILTER,
-#if !CONFIG_NEW_REF_SIGNALING
- 7,
-#endif // !CONFIG_NEW_REF_SIGNALING
- 0,
- 0 };
+static const int seg_feature_data_max[SEG_LVL_MAX] = {
+ MAXQ, MAX_LOOP_FILTER, MAX_LOOP_FILTER, MAX_LOOP_FILTER, MAX_LOOP_FILTER, 0, 0
+};
// These functions provide access to new segment level features.
// Eventually these function may be "optimized out" but for the moment,
@@ -50,11 +39,7 @@
for (int i = 0; i < MAX_SEGMENTS; i++) {
for (int j = 0; j < SEG_LVL_MAX; j++) {
if (seg->feature_mask[i] & (1 << j)) {
-#if CONFIG_NEW_REF_SIGNALING
seg->segid_preskip |= (j >= SEG_LVL_ALT_LF_V);
-#else
- seg->segid_preskip |= (j >= SEG_LVL_REF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
seg->last_active_segid = i;
}
}
diff --git a/av1/common/seg_common.h b/av1/common/seg_common.h
index 62a1026..7d959f4 100644
--- a/av1/common/seg_common.h
+++ b/av1/common/seg_common.h
@@ -31,10 +31,7 @@
SEG_LVL_ALT_LF_Y_H, // Use alternate loop filter value on y plane horizontal
SEG_LVL_ALT_LF_U, // Use alternate loop filter value on u plane
SEG_LVL_ALT_LF_V, // Use alternate loop filter value on v plane
-#if !CONFIG_NEW_REF_SIGNALING
- SEG_LVL_REF_FRAME, // Optional Segment reference frame
-#endif // !CONFIG_NEW_REF_SIGNALING
- SEG_LVL_SKIP, // Optional Segment (0,0) + skip mode
+ SEG_LVL_SKIP, // Optional Segment (0,0) + skip mode
SEG_LVL_GLOBALMV,
SEG_LVL_MAX
} UENUM1BYTE(SEG_LVL_FEATURES);
diff --git a/av1/common/tip.c b/av1/common/tip.c
index 957391b..56408f3 100644
--- a/av1/common/tip.c
+++ b/av1/common/tip.c
@@ -40,11 +40,7 @@
const int cur_order_hint = cm->current_frame.order_hint;
// Identify the nearest forward and backward references.
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; i++) {
-#else
- for (int i = LAST_FRAME; i < REF_FRAMES; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const buf = get_ref_frame_buf(cm, i);
if (buf == NULL) continue;
@@ -76,23 +72,12 @@
const RefCntBuffer *const start_frame_buf =
get_ref_frame_buf(cm, start_frame);
-#if CONFIG_NEW_REF_SIGNALING
const int *const ref_order_hints = &start_frame_buf->ref_order_hints[0];
for (MV_REFERENCE_FRAME rf = 0; rf < INTER_REFS_PER_FRAME; ++rf) {
if (ref_order_hints[rf] == target_frame_order) {
return 1;
}
}
-#else
- const unsigned int *const ref_order_hints =
- &start_frame_buf->ref_order_hints[0];
- for (MV_REFERENCE_FRAME rf = LAST_FRAME; rf <= INTER_REFS_PER_FRAME; ++rf) {
- const int ref_order = ref_order_hints[rf - LAST_FRAME];
- if (ref_order == target_frame_order) {
- return 1;
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
return 0;
}
@@ -131,11 +116,7 @@
assert(start_frame_buf->width == cm->width &&
start_frame_buf->height == cm->height);
-#if CONFIG_NEW_REF_SIGNALING
const int *const ref_order_hints = start_frame_buf->ref_order_hints;
-#else
- const unsigned int *const ref_order_hints = start_frame_buf->ref_order_hints;
-#endif // CONFIG_NEW_REF_SIGNALING
const int cur_order_hint = cm->cur_frame->order_hint;
int start_to_current_frame_offset = get_relative_dist(
order_hint_info, start_frame_order_hint, cur_order_hint);
@@ -163,12 +144,7 @@
mv_ref->ref_frame[1] };
for (int idx = 0; idx < 2; ++idx) {
if (is_inter_ref_frame(ref_frame[idx])) {
-#if CONFIG_NEW_REF_SIGNALING
const int ref_frame_order_hint = ref_order_hints[ref_frame[idx]];
-#else
- const int ref_frame_order_hint =
- ref_order_hints[ref_frame[idx] - LAST_FRAME];
-#endif // #if CONFIG_NEW_REF_SIGNALING
if (ref_frame_order_hint == target_order_hint) {
MV ref_mv = mv_ref->mv[idx].as_mv;
int_mv this_mv;
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 21ad549..ff770b9 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -1315,12 +1315,7 @@
const int mi_col = xd->mi_col;
for (int ref = 0; ref < 1 + has_second_ref(mbmi); ++ref) {
const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
-#if CONFIG_NEW_REF_SIGNALING
if (frame == INTRA_FRAME) {
-#else
- if (frame < LAST_FRAME) {
- assert(frame == INTRA_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
assert(is_intrabc_block(mbmi, xd->tree_type));
assert(ref == 0);
} else {
@@ -3681,11 +3676,7 @@
int width, height;
int found = 0;
int has_valid_ref_frame = 0;
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (aom_rb_read_bit(rb)) {
const RefCntBuffer *const ref_buf = get_ref_frame_buf(cm, i);
// This will never be NULL in a normal stream, as streams are required to
@@ -3725,13 +3716,9 @@
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Invalid frame size");
- // Check to make sure at least one of frames that this frame references has
- // valid dimensions.
-#if CONFIG_NEW_REF_SIGNALING
+ // Check to make sure at least one of frames that this frame references has
+ // valid dimensions.
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const ref_frame = get_ref_frame_buf(cm, i);
has_valid_ref_frame |=
valid_ref_frame_size(ref_frame->buf.y_crop_width,
@@ -3740,11 +3727,7 @@
if (!has_valid_ref_frame)
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Referenced frame has invalid size");
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const ref_frame = get_ref_frame_buf(cm, i);
if (!valid_ref_frame_img_fmt(
ref_frame->buf.bit_depth, ref_frame->buf.subsampling_x,
@@ -6064,7 +6047,6 @@
#if CONFIG_REF_MV_BANK
seq_params->enable_refmvbank = aom_rb_read_bit(rb);
#endif // CONFIG_REF_MV_BANK
-#if CONFIG_NEW_REF_SIGNALING
seq_params->explicit_ref_frame_map = aom_rb_read_bit(rb);
// A bit is sent here to indicate if the max number of references is 7. If
// this bit is 0, then two more bits are sent to indicate the exact number
@@ -6077,7 +6059,6 @@
#if CONFIG_ALLOW_SAME_REF_COMPOUND
seq_params->num_same_ref_compound = aom_rb_read_literal(rb, 2);
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#endif // CONFIG_NEW_REF_SIGNALING
seq_params->enable_sdp = aom_rb_read_bit(rb);
#if CONFIG_IST
seq_params->enable_ist = aom_rb_read_bit(rb);
@@ -6232,11 +6213,7 @@
static AOM_INLINE void read_global_motion(AV1_COMMON *cm,
struct aom_read_bit_buffer *rb) {
-#if CONFIG_NEW_REF_SIGNALING
for (int frame = 0; frame < cm->ref_frames_info.num_total_refs; ++frame) {
-#else
- for (int frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
-#endif // CONFIG_NEW_REF_SIGNALING
const WarpedMotionParams *ref_params =
cm->prev_frame ? &cm->prev_frame->global_motion[frame]
: &default_warp_params;
@@ -6278,13 +6255,8 @@
cm->global_motion[frame].wmmat[3]);
*/
}
-#if CONFIG_NEW_REF_SIGNALING
memcpy(cm->cur_frame->global_motion, cm->global_motion,
INTER_REFS_PER_FRAME * sizeof(WarpedMotionParams));
-#else
- memcpy(cm->cur_frame->global_motion, cm->global_motion,
- REF_FRAMES * sizeof(WarpedMotionParams));
-#endif // CONFIG_NEW_REF_SIGNALING
}
// Release the references to the frame buffers in cm->ref_frame_map and reset
@@ -6364,7 +6336,6 @@
if (current_frame->frame_type == KEY_FRAME && cm->show_existing_frame)
return 0;
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_DISPLAY_ORDER_HINT_FIX
// For key frames, the implicit derivation of display_order_hit is not
// applied.
@@ -6397,9 +6368,6 @@
cur_disp_order_hint += display_order_hint_factor;
}
return cur_disp_order_hint;
-#else
- return current_frame->order_hint;
-#endif // CONFIG_NEW_REF_SIGNALING
}
// On success, returns 0. On failure, calls aom_internal_error and does not
@@ -6769,15 +6737,12 @@
// use a different approach.
cm->ref_frame_map[ref_idx] = buf;
buf->order_hint = order_hint;
-#if CONFIG_NEW_REF_SIGNALING
// TODO(kslu) This is a workaround for error resilient mode. Make
// it more consistent with get_disp_order_hint().
buf->display_order_hint = order_hint;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
}
-#if CONFIG_NEW_REF_SIGNALING
if (features->error_resilient_mode) {
// Read all ref frame base_qindex
for (int ref_idx = 0; ref_idx < REF_FRAMES; ref_idx++) {
@@ -6787,7 +6752,6 @@
: QINDEX_BITS);
}
}
-#endif // CONFIG_NEW_REF_SIGNALING
}
if (current_frame->frame_type == KEY_FRAME) {
@@ -6841,7 +6805,6 @@
#endif // CONFIG_IBC_SR_EXT
} else if (pbi->need_resync != 1) { /* Skip if need resync */
-#if CONFIG_NEW_REF_SIGNALING
// Implicitly derive the reference mapping
RefFrameMapPair ref_frame_map_pairs[REF_FRAMES];
init_ref_map_pair(cm, ref_frame_map_pairs,
@@ -6853,39 +6816,7 @@
AOMMIN(cm->seq_params.num_same_ref_compound,
cm->ref_frames_info.num_total_refs);
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#else
- int frame_refs_short_signaling = 0;
- // Frame refs short signaling is off when error resilient mode is on.
- if (seq_params->order_hint_info.enable_order_hint)
- frame_refs_short_signaling = aom_rb_read_bit(rb);
- if (frame_refs_short_signaling) {
- // == LAST_FRAME ==
- const int lst_ref = aom_rb_read_literal(rb, REF_FRAMES_LOG2);
- const RefCntBuffer *const lst_buf = cm->ref_frame_map[lst_ref];
-
- // == GOLDEN_FRAME ==
- const int gld_ref = aom_rb_read_literal(rb, REF_FRAMES_LOG2);
- const RefCntBuffer *const gld_buf = cm->ref_frame_map[gld_ref];
-
- // Most of the time, streams start with a keyframe. In that case,
- // ref_frame_map will have been filled in at that point and will not
- // contain any NULLs. However, streams are explicitly allowed to start
- // with an intra-only frame, so long as they don't then signal a
- // reference to a slot that hasn't been set yet. That's what we are
- // checking here.
- if (lst_buf == NULL)
- aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
- "Inter frame requests nonexistent reference");
- if (gld_buf == NULL)
- aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
- "Inter frame requests nonexistent reference");
-
- av1_set_frame_refs(cm, cm->remapped_ref_idx, lst_ref, gld_ref);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
-
-#if CONFIG_NEW_REF_SIGNALING
// Reference rankings have been implicitly derived in av1_get_ref_frames.
// However, reference indices can be overwritten if they have been
// signaled, which happens in error resilient mode or when order hint
@@ -6904,12 +6835,6 @@
if (cm->ref_frame_map[ref] == NULL)
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Inter frame requests nonexistent reference");
-#else
- for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
- int ref = 0;
- if (frame_refs_short_signaling) {
- ref = cm->remapped_ref_idx[i];
-#endif // CONFIG_NEW_REF_SIGNALING
} else {
ref = aom_rb_read_literal(rb, REF_FRAMES_LOG2);
@@ -6929,10 +6854,6 @@
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Reference frame not valid for referencing");
-#if !CONFIG_NEW_REF_SIGNALING
- cm->ref_frame_sign_bias[LAST_FRAME + i] = 0;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
if (seq_params->frame_id_numbers_present_flag) {
int frame_id_length = seq_params->frame_id_length;
int diff_len = seq_params->delta_frame_id_length;
@@ -6948,7 +6869,6 @@
"Reference buffer frame ID mismatch");
}
}
-#if CONFIG_NEW_REF_SIGNALING
// With explicit_ref_frame_map, cm->remapped_ref_idx has been
// overwritten. The reference lists also needs to be reset.
if (explicit_ref_frame_map) {
@@ -6964,7 +6884,6 @@
}
av1_get_past_future_cur_ref_lists(cm, scores);
}
-#endif // CONFIG_NEW_REF_SIGNALING
if (!features->error_resilient_mode && frame_size_override_flag) {
setup_frame_size_with_refs(cm, rb);
@@ -7088,14 +7007,9 @@
if (!(current_frame->frame_type == INTRA_ONLY_FRAME) &&
pbi->need_resync != 1) {
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
const RefCntBuffer *const ref_buf = get_ref_frame_buf(cm, i);
if (!ref_buf) continue;
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
- const RefCntBuffer *const ref_buf = get_ref_frame_buf(cm, i);
-#endif // CONFIG_NEW_REF_SIGNALING
struct scale_factors *const ref_scale_factors =
get_ref_scale_factors(cm, i);
av1_setup_scale_factors_for_frame(
@@ -7191,9 +7105,7 @@
cm->quant_params.base_qindex = aom_rb_read_literal(
rb, cm->seq_params.bit_depth == AOM_BITS_8 ? QINDEX_BITS_UNEXT
: QINDEX_BITS);
-#if CONFIG_NEW_REF_SIGNALING
cm->cur_frame->base_qindex = cm->quant_params.base_qindex;
-#endif // CONFIG_NEW_REF_SIGNALING
features->refresh_frame_context = REFRESH_FRAME_CONTEXT_DISABLED;
read_tile_info(pbi, rb);
cm->cur_frame->film_grain_params_present =
@@ -7228,9 +7140,7 @@
CommonQuantParams *const quant_params = &cm->quant_params;
setup_quantization(quant_params, av1_num_planes(cm), cm->seq_params.bit_depth,
cm->seq_params.separate_uv_delta_q, rb);
-#if CONFIG_NEW_REF_SIGNALING
cm->cur_frame->base_qindex = quant_params->base_qindex;
-#endif // CONFIG_NEW_REF_SIGNALING
xd->bd = (int)seq_params->bit_depth;
CommonContexts *const above_contexts = &cm->above_contexts;
@@ -7436,11 +7346,7 @@
av1_copy_tip_frame_tmvp_mvs(cm);
aom_yv12_copy_frame(&cm->tip_ref.tip_frame->buf, &cm->cur_frame->buf,
num_planes);
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
cm->global_motion[i] = default_warp_params;
cm->cur_frame->global_motion[i] = default_warp_params;
}
@@ -7469,11 +7375,7 @@
mismatch_move_frame_idx_r();
#endif
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
cm->global_motion[i] = default_warp_params;
cm->cur_frame->global_motion[i] = default_warp_params;
}
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index cb7fd0a..e1a7dc7 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -869,12 +869,7 @@
if (!is_comp_ref_allowed(xd->mi[0]->sb_type[xd->tree_type == CHROMA_PART]))
return 0;
-#if CONFIG_NEW_REF_SIGNALING
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
-#else
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME) ||
- segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
-#endif // CONFIG_NEW_REF_SIGNALING
// These features imply single-reference mode, while skip mode implies
// compound reference. Hence, the two are mutually exclusive.
// In other words, skip_mode is implicitly 0 here.
@@ -1963,7 +1958,6 @@
}
}
-#if CONFIG_NEW_REF_SIGNALING
static AOM_INLINE void read_single_ref(
MACROBLOCKD *const xd, MV_REFERENCE_FRAME ref_frame[2],
const RefFramesInfo *const ref_frames_info, aom_reader *r) {
@@ -2016,29 +2010,11 @@
if (n_bits < 1) ref_frame[0] = n_refs - 2;
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
}
-#else
-#define READ_REF_BIT(pname) \
- aom_read_symbol(r, av1_get_pred_cdf_##pname(xd), 2, ACCT_STR)
-
-static COMP_REFERENCE_TYPE read_comp_reference_type(const MACROBLOCKD *xd,
- aom_reader *r) {
- const int ctx = av1_get_comp_reference_type_context(xd);
- const COMP_REFERENCE_TYPE comp_ref_type =
- (COMP_REFERENCE_TYPE)aom_read_symbol(
- r, xd->tile_ctx->comp_ref_type_cdf[ctx], 2, ACCT_STR);
- return comp_ref_type; // UNIDIR_COMP_REFERENCE or BIDIR_COMP_REFERENCE
-}
-#endif // CONFIG_NEW_REF_SIGNALING
static void set_ref_frames_for_skip_mode(AV1_COMMON *const cm,
MV_REFERENCE_FRAME ref_frame[2]) {
-#if CONFIG_NEW_REF_SIGNALING
ref_frame[0] = cm->current_frame.skip_mode_info.ref_frame_idx_0;
ref_frame[1] = cm->current_frame.skip_mode_info.ref_frame_idx_1;
-#else
- ref_frame[0] = LAST_FRAME + cm->current_frame.skip_mode_info.ref_frame_idx_0;
- ref_frame[1] = LAST_FRAME + cm->current_frame.skip_mode_info.ref_frame_idx_1;
-#endif // CONFIG_NEW_REF_SIGNALING
}
// Read the reference frame
@@ -2071,102 +2047,17 @@
if (is_tip_ref_frame(ref_frame[0])) return;
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
ref_frame[0] = get_closest_pastcur_ref_index(cm);
ref_frame[1] = NONE_FRAME;
-#else
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
- ref_frame[0] = (MV_REFERENCE_FRAME)get_segdata(&cm->seg, segment_id,
- SEG_LVL_REF_FRAME);
- ref_frame[1] = NONE_FRAME;
- } else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
- segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
- ref_frame[0] = LAST_FRAME;
- ref_frame[1] = NONE_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
} else {
const REFERENCE_MODE mode = read_block_reference_mode(cm, xd, r);
if (mode == COMPOUND_REFERENCE) {
-#if CONFIG_NEW_REF_SIGNALING
read_compound_ref(xd, ref_frame, &cm->ref_frames_info, r);
-#else
- const COMP_REFERENCE_TYPE comp_ref_type = read_comp_reference_type(xd, r);
-
- if (comp_ref_type == UNIDIR_COMP_REFERENCE) {
- const int bit = READ_REF_BIT(uni_comp_ref_p);
- if (bit) {
- ref_frame[0] = BWDREF_FRAME;
- ref_frame[1] = ALTREF_FRAME;
- } else {
- const int bit1 = READ_REF_BIT(uni_comp_ref_p1);
- if (bit1) {
- const int bit2 = READ_REF_BIT(uni_comp_ref_p2);
- if (bit2) {
- ref_frame[0] = LAST_FRAME;
- ref_frame[1] = GOLDEN_FRAME;
- } else {
- ref_frame[0] = LAST_FRAME;
- ref_frame[1] = LAST3_FRAME;
- }
- } else {
- ref_frame[0] = LAST_FRAME;
- ref_frame[1] = LAST2_FRAME;
- }
- }
-
- return;
- }
-
- assert(comp_ref_type == BIDIR_COMP_REFERENCE);
-
- const int idx = 1;
- const int bit = READ_REF_BIT(comp_ref_p);
- // Decode forward references.
- if (!bit) {
- const int bit1 = READ_REF_BIT(comp_ref_p1);
- ref_frame[!idx] = bit1 ? LAST2_FRAME : LAST_FRAME;
- } else {
- const int bit2 = READ_REF_BIT(comp_ref_p2);
- ref_frame[!idx] = bit2 ? GOLDEN_FRAME : LAST3_FRAME;
- }
-
- // Decode backward references.
- const int bit_bwd = READ_REF_BIT(comp_bwdref_p);
- if (!bit_bwd) {
- const int bit1_bwd = READ_REF_BIT(comp_bwdref_p1);
- ref_frame[idx] = bit1_bwd ? ALTREF2_FRAME : BWDREF_FRAME;
- } else {
- ref_frame[idx] = ALTREF_FRAME;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
} else if (mode == SINGLE_REFERENCE) {
-#if CONFIG_NEW_REF_SIGNALING
read_single_ref(xd, ref_frame, &cm->ref_frames_info, r);
-#else
- const int bit0 = READ_REF_BIT(single_ref_p1);
- if (bit0) {
- const int bit1 = READ_REF_BIT(single_ref_p2);
- if (!bit1) {
- const int bit5 = READ_REF_BIT(single_ref_p6);
- ref_frame[0] = bit5 ? ALTREF2_FRAME : BWDREF_FRAME;
- } else {
- ref_frame[0] = ALTREF_FRAME;
- }
- } else {
- const int bit2 = READ_REF_BIT(single_ref_p3);
- if (bit2) {
- const int bit4 = READ_REF_BIT(single_ref_p5);
- ref_frame[0] = bit4 ? GOLDEN_FRAME : LAST3_FRAME;
- } else {
- const int bit3 = READ_REF_BIT(single_ref_p4);
- ref_frame[0] = bit3 ? LAST2_FRAME : LAST_FRAME;
- }
- }
-
-#endif // CONFIG_NEW_REF_SIGNALING
ref_frame[1] = NONE_FRAME;
} else {
assert(0 && "Invalid prediction mode.");
@@ -2623,13 +2514,6 @@
const int skip_txfm
#endif // CONFIG_CONTEXT_DERIVATION
) {
-#if !CONFIG_NEW_REF_SIGNALING
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
- const int frame = get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
- if (frame < LAST_FRAME) return 0;
- return frame != INTRA_FRAME;
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
return 1;
}
diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c
index ffac997..56b05f5 100644
--- a/av1/decoder/decoder.c
+++ b/av1/decoder/decoder.c
@@ -546,12 +546,8 @@
// TODO(jkoleszar): Error concealment is undefined and non-normative
// at this point, but if it becomes so, [0] may not always be the correct
// thing to do here.
-#if CONFIG_NEW_REF_SIGNALING
const int last_frame = get_closest_pastcur_ref_index(cm);
RefCntBuffer *ref_buf = get_ref_frame_buf(cm, last_frame);
-#else
- RefCntBuffer *ref_buf = get_ref_frame_buf(cm, LAST_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
if (ref_buf != NULL) ref_buf->buf.corrupted = 1;
}
diff --git a/av1/encoder/aq_complexity.c b/av1/encoder/aq_complexity.c
index 0dea610..bbf9a1e 100644
--- a/av1/encoder/aq_complexity.c
+++ b/av1/encoder/aq_complexity.c
@@ -50,16 +50,9 @@
static bool is_frame_aq_enabled(const AV1_COMP *const cpi) {
const AV1_COMMON *const cm = &cpi->common;
-#if CONFIG_NEW_REF_SIGNALING
(void)cm;
// TODO(kslu) enable this for nrs
return 0;
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
- return frame_is_intra_only(cm) || cm->features.error_resilient_mode ||
- refresh_frame_flags->alt_ref_frame ||
- (refresh_frame_flags->golden_frame && !cpi->rc.is_src_frame_alt_ref);
-#endif // CONFIG_NEW_REF_SIGNALING
}
// Segmentation only makes sense if the target bits per SB is above a threshold.
diff --git a/av1/encoder/aq_cyclicrefresh.c b/av1/encoder/aq_cyclicrefresh.c
index 6602c20..dec9b59 100644
--- a/av1/encoder/aq_cyclicrefresh.c
+++ b/av1/encoder/aq_cyclicrefresh.c
@@ -389,12 +389,6 @@
cr->percent_refresh = 10;
cr->rate_ratio_qdelta = 1.5;
cr->rate_boost_fac = 10;
-#if !CONFIG_NEW_REF_SIGNALING
- if (cpi->refresh_frame.golden_frame) {
- cr->percent_refresh = 0;
- cr->rate_ratio_qdelta = 1.0;
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
}
// Weight for segment prior to encoding: take the average of the target
// number for the frame to be encoded and the actual from the previous frame.
@@ -511,8 +505,5 @@
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
memset(cr->map, 0, cm->mi_params.mi_rows * cm->mi_params.mi_cols);
cr->sb_index = 0;
-#if !CONFIG_NEW_REF_SIGNALING
- cpi->refresh_frame.golden_frame = true;
-#endif // !CONFIG_NEW_REF_SIGNALING
cr->apply_cyclic_refresh = 0;
}
diff --git a/av1/encoder/aq_variance.c b/av1/encoder/aq_variance.c
index 8fb9378..87cb76d 100644
--- a/av1/encoder/aq_variance.c
+++ b/av1/encoder/aq_variance.c
@@ -43,9 +43,6 @@
void av1_vaq_frame_setup(AV1_COMP *cpi) {
AV1_COMMON *cm = &cpi->common;
-#if !CONFIG_NEW_REF_SIGNALING
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // !CONFIG_NEW_REF_SIGNALING
const int base_qindex = cm->quant_params.base_qindex;
struct segmentation *seg = &cm->seg;
int i;
@@ -66,13 +63,7 @@
av1_disable_segmentation(seg);
return;
}
-#if CONFIG_NEW_REF_SIGNALING
if (frame_is_intra_only(cm) || cm->features.error_resilient_mode) {
-#else
- if (frame_is_intra_only(cm) || cm->features.error_resilient_mode ||
- refresh_frame_flags->alt_ref_frame ||
- (refresh_frame_flags->golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
-#endif // CONFIG_NEW_REF_SIGNALING
cpi->vaq_refresh = 1;
av1_enable_segmentation(seg);
diff --git a/av1/encoder/av1_quantize.c b/av1/encoder/av1_quantize.c
index 9b16a19..2054fe4 100644
--- a/av1/encoder/av1_quantize.c
+++ b/av1/encoder/av1_quantize.c
@@ -553,9 +553,7 @@
// delta_q changes.
CommonQuantParams *quant_params = &cm->quant_params;
quant_params->base_qindex = AOMMAX(cm->delta_q_info.delta_q_present_flag, q);
-#if CONFIG_NEW_REF_SIGNALING
cm->cur_frame->base_qindex = quant_params->base_qindex;
-#endif // CONFIG_NEW_REF_SIGNALING
set_frame_dc_delta_q(cm, &quant_params->y_dc_delta_q, enable_chroma_deltaq,
&quant_params->u_dc_delta_q, &quant_params->v_dc_delta_q,
&quant_params->u_ac_delta_q,
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 9bae37a..57fec3f 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -380,12 +380,7 @@
assert(!skip_mode);
return 0;
}
-#if CONFIG_NEW_REF_SIGNALING
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
-#else
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME) ||
- segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
-#endif // CONFIG_NEW_REF_SIGNALING
// These features imply single-reference mode, while skip mode implies
// compound reference. Hence, the two are mutually exclusive.
// In other words, skip_mode is implicitly 0 here.
@@ -405,23 +400,17 @@
const int skip_txfm
#endif // CONFIG_CONTEXT_DERIVATION
) {
-#if !CONFIG_NEW_REF_SIGNALING
- if (!segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
-#endif // !CONFIG_NEW_REF_SIGNALING
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
- assert(is_inter);
- return;
- }
- const int ctx = av1_get_intra_inter_context(xd);
- FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
+ if (segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
+ assert(is_inter);
+ return;
+ }
+ const int ctx = av1_get_intra_inter_context(xd);
+ FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#if CONFIG_CONTEXT_DERIVATION
- aom_write_symbol(w, is_inter, ec_ctx->intra_inter_cdf[skip_txfm][ctx], 2);
+ aom_write_symbol(w, is_inter, ec_ctx->intra_inter_cdf[skip_txfm][ctx], 2);
#else
aom_write_symbol(w, is_inter, ec_ctx->intra_inter_cdf[ctx], 2);
#endif // CONFIG_CONTEXT_DERIVATION
-#if !CONFIG_NEW_REF_SIGNALING
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
}
#if CONFIG_WEDGE_MOD_EXT
@@ -907,7 +896,6 @@
mi_col, mbmi->segment_id);
}
-#if CONFIG_NEW_REF_SIGNALING
static AOM_INLINE void write_single_ref(
const MACROBLOCKD *xd, const RefFramesInfo *const ref_frames_info,
aom_writer *w) {
@@ -966,10 +954,6 @@
assert(IMPLIES(n_bits < 1, AOMMIN(ref0, ref1) == n_refs - 2));
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
}
-#else
-#define WRITE_REF_BIT(bname, pname) \
- aom_write_symbol(w, bname, av1_get_pred_cdf_##pname(xd), 2)
-#endif // CONFIG_NEW_REF_SIGNALING
// This function encodes the reference frame
static AOM_INLINE void write_ref_frames(const AV1_COMMON *cm,
@@ -980,19 +964,9 @@
// If segment level coding of this signal is disabled...
// or the segment allows multiple reference frame options
-#if CONFIG_NEW_REF_SIGNALING
if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
assert(mbmi->ref_frame[0] == get_closest_pastcur_ref_index(cm));
-#else
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
- assert(!is_compound);
- assert(mbmi->ref_frame[0] ==
- get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME));
- } else if (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
- segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
- assert(mbmi->ref_frame[0] == LAST_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
assert(!is_compound);
} else {
// does the feature use compound prediction or not
@@ -1006,86 +980,9 @@
}
if (is_compound) {
-#if CONFIG_NEW_REF_SIGNALING
write_compound_ref(xd, &cm->ref_frames_info, w);
-#else
- const COMP_REFERENCE_TYPE comp_ref_type = has_uni_comp_refs(mbmi)
- ? UNIDIR_COMP_REFERENCE
- : BIDIR_COMP_REFERENCE;
- aom_write_symbol(w, comp_ref_type, av1_get_comp_reference_type_cdf(xd),
- 2);
-
- if (comp_ref_type == UNIDIR_COMP_REFERENCE) {
- const int bit = mbmi->ref_frame[0] == BWDREF_FRAME;
- WRITE_REF_BIT(bit, uni_comp_ref_p);
-
- if (!bit) {
- assert(mbmi->ref_frame[0] == LAST_FRAME);
- const int bit1 = mbmi->ref_frame[1] == LAST3_FRAME ||
- mbmi->ref_frame[1] == GOLDEN_FRAME;
- WRITE_REF_BIT(bit1, uni_comp_ref_p1);
- if (bit1) {
- const int bit2 = mbmi->ref_frame[1] == GOLDEN_FRAME;
- WRITE_REF_BIT(bit2, uni_comp_ref_p2);
- }
- } else {
- assert(mbmi->ref_frame[1] == ALTREF_FRAME);
- }
-
- return;
- }
-
- assert(comp_ref_type == BIDIR_COMP_REFERENCE);
-
- const int bit = (mbmi->ref_frame[0] == GOLDEN_FRAME ||
- mbmi->ref_frame[0] == LAST3_FRAME);
- WRITE_REF_BIT(bit, comp_ref_p);
-
- if (!bit) {
- const int bit1 = mbmi->ref_frame[0] == LAST2_FRAME;
- WRITE_REF_BIT(bit1, comp_ref_p1);
- } else {
- const int bit2 = mbmi->ref_frame[0] == GOLDEN_FRAME;
- WRITE_REF_BIT(bit2, comp_ref_p2);
- }
-
- const int bit_bwd = mbmi->ref_frame[1] == ALTREF_FRAME;
- WRITE_REF_BIT(bit_bwd, comp_bwdref_p);
-
- if (!bit_bwd) {
- WRITE_REF_BIT(mbmi->ref_frame[1] == ALTREF2_FRAME, comp_bwdref_p1);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
-
} else {
-#if CONFIG_NEW_REF_SIGNALING
write_single_ref(xd, &cm->ref_frames_info, w);
-#else
- const int bit0 = (mbmi->ref_frame[0] <= ALTREF_FRAME &&
- mbmi->ref_frame[0] >= BWDREF_FRAME);
- WRITE_REF_BIT(bit0, single_ref_p1);
-
- if (bit0) {
- const int bit1 = mbmi->ref_frame[0] == ALTREF_FRAME;
- WRITE_REF_BIT(bit1, single_ref_p2);
-
- if (!bit1) {
- WRITE_REF_BIT(mbmi->ref_frame[0] == ALTREF2_FRAME, single_ref_p6);
- }
- } else {
- const int bit2 = (mbmi->ref_frame[0] == LAST3_FRAME ||
- mbmi->ref_frame[0] == GOLDEN_FRAME);
- WRITE_REF_BIT(bit2, single_ref_p3);
-
- if (!bit2) {
- const int bit3 = mbmi->ref_frame[0] != LAST_FRAME;
- WRITE_REF_BIT(bit3, single_ref_p4);
- } else {
- const int bit4 = mbmi->ref_frame[0] != LAST3_FRAME;
- WRITE_REF_BIT(bit4, single_ref_p5);
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
}
@@ -4321,11 +4218,7 @@
int found = 0;
MV_REFERENCE_FRAME ref_frame;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
-#endif // CONFIG_NEW_REF_SIGNALING
const YV12_BUFFER_CONFIG *cfg = get_ref_frame_yv12_buf(cm, ref_frame);
if (cfg != NULL) {
@@ -4499,13 +4392,8 @@
if (!pars->update_parameters) {
int ref_frame, ref_idx;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ref_frame++) {
ref_idx = get_ref_frame_map_idx(cm, ref_frame);
-#else
- for (ref_frame = LAST_FRAME; ref_frame < REF_FRAMES; ref_frame++) {
- ref_idx = get_ref_frame_map_idx(cm, ref_frame);
-#endif // CONFIG_NEW_REF_SIGNALING
assert(ref_idx != INVALID_IDX);
const RefCntBuffer *const buf = cm->ref_frame_map[ref_idx];
if (buf->film_grain_params_present &&
@@ -4703,7 +4591,6 @@
#if CONFIG_REF_MV_BANK
aom_wb_write_bit(wb, seq_params->enable_refmvbank);
#endif // CONFIG_REF_MV_BANK
-#if CONFIG_NEW_REF_SIGNALING
aom_wb_write_bit(wb, seq_params->explicit_ref_frame_map);
// A bit is sent here to indicate if the max number of references is 7. If
// this bit is 0, then two more bits are sent to indicate the exact number
@@ -4714,7 +4601,6 @@
#if CONFIG_ALLOW_SAME_REF_COMPOUND
aom_wb_write_literal(wb, seq_params->num_same_ref_compound, 2);
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#endif // CONFIG_NEW_REF_SIGNALING
aom_wb_write_bit(wb, seq_params->enable_sdp);
#if CONFIG_IST
aom_wb_write_bit(wb, seq_params->enable_ist);
@@ -4843,11 +4729,7 @@
struct aom_write_bit_buffer *wb) {
AV1_COMMON *const cm = &cpi->common;
int frame;
-#if CONFIG_NEW_REF_SIGNALING
for (frame = 0; frame < cm->ref_frames_info.num_total_refs; ++frame) {
-#else
- for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
-#endif // CONFIG_NEW_REF_SIGNALING
const WarpedMotionParams *ref_params =
cm->prev_frame ? &cm->prev_frame->global_motion[frame]
: &default_warp_params;
@@ -4882,76 +4764,6 @@
}
}
-#if !CONFIG_NEW_REF_SIGNALING
-static int check_frame_refs_short_signaling(AV1_COMMON *const cm) {
- // Check whether all references are distinct frames.
- const RefCntBuffer *seen_bufs[FRAME_BUFFERS] = { NULL };
- int num_refs = 0;
- for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
- if (buf != NULL) {
- int seen = 0;
- for (int i = 0; i < num_refs; i++) {
- if (seen_bufs[i] == buf) {
- seen = 1;
- break;
- }
- }
- if (!seen) seen_bufs[num_refs++] = buf;
- }
- }
-
- // We only turn on frame_refs_short_signaling when all references are
- // distinct.
- if (num_refs < INTER_REFS_PER_FRAME) {
- // It indicates that there exist more than one reference frame pointing to
- // the same reference buffer, i.e. two or more references are duplicate.
- return 0;
- }
-
- // Check whether the encoder side ref frame choices are aligned with that to
- // be derived at the decoder side.
- int remapped_ref_idx_decoder[REF_FRAMES];
-
- const int lst_map_idx = get_ref_frame_map_idx(cm, LAST_FRAME);
- const int gld_map_idx = get_ref_frame_map_idx(cm, GOLDEN_FRAME);
-
- // Set up the frame refs mapping indexes according to the
- // frame_refs_short_signaling policy.
- av1_set_frame_refs(cm, remapped_ref_idx_decoder, lst_map_idx, gld_map_idx);
-
- // We only turn on frame_refs_short_signaling when the encoder side decision
- // on ref frames is identical to that at the decoder side.
- int frame_refs_short_signaling = 1;
- for (int ref_idx = 0; ref_idx < INTER_REFS_PER_FRAME; ++ref_idx) {
- // Compare the buffer index between two reference frames indexed
- // respectively by the encoder and the decoder side decisions.
- RefCntBuffer *ref_frame_buf_new = NULL;
- if (remapped_ref_idx_decoder[ref_idx] != INVALID_IDX) {
- ref_frame_buf_new = cm->ref_frame_map[remapped_ref_idx_decoder[ref_idx]];
- }
- if (get_ref_frame_buf(cm, LAST_FRAME + ref_idx) != ref_frame_buf_new) {
- frame_refs_short_signaling = 0;
- break;
- }
- }
-
-#if 0 // For debug
- printf("\nFrame=%d: \n", cm->current_frame.frame_number);
- printf("***frame_refs_short_signaling=%d\n", frame_refs_short_signaling);
- for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- printf("enc_ref(map_idx=%d)=%d, vs. "
- "dec_ref(map_idx=%d)=%d\n",
- get_ref_frame_map_idx(cm, ref_frame), ref_frame,
- cm->remapped_ref_idx[ref_frame - LAST_FRAME],
- ref_frame);
- }
-#endif // 0
-
- return frame_refs_short_signaling;
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
// New function based on HLS R18
static AOM_INLINE void write_uncompressed_header_obu(
AV1_COMP *cpi, struct aom_write_bit_buffer *saved_wb,
@@ -4963,10 +4775,6 @@
CurrentFrame *const current_frame = &cm->current_frame;
FeatureFlags *const features = &cm->features;
-#if !CONFIG_NEW_REF_SIGNALING
- current_frame->frame_refs_short_signaling = 0;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
if (seq_params->still_picture) {
assert(cm->show_existing_frame == 0);
assert(cm->show_frame == 1);
@@ -5109,7 +4917,6 @@
seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
}
}
-#if CONFIG_NEW_REF_SIGNALING
// Write all ref frame base_qindex if error_resilient_mode == 1. This is
// required by reference mapping.
if (features->error_resilient_mode) {
@@ -5120,7 +4927,6 @@
: QINDEX_BITS);
}
}
-#endif // CONFIG_NEW_REF_SIGNALING
}
if (current_frame->frame_type == KEY_FRAME) {
@@ -5172,29 +4978,6 @@
seq_params->order_hint_info.enable_order_hint;
#endif // FRAME_REFS_SHORT_SIGNALING
-#if !CONFIG_NEW_REF_SIGNALING
- if (current_frame->frame_refs_short_signaling) {
- // NOTE(zoeliu@google.com):
- // An example solution for encoder-side implementation on frame refs
- // short signaling, which is only turned on when the encoder side
- // decision on ref frames is identical to that at the decoder side.
- current_frame->frame_refs_short_signaling =
- check_frame_refs_short_signaling(cm);
- }
-
- if (seq_params->order_hint_info.enable_order_hint)
- aom_wb_write_bit(wb, current_frame->frame_refs_short_signaling);
-
- if (current_frame->frame_refs_short_signaling) {
- const int lst_ref = get_ref_frame_map_idx(cm, LAST_FRAME);
- aom_wb_write_literal(wb, lst_ref, REF_FRAMES_LOG2);
-
- const int gld_ref = get_ref_frame_map_idx(cm, GOLDEN_FRAME);
- aom_wb_write_literal(wb, gld_ref, REF_FRAMES_LOG2);
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
-
-#if CONFIG_NEW_REF_SIGNALING
// By default, no need to signal ref mapping indices in NRS because
// decoder can derive them unless order_hint is not available. Explicit
// signaling happens only when enabled by the command line flag or in
@@ -5212,13 +4995,6 @@
if (explicit_ref_frame_map)
aom_wb_write_literal(wb, get_ref_frame_map_idx(cm, ref_frame),
REF_FRAMES_LOG2);
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- assert(get_ref_frame_map_idx(cm, ref_frame) != INVALID_IDX);
- if (!current_frame->frame_refs_short_signaling)
- aom_wb_write_literal(wb, get_ref_frame_map_idx(cm, ref_frame),
- REF_FRAMES_LOG2);
-#endif // CONFIG_NEW_REF_SIGNALING
if (seq_params->frame_id_numbers_present_flag) {
int i = get_ref_frame_map_idx(cm, ref_frame);
int frame_id_len = seq_params->frame_id_length;
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index ed8e706..bb207ee 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -243,11 +243,7 @@
//! Number of ref mvs in the drl.
uint8_t ref_mv_count[MODE_CTX_REF_FRAMES];
//! Global mvs
-#if CONFIG_NEW_REF_SIGNALING
int_mv global_mvs[INTER_REFS_PER_FRAME];
-#else
- int_mv global_mvs[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
//! skip_mvp_candidate_list is the MVP list for skip mode.
#if CONFIG_SKIP_MODE_DRL_WITH_REF_IDX
SKIP_MODE_MVP_LIST skip_mvp_candidate_list;
@@ -284,11 +280,7 @@
#endif
// TODO(Ravi/Remya): Reduce the buffer size of global_mvs
//! \copydoc MB_MODE_INFO_EXT::global_mvs
-#if CONFIG_NEW_REF_SIGNALING
int_mv global_mvs[INTER_REFS_PER_FRAME];
-#else
- int_mv global_mvs[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
//! \copydoc MB_MODE_INFO_EXT::mode_context
int16_t mode_context;
//! Offset of current coding block's coeff buffer relative to the sb.
@@ -903,7 +895,6 @@
* \name Inter Costs: Ref Frame Types
****************************************************************************/
/**@{*/
-#if CONFIG_NEW_REF_SIGNALING
//! single_ref_cost
int single_ref_cost[REF_CONTEXTS][INTER_REFS_PER_FRAME - 1][2];
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -918,26 +909,6 @@
int comp_ref1_cost[REF_CONTEXTS][COMPREF_BIT_TYPES][INTER_REFS_PER_FRAME - 2]
[2];
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#else
- //! single_ref_cost
- int single_ref_cost[REF_CONTEXTS][SINGLE_REFS - 1][2];
- //! comp_ref_type_cost
- int comp_ref_type_cost[COMP_REF_TYPE_CONTEXTS]
- [CDF_SIZE(COMP_REFERENCE_TYPES)];
- //! uni_comp_ref_cost
- int uni_comp_ref_cost[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_REFS - 1]
- [CDF_SIZE(2)];
- /*! \brief Cost for signaling ref_frame[0] in bidir-comp mode
- *
- * Includes LAST_FRAME, LAST2_FRAME, LAST3_FRAME, and GOLDEN_FRAME.
- */
- int comp_ref_cost[REF_CONTEXTS][FWD_REFS - 1][2];
- /*! \brief Cost for signaling ref_frame[1] in bidir-comp mode
- *
- * Includes ALTREF_FRAME, ALTREF2_FRAME, and BWDREF_FRAME.
- */
- int comp_bwdref_cost[REF_CONTEXTS][BWD_REFS - 1][2];
-#endif // CONFIG_NEW_REF_SIGNALING
//! comp_inter_cost
int comp_inter_cost[COMP_INTER_CONTEXTS][2];
#if CONFIG_TIP
@@ -1521,11 +1492,7 @@
* current mode. If the current best rd is already <= threshold, then we skip
* the current mode.
*/
-#if CONFIG_NEW_REF_SIGNALING
int thresh_freq_fact[BLOCK_SIZES_ALL][MB_MODE_COUNT];
-#else
- int thresh_freq_fact[BLOCK_SIZES_ALL][MAX_MODES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*! \brief Tracks the winner modes in the current coding block.
*
diff --git a/av1/encoder/context_tree.c b/av1/encoder/context_tree.c
index 0df98ff..f8e4822 100644
--- a/av1/encoder/context_tree.c
+++ b/av1/encoder/context_tree.c
@@ -30,9 +30,6 @@
dst_ctx->num_4x4_blk = src_ctx->num_4x4_blk;
dst_ctx->skippable = src_ctx->skippable;
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- dst_ctx->best_mode_index = src_ctx->best_mode_index;
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
memcpy(dst_ctx->blk_skip, src_ctx->blk_skip,
sizeof(uint8_t) * src_ctx->num_4x4_blk);
diff --git a/av1/encoder/context_tree.h b/av1/encoder/context_tree.h
index 1e47b97..83e5573 100644
--- a/av1/encoder/context_tree.h
+++ b/av1/encoder/context_tree.h
@@ -56,9 +56,6 @@
// For current partition, only if all Y, U, and V transform blocks'
// coefficients are quantized to 0, skippable is set to 1.
int skippable;
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- THR_MODES best_mode_index;
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
int hybrid_pred_diff;
int comp_pred_diff;
int single_pred_diff;
diff --git a/av1/encoder/enc_enums.h b/av1/encoder/enc_enums.h
index b7cfe92..ed810f2 100644
--- a/av1/encoder/enc_enums.h
+++ b/av1/encoder/enc_enums.h
@@ -17,490 +17,6 @@
extern "C" {
#endif
-#if !CONFIG_NEW_REF_SIGNALING
-// This enumerator type needs to be kept aligned with the mode order in
-// const MODE_DEFINITION av1_mode_defs[MAX_MODES] used in the rd code.
-enum {
- THR_NEARMV,
- THR_NEARL2,
- THR_NEARL3,
- THR_NEARB,
- THR_NEARA2,
- THR_NEARA,
- THR_NEARG,
-
- THR_NEWMV,
- THR_NEWL2,
- THR_NEWL3,
- THR_NEWB,
- THR_NEWA2,
- THR_NEWA,
- THR_NEWG,
-
- THR_GLOBALMV,
- THR_GLOBALL2,
- THR_GLOBALL3,
- THR_GLOBALB,
- THR_GLOBALA2,
- THR_GLOBALG,
- THR_GLOBALA,
-
-#if IMPROVED_AMVD
- THR_AMVDNEWMV,
- THR_AMVDNEWL2,
- THR_AMVDNEWL3,
- THR_AMVDNEWB,
- THR_AMVDNEWA2,
- THR_AMVDNEWG,
- THR_AMVDNEWA,
-#endif // IMPROVED_AMVD
-
- THR_COMP_NEAR_NEARLA,
- THR_COMP_NEAR_NEARL2A,
- THR_COMP_NEAR_NEARL3A,
- THR_COMP_NEAR_NEARGA,
- THR_COMP_NEAR_NEARLB,
- THR_COMP_NEAR_NEARL2B,
- THR_COMP_NEAR_NEARL3B,
- THR_COMP_NEAR_NEARGB,
- THR_COMP_NEAR_NEARLA2,
- THR_COMP_NEAR_NEARL2A2,
- THR_COMP_NEAR_NEARL3A2,
- THR_COMP_NEAR_NEARGA2,
- THR_COMP_NEAR_NEARLL2,
- THR_COMP_NEAR_NEARLL3,
- THR_COMP_NEAR_NEARLG,
- THR_COMP_NEAR_NEARBA,
-
- THR_COMP_NEW_NEARLA,
- THR_COMP_NEAR_NEWLA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLA,
- THR_COMP_GLOBAL_GLOBALLA,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLA,
- THR_COMP_NEAR_NEW_OPTFLOWLA,
- THR_COMP_NEW_NEAR_OPTFLOWLA,
- THR_COMP_NEW_NEW_OPTFLOWLA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL2A,
- THR_COMP_NEAR_NEWL2A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL2A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL2A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL2A,
- THR_COMP_GLOBAL_GLOBALL2A,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL2A,
- THR_COMP_NEAR_NEW_OPTFLOWL2A,
- THR_COMP_NEW_NEAR_OPTFLOWL2A,
- THR_COMP_NEW_NEW_OPTFLOWL2A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL2A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL3A,
- THR_COMP_NEAR_NEWL3A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL3A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL3A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL3A,
- THR_COMP_GLOBAL_GLOBALL3A,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL3A,
- THR_COMP_NEAR_NEW_OPTFLOWL3A,
- THR_COMP_NEW_NEAR_OPTFLOWL3A,
- THR_COMP_NEW_NEW_OPTFLOWL3A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL3A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARGA,
- THR_COMP_NEAR_NEWGA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWGA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWGA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWGA,
- THR_COMP_GLOBAL_GLOBALGA,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWGA,
- THR_COMP_NEAR_NEW_OPTFLOWGA,
- THR_COMP_NEW_NEAR_OPTFLOWGA,
- THR_COMP_NEW_NEW_OPTFLOWGA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWGA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLB,
- THR_COMP_NEAR_NEWLB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLB,
- THR_COMP_GLOBAL_GLOBALLB,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLB,
- THR_COMP_NEAR_NEW_OPTFLOWLB,
- THR_COMP_NEW_NEAR_OPTFLOWLB,
- THR_COMP_NEW_NEW_OPTFLOWLB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL2B,
- THR_COMP_NEAR_NEWL2B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL2B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL2B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL2B,
- THR_COMP_GLOBAL_GLOBALL2B,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL2B,
- THR_COMP_NEAR_NEW_OPTFLOWL2B,
- THR_COMP_NEW_NEAR_OPTFLOWL2B,
- THR_COMP_NEW_NEW_OPTFLOWL2B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL2B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL3B,
- THR_COMP_NEAR_NEWL3B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL3B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL3B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL3B,
- THR_COMP_GLOBAL_GLOBALL3B,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL3B,
- THR_COMP_NEAR_NEW_OPTFLOWL3B,
- THR_COMP_NEW_NEAR_OPTFLOWL3B,
- THR_COMP_NEW_NEW_OPTFLOWL3B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL3B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARGB,
- THR_COMP_NEAR_NEWGB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWGB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWGB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWGB,
- THR_COMP_GLOBAL_GLOBALGB,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWGB,
- THR_COMP_NEAR_NEW_OPTFLOWGB,
- THR_COMP_NEW_NEAR_OPTFLOWGB,
- THR_COMP_NEW_NEW_OPTFLOWGB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWGB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLA2,
- THR_COMP_NEAR_NEWLA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLA2,
- THR_COMP_GLOBAL_GLOBALLA2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLA2,
- THR_COMP_NEAR_NEW_OPTFLOWLA2,
- THR_COMP_NEW_NEAR_OPTFLOWLA2,
- THR_COMP_NEW_NEW_OPTFLOWLA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL2A2,
- THR_COMP_NEAR_NEWL2A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL2A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL2A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL2A2,
- THR_COMP_GLOBAL_GLOBALL2A2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL2A2,
- THR_COMP_NEAR_NEW_OPTFLOWL2A2,
- THR_COMP_NEW_NEAR_OPTFLOWL2A2,
- THR_COMP_NEW_NEW_OPTFLOWL2A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL2A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL3A2,
- THR_COMP_NEAR_NEWL3A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL3A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL3A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL3A2,
- THR_COMP_GLOBAL_GLOBALL3A2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL3A2,
- THR_COMP_NEAR_NEW_OPTFLOWL3A2,
- THR_COMP_NEW_NEAR_OPTFLOWL3A2,
- THR_COMP_NEW_NEW_OPTFLOWL3A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL3A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARGA2,
- THR_COMP_NEAR_NEWGA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWGA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWGA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWGA2,
- THR_COMP_GLOBAL_GLOBALGA2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWGA2,
- THR_COMP_NEAR_NEW_OPTFLOWGA2,
- THR_COMP_NEW_NEAR_OPTFLOWGA2,
- THR_COMP_NEW_NEW_OPTFLOWGA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWGA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLL2,
- THR_COMP_NEAR_NEWLL2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLL2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLL2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLL2,
- THR_COMP_GLOBAL_GLOBALLL2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLL2,
- THR_COMP_NEAR_NEW_OPTFLOWLL2,
- THR_COMP_NEW_NEAR_OPTFLOWLL2,
- THR_COMP_NEW_NEW_OPTFLOWLL2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLL2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLL2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLL3,
- THR_COMP_NEAR_NEWLL3,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLL3,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLL3,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLL3,
- THR_COMP_GLOBAL_GLOBALLL3,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLL3,
- THR_COMP_NEAR_NEW_OPTFLOWLL3,
- THR_COMP_NEW_NEAR_OPTFLOWLL3,
- THR_COMP_NEW_NEW_OPTFLOWLL3,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLL3,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLL3,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLG,
- THR_COMP_NEAR_NEWLG,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLG,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLG,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLG,
- THR_COMP_GLOBAL_GLOBALLG,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLG,
- THR_COMP_NEAR_NEW_OPTFLOWLG,
- THR_COMP_NEW_NEAR_OPTFLOWLG,
- THR_COMP_NEW_NEW_OPTFLOWLG,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLG,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLG,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARBA,
- THR_COMP_NEAR_NEWBA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWBA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWBA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWBA,
- THR_COMP_GLOBAL_GLOBALBA,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWBA,
- THR_COMP_NEAR_NEW_OPTFLOWBA,
- THR_COMP_NEW_NEAR_OPTFLOWBA,
- THR_COMP_NEW_NEW_OPTFLOWBA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWBA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWBA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
-#if CONFIG_TIP
- THR_NEAR_TIP,
- THR_NEW_TIP,
-#if IMPROVED_AMVD
- THR_AMVDNEW_TIP,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_TIP
-
- THR_DC,
- THR_PAETH,
- THR_SMOOTH,
- THR_SMOOTH_V,
- THR_SMOOTH_H,
- THR_H_PRED,
- THR_V_PRED,
- THR_D135_PRED,
- THR_D203_PRED,
- THR_D157_PRED,
- THR_D67_PRED,
- THR_D113_PRED,
- THR_D45_PRED,
-
- MAX_MODES,
- SINGLE_REF_MODE_START = THR_NEARMV,
- SINGLE_REF_MODE_END = THR_COMP_NEAR_NEARLA,
- NUM_SINGLE_REF_MODES = SINGLE_REF_MODE_END - SINGLE_REF_MODE_START,
- THR_MODE_START = THR_NEARMV,
- THR_MODE_END = MAX_MODES,
- THR_INVALID = 255
-} UENUM1BYTE(THR_MODES);
-
-enum {
- THR_LAST,
- THR_LAST2,
- THR_LAST3,
- THR_BWDR,
- THR_ALTR2,
- THR_GOLD,
- THR_ALTR,
-
- THR_COMP_LA,
- THR_COMP_L2A,
- THR_COMP_L3A,
- THR_COMP_GA,
-
- THR_COMP_LB,
- THR_COMP_L2B,
- THR_COMP_L3B,
- THR_COMP_GB,
-
- THR_COMP_LA2,
- THR_COMP_L2A2,
- THR_COMP_L3A2,
- THR_COMP_GA2,
-
- THR_INTRA,
-
- MAX_REFS
-} UENUM1BYTE(THR_MODES_SUB8X8);
-#endif // !CONFIG_NEW_REF_SIGNALING
-
enum {
FULL_TXFM_RD,
LOW_TXFM_RD,
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 6143f21..00ad056 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -42,16 +42,6 @@
#define TEMPORAL_FILTER_KEY_FRAME 1
-#if !CONFIG_NEW_REF_SIGNALING
-static INLINE void set_refresh_frame_flags(
- RefreshFrameFlagsInfo *const refresh_frame_flags, bool refresh_gf,
- bool refresh_bwdref, bool refresh_arf) {
- refresh_frame_flags->golden_frame = refresh_gf;
- refresh_frame_flags->bwd_ref_frame = refresh_bwdref;
- refresh_frame_flags->alt_ref_frame = refresh_arf;
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
// Get the subgop config corresponding to the current frame within the
// gf group
const SubGOPStepCfg *get_subgop_step(const GF_GROUP *const gf_group,
@@ -64,7 +54,6 @@
return &subgop_cfg->step[index - offset];
}
-#if CONFIG_NEW_REF_SIGNALING
void av1_get_ref_frames_enc(AV1_COMMON *cm, int cur_frame_disp,
RefFrameMapPair *ref_frame_map_pairs) {
assert(cm->seq_params.explicit_ref_frame_map);
@@ -95,72 +84,6 @@
default: assert(0); break;
}
}
-#else
-void av1_configure_buffer_updates(
- AV1_COMP *const cpi, RefreshFrameFlagsInfo *const refresh_frame_flags,
- const FRAME_UPDATE_TYPE type, const FRAME_TYPE frame_type,
- int force_refresh_all) {
- // NOTE(weitinglin): Should we define another function to take care of
- // cpi->rc.is_$Source_Type to make this function as it is in the comment?
-
- const ExtRefreshFrameFlagsInfo *const ext_refresh_frame_flags =
- &cpi->ext_flags.refresh_frame;
- cpi->rc.is_src_frame_alt_ref = 0;
-
- switch (type) {
- case KF_UPDATE:
- set_refresh_frame_flags(refresh_frame_flags, true, true, true);
- break;
-
- case LF_UPDATE:
- set_refresh_frame_flags(refresh_frame_flags, false, false, false);
- break;
-
- case GF_UPDATE:
- set_refresh_frame_flags(refresh_frame_flags, true, false, false);
- break;
-
- case OVERLAY_UPDATE:
- case KFFLT_OVERLAY_UPDATE:
- set_refresh_frame_flags(refresh_frame_flags, true, false, false);
- cpi->rc.is_src_frame_alt_ref = 1;
- break;
-
- case ARF_UPDATE:
- case KFFLT_UPDATE:
- // NOTE: BWDREF does not get updated along with ALTREF_FRAME.
- if (frame_type == KEY_FRAME && !cpi->no_show_fwd_kf) {
- // TODO(bohanli): consider moving this to force_refresh_all?
- // This is Keyframe as arf
- set_refresh_frame_flags(refresh_frame_flags, true, true, true);
- } else {
- set_refresh_frame_flags(refresh_frame_flags, false, false, true);
- }
- break;
-
- case INTNL_OVERLAY_UPDATE:
- set_refresh_frame_flags(refresh_frame_flags, false, false, false);
- cpi->rc.is_src_frame_alt_ref = 1;
- break;
-
- case INTNL_ARF_UPDATE:
- set_refresh_frame_flags(refresh_frame_flags, false, true, false);
- break;
-
- default: assert(0); break;
- }
-
- if (ext_refresh_frame_flags->update_pending &&
- (!is_stat_generation_stage(cpi)))
- set_refresh_frame_flags(refresh_frame_flags,
- ext_refresh_frame_flags->golden_frame,
- ext_refresh_frame_flags->bwd_ref_frame,
- ext_refresh_frame_flags->alt_ref_frame);
-
- if (force_refresh_all)
- set_refresh_frame_flags(refresh_frame_flags, true, true, true);
-}
-#endif // CONFIG_NEW_REF_SIGNALING
static void set_additional_frame_flags(const AV1_COMMON *const cm,
unsigned int *const frame_flags) {
@@ -190,15 +113,7 @@
// Droppable frame is only used by external refresh flags. VoD setting won't
// trigger its use case.
if (ext_refresh_frame_flags->update_pending)
-#if CONFIG_NEW_REF_SIGNALING
return ext_refresh_frame_flags->all_ref_frames == 0;
-#else
- return !(ext_refresh_frame_flags->alt_ref_frame ||
- ext_refresh_frame_flags->alt2_ref_frame ||
- ext_refresh_frame_flags->bwd_ref_frame ||
- ext_refresh_frame_flags->golden_frame ||
- ext_refresh_frame_flags->last_frame);
-#endif // CONFIG_NEW_REF_SIGNALING
else
return 0;
}
@@ -312,11 +227,7 @@
// Note(yunqing): In other cases, primary_ref_frame is chosen based on
// cpi->gf_group.layer_depth[cpi->gf_group.index], which also controls
// frame bit allocation.
-#if CONFIG_NEW_REF_SIGNALING
if (cm->tiles.large_scale) return 0;
-#else
- if (cm->tiles.large_scale) return (LAST_FRAME - LAST_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
// Find the most recent reference frame with the same reference type as the
// current frame
@@ -324,20 +235,12 @@
int wanted_fb = cpi->fb_of_context_type[current_ref_type];
int primary_ref_frame = PRIMARY_REF_NONE;
-#if CONFIG_NEW_REF_SIGNALING
const int n_refs = cm->ref_frames_info.num_total_refs;
for (int ref_frame = 0; ref_frame < n_refs; ref_frame++) {
if (get_ref_frame_map_idx(cm, ref_frame) == wanted_fb) {
primary_ref_frame = ref_frame;
}
}
-#else
- for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
- if (get_ref_frame_map_idx(cm, ref_frame) == wanted_fb) {
- primary_ref_frame = ref_frame - LAST_FRAME;
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
return primary_ref_frame;
}
@@ -358,7 +261,6 @@
// No references specified
if (step_gop_cfg->num_references < 0) return;
-#if CONFIG_NEW_REF_SIGNALING
// Mask to indicate whether or not each ref is allowed by the GOP config
int ref_frame_used[INTER_REFS_PER_FRAME] = { 0 };
// Structures to hash each reference frame based on its pyramid level. This
@@ -367,24 +269,10 @@
int n_references[MAX_ARF_LAYERS + 1] = { 0 };
int references[MAX_ARF_LAYERS + 1][INTER_REFS_PER_FRAME] = { { 0 } };
int disp_orders[MAX_ARF_LAYERS + 1][INTER_REFS_PER_FRAME] = { { 0 } };
-#else
- // Mask to indicate whether or not each ref is allowed by the GOP config
- int ref_frame_used[REF_FRAMES] = { 0 };
- // Structures to hash each reference frame based on its pyramid level. This
- // will allow us to match the pyramid levels specified in the cfg to the best
- // reference frame index.
- int n_references[MAX_ARF_LAYERS + 1] = { 0 };
- int references[MAX_ARF_LAYERS + 1][REF_FRAMES] = { { 0 } };
- int disp_orders[MAX_ARF_LAYERS + 1][REF_FRAMES] = { { 0 } };
-#endif // CONFIG_NEW_REF_SIGNALING
int frame_level = -1;
// Loop over each reference frame and hash it based on its pyramid level
-#if CONFIG_NEW_REF_SIGNALING
for (int frame = 0; frame < INTER_REFS_PER_FRAME; frame++) {
-#else
- for (int frame = LAST_FRAME; frame <= ALTREF_FRAME; frame++) {
-#endif // CONFIG_NEW_REF_SIGNALING
// Get reference frame buffer
const RefCntBuffer *const buf = get_ref_frame_buf(&cpi->common, frame);
if (buf == NULL) continue;
@@ -450,14 +338,8 @@
}
// Avoid using references that were not specified by the cfg
-#if CONFIG_NEW_REF_SIGNALING
for (int frame = 0; frame < INTER_REFS_PER_FRAME; frame++)
if (!ref_frame_used[frame]) *ref_frame_flags &= ~(1 << (frame));
-#else
- for (int frame = LAST_FRAME; frame <= ALTREF_FRAME; frame++)
- if (!ref_frame_used[frame])
- *ref_frame_flags &= ~(1 << (frame - LAST_FRAME));
-#endif // CONFIG_NEW_REF_SIGNALING
}
static void update_fb_of_context_type(
@@ -467,24 +349,16 @@
const int current_frame_ref_type =
get_current_frame_ref_type(cpi, frame_params);
-#if CONFIG_NEW_REF_SIGNALING
const int golden_frame = cm->ref_frames_info.past_refs[0];
const int altref_frame = get_furthest_future_ref_index(cm);
-#endif // CONFIG_NEW_REF_SIGNALING
if (frame_is_intra_only(cm) || cm->features.error_resilient_mode ||
cpi->ext_flags.use_primary_ref_none) {
for (int i = 0; i < REF_FRAMES; i++) {
fb_of_context_type[i] = -1;
}
-#if CONFIG_NEW_REF_SIGNALING
fb_of_context_type[current_frame_ref_type] =
cm->show_frame ? get_ref_frame_map_idx(cm, golden_frame)
: get_ref_frame_map_idx(cm, altref_frame);
-#else
- fb_of_context_type[current_frame_ref_type] =
- cm->show_frame ? get_ref_frame_map_idx(cm, GOLDEN_FRAME)
- : get_ref_frame_map_idx(cm, ALTREF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
}
if (!encode_show_existing_frame(cm)) {
@@ -656,42 +530,13 @@
// Update frame_flags to tell the encoder's caller what sort of frame was
// encoded.
-static void update_frame_flags(
- const AV1_COMMON *const cm,
-#if !CONFIG_NEW_REF_SIGNALING
- const RefreshFrameFlagsInfo *const refresh_frame_flags,
-#endif // !CONFIG_NEW_REF_SIGNALING
- unsigned int *frame_flags) {
+static void update_frame_flags(const AV1_COMMON *const cm,
+ unsigned int *frame_flags) {
if (encode_show_existing_frame(cm)) {
-#if !CONFIG_NEW_REF_SIGNALING
- *frame_flags &= ~FRAMEFLAGS_GOLDEN;
- *frame_flags &= ~FRAMEFLAGS_BWDREF;
- *frame_flags &= ~FRAMEFLAGS_ALTREF;
-#endif // !CONFIG_NEW_REF_SIGNALING
*frame_flags &= ~FRAMEFLAGS_KEY;
return;
}
-#if !CONFIG_NEW_REF_SIGNALING
- if (refresh_frame_flags->golden_frame) {
- *frame_flags |= FRAMEFLAGS_GOLDEN;
- } else {
- *frame_flags &= ~FRAMEFLAGS_GOLDEN;
- }
-
- if (refresh_frame_flags->alt_ref_frame) {
- *frame_flags |= FRAMEFLAGS_ALTREF;
- } else {
- *frame_flags &= ~FRAMEFLAGS_ALTREF;
- }
-
- if (refresh_frame_flags->bwd_ref_frame) {
- *frame_flags |= FRAMEFLAGS_BWDREF;
- } else {
- *frame_flags &= ~FRAMEFLAGS_BWDREF;
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
-
if (cm->current_frame.frame_type == KEY_FRAME) {
*frame_flags |= FRAMEFLAGS_KEY;
} else {
@@ -881,43 +726,6 @@
if (is_frame_droppable(ext_refresh_frame_flags)) return 0;
if (ext_refresh_frame_flags->update_pending) {
-#if !CONFIG_NEW_REF_SIGNALING
- // Unfortunately the encoder interface reflects the old refresh_*_frame
- // flags so we have to replicate the old refresh_frame_flags logic here in
- // order to preserve the behaviour of the flag overrides.
- const AV1_COMMON *const cm = &cpi->common;
- int ref_frame_map_idx = get_ref_frame_map_idx(cm, LAST_FRAME);
- if (ref_frame_map_idx != INVALID_IDX)
- refresh_mask |= ext_refresh_frame_flags->last_frame << ref_frame_map_idx;
-
- ref_frame_map_idx = get_ref_frame_map_idx(cm, EXTREF_FRAME);
- if (ref_frame_map_idx != INVALID_IDX)
- refresh_mask |= ext_refresh_frame_flags->bwd_ref_frame
- << ref_frame_map_idx;
-
- ref_frame_map_idx = get_ref_frame_map_idx(cm, ALTREF2_FRAME);
- if (ref_frame_map_idx != INVALID_IDX)
- refresh_mask |= ext_refresh_frame_flags->alt2_ref_frame
- << ref_frame_map_idx;
-
- if (frame_update_type == OVERLAY_UPDATE ||
- frame_update_type == KFFLT_OVERLAY_UPDATE) {
- ref_frame_map_idx = get_ref_frame_map_idx(cm, ALTREF_FRAME);
- if (ref_frame_map_idx != INVALID_IDX)
- refresh_mask |= ext_refresh_frame_flags->golden_frame
- << ref_frame_map_idx;
- } else {
- ref_frame_map_idx = get_ref_frame_map_idx(cm, GOLDEN_FRAME);
- if (ref_frame_map_idx != INVALID_IDX)
- refresh_mask |= ext_refresh_frame_flags->golden_frame
- << ref_frame_map_idx;
-
- ref_frame_map_idx = get_ref_frame_map_idx(cm, ALTREF_FRAME);
- if (ref_frame_map_idx != INVALID_IDX)
- refresh_mask |= ext_refresh_frame_flags->alt_ref_frame
- << ref_frame_map_idx;
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
return refresh_mask;
}
@@ -1275,14 +1083,8 @@
frame_params.frame_type == S_FRAME) &&
!frame_params.show_existing_frame;
-#if CONFIG_NEW_REF_SIGNALING
(void)force_refresh_all;
av1_configure_buffer_updates(cpi, frame_update_type);
-#else
- av1_configure_buffer_updates(cpi, &frame_params.refresh_frame,
- frame_update_type, frame_params.frame_type,
- force_refresh_all);
-#endif // CONFIG_NEW_REF_SIGNALING
const int order_offset = gf_group->arf_src_offset[gf_group->index];
const int cur_frame_disp =
@@ -1292,13 +1094,6 @@
gf_group->update_type[gf_group->index] == KF_UPDATE);
if (!is_stat_generation_stage(cpi)) {
- if (!ext_flags->refresh_frame.update_pending) {
-#if !CONFIG_NEW_REF_SIGNALING
- av1_get_ref_frames(cm, cur_frame_disp, ref_frame_map_pairs);
-#endif // !CONFIG_NEW_REF_SIGNALING
- }
-
-#if CONFIG_NEW_REF_SIGNALING
cm->current_frame.frame_type = frame_params.frame_type;
cm->features.error_resilient_mode = frame_params.error_resilient_mode;
if (cm->seq_params.explicit_ref_frame_map)
@@ -1310,34 +1105,11 @@
AOMMIN(cm->seq_params.num_same_ref_compound,
cm->ref_frames_info.num_total_refs);
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#else
- const RefCntBuffer *ref_frames[INTER_REFS_PER_FRAME];
- const YV12_BUFFER_CONFIG *ref_frame_buf[INTER_REFS_PER_FRAME];
- // Get the reference frames
- for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
- ref_frames[i] = get_ref_frame_buf(cm, ref_frame_priority_order[i]);
- ref_frame_buf[i] = ref_frames[i] != NULL ? &ref_frames[i]->buf : NULL;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
-#if CONFIG_NEW_REF_SIGNALING
- // In NEW_REF_SIGNALING, ref_frame_flags is defined based on
- // the external flag max-reference-frames.
+ // ref_frame_flags is defined based on the external flag
+ // max-reference-frames.
frame_params.ref_frame_flags =
(1 << cpi->common.ref_frames_info.num_total_refs) - 1;
-#else
- // Work out which reference frame slots may be used.
- if (av1_check_keyframe_overlay(gf_group->index, gf_group,
- cpi->rc.frames_since_key)) {
- // This is a KF overlay, it should refer to arf. However KF overlay
- // has the same LAST and ALTREF references, so ALTREF will be disabled
- // in function get_ref_frame_flags. Therefore setting it manually.
- frame_params.ref_frame_flags = av1_ref_frame_flag_list[ALTREF_FRAME];
- } else {
- frame_params.ref_frame_flags =
- get_ref_frame_flags(ref_frame_buf, ext_flags->ref_frame_flags);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
frame_params.primary_ref_frame =
choose_primary_ref_frame(cpi, &frame_params);
@@ -1396,11 +1168,7 @@
if (!is_stat_generation_stage(cpi)) {
// First pass doesn't modify reference buffer assignment or produce frame
// flags
- update_frame_flags(&cpi->common,
-#if !CONFIG_NEW_REF_SIGNALING
- &cpi->refresh_frame,
-#endif // !CONFIG_NEW_REF_SIGNALING
- frame_flags);
+ update_frame_flags(&cpi->common, frame_flags);
}
if (!is_stat_generation_stage(cpi)) {
diff --git a/av1/encoder/encode_strategy.h b/av1/encoder/encode_strategy.h
index 5504f6f..f471cd4 100644
--- a/av1/encoder/encode_strategy.h
+++ b/av1/encoder/encode_strategy.h
@@ -62,18 +62,11 @@
// Set individual buffer update flags based on frame reference type.
// force_refresh_all is used when we have a KEY_FRAME or S_FRAME. It forces all
// refresh_*_frame flags to be set, because we refresh all buffers in this case.
-#if CONFIG_NEW_REF_SIGNALING
void av1_configure_buffer_updates(AV1_COMP *const cpi,
const FRAME_UPDATE_TYPE type);
// Encoder-only version for the reference mapping
void av1_get_ref_frames_enc(AV1_COMMON *cm, int cur_frame_disp,
RefFrameMapPair *ref_frame_map_pairs);
-#else
-void av1_configure_buffer_updates(
- AV1_COMP *const cpi, RefreshFrameFlagsInfo *const refresh_frame_flags,
- const FRAME_UPDATE_TYPE type, const FRAME_TYPE frame_type,
- int force_refresh_all);
-#endif // CONFIG_NEW_REF_SIGNALING
int av1_get_refresh_frame_flags(
const AV1_COMP *const cpi, const EncodeFrameParams *const frame_params,
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index eca7c49..8dc80b4 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -168,13 +168,8 @@
BLOCK_SIZE bs) {
unsigned int sse, var;
uint16_t *last_y;
- const YV12_BUFFER_CONFIG *last =
-#if CONFIG_NEW_REF_SIGNALING
- get_ref_frame_yv12_buf(&cpi->common,
- get_closest_pastcur_ref_index(&cpi->common));
-#else
- get_ref_frame_yv12_buf(&cpi->common, LAST_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
+ const YV12_BUFFER_CONFIG *last = get_ref_frame_yv12_buf(
+ &cpi->common, get_closest_pastcur_ref_index(&cpi->common));
assert(last != NULL);
last_y =
@@ -379,17 +374,10 @@
best_rf_idx = idx;
}
}
-#if CONFIG_NEW_REF_SIGNALING
// tpl_pred_error is the pred_error reduction of best_ref w.r.t.
// rank 0 frame.
tpl_pred_error[best_rf_idx] =
this_stats->pred_error[best_rf_idx] - this_stats->pred_error[0];
-#else
- // tpl_pred_error is the pred_error reduction of best_ref w.r.t.
- // LAST_FRAME.
- tpl_pred_error[best_rf_idx] = this_stats->pred_error[best_rf_idx] -
- this_stats->pred_error[LAST_FRAME - 1];
-#endif // CONFIG_NEW_REF_SIGNALING
for (int rf_idx = 1; rf_idx < INTER_REFS_PER_FRAME; ++rf_idx)
inter_cost[rf_idx] += tpl_pred_error[rf_idx];
@@ -408,21 +396,12 @@
}
}
-#if CONFIG_NEW_REF_SIGNALING
x->tpl_keep_ref_frame[INTRA_FRAME_INDEX] = 1;
x->tpl_keep_ref_frame[0] = 1;
-#else
- x->tpl_keep_ref_frame[INTRA_FRAME] = 1;
- x->tpl_keep_ref_frame[LAST_FRAME] = 1;
-#endif // CONFIG_NEW_REF_SIGNALING
int cutoff_ref = 0;
for (int idx = 0; idx < INTER_REFS_PER_FRAME - 1; ++idx) {
-#if CONFIG_NEW_REF_SIGNALING
x->tpl_keep_ref_frame[rank_index[idx]] = 1;
-#else
- x->tpl_keep_ref_frame[rank_index[idx] + LAST_FRAME] = 1;
-#endif // CONFIG_NEW_REF_SIGNALING
if (idx > 2) {
if (!cutoff_ref) {
// If the predictive coding gains are smaller than the previous more
@@ -434,11 +413,7 @@
cutoff_ref = 1;
}
-#if CONFIG_NEW_REF_SIGNALING
if (cutoff_ref) x->tpl_keep_ref_frame[rank_index[idx]] = 0;
-#else
- if (cutoff_ref) x->tpl_keep_ref_frame[rank_index[idx] + LAST_FRAME] = 0;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
}
@@ -1223,7 +1198,6 @@
int min_past_dist = INT32_MAX, min_future_dist = INT32_MAX;
ref_frame_dist_info->nearest_past_ref = NONE_FRAME;
ref_frame_dist_info->nearest_future_ref = NONE_FRAME;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
ref_frame_dist_info->ref_relative_dist[ref_frame] = 0;
if (ref_frame_flags & (1 << ref_frame)) {
@@ -1231,15 +1205,6 @@
cm->cur_frame->ref_display_order_hint[ref_frame],
cm->current_frame.display_order_hint);
ref_frame_dist_info->ref_relative_dist[ref_frame] = dist;
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- ref_frame_dist_info->ref_relative_dist[ref_frame - LAST_FRAME] = 0;
- if (ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
- int dist = av1_encoder_get_relative_dist(
- cm->cur_frame->ref_display_order_hint[ref_frame - LAST_FRAME],
- cm->current_frame.display_order_hint);
- ref_frame_dist_info->ref_relative_dist[ref_frame - LAST_FRAME] = dist;
-#endif // CONFIG_NEW_REF_SIGNALING
// Get the nearest ref_frame in the past
if (abs(dist) < min_past_dist && dist < 0) {
ref_frame_dist_info->nearest_past_ref = ref_frame;
@@ -1257,24 +1222,9 @@
static INLINE int refs_are_one_sided(const AV1_COMMON *cm) {
assert(!frame_is_intra_only(cm));
-#if CONFIG_NEW_REF_SIGNALING
return (cm->ref_frames_info.num_past_refs == 0 &&
cm->ref_frames_info.num_cur_refs == 0) ||
cm->ref_frames_info.num_future_refs == 0;
-#else
- int one_sided_refs = 1;
- const int cur_display_order_hint = cm->current_frame.display_order_hint;
- for (int ref = LAST_FRAME; ref <= ALTREF_FRAME; ++ref) {
- const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref);
- if (buf == NULL) continue;
- if (av1_encoder_get_relative_dist(buf->display_order_hint,
- cur_display_order_hint) > 0) {
- one_sided_refs = 0; // bwd reference
- break;
- }
- }
- return one_sided_refs;
-#endif // CONFIG_NEW_REF_SIGNALING
}
static INLINE void get_skip_mode_ref_offsets(const AV1_COMMON *cm,
@@ -1283,17 +1233,10 @@
ref_order_hint[0] = ref_order_hint[1] = 0;
if (!skip_mode_info->skip_mode_allowed) return;
-#if CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const buf_0 =
get_ref_frame_buf(cm, skip_mode_info->ref_frame_idx_0);
const RefCntBuffer *const buf_1 =
get_ref_frame_buf(cm, skip_mode_info->ref_frame_idx_1);
-#else
- const RefCntBuffer *const buf_0 =
- get_ref_frame_buf(cm, LAST_FRAME + skip_mode_info->ref_frame_idx_0);
- const RefCntBuffer *const buf_1 =
- get_ref_frame_buf(cm, LAST_FRAME + skip_mode_info->ref_frame_idx_1);
-#endif // CONFIG_NEW_REF_SIGNALING
assert(buf_0 != NULL && buf_1 != NULL);
ref_order_hint[0] = buf_0->order_hint;
@@ -1320,7 +1263,6 @@
// High Latency: Turn off skip mode if all refs are fwd.
if (cpi->all_one_sided_refs && cpi->oxcf.gf_cfg.lag_in_frames > 0) return 0;
-#if CONFIG_NEW_REF_SIGNALING
const int ref_frame[2] = { cm->current_frame.skip_mode_info.ref_frame_idx_0,
cm->current_frame.skip_mode_info.ref_frame_idx_1 };
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -1330,24 +1272,6 @@
if (!(cpi->common.ref_frame_flags & (1 << ref_frame[0])) ||
!(cpi->common.ref_frame_flags & (1 << ref_frame[1])))
return 0;
-#else
- static const int flag_list[REF_FRAMES] = { 0,
- AOM_LAST_FLAG,
- AOM_LAST2_FLAG,
- AOM_LAST3_FLAG,
- AOM_GOLD_FLAG,
- AOM_BWD_FLAG,
- AOM_ALT2_FLAG,
- AOM_ALT_FLAG };
-
- const int ref_frame[2] = {
- cm->current_frame.skip_mode_info.ref_frame_idx_0 + LAST_FRAME,
- cm->current_frame.skip_mode_info.ref_frame_idx_1 + LAST_FRAME
- };
- if (!(cm->ref_frame_flags & flag_list[ref_frame[0]]) ||
- !(cm->ref_frame_flags & flag_list[ref_frame[1]]))
- return 0;
-#endif // CONFIG_NEW_REF_SIGNALING
return 1;
}
@@ -1360,74 +1284,6 @@
: INTERP_SKIP_LUMA_SKIP_CHROMA;
}
-#if !CONFIG_NEW_REF_SIGNALING
-static AOM_INLINE void setup_prune_ref_frame_mask(AV1_COMP *cpi) {
- if ((!cpi->oxcf.ref_frm_cfg.enable_onesided_comp ||
- cpi->sf.inter_sf.disable_onesided_comp) &&
- cpi->all_one_sided_refs) {
- // Disable all compound references
-#if CONFIG_TIP
- cpi->prune_ref_frame_mask =
- (1 << (MODE_CTX_REF_FRAMES - 1)) - (1 << REF_FRAMES);
-#else
- cpi->prune_ref_frame_mask = (1 << MODE_CTX_REF_FRAMES) - (1 << REF_FRAMES);
-#endif // CONFIG_TIP
- } else if (cpi->sf.inter_sf.selective_ref_frame >= 2) {
- AV1_COMMON *const cm = &cpi->common;
- const int cur_frame_display_order_hint =
- cm->current_frame.display_order_hint;
- unsigned int *ref_display_order_hint =
- cm->cur_frame->ref_display_order_hint;
- const int arf2_dist = av1_encoder_get_relative_dist(
- ref_display_order_hint[ALTREF2_FRAME - LAST_FRAME],
- cur_frame_display_order_hint);
- const int bwd_dist = av1_encoder_get_relative_dist(
- ref_display_order_hint[BWDREF_FRAME - LAST_FRAME],
- cur_frame_display_order_hint);
-
-#if CONFIG_TIP
- for (int ref_idx = REF_FRAMES; ref_idx < MODE_CTX_REF_FRAMES - 1;
- ++ref_idx) {
-#else
- for (int ref_idx = REF_FRAMES; ref_idx < MODE_CTX_REF_FRAMES; ++ref_idx) {
-#endif // CONFIG_TIP
- MV_REFERENCE_FRAME rf[2];
- av1_set_ref_frame(rf, ref_idx);
- if (!(cm->ref_frame_flags & av1_ref_frame_flag_list[rf[0]]) ||
- !(cm->ref_frame_flags & av1_ref_frame_flag_list[rf[1]])) {
- continue;
- }
-
- if (!cpi->all_one_sided_refs) {
- int ref_dist[2];
- for (int i = 0; i < 2; ++i) {
- ref_dist[i] = av1_encoder_get_relative_dist(
- ref_display_order_hint[rf[i] - LAST_FRAME],
- cur_frame_display_order_hint);
- }
-
- // One-sided compound is used only when all reference frames are
- // one-sided.
- if ((ref_dist[0] > 0) == (ref_dist[1] > 0)) {
- cpi->prune_ref_frame_mask |= 1 << ref_idx;
- }
- }
-
- if (cpi->sf.inter_sf.selective_ref_frame >= 4 &&
- (rf[0] == ALTREF2_FRAME || rf[1] == ALTREF2_FRAME) &&
- (cm->ref_frame_flags & av1_ref_frame_flag_list[BWDREF_FRAME])) {
- // Check if both ALTREF2_FRAME and BWDREF_FRAME are future references.
- if (arf2_dist > 0 && bwd_dist > 0 && bwd_dist <= arf2_dist) {
- // Drop ALTREF2_FRAME as a reference if BWDREF_FRAME is a closer
- // reference to the current frame than ALTREF2_FRAME
- cpi->prune_ref_frame_mask |= 1 << ref_idx;
- }
- }
- }
- }
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
#if CONFIG_TIP
AOM_INLINE void av1_tip_enc_calc_subpel_params(
const MV *const src_mv, InterPredParams *const inter_pred_params,
@@ -1772,10 +1628,6 @@
frame_is_intra_only(cm) ? 0 : refs_are_one_sided(cm);
cpi->prune_ref_frame_mask = 0;
-#if !CONFIG_NEW_REF_SIGNALING
- // Figure out which ref frames can be skipped at frame level.
- setup_prune_ref_frame_mask(cpi);
-#endif // !CONFIG_NEW_REF_SIGNALING
x->txfm_search_info.txb_split_count = 0;
#if CONFIG_SPEED_STATS
diff --git a/av1/encoder/encodeframe_utils.c b/av1/encoder/encodeframe_utils.c
index e824bbc..bdc85a5 100644
--- a/av1/encoder/encodeframe_utils.c
+++ b/av1/encoder/encodeframe_utils.c
@@ -385,33 +385,6 @@
if (dry_run) return;
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- {
- unsigned int *const mode_chosen_counts =
- (unsigned int *)cpi->mode_chosen_counts; // Cast const away.
- if (frame_is_intra_only(cm)) {
- static const int kf_mode_index[] = {
- THR_DC /*DC_PRED*/,
- THR_V_PRED /*V_PRED*/,
- THR_H_PRED /*H_PRED*/,
- THR_D45_PRED /*D45_PRED*/,
- THR_D135_PRED /*D135_PRED*/,
- THR_D113_PRED /*D113_PRED*/,
- THR_D157_PRED /*D157_PRED*/,
- THR_D203_PRED /*D203_PRED*/,
- THR_D67_PRED /*D67_PRED*/,
- THR_SMOOTH, /*SMOOTH_PRED*/
- THR_SMOOTH_V, /*SMOOTH_V_PRED*/
- THR_SMOOTH_H, /*SMOOTH_H_PRED*/
- THR_PAETH /*PAETH_PRED*/,
- };
- ++mode_chosen_counts[kf_mode_index[mi_addr->mode]];
- } else {
- // Note how often each mode chosen as best
- ++mode_chosen_counts[ctx->best_mode_index];
- }
- }
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
if (mi_addr->ref_frame[0] != INTRA_FRAME) {
if (is_inter_block(mi_addr, xd->tree_type)) {
// TODO(sarahparker): global motion stats need to be handled per-tile
@@ -1339,18 +1312,8 @@
AVERAGE_CDF(ctx_left->palette_uv_mode_cdf, ctx_tr->palette_uv_mode_cdf, 2);
AVERAGE_CDF(ctx_left->comp_inter_cdf, ctx_tr->comp_inter_cdf, 2);
AVERAGE_CDF(ctx_left->single_ref_cdf, ctx_tr->single_ref_cdf, 2);
-#if CONFIG_NEW_REF_SIGNALING
AVERAGE_CDF(ctx_left->comp_ref0_cdf, ctx_tr->comp_ref0_cdf, 2);
AVERAGE_CDF(ctx_left->comp_ref1_cdf, ctx_tr->comp_ref1_cdf, 2);
-#else
- AVERAGE_CDF(ctx_left->comp_ref_cdf, ctx_tr->comp_ref_cdf, 2);
-#if CONFIG_TIP
- AVERAGE_CDF(ctx_left->tip_cdf, ctx_tr->tip_cdf, 2);
-#endif // CONFIG_TIP
- AVERAGE_CDF(ctx_left->comp_ref_type_cdf, ctx_tr->comp_ref_type_cdf, 2);
- AVERAGE_CDF(ctx_left->uni_comp_ref_cdf, ctx_tr->uni_comp_ref_cdf, 2);
- AVERAGE_CDF(ctx_left->comp_bwdref_cdf, ctx_tr->comp_bwdref_cdf, 2);
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_NEW_TX_PARTITION
// Square blocks
AVERAGE_CDF(ctx_left->inter_4way_txfm_partition_cdf[0],
@@ -1656,11 +1619,6 @@
#if CONFIG_EXT_RECUR_PARTITIONS
sb_fp_stats->min_partition_size = x->sb_enc.min_partition_size;
#endif // CONFIG_EXT_RECUR_PARTITIONS
-
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- memcpy(sb_fp_stats->mode_chosen_counts, cpi->mode_chosen_counts,
- sizeof(sb_fp_stats->mode_chosen_counts));
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
}
void av1_restore_sb_state(const SB_FIRST_PASS_STATS *sb_fp_stats, AV1_COMP *cpi,
@@ -1697,11 +1655,6 @@
#if CONFIG_EXT_RECUR_PARTITIONS
x->sb_enc.min_partition_size = sb_fp_stats->min_partition_size;
#endif // CONFIG_EXT_RECUR_PARTITIONS
-
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- memcpy(cpi->mode_chosen_counts, sb_fp_stats->mode_chosen_counts,
- sizeof(sb_fp_stats->mode_chosen_counts));
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
}
// Update the rate costs of some symbols according to the frequency directed
diff --git a/av1/encoder/encodeframe_utils.h b/av1/encoder/encodeframe_utils.h
index cb57e6c..04a192f 100644
--- a/av1/encoder/encodeframe_utils.h
+++ b/av1/encoder/encodeframe_utils.h
@@ -52,11 +52,7 @@
int split_count;
FRAME_COUNTS fc;
InterModeRdModel inter_mode_rd_models[BLOCK_SIZES_ALL];
-#if CONFIG_NEW_REF_SIGNALING
int thresh_freq_fact[BLOCK_SIZES_ALL][MB_MODE_COUNT];
-#else
- int thresh_freq_fact[BLOCK_SIZES_ALL][MAX_MODES];
-#endif // CONFIG_NEW_REF_SIGNALING
int current_qindex;
#if CONFIG_C043_MVP_IMPROVEMENTS
REF_MV_BANK ref_mv_bank;
@@ -67,10 +63,6 @@
#if CONFIG_EXT_RECUR_PARTITIONS
BLOCK_SIZE min_partition_size;
#endif // CONFIG_EXT_RECUR_PARTITIONS
-
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- unsigned int mode_chosen_counts[MAX_MODES];
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
} SB_FIRST_PASS_STATS;
// This structure contains block size related
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index aa75140..f534dd9 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -417,13 +417,11 @@
seq->order_hint_info.enable_order_hint
? DEFAULT_EXPLICIT_ORDER_HINT_BITS - 1
: -1;
-#if CONFIG_NEW_REF_SIGNALING
seq->explicit_ref_frame_map = oxcf->ref_frm_cfg.explicit_ref_frame_map;
seq->max_reference_frames = oxcf->ref_frm_cfg.max_reference_frames;
#if CONFIG_ALLOW_SAME_REF_COMPOUND
seq->num_same_ref_compound = SAME_REF_COMPOUND_PRUNE;
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#endif // CONFIG_NEW_REF_SIGNALING
seq->max_frame_width = frm_dim_cfg->forced_max_frame_width
? frm_dim_cfg->forced_max_frame_width
@@ -720,9 +718,6 @@
MACROBLOCK *const x = &cpi->td.mb;
AV1LevelParams *const level_params = &cpi->level_params;
InitialDimensions *const initial_dimensions = &cpi->initial_dimensions;
-#if !CONFIG_NEW_REF_SIGNALING
- RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // !CONFIG_NEW_REF_SIGNALING
const FrameDimensionCfg *const frm_dim_cfg = &cpi->oxcf.frm_dim_cfg;
const DecoderModelCfg *const dec_model_cfg = &oxcf->dec_model_cfg;
const ColorCfg *const color_cfg = &oxcf->color_cfg;
@@ -817,11 +812,6 @@
rc->baseline_gf_interval = (MIN_GF_INTERVAL + MAX_GF_INTERVAL) / 2;
-#if !CONFIG_NEW_REF_SIGNALING
- refresh_frame_flags->golden_frame = false;
- refresh_frame_flags->bwd_ref_frame = false;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
cm->features.refresh_frame_context =
(oxcf->tool_cfg.frame_parallel_decoding_mode)
? REFRESH_FRAME_CONTEXT_DISABLED
@@ -932,9 +922,7 @@
cpi->ext_flags.refresh_frame.update_pending = 0;
cpi->ext_flags.refresh_frame_context_pending = 0;
-#if CONFIG_NEW_REF_SIGNALING
cpi->ext_flags.refresh_frame.all_ref_frames = 1;
-#endif // CONFIG_NEW_REF_SIGNALING
highbd_set_var_fns(cpi);
@@ -1123,10 +1111,6 @@
cpi->last_show_frame_buf = NULL;
realloc_segmentation_maps(cpi);
-#if !CONFIG_NEW_REF_SIGNALING
- cpi->refresh_frame.alt_ref_frame = false;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
#if CONFIG_INTERNAL_STATS
cpi->b_calculate_blockiness = 1;
@@ -2146,11 +2130,7 @@
if (!is_stat_generation_stage(cpi)) alloc_util_frame_buffers(cpi);
init_motion_estimation(cpi);
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
-#endif // CONFIG_NEW_REF_SIGNALING
RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
if (buf != NULL) {
struct scale_factors *sf = get_ref_scale_factors(cm, ref_frame);
@@ -2182,11 +2162,7 @@
av1_setup_scale_factors_for_frame(&cm->sf_identity, cm->width, cm->height,
cm->width, cm->height);
-#if CONFIG_NEW_REF_SIGNALING
set_ref_ptrs(cm, xd, 0, 0);
-#else
- set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
}
/*!\brief Select and apply cdef filters and switchable restoration filters
@@ -2487,7 +2463,6 @@
// not allowed. Also consider dropping this segment completely.
if (cpi->sf.hl_sf.disable_unequal_scale_refs &&
!av1_superres_in_recode_allowed(cpi)) {
-#if CONFIG_NEW_REF_SIGNALING
const MV_REFERENCE_FRAME golden_frame = get_best_past_ref_index(cm);
const MV_REFERENCE_FRAME altref_frame = get_furthest_future_ref_index(cm);
if (golden_frame != NONE_FRAME &&
@@ -2504,20 +2479,6 @@
if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height)
cm->ref_frame_flags ^= (1 << altref_frame);
}
-#else
- if (cm->ref_frame_flags & av1_ref_frame_flag_list[GOLDEN_FRAME]) {
- const YV12_BUFFER_CONFIG *const ref =
- get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
- if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height)
- cm->ref_frame_flags ^= AOM_GOLD_FLAG;
- }
- if (cm->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]) {
- const YV12_BUFFER_CONFIG *const ref =
- get_ref_frame_yv12_buf(cm, ALTREF_FRAME);
- if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height)
- cm->ref_frame_flags ^= AOM_ALT_FLAG;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
// For SVC the inter-layer/spatial prediction is not done for newmv
@@ -2947,11 +2908,7 @@
cm->rst_info[1].frame_restoration_type = RESTORE_NONE;
cm->rst_info[2].frame_restoration_type = RESTORE_NONE;
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
cm->global_motion[i] = default_warp_params;
cm->cur_frame->global_motion[i] = default_warp_params;
}
@@ -3491,11 +3448,6 @@
aom_clear_system_state();
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- memset(cpi->mode_chosen_counts, 0,
- MAX_MODES * sizeof(*cpi->mode_chosen_counts));
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
-
if (seq_params->frame_id_numbers_present_flag) {
/* Non-normative definition of current_frame_id ("frame counter" with
* wraparound) */
@@ -3678,11 +3630,6 @@
memcpy(cm->remapped_ref_idx, frame_params->remapped_ref_idx,
REF_FRAMES * sizeof(*cm->remapped_ref_idx));
-#if !CONFIG_NEW_REF_SIGNALING
- memcpy(&cpi->refresh_frame, &frame_params->refresh_frame,
- sizeof(cpi->refresh_frame));
-#endif // !CONFIG_NEW_REF_SIGNALING
-
if (current_frame->frame_type == KEY_FRAME && !cpi->no_show_fwd_kf) {
current_frame->key_frame_number += current_frame->frame_number;
current_frame->frame_number = 0;
@@ -4105,33 +4052,6 @@
&ext_flags->refresh_frame;
ext_flags->ref_frame_flags = AOM_REFFRAME_ALL;
-#if !CONFIG_NEW_REF_SIGNALING
- if (flags &
- (AOM_EFLAG_NO_REF_LAST | AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
- AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF | AOM_EFLAG_NO_REF_BWD |
- AOM_EFLAG_NO_REF_ARF2)) {
- int ref = AOM_REFFRAME_ALL;
-
- if (flags & AOM_EFLAG_NO_REF_LAST) ref ^= AOM_LAST_FLAG;
- if (flags & AOM_EFLAG_NO_REF_LAST2) ref ^= AOM_LAST2_FLAG;
- if (flags & AOM_EFLAG_NO_REF_LAST3) ref ^= AOM_LAST3_FLAG;
-
- if (flags & AOM_EFLAG_NO_REF_GF) ref ^= AOM_GOLD_FLAG;
-
- if (flags & AOM_EFLAG_NO_REF_ARF) {
- ref ^= AOM_ALT_FLAG;
- ref ^= AOM_BWD_FLAG;
- ref ^= AOM_ALT2_FLAG;
- } else {
- if (flags & AOM_EFLAG_NO_REF_BWD) ref ^= AOM_BWD_FLAG;
- if (flags & AOM_EFLAG_NO_REF_ARF2) ref ^= AOM_ALT2_FLAG;
- }
-
- av1_use_as_reference(&ext_flags->ref_frame_flags, ref);
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
-
-#if CONFIG_NEW_REF_SIGNALING
if (flags & AOM_EFLAG_NO_UPD_ALL) {
ext_refresh_frame_flags->all_ref_frames = 0;
ext_refresh_frame_flags->update_pending = 1;
@@ -4139,32 +4059,6 @@
ext_refresh_frame_flags->all_ref_frames = 1;
ext_refresh_frame_flags->update_pending = 0;
}
-#else
- if (flags &
- (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF)) {
- int upd = AOM_REFFRAME_ALL;
-
- // Refreshing LAST/LAST2/LAST3 is handled by 1 common flag.
- if (flags & AOM_EFLAG_NO_UPD_LAST) upd ^= AOM_LAST_FLAG;
-
- if (flags & AOM_EFLAG_NO_UPD_GF) upd ^= AOM_GOLD_FLAG;
-
- if (flags & AOM_EFLAG_NO_UPD_ARF) {
- upd ^= AOM_ALT_FLAG;
- upd ^= AOM_BWD_FLAG;
- upd ^= AOM_ALT2_FLAG;
- }
-
- ext_refresh_frame_flags->last_frame = (upd & AOM_LAST_FLAG) != 0;
- ext_refresh_frame_flags->golden_frame = (upd & AOM_GOLD_FLAG) != 0;
- ext_refresh_frame_flags->alt_ref_frame = (upd & AOM_ALT_FLAG) != 0;
- ext_refresh_frame_flags->bwd_ref_frame = (upd & AOM_BWD_FLAG) != 0;
- ext_refresh_frame_flags->alt2_ref_frame = (upd & AOM_ALT2_FLAG) != 0;
- ext_refresh_frame_flags->update_pending = 1;
- } else {
- ext_refresh_frame_flags->update_pending = 0;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
ext_flags->use_ref_frame_mvs = cpi->oxcf.tool_cfg.enable_ref_frame_mvs &
((flags & AOM_EFLAG_NO_REF_FRAME_MVS) == 0);
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index ea36e52..b05668a 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -98,12 +98,6 @@
enum {
FRAMEFLAGS_KEY = 1 << 0,
-#if !CONFIG_NEW_REF_SIGNALING
- FRAMEFLAGS_GOLDEN = 1 << 1,
- FRAMEFLAGS_BWDREF = 1 << 2,
- // TODO(zoeliu): To determine whether a frame flag is needed for ALTREF2_FRAME
- FRAMEFLAGS_ALTREF = 1 << 3,
-#endif // !CONFIG_NEW_REF_SIGNALING
FRAMEFLAGS_INTRAONLY = 1 << 4,
FRAMEFLAGS_SWITCH = 1 << 5,
FRAMEFLAGS_ERROR_RESILIENT = 1 << 6,
@@ -689,9 +683,7 @@
bool enable_reduced_reference_set;
// Indicates if one-sided compound should be enabled.
bool enable_onesided_comp;
-#if CONFIG_NEW_REF_SIGNALING
bool explicit_ref_frame_map;
-#endif // CONFIG_NEW_REF_SIGNALING
} RefFrameCfg;
typedef struct {
@@ -1368,18 +1360,10 @@
unsigned int tip_ref[TIP_CONTEXTS][2];
#endif // CONFIG_TIP
unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
-#if CONFIG_NEW_REF_SIGNALING
unsigned int single_ref[REF_CONTEXTS][INTER_REFS_PER_FRAME - 1][2];
unsigned int comp_ref0[REF_CONTEXTS][INTER_REFS_PER_FRAME - 2][2];
unsigned int comp_ref1[REF_CONTEXTS][COMPREF_BIT_TYPES]
[INTER_REFS_PER_FRAME - 2][2];
-#else
- unsigned int comp_ref_type[COMP_REF_TYPE_CONTEXTS][2];
- unsigned int uni_comp_ref[UNI_COMP_REF_CONTEXTS][UNIDIR_COMP_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_bwdref[REF_CONTEXTS][BWD_REFS - 1][2];
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_NEW_CONTEXT_MODELING
unsigned int intrabc[INTRABC_CONTEXTS][2];
#else
@@ -1651,11 +1635,7 @@
typedef struct RD_COUNTS {
int64_t comp_pred_diff[REFERENCE_MODES];
// Stores number of 4x4 blocks using global motion per reference frame.
-#if CONFIG_NEW_REF_SIGNALING
int global_motion_used[INTER_REFS_PER_FRAME];
-#else
- int global_motion_used[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
int compound_ref_used_flag;
int skip_mode_used_flag;
int tx_type_used[TX_SIZES_ALL][TX_TYPES];
@@ -1982,11 +1962,7 @@
* each reference frame. gmparams_cost[i] stores the cost of signalling global
* motion for the ith reference frame.
*/
-#if CONFIG_NEW_REF_SIGNALING
int params_cost[INTER_REFS_PER_FRAME];
-#else
- int params_cost[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* Flag to indicate if global motion search needs to be rerun.
@@ -1998,11 +1974,7 @@
* ref_buf[i] stores the pointer to the reference frame of the ith
* reference frame type.
*/
-#if CONFIG_NEW_REF_SIGNALING
YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME];
-#else
- YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* Pointer to the source frame buffer.
@@ -2022,11 +1994,7 @@
* reference_frames[i][j] holds the jth valid reference frame type in the
* direction 'i' and its temporal distance from the source frame .
*/
-#if CONFIG_NEW_REF_SIGNALING
FrameDistPair reference_frames[MAX_DIRECTIONS][INTER_REFS_PER_FRAME];
-#else
- FrameDistPair reference_frames[MAX_DIRECTIONS][REF_FRAMES - 1];
-#endif // CONFIG_NEW_REF_SIGNALING
/**
* \name Dimensions for which segment map is allocated.
@@ -2112,22 +2080,6 @@
search_site_config search_site_cfg[SS_CFG_TOTAL][NUM_DISTINCT_SEARCH_METHODS];
} MotionVectorSearchParams;
-#if !CONFIG_NEW_REF_SIGNALING
-/*!
- * \brief Refresh frame flags for different type of frames.
- *
- * If the refresh flag is true for a particular reference frame, after the
- * current frame is encoded, the reference frame gets refreshed (updated) to
- * be the current frame. Note: Usually at most one flag will be set to true at
- * a time. But, for key-frames, all flags are set to true at once.
- */
-typedef struct {
- bool golden_frame; /*!< Refresh flag for golden frame */
- bool bwd_ref_frame; /*!< Refresh flag for bwd-ref frame */
- bool alt_ref_frame; /*!< Refresh flag for alt-ref frame */
-} RefreshFrameFlagsInfo;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
/*!
* \brief Desired dimensions for an externally triggered resize.
*
@@ -2232,15 +2184,7 @@
* reference frame buffer with the contents of the current frame.
*/
typedef struct {
-#if CONFIG_NEW_REF_SIGNALING
bool all_ref_frames; /*!< Refresh all refs */
-#else
- bool last_frame; /*!< Refresh flag for last frame */
- bool golden_frame; /*!< Refresh flag for golden frame */
- bool bwd_ref_frame; /*!< Refresh flag for bwd-ref frame */
- bool alt2_ref_frame; /*!< Refresh flag for alt2-ref frame */
- bool alt_ref_frame; /*!< Refresh flag for alt-ref frame */
-#endif // CONFIG_NEW_REF_SIGNALING
/*!
* Flag indicating if the update of refresh frame flags is pending.
*/
@@ -2511,13 +2455,6 @@
*/
RefCntBuffer *last_show_frame_buf;
-#if !CONFIG_NEW_REF_SIGNALING
- /*!
- * Refresh frame flags for golden, bwd-ref and alt-ref frames.
- */
- RefreshFrameFlagsInfo refresh_frame;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
/*!
* For each type of reference frame, this contains the index of a reference
* frame buffer for a reference frame of the same type. We use this to
@@ -2678,9 +2615,6 @@
/*!\cond */
uint64_t time_receive_data;
uint64_t time_compress_data;
-#if !CONFIG_NEW_REF_SIGNALING
- unsigned int mode_chosen_counts[MAX_MODES];
-#endif // !CONFIG_NEW_REF_SIGNALING
int count;
uint64_t total_sq_error;
@@ -3024,14 +2958,6 @@
*/
int remapped_ref_idx[REF_FRAMES];
-#if !CONFIG_NEW_REF_SIGNALING
- /*!
- * Flags which determine which reference buffers are refreshed by this
- * frame.
- */
- RefreshFrameFlagsInfo refresh_frame;
-#endif // !CONFIG_NEW_REF_SIGNALING
-
/*!
* Speed level to use for this frame: Bigger number means faster.
*/
@@ -3228,20 +3154,12 @@
static INLINE int enc_is_ref_frame_buf(const AV1_COMMON *const cm,
const RefCntBuffer *const frame_buf) {
MV_REFERENCE_FRAME ref_frame;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
if (buf == NULL) continue;
if (frame_buf == buf) break;
}
-#if CONFIG_NEW_REF_SIGNALING
return (ref_frame < INTER_REFS_PER_FRAME);
-#else
- return (ref_frame <= ALTREF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
}
static INLINE void alloc_frame_mvs(AV1_COMMON *const cm, RefCntBuffer *buf) {
@@ -3322,7 +3240,6 @@
static INLINE void set_ref_ptrs(const AV1_COMMON *cm, MACROBLOCKD *xd,
MV_REFERENCE_FRAME ref0,
MV_REFERENCE_FRAME ref1) {
-#if CONFIG_NEW_REF_SIGNALING
xd->block_ref_scale_factors[0] =
get_ref_scale_factors_const(cm, ref0 < INTER_REFS_PER_FRAME
#if CONFIG_TIP
@@ -3337,12 +3254,6 @@
#endif // CONFIG_TIP
? ref1
: 0);
-#else
- xd->block_ref_scale_factors[0] =
- get_ref_scale_factors_const(cm, ref0 >= LAST_FRAME ? ref0 : 1);
- xd->block_ref_scale_factors[1] =
- get_ref_scale_factors_const(cm, ref1 >= LAST_FRAME ? ref1 : 1);
-#endif // CONFIG_NEW_REF_SIGNALING
}
static INLINE int get_chessboard_index(int frame_index) {
@@ -3447,54 +3358,6 @@
return (BLOCK_SIZE)int_size;
}
-#if !CONFIG_NEW_REF_SIGNALING
-static const uint8_t av1_ref_frame_flag_list[REF_FRAMES] = { 0,
- AOM_LAST_FLAG,
- AOM_LAST2_FLAG,
- AOM_LAST3_FLAG,
- AOM_GOLD_FLAG,
- AOM_BWD_FLAG,
- AOM_ALT2_FLAG,
- AOM_ALT_FLAG };
-
-// When more than 'max_allowed_refs' are available, we reduce the number of
-// reference frames one at a time based on this order.
-static const MV_REFERENCE_FRAME disable_order[] = {
- LAST3_FRAME,
- LAST2_FRAME,
- ALTREF2_FRAME,
- GOLDEN_FRAME,
-};
-
-static const MV_REFERENCE_FRAME
- ref_frame_priority_order[INTER_REFS_PER_FRAME] = {
- LAST_FRAME, ALTREF_FRAME, BWDREF_FRAME, GOLDEN_FRAME,
- ALTREF2_FRAME, LAST2_FRAME, LAST3_FRAME,
- };
-
-static INLINE int get_ref_frame_flags(const YV12_BUFFER_CONFIG **ref_frames,
- const int ext_ref_frame_flags) {
- // cpi->ext_flags.ref_frame_flags allows certain reference types to be
- // disabled by the external interface. These are set by
- // av1_apply_encoding_flags(). Start with what the external interface allows,
- // then suppress any reference types which we have found to be duplicates.
- int flags = ext_ref_frame_flags;
-
- for (int i = 1; i < INTER_REFS_PER_FRAME; ++i) {
- const YV12_BUFFER_CONFIG *const this_ref = ref_frames[i];
- // If this_ref has appeared before, mark the corresponding ref frame as
- // invalid.
- for (int j = 0; j < i; ++j) {
- if (this_ref == ref_frames[j]) {
- flags &= ~(1 << (ref_frame_priority_order[i] - 1));
- break;
- }
- }
- }
- return flags;
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
static INLINE int get_max_allowed_ref_frames(
int selective_ref_frame, unsigned int max_reference_frames) {
const unsigned int max_allowed_refs_for_given_speed =
@@ -3510,19 +3373,11 @@
MV_REFERENCE_FRAME ref_frame;
int total_valid_refs = 0;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
if (*ref_frame_flags & (1 << ref_frame)) {
total_valid_refs++;
}
}
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- if (*ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
- total_valid_refs++;
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
const int max_allowed_refs =
get_max_allowed_ref_frames(cpi->sf.inter_sf.selective_ref_frame,
@@ -3535,17 +3390,7 @@
if (!(*ref_frame_flags & (1 << ref_frame_to_disable))) {
continue;
}
-#if CONFIG_NEW_REF_SIGNALING
*ref_frame_flags &= ~(1 << ref_frame_to_disable);
-#else
- switch (ref_frame_to_disable) {
- case LAST3_FRAME: *ref_frame_flags &= ~AOM_LAST3_FLAG; break;
- case LAST2_FRAME: *ref_frame_flags &= ~AOM_LAST2_FLAG; break;
- case ALTREF2_FRAME: *ref_frame_flags &= ~AOM_ALT2_FLAG; break;
- case GOLDEN_FRAME: *ref_frame_flags &= ~AOM_GOLD_FLAG; break;
- default: assert(0);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
--total_valid_refs;
}
}
diff --git a/av1/encoder/encoder_utils.c b/av1/encoder/encoder_utils.c
index b879cc3..5073552 100644
--- a/av1/encoder/encoder_utils.c
+++ b/av1/encoder/encoder_utils.c
@@ -497,25 +497,15 @@
const int num_planes = av1_num_planes(cm);
MV_REFERENCE_FRAME ref_frame;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
// Need to convert from AOM_REFFRAME to index into ref_mask (subtract 1).
if (cm->ref_frame_flags & (1 << ref_frame)) {
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- // Need to convert from AOM_REFFRAME to index into ref_mask (subtract 1).
- if (cm->ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
-#endif // CONFIG_NEW_REF_SIGNALING
BufferPool *const pool = cm->buffer_pool;
const YV12_BUFFER_CONFIG *const ref =
get_ref_frame_yv12_buf(cm, ref_frame);
if (ref == NULL) {
-#if CONFIG_NEW_REF_SIGNALING
cpi->scaled_ref_buf[ref_frame] = NULL;
-#else
- cpi->scaled_ref_buf[ref_frame - 1] = NULL;
-#endif // CONFIG_NEW_REF_SIGNALING
continue;
}
@@ -535,11 +525,7 @@
}
}
int force_scaling = 0;
-#if CONFIG_NEW_REF_SIGNALING
RefCntBuffer *new_fb = cpi->scaled_ref_buf[ref_frame];
-#else
- RefCntBuffer *new_fb = cpi->scaled_ref_buf[ref_frame - 1];
-#endif // CONFIG_NEW_REF_SIGNALING
if (new_fb == NULL) {
const int new_fb_idx = get_free_fb(cm);
if (new_fb_idx == INVALID_IDX) {
@@ -570,30 +556,18 @@
else
av1_resize_and_extend_frame_nonnormative(
ref, &new_fb->buf, (int)cm->seq_params.bit_depth, num_planes);
-#if CONFIG_NEW_REF_SIGNALING
cpi->scaled_ref_buf[ref_frame] = new_fb;
-#else
- cpi->scaled_ref_buf[ref_frame - 1] = new_fb;
-#endif // CONFIG_NEW_REF_SIGNALING
alloc_frame_mvs(cm, new_fb);
}
} else {
RefCntBuffer *buf = get_ref_frame_buf(cm, ref_frame);
buf->buf.y_crop_width = ref->y_crop_width;
buf->buf.y_crop_height = ref->y_crop_height;
-#if CONFIG_NEW_REF_SIGNALING
cpi->scaled_ref_buf[ref_frame] = buf;
-#else
- cpi->scaled_ref_buf[ref_frame - 1] = buf;
-#endif // CONFIG_NEW_REF_SIGNALING
++buf->ref_count;
}
} else {
-#if CONFIG_NEW_REF_SIGNALING
if (!has_no_stats_stage(cpi)) cpi->scaled_ref_buf[ref_frame] = NULL;
-#else
- if (!has_no_stats_stage(cpi)) cpi->scaled_ref_buf[ref_frame - 1] = NULL;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
}
@@ -826,11 +800,7 @@
int *const gm_params_cost) {
int i;
int recode = 0;
-#if CONFIG_NEW_REF_SIGNALING
for (i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (global_motion[i].wmtype != IDENTITY &&
global_motion_used[i] * GM_RECODE_LOOP_NUM4X4_FACTOR <
gm_params_cost[i]) {
diff --git a/av1/encoder/encoder_utils.h b/av1/encoder/encoder_utils.h
index 2d79598..cc379ce 100644
--- a/av1/encoder/encoder_utils.h
+++ b/av1/encoder/encoder_utils.h
@@ -139,11 +139,7 @@
static AOM_INLINE void init_buffer_indices(
ForceIntegerMVInfo *const force_intpel_info, int *const remapped_ref_idx) {
int fb_idx;
-#if CONFIG_NEW_REF_SIGNALING
for (fb_idx = 0; fb_idx < INTER_REFS_PER_FRAME; ++fb_idx)
-#else
- for (fb_idx = 0; fb_idx < REF_FRAMES; ++fb_idx)
-#endif // CONFIG_NEW_REF_SIGNALING
remapped_ref_idx[fb_idx] = fb_idx;
force_intpel_info->rate_index = 0;
force_intpel_info->rate_size = 0;
@@ -884,11 +880,7 @@
static AOM_INLINE void set_size_independent_vars(AV1_COMP *cpi) {
int i;
AV1_COMMON *const cm = &cpi->common;
-#if CONFIG_NEW_REF_SIGNALING
for (i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
cm->global_motion[i] = default_warp_params;
}
cpi->gm_info.search_done = 0;
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index 8c89e5e..ae5ee7c 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -27,11 +27,7 @@
for (int i = 0; i < REFERENCE_MODES; i++)
td->rd_counts.comp_pred_diff[i] += td_t->rd_counts.comp_pred_diff[i];
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; i++)
-#else
- for (int i = 0; i < REF_FRAMES; i++)
-#endif // CONFIG_NEW_REF_SIGNALING
td->rd_counts.global_motion_used[i] +=
td_t->rd_counts.global_motion_used[i];
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index 47b7eea..cf7332c 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -686,11 +686,7 @@
xd->mi[0]->mode = NEWMV;
xd->mi[0]->mv[0].as_mv = best_mv;
xd->mi[0]->tx_size = TX_4X4;
-#if CONFIG_NEW_REF_SIGNALING
xd->mi[0]->ref_frame[0] = get_closest_pastcur_ref_index(cm);
-#else
- xd->mi[0]->ref_frame[0] = LAST_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
xd->mi[0]->ref_frame[1] = NONE_FRAME;
av1_enc_build_inter_predictor(cm, xd, mb_row * mb_scale, mb_col * mb_scale,
NULL, bsize, AOM_PLANE_Y, AOM_PLANE_Y);
@@ -929,13 +925,11 @@
}
}
-#if CONFIG_NEW_REF_SIGNALING
// First pass inter prediction relies on last and golden frames as reference
// frames. In new reference framework, references with rank 0 and 2 are used
// as their proxies.
#define LAST_FRAME_PROXY 0
#define GOLDEN_FRAME_PROXY 2 // Any proxy index will do
-#endif // CONFIG_NEW_REF_SIGNALING
void av1_first_pass_row(AV1_COMP *cpi, ThreadData *td, TileDataEnc *tile_data,
int mb_row) {
@@ -961,17 +955,10 @@
AV1EncRowMultiThreadSync *const row_mt_sync = &tile_data->row_mt_sync;
xd->tile = *tile;
-#if CONFIG_NEW_REF_SIGNALING
const YV12_BUFFER_CONFIG *const last_frame =
get_ref_frame_yv12_buf(cm, LAST_FRAME_PROXY);
const YV12_BUFFER_CONFIG *golden_frame =
get_ref_frame_yv12_buf(cm, GOLDEN_FRAME_PROXY);
-#else
- const YV12_BUFFER_CONFIG *const last_frame =
- get_ref_frame_yv12_buf(cm, LAST_FRAME);
- const YV12_BUFFER_CONFIG *golden_frame =
- get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
const YV12_BUFFER_CONFIG *alt_ref_frame = NULL;
const int alt_ref_offset =
FIRST_PASS_ALT_REF_DISTANCE -
@@ -1130,17 +1117,10 @@
av1_init_tile_data(cpi);
-#if CONFIG_NEW_REF_SIGNALING
const YV12_BUFFER_CONFIG *const last_frame =
get_ref_frame_yv12_buf(cm, LAST_FRAME_PROXY);
const YV12_BUFFER_CONFIG *golden_frame =
get_ref_frame_yv12_buf(cm, GOLDEN_FRAME_PROXY);
-#else
- const YV12_BUFFER_CONFIG *const last_frame =
- get_ref_frame_yv12_buf(cm, LAST_FRAME);
- const YV12_BUFFER_CONFIG *golden_frame =
- get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
YV12_BUFFER_CONFIG *const this_frame = &cm->cur_frame->buf;
// First pass code requires valid last and new frame buffers.
assert(this_frame != NULL);
@@ -1239,15 +1219,9 @@
((this_frame_stats->intra_error /
DOUBLE_DIVIDE_CHECK(this_frame_stats->coded_error)) > 2.0))) {
if (golden_frame != NULL) {
-#if CONFIG_NEW_REF_SIGNALING
assign_frame_buffer_p(
&cm->ref_frame_map[get_ref_frame_map_idx(cm, GOLDEN_FRAME_PROXY)],
cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME_PROXY)]);
-#else
- assign_frame_buffer_p(
- &cm->ref_frame_map[get_ref_frame_map_idx(cm, GOLDEN_FRAME)],
- cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME)]);
-#endif // CONFIG_NEW_REF_SIGNALING
}
twopass->sr_update_lag = 1;
} else {
@@ -1257,32 +1231,18 @@
aom_extend_frame_borders(this_frame, num_planes);
// The frame we just compressed now becomes the last frame.
-#if CONFIG_NEW_REF_SIGNALING
assign_frame_buffer_p(
&cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME_PROXY)],
cm->cur_frame);
-#else
- assign_frame_buffer_p(
- &cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME)], cm->cur_frame);
-#endif // CONFIG_NEW_REF_SIGNALING
// Special case for the first frame. Copy into the GF buffer as a second
// reference.
-#if CONFIG_NEW_REF_SIGNALING
if (current_frame->frame_number == 0 &&
get_ref_frame_map_idx(cm, GOLDEN_FRAME_PROXY) != INVALID_IDX) {
assign_frame_buffer_p(
&cm->ref_frame_map[get_ref_frame_map_idx(cm, GOLDEN_FRAME_PROXY)],
cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME_PROXY)]);
}
-#else
- if (current_frame->frame_number == 0 &&
- get_ref_frame_map_idx(cm, GOLDEN_FRAME) != INVALID_IDX) {
- assign_frame_buffer_p(
- &cm->ref_frame_map[get_ref_frame_map_idx(cm, GOLDEN_FRAME)],
- cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME)]);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
print_reconstruction_frame(last_frame, current_frame->frame_number,
/*do_print=*/0);
diff --git a/av1/encoder/global_motion_facade.c b/av1/encoder/global_motion_facade.c
index 9fc6d8a..7e28cab 100644
--- a/av1/encoder/global_motion_facade.c
+++ b/av1/encoder/global_motion_facade.c
@@ -96,13 +96,8 @@
// For the given reference frame, computes the global motion parameters for
// different motion models and finds the best.
static AOM_INLINE void compute_global_motion_for_ref_frame(
- AV1_COMP *cpi,
-#if CONFIG_NEW_REF_SIGNALING
- YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
-#else
- YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES],
-#endif // CONFIG_NEW_REF_SIGNALING
- int frame, int num_src_corners, int *src_corners, unsigned char *src_buffer,
+ AV1_COMP *cpi, YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME], int frame,
+ int num_src_corners, int *src_corners, unsigned char *src_buffer,
MotionModel *params_by_motion, uint8_t *segment_map,
const int segment_map_w, const int segment_map_h,
const WarpedMotionParams *ref_params) {
@@ -130,15 +125,9 @@
// TODO(sarahparker, debargha): Explore do_adaptive_gm_estimation = 1
const int do_adaptive_gm_estimation = 0;
-#if CONFIG_NEW_REF_SIGNALING
const int ref_frame_dist = get_relative_dist(
&cm->seq_params.order_hint_info, cm->current_frame.order_hint,
cm->cur_frame->ref_order_hints[frame]);
-#else
- const int ref_frame_dist = get_relative_dist(
- &cm->seq_params.order_hint_info, cm->current_frame.order_hint,
- cm->cur_frame->ref_order_hints[frame - LAST_FRAME]);
-#endif // CONFIG_NEW_REF_SIGNALING
const GlobalMotionEstimationType gm_estimation_type =
cm->seq_params.order_hint_info.enable_order_hint &&
abs(ref_frame_dist) <= 2 && do_adaptive_gm_estimation
@@ -244,13 +233,8 @@
// Computes global motion for the given reference frame.
void av1_compute_gm_for_valid_ref_frames(
- AV1_COMP *cpi,
-#if CONFIG_NEW_REF_SIGNALING
- YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
-#else
- YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES],
-#endif // CONFIG_NEW_REF_SIGNALING
- int frame, int num_src_corners, int *src_corners, unsigned char *src_buffer,
+ AV1_COMP *cpi, YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME], int frame,
+ int num_src_corners, int *src_corners, unsigned char *src_buffer,
MotionModel *params_by_motion, uint8_t *segment_map, int segment_map_w,
int segment_map_h) {
AV1_COMMON *const cm = &cpi->common;
@@ -276,17 +260,11 @@
// Loops over valid reference frames and computes global motion estimation.
static AOM_INLINE void compute_global_motion_for_references(
- AV1_COMP *cpi,
-#if CONFIG_NEW_REF_SIGNALING
- YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
- FrameDistPair reference_frame[INTER_REFS_PER_FRAME],
-#else
- YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES],
- FrameDistPair reference_frame[REF_FRAMES - 1],
-#endif // CONFIG_NEW_REF_SIGNALING
- int num_ref_frames, int num_src_corners, int *src_corners,
- unsigned char *src_buffer, MotionModel *params_by_motion,
- uint8_t *segment_map, const int segment_map_w, const int segment_map_h) {
+ AV1_COMP *cpi, YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
+ FrameDistPair reference_frame[INTER_REFS_PER_FRAME], int num_ref_frames,
+ int num_src_corners, int *src_corners, unsigned char *src_buffer,
+ MotionModel *params_by_motion, uint8_t *segment_map,
+ const int segment_map_w, const int segment_map_h) {
// Computation of frame corners for the source frame will be done already.
assert(num_src_corners != -1);
AV1_COMMON *const cm = &cpi->common;
@@ -323,7 +301,6 @@
// Function to decide if we can skip the global motion parameter computation
// for a particular ref frame.
-#if CONFIG_NEW_REF_SIGNALING
static AOM_INLINE int skip_gm_frame(AV1_COMMON *const cm, int refrank) {
const RefCntBuffer *const refbuf = get_ref_frame_buf(cm, refrank);
if (refbuf == NULL) return 1;
@@ -354,47 +331,12 @@
}
return 1;
}
-#else
-static AOM_INLINE int skip_gm_frame(AV1_COMMON *const cm, int ref_frame) {
- if ((ref_frame == LAST3_FRAME || ref_frame == LAST2_FRAME) &&
- cm->global_motion[GOLDEN_FRAME].wmtype != IDENTITY) {
- return get_relative_dist(
- &cm->seq_params.order_hint_info,
- cm->cur_frame->ref_order_hints[ref_frame - LAST_FRAME],
- cm->cur_frame->ref_order_hints[GOLDEN_FRAME - LAST_FRAME]) <= 0;
- }
- return 0;
-}
-
-// Prunes reference frames for global motion estimation based on the speed
-// feature 'gm_search_type'.
-static int do_gm_search_logic(SPEED_FEATURES *const sf, int frame) {
- (void)frame;
- switch (sf->gm_sf.gm_search_type) {
- case GM_FULL_SEARCH: return 1;
- case GM_REDUCED_REF_SEARCH_SKIP_L2_L3:
- return !(frame == LAST2_FRAME || frame == LAST3_FRAME);
- case GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2:
- return !(frame == LAST2_FRAME || frame == LAST3_FRAME ||
- (frame == ALTREF2_FRAME));
- case GM_DISABLE_SEARCH: return 0;
- default: assert(0);
- }
- return 1;
-}
-#endif // CONFIG_NEW_REF_SIGNALING
// Populates valid reference frames in past/future directions in
// 'reference_frames' and their count in 'num_ref_frames'.
static AOM_INLINE void update_valid_ref_frames_for_gm(
- AV1_COMP *cpi,
-#if CONFIG_NEW_REF_SIGNALING
- YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
+ AV1_COMP *cpi, YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
FrameDistPair reference_frames[MAX_DIRECTIONS][INTER_REFS_PER_FRAME],
-#else
- YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES],
- FrameDistPair reference_frames[MAX_DIRECTIONS][REF_FRAMES - 1],
-#endif // CONFIG_NEW_REF_SIGNALING
int *num_ref_frames) {
AV1_COMMON *const cm = &cpi->common;
int *num_past_ref_frames = &num_ref_frames[0];
@@ -403,7 +345,6 @@
int ref_pruning_enabled = is_frame_eligible_for_ref_pruning(
gf_group, cpi->sf.inter_sf.selective_ref_frame, 1, gf_group->index);
-#if CONFIG_NEW_REF_SIGNALING
for (int frame = cm->ref_frames_info.num_total_refs - 1; frame >= 0;
--frame) {
const MV_REFERENCE_FRAME ref_frame[2] = { frame, NONE_FRAME };
@@ -411,12 +352,6 @@
assert(frame <= INTER_REFS_PER_FRAME);
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
const int ref_disabled = !(cm->ref_frame_flags & (1 << frame));
-#else
- for (int frame = ALTREF_FRAME; frame >= LAST_FRAME; --frame) {
- const MV_REFERENCE_FRAME ref_frame[2] = { frame, NONE_FRAME };
- const int ref_disabled =
- !(cm->ref_frame_flags & av1_ref_frame_flag_list[frame]);
-#endif // CONFIG_NEW_REF_SIGNALING
ref_buf[frame] = NULL;
cm->global_motion[frame] = default_warp_params;
RefCntBuffer *buf = get_ref_frame_buf(cm, frame);
@@ -429,26 +364,14 @@
ref_buf[frame] = &buf->buf;
}
-#if CONFIG_NEW_REF_SIGNALING
int prune_ref_frames =
ref_pruning_enabled &&
prune_ref_by_selective_ref_frame(cpi, NULL, ref_frame);
-#else
- int prune_ref_frames =
- ref_pruning_enabled &&
- prune_ref_by_selective_ref_frame(cpi, NULL, ref_frame,
- cm->cur_frame->ref_display_order_hint);
-#endif // CONFIG_NEW_REF_SIGNALING
if (ref_buf[frame]->y_crop_width == cpi->source->y_crop_width &&
ref_buf[frame]->y_crop_height == cpi->source->y_crop_height &&
-#if CONFIG_NEW_REF_SIGNALING
do_gm_search_logic(&cpi->sf, ref_frame[0]) &&
!(cpi->sf.gm_sf.selective_ref_gm && skip_gm_frame(cm, ref_frame[0])) &&
-#else
- do_gm_search_logic(&cpi->sf, frame) &&
- !(cpi->sf.gm_sf.selective_ref_gm && skip_gm_frame(cm, frame)) &&
-#endif // CONFIG_NEW_REF_SIGNALING
!prune_ref_frames) {
assert(ref_buf[frame] != NULL);
const int relative_frame_dist = av1_encoder_get_relative_dist(
@@ -512,15 +435,9 @@
gm_info->segment_map_h =
(source->y_height + WARP_ERROR_BLOCK) >> WARP_ERROR_BLOCK_LOG;
-#if CONFIG_NEW_REF_SIGNALING
memset(gm_info->reference_frames, -1,
sizeof(gm_info->reference_frames[0][0]) * MAX_DIRECTIONS *
(INTER_REFS_PER_FRAME));
-#else
- memset(gm_info->reference_frames, -1,
- sizeof(gm_info->reference_frames[0][0]) * MAX_DIRECTIONS *
- (REF_FRAMES - 1));
-#endif // CONFIG_NEW_REF_SIGNALING
av1_zero(gm_info->num_ref_frames);
// Populate ref_buf for valid ref frames in global motion
diff --git a/av1/encoder/global_motion_facade.h b/av1/encoder/global_motion_facade.h
index 474cebb..7768946 100644
--- a/av1/encoder/global_motion_facade.h
+++ b/av1/encoder/global_motion_facade.h
@@ -20,12 +20,7 @@
struct AV1_COMP;
void av1_compute_gm_for_valid_ref_frames(
- struct AV1_COMP *cpi,
-#if CONFIG_NEW_REF_SIGNALING
- YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
-#else
- YV12_BUFFER_CONFIG *ref_buf[REF_FRAMES],
-#endif // CONFIG_NEW_REF_SIGNALING
+ struct AV1_COMP *cpi, YV12_BUFFER_CONFIG *ref_buf[INTER_REFS_PER_FRAME],
int frame, int num_src_corners, int *src_corners, unsigned char *src_buffer,
MotionModel *params_by_motion, uint8_t *segment_map, int segment_map_w,
int segment_map_h);
diff --git a/av1/encoder/interp_search.c b/av1/encoder/interp_search.c
index eb2beb6..d3108aa 100644
--- a/av1/encoder/interp_search.c
+++ b/av1/encoder/interp_search.c
@@ -409,11 +409,7 @@
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = xd->mi[0];
const int need_search = av1_is_interp_needed(cm, xd);
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_frame = COMPACT_INDEX0_NRS(xd->mi[0]->ref_frame[0]);
-#else
- const int ref_frame = xd->mi[0]->ref_frame[0];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
RD_STATS rd_stats_luma, rd_stats;
#if CONFIG_WARPMV
diff --git a/av1/encoder/model_rd.h b/av1/encoder/model_rd.h
index b420db3..64c2342 100644
--- a/av1/encoder/model_rd.h
+++ b/av1/encoder/model_rd.h
@@ -164,11 +164,7 @@
// Hence quantizer step is also 8 times. To get effective quantizer
// we need to divide by 8 before sending to modeling function.
int plane;
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref = COMPACT_INDEX0_NRS(xd->mi[0]->ref_frame[0]);
-#else
- const int ref = xd->mi[0]->ref_frame[0];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
int64_t rate_sum = 0;
int64_t dist_sum = 0;
@@ -219,11 +215,7 @@
// Note our transform coeffs are 8 times an orthogonal transform.
// Hence quantizer step is also 8 times. To get effective quantizer
// we need to divide by 8 before sending to modeling function.
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref = COMPACT_INDEX0_NRS(xd->mi[0]->ref_frame[0]);
-#else
- const int ref = xd->mi[0]->ref_frame[0];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
int64_t rate_sum = 0;
int64_t dist_sum = 0;
diff --git a/av1/encoder/motion_search_facade.c b/av1/encoder/motion_search_facade.c
index df864d5..9d334fb 100644
--- a/av1/encoder/motion_search_facade.c
+++ b/av1/encoder/motion_search_facade.c
@@ -88,16 +88,10 @@
// Take the weighted average of the step_params based on the last frame's
// max mv magnitude and that based on the best ref mvs of the current
// block for the given reference.
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_frame_idx = COMPACT_INDEX0_NRS(ref);
step_param = (av1_init_search_range(x->max_mv_context[ref_frame_idx]) +
mv_search_params->mv_step_param) /
2;
-#else
- step_param = (av1_init_search_range(x->max_mv_context[ref]) +
- mv_search_params->mv_step_param) /
- 2;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
} else {
step_param = mv_search_params->mv_step_param;
}
@@ -164,13 +158,8 @@
for (int k = 0; k < nh; k++) {
for (int l = 0; l < nw; l++) {
-#if CONFIG_NEW_REF_SIGNALING
const int_mv mv =
sb_enc->tpl_mv[start + k * sb_enc->tpl_stride + l][ref];
-#else
- const int_mv mv = sb_enc->tpl_mv[start + k * sb_enc->tpl_stride + l]
- [ref - LAST_FRAME];
-#endif // CONFIG_NEW_REF_SIGNALING
if (mv.as_int == INVALID_MV) {
valid = 0;
break;
@@ -397,11 +386,7 @@
int_mv fractional_ms_list[3];
av1_set_fractional_mv(fractional_ms_list);
int dis; /* TODO: use dis in distortion calculation later. */
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_pred = COMPACT_INDEX0_NRS(ref);
-#else
- const int ref_pred = ref;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
SUBPEL_MOTION_SEARCH_PARAMS ms_params;
av1_make_default_subpel_ms_params(&ms_params, cpi, x, bsize, &ref_mv,
@@ -1585,12 +1570,7 @@
cpi->mv_search_params.find_fractional_mv_step(
xd, cm, &ms_params, subpel_start_mv, &best_mv.as_mv, ¬_used,
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
- &x->pred_sse[COMPACT_INDEX0_NRS(ref)],
-#else
- &x->pred_sse[ref],
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
- NULL);
+ &x->pred_sse[COMPACT_INDEX0_NRS(ref)], NULL);
} else {
// Manually convert from units of pixel to 1/8-pixels if we are not doing
// subpel search
@@ -1617,12 +1597,7 @@
const FULLPEL_MV start_mv, int use_subpixel,
unsigned int *sse, unsigned int *var) {
MACROBLOCKD *xd = &x->e_mbd;
-#if CONFIG_NEW_REF_SIGNALING
const MV_REFERENCE_FRAME ref = get_closest_pastcur_ref_index(&cpi->common);
-#else
- const MV_REFERENCE_FRAME ref =
- cpi->rc.is_src_frame_alt_ref ? ALTREF_FRAME : LAST_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
int_mv best_mv = av1_simple_motion_search(cpi, x, mi_row, mi_col, bsize, ref,
start_mv, 1, use_subpixel);
diff --git a/av1/encoder/partition_search.c b/av1/encoder/partition_search.c
index 8d48ca0..e28b625 100644
--- a/av1/encoder/partition_search.c
+++ b/av1/encoder/partition_search.c
@@ -1049,12 +1049,7 @@
const CurrentFrame *const current_frame = &cm->current_frame;
const BLOCK_SIZE bsize = mbmi->sb_type[xd->tree_type == CHROMA_PART];
FRAME_CONTEXT *fc = xd->tile_ctx;
-#if CONFIG_NEW_REF_SIGNALING
const int seg_ref_active = 0;
-#else
- const int seg_ref_active =
- segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
if (current_frame->skip_mode_info.skip_mode_flag && !seg_ref_active &&
is_comp_ref_allowed(bsize)) {
@@ -1244,7 +1239,6 @@
}
if (has_second_ref(mbmi)) {
-#if CONFIG_NEW_REF_SIGNALING
const int n_refs = cm->ref_frames_info.num_total_refs;
int n_bits = 0;
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -1279,83 +1273,11 @@
if (i < cm->ref_frames_info.num_same_ref_compound) i -= bit;
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
}
-#else
- const COMP_REFERENCE_TYPE comp_ref_type = has_uni_comp_refs(mbmi)
- ? UNIDIR_COMP_REFERENCE
- : BIDIR_COMP_REFERENCE;
- update_cdf(av1_get_comp_reference_type_cdf(xd), comp_ref_type,
- COMP_REFERENCE_TYPES);
-#if CONFIG_ENTROPY_STATS
- counts->comp_ref_type[av1_get_comp_reference_type_context(xd)]
- [comp_ref_type]++;
-#endif // CONFIG_ENTROPY_STATS
-
- if (comp_ref_type == UNIDIR_COMP_REFERENCE) {
- const int bit = (ref0 == BWDREF_FRAME);
- update_cdf(av1_get_pred_cdf_uni_comp_ref_p(xd), bit, 2);
-#if CONFIG_ENTROPY_STATS
- counts
- ->uni_comp_ref[av1_get_pred_context_uni_comp_ref_p(xd)][0][bit]++;
-#endif // CONFIG_ENTROPY_STATS
- if (!bit) {
- const int bit1 = (ref1 == LAST3_FRAME || ref1 == GOLDEN_FRAME);
- update_cdf(av1_get_pred_cdf_uni_comp_ref_p1(xd), bit1, 2);
-#if CONFIG_ENTROPY_STATS
- counts->uni_comp_ref[av1_get_pred_context_uni_comp_ref_p1(xd)][1]
- [bit1]++;
-#endif // CONFIG_ENTROPY_STATS
- if (bit1) {
- update_cdf(av1_get_pred_cdf_uni_comp_ref_p2(xd),
- ref1 == GOLDEN_FRAME, 2);
-#if CONFIG_ENTROPY_STATS
- counts->uni_comp_ref[av1_get_pred_context_uni_comp_ref_p2(xd)][2]
- [ref1 == GOLDEN_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- }
- }
- } else {
- const int bit = (ref0 == GOLDEN_FRAME || ref0 == LAST3_FRAME);
- update_cdf(av1_get_pred_cdf_comp_ref_p(xd), bit, 2);
-#if CONFIG_ENTROPY_STATS
- counts->comp_ref[av1_get_pred_context_comp_ref_p(xd)][0][bit]++;
-#endif // CONFIG_ENTROPY_STATS
- if (!bit) {
- update_cdf(av1_get_pred_cdf_comp_ref_p1(xd), ref0 == LAST2_FRAME,
- 2);
-#if CONFIG_ENTROPY_STATS
- counts->comp_ref[av1_get_pred_context_comp_ref_p1(xd)][1]
- [ref0 == LAST2_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- } else {
- update_cdf(av1_get_pred_cdf_comp_ref_p2(xd), ref0 == GOLDEN_FRAME,
- 2);
-#if CONFIG_ENTROPY_STATS
- counts->comp_ref[av1_get_pred_context_comp_ref_p2(xd)][2]
- [ref0 == GOLDEN_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- }
- update_cdf(av1_get_pred_cdf_comp_bwdref_p(xd), ref1 == ALTREF_FRAME,
- 2);
-#if CONFIG_ENTROPY_STATS
- counts->comp_bwdref[av1_get_pred_context_comp_bwdref_p(xd)][0]
- [ref1 == ALTREF_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- if (ref1 != ALTREF_FRAME) {
- update_cdf(av1_get_pred_cdf_comp_bwdref_p1(xd),
- ref1 == ALTREF2_FRAME, 2);
-#if CONFIG_ENTROPY_STATS
- counts->comp_bwdref[av1_get_pred_context_comp_bwdref_p1(xd)][1]
- [ref1 == ALTREF2_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
} else if (!is_tip_ref_frame(ref0)) {
#else
} else {
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
const int n_refs = cm->ref_frames_info.num_total_refs;
const MV_REFERENCE_FRAME ref0_nrs = mbmi->ref_frame[0];
for (int i = 0; i < n_refs - 1; i++) {
@@ -1366,51 +1288,6 @@
#endif // CONFIG_ENTROPY_STATS
if (bit) break;
}
-#else
- const int bit = (ref0 >= BWDREF_FRAME);
- update_cdf(av1_get_pred_cdf_single_ref_p1(xd), bit, 2);
-#if CONFIG_ENTROPY_STATS
- counts->single_ref[av1_get_pred_context_single_ref_p1(xd)][0][bit]++;
-#endif // CONFIG_ENTROPY_STATS
- if (bit) {
- assert(ref0 <= ALTREF_FRAME);
- update_cdf(av1_get_pred_cdf_single_ref_p2(xd), ref0 == ALTREF_FRAME,
- 2);
-#if CONFIG_ENTROPY_STATS
- counts->single_ref[av1_get_pred_context_single_ref_p2(xd)][1]
- [ref0 == ALTREF_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- if (ref0 != ALTREF_FRAME) {
- update_cdf(av1_get_pred_cdf_single_ref_p6(xd),
- ref0 == ALTREF2_FRAME, 2);
-#if CONFIG_ENTROPY_STATS
- counts->single_ref[av1_get_pred_context_single_ref_p6(xd)][5]
- [ref0 == ALTREF2_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- }
- } else {
- const int bit1 = !(ref0 == LAST2_FRAME || ref0 == LAST_FRAME);
- update_cdf(av1_get_pred_cdf_single_ref_p3(xd), bit1, 2);
-#if CONFIG_ENTROPY_STATS
- counts->single_ref[av1_get_pred_context_single_ref_p3(xd)][2][bit1]++;
-#endif // CONFIG_ENTROPY_STATS
- if (!bit1) {
- update_cdf(av1_get_pred_cdf_single_ref_p4(xd), ref0 != LAST_FRAME,
- 2);
-#if CONFIG_ENTROPY_STATS
- counts->single_ref[av1_get_pred_context_single_ref_p4(xd)][3]
- [ref0 != LAST_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- } else {
- update_cdf(av1_get_pred_cdf_single_ref_p5(xd), ref0 != LAST3_FRAME,
- 2);
-#if CONFIG_ENTROPY_STATS
- counts->single_ref[av1_get_pred_context_single_ref_p5(xd)][4]
- [ref0 != LAST3_FRAME]++;
-#endif // CONFIG_ENTROPY_STATS
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
#if CONFIG_BAWP
@@ -1960,12 +1837,7 @@
}
set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
} else {
-#if CONFIG_NEW_REF_SIGNALING
const int seg_ref_active = 0;
-#else
- const int seg_ref_active =
- segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
if (!seg_ref_active) {
// If the segment reference feature is enabled we have only a single
// reference frame allowed for the segment so exclude it from
@@ -1995,12 +1867,7 @@
cpi->sf.inter_sf.prune_warped_prob_thresh > 0)) {
#endif // CONFIG_EXTENDED_WARP_PREDICTION
const int inter_block = is_inter_block(mbmi, xd->tree_type);
-#if CONFIG_NEW_REF_SIGNALING
const int seg_ref_active = 0;
-#else
- const int seg_ref_active =
- segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
if (!seg_ref_active && inter_block) {
#if CONFIG_EXTENDED_WARP_PREDICTION
const int allowed_motion_modes = motion_mode_allowed(
@@ -2043,13 +1910,8 @@
&cpi->common.current_frame.skip_mode_info;
MV_REFERENCE_FRAME rf[2];
-#if CONFIG_NEW_REF_SIGNALING
rf[0] = skip_mode_info->ref_frame_idx_0;
rf[1] = skip_mode_info->ref_frame_idx_1;
-#else
- rf[0] = LAST_FRAME + skip_mode_info->ref_frame_idx_0;
- rf[1] = LAST_FRAME + skip_mode_info->ref_frame_idx_1;
-#endif // CONFIG_NEW_REF_SIGNALING
MV_REFERENCE_FRAME ref_frame_type = av1_ref_frame_type(rf);
av1_find_mv_refs(&cpi->common, xd, mbmi, ref_frame_type,
diff --git a/av1/encoder/partition_strategy.c b/av1/encoder/partition_strategy.c
index b5e10b7..812bc50 100644
--- a/av1/encoder/partition_strategy.c
+++ b/av1/encoder/partition_strategy.c
@@ -341,12 +341,8 @@
for (int ref_idx = 0; ref_idx < num_refs; ref_idx++) {
const int ref = refs[ref_idx];
-#if CONFIG_NEW_REF_SIGNALING
if (ref == INVALID_IDX) continue;
if (cm->ref_frame_flags & (1 << ref)) {
-#else
- if (cm->ref_frame_flags & av1_ref_frame_flag_list[ref]) {
-#endif // CONFIG_NEW_REF_SIGNALING
const FULLPEL_MV *start_mvs = sms_tree->start_mvs;
unsigned int curr_sse = 0, curr_var = 0;
int_mv best_mv =
@@ -402,23 +398,7 @@
assert(mi_size_wide[bsize] == mi_size_high[bsize]);
// Setting up motion search
int ref_list[1];
-#if CONFIG_NEW_REF_SIGNALING
ref_list[0] = get_closest_pastcur_ref_index(&cpi->common);
-#else
- ref_list[0] = LAST_FRAME;
- if (!(cpi->common.ref_frame_flags & av1_ref_frame_flag_list[LAST_FRAME]) &&
- !(cpi->common.ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME])) {
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; i++) {
- if (cpi->common.ref_frame_flags & av1_ref_frame_flag_list[i]) {
- ref_list[0] = i;
- break;
- }
- }
- } else {
- // Setting up motion search
- ref_list[0] = cpi->rc.is_src_frame_alt_ref ? ALTREF_FRAME : LAST_FRAME;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
const int num_refs = 1;
const int use_subpixel = 1;
@@ -1750,12 +1730,7 @@
MACROBLOCK *x, SimpleMotionData *sms_data,
int mi_row, int mi_col, BLOCK_SIZE bsize) {
const AV1_COMMON *const cm = &cpi->common;
-#if CONFIG_NEW_REF_SIGNALING
const int ref_frame = get_closest_pastcur_ref_index(cm);
-#else
- const int ref_frame =
- cpi->rc.is_src_frame_alt_ref ? ALTREF_FRAME : LAST_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
assert(ref_frame >= 0);
if (mi_col >= cm->mi_params.mi_cols || mi_row >= cm->mi_params.mi_rows) {
// If the whole block is outside of the image, set the var and sse to 0.
@@ -1776,11 +1751,7 @@
setup_block_rdmult(cpi, x, mi_row, mi_col, bsize, aq_mode, mbmi);
// Set error per bit for current rdmult
av1_set_error_per_bit(&x->mv_costs, x->rdmult);
-#if CONFIG_NEW_REF_SIGNALING
if (cm->ref_frame_flags & (1 << ref_frame)) {
-#else
- if (cm->ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
-#endif // CONFIG_NEW_REF_SIGNALING
const MACROBLOCKD *xd = &x->e_mbd;
const uint16_t *src_buf = x->plane[0].src.buf;
const uint16_t *dst_buf = xd->plane[0].dst.buf;
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index fd04d39..72ce6dd 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -405,12 +405,8 @@
static int adjust_q_cbr(const AV1_COMP *cpi, int q, int active_worst_quality) {
const RATE_CONTROL *const rc = &cpi->rc;
const AV1_COMMON *const cm = &cpi->common;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const int max_delta = 16;
const int change_avg_frame_bandwidth =
abs(rc->avg_frame_bandwidth - rc->prev_avg_frame_bandwidth) >
@@ -424,13 +420,7 @@
// Apply some control/clamp to QP under certain conditions.
if (cm->current_frame.frame_type != KEY_FRAME && rc->frames_since_key > 1 &&
!change_target_bits_mb &&
- (!cpi->oxcf.rc_cfg.gf_cbr_boost_pct ||
-#if CONFIG_NEW_REF_SIGNALING
- (level > 1))) {
-#else
- !(refresh_frame_flags->alt_ref_frame ||
- refresh_frame_flags->golden_frame))) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ (!cpi->oxcf.rc_cfg.gf_cbr_boost_pct || (level > 1))) {
// Make sure q is between oscillating Qs to prevent resonance.
if (rc->rc_1_frame * rc->rc_2_frame == -1 &&
rc->q_1_frame != rc->q_2_frame) {
@@ -482,12 +472,8 @@
static double get_rate_correction_factor(const AV1_COMP *cpi, int width,
int height) {
const RATE_CONTROL *const rc = &cpi->rc;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
double rcf;
if (cpi->common.current_frame.frame_type == KEY_FRAME) {
@@ -496,16 +482,8 @@
const RATE_FACTOR_LEVEL rf_lvl = get_rate_factor_level(&cpi->gf_group);
rcf = rc->rate_correction_factors[rf_lvl];
} else {
- if (
-#if CONFIG_NEW_REF_SIGNALING
- level <= 1 &&
-#else
- (refresh_frame_flags->alt_ref_frame ||
- refresh_frame_flags->golden_frame) &&
- !rc->is_src_frame_alt_ref &&
-#endif // CONFIG_NEW_REF_SIGNALING
- (cpi->oxcf.rc_cfg.mode != AOM_CBR ||
- cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 20))
+ if (level <= 1 && (cpi->oxcf.rc_cfg.mode != AOM_CBR ||
+ cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 20))
rcf = rc->rate_correction_factors[GF_ARF_STD];
else
rcf = rc->rate_correction_factors[INTER_NORMAL];
@@ -532,12 +510,8 @@
static void set_rate_correction_factor(AV1_COMP *cpi, double factor, int width,
int height) {
RATE_CONTROL *const rc = &cpi->rc;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
// Normalize RCF to account for the size-dependent scaling factor.
factor /= resize_rate_factor(&cpi->oxcf.frm_dim_cfg, width, height);
@@ -550,16 +524,8 @@
const RATE_FACTOR_LEVEL rf_lvl = get_rate_factor_level(&cpi->gf_group);
rc->rate_correction_factors[rf_lvl] = factor;
} else {
- if (
-#if CONFIG_NEW_REF_SIGNALING
- level <= 1 &&
-#else
- (refresh_frame_flags->alt_ref_frame ||
- refresh_frame_flags->golden_frame) &&
- !rc->is_src_frame_alt_ref &&
-#endif // CONFIG_NEW_REF_SIGNALING
- (cpi->oxcf.rc_cfg.mode != AOM_CBR ||
- cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 20))
+ if (level <= 1 && (cpi->oxcf.rc_cfg.mode != AOM_CBR ||
+ cpi->oxcf.rc_cfg.gf_cbr_boost_pct > 20))
rc->rate_correction_factors[GF_ARF_STD] = factor;
else
rc->rate_correction_factors[INTER_NORMAL] = factor;
@@ -797,12 +763,8 @@
static int calc_active_worst_quality_no_stats_vbr(const AV1_COMP *cpi) {
const RATE_CONTROL *const rc = &cpi->rc;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const unsigned int curr_frame = cpi->common.current_frame.frame_number;
int active_worst_quality;
@@ -810,13 +772,7 @@
active_worst_quality =
curr_frame == 0 ? rc->worst_quality : rc->last_q[KEY_FRAME] * 2;
} else {
-#if CONFIG_NEW_REF_SIGNALING
if (!rc->is_src_frame_alt_ref && level <= 1) {
-#else
- if (!rc->is_src_frame_alt_ref && (refresh_frame_flags->golden_frame ||
- refresh_frame_flags->bwd_ref_frame ||
- refresh_frame_flags->alt_ref_frame)) {
-#endif // CONFIG_NEW_REF_SIGNALING
active_worst_quality = curr_frame == 1 ? rc->last_q[KEY_FRAME] * 5 / 4
: rc->last_q[INTER_FRAME];
} else {
@@ -889,12 +845,8 @@
int width, int height) {
const AV1_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const CurrentFrame *const current_frame = &cm->current_frame;
int *rtc_minq;
const int bit_depth = cm->seq_params.bit_depth;
@@ -928,12 +880,7 @@
av1_compute_qdelta(rc, q_val, q_val * q_adj_factor, bit_depth);
}
} else if (!rc->is_src_frame_alt_ref && cpi->oxcf.rc_cfg.gf_cbr_boost_pct &&
-#if CONFIG_NEW_REF_SIGNALING
level <= 1) {
-#else
- (refresh_frame_flags->golden_frame ||
- refresh_frame_flags->alt_ref_frame)) {
-#endif // CONFIG_NEW_REF_SIGNALING
// Use the lower of active_worst_quality and recent
// average Q as basis for GF/ARF best Q limit unless last frame was
// a key frame.
@@ -1152,11 +1099,7 @@
const CurrentFrame *const current_frame = &cm->current_frame;
const AV1EncoderConfig *const oxcf = &cpi->oxcf;
const GF_GROUP *const gf_group = &cpi->gf_group;
-#if CONFIG_NEW_REF_SIGNALING
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const enum aom_rc_mode rc_mode = oxcf->rc_cfg.mode;
assert(has_no_stats_stage(cpi));
@@ -1215,13 +1158,7 @@
av1_compute_qdelta(rc, q_val, q_val * q_adj_factor, bit_depth);
}
}
- } else if (!rc->is_src_frame_alt_ref &&
-#if CONFIG_NEW_REF_SIGNALING
- level <= 1) {
-#else
- (refresh_frame_flags->golden_frame ||
- refresh_frame_flags->alt_ref_frame)) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ } else if (!rc->is_src_frame_alt_ref && level <= 1) {
// Use the lower of active_worst_quality and recent
// average Q as basis for GF/ARF best Q limit unless last frame was
// a key frame.
@@ -1240,13 +1177,8 @@
const int qindex = qp;
const double q_val = av1_convert_qindex_to_q(qindex, bit_depth);
const int delta_qindex =
-#if CONFIG_NEW_REF_SIGNALING
- (level <= 1)
-#else
- (refresh_frame_flags->alt_ref_frame)
-#endif // CONFIG_NEW_REF_SIGNALING
- ? av1_compute_qdelta(rc, q_val, q_val * 0.40, bit_depth)
- : av1_compute_qdelta(rc, q_val, q_val * 0.50, bit_depth);
+ (level <= 1) ? av1_compute_qdelta(rc, q_val, q_val * 0.40, bit_depth)
+ : av1_compute_qdelta(rc, q_val, q_val * 0.50, bit_depth);
active_best_quality = AOMMAX(qindex + delta_qindex, rc->best_quality);
} else {
active_best_quality = get_gf_active_quality(
@@ -1283,13 +1215,7 @@
qdelta = av1_compute_qdelta_by_rate(
&cpi->rc, current_frame->frame_type, active_worst_quality, 2.0,
cpi->is_screen_content_type, bit_depth);
- } else if (!rc->is_src_frame_alt_ref &&
-#if CONFIG_NEW_REF_SIGNALING
- (level <= 1)) {
-#else
- (refresh_frame_flags->golden_frame ||
- refresh_frame_flags->alt_ref_frame)) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ } else if (!rc->is_src_frame_alt_ref && (level <= 1)) {
qdelta = av1_compute_qdelta_by_rate(
&cpi->rc, current_frame->frame_type, active_worst_quality, 1.75,
cpi->is_screen_content_type, bit_depth);
@@ -1451,26 +1377,16 @@
int *active_best) {
const AV1_COMMON *const cm = &cpi->common;
const RATE_CONTROL *const rc = &cpi->rc;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const int bit_depth = cpi->common.seq_params.bit_depth;
int active_best_quality = *active_best;
int active_worst_quality = *active_worst;
// Extension to max or min Q if undershoot or overshoot is outside
// the permitted range.
if (cpi->oxcf.rc_cfg.mode != AOM_Q) {
- if (frame_is_intra_only(cm) || (!rc->is_src_frame_alt_ref &&
-#if CONFIG_NEW_REF_SIGNALING
- (level <= 1 || is_intrl_arf_boost))) {
-#else
- (refresh_frame_flags->golden_frame ||
- is_intrl_arf_boost ||
- refresh_frame_flags->alt_ref_frame))) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ if (frame_is_intra_only(cm) ||
+ (!rc->is_src_frame_alt_ref && (level <= 1 || is_intrl_arf_boost))) {
active_best_quality -=
(cpi->twopass.extend_minq + cpi->twopass.extend_minq_fast);
active_worst_quality += (cpi->twopass.extend_maxq / 2);
@@ -1664,11 +1580,7 @@
const RATE_CONTROL *const rc = &cpi->rc;
const AV1EncoderConfig *const oxcf = &cpi->oxcf;
const GF_GROUP *gf_group = &cpi->gf_group;
-#if CONFIG_NEW_REF_SIGNALING
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
assert(IMPLIES(has_no_stats_stage(cpi),
cpi->oxcf.rc_cfg.mode == AOM_Q &&
gf_group->update_type[gf_index] != ARF_UPDATE &&
@@ -1721,13 +1633,7 @@
// sections we dont clamp the Q at the same value for arf frames and
// leaf (non arf) frames. This is important to the TPL model which assumes
// Q drops with each arf level.
- if (!(rc->is_src_frame_alt_ref) &&
-#if CONFIG_NEW_REF_SIGNALING
- (level <= 1 || is_intrl_arf_boost)) {
-#else
- (refresh_frame_flags->golden_frame ||
- refresh_frame_flags->alt_ref_frame || is_intrl_arf_boost)) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ if (!(rc->is_src_frame_alt_ref) && (level <= 1 || is_intrl_arf_boost)) {
active_worst_quality =
(active_best_quality + (3 * active_worst_quality) + 2) / 4;
}
@@ -1833,15 +1739,10 @@
static void update_golden_frame_stats(AV1_COMP *cpi) {
RATE_CONTROL *const rc = &cpi->rc;
-#if CONFIG_NEW_REF_SIGNALING
const GF_GROUP *const gf_group = &cpi->gf_group;
// Update the Golden frame usage counts.
if (gf_group->update_type[gf_group->index] == GF_UPDATE ||
rc->is_src_frame_alt_ref) {
-#else
- // Update the Golden frame usage counts.
- if (cpi->refresh_frame.golden_frame || rc->is_src_frame_alt_ref) {
-#endif // CONFIG_NEW_REF_SIGNALING
rc->frames_since_golden = 0;
} else if (cpi->common.show_frame) {
rc->frames_since_golden++;
@@ -1853,11 +1754,7 @@
const CurrentFrame *const current_frame = &cm->current_frame;
RATE_CONTROL *const rc = &cpi->rc;
const GF_GROUP *const gf_group = &cpi->gf_group;
-#if CONFIG_NEW_REF_SIGNALING
const int level = gf_group->layer_depth[gf_group->index];
-#else
- const RefreshFrameFlagsInfo *const refresh_frame_flags = &cpi->refresh_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const int is_intrnl_arf =
gf_group->update_type[gf_group->index] == INTNL_ARF_UPDATE;
@@ -1876,13 +1773,7 @@
rc->avg_frame_qindex[KEY_FRAME] =
ROUND_POWER_OF_TWO(3 * rc->avg_frame_qindex[KEY_FRAME] + qindex, 2);
} else {
- if ((!rc->is_src_frame_alt_ref &&
-#if CONFIG_NEW_REF_SIGNALING
- !(level <= 1 || is_intrnl_arf))) {
-#else
- !(refresh_frame_flags->golden_frame || is_intrnl_arf ||
- refresh_frame_flags->alt_ref_frame))) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ if ((!rc->is_src_frame_alt_ref && !(level <= 1 || is_intrnl_arf))) {
rc->last_q[INTER_FRAME] = qindex;
rc->avg_frame_qindex[INTER_FRAME] =
ROUND_POWER_OF_TWO(3 * rc->avg_frame_qindex[INTER_FRAME] + qindex, 2);
@@ -1903,13 +1794,7 @@
// This is used to help set quality in forced key frames to reduce popping
if ((qindex < rc->last_boosted_qindex) ||
(current_frame->frame_type == KEY_FRAME) ||
- (!rc->constrained_gf_group &&
-#if CONFIG_NEW_REF_SIGNALING
- (level <= 1 || is_intrnl_arf))) {
-#else
- (refresh_frame_flags->alt_ref_frame || is_intrnl_arf ||
- (refresh_frame_flags->golden_frame && !rc->is_src_frame_alt_ref)))) {
-#endif // CONFIG_NEW_REF_SIGNALING
+ (!rc->constrained_gf_group && (level <= 1 || is_intrnl_arf))) {
rc->last_boosted_qindex = qindex;
}
if (current_frame->frame_type == KEY_FRAME) rc->last_kf_qindex = qindex;
@@ -1942,11 +1827,7 @@
if (is_altref_enabled(cpi->oxcf.gf_cfg.lag_in_frames,
cpi->oxcf.gf_cfg.enable_auto_arf) &&
-#if CONFIG_NEW_REF_SIGNALING
gf_group->update_type[gf_group->index] == ARF_UPDATE &&
-#else
- refresh_frame_flags->alt_ref_frame &&
-#endif // CONFIG_NEW_REF_SIGNALING
(current_frame->frame_type != KEY_FRAME && !frame_is_sframe(cm)))
// Update the alternate reference frame stats as appropriate.
update_alt_ref_frame_stats(cpi);
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 54a2a1a..8e06d2b 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -398,7 +398,6 @@
}
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
for (i = 0; i < REF_CONTEXTS; ++i) {
for (j = 0; j < INTER_REFS_PER_FRAME - 1; ++j) {
av1_cost_tokens_from_cdf(mode_costs->single_ref_cost[i][j],
@@ -428,40 +427,6 @@
}
}
}
-#else
- for (i = 0; i < REF_CONTEXTS; ++i) {
- for (j = 0; j < SINGLE_REFS - 1; ++j) {
- av1_cost_tokens_from_cdf(mode_costs->single_ref_cost[i][j],
- fc->single_ref_cdf[i][j], NULL);
- }
- }
-
- for (i = 0; i < COMP_REF_TYPE_CONTEXTS; ++i) {
- av1_cost_tokens_from_cdf(mode_costs->comp_ref_type_cost[i],
- fc->comp_ref_type_cdf[i], NULL);
- }
-
- for (i = 0; i < UNI_COMP_REF_CONTEXTS; ++i) {
- for (j = 0; j < UNIDIR_COMP_REFS - 1; ++j) {
- av1_cost_tokens_from_cdf(mode_costs->uni_comp_ref_cost[i][j],
- fc->uni_comp_ref_cdf[i][j], NULL);
- }
- }
-
- for (i = 0; i < REF_CONTEXTS; ++i) {
- for (j = 0; j < FWD_REFS - 1; ++j) {
- av1_cost_tokens_from_cdf(mode_costs->comp_ref_cost[i][j],
- fc->comp_ref_cdf[i][j], NULL);
- }
- }
-
- for (i = 0; i < REF_CONTEXTS; ++i) {
- for (j = 0; j < BWD_REFS - 1; ++j) {
- av1_cost_tokens_from_cdf(mode_costs->comp_bwdref_cost[i][j],
- fc->comp_bwdref_cdf[i][j], NULL);
- }
- }
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_CONTEXT_DERIVATION
for (j = 0; j < INTRA_INTER_SKIP_TXFM_CONTEXTS; ++j) {
@@ -849,11 +814,7 @@
const int t = q * rd_thresh_block_size_factor[bsize];
const int thresh_max = INT_MAX / t;
-#if CONFIG_NEW_REF_SIGNALING
for (i = 0; i < MB_MODE_COUNT; ++i)
-#else
- for (i = 0; i < MAX_MODES; ++i)
-#endif // CONFIG_NEW_REF_SIGNALING
rd->threshes[segment_id][bsize][i] = rd->thresh_mult[i] < thresh_max
? rd->thresh_mult[i] * t / 4
: INT_MAX;
@@ -1673,14 +1634,9 @@
}
// Note the index of the mv that worked best in the reference list.
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_frame_idx = COMPACT_INDEX0_NRS(ref_frame);
x->max_mv_context[ref_frame_idx] = max_mv;
x->pred_mv_sad[ref_frame_idx] = best_sad;
-#else
- x->max_mv_context[ref_frame] = max_mv;
- x->pred_mv_sad[ref_frame] = best_sad;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
void av1_setup_pred_block(const MACROBLOCKD *xd,
@@ -1714,13 +1670,8 @@
}
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
assert(ref_frame < cpi->common.ref_frames_info.num_total_refs);
RefCntBuffer *const scaled_buf = cpi->scaled_ref_buf[ref_frame];
-#else
- assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME);
- RefCntBuffer *const scaled_buf = cpi->scaled_ref_buf[ref_frame - 1];
-#endif // CONFIG_NEW_REF_SIGNALING
const RefCntBuffer *const ref_buf =
get_ref_frame_buf(&cpi->common, ref_frame);
return (scaled_buf != ref_buf && scaled_buf != NULL) ? &scaled_buf->buf
@@ -1749,7 +1700,6 @@
// Set baseline threshold values.
av1_zero(rd->thresh_mult);
-#if CONFIG_NEW_REF_SIGNALING
rd->thresh_mult[NEWMV] = 1000;
rd->thresh_mult[NEARMV] = 1000;
rd->thresh_mult[GLOBALMV] = 2200;
@@ -1771,263 +1721,13 @@
rd->thresh_mult[D67_PRED] = 2000;
rd->thresh_mult[D113_PRED] = 2500;
rd->thresh_mult[D45_PRED] = 2500;
-#else
-#if CONFIG_TIP
- rd->thresh_mult[THR_NEW_TIP] = 0;
- rd->thresh_mult[THR_NEAR_TIP] = 0;
-#if IMPROVED_AMVD
- rd->thresh_mult[THR_AMVDNEW_TIP] = 0;
-#endif // IMPROVED_AMVD
-#endif // CONFIG_TIP
-
- rd->thresh_mult[THR_NEARMV] = 0;
- rd->thresh_mult[THR_NEARL2] = 0;
- rd->thresh_mult[THR_NEARL3] = 100;
- rd->thresh_mult[THR_NEARB] = 0;
- rd->thresh_mult[THR_NEARA2] = 0;
- rd->thresh_mult[THR_NEARA] = 0;
- rd->thresh_mult[THR_NEARG] = 0;
-
- rd->thresh_mult[THR_NEARMV] = 1000;
- rd->thresh_mult[THR_NEARL2] = 1000;
- rd->thresh_mult[THR_NEARL3] = 1000;
- rd->thresh_mult[THR_NEARB] = 1000;
- rd->thresh_mult[THR_NEARA2] = 1000;
- rd->thresh_mult[THR_NEARA] = 1000;
- rd->thresh_mult[THR_NEARG] = 1000;
-
- rd->thresh_mult[THR_GLOBALMV] = 2200;
- rd->thresh_mult[THR_GLOBALL2] = 2000;
- rd->thresh_mult[THR_GLOBALL3] = 2000;
- rd->thresh_mult[THR_GLOBALB] = 2400;
- rd->thresh_mult[THR_GLOBALA2] = 2000;
- rd->thresh_mult[THR_GLOBALG] = 2000;
- rd->thresh_mult[THR_GLOBALA] = 2400;
-
- rd->thresh_mult[THR_COMP_NEAR_NEARLA] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWLA] = 1530;
- rd->thresh_mult[THR_COMP_NEW_NEARLA] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEWLA] = 2400;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLA] = 2750;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWLA] = 1530;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWLA] = 1530;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWLA] = 1530;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWLA] = 1530;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARL2A] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWL2A] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEARL2A] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWL2A] = 1800;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL2A] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWL2A] = 1870;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWL2A] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWL2A] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWL2A] = 1870;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARL3A] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWL3A] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARL3A] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWL3A] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL3A] = 3000;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWL3A] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWL3A] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWL3A] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWL3A] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARGA] = 1320;
- rd->thresh_mult[THR_COMP_NEAR_NEWGA] = 2040;
- rd->thresh_mult[THR_COMP_NEW_NEARGA] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWGA] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALGA] = 2250;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWGA] = 2040;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWGA] = 2040;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWGA] = 2040;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWGA] = 2040;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARLB] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWLB] = 1360;
- rd->thresh_mult[THR_COMP_NEW_NEARLB] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWLB] = 2400;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLB] = 2250;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWLB] = 1360;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWLB] = 1360;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWLB] = 1360;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWLB] = 1360;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARL2B] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWL2B] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARL2B] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWL2B] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL2B] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWL2B] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWL2B] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWL2B] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWL2B] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARL3B] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWL3B] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEARL3B] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWL3B] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL3B] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWL3B] = 1870;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWL3B] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWL3B] = 1870;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWL3B] = 1870;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARGB] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWGB] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARGB] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWGB] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALGB] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWGB] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWGB] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWGB] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWGB] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARLA2] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWLA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARLA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWLA2] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLA2] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWLA2] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWLA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWLA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWLA2] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARL2A2] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWL2A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARL2A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWL2A2] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL2A2] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWL2A2] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWL2A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWL2A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWL2A2] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARL3A2] = 1440;
- rd->thresh_mult[THR_COMP_NEAR_NEWL3A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARL3A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWL3A2] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALL3A2] = 2500;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWL3A2] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWL3A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWL3A2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWL3A2] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARGA2] = 1200;
- rd->thresh_mult[THR_COMP_NEAR_NEWGA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEARGA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEWGA2] = 2000;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALGA2] = 2750;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWGA2] = 1700;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWGA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWGA2] = 1700;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWGA2] = 1700;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARLL2] = 1600;
- rd->thresh_mult[THR_COMP_NEAR_NEWLL2] = 2640;
- rd->thresh_mult[THR_COMP_NEW_NEARLL2] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEWLL2] = 2400;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLL2] = 3200;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWLL2] = 2640;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWLL2] = 2640;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWLL2] = 2640;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWLL2] = 2640;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARLL3] = 1600;
- rd->thresh_mult[THR_COMP_NEAR_NEWLL3] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEARLL3] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEWLL3] = 2400;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLL3] = 3200;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWLL3] = 2200;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWLL3] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWLL3] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWLL3] = 2200;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARLG] = 1760;
- rd->thresh_mult[THR_COMP_NEAR_NEWLG] = 1760;
- rd->thresh_mult[THR_COMP_NEW_NEARLG] = 2640;
- rd->thresh_mult[THR_COMP_NEW_NEWLG] = 2400;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALLG] = 3200;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWLG] = 1760;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWLG] = 1760;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWLG] = 1760;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWLG] = 1760;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_COMP_NEAR_NEARBA] = 1600;
- rd->thresh_mult[THR_COMP_NEAR_NEWBA] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEARBA] = 1980;
- rd->thresh_mult[THR_COMP_NEW_NEWBA] = 2640;
- rd->thresh_mult[THR_COMP_GLOBAL_GLOBALBA] = 3200;
-#if CONFIG_OPTFLOW_REFINEMENT
- rd->thresh_mult[THR_COMP_NEAR_NEAR_OPTFLOWBA] = 2200;
- rd->thresh_mult[THR_COMP_NEAR_NEW_OPTFLOWBA] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEAR_OPTFLOWBA] = 2200;
- rd->thresh_mult[THR_COMP_NEW_NEW_OPTFLOWBA] = 2200;
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- rd->thresh_mult[THR_DC] = 1000;
- rd->thresh_mult[THR_PAETH] = 1000;
- rd->thresh_mult[THR_SMOOTH] = 2200;
- rd->thresh_mult[THR_SMOOTH_V] = 2000;
- rd->thresh_mult[THR_SMOOTH_H] = 2000;
- rd->thresh_mult[THR_H_PRED] = 2000;
- rd->thresh_mult[THR_V_PRED] = 1800;
- rd->thresh_mult[THR_D135_PRED] = 2500;
- rd->thresh_mult[THR_D203_PRED] = 2000;
- rd->thresh_mult[THR_D157_PRED] = 2500;
- rd->thresh_mult[THR_D67_PRED] = 2000;
- rd->thresh_mult[THR_D113_PRED] = 2500;
- rd->thresh_mult[THR_D45_PRED] = 2500;
-#endif // CONFIG_NEW_REF_SIGNALING
}
void av1_update_rd_thresh_fact(const AV1_COMMON *const cm,
-#if CONFIG_NEW_REF_SIGNALING
int (*factor_buf)[MB_MODE_COUNT],
-#else
- int (*factor_buf)[MAX_MODES],
-#endif // CONFIG_NEW_REF_SIGNALING
int use_adaptive_rd_thresh, BLOCK_SIZE bsize,
-#if !CONFIG_NEW_REF_SIGNALING
- MV_REFERENCE_FRAME *ref_frames,
-#endif // !CONFIG_NEW_REF_SIGNALING
PREDICTION_MODE best_mode) {
assert(use_adaptive_rd_thresh > 0);
-#if !CONFIG_NEW_REF_SIGNALING
- const int best_mode_index =
- get_prediction_mode_idx(best_mode, ref_frames[0], ref_frames[1]);
-#endif // !CONFIG_NEW_REF_SIGNALING
const int max_rd_thresh_factor = use_adaptive_rd_thresh * RD_THRESH_MAX_FACT;
const int bsize_is_1_to_4 = bsize > cm->seq_params.sb_size;
@@ -2042,18 +1742,10 @@
max_size = AOMMIN(bsize + 2, (int)cm->seq_params.sb_size);
}
-#if CONFIG_NEW_REF_SIGNALING
for (PREDICTION_MODE mode = 0; mode < MB_MODE_COUNT; ++mode) {
-#else
- for (THR_MODES mode = 0; mode < MAX_MODES; ++mode) {
-#endif // CONFIG_NEW_REF_SIGNALING
for (BLOCK_SIZE bs = min_size; bs <= max_size; ++bs) {
int *const fact = &factor_buf[bs][mode];
-#if CONFIG_NEW_REF_SIGNALING
if (mode == best_mode) {
-#else
- if (mode == best_mode_index) {
-#endif // CONFIG_NEW_REF_SIGNALING
*fact -= (*fact >> RD_THRESH_LOG_DEC_FACTOR);
} else {
*fact = AOMMIN(*fact + RD_THRESH_INC, max_rd_thresh_factor);
diff --git a/av1/encoder/rd.h b/av1/encoder/rd.h
index 23b55e2..3620853 100644
--- a/av1/encoder/rd.h
+++ b/av1/encoder/rd.h
@@ -73,13 +73,8 @@
// means that we will accept the best mode so far more often. This number
// is used in combination with the current block size, and thresh_freq_fact
// to pick a threshold.
-#if CONFIG_NEW_REF_SIGNALING
int thresh_mult[MB_MODE_COUNT];
int threshes[MAX_SEGMENTS][BLOCK_SIZES_ALL][MB_MODE_COUNT];
-#else
- int thresh_mult[MAX_MODES];
- int threshes[MAX_SEGMENTS][BLOCK_SIZES_ALL][MAX_MODES];
-#endif // CONFIG_NEW_REF_SIGNALING
int RDMULT;
@@ -271,24 +266,12 @@
void av1_set_rd_speed_thresholds(struct AV1_COMP *cpi);
void av1_update_rd_thresh_fact(const AV1_COMMON *const cm,
-#if CONFIG_NEW_REF_SIGNALING
- int (*fact)[MB_MODE_COUNT],
-#else
- int (*fact)[MAX_MODES],
-#endif // CONFIG_NEW_REF_SIGNALING
- int rd_thresh, BLOCK_SIZE bsize,
-#if !CONFIG_NEW_REF_SIGNALING
- MV_REFERENCE_FRAME *ref_frames,
-#endif // !CONFIG_NEW_REF_SIGNALING
- PREDICTION_MODE best_mode);
+ int (*fact)[MB_MODE_COUNT], int rd_thresh,
+ BLOCK_SIZE bsize, PREDICTION_MODE best_mode);
static INLINE void reset_thresh_freq_fact(MACROBLOCK *const x) {
for (int i = 0; i < BLOCK_SIZES_ALL; ++i) {
-#if CONFIG_NEW_REF_SIGNALING
for (int j = 0; j < MB_MODE_COUNT; ++j) {
-#else
- for (int j = 0; j < MAX_MODES; ++j) {
-#endif // CONFIG_NEW_REF_SIGNALING
x->thresh_freq_fact[i][j] = RD_THRESH_FAC_FRAC_VAL;
}
}
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 0448ffe..6164a60 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -109,452 +109,6 @@
4144, 4120, 4096
};
-#if !CONFIG_NEW_REF_SIGNALING
-static const THR_MODES av1_default_mode_order[MAX_MODES] = {
- THR_NEARMV,
- THR_NEARL2,
- THR_NEARL3,
- THR_NEARB,
- THR_NEARA2,
- THR_NEARA,
- THR_NEARG,
-
- THR_NEWMV,
- THR_NEWL2,
- THR_NEWL3,
- THR_NEWB,
- THR_NEWA2,
- THR_NEWA,
- THR_NEWG,
-
- THR_GLOBALMV,
- THR_GLOBALL2,
- THR_GLOBALL3,
- THR_GLOBALB,
- THR_GLOBALA2,
- THR_GLOBALG,
- THR_GLOBALA,
-
-#if IMPROVED_AMVD
- THR_AMVDNEWMV,
- THR_AMVDNEWL2,
- THR_AMVDNEWL3,
- THR_AMVDNEWB,
- THR_AMVDNEWA2,
- THR_AMVDNEWG,
- THR_AMVDNEWA,
-#endif // IMPROVED_AMVD
-
- THR_COMP_NEAR_NEARLA,
- THR_COMP_NEAR_NEARL2A,
- THR_COMP_NEAR_NEARL3A,
- THR_COMP_NEAR_NEARGA,
- THR_COMP_NEAR_NEARLB,
- THR_COMP_NEAR_NEARL2B,
- THR_COMP_NEAR_NEARL3B,
- THR_COMP_NEAR_NEARGB,
- THR_COMP_NEAR_NEARLA2,
- THR_COMP_NEAR_NEARL2A2,
- THR_COMP_NEAR_NEARL3A2,
- THR_COMP_NEAR_NEARGA2,
-
- THR_COMP_NEAR_NEARLL2,
- THR_COMP_NEAR_NEARLL3,
- THR_COMP_NEAR_NEARLG,
- THR_COMP_NEAR_NEARBA,
-
- THR_COMP_NEW_NEARLA,
- THR_COMP_NEAR_NEWLA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLA,
- THR_COMP_GLOBAL_GLOBALLA,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLA,
- THR_COMP_NEAR_NEW_OPTFLOWLA,
- THR_COMP_NEW_NEAR_OPTFLOWLA,
- THR_COMP_NEW_NEW_OPTFLOWLA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL2A,
- THR_COMP_NEAR_NEWL2A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL2A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL2A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL2A,
- THR_COMP_GLOBAL_GLOBALL2A,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL2A,
- THR_COMP_NEAR_NEW_OPTFLOWL2A,
- THR_COMP_NEW_NEAR_OPTFLOWL2A,
- THR_COMP_NEW_NEW_OPTFLOWL2A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL2A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL3A,
- THR_COMP_NEAR_NEWL3A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL3A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL3A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL3A,
- THR_COMP_GLOBAL_GLOBALL3A,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL3A,
- THR_COMP_NEAR_NEW_OPTFLOWL3A,
- THR_COMP_NEW_NEAR_OPTFLOWL3A,
- THR_COMP_NEW_NEW_OPTFLOWL3A,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL3A,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3A,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARGA,
- THR_COMP_NEAR_NEWGA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWGA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWGA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWGA,
- THR_COMP_GLOBAL_GLOBALGA,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWGA,
- THR_COMP_NEAR_NEW_OPTFLOWGA,
- THR_COMP_NEW_NEAR_OPTFLOWGA,
- THR_COMP_NEW_NEW_OPTFLOWGA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWGA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLB,
- THR_COMP_NEAR_NEWLB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLB,
- THR_COMP_GLOBAL_GLOBALLB,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLB,
- THR_COMP_NEAR_NEW_OPTFLOWLB,
- THR_COMP_NEW_NEAR_OPTFLOWLB,
- THR_COMP_NEW_NEW_OPTFLOWLB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL2B,
- THR_COMP_NEAR_NEWL2B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL2B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL2B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL2B,
- THR_COMP_GLOBAL_GLOBALL2B,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL2B,
- THR_COMP_NEAR_NEW_OPTFLOWL2B,
- THR_COMP_NEW_NEAR_OPTFLOWL2B,
- THR_COMP_NEW_NEW_OPTFLOWL2B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL2B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL3B,
- THR_COMP_NEAR_NEWL3B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL3B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL3B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL3B,
- THR_COMP_GLOBAL_GLOBALL3B,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL3B,
- THR_COMP_NEAR_NEW_OPTFLOWL3B,
- THR_COMP_NEW_NEAR_OPTFLOWL3B,
- THR_COMP_NEW_NEW_OPTFLOWL3B,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL3B,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3B,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARGB,
- THR_COMP_NEAR_NEWGB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWGB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWGB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWGB,
- THR_COMP_GLOBAL_GLOBALGB,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWGB,
- THR_COMP_NEAR_NEW_OPTFLOWGB,
- THR_COMP_NEW_NEAR_OPTFLOWGB,
- THR_COMP_NEW_NEW_OPTFLOWGB,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWGB,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGB,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLA2,
- THR_COMP_NEAR_NEWLA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLA2,
- THR_COMP_GLOBAL_GLOBALLA2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLA2,
- THR_COMP_NEAR_NEW_OPTFLOWLA2,
- THR_COMP_NEW_NEAR_OPTFLOWLA2,
- THR_COMP_NEW_NEW_OPTFLOWLA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL2A2,
- THR_COMP_NEAR_NEWL2A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL2A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL2A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL2A2,
- THR_COMP_GLOBAL_GLOBALL2A2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL2A2,
- THR_COMP_NEAR_NEW_OPTFLOWL2A2,
- THR_COMP_NEW_NEAR_OPTFLOWL2A2,
- THR_COMP_NEW_NEW_OPTFLOWL2A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL2A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARL3A2,
- THR_COMP_NEAR_NEWL3A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWL3A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWL3A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWL3A2,
- THR_COMP_GLOBAL_GLOBALL3A2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWL3A2,
- THR_COMP_NEAR_NEW_OPTFLOWL3A2,
- THR_COMP_NEW_NEAR_OPTFLOWL3A2,
- THR_COMP_NEW_NEW_OPTFLOWL3A2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWL3A2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3A2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARGA2,
- THR_COMP_NEAR_NEWGA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWGA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWGA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWGA2,
- THR_COMP_GLOBAL_GLOBALGA2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWGA2,
- THR_COMP_NEAR_NEW_OPTFLOWGA2,
- THR_COMP_NEW_NEAR_OPTFLOWGA2,
- THR_COMP_NEW_NEW_OPTFLOWGA2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWGA2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGA2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLL2,
- THR_COMP_NEAR_NEWLL2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLL2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLL2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLL2,
- THR_COMP_GLOBAL_GLOBALLL2,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLL2,
- THR_COMP_NEAR_NEW_OPTFLOWLL2,
- THR_COMP_NEW_NEAR_OPTFLOWLL2,
- THR_COMP_NEW_NEW_OPTFLOWLL2,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLL2,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLL2,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLL3,
- THR_COMP_NEAR_NEWLL3,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLL3,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLL3,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLL3,
- THR_COMP_GLOBAL_GLOBALLL3,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLL3,
- THR_COMP_NEAR_NEW_OPTFLOWLL3,
- THR_COMP_NEW_NEAR_OPTFLOWLL3,
- THR_COMP_NEW_NEW_OPTFLOWLL3,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLL3,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLL3,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARLG,
- THR_COMP_NEAR_NEWLG,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWLG,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWLG,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWLG,
- THR_COMP_GLOBAL_GLOBALLG,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWLG,
- THR_COMP_NEAR_NEW_OPTFLOWLG,
- THR_COMP_NEW_NEAR_OPTFLOWLG,
- THR_COMP_NEW_NEW_OPTFLOWLG,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWLG,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLG,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- THR_COMP_NEW_NEARBA,
- THR_COMP_NEAR_NEWBA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEWBA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEWBA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
- THR_COMP_NEW_NEWBA,
- THR_COMP_GLOBAL_GLOBALBA,
-#if CONFIG_OPTFLOW_REFINEMENT
- THR_COMP_NEAR_NEAR_OPTFLOWBA,
- THR_COMP_NEAR_NEW_OPTFLOWBA,
- THR_COMP_NEW_NEAR_OPTFLOWBA,
- THR_COMP_NEW_NEW_OPTFLOWBA,
-#if CONFIG_JOINT_MVD
- THR_COMP_JOINT_NEW_OPTFLOWBA,
-#if IMPROVED_AMVD
- THR_COMP_JOINT_AMVDNEW_OPTFLOWBA,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
-#if CONFIG_TIP
- THR_NEAR_TIP,
- THR_NEW_TIP,
-#if IMPROVED_AMVD
- THR_AMVDNEW_TIP,
-#endif // IMPROVED_AMVD
-#endif // CONFIG_TIP
-
- THR_DC,
- THR_PAETH,
- THR_SMOOTH,
- THR_SMOOTH_V,
- THR_SMOOTH_H,
- THR_H_PRED,
- THR_V_PRED,
- THR_D135_PRED,
- THR_D203_PRED,
- THR_D157_PRED,
- THR_D67_PRED,
- THR_D113_PRED,
- THR_D45_PRED,
-};
-#endif // !CONFIG_NEW_REF_SIGNALING
-
/*!\cond */
typedef struct SingleInterModeState {
int64_t rd;
@@ -576,11 +130,7 @@
int num_available_refs;
int64_t dist_refs[REF_FRAMES];
int dist_order_refs[REF_FRAMES];
-#if CONFIG_NEW_REF_SIGNALING
int64_t mode_threshold[MB_MODE_COUNT];
-#else
- int64_t mode_threshold[MAX_MODES];
-#endif // CONFIG_NEW_REF_SIGNALING
int64_t best_intra_rd;
unsigned int best_pred_sse;
int64_t best_pred_diff[REFERENCE_MODES];
@@ -606,19 +156,12 @@
// Single search results by [directions][modes][reference frames]
int single_state_cnt[2][SINGLE_INTER_MODE_NUM];
int single_state_modelled_cnt[2][SINGLE_INTER_MODE_NUM];
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
SingleInterModeState single_state[2][SINGLE_INTER_MODE_NUM]
[SINGLE_REF_FRAMES];
SingleInterModeState single_state_modelled[2][SINGLE_INTER_MODE_NUM]
[SINGLE_REF_FRAMES];
MV_REFERENCE_FRAME single_rd_order[2][SINGLE_INTER_MODE_NUM]
[SINGLE_REF_FRAMES];
-#else
- SingleInterModeState single_state[2][SINGLE_INTER_MODE_NUM][FWD_REFS];
- SingleInterModeState single_state_modelled[2][SINGLE_INTER_MODE_NUM]
- [FWD_REFS];
- MV_REFERENCE_FRAME single_rd_order[2][SINGLE_INTER_MODE_NUM][FWD_REFS];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
IntraModeSearchState intra_search_state;
} InterModeSearchState;
/*!\endcond */
@@ -1031,13 +574,8 @@
const AV1_COMMON *cm, const MACROBLOCKD *xd, const ModeCosts *mode_costs,
int segment_id, unsigned int *ref_costs_single,
unsigned int (*ref_costs_comp)[REF_FRAMES]) {
-#if CONFIG_NEW_REF_SIGNALING
(void)segment_id;
int seg_ref_active = 0;
-#else
- int seg_ref_active =
- segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
if (seg_ref_active) {
memset(ref_costs_single, 0, SINGLE_REF_FRAMES * sizeof(*ref_costs_single));
int ref_frame;
@@ -1048,20 +586,12 @@
int intra_inter_ctx = av1_get_intra_inter_context(xd);
#if CONFIG_CONTEXT_DERIVATION
const int skip_txfm = xd->mi[0]->skip_txfm[xd->tree_type == CHROMA_PART];
-#if CONFIG_NEW_REF_SIGNALING
ref_costs_single[INTRA_FRAME_INDEX] =
-#else
- ref_costs_single[INTRA_FRAME] =
-#endif // CONFIG_NEW_REF_SIGNALING
mode_costs->intra_inter_cost[skip_txfm][intra_inter_ctx][0];
unsigned int base_cost =
mode_costs->intra_inter_cost[skip_txfm][intra_inter_ctx][1];
#else
-#if CONFIG_NEW_REF_SIGNALING
ref_costs_single[INTRA_FRAME_INDEX] =
-#else
- ref_costs_single[INTRA_FRAME] =
-#endif // CONFIG_NEW_REF_SIGNALING
mode_costs->intra_inter_cost[intra_inter_ctx][0];
unsigned int base_cost = mode_costs->intra_inter_cost[intra_inter_ctx][1];
#endif // CONFIG_CONTEXT_DERIVATION
@@ -1075,7 +605,6 @@
}
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i)
ref_costs_single[i] = base_cost;
@@ -1090,58 +619,7 @@
for (int i = n_refs; i < INTER_REFS_PER_FRAME; i++)
ref_costs_single[i] = INT_MAX;
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i)
- ref_costs_single[i] = base_cost;
- const int ctx_p1 = av1_get_pred_context_single_ref_p1(xd);
- const int ctx_p2 = av1_get_pred_context_single_ref_p2(xd);
- const int ctx_p3 = av1_get_pred_context_single_ref_p3(xd);
- const int ctx_p4 = av1_get_pred_context_single_ref_p4(xd);
- const int ctx_p5 = av1_get_pred_context_single_ref_p5(xd);
- const int ctx_p6 = av1_get_pred_context_single_ref_p6(xd);
-
- // Determine cost of a single ref frame, where frame types are represented
- // by a tree:
- // Level 0: add cost whether this ref is a forward or backward ref
- ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
- ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
- ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
- ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][0];
- ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][1];
- ref_costs_single[ALTREF2_FRAME] +=
- mode_costs->single_ref_cost[ctx_p1][0][1];
- ref_costs_single[ALTREF_FRAME] += mode_costs->single_ref_cost[ctx_p1][0][1];
-
- // Level 1: if this ref is forward ref,
- // add cost whether it is last/last2 or last3/golden
- ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][0];
- ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][0];
- ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][1];
- ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[ctx_p3][2][1];
-
- // Level 1: if this ref is backward ref
- // then add cost whether this ref is altref or backward ref
- ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[ctx_p2][1][0];
- ref_costs_single[ALTREF2_FRAME] +=
- mode_costs->single_ref_cost[ctx_p2][1][0];
- ref_costs_single[ALTREF_FRAME] += mode_costs->single_ref_cost[ctx_p2][1][1];
-
- // Level 2: further add cost whether this ref is last or last2
- ref_costs_single[LAST_FRAME] += mode_costs->single_ref_cost[ctx_p4][3][0];
- ref_costs_single[LAST2_FRAME] += mode_costs->single_ref_cost[ctx_p4][3][1];
-
- // Level 2: last3 or golden
- ref_costs_single[LAST3_FRAME] += mode_costs->single_ref_cost[ctx_p5][4][0];
- ref_costs_single[GOLDEN_FRAME] += mode_costs->single_ref_cost[ctx_p5][4][1];
-
- // Level 2: bwdref or altref2
- ref_costs_single[BWDREF_FRAME] += mode_costs->single_ref_cost[ctx_p6][5][0];
- ref_costs_single[ALTREF2_FRAME] +=
- mode_costs->single_ref_cost[ctx_p6][5][1];
-#endif // CONFIG_NEW_REF_SIGNALING
-
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_ALLOW_SAME_REF_COMPOUND
if (cm->current_frame.reference_mode != SINGLE_REFERENCE) {
for (int i = 0; i < REF_FRAMES; i++) {
@@ -1246,100 +724,6 @@
}
}
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#else
- if (cm->current_frame.reference_mode != SINGLE_REFERENCE) {
- // Similar to single ref, determine cost of compound ref frames.
- // cost_compound_refs = cost_first_ref + cost_second_ref
- const int bwdref_comp_ctx_p = av1_get_pred_context_comp_bwdref_p(xd);
- const int bwdref_comp_ctx_p1 = av1_get_pred_context_comp_bwdref_p1(xd);
- const int ref_comp_ctx_p = av1_get_pred_context_comp_ref_p(xd);
- const int ref_comp_ctx_p1 = av1_get_pred_context_comp_ref_p1(xd);
- const int ref_comp_ctx_p2 = av1_get_pred_context_comp_ref_p2(xd);
-
- const int comp_ref_type_ctx = av1_get_comp_reference_type_context(xd);
- unsigned int ref_bicomp_costs[REF_FRAMES] = { 0 };
-
- ref_bicomp_costs[LAST_FRAME] = ref_bicomp_costs[LAST2_FRAME] =
- ref_bicomp_costs[LAST3_FRAME] = ref_bicomp_costs[GOLDEN_FRAME] =
- base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][1];
- ref_bicomp_costs[BWDREF_FRAME] = ref_bicomp_costs[ALTREF2_FRAME] = 0;
- ref_bicomp_costs[ALTREF_FRAME] = 0;
-
- // cost of first ref frame
- ref_bicomp_costs[LAST_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p][0][0];
- ref_bicomp_costs[LAST2_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p][0][0];
- ref_bicomp_costs[LAST3_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p][0][1];
- ref_bicomp_costs[GOLDEN_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p][0][1];
-
- ref_bicomp_costs[LAST_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p1][1][0];
- ref_bicomp_costs[LAST2_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p1][1][1];
-
- ref_bicomp_costs[LAST3_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p2][2][0];
- ref_bicomp_costs[GOLDEN_FRAME] +=
- mode_costs->comp_ref_cost[ref_comp_ctx_p2][2][1];
-
- // cost of second ref frame
- ref_bicomp_costs[BWDREF_FRAME] +=
- mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
- ref_bicomp_costs[ALTREF2_FRAME] +=
- mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p][0][0];
- ref_bicomp_costs[ALTREF_FRAME] +=
- mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p][0][1];
-
- ref_bicomp_costs[BWDREF_FRAME] +=
- mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p1][1][0];
- ref_bicomp_costs[ALTREF2_FRAME] +=
- mode_costs->comp_bwdref_cost[bwdref_comp_ctx_p1][1][1];
-
- // cost: if one ref frame is forward ref, the other ref is backward ref
- int ref0, ref1;
- for (ref0 = LAST_FRAME; ref0 <= GOLDEN_FRAME; ++ref0) {
- for (ref1 = BWDREF_FRAME; ref1 <= ALTREF_FRAME; ++ref1) {
- ref_costs_comp[ref0][ref1] =
- ref_bicomp_costs[ref0] + ref_bicomp_costs[ref1];
- }
- }
-
- // cost: if both ref frames are the same side.
- const int uni_comp_ref_ctx_p = av1_get_pred_context_uni_comp_ref_p(xd);
- const int uni_comp_ref_ctx_p1 = av1_get_pred_context_uni_comp_ref_p1(xd);
- const int uni_comp_ref_ctx_p2 = av1_get_pred_context_uni_comp_ref_p2(xd);
- ref_costs_comp[LAST_FRAME][LAST2_FRAME] =
- base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p1][1][0];
- ref_costs_comp[LAST_FRAME][LAST3_FRAME] =
- base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p1][1][1] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p2][2][0];
- ref_costs_comp[LAST_FRAME][GOLDEN_FRAME] =
- base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p1][1][1] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p2][2][1];
- ref_costs_comp[BWDREF_FRAME][ALTREF_FRAME] =
- base_cost + mode_costs->comp_ref_type_cost[comp_ref_type_ctx][0] +
- mode_costs->uni_comp_ref_cost[uni_comp_ref_ctx_p][0][1];
- } else {
- int ref0, ref1;
- for (ref0 = LAST_FRAME; ref0 <= GOLDEN_FRAME; ++ref0) {
- for (ref1 = BWDREF_FRAME; ref1 <= ALTREF_FRAME; ++ref1)
- ref_costs_comp[ref0][ref1] = 512;
- }
- ref_costs_comp[LAST_FRAME][LAST2_FRAME] = 512;
- ref_costs_comp[LAST_FRAME][LAST3_FRAME] = 512;
- ref_costs_comp[LAST_FRAME][GOLDEN_FRAME] = 512;
- ref_costs_comp[BWDREF_FRAME][ALTREF_FRAME] = 512;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
@@ -1380,11 +764,7 @@
#endif // CONFIG_C071_SUBBLK_WARPMV
static AOM_INLINE void store_coding_context(
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, int mode_index,
-#else
MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
int64_t comp_pred_diff[REFERENCE_MODES], int skippable
#if CONFIG_C071_SUBBLK_WARPMV
,
@@ -1397,9 +777,6 @@
// restored if we decide to encode this way
ctx->rd_stats.skip_txfm = x->txfm_search_info.skip_txfm;
ctx->skippable = skippable;
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- ctx->best_mode_index = mode_index;
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
ctx->mic = *xd->mi[0];
#if CONFIG_C071_SUBBLK_WARPMV
if (is_warp_mode(xd->mi[0]->motion_mode)) {
@@ -1542,12 +919,8 @@
return 0;
}
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const MV_REFERENCE_FRAME ref_frame0 = COMPACT_INDEX0_NRS(ref_frames[0]);
if (search_state->modelled_rd[compare_mode][0][ref_frame0] == INT64_MAX) {
-#else
- if (search_state->modelled_rd[compare_mode][0][ref_frames[0]] == INT64_MAX) {
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
return 0;
}
const int16_t mode_ctx =
@@ -1571,13 +944,8 @@
// Only skip if the mode cost is larger than compare mode cost
if (this_cost > compare_cost) {
-#if CONFIG_NEW_REF_SIGNALING
search_state->modelled_rd[this_mode][0][ref_frame0] =
search_state->modelled_rd[compare_mode][0][ref_frame0];
-#else
- search_state->modelled_rd[this_mode][0][ref_frames[0]] =
- search_state->modelled_rd[compare_mode][0][ref_frames[0]];
-#endif // CONFIG_NEW_REF_SIGNALING
return 1;
}
return 0;
@@ -1645,14 +1013,8 @@
#endif // CONFIG_JOINT_MVD || CONFIG_JOINT_MVD
const int is_comp_pred = has_second_ref(mbmi);
const PREDICTION_MODE this_mode = mbmi->mode;
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const MV_REFERENCE_FRAME refs[2] = { COMPACT_INDEX0_NRS(mbmi->ref_frame[0]),
COMPACT_INDEX1_NRS(mbmi->ref_frame[1]) };
-#else
- const MV_REFERENCE_FRAME refs[2] = {
- mbmi->ref_frame[0], mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1]
- };
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_mv_idx = mbmi->ref_mv_idx;
#if CONFIG_FLEX_MVRES
const MvSubpelPrecision pb_mv_precision = mbmi->pb_mv_precision;
@@ -3055,11 +2417,7 @@
model_rd_sb_fn[MODELRD_TYPE_MOTION_MODE_RD](
cpi, bsize, x, xd, 0, num_planes - 1, &est_residue_cost,
&est_dist, NULL, &curr_sse, NULL, NULL, NULL);
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
sse_y = x->pred_sse[COMPACT_INDEX0_NRS(xd->mi[0]->ref_frame[0])];
-#else
- sse_y = x->pred_sse[xd->mi[0]->ref_frame[0]];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
est_rd = RDCOST(x->rdmult, rd_stats->rate + est_residue_cost, est_dist);
if (est_rd * 0.80 > *best_est_rd) {
@@ -3152,12 +2510,8 @@
const int64_t tmp_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
if (mode_index == 0) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
args->simple_rd[this_mode][mbmi->ref_mv_idx]
[COMPACT_INDEX0_NRS(mbmi->ref_frame[0])] = tmp_rd;
-#else
- args->simple_rd[this_mode][mbmi->ref_mv_idx][mbmi->ref_frame[0]] = tmp_rd;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
if (mode_index == 0 || tmp_rd < best_rd) {
// Update best_rd data if this is the best motion mode so far
@@ -3537,10 +2891,8 @@
const RefFrameDistanceInfo *const ref_frame_dist_info, MACROBLOCK *x,
const HandleInterModeArgs *const args, int64_t ref_best_rd,
int ref_mv_idx) {
-#if CONFIG_NEW_REF_SIGNALING
(void)ref_frame_dist_info;
const AV1_COMMON *const cm = &cpi->common;
-#endif // CONFIG_NEW_REF_SIGNALING
const SPEED_FEATURES *const sf = &cpi->sf;
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *mbmi = xd->mi[0];
@@ -3548,7 +2900,6 @@
const int8_t ref_frame_type = av1_ref_frame_type(mbmi->ref_frame);
const int is_comp_pred = has_second_ref(mbmi);
if (sf->inter_sf.reduce_inter_modes && ref_mv_idx > 0) {
-#if CONFIG_NEW_REF_SIGNALING
// NOTE: This section changes the stats.
int ranks[2][2], dir[2] = { -1, -1 };
if (mbmi->ref_frame[0] != INTRA_FRAME)
@@ -3557,12 +2908,6 @@
dir[1] = get_dir_rank(cm, mbmi->ref_frame[1], ranks[1]);
if ((dir[0] != -1 && ranks[0][dir[0]] > 3) ||
(dir[1] != -1 && ranks[1][dir[1]] > 2)) {
-#else
- if (mbmi->ref_frame[0] == LAST2_FRAME ||
- mbmi->ref_frame[0] == LAST3_FRAME ||
- mbmi->ref_frame[1] == LAST2_FRAME ||
- mbmi->ref_frame[1] == LAST3_FRAME) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (mbmi_ext->weight[ref_frame_type][ref_mv_idx] < REF_CAT_LEVEL) {
return true;
}
@@ -3570,15 +2915,10 @@
// TODO(any): Experiment with reduce_inter_modes for compound prediction
if (sf->inter_sf.reduce_inter_modes >= 2 && !is_comp_pred &&
have_newmv_in_inter_mode(mbmi->mode)) {
-#if CONFIG_NEW_REF_SIGNALING
if ((cm->ref_frames_info.num_future_refs == 0 ||
mbmi->ref_frame[0] != cm->ref_frames_info.future_refs[0]) &&
(cm->ref_frames_info.num_past_refs == 0 ||
mbmi->ref_frame[0] != cm->ref_frames_info.past_refs[0])) {
-#else
- if (mbmi->ref_frame[0] != ref_frame_dist_info->nearest_past_ref &&
- mbmi->ref_frame[0] != ref_frame_dist_info->nearest_future_ref) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (mbmi_ext->weight[ref_frame_type][ref_mv_idx] < REF_CAT_LEVEL) {
return true;
}
@@ -4083,7 +3423,6 @@
};
const int is_comp_pred = is_inter_ref_frame(refs[1]);
-#if CONFIG_NEW_REF_SIGNALING
if (!is_comp_pred) {
cur_inter_cost = inter_cost_info_from_tpl->ref_inter_cost[refs[0]];
} else {
@@ -4095,19 +3434,6 @@
// more aggressive pruning
cur_inter_cost = AOMMAX(inter_cost_ref0, inter_cost_ref1);
}
-#else
- if (!is_comp_pred) {
- cur_inter_cost = inter_cost_info_from_tpl->ref_inter_cost[refs[0] - 1];
- } else {
- const int64_t inter_cost_ref0 =
- inter_cost_info_from_tpl->ref_inter_cost[refs[0] - 1];
- const int64_t inter_cost_ref1 =
- inter_cost_info_from_tpl->ref_inter_cost[refs[1] - 1];
- // Choose maximum inter_cost among inter_cost_ref0 and inter_cost_ref1 for
- // more aggressive pruning
- cur_inter_cost = AOMMAX(inter_cost_ref0, inter_cost_ref1);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
// Prune the mode if cur_inter_cost is greater than threshold times
// best_inter_cost
@@ -4508,14 +3834,8 @@
tpl_idx < MAX_TPL_FRAME_IDX && tpl_frame->is_valid;
int i;
// Reference frames for this mode
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const MV_REFERENCE_FRAME refs[2] = { COMPACT_INDEX0_NRS(mbmi->ref_frame[0]),
COMPACT_INDEX1_NRS(mbmi->ref_frame[1]) };
-#else
- const MV_REFERENCE_FRAME refs[2] = {
- mbmi->ref_frame[0], (mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1])
- };
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
int rate_mv = 0;
int64_t rd = INT64_MAX;
// Do first prediction into the destination buffer. Do the next
@@ -6241,15 +5561,8 @@
return;
}
-#if CONFIG_NEW_REF_SIGNALING
const MV_REFERENCE_FRAME ref_frame = skip_mode_info->ref_frame_idx_0;
const MV_REFERENCE_FRAME second_ref_frame = skip_mode_info->ref_frame_idx_1;
-#else
- const MV_REFERENCE_FRAME ref_frame =
- LAST_FRAME + skip_mode_info->ref_frame_idx_0;
- const MV_REFERENCE_FRAME second_ref_frame =
- LAST_FRAME + skip_mode_info->ref_frame_idx_1;
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_OPTFLOW_REFINEMENT
const PREDICTION_MODE this_mode =
@@ -6258,15 +5571,6 @@
const PREDICTION_MODE this_mode = NEAR_NEARMV;
#endif // CONFIG_OPTFLOW_REFINEMENT
-#if !CONFIG_NEW_REF_SIGNALING
- const THR_MODES mode_index =
- get_prediction_mode_idx(this_mode, ref_frame, second_ref_frame);
-
- if (mode_index == THR_INVALID) {
- return;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
-
if ((!cpi->oxcf.ref_frm_cfg.enable_onesided_comp ||
cpi->sf.inter_sf.disable_onesided_comp) &&
cpi->all_one_sided_refs) {
@@ -6377,12 +5681,8 @@
}
search_state->best_rd = best_rd_cost->rdcost;
-#if CONFIG_NEW_REF_SIGNALING
for (int8_t rf_idx = 0; rf_idx < cpi->common.ref_frames_info.num_total_refs;
++rf_idx) {
-#else
- for (int8_t rf_idx = LAST_FRAME; rf_idx <= ALTREF_FRAME; ++rf_idx) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (get_ref_frame_yv12_buf(cm, rf_idx) == NULL) continue;
setup_buffer_ref_mvs_inter(cpi, x, rf_idx, bsize, yv12_mb);
}
@@ -6514,9 +5814,6 @@
if (skip_mode_rd_stats.rdcost < search_state->best_rd &&
(!xd->lossless[mbmi->segment_id] || skip_mode_rd_stats.dist == 0)) {
-#if !CONFIG_NEW_REF_SIGNALING
- assert(mode_index != THR_INVALID);
-#endif // !CONFIG_NEW_REF_SIGNALING
assert(mbmi->skip_txfm[xd->tree_type == CHROMA_PART] ==
skip_mode_rd_stats.skip_txfm);
search_state->best_mbmode.skip_mode = 1;
@@ -6594,9 +5891,6 @@
cm,
#endif // CONFIG_OPTFLOW_REFINEMENT
cm->features.interp_filter);
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- ctx->best_mode_index = mode_index;
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
// Update rd_cost
best_rd_cost->rate = skip_mode_rd_stats.rate;
@@ -6628,25 +5922,10 @@
return;
}
-#if CONFIG_NEW_REF_SIGNALING
const MV_REFERENCE_FRAME ref_frame = skip_mode_info->ref_frame_idx_0;
const MV_REFERENCE_FRAME second_ref_frame = skip_mode_info->ref_frame_idx_1;
-#else
- const MV_REFERENCE_FRAME ref_frame =
- LAST_FRAME + skip_mode_info->ref_frame_idx_0;
- const MV_REFERENCE_FRAME second_ref_frame =
- LAST_FRAME + skip_mode_info->ref_frame_idx_1;
-#endif // CONFIG_NEW_REF_SIGNALING
const PREDICTION_MODE this_mode = NEAR_NEARMV;
-#if !CONFIG_NEW_REF_SIGNALING
- const THR_MODES mode_index =
- get_prediction_mode_idx(this_mode, ref_frame, second_ref_frame);
-
- if (mode_index == THR_INVALID) {
- return;
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
if ((!cpi->oxcf.ref_frm_cfg.enable_onesided_comp ||
cpi->sf.inter_sf.disable_onesided_comp) &&
@@ -6741,9 +6020,6 @@
if (skip_mode_rd_stats.rdcost <= best_intra_inter_mode_cost &&
(!xd->lossless[mbmi->segment_id] || skip_mode_rd_stats.dist == 0)) {
-#if !CONFIG_NEW_REF_SIGNALING
- assert(mode_index != THR_INVALID);
-#endif // !CONFIG_NEW_REF_SIGNALING
search_state->best_mbmode.skip_mode = 1;
search_state->best_mbmode = *mbmi;
search_state->best_mbmode.skip_mode =
@@ -6888,17 +6164,11 @@
// Select prediction reference frames.
for (int i = 0; i < num_planes; i++) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
xd->plane[i].pre[0] =
yv12_mb[COMPACT_INDEX0_NRS(mbmi->ref_frame[0])][i];
if (has_second_ref(mbmi))
xd->plane[i].pre[1] =
yv12_mb[COMPACT_INDEX0_NRS(mbmi->ref_frame[1])][i];
-#else
- xd->plane[i].pre[0] = yv12_mb[mbmi->ref_frame[0]][i];
- if (has_second_ref(mbmi))
- xd->plane[i].pre[1] = yv12_mb[mbmi->ref_frame[1]][i];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
if (is_inter_mode(mbmi->mode)) {
@@ -6980,14 +6250,12 @@
uint32_t pred_modes[REF_FRAMES];
// If ref_combo[i][j + 1] is true, do NOT try prediction using combination
// of reference frames (i, j). Indexing with 'j + 1' is due to the fact that
- // 2nd reference can be -1 (INVALID_FRAME). NOTE: In
- // CONFIG_NEW_REF_SIGNALING, indexing for the reference has the order the
- // INTER references followed by INTRA
+ // 2nd reference can be -1 (INVALID_FRAME). NOTE: indexing for the reference
+ // has the order the INTER references followed by INTRA
bool ref_combo[REF_FRAMES][REF_FRAMES + 1];
} mode_skip_mask_t;
/*!\endcond */
-#if CONFIG_NEW_REF_SIGNALING
// Update 'ref_combo' mask to disable given 'ref' in single and compound
// modes.
static AOM_INLINE void disable_reference(
@@ -7014,39 +6282,6 @@
{ 0, 3 }, { 1, 2 }, { 1, 3 },
{ 2, 3 },
};
-#else
-// Update 'ref_combo' mask to disable given 'ref' in single and compound modes.
-static AOM_INLINE void disable_reference(
- MV_REFERENCE_FRAME ref, bool ref_combo[REF_FRAMES][REF_FRAMES + 1]) {
- for (MV_REFERENCE_FRAME ref2 = NONE_FRAME; ref2 < REF_FRAMES; ++ref2) {
- ref_combo[ref][ref2 + 1] = true;
- }
-}
-
-// Update 'ref_combo' mask to disable all inter references except ALTREF.
-static AOM_INLINE void disable_inter_references_except_altref(
- bool ref_combo[REF_FRAMES][REF_FRAMES + 1]) {
- disable_reference(LAST_FRAME, ref_combo);
- disable_reference(LAST2_FRAME, ref_combo);
- disable_reference(LAST3_FRAME, ref_combo);
- disable_reference(GOLDEN_FRAME, ref_combo);
- disable_reference(BWDREF_FRAME, ref_combo);
- disable_reference(ALTREF2_FRAME, ref_combo);
-}
-
-// Define single and compound reference combinations allowed in
-// "enable_reduced_reference_set" speed feature.
-static const MV_REFERENCE_FRAME reduced_ref_combos[][2] = {
- { LAST_FRAME, NONE_FRAME }, { ALTREF_FRAME, NONE_FRAME },
- { LAST_FRAME, ALTREF_FRAME }, { GOLDEN_FRAME, NONE_FRAME },
- { INTRA_FRAME, NONE_FRAME }, { GOLDEN_FRAME, ALTREF_FRAME },
- { LAST_FRAME, GOLDEN_FRAME }, { LAST_FRAME, INTRA_FRAME },
- { LAST_FRAME, BWDREF_FRAME }, { LAST_FRAME, LAST3_FRAME },
- { GOLDEN_FRAME, BWDREF_FRAME }, { GOLDEN_FRAME, INTRA_FRAME },
- { BWDREF_FRAME, NONE_FRAME }, { BWDREF_FRAME, ALTREF_FRAME },
- { ALTREF_FRAME, INTRA_FRAME }, { BWDREF_FRAME, INTRA_FRAME },
-};
-#endif // CONFIG_NEW_REF_SIGNALING
typedef enum { REF_SET_FULL, REF_SET_REDUCED } REF_SET;
@@ -7078,12 +6313,8 @@
for (int i = 0; i < num_ref_combos; ++i) {
const MV_REFERENCE_FRAME *const this_combo = ref_set_combos[i];
-#if CONFIG_NEW_REF_SIGNALING
mask->ref_combo[COMPACT_INDEX0_NRS(this_combo[0])]
[COMPACT_INDEX0_NRS(this_combo[1]) + 1] = false;
-#else
- mask->ref_combo[this_combo[0]][this_combo[1] + 1] = false;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
}
@@ -7092,12 +6323,6 @@
const AV1_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bsize) {
const AV1_COMMON *const cm = &cpi->common;
-#if !CONFIG_NEW_REF_SIGNALING
- const struct segmentation *const seg = &cm->seg;
- MACROBLOCKD *const xd = &x->e_mbd;
- MB_MODE_INFO *const mbmi = xd->mi[0];
- unsigned char segment_id = mbmi->segment_id;
-#endif // !CONFIG_NEW_REF_SIGNALING
const SPEED_FEATURES *const sf = &cpi->sf;
REF_SET ref_set = REF_SET_FULL;
@@ -7108,28 +6333,19 @@
int min_pred_mv_sad = INT_MAX;
MV_REFERENCE_FRAME ref_frame;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < cm->ref_frames_info.num_total_refs;
++ref_frame)
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame)
-#endif // CONFIG_NEW_REF_SIGNALING
min_pred_mv_sad = AOMMIN(min_pred_mv_sad, x->pred_mv_sad[ref_frame]);
#if CONFIG_TIP
min_pred_mv_sad = AOMMIN(min_pred_mv_sad, x->pred_mv_sad[TIP_FRAME_INDEX]);
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < cm->ref_frames_info.num_total_refs;
++ref_frame) {
if (!(cm->ref_frame_flags & (1 << ref_frame))) {
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- if (!(cm->ref_frame_flags & av1_ref_frame_flag_list[ref_frame])) {
-#endif // CONFIG_NEW_REF_SIGNALING
- // Skip checking missing reference in both single and compound reference
- // modes.
+ // Skip checking missing reference in both single and compound reference
+ // modes.
disable_reference(ref_frame, mask->ref_combo);
} else {
// Skip fixed mv modes for poor references
@@ -7137,49 +6353,12 @@
mask->pred_modes[ref_frame] |= INTER_NEAR_GLOBAL;
}
}
-#if !CONFIG_NEW_REF_SIGNALING
- if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) &&
- get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) {
- // Reference not used for the segment.
- disable_reference(ref_frame, mask->ref_combo);
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
}
-#if !CONFIG_NEW_REF_SIGNALING
- // Note: We use the following drop-out only if the SEG_LVL_REF_FRAME feature
- // is disabled for this segment. This is to prevent the possibility that we
- // end up unable to pick any mode.
- if (!segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
- // Only consider GLOBALMV/ALTREF_FRAME for alt ref frame,
- // unless ARNR filtering is enabled in which case we want
- // an unfiltered alternative. We allow near/nearest as well
- // because they may result in zero-zero MVs but be cheaper.
- if (cpi->rc.is_src_frame_alt_ref &&
- (cpi->oxcf.algo_cfg.arnr_max_frames == 0)) {
- disable_inter_references_except_altref(mask->ref_combo);
-
- mask->pred_modes[ALTREF_FRAME] = ~INTER_NEAR_GLOBAL;
- const MV_REFERENCE_FRAME tmp_ref_frames[2] = { ALTREF_FRAME, NONE_FRAME };
- int_mv near_mv, global_mv;
- get_this_mv(&near_mv, NEARMV, 0, 0, 0, tmp_ref_frames, x->mbmi_ext);
- get_this_mv(&global_mv, GLOBALMV, 0, 0, 0, tmp_ref_frames, x->mbmi_ext);
- if (near_mv.as_int != global_mv.as_int)
- mask->pred_modes[ALTREF_FRAME] |= (1 << NEARMV);
- }
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
-
if (cpi->rc.is_src_frame_alt_ref) {
if (sf->inter_sf.alt_ref_search_fp) {
-#if CONFIG_NEW_REF_SIGNALING
mask->pred_modes[0] = 0;
disable_inter_references_except_top(mask->ref_combo);
-#else
- assert(cm->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]);
- mask->pred_modes[ALTREF_FRAME] = 0;
- disable_inter_references_except_altref(mask->ref_combo);
-#endif // CONFIG_NEW_REF_SIGNALING
disable_reference(INTRA_FRAME, mask->ref_combo);
}
}
@@ -7189,14 +6368,8 @@
int sad_thresh = x->best_pred_mv_sad + (x->best_pred_mv_sad >> 3);
// Conservatively skip the modes w.r.t. BWDREF, ALTREF2 and ALTREF, if
// those are past frames
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 4; ref_frame < INTER_REFS_PER_FRAME; ref_frame++) {
if (cpi->ref_frame_dist_info.ref_relative_dist[ref_frame] < 0)
-#else
- for (ref_frame = BWDREF_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
- if (cpi->ref_frame_dist_info.ref_relative_dist[ref_frame - LAST_FRAME] <
- 0)
-#endif // CONFIG_NEW_REF_SIGNALING
if (x->pred_mv_sad[ref_frame] > sad_thresh)
mask->pred_modes[ref_frame] |= INTER_ALL;
}
@@ -7207,11 +6380,7 @@
disable_reference(INTRA_FRAME, mask->ref_combo);
}
-#if CONFIG_NEW_REF_SIGNALING
mask->pred_modes[INTRA_FRAME_INDEX] |=
-#else
- mask->pred_modes[INTRA_FRAME] |=
-#endif // CONFIG_NEW_REF_SIGNALING
~(sf->intra_sf.intra_y_mode_mask[max_txsize_lookup[bsize]]);
}
@@ -7225,7 +6394,6 @@
args->left_pred_buf[2] = obmc_buffer->left_pred + MAX_SB_SQUARE;
}
-#if CONFIG_NEW_REF_SIGNALING
static AOM_INLINE int prune_ref_frame(const AV1_COMP *cpi, const MACROBLOCK *x,
const MV_REFERENCE_FRAME ref_frame) {
const AV1_COMMON *const cm = &cpi->common;
@@ -7255,23 +6423,6 @@
return 0;
}
-#else
-static AOM_INLINE int prune_ref_frame(const AV1_COMP *cpi, const MACROBLOCK *x,
- MV_REFERENCE_FRAME ref_frame) {
- const AV1_COMMON *const cm = &cpi->common;
- MV_REFERENCE_FRAME rf[2];
- av1_set_ref_frame(rf, ref_frame);
-
- if ((cpi->prune_ref_frame_mask >> ref_frame) & 1) return 1;
-
- if (prune_ref_by_selective_ref_frame(cpi, x, rf,
- cm->cur_frame->ref_display_order_hint)) {
- return 1;
- }
-
- return 0;
-}
-#endif // CONFIG_NEW_REF_SIGNALING
static AOM_INLINE int is_ref_frame_used_by_compound_ref(
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -7279,7 +6430,6 @@
#else
int ref_frame, int skip_ref_frame_mask) {
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#if CONFIG_NEW_REF_SIGNALING
for (int r = INTER_REFS_PER_FRAME; r < INTRA_FRAME; ++r) {
#if CONFIG_ALLOW_SAME_REF_COMPOUND
if (!(skip_ref_frame_mask & ((uint64_t)1 << r))) {
@@ -7288,15 +6438,6 @@
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
MV_REFERENCE_FRAME rf[2];
av1_set_ref_frame(rf, r);
-#else
-#if CONFIG_TIP
- for (int r = ALTREF_FRAME + 1; r < MODE_CTX_REF_FRAMES - 1; ++r) {
-#else
- for (int r = ALTREF_FRAME + 1; r < MODE_CTX_REF_FRAMES; ++r) {
-#endif // CONFIG_TIP
- if (!(skip_ref_frame_mask & (1 << r))) {
- const MV_REFERENCE_FRAME *rf = ref_frame_map[r - REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
if (rf[0] == ref_frame || rf[1] == ref_frame) {
return 1;
}
@@ -7351,19 +6492,11 @@
const int mi_col = xd->mi_col;
x->best_pred_mv_sad = INT_MAX;
MV_REFERENCE_FRAME ref_frame;
-#if CONFIG_NEW_REF_SIGNALING
for (ref_frame = 0; ref_frame < INTER_REFS_PER_FRAME; ++ref_frame) {
x->mbmi_ext->mode_context[ref_frame] = 0;
mbmi_ext->ref_mv_count[ref_frame] = UINT8_MAX;
if ((cm->ref_frame_flags & (1 << ref_frame))) {
x->pred_mv_sad[ref_frame] = INT_MAX;
-#else
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
- x->pred_mv_sad[ref_frame] = INT_MAX;
- x->mbmi_ext->mode_context[ref_frame] = 0;
- mbmi_ext->ref_mv_count[ref_frame] = UINT8_MAX;
- if (cm->ref_frame_flags & av1_ref_frame_flag_list[ref_frame]) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (mbmi->partition != PARTITION_NONE &&
mbmi->partition != PARTITION_SPLIT) {
#if CONFIG_ALLOW_SAME_REF_COMPOUND
@@ -7383,13 +6516,6 @@
assert(get_ref_frame_yv12_buf(cm, ref_frame) != NULL);
setup_buffer_ref_mvs_inter(cpi, x, ref_frame, bsize, yv12_mb);
}
-#if !CONFIG_NEW_REF_SIGNALING
- // Store the best pred_mv_sad across all past frames
- if (cpi->sf.inter_sf.alt_ref_search_fp &&
- cpi->ref_frame_dist_info.ref_relative_dist[ref_frame - LAST_FRAME] < 0)
- x->best_pred_mv_sad =
- AOMMIN(x->best_pred_mv_sad, x->pred_mv_sad[ref_frame]);
-#endif // !CONFIG_NEW_REF_SIGNALING
}
#if CONFIG_TIP
@@ -7411,7 +6537,6 @@
#endif // CONFIG_TIP
x->mbmi_ext->mode_context[ref_frame] = 0;
mbmi_ext->ref_mv_count[ref_frame] = UINT8_MAX;
-#if CONFIG_NEW_REF_SIGNALING
MV_REFERENCE_FRAME rf[2];
av1_set_ref_frame(rf, ref_frame);
if (rf[0] >= cm->ref_frames_info.num_total_refs ||
@@ -7421,13 +6546,6 @@
(cm->ref_frame_flags & (1 << rf[1])))) {
continue;
}
-#else
- const MV_REFERENCE_FRAME *rf = ref_frame_map[ref_frame - REF_FRAMES];
- if (!((cm->ref_frame_flags & av1_ref_frame_flag_list[rf[0]]) &&
- (cm->ref_frame_flags & av1_ref_frame_flag_list[rf[1]]))) {
- continue;
- }
-#endif // CONFIG_NEW_REF_SIGNALING
if (mbmi->partition != PARTITION_NONE &&
mbmi->partition != PARTITION_SPLIT) {
@@ -7565,21 +6683,11 @@
memset(search_state->dist_order_refs, -1,
sizeof(search_state->dist_order_refs));
-#if CONFIG_NEW_REF_SIGNALING
const int *const rd_threshes = cpi->rd.threshes[segment_id][bsize];
for (int i = 0; i < MB_MODE_COUNT; ++i)
search_state->mode_threshold[i] =
((int64_t)rd_threshes[i] * x->thresh_freq_fact[bsize][i]) >>
RD_THRESH_FAC_FRAC_BITS;
-#else
- for (int i = 0; i <= LAST_NEW_MV_INDEX; ++i)
- search_state->mode_threshold[i] = 0;
- const int *const rd_threshes = cpi->rd.threshes[segment_id][bsize];
- for (int i = LAST_NEW_MV_INDEX + 1; i < MAX_MODES; ++i)
- search_state->mode_threshold[i] =
- ((int64_t)rd_threshes[i] * x->thresh_freq_fact[bsize][i]) >>
- RD_THRESH_FAC_FRAC_BITS;
-#endif // CONFIG_NEW_REF_SIGNALING
search_state->best_intra_rd = INT64_MAX;
@@ -7599,11 +6707,7 @@
for (int dir = 0; dir < 2; ++dir) {
for (int mode = 0; mode < SINGLE_INTER_MODE_NUM; ++mode) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
for (int ref_frame = 0; ref_frame < SINGLE_REF_FRAMES; ++ref_frame) {
-#else
- for (int ref_frame = 0; ref_frame < FWD_REFS; ++ref_frame) {
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
SingleInterModeState *state;
state = &search_state->single_state[dir][mode][ref_frame];
@@ -7618,11 +6722,7 @@
}
for (int dir = 0; dir < 2; ++dir) {
for (int mode = 0; mode < SINGLE_INTER_MODE_NUM; ++mode) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
for (int ref_frame = 0; ref_frame < SINGLE_REF_FRAMES; ++ref_frame) {
-#else
- for (int ref_frame = 0; ref_frame < FWD_REFS; ++ref_frame) {
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
search_state->single_rd_order[dir][mode][ref_frame] = NONE_FRAME;
}
}
@@ -7643,21 +6743,13 @@
if (is_tip_ref_frame(ref_frame[0])) return false;
#endif // CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
if (mode_skip_mask->pred_modes[COMPACT_INDEX0_NRS(ref_frame[0])] &
(1 << this_mode)) {
-#else
- if (mode_skip_mask->pred_modes[ref_frame[0]] & (1 << this_mode)) {
-#endif // CONFIG_NEW_REF_SIGNALING
return true;
}
-#if CONFIG_NEW_REF_SIGNALING
return mode_skip_mask->ref_combo[COMPACT_INDEX0_NRS(ref_frame[0])]
[COMPACT_INDEX0_NRS(ref_frame[1]) + 1];
-#else
- return mode_skip_mask->ref_combo[ref_frame[0]][ref_frame[1] + 1];
-#endif // CONFIG_NEW_REF_SIGNALING
}
static int inter_mode_compatible_skip(const AV1_COMP *cpi, const MACROBLOCK *x,
@@ -7667,12 +6759,7 @@
const int comp_pred = is_inter_ref_frame(ref_frames[1]);
if (comp_pred) {
if (!is_comp_ref_allowed(bsize)) return 1;
-#if CONFIG_NEW_REF_SIGNALING
- if (!(cpi->common.ref_frame_flags & (1 << ref_frames[1])))
-#else
- if (!(cpi->common.ref_frame_flags & av1_ref_frame_flag_list[ref_frames[1]]))
-#endif // CONFIG_NEW_REF_SIGNALING
- return 1;
+ if (!(cpi->common.ref_frame_flags & (1 << ref_frames[1]))) return 1;
const AV1_COMMON *const cm = &cpi->common;
if (frame_is_intra_only(cm)) return 1;
@@ -7680,15 +6767,7 @@
const CurrentFrame *const current_frame = &cm->current_frame;
if (current_frame->reference_mode == SINGLE_REFERENCE) return 1;
-#if CONFIG_NEW_REF_SIGNALING
(void)x;
-#else
- const struct segmentation *const seg = &cm->seg;
- const unsigned char segment_id = x->e_mbd.mi[0]->segment_id;
- // Do not allow compound prediction if the segment level reference frame
- // feature is in use as in this case there can only be one reference.
- if (segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) return 1;
-#endif // CONFIG_NEW_REF_SIGNALING
}
if (is_inter_ref_frame(ref_frames[0]) && ref_frames[1] == INTRA_FRAME) {
@@ -7872,7 +6951,6 @@
#else
int skip_ref = skip_ref_frame_mask & (1 << ref_type);
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
-#if CONFIG_NEW_REF_SIGNALING
if (ref_type < INTER_REFS_PER_FRAME && skip_ref) {
// Since the compound ref modes depends on the motion estimation result
// of two single ref modes( best mv of single ref modes as the start
@@ -7886,20 +6964,6 @@
#endif // CONFIG_ALLOW_SAME_REF_COMPOUND
MV_REFERENCE_FRAME rf[2];
av1_set_ref_frame(rf, r);
-#else
- if (ref_type <= ALTREF_FRAME && skip_ref) {
- // Since the compound ref modes depends on the motion estimation result of
- // two single ref modes( best mv of single ref modes as the start point )
- // If current single ref mode is marked skip, we need to check if it will
- // be used in compound ref modes.
-#if CONFIG_TIP
- for (int r = ALTREF_FRAME + 1; r < MODE_CTX_REF_FRAMES - 1; ++r) {
-#else
- for (int r = ALTREF_FRAME + 1; r < MODE_CTX_REF_FRAMES; ++r) {
-#endif // CONFIG_TIP
- if (skip_ref_frame_mask & (1 << r)) continue;
- const MV_REFERENCE_FRAME *rf = ref_frame_map[r - REF_FRAMES];
-#endif // CONFIG_NEW_REF_SIGNALING
if (rf[0] == ref_type || rf[1] == ref_type) {
// Found a not skipped compound ref mode which contains current
// single ref. So this single ref can't be skipped completly
@@ -7920,13 +6984,8 @@
// If the cache only needs the current reference type for compound
// prediction, then we can skip motion mode search.
assert(x->inter_mode_cache->ref_frame);
-#if CONFIG_NEW_REF_SIGNALING
skip_motion_mode = (ref_type < INTER_REFS_PER_FRAME &&
x->inter_mode_cache->ref_frame[1] != INTRA_FRAME);
-#else
- skip_motion_mode = (ref_type <= ALTREF_FRAME &&
- x->inter_mode_cache->ref_frame[1] > INTRA_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
}
#endif // CONFIG_EXT_RECUR_PARTITIONS
if (skip_ref) return 1;
@@ -8003,17 +7062,8 @@
(void)features;
int i, j;
const PREDICTION_MODE this_mode = mbmi->mode;
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const MV_REFERENCE_FRAME ref_frame = COMPACT_INDEX0_NRS(mbmi->ref_frame[0]);
-#if CONFIG_NEW_REF_SIGNALING
const int dir = get_dir_rank(cm, mbmi->ref_frame[0], NULL);
-#else
- const int dir = ref_frame <= GOLDEN_FRAME ? 0 : 1;
-#endif // CONFIG_NEW_REF_SIGNALING
-#else
- const MV_REFERENCE_FRAME ref_frame = mbmi->ref_frame[0];
- const int dir = ref_frame <= GOLDEN_FRAME ? 0 : 1;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int mode_offset = INTER_OFFSET(this_mode);
const int ref_set = get_drl_refmv_count(features->max_drl_bits, x,
mbmi->ref_frame, this_mode);
@@ -8062,11 +7112,7 @@
for (dir = 0; dir < 2; ++dir) {
int64_t best_rd;
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
SingleInterModeState(*state)[SINGLE_REF_FRAMES];
-#else
- SingleInterModeState(*state)[FWD_REFS];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int prune_factor = prune_level >= 2 ? 6 : 5;
// Use the best rd of GLOBALMV or NEWMV to prune the unlikely reference
@@ -8157,11 +7203,7 @@
search_state->single_state_modelled[dir][mode_offset];
int max_candidates = 0;
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
-#else
- for (int i = 0; i < FWD_REFS; ++i) {
-#endif // CONFIG_NEW_REF_SIGNALING
if (search_state->single_rd_order[dir][mode_offset][i] == NONE_FRAME) break;
max_candidates++;
}
@@ -8193,13 +7235,8 @@
const int mode[2] = { compound_ref0_mode(this_mode),
compound_ref1_mode(this_mode) };
const int mode_offset[2] = { INTER_OFFSET(mode[0]), INTER_OFFSET(mode[1]) };
-#if CONFIG_NEW_REF_SIGNALING
const int mode_dir[2] = { get_dir_rank(&cpi->common, refs[0], NULL),
get_dir_rank(&cpi->common, refs[1], NULL) };
-#else
- const int mode_dir[2] = { refs[0] <= GOLDEN_FRAME ? 0 : 1,
- refs[1] <= GOLDEN_FRAME ? 0 : 1 };
-#endif // CONFIG_NEW_REF_SIGNALING
int ref_searched[2] = { 0, 0 };
int ref_mv_match[2] = { 1, 1 };
int i, j;
@@ -8302,11 +7339,7 @@
const PREDICTION_MODE this_mode,
const MV_REFERENCE_FRAME ref_frame,
int64_t this_rd) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const MV_REFERENCE_FRAME rf = COMPACT_INDEX0_NRS(ref_frame);
-#else
- const MV_REFERENCE_FRAME rf = ref_frame;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
if (this_rd < search_state->best_single_rd[rf]) {
search_state->best_single_rd[rf] = this_rd;
search_state->best_single_mode[rf] = this_mode;
@@ -8407,14 +7440,8 @@
// and store +10% of it in the 0-th (or last for NRS) element in ref_frame_rd.
static AOM_INLINE void find_top_ref(int64_t *ref_frame_rd) {
int64_t ref_copy[REF_FRAMES - 1];
-#if CONFIG_NEW_REF_SIGNALING
assert(ref_frame_rd[INTRA_FRAME_INDEX] == INT64_MAX);
memcpy(ref_copy, ref_frame_rd, sizeof(ref_frame_rd[0]) * (REF_FRAMES - 1));
-#else
- assert(ref_frame_rd[0] == INT64_MAX);
- memcpy(ref_copy, ref_frame_rd + 1,
- sizeof(ref_frame_rd[0]) * (REF_FRAMES - 1));
-#endif // CONFIG_NEW_REF_SIGNALING
qsort(ref_copy, REF_FRAMES - 1, sizeof(int64_t), compare_int64);
#if CONFIG_TIP
@@ -8427,26 +7454,16 @@
assert(cutoff < INT64_MAX / 200);
cutoff = (110 * cutoff) / 100;
}
-#if CONFIG_NEW_REF_SIGNALING
ref_frame_rd[INTRA_FRAME_INDEX] = cutoff;
-#else
- ref_frame_rd[0] = cutoff;
-#endif // CONFIG_NEW_REF_SIGNALING
}
// Check if either frame is within the cutoff.
static INLINE bool in_single_ref_cutoff(int64_t *ref_frame_rd,
MV_REFERENCE_FRAME frame1,
MV_REFERENCE_FRAME frame2) {
-#if CONFIG_NEW_REF_SIGNALING
assert(is_inter_ref_frame(frame2));
return ref_frame_rd[frame1] <= ref_frame_rd[INTRA_FRAME_INDEX] ||
ref_frame_rd[frame2] <= ref_frame_rd[INTRA_FRAME_INDEX];
-#else
- assert(frame2 > 0);
- return ref_frame_rd[frame1] <= ref_frame_rd[0] ||
- ref_frame_rd[frame2] <= ref_frame_rd[0];
-#endif // CONFIG_NEW_REF_SIGNALING
}
static AOM_INLINE void evaluate_motion_mode_for_winner_candidates(
@@ -8496,15 +7513,10 @@
mbmi->motion_mode = 0;
const int is_comp_pred = is_inter_ref_frame(mbmi->ref_frame[1]);
for (int i = 0; i < num_planes; i++) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
xd->plane[i].pre[0] = yv12_mb[COMPACT_INDEX0_NRS(mbmi->ref_frame[0])][i];
if (is_comp_pred)
xd->plane[i].pre[1] =
yv12_mb[COMPACT_INDEX0_NRS(mbmi->ref_frame[1])][i];
-#else
- xd->plane[i].pre[0] = yv12_mb[mbmi->ref_frame[0]][i];
- if (is_comp_pred) xd->plane[i].pre[1] = yv12_mb[mbmi->ref_frame[1]][i];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
int64_t skip_rd[2] = { search_state->best_skip_rd[0],
@@ -8555,23 +7567,11 @@
/*!\endcond */
static int skip_inter_mode(AV1_COMP *cpi, MACROBLOCK *x, const BLOCK_SIZE bsize,
- int64_t *ref_frame_rd,
-#if CONFIG_NEW_REF_SIGNALING
- PREDICTION_MODE this_mode,
+ int64_t *ref_frame_rd, PREDICTION_MODE this_mode,
const MV_REFERENCE_FRAME *ref_frames,
-#else
- int midx,
-#endif // CONFIG_NEW_REF_SIGNALING
InterModeSFArgs *args) {
const SPEED_FEATURES *const sf = &cpi->sf;
MACROBLOCKD *const xd = &x->e_mbd;
-#if !CONFIG_NEW_REF_SIGNALING
- // Get the actual prediction mode we are trying in this iteration
- const THR_MODES mode_enum = av1_default_mode_order[midx];
- const MODE_DEFINITION *mode_def = &av1_mode_defs[mode_enum];
- const PREDICTION_MODE this_mode = mode_def->mode;
- const MV_REFERENCE_FRAME *ref_frames = mode_def->ref_frame;
-#endif // CONFIG_NEW_REF_SIGNALING
const MV_REFERENCE_FRAME ref_frame = ref_frames[0];
const MV_REFERENCE_FRAME second_ref_frame = ref_frames[1];
const int comp_pred = is_inter_ref_frame(second_ref_frame);
@@ -8611,15 +7611,9 @@
int mul_fact = args->search_state->best_mode_skippable
? args->mode_thresh_mul_fact
: (1 << MODE_THRESH_QBITS);
-#if CONFIG_NEW_REF_SIGNALING
int64_t mode_threshold =
(args->search_state->mode_threshold[this_mode] * mul_fact) >>
MODE_THRESH_QBITS;
-#else
- int64_t mode_threshold =
- (args->search_state->mode_threshold[mode_enum] * mul_fact) >>
- MODE_THRESH_QBITS;
-#endif // CONFIG_NEW_REF_SIGNALING
if (args->search_state->best_rd < mode_threshold) return 1;
@@ -8646,13 +7640,9 @@
// for a reference frame. Only search compound modes that have a reference
// frame at least as good as 110% the best one.
if (!args->prune_cpd_using_sr_stats_ready &&
-#if CONFIG_NEW_REF_SIGNALING
*args->num_single_modes_processed ==
cpi->common.ref_frames_info.num_total_refs *
SINGLE_INTER_MODE_NUM) {
-#else
- *args->num_single_modes_processed == NUM_SINGLE_REF_MODES) {
-#endif // CONFIG_NEW_REF_SIGNALING
find_top_ref(ref_frame_rd);
args->prune_cpd_using_sr_stats_ready = 1;
}
@@ -8760,15 +7750,10 @@
// Select prediction reference frames.
const int is_comp_pred = is_inter_ref_frame(mbmi->ref_frame[1]);
for (int i = 0; i < num_planes; i++) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
xd->plane[i].pre[0] = yv12_mb[COMPACT_INDEX0_NRS(mbmi->ref_frame[0])][i];
if (is_comp_pred)
xd->plane[i].pre[1] =
yv12_mb[COMPACT_INDEX0_NRS(mbmi->ref_frame[1])][i];
-#else
- xd->plane[i].pre[0] = yv12_mb[mbmi->ref_frame[0]][i];
- if (is_comp_pred) xd->plane[i].pre[1] = yv12_mb[mbmi->ref_frame[1]][i];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
// Build the prediction for this mode
@@ -8886,7 +7871,6 @@
}
#if CONFIG_TIP
-#if CONFIG_NEW_REF_SIGNALING
static INLINE int is_tip_mode(PREDICTION_MODE mode) {
#if IMPROVED_AMVD
return (mode == NEARMV || mode == NEWMV || mode == AMVDNEWMV);
@@ -8894,16 +7878,6 @@
return (mode == NEARMV || mode == NEWMV);
#endif // IMPROVED_AMVD
}
-#else
-static INLINE int is_tip_mode(THR_MODES mode) {
-#if IMPROVED_AMVD
- return (mode == THR_NEAR_TIP || mode == THR_NEW_TIP ||
- mode == THR_AMVDNEW_TIP);
-#else
- return (mode == THR_NEAR_TIP || mode == THR_NEW_TIP);
-#endif // IMPROVED_AMVD
-}
-#endif // CONFIG_NEW_REF_SIGNALING
#endif // CONFIG_TIP
// TODO(chiyotsai@google.com): See the todo for av1_rd_pick_intra_mode_sb.
@@ -9117,22 +8091,12 @@
// 'inter_cost_info_from_tpl.best_inter_cost' does not correspond to a
// pruned ref frame.
int valid_refs[INTER_REFS_PER_FRAME] = { 0 };
-#if CONFIG_NEW_REF_SIGNALING
for (MV_REFERENCE_FRAME frame = 0;
frame < cm->ref_frames_info.num_total_refs; frame++) {
const MV_REFERENCE_FRAME refs[2] = { frame, NONE_FRAME };
valid_refs[frame] = x->tpl_keep_ref_frame[frame] ||
!prune_ref_by_selective_ref_frame(cpi, x, refs);
}
-#else
- for (MV_REFERENCE_FRAME frame = LAST_FRAME; frame < REF_FRAMES; frame++) {
- const MV_REFERENCE_FRAME refs[2] = { frame, NONE_FRAME };
- valid_refs[frame - 1] =
- x->tpl_keep_ref_frame[frame] ||
- !prune_ref_by_selective_ref_frame(
- cpi, x, refs, cm->cur_frame->ref_display_order_hint);
- }
-#endif // CONFIG_NEW_REF_SIGNALING
av1_zero(inter_cost_info_from_tpl);
get_block_level_tpl_stats(cpi, bsize, mi_row, mi_col, valid_refs,
&inter_cost_info_from_tpl);
@@ -9201,7 +8165,6 @@
// with av1_default_mode_order to get the enum that defines the mode, which
// can be used with av1_mode_defs to get the prediction mode and the ref
// frames.
-#if CONFIG_NEW_REF_SIGNALING
for (PREDICTION_MODE this_mode = 0; this_mode < MB_MODE_COUNT; ++this_mode) {
#if CONFIG_TIP
for (MV_REFERENCE_FRAME rf = NONE_FRAME;
@@ -9254,30 +8217,6 @@
const int is_single_pred =
ref_frame != INTRA_FRAME && second_ref_frame == NONE_FRAME;
-#else
-
- for (THR_MODES midx = THR_MODE_START; midx < THR_MODE_END; ++midx) {
- // Get the actual prediction mode we are trying in this iteration
- const THR_MODES mode_enum = av1_default_mode_order[midx];
- const MODE_DEFINITION *mode_def = &av1_mode_defs[mode_enum];
- const PREDICTION_MODE this_mode = mode_def->mode;
- const MV_REFERENCE_FRAME *ref_frames = mode_def->ref_frame;
-#if CONFIG_TIP
- if (is_tip_mode(mode_enum) &&
-#if CONFIG_EXT_RECUR_PARTITIONS
- (!is_tip_allowed_bsize(mbmi) ||
-#else // CONFIG_EXT_RECUR_PARTITIONS
- (!is_tip_allowed_bsize(bsize) ||
-#endif // CONFIG_EXT_RECUR_PARTITIONS
- !cm->features.tip_frame_mode))
- continue;
-#endif // CONFIG_TIP
-
- const MV_REFERENCE_FRAME ref_frame = ref_frames[0];
- const MV_REFERENCE_FRAME second_ref_frame = ref_frames[1];
- const int is_single_pred =
- is_inter_ref_frame(ref_frame) && second_ref_frame == NONE_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
const int comp_pred = is_inter_ref_frame(second_ref_frame);
#if CONFIG_IBC_SR_EXT
@@ -9289,12 +8228,12 @@
);
#else
- init_mbmi(mbmi, this_mode, ref_frames, cm
+ init_mbmi(mbmi, this_mode, ref_frames, cm
#if CONFIG_FLEX_MVRES
- ,
- xd->sbi
+ ,
+ xd->sbi
#endif
- );
+ );
#endif // CONFIG_IBC_SR_EXT
#if CONFIG_WARPMV
@@ -9331,12 +8270,7 @@
set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
// Apply speed features to decide if this inter mode can be skipped
- if (skip_inter_mode(cpi, x, bsize, ref_frame_rd,
-#if CONFIG_NEW_REF_SIGNALING
- this_mode, ref_frames,
-#else
- midx,
-#endif // CONFIG_NEW_REF_SIGNALING
+ if (skip_inter_mode(cpi, x, bsize, ref_frame_rd, this_mode, ref_frames,
&sf_args))
continue;
@@ -9361,16 +8295,10 @@
// Select prediction reference frames.
for (i = 0; i < num_planes; i++) {
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
xd->plane[i].pre[0] = yv12_mb[COMPACT_INDEX0_NRS(ref_frame)][i];
if (comp_pred)
xd->plane[i].pre[1] =
yv12_mb[COMPACT_INDEX0_NRS(second_ref_frame)][i];
-
-#else
- xd->plane[i].pre[0] = yv12_mb[ref_frame][i];
- if (comp_pred) xd->plane[i].pre[1] = yv12_mb[second_ref_frame][i];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
}
#if CONFIG_FORWARDSKIP
@@ -9393,11 +8321,7 @@
RD_STATS rd_stats, rd_stats_y, rd_stats_uv;
av1_init_rd_stats(&rd_stats);
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_frame_index = COMPACT_INDEX0_NRS(ref_frame);
-#else
- const int ref_frame_index = ref_frame;
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
const int ref_frame_cost =
comp_pred ? ref_costs_comp[ref_frame][second_ref_frame]
@@ -9463,12 +8387,8 @@
#endif // CONFIG_OPTFLOW_ON_TIP
assert(IMPLIES(comp_pred,
cm->current_frame.reference_mode != SINGLE_REFERENCE));
-#if CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
search_state.best_pred_sse =
x->pred_sse[COMPACT_INDEX0_NRS(ref_frame)];
-#else
- search_state.best_pred_sse = x->pred_sse[ref_frame];
-#endif // CONFIG_NEW_REF_SIGNALING || CONFIG_TIP
update_search_state(&search_state, rd_cost, ctx, &rd_stats,
&rd_stats_y, &rd_stats_uv, this_mode, x,
do_tx_search
@@ -9493,10 +8413,8 @@
comp_pred, x->rdmult, &search_state,
compmode_cost);
-#if CONFIG_NEW_REF_SIGNALING
} // end of ref1 loop
} // end of ref0 loop
-#endif // CONFIG_NEW_REF_SIGNALING
} // end of mode loop
if (cpi->sf.winner_mode_sf.motion_mode_for_winner_cand) {
@@ -9560,11 +8478,7 @@
}
}
-#if CONFIG_NEW_REF_SIGNALING
const unsigned int intra_ref_frame_cost = ref_costs_single[INTRA_FRAME_INDEX];
-#else
- const unsigned int intra_ref_frame_cost = ref_costs_single[INTRA_FRAME];
-#endif // CONFIG_NEW_REF_SIGNALING
int64_t best_model_rd = INT64_MAX;
int64_t top_intra_model_rd[TOP_INTRA_MODEL_COUNT];
for (i = 0; i < TOP_INTRA_MODEL_COUNT; i++) {
@@ -9655,15 +8569,7 @@
const PREDICTION_MODE this_mode = mbmi->mode;
-#if CONFIG_NEW_REF_SIGNALING
MV_REFERENCE_FRAME refs[2] = { INTRA_FRAME, NONE_FRAME };
-#else
- THR_MODES mode_enum = mbmi->mode + THR_DC;
- MV_REFERENCE_FRAME refs[2] = { av1_mode_defs[mode_enum].ref_frame[0],
- av1_mode_defs[mode_enum].ref_frame[1] };
- assert(av1_mode_defs[mode_enum].ref_frame[0] == INTRA_FRAME);
- assert(av1_mode_defs[mode_enum].ref_frame[1] == NONE_FRAME);
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_IBC_SR_EXT
init_mbmi(mbmi, this_mode, refs, cm, xd
@@ -9771,25 +8677,12 @@
search_state.best_mbmode.skip_mode = 0;
if (cm->current_frame.skip_mode_info.skip_mode_flag &&
is_comp_ref_allowed(bsize)) {
-#if CONFIG_NEW_REF_SIGNALING
#if CONFIG_SKIP_MODE_ENHANCEMENT
rd_pick_motion_copy_mode(&search_state, cpi, x, bsize, yv12_mb, ctx,
rd_cost);
#else
rd_pick_skip_mode(rd_cost, &search_state, cpi, x, bsize, yv12_mb);
#endif // CONFIG_SKIP_MODE_ENHANCEMENT
-#else
- const struct segmentation *const seg = &cm->seg;
- unsigned char segment_id = mbmi->segment_id;
- if (!segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
-#if CONFIG_SKIP_MODE_ENHANCEMENT
- rd_pick_motion_copy_mode(&search_state, cpi, x, bsize, yv12_mb, ctx,
- rd_cost);
-#else
- rd_pick_skip_mode(rd_cost, &search_state, cpi, x, bsize, yv12_mb);
-#endif // CONFIG_SKIP_MODE_ENHANCEMENT
- }
-#endif // CONFIG_NEW_REF_SIGNALING
}
#if CONFIG_IBC_SR_EXT
@@ -9865,9 +8758,6 @@
if (!cpi->rc.is_src_frame_alt_ref && cpi->sf.inter_sf.adaptive_rd_thresh) {
av1_update_rd_thresh_fact(cm, x->thresh_freq_fact,
sf->inter_sf.adaptive_rd_thresh, bsize,
-#if !CONFIG_NEW_REF_SIGNALING
- search_state.best_mbmode.ref_frame,
-#endif // !CONFIG_NEW_REF_SIGNALING
search_state.best_mbmode.mode);
}
// macroblock modes
@@ -9940,18 +8830,6 @@
}
#endif // CONFIG_WARP_REF_LIST
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- const THR_MODES best_mode_enum = get_prediction_mode_idx(
- search_state.best_mbmode.mode, search_state.best_mbmode.ref_frame[0],
- search_state.best_mbmode.ref_frame[1]);
- store_coding_context(x, ctx, best_mode_enum, search_state.best_pred_diff,
- search_state.best_mode_skippable
-#if CONFIG_C071_SUBBLK_WARPMV
- ,
- cm
-#endif // CONFIG_C071_SUBBLK_WARPMV
- );
-#else
store_coding_context(x, ctx, search_state.best_pred_diff,
search_state.best_mode_skippable
#if CONFIG_C071_SUBBLK_WARPMV
@@ -9959,7 +8837,6 @@
cm
#endif // CONFIG_C071_SUBBLK_WARPMV
);
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
if (mbmi->palette_mode_info.palette_size[1] > 0) {
assert(try_palette);
@@ -10000,11 +8877,7 @@
ref_costs_comp);
for (i = 0; i < REF_FRAMES; ++i) x->pred_sse[i] = INT_MAX;
-#if CONFIG_NEW_REF_SIGNALING
for (i = 0; i < REF_FRAMES; ++i) x->pred_mv_sad[i] = INT_MAX;
-#else
- for (i = LAST_FRAME; i < REF_FRAMES; ++i) x->pred_mv_sad[i] = INT_MAX;
-#endif // CONFIG_NEW_REF_SIGNALING
#if CONFIG_TIP
x->pred_sse[TIP_FRAME_INDEX] = INT_MAX;
@@ -10021,15 +8894,8 @@
mbmi->mode = GLOBALMV;
mbmi->motion_mode = SIMPLE_TRANSLATION;
mbmi->uv_mode = UV_DC_PRED;
-#if CONFIG_NEW_REF_SIGNALING
const MV_REFERENCE_FRAME last_frame = get_closest_pastcur_ref_index(cm);
mbmi->ref_frame[0] = last_frame;
-#else
- if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME))
- mbmi->ref_frame[0] = get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
- else
- mbmi->ref_frame[0] = LAST_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
mbmi->ref_frame[1] = NONE_FRAME;
#if CONFIG_TIP
if (is_tip_ref_frame(mbmi->ref_frame[0])) {
@@ -10118,14 +8984,10 @@
if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT)
rate2 += comp_inter_cost[comp_pred];
- // Estimate the reference frame signaling cost and add it
- // to the rolling cost variable.
+ // Estimate the reference frame signaling cost and add it
+ // to the rolling cost variable.
-#if CONFIG_NEW_REF_SIGNALING
rate2 += ref_costs_single[last_frame];
-#else
- rate2 += ref_costs_single[LAST_FRAME];
-#endif // CONFIG_NEW_REF_SIGNALING
this_rd = RDCOST(x->rdmult, rate2, distortion2);
rd_cost->rate = rate2;
@@ -10141,34 +9003,19 @@
assert((interp_filter == SWITCHABLE) || (interp_filter == mbmi->interp_fltr));
if (cpi->sf.inter_sf.adaptive_rd_thresh) {
-#if !CONFIG_NEW_REF_SIGNALING
- MV_REFERENCE_FRAME global_mv_refs[2] = { LAST_FRAME, INTRA_FRAME };
-#endif // !CONFIG_NEW_REF_SIGNALING
av1_update_rd_thresh_fact(cm, x->thresh_freq_fact,
cpi->sf.inter_sf.adaptive_rd_thresh, bsize,
-#if !CONFIG_NEW_REF_SIGNALING
- global_mv_refs,
-#endif // !CONFIG_NEW_REF_SIGNALING
GLOBALMV);
}
av1_zero(best_pred_diff);
-#if CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
- store_coding_context(x, ctx, THR_GLOBALMV, best_pred_diff, 0
-#if CONFIG_C071_SUBBLK_WARPMV
- ,
- cm
-#endif // CONFIG_C071_SUBBLK_WARPMV
- );
-#else
store_coding_context(x, ctx, best_pred_diff, 0
#if CONFIG_C071_SUBBLK_WARPMV
,
cm
#endif // CONFIG_C071_SUBBLK_WARPMV
);
-#endif // CONFIG_INTERNAL_STATS && !CONFIG_NEW_REF_SIGNALING
}
/*!\cond */
diff --git a/av1/encoder/rdopt.h b/av1/encoder/rdopt.h
index efdf7ab..47685f4 100644
--- a/av1/encoder/rdopt.h
+++ b/av1/encoder/rdopt.h
@@ -192,7 +192,6 @@
USABLE_REF_MV_STACK_SIZE * sizeof(xd->ref_mv_stack[0][0]));
}
-#if CONFIG_NEW_REF_SIGNALING
#define PRUNE_SINGLE_REFS 0
static INLINE int prune_ref_by_selective_ref_frame(
const AV1_COMP *const cpi, const MACROBLOCK *const x,
@@ -298,69 +297,6 @@
}
return 0;
}
-#else
-// This function prunes the mode if either of the reference frame falls in the
-// pruning list
-static INLINE int prune_ref(const MV_REFERENCE_FRAME *const ref_frame,
- const unsigned int *const ref_display_order_hint,
- const unsigned int frame_display_order_hint,
- const int *ref_frame_list) {
- for (int i = 0; i < 2; i++) {
- if (ref_frame_list[i] == NONE_FRAME) continue;
-
- if (ref_frame[0] == ref_frame_list[i] ||
- ref_frame[1] == ref_frame_list[i]) {
- if (av1_encoder_get_relative_dist(
- ref_display_order_hint[ref_frame_list[i] - LAST_FRAME],
- frame_display_order_hint) < 0)
- return 1;
- }
- }
- return 0;
-}
-
-static INLINE int prune_ref_by_selective_ref_frame(
- const AV1_COMP *const cpi, const MACROBLOCK *const x,
- const MV_REFERENCE_FRAME *const ref_frame,
- const unsigned int *const ref_display_order_hint) {
- const SPEED_FEATURES *const sf = &cpi->sf;
-
- if (!sf->inter_sf.selective_ref_frame) return 0;
-
- const int comp_pred = is_inter_ref_frame(ref_frame[1]);
-
- if (sf->inter_sf.selective_ref_frame >= 2 ||
- (sf->inter_sf.selective_ref_frame == 1 && comp_pred)) {
- int ref_frame_list[2] = { LAST3_FRAME, LAST2_FRAME };
-
- if (x != NULL) {
- if (x->tpl_keep_ref_frame[LAST3_FRAME]) ref_frame_list[0] = NONE_FRAME;
- if (x->tpl_keep_ref_frame[LAST2_FRAME]) ref_frame_list[1] = NONE_FRAME;
- }
-
- if (prune_ref(ref_frame, ref_display_order_hint,
- ref_display_order_hint[GOLDEN_FRAME - LAST_FRAME],
- ref_frame_list))
- return 1;
- }
-
- if (sf->inter_sf.selective_ref_frame >= 3) {
- int ref_frame_list[2] = { ALTREF2_FRAME, BWDREF_FRAME };
-
- if (x != NULL) {
- if (x->tpl_keep_ref_frame[ALTREF2_FRAME]) ref_frame_list[0] = NONE_FRAME;
- if (x->tpl_keep_ref_frame[BWDREF_FRAME]) ref_frame_list[1] = NONE_FRAME;
- }
-
- if (prune_ref(ref_frame, ref_display_order_hint,
- ref_display_order_hint[LAST_FRAME - LAST_FRAME],
- ref_frame_list))
- return 1;
- }
-
- return 0;
-}
-#endif // CONFIG_NEW_REF_SIGNALING
// This function will copy the best reference mode information from
// MB_MODE_INFO_EXT to MB_MODE_INFO_EXT_FRAME.
diff --git a/av1/encoder/rdopt_data_defs.h b/av1/encoder/rdopt_data_defs.h
deleted file mode 100644
index 6696cb6..0000000
--- a/av1/encoder/rdopt_data_defs.h
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright (c) 2021, Alliance for Open Media. All rights reserved
- *
- * This source code is subject to the terms of the BSD 3-Clause Clear License
- * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
- * License was not distributed with this source code in the LICENSE file, you
- * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the
- * Alliance for Open Media Patent License 1.0 was not distributed with this
- * source code in the PATENTS file, you can obtain it at
- * aomedia.org/license/patent-license/.
- */
-
-#ifndef AOM_AV1_ENCODER_RDOPT_DATA_DEFS_H_
-#define AOM_AV1_ENCODER_RDOPT_DATA_DEFS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static const THR_MODES intra_to_mode_idx[INTRA_MODE_NUM] = {
- THR_DC, // DC_PRED,
- THR_V_PRED, // V_PRED,
- THR_H_PRED, // H_PRED,
- THR_D45_PRED, // D45_PRED,
- THR_D135_PRED, // D135_PRED,
- THR_D113_PRED, // D113_PRED,
- THR_D157_PRED, // D157_PRED,
- THR_D203_PRED, // D203_PRED,
- THR_D67_PRED, // D67_PRED,
- THR_SMOOTH, // SMOOTH_PRED,
- THR_SMOOTH_V, // SMOOTH_V_PRED,
- THR_SMOOTH_H, // SMOOTH_H_PRED,
- THR_PAETH, // PAETH_PRED,
-};
-
-/* clang-format off */
-#if CONFIG_TIP
-static const THR_MODES single_inter_to_mode_idx[SINGLE_INTER_MODE_NUM]
- [EXTREF_FRAMES] = {
- // NEARMV,
- { THR_INVALID, THR_NEARMV, THR_NEARL2, THR_NEARL3,
- THR_NEARG, THR_NEARB, THR_NEARA2, THR_NEARA, THR_NEAR_TIP, },
- // GLOBALMV,
- { THR_INVALID, THR_GLOBALMV, THR_GLOBALL2, THR_GLOBALL3,
- THR_GLOBALG, THR_GLOBALB, THR_GLOBALA2, THR_GLOBALA, },
- // NEWMV,
- { THR_INVALID, THR_NEWMV, THR_NEWL2, THR_NEWL3,
- THR_NEWG, THR_NEWB, THR_NEWA2, THR_NEWA, THR_NEW_TIP, },
-#if IMPROVED_AMVD
- // AMVDNEWMV,
- { THR_INVALID, THR_AMVDNEWMV, THR_AMVDNEWL2, THR_AMVDNEWL3,
- THR_AMVDNEWG, THR_AMVDNEWB, THR_AMVDNEWA2, THR_AMVDNEWA,
- THR_AMVDNEW_TIP },
-#endif // IMPROVED_AMVD
-};
-#else
-static const THR_MODES single_inter_to_mode_idx[SINGLE_INTER_MODE_NUM]
- [REF_FRAMES] = {
- // NEARMV,
- { THR_INVALID, THR_NEARMV, THR_NEARL2, THR_NEARL3,
- THR_NEARG, THR_NEARB, THR_NEARA2, THR_NEARA, },
- // GLOBALMV,
- { THR_INVALID, THR_GLOBALMV, THR_GLOBALL2, THR_GLOBALL3,
- THR_GLOBALG, THR_GLOBALB, THR_GLOBALA2, THR_GLOBALA, },
- // NEWMV,
- { THR_INVALID, THR_NEWMV, THR_NEWL2, THR_NEWL3,
- THR_NEWG, THR_NEWB, THR_NEWA2, THR_NEWA, },
-#if IMPROVED_AMVD
- // AMVDNEWMV,
- { THR_INVALID, THR_AMVDNEWMV, THR_AMVDNEWL2, THR_AMVDNEWL3,
- THR_AMVDNEWG, THR_AMVDNEWB, THR_AMVDNEWA2, THR_AMVDNEWA, },
-#endif // IMPROVED_AMVD
-};
-#endif // CONFIG_TIP
-/* clang-format on */
-
-/* clang-format off */
-static const THR_MODES comp_inter_to_mode_idx[COMP_INTER_MODE_NUM][REF_FRAMES]
- [REF_FRAMES] = {
- // NEAR_NEARMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEARLL2, THR_COMP_NEAR_NEARLL3,
- THR_COMP_NEAR_NEARLG, THR_COMP_NEAR_NEARLB,
- THR_COMP_NEAR_NEARLA2, THR_COMP_NEAR_NEARLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEARL2B,
- THR_COMP_NEAR_NEARL2A2, THR_COMP_NEAR_NEARL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEARL3B,
- THR_COMP_NEAR_NEARL3A2, THR_COMP_NEAR_NEARL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEARGB,
- THR_COMP_NEAR_NEARGA2, THR_COMP_NEAR_NEARGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEARBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // NEAR_NEWMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEWLL2, THR_COMP_NEAR_NEWLL3,
- THR_COMP_NEAR_NEWLG, THR_COMP_NEAR_NEWLB,
- THR_COMP_NEAR_NEWLA2, THR_COMP_NEAR_NEWLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEWL2B,
- THR_COMP_NEAR_NEWL2A2, THR_COMP_NEAR_NEWL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEWL3B,
- THR_COMP_NEAR_NEWL3A2, THR_COMP_NEAR_NEWL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEWGB,
- THR_COMP_NEAR_NEWGA2, THR_COMP_NEAR_NEWGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEAR_NEWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // NEW_NEARMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEARLL2, THR_COMP_NEW_NEARLL3,
- THR_COMP_NEW_NEARLG, THR_COMP_NEW_NEARLB,
- THR_COMP_NEW_NEARLA2, THR_COMP_NEW_NEARLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEARL2B,
- THR_COMP_NEW_NEARL2A2, THR_COMP_NEW_NEARL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEARL3B,
- THR_COMP_NEW_NEARL3A2, THR_COMP_NEW_NEARL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEARGB,
- THR_COMP_NEW_NEARGA2, THR_COMP_NEW_NEARGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEARBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // GLOBAL_GLOBALMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_GLOBAL_GLOBALLL2, THR_COMP_GLOBAL_GLOBALLL3,
- THR_COMP_GLOBAL_GLOBALLG, THR_COMP_GLOBAL_GLOBALLB,
- THR_COMP_GLOBAL_GLOBALLA2, THR_COMP_GLOBAL_GLOBALLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_GLOBAL_GLOBALL2B,
- THR_COMP_GLOBAL_GLOBALL2A2, THR_COMP_GLOBAL_GLOBALL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_GLOBAL_GLOBALL3B,
- THR_COMP_GLOBAL_GLOBALL3A2, THR_COMP_GLOBAL_GLOBALL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_GLOBAL_GLOBALGB,
- THR_COMP_GLOBAL_GLOBALGA2, THR_COMP_GLOBAL_GLOBALGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_GLOBAL_GLOBALBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // NEW_NEWMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEWLL2, THR_COMP_NEW_NEWLL3,
- THR_COMP_NEW_NEWLG, THR_COMP_NEW_NEWLB,
- THR_COMP_NEW_NEWLA2, THR_COMP_NEW_NEWLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEWL2B,
- THR_COMP_NEW_NEWL2A2, THR_COMP_NEW_NEWL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEWL3B,
- THR_COMP_NEW_NEWL3A2, THR_COMP_NEW_NEWL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEWGB,
- THR_COMP_NEW_NEWGA2, THR_COMP_NEW_NEWGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_NEW_NEWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
-#if CONFIG_JOINT_MVD
- // JOINT_NEWMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_JOINT_NEWLL2, THR_COMP_JOINT_NEWLL3,
- THR_COMP_JOINT_NEWLG, THR_COMP_JOINT_NEWLB,
- THR_COMP_JOINT_NEWLA2, THR_COMP_JOINT_NEWLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEWL2B,
- THR_COMP_JOINT_NEWL2A2, THR_COMP_JOINT_NEWL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEWL3B,
- THR_COMP_JOINT_NEWL3A2, THR_COMP_JOINT_NEWL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEWGB,
- THR_COMP_JOINT_NEWGA2, THR_COMP_JOINT_NEWGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
-#if IMPROVED_AMVD
- // JOINT_AMVDNEWMV,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_JOINT_AMVDNEWLL2, THR_COMP_JOINT_AMVDNEWLL3,
- THR_COMP_JOINT_AMVDNEWLG, THR_COMP_JOINT_AMVDNEWLB,
- THR_COMP_JOINT_AMVDNEWLA2, THR_COMP_JOINT_AMVDNEWLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEWL2B,
- THR_COMP_JOINT_AMVDNEWL2A2, THR_COMP_JOINT_AMVDNEWL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEWL3B,
- THR_COMP_JOINT_AMVDNEWL3A2, THR_COMP_JOINT_AMVDNEWL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEWGB,
- THR_COMP_JOINT_AMVDNEWGA2, THR_COMP_JOINT_AMVDNEWGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- // NEAR_NEARMV_OPTFLOW,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_COMP_NEAR_NEAR_OPTFLOWLL2,
- THR_COMP_NEAR_NEAR_OPTFLOWLL3, THR_COMP_NEAR_NEAR_OPTFLOWLG,
- THR_COMP_NEAR_NEAR_OPTFLOWLB, THR_COMP_NEAR_NEAR_OPTFLOWLA2,
- THR_COMP_NEAR_NEAR_OPTFLOWLA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEAR_OPTFLOWL2B, THR_COMP_NEAR_NEAR_OPTFLOWL2A2,
- THR_COMP_NEAR_NEAR_OPTFLOWL2A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEAR_OPTFLOWL3B, THR_COMP_NEAR_NEAR_OPTFLOWL3A2,
- THR_COMP_NEAR_NEAR_OPTFLOWL3A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEAR_OPTFLOWGB, THR_COMP_NEAR_NEAR_OPTFLOWGA2,
- THR_COMP_NEAR_NEAR_OPTFLOWGA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_COMP_NEAR_NEAR_OPTFLOWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // NEAR_NEWMV_OPTFLOW,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_COMP_NEAR_NEW_OPTFLOWLL2,
- THR_COMP_NEAR_NEW_OPTFLOWLL3, THR_COMP_NEAR_NEW_OPTFLOWLG,
- THR_COMP_NEAR_NEW_OPTFLOWLB, THR_COMP_NEAR_NEW_OPTFLOWLA2,
- THR_COMP_NEAR_NEW_OPTFLOWLA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEW_OPTFLOWL2B, THR_COMP_NEAR_NEW_OPTFLOWL2A2,
- THR_COMP_NEAR_NEW_OPTFLOWL2A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEW_OPTFLOWL3B, THR_COMP_NEAR_NEW_OPTFLOWL3A2,
- THR_COMP_NEAR_NEW_OPTFLOWL3A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEAR_NEW_OPTFLOWGB, THR_COMP_NEAR_NEW_OPTFLOWGA2,
- THR_COMP_NEAR_NEW_OPTFLOWGA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_COMP_NEAR_NEW_OPTFLOWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // NEW_NEARMV_OPTFLOW,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_COMP_NEW_NEAR_OPTFLOWLL2,
- THR_COMP_NEW_NEAR_OPTFLOWLL3, THR_COMP_NEW_NEAR_OPTFLOWLG,
- THR_COMP_NEW_NEAR_OPTFLOWLB, THR_COMP_NEW_NEAR_OPTFLOWLA2,
- THR_COMP_NEW_NEAR_OPTFLOWLA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEAR_OPTFLOWL2B, THR_COMP_NEW_NEAR_OPTFLOWL2A2,
- THR_COMP_NEW_NEAR_OPTFLOWL2A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEAR_OPTFLOWL3B, THR_COMP_NEW_NEAR_OPTFLOWL3A2,
- THR_COMP_NEW_NEAR_OPTFLOWL3A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEAR_OPTFLOWGB, THR_COMP_NEW_NEAR_OPTFLOWGA2,
- THR_COMP_NEW_NEAR_OPTFLOWGA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_COMP_NEW_NEAR_OPTFLOWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
- // NEW_NEWMV_OPTFLOW,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_COMP_NEW_NEW_OPTFLOWLL2,
- THR_COMP_NEW_NEW_OPTFLOWLL3, THR_COMP_NEW_NEW_OPTFLOWLG,
- THR_COMP_NEW_NEW_OPTFLOWLB, THR_COMP_NEW_NEW_OPTFLOWLA2,
- THR_COMP_NEW_NEW_OPTFLOWLA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEW_OPTFLOWL2B, THR_COMP_NEW_NEW_OPTFLOWL2A2,
- THR_COMP_NEW_NEW_OPTFLOWL2A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEW_OPTFLOWL3B, THR_COMP_NEW_NEW_OPTFLOWL3A2,
- THR_COMP_NEW_NEW_OPTFLOWL3A, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_COMP_NEW_NEW_OPTFLOWGB, THR_COMP_NEW_NEW_OPTFLOWGA2,
- THR_COMP_NEW_NEW_OPTFLOWGA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_COMP_NEW_NEW_OPTFLOWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
-#if CONFIG_JOINT_MVD
- // JOINT_NEWMV_OPTFLOW,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_JOINT_NEW_OPTFLOWLL2, THR_COMP_JOINT_NEW_OPTFLOWLL3,
- THR_COMP_JOINT_NEW_OPTFLOWLG, THR_COMP_JOINT_NEW_OPTFLOWLB,
- THR_COMP_JOINT_NEW_OPTFLOWLA2, THR_COMP_JOINT_NEW_OPTFLOWLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEW_OPTFLOWL2B,
- THR_COMP_JOINT_NEW_OPTFLOWL2A2, THR_COMP_JOINT_NEW_OPTFLOWL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEW_OPTFLOWL3B,
- THR_COMP_JOINT_NEW_OPTFLOWL3A2, THR_COMP_JOINT_NEW_OPTFLOWL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEW_OPTFLOWGB,
- THR_COMP_JOINT_NEW_OPTFLOWGA2, THR_COMP_JOINT_NEW_OPTFLOWGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_NEW_OPTFLOWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
-#if IMPROVED_AMVD
- // JOINT_AMVDNEWMV_OPTFLOW,
- {
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID,
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLL2, THR_COMP_JOINT_AMVDNEW_OPTFLOWLL3,
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLG, THR_COMP_JOINT_AMVDNEW_OPTFLOWLB,
- THR_COMP_JOINT_AMVDNEW_OPTFLOWLA2, THR_COMP_JOINT_AMVDNEW_OPTFLOWLA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEW_OPTFLOWL2B,
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL2A2, THR_COMP_JOINT_AMVDNEW_OPTFLOWL2A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEW_OPTFLOWL3B,
- THR_COMP_JOINT_AMVDNEW_OPTFLOWL3A2, THR_COMP_JOINT_AMVDNEW_OPTFLOWL3A, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEW_OPTFLOWGB,
- THR_COMP_JOINT_AMVDNEW_OPTFLOWGA2, THR_COMP_JOINT_AMVDNEW_OPTFLOWGA, },
- { THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID,
- THR_INVALID, THR_COMP_JOINT_AMVDNEW_OPTFLOWBA, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- { THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID, THR_INVALID,
- THR_INVALID, THR_INVALID, THR_INVALID, },
- },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-};
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // AOM_AV1_ENCODER_RDOPT_DATA_DEFS_H_
diff --git a/av1/encoder/rdopt_utils.h b/av1/encoder/rdopt_utils.h
index 476b73e..de13e91 100644
--- a/av1/encoder/rdopt_utils.h
+++ b/av1/encoder/rdopt_utils.h
@@ -17,9 +17,6 @@
#include "av1/encoder/block.h"
#include "av1/common/cfl.h"
#include "av1/common/pred_common.h"
-#if !CONFIG_NEW_REF_SIGNALING
-#include "av1/encoder/rdopt_data_defs.h"
-#endif // !CONFIG_NEW_REF_SIGNALING
#ifdef __cplusplus
extern "C" {
@@ -34,486 +31,6 @@
MV_REFERENCE_FRAME ref_frame[2];
} MODE_DEFINITION;
-#if !CONFIG_NEW_REF_SIGNALING
-// This array defines the mapping from the enums in THR_MODES to the actual
-// prediction modes and refrence frames
-static const MODE_DEFINITION av1_mode_defs[MAX_MODES] = {
- { NEARMV, { LAST_FRAME, NONE_FRAME } },
- { NEARMV, { LAST2_FRAME, NONE_FRAME } },
- { NEARMV, { LAST3_FRAME, NONE_FRAME } },
- { NEARMV, { BWDREF_FRAME, NONE_FRAME } },
- { NEARMV, { ALTREF2_FRAME, NONE_FRAME } },
- { NEARMV, { ALTREF_FRAME, NONE_FRAME } },
- { NEARMV, { GOLDEN_FRAME, NONE_FRAME } },
-
- { NEWMV, { LAST_FRAME, NONE_FRAME } },
- { NEWMV, { LAST2_FRAME, NONE_FRAME } },
- { NEWMV, { LAST3_FRAME, NONE_FRAME } },
- { NEWMV, { BWDREF_FRAME, NONE_FRAME } },
- { NEWMV, { ALTREF2_FRAME, NONE_FRAME } },
- { NEWMV, { ALTREF_FRAME, NONE_FRAME } },
- { NEWMV, { GOLDEN_FRAME, NONE_FRAME } },
-
- { GLOBALMV, { LAST_FRAME, NONE_FRAME } },
- { GLOBALMV, { LAST2_FRAME, NONE_FRAME } },
- { GLOBALMV, { LAST3_FRAME, NONE_FRAME } },
- { GLOBALMV, { BWDREF_FRAME, NONE_FRAME } },
- { GLOBALMV, { ALTREF2_FRAME, NONE_FRAME } },
- { GLOBALMV, { GOLDEN_FRAME, NONE_FRAME } },
- { GLOBALMV, { ALTREF_FRAME, NONE_FRAME } },
-
-#if IMPROVED_AMVD
- { AMVDNEWMV, { LAST_FRAME, NONE_FRAME } },
- { AMVDNEWMV, { LAST2_FRAME, NONE_FRAME } },
- { AMVDNEWMV, { LAST3_FRAME, NONE_FRAME } },
- { AMVDNEWMV, { BWDREF_FRAME, NONE_FRAME } },
- { AMVDNEWMV, { ALTREF2_FRAME, NONE_FRAME } },
- { AMVDNEWMV, { GOLDEN_FRAME, NONE_FRAME } },
- { AMVDNEWMV, { ALTREF_FRAME, NONE_FRAME } },
-#endif // IMPROVED_AMVD
-
- // TODO(zoeliu): May need to reconsider the order on the modes to check
- { NEAR_NEARMV, { LAST_FRAME, ALTREF_FRAME } },
- { NEAR_NEARMV, { LAST2_FRAME, ALTREF_FRAME } },
- { NEAR_NEARMV, { LAST3_FRAME, ALTREF_FRAME } },
- { NEAR_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } },
- { NEAR_NEARMV, { LAST_FRAME, BWDREF_FRAME } },
- { NEAR_NEARMV, { LAST2_FRAME, BWDREF_FRAME } },
- { NEAR_NEARMV, { LAST3_FRAME, BWDREF_FRAME } },
- { NEAR_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } },
- { NEAR_NEARMV, { LAST_FRAME, ALTREF2_FRAME } },
- { NEAR_NEARMV, { LAST2_FRAME, ALTREF2_FRAME } },
- { NEAR_NEARMV, { LAST3_FRAME, ALTREF2_FRAME } },
- { NEAR_NEARMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
-
- { NEAR_NEARMV, { LAST_FRAME, LAST2_FRAME } },
- { NEAR_NEARMV, { LAST_FRAME, LAST3_FRAME } },
- { NEAR_NEARMV, { LAST_FRAME, GOLDEN_FRAME } },
- { NEAR_NEARMV, { BWDREF_FRAME, ALTREF_FRAME } },
-
- { NEW_NEARMV, { LAST_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV, { LAST_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV, { LAST_FRAME, ALTREF_FRAME } },
- { GLOBAL_GLOBALMV, { LAST_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST_FRAME, ALTREF_FRAME } },
-#endif
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST_FRAME, ALTREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST2_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV, { LAST2_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV, { LAST2_FRAME, ALTREF_FRAME } },
- { GLOBAL_GLOBALMV, { LAST2_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST2_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST2_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST2_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST2_FRAME, ALTREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST2_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST2_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST2_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST2_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST3_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV, { LAST3_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV, { LAST3_FRAME, ALTREF_FRAME } },
- { GLOBAL_GLOBALMV, { LAST3_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST3_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST3_FRAME, ALTREF_FRAME } },
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST3_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST3_FRAME, ALTREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST3_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST3_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST3_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST3_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } },
- { GLOBAL_GLOBALMV, { GOLDEN_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { GOLDEN_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { GOLDEN_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { GOLDEN_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV, { LAST_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV, { LAST_FRAME, BWDREF_FRAME } },
- { GLOBAL_GLOBALMV, { LAST_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST_FRAME, BWDREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST2_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV, { LAST2_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV, { LAST2_FRAME, BWDREF_FRAME } },
- { GLOBAL_GLOBALMV, { LAST2_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST2_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST2_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST2_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST2_FRAME, BWDREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST2_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST2_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST2_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST2_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST3_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV, { LAST3_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV, { LAST3_FRAME, BWDREF_FRAME } },
- { GLOBAL_GLOBALMV, { LAST3_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST3_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST3_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST3_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST3_FRAME, BWDREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST3_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST3_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST3_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST3_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } },
- { GLOBAL_GLOBALMV, { GOLDEN_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { GOLDEN_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { GOLDEN_FRAME, BWDREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { GOLDEN_FRAME, BWDREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { GOLDEN_FRAME, BWDREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { GOLDEN_FRAME, BWDREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { GOLDEN_FRAME, BWDREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { GOLDEN_FRAME, BWDREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV, { LAST_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV, { LAST_FRAME, ALTREF2_FRAME } },
- { GLOBAL_GLOBALMV, { LAST_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST_FRAME, ALTREF2_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST2_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV, { LAST2_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV, { LAST2_FRAME, ALTREF2_FRAME } },
- { GLOBAL_GLOBALMV, { LAST2_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST2_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST2_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST2_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST2_FRAME, ALTREF2_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST2_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST2_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST2_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST2_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST3_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV, { LAST3_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV, { LAST3_FRAME, ALTREF2_FRAME } },
- { GLOBAL_GLOBALMV, { LAST3_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST3_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST3_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST3_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST3_FRAME, ALTREF2_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST3_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST3_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST3_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST3_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
- { GLOBAL_GLOBALMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { GOLDEN_FRAME, ALTREF2_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF2_FRAME } },
- { NEW_NEARMV_OPTFLOW, { GOLDEN_FRAME, ALTREF2_FRAME } },
- { NEW_NEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { GOLDEN_FRAME, ALTREF2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST_FRAME, LAST2_FRAME } },
- { NEAR_NEWMV, { LAST_FRAME, LAST2_FRAME } },
- { NEW_NEWMV, { LAST_FRAME, LAST2_FRAME } },
- { GLOBAL_GLOBALMV, { LAST_FRAME, LAST2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST_FRAME, LAST2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST_FRAME, LAST2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST_FRAME, LAST2_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST_FRAME, LAST2_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST_FRAME, LAST2_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST_FRAME, LAST2_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST_FRAME, LAST2_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST_FRAME, LAST2_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST_FRAME, LAST3_FRAME } },
- { NEAR_NEWMV, { LAST_FRAME, LAST3_FRAME } },
- { NEW_NEWMV, { LAST_FRAME, LAST3_FRAME } },
- { GLOBAL_GLOBALMV, { LAST_FRAME, LAST3_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST_FRAME, LAST3_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST_FRAME, LAST3_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST_FRAME, LAST3_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST_FRAME, LAST3_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST_FRAME, LAST3_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST_FRAME, LAST3_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST_FRAME, LAST3_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST_FRAME, LAST3_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { LAST_FRAME, GOLDEN_FRAME } },
- { NEAR_NEWMV, { LAST_FRAME, GOLDEN_FRAME } },
- { NEW_NEWMV, { LAST_FRAME, GOLDEN_FRAME } },
- { GLOBAL_GLOBALMV, { LAST_FRAME, GOLDEN_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { LAST_FRAME, GOLDEN_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { LAST_FRAME, GOLDEN_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { LAST_FRAME, GOLDEN_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { LAST_FRAME, GOLDEN_FRAME } },
- { NEW_NEARMV_OPTFLOW, { LAST_FRAME, GOLDEN_FRAME } },
- { NEW_NEWMV_OPTFLOW, { LAST_FRAME, GOLDEN_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { LAST_FRAME, GOLDEN_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { LAST_FRAME, GOLDEN_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
- { NEW_NEARMV, { BWDREF_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV, { BWDREF_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV, { BWDREF_FRAME, ALTREF_FRAME } },
- { GLOBAL_GLOBALMV, { BWDREF_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV, { BWDREF_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV, { BWDREF_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#if CONFIG_OPTFLOW_REFINEMENT
- { NEAR_NEARMV_OPTFLOW, { BWDREF_FRAME, ALTREF_FRAME } },
- { NEAR_NEWMV_OPTFLOW, { BWDREF_FRAME, ALTREF_FRAME } },
- { NEW_NEARMV_OPTFLOW, { BWDREF_FRAME, ALTREF_FRAME } },
- { NEW_NEWMV_OPTFLOW, { BWDREF_FRAME, ALTREF_FRAME } },
-#if CONFIG_JOINT_MVD
- { JOINT_NEWMV_OPTFLOW, { BWDREF_FRAME, ALTREF_FRAME } },
-#if IMPROVED_AMVD
- { JOINT_AMVDNEWMV_OPTFLOW, { BWDREF_FRAME, ALTREF_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_JOINT_MVD
-#endif // CONFIG_OPTFLOW_REFINEMENT
-
-#if CONFIG_TIP
- { NEARMV, { TIP_FRAME, NONE_FRAME } },
- { NEWMV, { TIP_FRAME, NONE_FRAME } },
-#if IMPROVED_AMVD
- { AMVDNEWMV, { TIP_FRAME, NONE_FRAME } },
-#endif // IMPROVED_AMVD
-#endif // CONFIG_TIP
-
- // intra modes
- { DC_PRED, { INTRA_FRAME, NONE_FRAME } },
- { PAETH_PRED, { INTRA_FRAME, NONE_FRAME } },
- { SMOOTH_PRED, { INTRA_FRAME, NONE_FRAME } },
- { SMOOTH_V_PRED, { INTRA_FRAME, NONE_FRAME } },
- { SMOOTH_H_PRED, { INTRA_FRAME, NONE_FRAME } },
- { H_PRED, { INTRA_FRAME, NONE_FRAME } },
- { V_PRED, { INTRA_FRAME, NONE_FRAME } },
- { D135_PRED, { INTRA_FRAME, NONE_FRAME } },
- { D203_PRED, { INTRA_FRAME, NONE_FRAME } },
- { D157_PRED, { INTRA_FRAME, NONE_FRAME } },
- { D67_PRED, { INTRA_FRAME, NONE_FRAME } },
- { D113_PRED, { INTRA_FRAME, NONE_FRAME } },
- { D45_PRED, { INTRA_FRAME, NONE_FRAME } },
-};
-
-static AOM_INLINE THR_MODES
-get_prediction_mode_idx(PREDICTION_MODE this_mode, MV_REFERENCE_FRAME ref_frame,
- MV_REFERENCE_FRAME second_ref_frame) {
- if (this_mode < INTRA_MODE_END) {
- assert(ref_frame == INTRA_FRAME);
- assert(second_ref_frame == NONE_FRAME);
- return intra_to_mode_idx[this_mode - INTRA_MODE_START];
- }
- if (this_mode >= SINGLE_INTER_MODE_START &&
- this_mode < SINGLE_INTER_MODE_END) {
-#if CONFIG_TIP
- assert(is_inter_ref_frame(ref_frame) &&
- (ref_frame == TIP_FRAME || ref_frame <= ALTREF_FRAME));
-#else
- assert(is_inter_ref_frame(ref_frame) && (ref_frame <= ALTREF_FRAME));
-#endif // CONFIG_TIP
- return single_inter_to_mode_idx[this_mode - SINGLE_INTER_MODE_START]
- [ref_frame];
- }
- if (this_mode >= COMP_INTER_MODE_START && this_mode < COMP_INTER_MODE_END) {
- assert(is_inter_ref_frame(ref_frame) && (ref_frame <= ALTREF_FRAME));
- assert(is_inter_ref_frame(second_ref_frame) &&
- (second_ref_frame <= ALTREF_FRAME));
- return comp_inter_to_mode_idx[this_mode - COMP_INTER_MODE_START][ref_frame]
- [second_ref_frame];
- }
- assert(0);
- return THR_INVALID;
-}
-#endif // !CONFIG_NEW_REF_SIGNALING
-
static AOM_INLINE void restore_dst_buf(MACROBLOCKD *xd, const BUFFER_SET dst,
const int num_planes) {
for (int i = 0; i < num_planes; i++) {
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index c2554d1..ac68254 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -351,11 +351,7 @@
// Speed 0 for all speed features that give neutral coding performance change.
sf->gm_sf.gm_disable_recode = 1;
-#if CONFIG_NEW_REF_SIGNALING
sf->gm_sf.gm_search_type = GM_REDUCED_REF_SEARCH_SKIP_LEV2;
-#else
- sf->gm_sf.gm_search_type = GM_REDUCED_REF_SEARCH_SKIP_L2_L3;
-#endif // CONFIG_NEW_REF_SIGNALING
sf->part_sf.less_rectangular_check_level = 1;
#if CONFIG_EXT_RECUR_PARTITIONS
@@ -410,11 +406,7 @@
sf->hl_sf.superres_auto_search_type = SUPERRES_AUTO_DUAL;
if (speed >= 1) {
-#if CONFIG_NEW_REF_SIGNALING
sf->gm_sf.gm_search_type = GM_REDUCED_REF_SEARCH_SKIP_LEV3;
-#else
- sf->gm_sf.gm_search_type = GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2;
-#endif // CONFIG_NEW_REF_SIGNALING
sf->gm_sf.prune_ref_frame_for_gm_search = boosted ? 0 : 1;
#if CONFIG_EXT_RECUR_PARTITIONS
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index c342c2c..c035d93 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -34,13 +34,8 @@
enum {
GM_FULL_SEARCH,
-#if CONFIG_NEW_REF_SIGNALING
GM_REDUCED_REF_SEARCH_SKIP_LEV2,
GM_REDUCED_REF_SEARCH_SKIP_LEV3,
-#else
- GM_REDUCED_REF_SEARCH_SKIP_L2_L3,
- GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2,
-#endif // CONFIG_NEW_REF_SIGNALING
GM_DISABLE_SEARCH
} UENUM1BYTE(GM_SEARCH_TYPE);
@@ -84,20 +79,6 @@
(1 << NEAR_NEARMV),
};
-#if !CONFIG_NEW_REF_SIGNALING
-enum {
- DISABLE_ALL_INTER_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA) |
- (1 << THR_ALTR) | (1 << THR_GOLD) | (1 << THR_LAST),
-
- DISABLE_ALL_SPLIT = (1 << THR_INTRA) | DISABLE_ALL_INTER_SPLIT,
-
- DISABLE_COMPOUND_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA),
-
- LAST_AND_INTRA_SPLIT_ONLY = (1 << THR_COMP_GA) | (1 << THR_COMP_LA) |
- (1 << THR_ALTR) | (1 << THR_GOLD)
-};
-#endif // !CONFIG_NEW_REF_SIGNALING
-
enum {
TXFM_CODING_SF = 1,
INTER_PRED_SF = 2,
diff --git a/av1/encoder/tpl_model.c b/av1/encoder/tpl_model.c
index aed6c60..9c4b226 100644
--- a/av1/encoder/tpl_model.c
+++ b/av1/encoder/tpl_model.c
@@ -456,11 +456,7 @@
best_mv.as_int = best_rfidx_mv.as_int;
if (best_inter_cost < best_intra_cost) {
best_mode = NEWMV;
-#if CONFIG_NEW_REF_SIGNALING
xd->mi[0]->ref_frame[0] = best_rf_idx;
-#else
- xd->mi[0]->ref_frame[0] = best_rf_idx + LAST_FRAME;
-#endif // CONFIG_NEW_REF_SIGNALING
xd->mi[0]->mv[0].as_int = best_mv.as_int;
}
}
@@ -790,44 +786,16 @@
xd->cur_buf = this_frame;
-#if !CONFIG_NEW_REF_SIGNALING
- uint32_t ref_frame_display_indices[INTER_REFS_PER_FRAME];
-#endif // !CONFIG_NEW_REF_SIGNALING
for (idx = 0; idx < INTER_REFS_PER_FRAME; ++idx) {
TplDepFrame *tpl_ref_frame =
&tpl_data->tpl_frame[tpl_frame->ref_map_index[idx]];
tpl_data->ref_frame[idx] = tpl_ref_frame->rec_picture;
tpl_data->src_ref_frame[idx] = tpl_ref_frame->gf_picture;
-#if !CONFIG_NEW_REF_SIGNALING
- ref_frame_display_indices[idx] = tpl_ref_frame->frame_display_index;
-#endif // !CONFIG_NEW_REF_SIGNALING
}
// TODO(debargha,kslu) Apply ref_frame_flags and prune references here.
// See example of how this is done in init_mc_flow_dispenser().
// aomedia:3159
-#if !CONFIG_NEW_REF_SIGNALING
- int ref_frame_flags;
- const YV12_BUFFER_CONFIG *ref_frames_ordered[INTER_REFS_PER_FRAME];
- // Store the reference frames based on priority order
- for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
- ref_frames_ordered[i] =
- tpl_data->ref_frame[ref_frame_priority_order[i] - 1];
- }
-
- // Work out which reference frame slots may be used.
- ref_frame_flags =
- get_ref_frame_flags(ref_frames_ordered, cpi->ext_flags.ref_frame_flags);
-
- enforce_max_ref_frames(cpi, &ref_frame_flags);
-
- // Prune reference frames
- for (idx = 0; idx < INTER_REFS_PER_FRAME; ++idx) {
- if ((ref_frame_flags & (1 << idx)) == 0) {
- tpl_data->ref_frame[idx] = NULL;
- }
- }
-#endif // !CONFIG_NEW_REF_SIGNALING
// Skip motion estimation w.r.t. reference frames which are not
// considered in RD search, using "selective_ref_frame" speed feature.
@@ -835,16 +803,9 @@
// length, as there are fewer reference frames and the reference frames
// differ from the frames considered during RD search.
if (ref_pruning_enabled && (frame_idx < gop_length)) {
-#if CONFIG_NEW_REF_SIGNALING
for (idx = 0; idx < cm->ref_frames_info.num_total_refs; ++idx) {
const MV_REFERENCE_FRAME refs[2] = { idx, NONE_FRAME };
if (prune_ref_by_selective_ref_frame(cpi, NULL, refs)) {
-#else
- for (idx = 0; idx < INTER_REFS_PER_FRAME; ++idx) {
- const MV_REFERENCE_FRAME refs[2] = { idx + 1, NONE_FRAME };
- if (prune_ref_by_selective_ref_frame(cpi, NULL, refs,
- ref_frame_display_indices)) {
-#endif // CONFIG_NEW_REF_SIGNALING
tpl_data->ref_frame[idx] = NULL;
}
}
@@ -1053,11 +1014,9 @@
const int true_disp =
(int)(tpl_frame->frame_display_index) -
(gf_group->subgop_cfg != NULL && frame_params.show_frame);
-#if CONFIG_NEW_REF_SIGNALING
if (cm->seq_params.explicit_ref_frame_map)
av1_get_ref_frames_enc(cm, true_disp, ref_frame_map_pairs);
else
-#endif // CONFIG_NEW_REF_SIGNALING
av1_get_ref_frames(cm, true_disp, ref_frame_map_pairs);
int refresh_mask =
av1_get_refresh_frame_flags(cpi, &frame_params, frame_update_type,
@@ -1073,7 +1032,6 @@
cpi->gf_group.max_layer_depth);
}
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
if (cm->remapped_ref_idx[i] != -1) {
tpl_frame->ref_map_index[i] = ref_picture_map[cm->remapped_ref_idx[i]];
@@ -1081,11 +1039,6 @@
tpl_frame->ref_map_index[i] = ref_picture_map[0];
}
}
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i)
- tpl_frame->ref_map_index[i - LAST_FRAME] =
- ref_picture_map[cm->remapped_ref_idx[i - LAST_FRAME]];
-#endif // CONFIG_NEW_REF_SIGNALING
if (refresh_mask) ref_picture_map[refresh_frame_map_index] = gf_index;
@@ -1093,7 +1046,6 @@
}
if (cpi->rc.frames_since_key == 0) {
-#if CONFIG_NEW_REF_SIGNALING
TplDepFrame *tpl_frame = &tpl_data->tpl_frame[cur_frame_idx];
const int true_disp =
(int)(tpl_frame->frame_display_index) -
@@ -1105,7 +1057,6 @@
av1_get_ref_frames_enc(cm, true_disp, ref_frame_map_pairs);
else
av1_get_ref_frames(cm, true_disp, ref_frame_map_pairs);
-#endif // CONFIG_NEW_REF_SIGNALING
return;
}
@@ -1155,11 +1106,9 @@
const int true_disp =
(int)(tpl_frame->frame_display_index) -
(gf_group->subgop_cfg != NULL && frame_params.show_frame);
-#if CONFIG_NEW_REF_SIGNALING
if (cm->seq_params.explicit_ref_frame_map)
av1_get_ref_frames_enc(cm, true_disp, ref_frame_map_pairs);
else
-#endif // CONFIG_NEW_REF_SIGNALING
av1_get_ref_frames(cm, true_disp, ref_frame_map_pairs);
// TODO(kslu) av1_get_refresh_frame_flags()
// will execute default behavior even when
@@ -1177,7 +1126,6 @@
cpi->gf_group.max_layer_depth);
}
-#if CONFIG_NEW_REF_SIGNALING
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
if (cm->remapped_ref_idx[i] != -1) {
tpl_frame->ref_map_index[i] = ref_picture_map[cm->remapped_ref_idx[i]];
@@ -1185,16 +1133,6 @@
tpl_frame->ref_map_index[i] = ref_picture_map[0];
}
}
-#else
- for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i)
- tpl_frame->ref_map_index[i - LAST_FRAME] =
- ref_picture_map[cm->remapped_ref_idx[i - LAST_FRAME]];
-
- tpl_frame->ref_map_index[ALTREF_FRAME - LAST_FRAME] = -1;
- tpl_frame->ref_map_index[LAST3_FRAME - LAST_FRAME] = -1;
- tpl_frame->ref_map_index[BWDREF_FRAME - LAST_FRAME] = -1;
- tpl_frame->ref_map_index[ALTREF2_FRAME - LAST_FRAME] = -1;
-#endif // CONFIG_NEW_REF_SIGNALING
if (refresh_mask) ref_picture_map[refresh_frame_map_index] = gf_index;
@@ -1210,11 +1148,9 @@
init_ref_map_pair(
cm, ref_frame_map_pairs,
cpi->gf_group.update_type[cpi->gf_group.index] == KF_UPDATE);
-#if CONFIG_NEW_REF_SIGNALING
if (cm->seq_params.explicit_ref_frame_map)
av1_get_ref_frames_enc(cm, true_disp, ref_frame_map_pairs);
else
-#endif // CONFIG_NEW_REF_SIGNALING
av1_get_ref_frames(cm, true_disp, ref_frame_map_pairs);
}
@@ -1248,17 +1184,8 @@
cm->current_frame.frame_type = frame_params->frame_type;
for (int gf_index = gf_group->index; gf_index < (gf_group->size - 1);
++gf_index) {
-#if CONFIG_NEW_REF_SIGNALING
(void)this_frame_params;
av1_configure_buffer_updates(cpi, gf_group->update_type[gf_index]);
-#else
- av1_configure_buffer_updates(cpi, &this_frame_params.refresh_frame,
- gf_group->update_type[gf_index],
- cm->current_frame.frame_type, 0);
-
- memcpy(&cpi->refresh_frame, &this_frame_params.refresh_frame,
- sizeof(cpi->refresh_frame));
-#endif // CONFIG_NEW_REF_SIGNALING
cm->show_frame = gf_group->update_type[gf_index] != ARF_UPDATE &&
gf_group->update_type[gf_index] != KFFLT_UPDATE &&
@@ -1325,13 +1252,7 @@
mc_flow_synthesizer(cpi, frame_idx);
}
-#if CONFIG_NEW_REF_SIGNALING
av1_configure_buffer_updates(cpi, gf_group->update_type[gf_group->index]);
-#else
- av1_configure_buffer_updates(cpi, &this_frame_params.refresh_frame,
- gf_group->update_type[gf_group->index],
- frame_params->frame_type, 0);
-#endif // CONFIG_NEW_REF_SIGNALING
cm->current_frame.frame_type = frame_params->frame_type;
cm->show_frame = frame_params->show_frame;
}
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 287cba8..4729bb7 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -173,8 +173,6 @@
set_aom_config_var(CONFIG_SMVP_IMPROVEMENT 1 "Enable SMVP improvement")
set_aom_config_var(CONFIG_TMVP_IMPROVEMENT 1 "Enable TMVP improvement")
set_aom_config_var(CONFIG_REF_MV_BANK 1 "AV2 ref mv bank experiment flag")
-set_aom_config_var(CONFIG_NEW_REF_SIGNALING 1
- "AV2 experiment flag for the new reference syntax")
set_aom_config_var(
CONFIG_CCSO 1 "AV2 experiment flag to enable cross component sample offset.")
set_aom_config_var(CONFIG_OPTFLOW_REFINEMENT 1
diff --git a/common/av1_config.c b/common/av1_config.c
index d0e4c41..d005c9a 100644
--- a/common/av1_config.c
+++ b/common/av1_config.c
@@ -239,13 +239,11 @@
#if CONFIG_REF_MV_BANK
AV1C_READ_BIT_OR_RETURN_ERROR(enable_refmvbank);
#endif // CONFIG_REF_MV_BANK
-#if CONFIG_NEW_REF_SIGNALING
AV1C_READ_BIT_OR_RETURN_ERROR(reduced_ref_frame_set);
if (reduced_ref_frame_set) {
AV1C_READ_BITS_OR_RETURN_ERROR(max_reference_frames, 2);
}
AV1C_READ_BIT_OR_RETURN_ERROR(explicit_ref_frame_map);
-#endif // CONFIG_NEW_REF_SIGNALING
AV1C_READ_BIT_OR_RETURN_ERROR(enable_sdp);
#if CONFIG_IST
AV1C_READ_BIT_OR_RETURN_ERROR(enable_ist);
diff --git a/examples/inspect.c b/examples/inspect.c
index ba7a0f2..bbe7613 100644
--- a/examples/inspect.c
+++ b/examples/inspect.c
@@ -163,17 +163,9 @@
int value;
} map_entry;
-#if CONFIG_NEW_REF_SIGNALING
const map_entry refs_map[] = { ENUM(INTRA_FRAME), ENUM(0), ENUM(1),
ENUM(2), ENUM(3), ENUM(4),
ENUM(5), ENUM(6), LAST_ENUM };
-#else
-const map_entry refs_map[] = {
- ENUM(INTRA_FRAME), ENUM(LAST_FRAME), ENUM(LAST2_FRAME),
- ENUM(LAST3_FRAME), ENUM(GOLDEN_FRAME), ENUM(BWDREF_FRAME),
- ENUM(ALTREF2_FRAME), ENUM(ALTREF_FRAME), LAST_ENUM
-};
-#endif // CONFIG_NEW_REF_SIGNALING
const map_entry block_size_map[] = {
ENUM(BLOCK_4X4), ENUM(BLOCK_4X8), ENUM(BLOCK_8X4),
diff --git a/examples/lightfield_encoder.c b/examples/lightfield_encoder.c
index 58c656f..75040c28 100644
--- a/examples/lightfield_encoder.c
+++ b/examples/lightfield_encoder.c
@@ -205,13 +205,7 @@
AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF |
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
-#if CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_ALL |
-#else
- AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
- AOM_EFLAG_NO_UPD_ARF |
-#endif // CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_ENTROPY,
+ AOM_EFLAG_NO_UPD_ALL | AOM_EFLAG_NO_UPD_ENTROPY,
writer);
if (aom_codec_control(&codec, AV1_COPY_NEW_FRAME_IMAGE,
@@ -270,13 +264,7 @@
AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF |
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
-#if CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_ALL |
-#else
- AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
- AOM_EFLAG_NO_UPD_ARF |
-#endif // CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_ENTROPY,
+ AOM_EFLAG_NO_UPD_ALL | AOM_EFLAG_NO_UPD_ENTROPY,
writer);
}
}
diff --git a/examples/scalable_encoder.c b/examples/scalable_encoder.c
index 04fc253..b90e42e 100644
--- a/examples/scalable_encoder.c
+++ b/examples/scalable_encoder.c
@@ -235,9 +235,6 @@
flags |= AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF |
AOM_EFLAG_NO_REF_BWD | AOM_EFLAG_NO_REF_ARF2 |
-#if !CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF |
-#endif // !CONFIG_NEW_REF_SIGNALING
AOM_EFLAG_NO_UPD_ENTROPY;
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
@@ -254,12 +251,7 @@
// use LAST (base layer) as sole reference
flags = AOM_EFLAG_NO_REF_LAST2 | AOM_EFLAG_NO_REF_LAST3 |
AOM_EFLAG_NO_REF_GF | AOM_EFLAG_NO_REF_ARF | AOM_EFLAG_NO_REF_BWD |
- AOM_EFLAG_NO_REF_ARF2 |
-#if CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_ALL |
-#else
- AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF |
-#endif // CONFIG_NEW_REF_SIGNALING
+ AOM_EFLAG_NO_REF_ARF2 | AOM_EFLAG_NO_UPD_ALL |
AOM_EFLAG_NO_UPD_ENTROPY;
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
diff --git a/test/av1_ext_tile_test.cc b/test/av1_ext_tile_test.cc
index 113a50f..e0f12ca 100644
--- a/test/av1_ext_tile_test.cc
+++ b/test/av1_ext_tile_test.cc
@@ -94,12 +94,7 @@
}
if (video->frame() == 1) {
-#if CONFIG_NEW_REF_SIGNALING
frame_flags_ = AOM_EFLAG_NO_UPD_ALL;
-#else
- frame_flags_ =
- AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF;
-#endif // CONFIG_NEW_REF_SIGNALING
}
}
diff --git a/test/error_resilience_test.cc b/test/error_resilience_test.cc
index 6ead25c..cd9ca58 100644
--- a/test/error_resilience_test.cc
+++ b/test/error_resilience_test.cc
@@ -84,25 +84,15 @@
encoder->Control(AOME_SET_ENABLEAUTOALTREF, enable_altref_);
}
frame_flags_ &= ~(AOM_EFLAG_NO_REF_FRAME_MVS | AOM_EFLAG_ERROR_RESILIENT |
-#if CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_NO_UPD_ALL |
-#else
- AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
- AOM_EFLAG_NO_UPD_ARF |
-#endif // CONFIG_NEW_REF_SIGNALING
- AOM_EFLAG_SET_S_FRAME | AOM_EFLAG_SET_PRIMARY_REF_NONE);
+ AOM_EFLAG_NO_UPD_ALL | AOM_EFLAG_SET_S_FRAME |
+ AOM_EFLAG_SET_PRIMARY_REF_NONE);
if (droppable_nframes_ > 0 &&
(cfg_.g_pass == AOM_RC_LAST_PASS || cfg_.g_pass == AOM_RC_ONE_PASS)) {
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
if (droppable_frames_[i] == video->frame()) {
std::cout << " Encoding droppable frame: "
<< droppable_frames_[i] << "\n";
-#if CONFIG_NEW_REF_SIGNALING
frame_flags_ |= AOM_EFLAG_NO_UPD_ALL;
-#else
- frame_flags_ |= (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
- AOM_EFLAG_NO_UPD_ARF);
-#endif // CONFIG_NEW_REF_SIGNALING
break;
}
}
@@ -162,13 +152,7 @@
// Check that the encode frame flags are correctly reflected
// in the output frame flags.
const int encode_flags = pkt->data.frame.flags >> 16;
-#if CONFIG_NEW_REF_SIGNALING
if ((encode_flags & AOM_EFLAG_NO_UPD_ALL) == AOM_EFLAG_NO_UPD_ALL) {
-#else
- if ((encode_flags & (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF |
- AOM_EFLAG_NO_UPD_ARF)) ==
- (AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF)) {
-#endif // CONFIG_NEW_REF_SIGNALING
ASSERT_EQ(pkt->data.frame.flags & AOM_FRAME_IS_DROPPABLE,
static_cast<aom_codec_frame_flags_t>(AOM_FRAME_IS_DROPPABLE));
}
diff --git a/tools/aom_entropy_optimizer.c b/tools/aom_entropy_optimizer.c
index 0a3d570..ede14c9 100644
--- a/tools/aom_entropy_optimizer.c
+++ b/tools/aom_entropy_optimizer.c
@@ -744,26 +744,7 @@
"static const aom_cdf_prob\n"
"default_comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(2)]");
- /* ext_comp_refs experiment */
-#if !CONFIG_NEW_REF_SIGNALING
- cts_each_dim[0] = COMP_REF_TYPE_CONTEXTS;
- cts_each_dim[1] = 2;
- optimize_cdf_table(
- &fc.comp_ref_type[0][0], probsfile, 2, cts_each_dim,
- "static const aom_cdf_prob\n"
- "default_comp_ref_type_cdf[COMP_REF_TYPE_CONTEXTS][CDF_SIZE(2)]");
-
- cts_each_dim[0] = UNI_COMP_REF_CONTEXTS;
- cts_each_dim[1] = UNIDIR_COMP_REFS - 1;
- cts_each_dim[2] = 2;
- optimize_cdf_table(&fc.uni_comp_ref[0][0][0], probsfile, 3, cts_each_dim,
- "static const aom_cdf_prob\n"
- "default_uni_comp_ref_cdf[UNI_COMP_REF_CONTEXTS][UNIDIR_"
- "COMP_REFS - 1][CDF_SIZE(2)]");
-#endif // !CONFIG_NEW_REF_SIGNALING
-
/* Reference frame (single ref) */
-#if CONFIG_NEW_REF_SIGNALING
cts_each_dim[0] = REF_CONTEXTS;
cts_each_dim[1] = INTER_REFS_PER_FRAME - 1;
cts_each_dim[2] = 2;
@@ -771,18 +752,8 @@
"static const aom_cdf_prob\n"
"default_single_ref_cdf[REF_CONTEXTS][INTER_REFS_PER_"
"FRAME - 1][CDF_SIZE(2)]");
-#else
- cts_each_dim[0] = REF_CONTEXTS;
- cts_each_dim[1] = SINGLE_REFS - 1;
- cts_each_dim[2] = 2;
- optimize_cdf_table(
- &fc.single_ref[0][0][0], probsfile, 3, cts_each_dim,
- "static const aom_cdf_prob\n"
- "default_single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)]");
-#endif // CONFIG_NEW_REF_SIGNALING
/* ext_refs experiment */
-#if CONFIG_NEW_REF_SIGNALING
cts_each_dim[0] = REF_CONTEXTS;
cts_each_dim[1] = INTER_REFS_PER_FRAME - 2;
cts_each_dim[2] = 2;
@@ -798,23 +769,6 @@
"static const aom_cdf_prob\n"
"default_comp_ref1_cdf[REF_CONTEXTS][COMPREF_BIT_TYPES]"
"[INTER_REFS_PER_FRAME - 2][CDF_SIZE(2)]");
-#else
- cts_each_dim[0] = REF_CONTEXTS;
- cts_each_dim[1] = FWD_REFS - 1;
- cts_each_dim[2] = 2;
- optimize_cdf_table(
- &fc.comp_ref[0][0][0], probsfile, 3, cts_each_dim,
- "static const aom_cdf_prob\n"
- "default_comp_ref_cdf[REF_CONTEXTS][FWD_REFS - 1][CDF_SIZE(2)]");
-
- cts_each_dim[0] = REF_CONTEXTS;
- cts_each_dim[1] = BWD_REFS - 1;
- cts_each_dim[2] = 2;
- optimize_cdf_table(
- &fc.comp_bwdref[0][0][0], probsfile, 3, cts_each_dim,
- "static const aom_cdf_prob\n"
- "default_comp_bwdref_cdf[REF_CONTEXTS][BWD_REFS - 1][CDF_SIZE(2)]");
-#endif // !CONFIG_NEW_REF_SIGNALING
/* palette */
cts_each_dim[0] = PALATTE_BSIZE_CTXS;