[FFmpeg-devel] [PATCH 1/3] Add clew.c & clew.h to libavutil

Gupta, Maneesh Maneesh.Gupta at amd.com
Fri Feb 6 11:09:14 CET 2015

Hi All,

There are several issues with the way ffmpeg compilation works when OpenCL is enabled using --enable-opencl. Chief among them are:
1. One needs to also use --extra-cflags, --extra-ldflags & -extra-libs to specify the path to the OpenCL header and library files. Otherwise configure fails.
2. ffmpeg currently requires OpenCL 1.2, but the build system may have another version installed (such as the newer OpenCL 2.0 which has deprecated some 1.2 APIs).

There are a couple of ways to address this.

* One way is the x264 approach which is to bundle cl.h, cl_platform.h and a wrapper c file which relies on dynamically loading OpenCL rather than using static linking. This requires modifications to the entire OpenCL based code since we cannot use the OpenCL APIs directly.
* Another approach taken by LibreOffice and Blender for example is to use clew (i.e. The OpenCL Extension Wrangler Library). This has the advantage of letting us use the OpenCL APIs directly yet at the same time relying on dynamically loading OpenCL. The clew project is hosted at https://github.com/OpenCLWrangler/clew. This is maintained by two people (Sergey and Martijn).
Usage of clew in Libreoffice can be seen @ http://cgit.freedesktop.org/libreoffice/core/tree/clew/source and in Blender @ https://git.blender.org/gitweb/gitweb.cgi/blender.git/tree/HEAD:/extern/clew.

This patch is for adding clew to the ffmpeg tree. The subsequent patches switch the OpenCL code in ffmpeg from using cl.h to using clew.

Maneesh Gupta

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-clew.c-clew.h-to-libavutil.patch
Type: application/octet-stream
Size: 150819 bytes
Desc: 0001-Add-clew.c-clew.h-to-libavutil.patch
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150206/251feb64/attachment.obj>

More information about the ffmpeg-devel mailing list