[FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL acceleration
highgod0401 at gmail.com
Wed Oct 14 08:44:02 CEST 2015
2015-10-14 14:31 GMT+08:00 Timo Rothenpieler <timo at rothenpieler.org>:
>> I have check the error, for some card, yes, just like what I said above,
>> some cards does not support double type, so we must check the opencl
>> extension: cl_khr_fp64 before the kernel compile. If the device support,
>> we use GPU, else, we use CPU or use float type, Is it OK?
>> Best regards
> Of course, if there's a way to only fall back to floats if doubles are not
> available, that'd be preferable.
A simple idea is that
1. Check whether the device support cl_khr_fp64
2. Set a macro in build option. you can reference the unsharp filter, the
code is as follow:
snprintf(build_opts, 96, "-D LU_RADIUS_X=%d -D LU_RADIUS_Y=%d -D
CH_RADIUS_X=%d -D CH_RADIUS_Y=%d",
unsharp->opencl_ctx.program = av_opencl_compile("unsharp", build_opts);
use the macro to decide whether to use double or float at the compile stage
Do you think it is OK?
More information about the ffmpeg-devel