FFmpeg
Data Structures | Macros | Functions | Variables
vf_remap_opencl.c File Reference
#include "libavutil/colorspace.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "drawutils.h"
#include "framesync.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  RemapOpenCLContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (remap_opencl)
 
static av_cold int remap_opencl_init (AVFilterContext *avctx)
 
static int remap_opencl_load (AVFilterContext *avctx, enum AVPixelFormat main_format, enum AVPixelFormat xmap_format, enum AVPixelFormat ymap_format)
 
static int remap_opencl_process_frame (FFFrameSync *fs)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void remap_opencl_uninit (AVFilterContext *avctx)
 

Variables

static const AVOption remap_opencl_options []
 
static const char * kernels [] = { "remap_near", "remap_linear" }
 
static const AVFilterPad remap_opencl_inputs []
 
static const AVFilterPad remap_opencl_outputs []
 
const AVFilter ff_vf_remap_opencl
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 47 of file vf_remap_opencl.c.

◆ FLAGS

Definition at line 48 of file vf_remap_opencl.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( remap_opencl  )

◆ remap_opencl_init()

static av_cold int remap_opencl_init ( AVFilterContext avctx)
static

Definition at line 60 of file vf_remap_opencl.c.

◆ remap_opencl_load()

static int remap_opencl_load ( AVFilterContext avctx,
enum AVPixelFormat  main_format,
enum AVPixelFormat  xmap_format,
enum AVPixelFormat  ymap_format 
)
static

Definition at line 67 of file vf_remap_opencl.c.

Referenced by remap_opencl_process_frame().

◆ remap_opencl_process_frame()

static int remap_opencl_process_frame ( FFFrameSync fs)
static

Definition at line 130 of file vf_remap_opencl.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 229 of file vf_remap_opencl.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 284 of file vf_remap_opencl.c.

◆ remap_opencl_uninit()

static av_cold void remap_opencl_uninit ( AVFilterContext avctx)
static

Definition at line 290 of file vf_remap_opencl.c.

Variable Documentation

◆ remap_opencl_options

const AVOption remap_opencl_options[]
static
Initial value:
= {
{ "interp", "set interpolation method", OFFSET(interp), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, .unit = "interp" },
{ "near", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, .unit = "interp" },
{ "linear", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, .unit = "interp" },
{ "fill", "set the color of the unmapped pixels", OFFSET(fill_rgba), AV_OPT_TYPE_COLOR, {.str="black"}, .flags = FLAGS },
{ NULL }
}

Definition at line 50 of file vf_remap_opencl.c.

◆ kernels

const char* kernels[] = { "remap_near", "remap_linear" }
static

Definition at line 65 of file vf_remap_opencl.c.

Referenced by remap_opencl_load().

◆ remap_opencl_inputs

const AVFilterPad remap_opencl_inputs[]
static
Initial value:
= {
{
.name = "source",
},
{
.name = "xmap",
},
{
.name = "ymap",
},
}

Definition at line 314 of file vf_remap_opencl.c.

◆ remap_opencl_outputs

const AVFilterPad remap_opencl_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}

Definition at line 332 of file vf_remap_opencl.c.

◆ ff_vf_remap_opencl

const AVFilter ff_vf_remap_opencl
Initial value:
= {
.name = "remap_opencl",
.description = NULL_IF_CONFIG_SMALL("Remap pixels using OpenCL."),
.priv_size = sizeof(RemapOpenCLContext),
.priv_class = &remap_opencl_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 340 of file vf_remap_opencl.c.

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:351
activate
static int activate(AVFilterContext *ctx)
Definition: vf_remap_opencl.c:284
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_remap_opencl.c:229
FLAGS
#define FLAGS
Definition: vf_remap_opencl.c:48
interp
interp
Definition: vf_curves.c:61
RemapOpenCLContext
Definition: vf_remap_opencl.c:32
OFFSET
#define OFFSET(x)
Definition: vf_remap_opencl.c:47
remap_opencl_uninit
static av_cold void remap_opencl_uninit(AVFilterContext *avctx)
Definition: vf_remap_opencl.c:290
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:250
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:358
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:138
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: opencl.c:45
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:172
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
remap_opencl_inputs
static const AVFilterPad remap_opencl_inputs[]
Definition: vf_remap_opencl.c:314
remap_opencl_outputs
static const AVFilterPad remap_opencl_outputs[]
Definition: vf_remap_opencl.c:332
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
remap_opencl_init
static av_cold int remap_opencl_init(AVFilterContext *avctx)
Definition: vf_remap_opencl.c:60
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244