[mpi_dec_utils]: Add decoder frame rate print

Change-Id: I46006cb51205ea98204c803f4753039409e8171d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2021-10-19 14:12:50 +08:00
parent 31de64ae15
commit 7b86c1abe4
2 changed files with 12 additions and 1 deletions

View File

@@ -377,6 +377,15 @@ void reader_stop(FileReader reader)
pthread_join(impl->thd, NULL);
}
void show_dec_fps(RK_S64 total_time, RK_S64 total_count, RK_S64 last_time, RK_S64 last_count)
{
float avg_fps = (float)total_count * 1000000 / total_time;
float ins_fps = (float)last_count * 1000000 / last_time;
mpp_log("decoded %10lld frame fps avg %7.2f ins %7.2f\n",
total_count, avg_fps, ins_fps);
}
void mpi_dec_test_help()
{
mpp_log("usage: mpi_dec_test [options]\n");

View File

@@ -27,7 +27,7 @@
typedef void* FileReader;
/* For overall configure setup */
typedef struct {
typedef struct MpiDecTestCmd_t {
char file_input[MAX_FILE_NAME_LENGTH];
char file_output[MAX_FILE_NAME_LENGTH];
char file_config[MAX_FILE_NAME_LENGTH];
@@ -69,4 +69,6 @@ RK_U32 reader_read(FileReader reader, char** buf, size_t *size);
RK_U32 reader_index_read(FileReader reader, RK_S32 index, char** buf, size_t *size);
void reader_rewind(FileReader reader);
void show_dec_fps(RK_S64 total_time, RK_S64 total_count, RK_S64 last_time, RK_S64 last_count);
#endif