[FFmpeg-devel] [PATCH v2] cpu: add a function for querying maximum required data alignment

James Almer jamrial at gmail.com
Thu Sep 28 04:26:48 EEST 2017

On 9/27/2017 9:59 PM, wm4 wrote:
> On Wed, 27 Sep 2017 21:37:54 -0300
> James Almer <jamrial at gmail.com> wrote:
>>> API users can rely on it. So you better make sure that can't break.
>>> Other aspects don't really matter.  
>> What do you mean with this? Do i apply it or not? The function will
>> return a value based on runtime cpuflags. The value is guaranteed to be
>> correct, but how the user uses it is beyond our control.
> If the user uses the return value of the API to align pointers, and
> then passes these pointers to ffmpeg functions that process data, they
> must not crash or exhibit low performance. Or in other words, the
> alignment returned by the function must be high enough. At least as
> long as the global CPU flags are not changed afterwards.
> So if this is correct, I see no reason not to apply this patch?
> I'm not sure if your question was only about this patch, or potentially
> later Libav commits that need to be merged.

Yes, i mentioned there's a commit after this one that makes use of the
function internally, which based on the above (global CPU flags can be
changed by the user), should probably not be applied in favor of keeping
the current safe hardcoded STRIDE value.

My question was, since it will not be used by ffmpeg itself, does it
make sense adding it? You argued that yes (users may have use for it),
so I'll merge it.

More information about the ffmpeg-devel mailing list