Clean up av1_encode_strategy()
Remove redundant control flow in av1_encode_strategy().
Change-Id: I8a6503a7afb0a8ff7ff2b06b6c7f161caf9dfd47
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index d363b80..3c87a98 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -1149,9 +1149,9 @@
int code_arf = 0;
struct lookahead_entry *source = NULL;
struct lookahead_entry *last_source = NULL;
- FRAME_UPDATE_TYPE frame_update_type = get_frame_update_type(gf_group);
if (frame_params.show_existing_frame) {
source = av1_lookahead_pop(cpi->lookahead, flush);
+ frame_params.show_frame = 1;
} else {
source = choose_frame_source(cpi, &code_arf, &flush, &last_source,
&frame_params);
@@ -1182,18 +1182,10 @@
if (!frame_params.show_existing_frame)
*frame_flags = (source->flags & AOM_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0;
- const int is_overlay = frame_params.show_existing_frame &&
- (frame_update_type == OVERLAY_UPDATE ||
- frame_update_type == INTNL_OVERLAY_UPDATE);
- if (frame_params.show_frame || is_overlay) {
- // Shown frames and arf-overlay frames need frame-rate considering
- adjust_frame_rate(cpi, source);
- }
+ // Shown frames and arf-overlay frames need frame-rate considering
+ if (frame_params.show_frame) adjust_frame_rate(cpi, source);
- if (frame_params.show_existing_frame) {
- // show_existing_frame implies this frame is shown!
- frame_params.show_frame = 1;
- } else {
+ if (!frame_params.show_existing_frame) {
if (cpi->film_grain_table) {
cm->cur_frame->film_grain_params_present = aom_film_grain_table_lookup(
cpi->film_grain_table, *time_stamp, *time_end, 0 /* =erase */,
@@ -1205,23 +1197,18 @@
// only one operating point supported now
const int64_t pts64 = ticks_to_timebase_units(timestamp_ratio, *time_stamp);
if (pts64 < 0 || pts64 > UINT32_MAX) return AOM_CODEC_ERROR;
- cpi->common.frame_presentation_time = (uint32_t)pts64;
+ cm->frame_presentation_time = (uint32_t)pts64;
}
#if CONFIG_REALTIME_ONLY
av1_get_one_pass_rt_params(cpi, &frame_params, *frame_flags);
- frame_update_type = get_frame_update_type(gf_group);
#else
- if (oxcf->pass == 0 && oxcf->mode == REALTIME && oxcf->lag_in_frames == 0) {
+ if (oxcf->pass == 0 && oxcf->mode == REALTIME && oxcf->lag_in_frames == 0)
av1_get_one_pass_rt_params(cpi, &frame_params, *frame_flags);
- frame_update_type = get_frame_update_type(gf_group);
- } else if (oxcf->pass != 1 &&
- (!frame_params.show_existing_frame || is_overlay)) {
- // GF_GROUP needs updating for arf overlays as well as non-show-existing
+ else if (oxcf->pass != 1)
av1_get_second_pass_params(cpi, &frame_params, *frame_flags);
- frame_update_type = get_frame_update_type(gf_group);
- }
#endif
+ FRAME_UPDATE_TYPE frame_update_type = get_frame_update_type(gf_group);
if (frame_params.show_existing_frame &&
frame_params.frame_type != KEY_FRAME) {