[FFmpeg-devel] [PATCH] Move CPU detection to libavutil and cleanup

Stefano Sabatini stefano.sabatini-lala
Sun Sep 5 23:25:55 CEST 2010


On date Sunday 2010-09-05 23:05:29 +0200, Michael Niedermayer encoded:
> On Sun, Sep 05, 2010 at 05:27:50PM +0200, Stefano Sabatini wrote:
> > On date Sunday 2010-09-05 16:48:23 +0200, Michael Niedermayer encoded:
> > > On Sat, Sep 04, 2010 at 12:09:50PM +0200, Stefano Sabatini wrote:
> > > [...]
> > > > +#include "config.h"
> > > > +
> > > > +int av_get_cpu_flags(void)
> > > > +{
> > > > +    return HAVE_IWMMXT * AV_CPU_IWMMXT;
> > > > +}
> > > > +
> > > > +int ff_has_altivec(void)
> > > 
> > > why this seperate function and why does it have a ff_ prefix but is used from
> > > outside libavutil?
> > 
> > Is used in libavcodec/ppc/dsputil_init_ppc.c.
> 
> why this seperate function?
> why not av_get_cpu_flags() ?

Because it's a mess, I have no idea why it is like that though.

Another problem I see is that AV_CPU_FLAG_MMX is defined the same way
as AV_CPU_FLAG_ALTIVEC (see libavutil/cpu.h, I just moved the
definitions from libavcodec without to perform consistency checks...),
so currently mm_support() cannot distinguish the two, maybe that
should be the first point to address.

> > If you prefer av_ rather than ff_ no problem, but also I see no much
> > point in it,
> 
> av_ is public
> ff_ is private
> 
> you use it from outside libavutil thus its public
> (yes i dislike the idea of a secret private API that entangles our libs
>  but that we need to take care of due to ABI issues)

I see.

Regards.
-- 
FFmpeg = Fantastic Friendly Murdering Portable Everlasting Glue



More information about the ffmpeg-devel mailing list