[Ffmpeg-devel] [PATCH]: Too much alignment assumed by H264 decoder

David S. Miller davem
Mon Dec 26 01:04:04 CET 2005

From: Michael Niedermayer <michaelni at gmx.at>
Date: Sun, 25 Dec 2005 23:52:03 +0100

> people dont do things according to importance but due to what they like
> or are being paid for, why not fix the alignment yourself? changing all
> accesses to slower 4byte accesses is not ok

I did the fix, some folks just don't like it.  To be honest, I don't
think it decreases performance all as much as is being implied.

The fact is that the object is 4-byte, not 8-byte aligned, on 32-bit
platforms.  So you can't legally do 8-byte memory accesses to them
in such cases.

With the way the code is now, it crashes on 32-bit platforms other
than x86 and x86_64 (which do not trap on unaligned memory accesses).
And because the x86 and x86_64 don't trap, but instead just eat a
couple extra cycles to perform the unaligned memory accesses, this
makes me believe that the "performance penalty" of my patch is
possibly a myth not fact.

More information about the ffmpeg-devel mailing list