[FFmpeg-devel] [PATCH 06/12] lavu/aes: add x86 AESNI optimizations

Michael Niedermayer michael at niedermayer.cc
Tue Oct 27 14:35:33 CET 2015


On Mon, Oct 26, 2015 at 03:25:48AM -0500, Rodger Combs wrote:
> crypto_bench comparison for AES-128-ECB:
> 
> lavu_aesni AES-128-ECB  size: 1048576  runs:   1024  time:    0.596 +- 0.081
> lavu_c     AES-128-ECB  size: 1048576  runs:   1024  time:   17.007 +- 2.131
> crypto     AES-128-ECB  size: 1048576  runs:   1024  time:    0.612 +- 1.857
> gcrypt     AES-128-ECB  size: 1048576  runs:   1024  time:    1.123 +- 0.224
> tomcrypt   AES-128-ECB  size: 1048576  runs:   1024  time:    9.038 +- 0.790
> 
> Improved-By: Henrik Gramner <henrik at gramner.com>
> ---
>  libavutil/aes.c          |  4 +++
>  libavutil/aes_internal.h |  2 ++
>  libavutil/x86/Makefile   |  4 ++-
>  libavutil/x86/aes.asm    | 92 ++++++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/x86/aes_init.c | 37 +++++++++++++++++++
>  5 files changed, 138 insertions(+), 1 deletion(-)
>  create mode 100644 libavutil/x86/aes.asm
>  create mode 100644 libavutil/x86/aes_init.c
> 
> diff --git a/libavutil/aes.c b/libavutil/aes.c
> index 4b871a0..40db681 100644
> --- a/libavutil/aes.c
> +++ b/libavutil/aes.c
> @@ -161,6 +161,8 @@ static void aes_decrypt(AVAES *a, uint8_t *dst, const uint8_t *src,
>  void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src,
>                    int count, uint8_t *iv, int decrypt)
>  {
> +    if (count <= 0)
> +        return;

if only the ASM version needs this check then it should only be done
for the asm version


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151027/6dc9a7e4/attachment.sig>


More information about the ffmpeg-devel mailing list