diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-20 22:45:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-21 00:24:10 +0100 |
commit | a41687c2d673f3dc375cdd2be97877991df49463 (patch) | |
tree | 29aed941c9540d62bdf0855a0f38e9052bd9a1b7 /libavutil/base64.c | |
parent | d60d718c49133544bb6e11d073ca48a5e22b0eb6 (diff) | |
download | ffmpeg-a41687c2d673f3dc375cdd2be97877991df49463.tar.gz |
base64: add benchmark
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/base64.c')
-rw-r--r-- | libavutil/base64.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/base64.c b/libavutil/base64.c index ef9bfc95dd..654c280827 100644 --- a/libavutil/base64.c +++ b/libavutil/base64.c @@ -159,11 +159,24 @@ int main(void) { "666666", "NjY2NjY2"}, { "abc:def", "YWJjOmRlZg=="}, }; + char in[1024], out[2048]; printf("Encoding/decoding tests\n"); 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); + 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; } |