[x264-devel] patch for: alignment problem on sparc (maybe others 32bit archs, too)

Jason Garrett-Glaser darkshikari at gmail.com
Fri Mar 6 11:23:14 CET 2009


2009/3/6 Chris Fensch <cf-x264 at fens.ch>:
> Hello,
>
>   there is a pointer alignment problem in bs.h. s->p is no longer guaranteed
> to be aligned to word bounderies. This causes a problem on architectures
> that only support aligned word memory access, such as sparc (I assume a few
> others might also have the same problem). In such a case it is necessary to
> perform the word access as a sequence of bytes accesses. I attached a patch
> that fixes this problem for sparc, but it should be straight forward to
> modify the patch such that it also supports other architectures. A final
> note, the patch only fixes alignment problems on 32bit architectures. I made
> no effort to make it also support 64bit architectures that have similar
> alignment constraints.

This is not an appropriate fix.  The bitstream pointer itself should
always be aligned, and if it is not, the bitstream writer should be
modified to ensure that it is.

Dark Shikari


More information about the x264-devel mailing list