[FFmpeg-devel] [PATCH] cmdutils: add -cpuflags.

Alexander Strasser eclipse7 at gmx.net
Sun Feb 19 21:08:07 CET 2012


Hi Michael,

  overall it seems useful enough to me.

Michael Niedermayer wrote:
> This allows globally forcing specific cpuflags (or lack thereof)
> Useful for debugging and benchmarking
> 

  On the one hand one might argue it makes it pretty easy to shoot
yourself in the foot. But on the other hand I guess the option is
not documented enough to make it an easy or a worthwhile target
(which is of course good in this case). 

> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  cmdutils.c             |   14 ++++++++++++++
>  cmdutils.h             |    2 ++
>  cmdutils_common_opts.h |    1 +
>  3 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/cmdutils.c b/cmdutils.c
> index 218c9f0..ea136fc 100644
> --- a/cmdutils.c
> +++ b/cmdutils.c
> @@ -535,6 +535,20 @@ int opt_max_alloc(const char *opt, const char *arg)
>      return 0;
>  }
>  
> +int opt_cpuflags(const char *opt, const char *arg)
> +{
> +    char *tail;
> +    size_t max;

  Is this a copy&paste error, or does the name max qualify in any other
way then rhyming on flags?

  Wouldn't it be more logical to use long? What is the rational on using
size_t? Is it because with an unsigned type it is easier to set
AV_CPU_FLAG_FORCE on some architectures?

[...]

  Alexander


More information about the ffmpeg-devel mailing list