[vlc-devel] [PATCH] core: avcodec requires 32-bytes memory alignment in many cases

Rémi Denis-Courmont remi at remlab.net
Wed Dec 13 09:48:23 CET 2017


Le 13 décembre 2017 10:40:18 GMT+02:00, Steve Lhomme <robux4 at gmail.com> a écrit :
>I think you sent the reply to the wrong thread Rémi.
>
>> If the plane alignment is the same as the scan line alignment, there
>is no plane alignment requirement as such.
>>
>> SIMD code cares about scan lines not only whole planes.
>
>Is it possible to have scan lines aligned correctly but not the planes
>? No. So we should *at least* get the planes right. Which we don't
>right now. On some OS it may lucky enough that allocations are 32
>bytes aligned but that's not the case on Windows if you don't request
>it explicitly.
>
>
>On Wed, Dec 13, 2017 at 9:22 AM, Steve Lhomme <robux4 at gmail.com> wrote:
>> On Tue, Mar 31, 2015 at 11:25 AM, Rémi Denis-Courmont
><remi at remlab.net> wrote:
>>> I doubt that libavcodec has alignment requirement for the whole
>picture.
>>
>> It does. And when SIMD is enabled (so pretty much always) the
>> alignment for all planes must be 32.
>>
>>
>http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=873f39f9bda4f6473035c7e096fbf04331858e73;hb=HEAD#l419
>>
>http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/internal.h;h=30cb9a0de1df41fc4eed4f3cf2084343cdf04227;hb=HEAD#l90
>>
>>> Usually, alignment constraints are on the scan line or possibly on
>the
>>> plane.
>>>
>>> --
>>> Rémi Denis-Courmont
>>>
>>> _______________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

1) My mobile mail client sucks. But as long as professional developers won't leave time (several days) for hobbyists with day jobs to participate before merging, you will have to deal with it.

2) To align scan lines, you need to align the pitch and align the underlying allocation (which may be a plane, a whole picture, or even a whole picture pool).

It is a necessary consequence that planes will be aligned but it is not sufficient, and it is implicit.
-- 
Remi Denis-Courmont


More information about the vlc-devel mailing list