[FFmpeg-cvslog] r21219 - in trunk/libavcodec: aac.c arm/aac.h

Måns Rullgård mans
Sat Jan 16 13:27:45 CET 2010


Alex Converse <alex.converse at gmail.com> writes:

> 2010/1/15 M?ns Rullg?rd <mans at mansr.com>:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>>
>>> On Fri, Jan 15, 2010 at 09:17:24PM +0000, M?ns Rullg?rd wrote:
>>>> Michael Niedermayer <michaelni at gmx.at> writes:
>>>>
>>>> > maybe a header that describes in english what the functions do and contains
>>>> > ISO C implementations named like VMUL2_C.
>>>> > And a seperate header for each arch that contains a full set of these
>>>> > implementations using "#define VMUL2 VMUL2_C" where no better is available.
>>>> > Also there would then be a ISO C only header that contained a
>>>> > #define VMUL2 VMUL2_C
>>>> > for every function.
>>>> > That way there would be no ifdefs except for including the right header
>>>>
>>>> That would require creating and maintaining dummy headers for every
>>>> arch. ?I consider that for more of a burden than looking at 4 simple
>>>> ifdefs from time to time.
>>>
>>> I dont think it would need dummy headers
>>>
>>> #if ARCH_X86
>>> #include "x86/foo.h"
>>> #else if ARCH_ARM
>>> #include "arm/foo.h"
>>> #else
>>> #include "foo.h"
>>> #endif
>>> // not yet implemented for alpha & sparc
>>
>> What if only a subset is implemented for some arch?
>>
>>> also, having a complete list of optimized functions in each arch file is a
>>> great reminder of what is not optimized yet and could be optimized.
>>
>> It also means that any changes have to be done to *all* arch headers.
>> I know from experience that this will not work very well.
>>
>
> It doesn't ahve to be taht bad. Consider...
>
> +++ aacopt.h
> static av_always_inline float FUNC_C(...) {
>     //ISO C90 stuff
> }
> #define FUNC FUNC_C
>
> +++ arm/aac.h
> #include "aacopt.h"
> static av_always_inline float FUNC_NEON(...) {
>    //Your super awesome neon stuff
> }
> #undef FUNC
> #define FUNC FUNC_NEON
>
> Adding new functions doesn't break any other archs.
>
> The unused static functions should be eliminated at compile time.

If you're lucky.

> Everybody wins!

I consider your suggestion uglier than mine.

>>> anyway iam not aac maintainer so its none of my business but for files
>>> i maintain i dont want such ifdefery
>>
>> Files you maintain? ?Bah! ?As far as I can tell, I'm the only one
>> doing anything resembling $arch maintenance, and I've *reduced* the
>> amount of ugly ifdeffery substantially compared to what it used to be,
>> so please don't complain to me. ?There is still a lot of cleanup work
>> to be done, but I hope to get round to it sooner or later.
>
> I was unaware cleaning up after others gives you license to make new messes.

I disagree about me having creating anything remotely messy.  We've
have the same scheme in use in numerous places (mathops.h, bswap.h,
intreadwrite.h, ...) for years without anyone complaining.  Why the
sudden outrage?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-cvslog mailing list