mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[test]: Improve decoder tests
1. All cases use reader to improve performance. 2. Rename cmd parser and create share data on cmd parsing. 3. Add reader_size function to get file size. 4. Change test log flag to -v options. 5. Fix FileBufSlot release MppBuffer issue. 6. Use index_read in multi test to improve performance. Usage: mpi_dec_test -i xxx.h264 Decode to the end of input stream. mpi_dec_test -i xxx.h264 -n 10 Decode to the first 10 frame of input stream. If the xxx.h264 has only 5 frames then loop decoding from the beginning. mpi_dec_test -i xxx.h264 -n -1 -v qf Infinitely loop decoding xxx.h264. It is usefull for performance test. mpi_dec_multi_test -i xxx.h264 -n -1 -v qf -s 8 Parallelly infinitely loop run 8 decoders with same xxx.h264 input. It is usefull for performance test. -v q will disable each frame output log. -v f will enable fps print per second. -n -1 will enter infinite decode mode. Press <enter> will quit the loop. Change-Id: I3d54123f0e9b9a85cb35e4fea71ebf665889750a Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -38,17 +38,14 @@ typedef struct FileBufSlot_t {
|
||||
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];
|
||||
|
||||
MppCodingType type;
|
||||
MppFrameFormat format;
|
||||
RK_U32 width;
|
||||
RK_U32 height;
|
||||
RK_U32 debug;
|
||||
RK_U32 quiet;
|
||||
|
||||
RK_U32 have_input;
|
||||
RK_U32 have_output;
|
||||
RK_U32 have_config;
|
||||
|
||||
RK_U32 simple;
|
||||
RK_S32 timeout;
|
||||
@@ -58,21 +55,32 @@ typedef struct MpiDecTestCmd_t {
|
||||
RK_S32 nthreads;
|
||||
// report information
|
||||
size_t max_usage;
|
||||
|
||||
/* data for share */
|
||||
FileReader reader;
|
||||
FpsCalc fps;
|
||||
|
||||
/* runtime log flag */
|
||||
RK_U32 debug;
|
||||
RK_U32 quiet;
|
||||
RK_U32 trace_fps;
|
||||
} MpiDecTestCmd;
|
||||
|
||||
extern OptionInfo mpi_dec_cmd[];
|
||||
|
||||
RK_S32 mpi_dec_test_parse_options(int argc, char **argv, MpiDecTestCmd* cmd);
|
||||
void mpi_dec_test_show_options(MpiDecTestCmd* cmd);
|
||||
void mpi_dec_test_help();
|
||||
RK_S32 mpi_dec_test_cmd_init(MpiDecTestCmd* cmd, int argc, char **argv);
|
||||
RK_S32 mpi_dec_test_cmd_deinit(MpiDecTestCmd* cmd);
|
||||
void mpi_dec_test_cmd_options(MpiDecTestCmd* cmd);
|
||||
void mpi_dec_test_cmd_help();
|
||||
|
||||
void reader_init(FileReader* reader, char* file_in, FILE* fp_in);
|
||||
void reader_deinit(FileReader *reader);
|
||||
void reader_init(FileReader* reader, char* file_in);
|
||||
void reader_deinit(FileReader reader);
|
||||
|
||||
void reader_start(FileReader reader);
|
||||
void reader_sync(FileReader reader);
|
||||
void reader_stop(FileReader reader);
|
||||
|
||||
size_t reader_size(FileReader reader);
|
||||
MPP_RET reader_read(FileReader reader, FileBufSlot **buf);
|
||||
MPP_RET reader_index_read(FileReader reader, RK_S32 index, FileBufSlot **buf);
|
||||
void reader_rewind(FileReader reader);
|
||||
|
Reference in New Issue
Block a user