[FFmpeg-devel] [PATCH] Macros to copy small, possibly unaligned, values

Jeff Downs heydowns
Tue Jun 2 21:08:13 CEST 2009

On Tue, 2 Jun 2009, Reimar D?ffinger wrote:

> On Tue, Jun 02, 2009 at 02:06:12PM -0400, Jeff Downs wrote:
> > Attached adds AV_CN* macros to provide a universal way to copy small, 
> > possibly unaligned, constant-sized values.
> Note that there is such a thing already in libavutil/lzo.c.
> Issue is just that the defines are set manually...

Indeed,  I'll keep those in mind and look at migrating them if we decide 
to go the route of adding these new macros in the common header.

> Since I benchmarked that a lot on x86 back then, the obvious question
> is if there is any reason at all to avoid using memcpy...

Mans did some tests on a number of architectures and suggested it would be 
best to not just use memcpy universally for small, constant-sized amounts.  
Maybe he can post the specifics of some of his testing or summarize his
In the meantime, if no one else weighs in, I will see about doing some.


More information about the ffmpeg-devel mailing list