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

Mike Melanson mike
Mon Dec 26 02:51:52 CET 2005

David S. Miller wrote:
> 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.

	Do you have any numbers to back this up? Per my understanding, 
unaligned accessed for MMX instructions is possible but slightly slower. 
IIRC, unaligned access on SSE2 instructions is not possible.

	Plus, it still doesn't make any sense: Why is an 8-byte alignment 
causing trouble but a 4-byte alignment is okay? Logically, the 8-byte 
alignment *is also* a 4-byte alignment.

	-Mike Melanson

More information about the ffmpeg-devel mailing list