[FFmpeg-devel] [PATCH] bswap: add macros to byteswap constants

Michael Niedermayer michaelni
Thu Apr 29 16:06:55 CEST 2010


On Thu, Apr 29, 2010 at 02:26:50PM +0100, Mans Rullgard wrote:
> The normal byteswap functions might use inline asm which is suboptimal
> with constants (and cannot be used in static initialisers), so special
> macros for constants only is needed.
> 
> We should not rely on the gcc __builtin_constant_p() test since it is
> not always available.

if its not available then this kind of optimization is not possible
adding even more complexity, ifdefery, and burden to support partial
optimizations in extreemly primitive compilers is imho not a good idea.
If one wants optimized
code a compiler with the (optimization relevant) feature set of gcc is
imho the minimum requirement.
thats besides that this patch is just a brick of a huge wall that would
be needed for this hack, you would need to duplicate every use of le/be
code as well. The bitstream readers is just the next step, and then all
uses of the bitstream code would have to be reviewed if the values are
compiletime constant or not. Thats huge amounts of work for a primitive
compiler. id much rather completely drop support for such compilers

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- 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-devel/attachments/20100429/ff80f1b3/attachment.pgp>



More information about the ffmpeg-devel mailing list