1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-04-19 09:02:26 +02:00

base64: Only run benchmark when "-t" is specified.

As the test is run during fate and the benchmark is useless for fate
this very slightly speeds up fate. Its also consistent with the other
tests.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-21 05:11:19 +01:00
parent 57822f0660
commit bdd739e91c

View File

@ -150,7 +150,7 @@ static int test_encode_decode(const uint8_t *data, unsigned int data_size,
return 0; return 0;
} }
int main(void) int main(int argc, char ** argv)
{ {
int i, error_count = 0; int i, error_count = 0;
struct test { struct test {
@ -172,6 +172,7 @@ int main(void)
for (i = 0; i < FF_ARRAY_ELEMS(tests); i++) for (i = 0; i < FF_ARRAY_ELEMS(tests); i++)
error_count += test_encode_decode(tests[i].data, strlen(tests[i].data), tests[i].encoded_ref); error_count += test_encode_decode(tests[i].data, strlen(tests[i].data), tests[i].encoded_ref);
if (argc>1 && !strcmp(argv[1], "-t")) {
memset(in, 123, sizeof(in)); memset(in, 123, sizeof(in));
for(i=0; i<10000; i++){ for(i=0; i<10000; i++){
START_TIMER START_TIMER
@ -189,6 +190,7 @@ int main(void)
av_base64_decode(NULL, out, 0); av_base64_decode(NULL, out, 0);
STOP_TIMER("syntax check") STOP_TIMER("syntax check")
} }
}
return error_count; return error_count;
} }