FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_convolution_opencl.c File Reference
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "avfilter.h"
#include "internal.h"
#include "opencl.h"
#include "opencl_source.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ConvolutionOpenCLContext
 

Macros

#define OFFSET(x)   offsetof(ConvolutionOpenCLContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static int convolution_opencl_init (AVFilterContext *avctx)
 
static int convolution_opencl_make_filter_params (AVFilterContext *avctx)
 
static int convolution_opencl_filter_frame (AVFilterLink *inlink, AVFrame *input)
 
static av_cold void convolution_opencl_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (convolution_opencl)
 

Variables

static const AVOption convolution_opencl_options []
 
static const AVFilterPad convolution_opencl_inputs []
 
static const AVFilterPad convolution_opencl_outputs []
 
AVFilter ff_vf_convolution_opencl
 

Macro Definition Documentation

#define OFFSET (   x)    offsetof(ConvolutionOpenCLContext, x)

Definition at line 318 of file vf_convolution_opencl.c.

Definition at line 319 of file vf_convolution_opencl.c.

Function Documentation

static int convolution_opencl_init ( AVFilterContext avctx)
static

Definition at line 53 of file vf_convolution_opencl.c.

Referenced by convolution_opencl_filter_frame().

static int convolution_opencl_make_filter_params ( AVFilterContext avctx)
static

Definition at line 93 of file vf_convolution_opencl.c.

Referenced by convolution_opencl_filter_frame().

static int convolution_opencl_filter_frame ( AVFilterLink inlink,
AVFrame input 
)
static

Definition at line 166 of file vf_convolution_opencl.c.

static av_cold void convolution_opencl_uninit ( AVFilterContext avctx)
static

Definition at line 291 of file vf_convolution_opencl.c.

AVFILTER_DEFINE_CLASS ( convolution_opencl  )

Variable Documentation

const AVOption convolution_opencl_options[]
static
Initial value:
= {
{ "0m", "set matrix for 2nd plane", OFFSET(matrix_str[0]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "1m", "set matrix for 2nd plane", OFFSET(matrix_str[1]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "2m", "set matrix for 3rd plane", OFFSET(matrix_str[2]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "3m", "set matrix for 4th plane", OFFSET(matrix_str[3]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "0rdiv", "set rdiv for 1nd plane", OFFSET(rdivs[0]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "1rdiv", "set rdiv for 2nd plane", OFFSET(rdivs[1]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "2rdiv", "set rdiv for 3rd plane", OFFSET(rdivs[2]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "3rdiv", "set rdiv for 4th plane", OFFSET(rdivs[3]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "0bias", "set bias for 1st plane", OFFSET(biases[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ "1bias", "set bias for 2nd plane", OFFSET(biases[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ "2bias", "set bias for 3rd plane", OFFSET(biases[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ "3bias", "set bias for 4th plane", OFFSET(biases[3]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)

Definition at line 320 of file vf_convolution_opencl.c.

const AVFilterPad convolution_opencl_inputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
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: opencl.c:63
static int convolution_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)

Definition at line 338 of file vf_convolution_opencl.c.

const AVFilterPad convolution_opencl_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
int ff_opencl_filter_config_output(AVFilterLink *outlink)
Create a suitable hardware frames context for the output.
Definition: opencl.c:99

Definition at line 348 of file vf_convolution_opencl.c.

AVFilter ff_vf_convolution_opencl
Initial value:
= {
.name = "convolution_opencl",
.description = NULL_IF_CONFIG_SMALL("Apply convolution mask to input video"),
.priv_size = sizeof(ConvolutionOpenCLContext),
.priv_class = &convolution_opencl_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:385
int ff_opencl_filter_query_formats(AVFilterContext *avctx)
Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
Definition: opencl.c:31
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
int ff_opencl_filter_init(AVFilterContext *avctx)
Initialise an OpenCL filter context.
Definition: opencl.c:150
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold void convolution_opencl_uninit(AVFilterContext *avctx)
static const AVFilterPad convolution_opencl_outputs[]
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
static const AVFilterPad convolution_opencl_inputs[]

Definition at line 357 of file vf_convolution_opencl.c.