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

Michael Niedermayer michaelni
Sat Jan 16 00:50:52 CET 2010


On Fri, Jan 15, 2010 at 09:17:24PM +0000, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Fri, Jan 15, 2010 at 08:28:10PM +0000, M?ns Rullg?rd wrote:
> >> Alex Converse <alex.converse at gmail.com> writes:
> >> 
> >> > On Thu, Jan 14, 2010 at 9:58 PM, mru <subversion at mplayerhq.hu> wrote:
> >> >> Author: mru
> >> >> Date: Fri Jan 15 03:58:24 2010
> >> >> New Revision: 21219
> >> >>
> >> >> Log:
> >> >> AAC: ARM/NEON asm for VMUL2/4 functions
> >> >>
> >> >> Added:
> >> >> ? trunk/libavcodec/arm/aac.h
> >> >> Modified:
> >> >> ? trunk/libavcodec/aac.c
> >> >>
> >> >> Modified: trunk/libavcodec/aac.c
> >> >> ==============================================================================
> >> >> --- trunk/libavcodec/aac.c ? ? ?Fri Jan 15 01:45:47 2010 ? ? ? ?(r21218)
> >> >> +++ trunk/libavcodec/aac.c ? ? ?Fri Jan 15 03:58:24 2010 ? ? ? ?(r21219)
> >> >> @@ -93,6 +93,10 @@
> >> >> ?#include <math.h>
> >> >> ?#include <string.h>
> >> >>
> >> >> +#if ARCH_ARM
> >> >> +# ? include "arm/aac.h"
> >> >> +#endif
> >> >> +
> >> >> ?union float754 {
> >> >> ? ? float f;
> >> >> ? ? uint32_t i;
> >> >> @@ -862,6 +866,7 @@ static void decode_mid_side_stereo(Chann
> >> >> ? ? }
> >> >> ?}
> >> >>
> >> >> +#ifndef VMUL2
> >> >> ?static inline float *VMUL2(float *dst, const float *v, unsigned idx,
> >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ?const float *scale)
> >> >> ?{
> >> >> @@ -870,7 +875,9 @@ static inline float *VMUL2(float *dst, c
> >> >> ? ? *dst++ = v[idx>>4 & 15] * s;
> >> >> ? ? return dst;
> >> >> ?}
> >> >> +#endif
> >> 
> >> [...]
> >> 
> >> > I certainly like the speed up associated with these changes but there
> >> > has to be a cleaner way of organizing them as not to litter aac.c with
> >> > ifdefs.
> >> 
> >> Like what?
> >
> > 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

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.

anyway iam not aac maintainer so its none of my business but for files
i maintain i dont want such ifdefery

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- 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-cvslog/attachments/20100116/661b9c81/attachment.pgp>



More information about the ffmpeg-cvslog mailing list