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

Clément Bœsch u at pkh.me
Sat Sep 2 21:29:43 EEST 2017


On Sat, Sep 02, 2017 at 02:07:01PM -0300, James Almer wrote:
[...]
> +size_t av_cpu_max_align(void)
> +{
> +    int av_unused flags = av_get_cpu_flags();
> +
> +#if ARCH_ARM || ARCH_AARCH64
> +    if (flags & AV_CPU_FLAG_NEON)
> +        return 16;
> +#elif ARCH_PPC
> +    if (flags & AV_CPU_FLAG_ALTIVEC)
> +        return 16;

> +#elif ARCH_X86
> +    if (flags & AV_CPU_FLAG_AVX)
> +        return 32;
> +    if (flags & AV_CPU_FLAG_SSE)
> +        return 16;
> +#endif

mmh, will this really work in FFmpeg? I think we have a difference related
to the flags dependency. Typically, if having SSE2 doesn't imply you have
SSE. I think you may want to extend the mask.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170902/c3c3f2c4/attachment.sig>


More information about the ffmpeg-devel mailing list