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

Måns Rullgård mans
Tue Jun 2 23:15:43 CEST 2009

Jeff Downs <heydowns at borg.com> writes:

> 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
> findings.
> In the meantime, if no one else weighs in, I will see about doing some.

I'll post something, probably a blog rant, after I get back from
California on Monday.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list