"Ronald S. Bultje" <[email protected]> writes:

> From f515b4df375e921b7f42826f903b009f709ef34f Mon Sep 17 00:00:00 2001
> From: Ronald S. Bultje <[email protected]>
> Date: Tue, 24 May 2011 13:04:38 -0400
> Subject: [PATCH 1/5] Move emms_c() from libavcodec to libavutil.
>
> ---
>  libavcodec/dsputil.h |   20 +-------------------
>  libavutil/internal.h |   14 ++++++++++++++
>  2 files changed, 15 insertions(+), 19 deletions(-)
>
> diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
> index 78d2152..74230ca 100644
> --- a/libavcodec/dsputil.h
> +++ b/libavcodec/dsputil.h
> @@ -630,13 +630,6 @@ static inline int get_penalty_factor(int lambda, int 
> lambda2, int type){
>      }
>  }
>  
> -/**
> - * Empty mmx state.
> - * this must be called between any dsp function and float/double code.
> - * for example sin(); dsp->idct_put(); emms_c(); cos()
> - */
> -#define emms_c()
> -
>  void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
>  void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
>  void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
> @@ -654,18 +647,7 @@ void ff_intrax8dsp_init(DSPContext* c, AVCodecContext 
> *avctx);
>  void ff_mlp_init(DSPContext* c, AVCodecContext *avctx);
>  void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx);
>  
> -#if HAVE_MMX
> -
> -#undef emms_c
> -
> -static inline void emms(void)
> -{
> -    __asm__ volatile ("emms;":::"memory");
> -}
> -
> -#define emms_c() emms()
> -
> -#elif ARCH_ARM
> +#if ARCH_ARM
>  
>  #if HAVE_NEON
>  #   define STRIDE_ALIGN 16
> diff --git a/libavutil/internal.h b/libavutil/internal.h
> index e890ae7..d7081f2 100644
> --- a/libavutil/internal.h
> +++ b/libavutil/internal.h
> @@ -223,4 +223,18 @@
>  #   define ONLY_IF_THREADS_ENABLED(x) NULL
>  #endif
>  
> +#if HAVE_MMX
> +static av_always_inline void emms_c(void)
> +{
> +    __asm__ volatile ("emms" ::: "memory");
> +}
> +#else /* HAVE_MMX */
> +/**
> + * Empty mmx state.
> + * this must be called between any dsp function and float/double code.
> + * for example sin(); dsp->idct_put(); emms_c(); cos()
> + */

This comment is oddly placed.

> +#define emms_c()
> +#endif /* HAVE_MMX */
> +
>  #endif /* AVUTIL_INTERNAL_H */
> -- 
> 1.7.4.4

Looks OK otherwise.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to