1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

base64: add benchmark

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-20 22:45:51 +01:00
parent d60d718c49
commit a41687c2d6

View File

@ -159,11 +159,24 @@ int main(void)
{ "666666", "NjY2NjY2"}, { "666666", "NjY2NjY2"},
{ "abc:def", "YWJjOmRlZg=="}, { "abc:def", "YWJjOmRlZg=="},
}; };
char in[1024], out[2048];
printf("Encoding/decoding tests\n"); printf("Encoding/decoding tests\n");
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);
memset(in, 123, sizeof(in));
for(i=0; i<10000; i++){
START_TIMER
av_base64_encode(out, sizeof(out), in, sizeof(in));
STOP_TIMER("encode")
}
for(i=0; i<10000; i++){
START_TIMER
av_base64_decode(in, out, sizeof(in));
STOP_TIMER("decode")
}
return error_count; return error_count;
} }