From 6e1ce4bb96550c6a05fd50440d28edf75a434ac6 Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Tue, 13 Aug 2024 17:23:05 -0700
Subject: [PATCH] level.c: make some functions static
av1_decoder_model_init() and av1_decoder_model_process_frame() are
unused outside of this file. av1_decoder_model_print_status() is debug
only, so wrap it in `#if 0` to allow it to be used as needed.
Bug: aomedia:3416
Change-Id: I6a911f0fe762e108690e864c37801e5a1c576089
---
av1/encoder/level.c | 18 +++++++++++-------
av1/encoder/level.h | 10 ----------
2 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/av1/encoder/level.c b/av1/encoder/level.c
index 7d35fcc3bd..9a804669b5 100644
--- a/av1/encoder/level.c
+++ b/av1/encoder/level.c
@@ -560,6 +560,8 @@ static double get_removal_time(int mode, int num_decoded_frame,
}
}
+#if 0
+// Print the status of the decoder model (for debugging).
void av1_decoder_model_print_status(const DECODER_MODEL *const decoder_model) {
printf(
"\n status %d, num_frame %3d, num_decoded_frame %3d, "
@@ -578,10 +580,12 @@ void av1_decoder_model_print_status(const DECODER_MODEL *const decoder_model) {
this_buffer->presentation_time);
}
}
+#endif
// op_index is the operating point index.
-void av1_decoder_model_init(const AV1_COMP *const cpi, AV1_LEVEL level,
- int op_index, DECODER_MODEL *const decoder_model) {
+static void decoder_model_init(const AV1_COMP *const cpi, AV1_LEVEL level,
+ int op_index,
+ DECODER_MODEL *const decoder_model) {
decoder_model->status = DECODER_MODEL_OK;
decoder_model->level = level;
@@ -719,9 +723,9 @@ DECODER_MODEL_STATUS av1_decoder_model_try_smooth_buf(
}
}
-void av1_decoder_model_process_frame(const AV1_COMP *const cpi,
- size_t coded_bits,
- DECODER_MODEL *const decoder_model) {
+static void decoder_model_process_frame(const AV1_COMP *const cpi,
+ size_t coded_bits,
+ DECODER_MODEL *const decoder_model) {
if (!decoder_model || decoder_model->status != DECODER_MODEL_OK) return;
const AV1_COMMON *const cm = &cpi->common;
@@ -917,7 +921,7 @@ void av1_init_level_info(AV1_COMP *cpi) {
// exceeds level constraints.
this_model->status = DECODER_MODEL_DISABLED;
} else {
- av1_decoder_model_init(cpi, level, op_index, this_model);
+ decoder_model_init(cpi, level, op_index, this_model);
}
}
}
@@ -1337,7 +1341,7 @@ void av1_update_level_info(AV1_COMP *cpi, size_t size, int64_t ts_start,
DECODER_MODEL *const decoder_models = level_info->decoder_models;
for (AV1_LEVEL level = SEQ_LEVEL_2_0; level < SEQ_LEVELS; ++level) {
- av1_decoder_model_process_frame(cpi, size << 3, &decoder_models[level]);
+ decoder_model_process_frame(cpi, size << 3, &decoder_models[level]);
}
// Check whether target level is met.
diff --git a/av1/encoder/level.h b/av1/encoder/level.h
index d9d642fb04..077825e7b9 100644
--- a/av1/encoder/level.h
+++ b/av1/encoder/level.h
@@ -189,16 +189,6 @@ aom_codec_err_t av1_get_target_seq_level_idx(const SequenceHeader *seq_params,
const AV1LevelParams *level_params,
int *target_seq_level_idx);
-// Print the status of the decoder model(for debugging).
-void av1_decoder_model_print_status(const DECODER_MODEL *const decoder_model);
-
-void av1_decoder_model_init(const struct AV1_COMP *const cpi, AV1_LEVEL level,
- int op_index, DECODER_MODEL *const decoder_model);
-
-void av1_decoder_model_process_frame(const struct AV1_COMP *const cpi,
- size_t coded_bits,
- DECODER_MODEL *const decoder_model);
-
// This function uses the decoder model to check whether there could be
// SMOOTHING_BUFFER_UNDERFLOW or SMOOTHING_BUFFER_OVERFLOW. It does not
// update the content of decoder_model, and can be used to target certain