Commit 98c16fa3 authored by Frederic Barbier's avatar Frederic Barbier Committed by Fred BARBIER

Remove experimental flag of TEMPMV_SIGNALING

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

Change-Id: Ieeafdf9139ef52bd26a0cb4e6e058161cc59e466
parent ba7815a6
......@@ -494,10 +494,8 @@ static const arg_def_t film_grain_test =
"Film grain test vectors (0: none (default), 1: test-1 2: test-2, "
"... 16: test-16)");
#endif
#if CONFIG_TEMPMV_SIGNALING
static const arg_def_t disable_tempmv = ARG_DEF(
NULL, "disable-tempmv", 1, "Disable temporal mv prediction (default is 0)");
#endif
static const arg_def_t frame_parallel_decoding =
ARG_DEF(NULL, "frame-parallel", 1,
"Enable frame parallel decodability features "
......@@ -729,9 +727,7 @@ static const arg_def_t *av1_args[] = { &cpu_used_av1,
#if CONFIG_FILM_GRAIN
&film_grain_test,
#endif
#if CONFIG_TEMPMV_SIGNALING
&disable_tempmv,
#endif
&bitdeptharg,
&inbitdeptharg,
NULL };
......@@ -803,9 +799,7 @@ static const int av1_arg_ctrl_map[] = { AOME_SET_CPUUSED,
#if CONFIG_FILM_GRAIN
AV1E_SET_FILM_GRAIN_TEST_VECTOR,
#endif
#if CONFIG_TEMPMV_SIGNALING
AV1E_SET_DISABLE_TEMPMV,
#endif
0 };
#endif
......
......@@ -78,9 +78,7 @@ struct av1_extracfg {
#if CONFIG_TIMING_INFO_IN_SEQ_HEADERS
aom_timing_info_t timing_info;
#endif
#if CONFIG_TEMPMV_SIGNALING
unsigned int disable_tempmv;
#endif
unsigned int frame_parallel_decoding_mode;
AQ_MODE aq_mode;
#if CONFIG_EXT_DELTA_Q
......@@ -157,9 +155,7 @@ static struct av1_extracfg default_extra_cfg = {
#if CONFIG_TIMING_INFO_IN_SEQ_HEADERS
AOM_TIMING_UNSPECIFIED, // No picture timing signaling in bitstream
#endif
#if CONFIG_TEMPMV_SIGNALING
0, // disable temporal mv prediction
#endif
0, // disable temporal mv prediction
1, // frame_parallel_decoding_mode
NO_AQ, // aq_mode
#if CONFIG_EXT_DELTA_Q
......@@ -584,9 +580,7 @@ static aom_codec_err_t set_encoder_config(
#endif // CONFIG_EXT_TILE
oxcf->mtu = extra_cfg->mtu_size;
#if CONFIG_TEMPMV_SIGNALING
oxcf->disable_tempmv = extra_cfg->disable_tempmv;
#endif
oxcf->under_shoot_pct = cfg->rc_undershoot_pct;
oxcf->over_shoot_pct = cfg->rc_overshoot_pct;
......@@ -1035,14 +1029,12 @@ static aom_codec_err_t ctrl_set_timing_info(aom_codec_alg_priv_t *ctx,
return update_extra_cfg(ctx, &extra_cfg);
}
#endif
#if CONFIG_TEMPMV_SIGNALING
static aom_codec_err_t ctrl_set_disable_tempmv(aom_codec_alg_priv_t *ctx,
va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.disable_tempmv = CAST(AV1E_SET_DISABLE_TEMPMV, args);
return update_extra_cfg(ctx, &extra_cfg);
}
#endif
static aom_codec_err_t ctrl_set_frame_parallel_decoding_mode(
aom_codec_alg_priv_t *ctx, va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
......@@ -1793,9 +1785,7 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
#if CONFIG_TIMING_INFO_IN_SEQ_HEADERS
{ AV1E_SET_TIMING_INFO, ctrl_set_timing_info },
#endif
#if CONFIG_TEMPMV_SIGNALING
{ AV1E_SET_DISABLE_TEMPMV, ctrl_set_disable_tempmv },
#endif
{ AV1E_SET_FRAME_PARALLEL_DECODING, ctrl_set_frame_parallel_decoding_mode },
{ AV1E_SET_AQ_MODE, ctrl_set_aq_mode },
#if CONFIG_EXT_DELTA_Q
......
......@@ -817,13 +817,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
}
#else
#if CONFIG_TEMPMV_SIGNALING
if (cm->use_prev_frame_mvs && rf[1] == NONE_FRAME)
#else
if (prev_frame_mvs_base && cm->show_frame && cm->last_show_frame &&
rf[1] == NONE_FRAME)
#endif
{
if (cm->use_prev_frame_mvs && rf[1] == NONE_FRAME) {
int coll_blk_count = 0;
const int mi_step = (xd->n8_w == 1 || xd->n8_h == 1)
? mi_size_wide[BLOCK_8X8]
......
......@@ -165,9 +165,7 @@ typedef struct {
#if CONFIG_HASH_ME
hash_table hash_table;
#endif
#if CONFIG_TEMPMV_SIGNALING || CONFIG_FWD_KF
uint8_t intra_only;
#endif // CONFIG_TEMPMV_SIGNALING || CONFIG_FWD_KF
// The Following variables will only be used in frame parallel decode.
// frame_worker_owner indicates which FrameWorker owns this buffer. NULL means
......@@ -684,7 +682,6 @@ static INLINE void ref_cnt_fb(RefCntBuffer *bufs, int *idx, int new_idx) {
bufs[new_idx].ref_count++;
}
#if CONFIG_TEMPMV_SIGNALING
// Returns 1 if this frame might use mvs from some previous frame. This
// function doesn't consider whether prev_frame is actually suitable (see
// frame_can_use_prev_frame_mvs for that)
......@@ -702,7 +699,6 @@ static INLINE int frame_can_use_prev_frame_mvs(const AV1_COMMON *cm) {
!cm->prev_frame->intra_only && cm->width == cm->prev_frame->width &&
cm->height == cm->prev_frame->height);
}
#endif
static INLINE void ensure_mv_buffer(RefCntBuffer *buf, AV1_COMMON *cm) {
const int buf_rows = buf->mi_rows;
......
......@@ -2551,9 +2551,7 @@ static void show_existing_frame_reset(AV1Decoder *const pbi) {
cm->reset_frame_context = RESET_FRAME_CONTEXT_ALL;
#if CONFIG_TEMPMV_SIGNALING
cm->cur_frame->intra_only = 1;
#endif // CONFIG_TEMPMV_SIGNALING
#if CONFIG_REFERENCE_BUFFER
if (cm->seq_params.frame_id_numbers_present_flag) {
......@@ -2810,13 +2808,9 @@ static int read_uncompressed_header(AV1Decoder *pbi,
cm->seq_force_integer_mv = 0;
}
#endif
#if CONFIG_TEMPMV_SIGNALING
cm->use_prev_frame_mvs = 0;
#endif
} else {
#if CONFIG_TEMPMV_SIGNALING
if (cm->intra_only || cm->error_resilient_mode) cm->use_prev_frame_mvs = 0;
#endif
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
// The only way to reset all frame contexts to their default values is with a
// keyframe.
......@@ -2956,7 +2950,6 @@ static int read_uncompressed_header(AV1Decoder *pbi,
#endif // CONFIG_EIGHTH_PEL_MV_ONLY
#endif
cm->interp_filter = read_frame_interp_filter(rb);
#if CONFIG_TEMPMV_SIGNALING
if (frame_might_use_prev_frame_mvs(cm))
cm->use_ref_frame_mvs = aom_rb_read_bit(rb);
else
......@@ -2977,7 +2970,6 @@ static int read_uncompressed_header(AV1Decoder *pbi,
} else {
cm->last_frame_seg_map = NULL;
}
#endif
#endif
for (int i = 0; i < INTER_REFS_PER_FRAME; ++i) {
RefBuffer *const ref_buf = &cm->frame_refs[i];
......@@ -3002,9 +2994,7 @@ static int read_uncompressed_header(AV1Decoder *pbi,
#endif // CONFIG_OBU
av1_setup_frame_sign_bias(cm);
#if CONFIG_TEMPMV_SIGNALING
cm->cur_frame->intra_only = cm->frame_type == KEY_FRAME || cm->intra_only;
#endif
#if CONFIG_REFERENCE_BUFFER
if (cm->seq_params.frame_id_numbers_present_flag) {
......@@ -3220,44 +3210,10 @@ static int read_uncompressed_header(AV1Decoder *pbi,
cm->reduced_tx_set_used = aom_rb_read_bit(rb);
#if !CONFIG_TEMPMV_SIGNALING
// NOTE(zoeliu): As cm->prev_frame can take neither a frame of
// show_exisiting_frame=1, nor can it take a frame not used as
// a reference, it is probable that by the time it is being
// referred to, the frame buffer it originally points to may
// already get expired and have been reassigned to the current
// newly coded frame. Hence, we need to check whether this is
// the case, and if yes, we have 2 choices:
// (1) Simply disable the use of previous frame mvs; or
// (2) Have cm->prev_frame point to one reference frame buffer,
// e.g. LAST_FRAME.
if (!dec_is_ref_frame_buf(pbi, cm->prev_frame)) {
// Reassign the LAST_FRAME buffer to cm->prev_frame.
cm->prev_frame =
cm->frame_refs[LAST_FRAME - LAST_FRAME].idx != INVALID_IDX
? &cm->buffer_pool
->frame_bufs[cm->frame_refs[LAST_FRAME - LAST_FRAME].idx]
: NULL;
}
#endif
#if CONFIG_TEMPMV_SIGNALING
if (cm->use_prev_frame_mvs && !frame_can_use_prev_frame_mvs(cm)) {
aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
"Frame wrongly requests previous frame MVs");
}
#else
cm->use_prev_frame_mvs = !cm->error_resilient_mode && cm->prev_frame &&
#if CONFIG_HORZONLY_FRAME_SUPERRES
cm->width == cm->last_width &&
cm->height == cm->last_height &&
#else
cm->width == cm->prev_frame->buf.y_crop_width &&
cm->height == cm->prev_frame->buf.y_crop_height &&
#endif // CONFIG_HORZONLY_FRAME_SUPERRES
!cm->last_intra_only && cm->last_show_frame &&
(cm->last_frame_type != KEY_FRAME);
#endif // CONFIG_TEMPMV_SIGNALING
if (!frame_is_intra_only(cm)) read_global_motion(cm, rb);
......
......@@ -3803,10 +3803,8 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
#endif
fix_interp_filter(cm, cpi->td.counts);
write_frame_interp_filter(cm->interp_filter, wb);
#if CONFIG_TEMPMV_SIGNALING
if (frame_might_use_prev_frame_mvs(cm))
aom_wb_write_bit(wb, cm->use_ref_frame_mvs);
#endif
}
}
......@@ -4130,11 +4128,9 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
#endif
fix_interp_filter(cm, cpi->td.counts);
write_frame_interp_filter(cm->interp_filter, wb);
#if CONFIG_TEMPMV_SIGNALING
if (frame_might_use_prev_frame_mvs(cm)) {
aom_wb_write_bit(wb, cm->use_ref_frame_mvs);
}
#endif
} else if (cm->frame_type == S_FRAME) {
MV_REFERENCE_FRAME ref_frame;
......@@ -4190,11 +4186,9 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
fix_interp_filter(cm, cpi->td.counts);
write_frame_interp_filter(cm->interp_filter, wb);
#if CONFIG_TEMPMV_SIGNALING
if (frame_might_use_prev_frame_mvs(cm)) {
aom_wb_write_bit(wb, cm->use_ref_frame_mvs);
}
#endif
}
if (cm->show_frame == 0) {
......
......@@ -4498,46 +4498,11 @@ static void encode_frame_internal(AV1_COMP *cpi) {
av1_initialize_me_consts(cpi, x, cm->base_qindex);
init_encode_frame_mb_context(cpi);
#if CONFIG_TEMPMV_SIGNALING
cm->prev_frame = last_fb_buf_idx != INVALID_IDX
? &cm->buffer_pool->frame_bufs[last_fb_buf_idx]
: NULL;
#else
// NOTE(zoeliu): As cm->prev_frame can take neither a frame of
// show_exisiting_frame=1, nor can it take a frame not used as
// a reference, it is probable that by the time it is being
// referred to, the frame buffer it originally points to may
// already get expired and have been reassigned to the current
// newly coded frame. Hence, we need to check whether this is
// the case, and if yes, we have 2 choices:
// (1) Simply disable the use of previous frame mvs; or
// (2) Have cm->prev_frame point to one reference frame buffer,
// e.g. LAST_FRAME.
if (!enc_is_ref_frame_buf(cpi, cm->prev_frame)) {
// Reassign the LAST_FRAME buffer to cm->prev_frame.
cm->prev_frame = last_fb_buf_idx != INVALID_IDX
? &cm->buffer_pool->frame_bufs[last_fb_buf_idx]
: NULL;
}
#endif
#if CONFIG_TEMPMV_SIGNALING
cm->use_prev_frame_mvs &= frame_can_use_prev_frame_mvs(cm);
#else
if (cm->prev_frame) {
cm->use_prev_frame_mvs = !cm->error_resilient_mode &&
#if CONFIG_HORZONLY_FRAME_SUPERRES
cm->width == cm->last_width &&
cm->height == cm->last_height &&
#else
cm->width == cm->prev_frame->buf.y_crop_width &&
cm->height == cm->prev_frame->buf.y_crop_height &&
#endif // CONFIG_HORZONLY_FRAME_SUPERRES
!cm->intra_only && cm->last_show_frame;
} else {
cm->use_prev_frame_mvs = 0;
}
#endif // CONFIG_TEMPMV_SIGNALING
#if CONFIG_SEGMENT_PRED_LAST
if (cm->prev_frame) cm->last_frame_seg_map = cm->prev_frame->seg_map;
cm->current_frame_seg_map = cm->cur_frame->seg_map;
......
......@@ -5845,16 +5845,12 @@ static int encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size, uint8_t *dest,
set_ext_overrides(cpi);
aom_clear_system_state();
#if CONFIG_TEMPMV_SIGNALING || CONFIG_FWD_KF
// frame type has been decided outside of this function call
cm->cur_frame->intra_only = cm->frame_type == KEY_FRAME || cm->intra_only;
#endif // CONFIG_TEMPMV_SIGNALING || CONFIG_FWD_KF
#if CONFIG_TEMPMV_SIGNALING
cm->use_ref_frame_mvs = !cpi->oxcf.disable_tempmv &&
!cm->cur_frame->intra_only &&
frame_might_use_prev_frame_mvs(cm);
cm->use_prev_frame_mvs = cm->use_ref_frame_mvs;
#endif // CONFIG_TEMPMV_SIGNALING
// Reset the frame packet stamp index.
if (cm->frame_type == KEY_FRAME) cm->current_video_frame = 0;
......
......@@ -202,9 +202,7 @@ typedef struct AV1EncoderConfig {
unsigned int num_tile_groups;
unsigned int mtu;
#if CONFIG_TEMPMV_SIGNALING
unsigned int disable_tempmv;
#endif
// Internal frame size scaling.
RESIZE_MODE resize_mode;
uint8_t resize_scale_denominator;
......@@ -754,9 +752,7 @@ static INLINE unsigned int allocated_tokens(TileInfo tile, int sb_size_log2,
return get_token_alloc(tile_mb_rows, tile_mb_cols, sb_size_log2, num_planes);
}
#if CONFIG_TEMPMV_SIGNALING
void av1_set_temporal_mv_prediction(AV1_COMP *cpi, int allow_tempmv_prediction);
#endif
void av1_apply_encoding_flags(AV1_COMP *cpi, aom_enc_frame_flags_t flags);
......
......@@ -153,7 +153,6 @@ set(CONFIG_SEGMENT_GLOBALMV 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SEGMENT_PRED_LAST 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SHORT_FILTER 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_SPATIAL_SEGMENTATION 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TEMPMV_SIGNALING 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TILE_INFO_FIRST 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TIMING_INFO_IN_SEQ_HEADERS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_TMV 1 CACHE NUMBER "AV1 experiment flag.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment