[Ffmpeg-devel] [PATCH] increase picture buffer alignment to 16-byte on x86

Michael Niedermayer michaelni
Thu Jan 11 21:41:49 CET 2007


On Wed, Jan 10, 2007 at 10:24:16PM -0500, Alexander Strange wrote:
> I was doing some sse2 code with an ffmpeg buffer and was surprised to  
> find it crashing.
> This turned out to be because avcodec_default_get_buffer was aligning  
> the U/V buffers to 8-byte instead of 16-byte alignment. As 16-byte  
> alignment works fine on PPC, the attached patch changes it to match  
> on x86.
> Although if there's a reason for this, I can certainly just go to  
> using movdqu.

if your code has alignment requirements beyond what ffmpeg needs internally
then you should override get_buffer() or suggest some more flexible way to
tell default_get_buffer() what alignment is wanted, simply increasing
the alignment even if its not needed is bad, because it wastes memory and
reduces cache efficiency


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070111/2096aab4/attachment.pgp>

More information about the ffmpeg-devel mailing list