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

Michael Niedermayer michaelni
Sun Sep 5 23:46:51 CEST 2010


On Sun, Sep 05, 2010 at 11:25:55PM +0200, Stefano Sabatini wrote:
> 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.

i know its a mess even if not a particularely bad and big one
but this needs to be fixed before making the API public. otherwise there
will be cruft until the next major bump and maybe worse, people using it
by mistake ...


> 
> 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.

i dont think code testing for altivec will be run on mmx chips but maybe
i miss some case. that said iam not saying the 2 should stay like that ...

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

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100905/61d2051e/attachment.pgp>



More information about the ffmpeg-devel mailing list