[FFmpeg-devel] Alignment implication in libswscale

Reimar Döffinger Reimar.Doeffinger
Tue Mar 11 14:25:12 CET 2008


On Tue, Mar 11, 2008 at 02:13:16PM +0100, Michael Niedermayer wrote:
> On Tue, Mar 11, 2008 at 08:44:14PM +0800, Zuxy Meng wrote:
> > Is it safe when implementing libswscale to assume that src and dst
> > pointers are aligned to the natural boundary of its format? For
> > example assuming that a src pointing to RGB32/YUY2 format is aligned
> > to a 4-byte boundary and RGB24 a 3-byte one.
> 
> You can generally assume 16byte alignment for src/dst/linesize.
> And its easy to fallback to the existing C code when alignment is not
> provided.
> The only case where alignment might be missing is for crop+scale ...

I am quite sure you can not assume anything will be 3 byte "aligned", not
even with RGB24...




More information about the ffmpeg-devel mailing list