[test]: Update utils for encoder test

1. Move command parsing to util files.
2. Support frame format and coding type detection.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id1df67ba61943bb7aa1f02ccccaa932fb5ae9842
This commit is contained in:
Herman Chen
2020-04-04 17:19:57 +08:00
parent b83158b23b
commit 681599f97f
6 changed files with 387 additions and 335 deletions

View File

@@ -127,17 +127,6 @@ typedef struct {
RK_S32 qp_init;
} MpiEncTestData;
static OptionInfo mpi_enc_cmd[] = {
{"i", "input_file", "input bitstream file"},
{"o", "output_file", "output bitstream file, "},
{"w", "width", "the width of input picture"},
{"h", "height", "the height of input picture"},
{"f", "format", "the format of input picture"},
{"t", "type", "output stream coding type"},
{"n", "max frame number", "max encoding frame number"},
{"d", "debug", "debug flag"},
};
MPP_RET test_ctx_init(MpiEncTestData **data, MpiEncTestCmd *cmd)
{
MpiEncTestData *p = NULL;
@@ -853,14 +842,6 @@ MPP_TEST_OUT:
return rate;
}
static void mpi_enc_test_help()
{
mpp_log("usage: mpi_enc_test [options]\n");
show_options(mpi_enc_cmd);
mpp_show_support_format();
}
static RK_S32 mpi_enc_test_parse_options(int argc, char **argv, MpiEncTestCmd* cmd)
{
const char *opt;