diff --git a/utils/mpi_dec_utils.c b/utils/mpi_dec_utils.c index fd825eb4..1dc1c59f 100644 --- a/utils/mpi_dec_utils.c +++ b/utils/mpi_dec_utils.c @@ -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"); diff --git a/utils/mpi_dec_utils.h b/utils/mpi_dec_utils.h index 33427ceb..812a7e5b 100644 --- a/utils/mpi_dec_utils.h +++ b/utils/mpi_dec_utils.h @@ -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