[FFmpeg-cvslog] r14245 - trunk/libavcodec/armv4l/mathops.h

Måns Rullgård mans
Wed Jul 16 01:34:53 CEST 2008


Aurelien Jacobs <aurel at gnuage.org> writes:

> M?ns Rullg?rd wrote:
>
>> matthieu castet <castet.matthieu at free.fr> writes:
>> 
>> > mru wrote:
>> >> Author: mru
>> >> Date: Tue Jul 15 21:06:32 2008
>> >> New Revision: 14245
>> >> 
>> >> Log:
>> >> ARM: optimised MAC64 and MLS64
>> >> 
>> >> Modified:
>> >>    trunk/libavcodec/armv4l/mathops.h
>> >> 
>> >> Modified: trunk/libavcodec/armv4l/mathops.h
>> >> ==============================================================================
>> >> --- trunk/libavcodec/armv4l/mathops.h	(original)
>> >> +++ trunk/libavcodec/armv4l/mathops.h	Tue Jul 15 21:06:32 2008
>> >> @@ -57,6 +57,16 @@ static inline av_const int64_t MUL64(int
>> >>  }
>> >>  #define MUL64 MUL64
>> >>  
>> >> +static inline av_const int64_t MAC64(int64_t d, int a, int b)
>> >> +{
>> >> +    union { uint64_t x; unsigned hl[2]; } x = { d };
>> >> +    asm ("smlal %0, %1, %2, %3"
>> >> +         : "+r"(x.hl[0]), "+r"(x.hl[1]) : "r"(a), "r"(b));
>> >> +    return x.x;
>> >> +}
>> >> +#define MAC64(d, a, b) ((d) = MAC64(d, a, b))
>> >> +#define MLS64(d, a, b) MAC64(d, -(a), b)
>> >> +
>> > Will this work on big endian arm ?
>> 
>> Probably not.
>> 
>> > Or big endian is not supported by ffmpeg ?
>> 
>> Apparently not ;-)
>
> IIRC I successfully tested mp3 decoding on big endian ARM some times ago.

OK.  I looked at one of the old IDCTs (not one of mine), and it
assumes little endian.

>> Some of the existing ARM code in FFmpeg already assumes little endian,
>> and big endian ARM systems seem quite rare (I've never actually seen
>> one).
>
> The Linksys NSLU2 is a quite popular big endian ARM system.
> There were a full debian port to armeb some times ago, even including
> an (old) ffmpeg package:
> http://armeb.debian.net/debian-armeb/sarge/pool/main/f/ffmpeg/
>
> Now, we are talking about ARMv6 code, and I don't know if there are
> some big endian ARMv6 systems in the wild. So it may not matter much.

This instruction is actually available from ARMv4.

> But it would be nice to avoid breaking at least basic big endian ARMv4
> when easily possible.

I agree.  I just didn't think of it.  If you have a big endian ARM,
you're welcome to help with testing.

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




More information about the ffmpeg-cvslog mailing list