[FFmpeg-devel] [PATCH] doc/filters: add documentation to all existing OpenCL filters, except tonemap filter

mypopy at gmail.com mypopy at gmail.com
Tue Jul 3 06:10:09 EEST 2018


On Tue, Jul 3, 2018 at 10:51 AM Danil Iashchenko <danyaschenko at gmail.com> wrote:
>
> Add documentation to all existing OpenCL filters, except tonemap filter.
>
> ---
> Creation of the seperate section for OpenCL filters is motivated by developing support for Vulkan and CUDA and it is easier to show the capabilities of each platform by adding new sections.
>
>  doc/filters.texi | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 193 insertions(+)
>
> diff --git a/doc/filters.texi b/doc/filters.texi
> index fb5f3ee..3e18e5c 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -5423,6 +5423,7 @@ number in range [5, 129].
>  Set what planes of frame filter will use for averaging. Default is all.
>  @end table
>
> + at anchor{avgblur}
>  @section avgblur
>
>  Apply average blur filter.
> @@ -5715,6 +5716,7 @@ tblend=all_mode=grainextract
>  @end example
>  @end itemize
>
> + at anchor{boxblur}
>  @section boxblur
>
>  Apply a boxblur algorithm to the input video.
> @@ -6551,6 +6553,7 @@ For example to convert the input to SMPTE-240M, use the command:
>  colorspace=smpte240m
>  @end example
>
> + at anchor{convolution}
>  @section convolution
>
>  Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
> @@ -12900,6 +12903,7 @@ By default value 0xf, all planes will be processed.
>  Do not require 2nd input for processing, instead use alpha plane from input stream.
>  @end table
>
> + at anchor{prewitt}
>  @section prewitt
>  Apply prewitt operator to input video stream.
>
> @@ -13591,6 +13595,7 @@ trim=end=5,reverse
>  @end example
>  @end itemize
>
> + at anchor{roberts}
>  @section roberts
>  Apply roberts cross operator to input video stream.
>
> @@ -15176,6 +15181,7 @@ asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
>  @end example
>  @end itemize
>
> + at anchor{sobel}
>  @section sobel
>  Apply sobel operator to input video stream.
>
> @@ -17422,6 +17428,193 @@ pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
>
>  @c man end VIDEO FILTERS
>
> + at chapter OpenCL Video Filters
> + at c man begin OPENCL VIDEO FILTERS
> +
> +Below is a description of the currently available OpenCL video filters.
> +
> +To enable compilation of these filters you need to configure FFmpeg with
> + at code{--enable-opencl}.
> +
> + at section avgblur_opencl
> +
> +Apply average blur filter.
> +
> +Works like existing @ref{avgblur} filter.
> +
> + at subsection Example
> +
> + at itemize
> + at item
> +Apply average blur filter with sizeX and sizeY set to 3
> + at example
> +-i INPUT -filter_complex "hwupload, avgblur_opencl=3, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section boxblur_opencl
> +
> +Apply a boxblur algorithm to the input video.
> +
> +Works like existing @ref{boxblur} filter.
> +
> + at subsection Examples
> +
> + at itemize
> + at item
> +Apply a boxblur filter with the luma, chroma, and alpha radius
> +set to 2:
> + at example
> +-i INPUT -filter_complex "hwupload, boxblur_opencl=luma_radius=2:luma_power=1, hwdownload" OUTPUT
> +-i INPUT -filter_complex "hwupload, boxblur_opencl=2:1, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Set the luma radius to 2, and alpha and chroma radius to 0:
> + at example
> +-i INPUT -filter_complex "hwupload, boxblur_opencl=2:1:cr=0:ar=0, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Set the luma and chroma radius to a fraction of the video dimension:
> + at example
> +-i INPUT -filter_complex "hwupload, boxblur_opencl=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section convolution_opencl
> +
> +Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
> +
> +Works like existing @ref{convolution} filter.
> +
> + at subsection Examples
> +
> + at itemize
> + at item
> +Apply sharpen:
> + at example
> +-i INPUT -filter_complex "hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Apply blur:
> + at example
> +-i INPUT -filter_complex "hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Apply edge enhance:
> + at example
> +-i INPUT -filter_complex "hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Apply edge detect:
> + at example
> +-i INPUT -filter_complex "hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Apply laplacian edge detector which includes diagonals:
> + at example
> +-i INPUT -filter_complex "hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Apply emboss:
> + at example
> +-i INPUT -filter_complex "hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section overlay_opencl
> +
> +Overlay one video on top of another.
> +
> +Works like existing @ref{overlay} filter.
> +
> + at subsection Example
> +
> + at itemize
> + at item
> +Insert a transparent PNG logo in the bottom left corner of the input
> + at example
> +-i INPUT -i LOGO -filter_complex "[0:v]hwupload[a],[1:v]hwupload[b], [a][b]overlay_opencl[out],[out]hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section prewitt_opencl
> +
> +Apply prewitt operator to input video stream.
> +
> +Works like existing @ref{prewitt} filter.
> +
> + at subsection Example
> +
> + at itemize
> + at item
> +Apply prewitt operator with scale set to 2 and delta set to 10
> + at example
> +-i INPUT -filter_complex "hwupload, prewitt_opencl=scale=2:delta=10, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section roberts_opencl
> +Apply roberts cross operator to input video stream.
> +
> +Works like existing @ref{roberts} filter.
> +
> + at subsection Example
> +
> + at itemize
> + at item
> +Apply roberts cross operator with scale set to 2 and delta set to 10
> + at example
> +-i INPUT -filter_complex "hwupload, roberts_opencl=scale=2:delta=10, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section sobel_opencl
> +
> +Apply sobel operator to input video stream.
> +
> +Works like existing @ref{sobel} filter.
> +
> + at subsection Example
> +
> + at itemize
> + at item
> +Apply sobel operator with scale set to 2 and delta set to 10
> + at example
> +-i INPUT -filter_complex "hwupload, sobel_opencl=scale=2:delta=10, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at section unsharp_opencl
> +
> +Sharpen or blur the input video.
> +
> +Works like existing @ref{unsharp} filter.
> +
> + at subsection Examples
> +
> + at itemize
> + at item
> +Apply strong luma sharpen effect:
> + at example
> +-i INPUT -filter_complex "hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload" OUTPUT
> + at end example
> +
> + at item
> +Apply a strong blur of both luma and chroma parameters:
> + at example
> +-i INPUT -filter_complex "hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload" OUTPUT
> + at end example
> + at end itemize
> +
> + at c man end OPENCL VIDEO FILTERS
> +
>  @chapter Video Sources
>  @c man begin VIDEO SOURCES
>
> --
> 2.7.4
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

I like this patch, the other thing, is it have any plan to update
openCL part like VAAPI (https://trac.ffmpeg.org/wiki/Hardware/VAAPI)
in https://trac.ffmpeg.org/wiki/HWAccelIntro, thanks.


More information about the ffmpeg-devel mailing list