[FFmpeg-devel] [PATCH] dsputil: add bswap16_buf()

Alexander Strange astrange
Fri Mar 11 05:02:00 CET 2011


On Mar 10, 2011, at 9:05 PM, M?ns Rullg?rd wrote:

> Michael Niedermayer <michaelni at gmx.at> writes:
> 
>> On Fri, Mar 11, 2011 at 01:55:19AM +0100, Luca Barbato wrote:
>>> On 03/11/2011 01:12 AM, Mans Rullgard wrote:
>>>> There several places where a buffer is byte-swapped in 16-bit units.
>>>> This allows them to share code which can be optimised for various
>>>> architectures.
>>> 
>>> Looks ok, which alignment constraint for it?
>> 
>> 16
> 
> You just made that up out of thin air.

Do you need to bswap16_buf part of a malloced buffer or the entire thing? 16 is the natural alignment for the start of av_malloc and therefore is obvious for start-aligned buffer operations. And it's natural for pshufb, of course.




More information about the ffmpeg-devel mailing list