lavfi: add opencl tonemap filter

Multimedia / FFmpeg - Ruiling Song [intel.com] - 21 June 2018 00:19 EDT

This filter does HDR(HDR10/HLG) to SDR conversion with tone-mapping.

An example command to use this filter with vaapi codecs: FFMPEG -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device \ opencl=ocl@va -hwaccel vaapi -hwaccel_device va -hwaccel_output_format \
vaapi -i INPUT -filter_hw_device ocl -filter_complex \ '[0:v]hwmap,tonemap_opencl=t=bt2020:tonemap=linear:format=p010[x1]; \ [x1]hwmap=derive_device=vaapi:reverse=1' -c:v hevc_vaapi -profile 2 OUTPUT

8b8b0e2cd2 lavfi: add opencl tonemap filter
configure | 1 +
libavfilter/Makefile | 2 +
libavfilter/allfilters.c | 1 +
libavfilter/colorspace.c | 90 +++++
libavfilter/colorspace.h | 41 +++
libavfilter/opencl/colorspace_common.cl | 220 +++++++++++
libavfilter/opencl/tonemap.cl | 272 ++++++++++++++
libavfilter/opencl_source.h | 2 +
libavfilter/vf_tonemap_opencl.c | 624 ++++++++++++++++++++++++++++++++
9 files changed, 1253 insertions(+)

  • Share