[FFmpeg-devel] Multimedia extensions run-time support check

Michael Niedermayer michaelni
Tue Jun 24 22:23:18 CEST 2008

On Tue, Jun 24, 2008 at 05:43:49PM +0200, Laurent Desnogues wrote:
> Hello,
> (I know this is not a very interesting matter, but it's a good way
> for me to start messing with FFmpeg code;  if noone cares, let
> me know and I'll use some adhoc solution that fits my needs.)
> Currently to know what multimedia extensions are supported,
> the code checks the value of mm_flags or the return value of
> mm_support() (cf. dsputil.h).
> My understanding is that this is only used to setup things at
> initialization time.
> However I find things are inconsistent.  For instance:
> - mm_support is always declared but only defined for MMX,
>   IWMMXT (Xscale) and PPC
> - mm_flags is declared for ARMV4L but only defined for
> This is not a big deal at the moment since it only breaks
> the build of some test programs for some configs, such as
> dct-test when either MMX is not defined or when building
> for ARM without IWMMXT.

dct-test.c was broken by
    Author: benoit
    Date: Tue Mar 25 15:34:27 2008
    New Revision: 12580

    Set mm_flags in dct-test to fix floating math.
    Patch by Alexander Strange \astrange ithinksw com/
    Author: gpoirier
    Date: Sun Mar 30 12:29:28 2008
    New Revision: 12628

    check mm_flags for each DCT and skips the ones that can't be run
    patch by Alexander Strange %astrange A ithinksw P com%

fft-test.c was broken by
    Author: diego
    Date: Tue Jun 24 11:00:58 2008
    New Revision: 13940

    Remove redundant mm_flags declaration, fixes the warning:
    libavcodec.a(dsputil_ppc.o): warning: definition of `mm_flags' overriding common
    fft-test.o: warning: common is here

> Currently I only see two solutions:
> 1. correctly protect declarations in dsputil.h depending
>    on ifdef's
> 2. always define fake mm_flags and mm_support that
>   are or return zero.

I do not belive mm_flags was ever intended to be accessed from outside
the specific optimized code. it just happened by mistake as people tried
to "fix" gcc warnings without bothering to fully understand the code

mm_support() should be a #define 0 when optims are off.

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080624/19972fa2/attachment.pgp>

More information about the ffmpeg-devel mailing list