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

◆ FLAGS

Definition at line 50 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 62 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 69 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 132 of file vf_remap_opencl.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 231 of file vf_remap_opencl.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 286 of file vf_remap_opencl.c.

◆ remap_opencl_uninit()

static av_cold void remap_opencl_uninit ( AVFilterContext avctx)
static

Definition at line 292 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, "interp" },
{ "near", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "interp" },
{ "linear", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "interp" },
{ "fill", "set the color of the unmapped pixels", OFFSET(fill_rgba), AV_OPT_TYPE_COLOR, {.str="black"}, .flags = FLAGS },
{ NULL }
}

Definition at line 52 of file vf_remap_opencl.c.

◆ kernels

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

Definition at line 67 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 316 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 334 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 342 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:370
activate
static int activate(AVFilterContext *ctx)
Definition: vf_remap_opencl.c:286
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_remap_opencl.c:231
init
static int init
Definition: av_tx.c:47
FLAGS
#define FLAGS
Definition: vf_remap_opencl.c:50
RemapOpenCLContext
Definition: vf_remap_opencl.c:34
OFFSET
#define OFFSET(x)
Definition: vf_remap_opencl.c:49
remap_opencl_uninit
static av_cold void remap_opencl_uninit(AVFilterContext *avctx)
Definition: vf_remap_opencl.c:292
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:240
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:327
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:117
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:180
remap_opencl_inputs
static const AVFilterPad remap_opencl_inputs[]
Definition: vf_remap_opencl.c:316
remap_opencl_outputs
static const AVFilterPad remap_opencl_outputs[]
Definition: vf_remap_opencl.c:334
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
remap_opencl_init
static av_cold int remap_opencl_init(AVFilterContext *avctx)
Definition: vf_remap_opencl.c:62
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234