[FFmpeg-devel] [PATCH] tools: add benchmark for crypto functions.

James Almer jamrial at gmail.com
Fri Jul 26 18:12:39 CEST 2013


On 26/07/13 11:23 AM, Nicolas George wrote:
> The benchmark tests the speed of the following algorithms:
> MD5, SHA-1, SHA-224, SHA-256, AES-128.
> 
> It can optionally be built to perform the same benchmark on
> other crypto libraries, for comparison purposes.
> The supported libraries are:
> - crypto:   OpenSSL's libcrypto;
> - gcrypt:   GnuTLS's libgcrypt;
> - tomcrypt: LibTomCrypt
> To enable them, use this syntax:
> make VERSUS=crypto+gcrypt+tomcrypt tools/crypto_bench
> They do not need to have been enabled in configure.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  .gitignore           |    1 +
>  libavutil/Makefile   |    5 +-
>  tools/crypto_bench.c |  341 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 346 insertions(+), 1 deletion(-)
>  create mode 100644 tools/crypto_bench.c

I'm getting this when i try to compile with no external libraries. Looks like USE_EXT_LIBS is not 
being defined properly.

jamrial at GentooVM ~/build $ make tools/crypto_bench
CC      tools/crypto_bench.o
/home/jamrial/ffmpeg/tools/crypto_bench.c:111:18: error: missing expression between '(' and ')'
/home/jamrial/ffmpeg/tools/crypto_bench.c:150:18: error: missing expression between '(' and ')'
/home/jamrial/ffmpeg/tools/crypto_bench.c:185:18: error: missing expression between '(' and ')'
/home/jamrial/ffmpeg/tools/crypto_bench.c: In function 'main':
/home/jamrial/ffmpeg/tools/crypto_bench.c:312:30: error: expected expression before ')' token
/home/jamrial/ffmpeg/tools/crypto_bench.c:314:26: error: 'buf' undeclared (first use in this function)
/home/jamrial/ffmpeg/tools/crypto_bench.c:314:26: note: each undeclared identifier is reported only 
once for each function it appears in
/home/jamrial/ffmpeg/tools/crypto_bench.c:315:40: error: expected expression before ')' token
/home/jamrial/ffmpeg/tools/crypto_bench.c:316:40: error: expected expression before ')' token
/home/jamrial/ffmpeg/tools/crypto_bench.c:317:40: error: expected expression before ')' token

And IMO there's no need to test both SHA224 and SHA256 as they run the same code.
You could instead test SHA512 or RIPEMD160 (RIPEMD128 is afaik only supported by lavu and tomcrypt).

Also, you posted the same results for both the Core i7 and the Athlon II X2.

Regards.


More information about the ffmpeg-devel mailing list