Merge FPMT update of framerate to default
FPMT related update of framerate and associated timestamp variables
are merged to the default path.
Change-Id: If62901a29c3cc3b138033ee4b72189f9b87f2ca0
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 8c11c03..73da66a 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -248,12 +248,9 @@
if (this_duration) {
if (step) {
-#if CONFIG_FRAME_PARALLEL_ENCODE
cpi->new_framerate = 10000000.0 / this_duration;
-#endif
- av1_new_framerate(cpi, 10000000.0 / this_duration);
+ av1_new_framerate(cpi, cpi->new_framerate);
} else {
- double framerate;
// Average this frame's rate into the last second's average
// frame rate. If we haven't seen 1 second yet, then average
// over the whole interval seen.
@@ -262,17 +259,13 @@
double avg_duration = 10000000.0 / cpi->framerate;
avg_duration *= (interval - avg_duration + this_duration);
avg_duration /= interval;
-#if CONFIG_FRAME_PARALLEL_ENCODE
cpi->new_framerate = (10000000.0 / avg_duration);
// For parallel frames update cpi->framerate with new_framerate
// during av1_post_encode_updates()
- framerate =
+ double framerate =
(cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
? cpi->framerate
: cpi->new_framerate;
-#else
- framerate = (10000000.0 / avg_duration);
-#endif
av1_new_framerate(cpi, framerate);
}
}
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index cc5292c..d07a062 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -4319,12 +4319,10 @@
av1_lookahead_pop(cpi->ppi->lookahead, cpi_data->flush,
cpi->compressor_stage);
}
-#if CONFIG_FRAME_PARALLEL_ENCODE
if (cpi->common.show_frame) {
cpi->ppi->ts_start_last_show_frame = cpi_data->ts_frame_start;
cpi->ppi->ts_end_last_show_frame = cpi_data->ts_frame_end;
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE
if (ppi->level_params.keep_level_stats && !is_stat_generation_stage(cpi)) {
// Initialize level info. at the beginning of each sequence.
if (cm->current_frame.frame_type == KEY_FRAME &&
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 6606b1a..ee1d20c 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -2409,6 +2409,15 @@
*/
int temp_valid_gm_model_found[FRAME_UPDATE_TYPES];
#endif
+#if CONFIG_FRAME_PARALLEL_ENCODE_2
+ /*!
+ * Copy of cm->ref_frame_map maintained to facilitate sequential update of
+ * ref_frame_map by lower layer depth frames encoded ahead of time in a
+ * parallel encode set.
+ */
+ RefCntBuffer *ref_frame_map_copy[REF_FRAMES];
+#endif // CONFIG_FRAME_PARALLEL_ENCODE_2
+#endif // CONFIG_FRAME_PARALLEL_ENCODE
/*!
* Start time stamp of the last encoded show frame
@@ -2419,15 +2428,7 @@
* End time stamp of the last encoded show frame
*/
int64_t ts_end_last_show_frame;
-#if CONFIG_FRAME_PARALLEL_ENCODE_2
- /*!
- * Copy of cm->ref_frame_map maintained to facilitate sequential update of
- * ref_frame_map by lower layer depth frames encoded ahead of time in a
- * parallel encode set.
- */
- RefCntBuffer *ref_frame_map_copy[REF_FRAMES];
-#endif // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif // CONFIG_FRAME_PARALLEL_ENCODE
+
/*!
* Number of frame level contexts(cpis)
*/
@@ -3016,8 +3017,7 @@
*/
int do_update_frame_probs_interpfilter[NUM_RECODES_PER_FRAME];
-#if CONFIG_FRAME_PARALLEL_ENCODE
-#if CONFIG_FPMT_TEST
+#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
/*!
* Temporary variable for simulation.
* Previous frame's framerate.
@@ -3030,7 +3030,6 @@
* post encode updates for parallel frames.
*/
double new_framerate;
-#endif
/*!
* Retain condition for fast_extra_bits calculation.
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index 16df508..51d2200 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -4359,12 +4359,11 @@
}
}
#endif
-#if CONFIG_FRAME_PARALLEL_ENCODE
// Update framerate obtained from parallel encode frames
if (cpi->common.show_frame &&
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
cpi->framerate = cpi->new_framerate;
-#if CONFIG_FPMT_TEST
+#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
// SIMULATION PURPOSE
int show_existing_between_parallel_frames_cndn =
(cpi->ppi->gf_group.update_type[cpi->gf_frame_index] ==
@@ -4374,5 +4373,4 @@
cpi->do_frame_data_update && simulate_parallel_frame)
cpi->temp_framerate = cpi->framerate;
#endif
-#endif
}