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

Alexander Strange astrange
Wed Jun 25 01:24:52 CEST 2008


On Jun 24, 2008, at 4:23 PM, Michael Niedermayer wrote:

> 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
>>  IWMMXT
>>
>> 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
>
>    Log:
>    Set mm_flags in dct-test to fix floating math.
>    Patch by Alexander Strange \astrange ithinksw com/
> and
>    Author: gpoirier
>    Date: Sun Mar 30 12:29:28 2008
>    New Revision: 12628
>
>    Log:
>    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
>
>    Log:
>    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.

Is this OK?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: generic-dcttest.diff
Type: text/x-diff
Size: 1161 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080624/5a3c0862/attachment.diff>
-------------- next part --------------




More information about the ffmpeg-devel mailing list