FFmpeg  4.0
Data Structures | Macros | Functions
opencl.h File Reference
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_opencl.h"
#include "libavutil/pixfmt.h"
#include "avfilter.h"

Go to the source code of this file.

Data Structures

struct  OpenCLFilterContext
 

Macros

#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
 

Functions

int ff_opencl_filter_query_formats (AVFilterContext *avctx)
 Return that all inputs and outputs support only AV_PIX_FMT_OPENCL. More...
 
int ff_opencl_filter_config_input (AVFilterLink *inlink)
 Check that the input link contains a suitable hardware frames context and extract the device from it. More...
 
int ff_opencl_filter_config_output (AVFilterLink *outlink)
 Create a suitable hardware frames context for the output. More...
 
int ff_opencl_filter_init (AVFilterContext *avctx)
 Initialise an OpenCL filter context. More...
 
void ff_opencl_filter_uninit (AVFilterContext *avctx)
 Uninitialise an OpenCL filter context. More...
 
int ff_opencl_filter_load_program (AVFilterContext *avctx, const char **program_source_array, int nb_strings)
 Load a new OpenCL program from strings in memory. More...
 
int ff_opencl_filter_load_program_from_file (AVFilterContext *avctx, const char *filename)
 Load a new OpenCL program from a file. More...
 
int ff_opencl_filter_work_size_from_image (AVFilterContext *avctx, size_t *work_size, AVFrame *frame, int plane, int block_alignment)
 Find the work size needed needed for a given plane of an image. More...
 

Macro Definition Documentation

◆ CL_USE_DEPRECATED_OPENCL_1_2_APIS

#define CL_USE_DEPRECATED_OPENCL_1_2_APIS

Definition at line 26 of file opencl.h.

Function Documentation

◆ ff_opencl_filter_query_formats()

int ff_opencl_filter_query_formats ( AVFilterContext avctx)

Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.

Definition at line 31 of file opencl.c.

◆ ff_opencl_filter_config_input()

int ff_opencl_filter_config_input ( AVFilterLink inlink)

Check that the input link contains a suitable hardware frames context and extract the device from it.

Definition at line 63 of file opencl.c.

Referenced by program_opencl_init().

◆ ff_opencl_filter_config_output()

int ff_opencl_filter_config_output ( AVFilterLink outlink)

Create a suitable hardware frames context for the output.

Definition at line 99 of file opencl.c.

Referenced by overlay_opencl_config_output(), and program_opencl_config_output().

◆ ff_opencl_filter_init()

int ff_opencl_filter_init ( AVFilterContext avctx)

Initialise an OpenCL filter context.

Definition at line 150 of file opencl.c.

Referenced by overlay_opencl_init(), and program_opencl_init().

◆ ff_opencl_filter_uninit()

void ff_opencl_filter_uninit ( AVFilterContext avctx)

Uninitialise an OpenCL filter context.

Definition at line 159 of file opencl.c.

Referenced by avgblur_opencl_uninit(), convolution_opencl_uninit(), overlay_opencl_uninit(), program_opencl_uninit(), and unsharp_opencl_uninit().

◆ ff_opencl_filter_load_program()

int ff_opencl_filter_load_program ( AVFilterContext avctx,
const char **  program_source_array,
int  nb_strings 
)

Load a new OpenCL program from strings in memory.

Creates a new program and compiles it for the current device. Will log any build errors if compilation fails.

Definition at line 174 of file opencl.c.

Referenced by avgblur_opencl_init(), convolution_opencl_init(), ff_opencl_filter_load_program_from_file(), overlay_opencl_load(), and unsharp_opencl_init().

◆ ff_opencl_filter_load_program_from_file()

int ff_opencl_filter_load_program_from_file ( AVFilterContext avctx,
const char *  filename 
)

Load a new OpenCL program from a file.

Same as ff_opencl_filter_load_program(), but from a file.

Definition at line 222 of file opencl.c.

Referenced by program_opencl_load().

◆ ff_opencl_filter_work_size_from_image()

int ff_opencl_filter_work_size_from_image ( AVFilterContext avctx,
size_t *  work_size,
AVFrame frame,
int  plane,
int  block_alignment 
)

Find the work size needed needed for a given plane of an image.

Definition at line 281 of file opencl.c.

Referenced by avgblur_opencl_filter_frame(), convolution_opencl_filter_frame(), overlay_opencl_blend(), program_opencl_run(), and unsharp_opencl_filter_frame().