FFmpeg
Loading...
Searching...
No Matches
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 "filters.h"
#include "framesync.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)
 
#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 FFFilter ff_vf_remap_opencl
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

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 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, .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 }
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322
interp
Definition vf_curves.c:62

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",
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
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:46

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,
},
}
static int config_output(AVBitStreamFilterLink *outlink)

Definition at line 334 of file vf_remap_opencl.c.

◆ ff_vf_remap_opencl

const FFFilter ff_vf_remap_opencl
Initial value:
= {
.p.name = "remap_opencl",
.p.description = NULL_IF_CONFIG_SMALL("Remap pixels using OpenCL."),
.p.priv_class = &remap_opencl_class,
.priv_size = sizeof(RemapOpenCLContext),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition filters.h:208
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition pixfmt.h:358
static av_cold int remap_opencl_init(AVFilterContext *avctx)
static const AVFilterPad remap_opencl_inputs[]
static const AVFilterPad remap_opencl_outputs[]
static av_cold void remap_opencl_uninit(AVFilterContext *avctx)

Definition at line 342 of file vf_remap_opencl.c.