[gst-devel] alignment issues

Ronald S. Bultje R.S.Bultje at students.uu.nl
Mon Apr 5 02:06:32 CEST 2004


Hi Dave,

On Sun, 2004-04-04 at 02:15, David Schleef wrote:
> On Sat, Apr 03, 2004 at 08:35:13PM +0200, Ronald Bultje wrote:
> > Please do. I sort-of dislike memcpy() though... Can you think of a quick
> > macro to do this? E.g.:
> > 
> > #define GST_READ_UINT32_BE(data) (data[0] << 24 | \
> > 				  data[1] << 16 | \
> > 				  data[2] <<  8 | \
> > 				  data[3]         )
> > 
> > (etc.)
> > 
> > Same for uint64, 16, all also LE and maybe even several write macros. Such
> > code should go somewhere in GStreamer core, I guess, since those are used
> > virtually everywhere.
> 
> Please hide this behind an #ifdef.  Sane architectures have no
> problem reading and writing unaligned words, most of them with
> no speed penalty.

Hm, yeah. Well, if the macros exist, optimizing them is easy, no? :).
Let's first make sure that it exists.

Ronald





More information about the gstreamer-devel mailing list