[Ffmpeg-devel] [PATCH] Machine endian bytestream functions

Måns Rullgård mans
Tue Apr 24 02:37:11 CEST 2007


Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
>
> On Sat, Apr 14, 2007 at 12:21:20AM +0100, M?ns Rullg?rd wrote:
> [...]
>> >> I'm thinking the unaligned16/32/64 macros from bitstream.h should be
>> >> renamed and moved here instead.
>> >>
>> > I'll take a look.
>> 
>> This lets the compiler choose whatever access method is appropriate,
>> and saves us the trouble of maintaining a fragile list.
>
> iam not sure what exactly you are proposing
>
> the compiler does not know if bytewise read is faster then unaligned
> uintXY_t read with a user provided (possibly asm) bswap afterwards

The compiler knows if unaligned access is possible at all.  It may
also know ways of accessing unaligned data that are faster than
reading 4 bytes but slower than aligned access.  The bswap reference
seems completely out of place here.  The macros we're talking about
are for reading native endian data.

> also with the argument that the compiler should know what is best we can
> rm -r i386/ ppc/ alpha/ ...

Don't be stupid.  When you say things like that I get the feeling
you've run out of arguments.  Or possibly forgotten what you were
arguing.

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




More information about the ffmpeg-devel mailing list