Data Structures | Macros | Functions | Variables
vf_nlmeans_opencl.c File Reference
#include <float.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.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  NLMeansOpenCLContext


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


static int is_format_supported (enum AVPixelFormat fmt)
static int nlmeans_opencl_init (AVFilterContext *avctx, int width, int height)
static int nlmeans_plane (AVFilterContext *avctx, cl_mem dst, cl_mem src, cl_int width, cl_int height, cl_int p, cl_int r)
static int nlmeans_opencl_filter_frame (AVFilterLink *inlink, AVFrame *input)
static av_cold void nlmeans_opencl_uninit (AVFilterContext *avctx)
 AVFILTER_DEFINE_CLASS (nlmeans_opencl)


static enum AVPixelFormat supported_formats []
static const AVOption nlmeans_opencl_options []
static const AVFilterPad nlmeans_opencl_inputs []
static const AVFilterPad nlmeans_opencl_outputs []
AVFilter ff_vf_nlmeans_opencl

Macro Definition Documentation

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

Definition at line 400 of file vf_nlmeans_opencl.c.

Definition at line 401 of file vf_nlmeans_opencl.c.

Function Documentation

static int is_format_supported ( enum AVPixelFormat  fmt)

Definition at line 42 of file vf_nlmeans_opencl.c.

Referenced by nlmeans_opencl_filter_frame().

static int nlmeans_opencl_init ( AVFilterContext avctx,
int  width,
int  height 

Definition at line 74 of file vf_nlmeans_opencl.c.

Referenced by nlmeans_opencl_filter_frame().

static int nlmeans_plane ( AVFilterContext avctx,
cl_mem  dst,
cl_mem  src,
cl_int  width,
cl_int  height,
cl_int  p,
cl_int  r 

Definition at line 170 of file vf_nlmeans_opencl.c.

Referenced by nlmeans_opencl_filter_frame().

static int nlmeans_opencl_filter_frame ( AVFilterLink inlink,
AVFrame input 

Definition at line 286 of file vf_nlmeans_opencl.c.

static av_cold void nlmeans_opencl_uninit ( AVFilterContext avctx)

Definition at line 380 of file vf_nlmeans_opencl.c.

AVFILTER_DEFINE_CLASS ( nlmeans_opencl  )

Variable Documentation

enum AVPixelFormat supported_formats[]
Initial value:
= {
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66

Definition at line 36 of file vf_nlmeans_opencl.c.

Referenced by is_format_supported().

const AVOption nlmeans_opencl_options[]
Initial value:
= {
{ "s", "denoising strength", OFFSET(sigma), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, 1.0, 30.0, FLAGS },
{ "p", "patch size", OFFSET(patch_size), AV_OPT_TYPE_INT, { .i64 = 2*3+1 }, 0, 99, FLAGS },
{ "pc", "patch size for chroma planes", OFFSET(patch_size_uv), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 99, FLAGS },
{ "r", "research window", OFFSET(research_size), AV_OPT_TYPE_INT, { .i64 = 7*2+1 }, 0, 99, FLAGS },
{ "rc", "research window for chroma planes", OFFSET(research_size_uv), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 99, FLAGS },
{ NULL }
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)

Definition at line 402 of file vf_nlmeans_opencl.c.

const AVFilterPad nlmeans_opencl_inputs[]
Initial value:
= {
.name = "default",
.filter_frame = &nlmeans_opencl_filter_frame,
{ 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:60
static int nlmeans_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)

Definition at line 413 of file vf_nlmeans_opencl.c.

const AVFilterPad nlmeans_opencl_outputs[]
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:96

Definition at line 423 of file vf_nlmeans_opencl.c.

AVFilter ff_vf_nlmeans_opencl
Initial value:
= {
.name = "nlmeans_opencl",
.description = NULL_IF_CONFIG_SMALL("Non-local means denoiser through OpenCL"),
.priv_size = sizeof(NLMeansOpenCLContext),
.priv_class = &nlmeans_opencl_class,
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:339
int ff_opencl_filter_query_formats(AVFilterContext *avctx)
Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
Definition: opencl.c:28
static const AVFilterPad nlmeans_opencl_outputs[]
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
int ff_opencl_filter_init(AVFilterContext *avctx)
Initialise an OpenCL filter context.
Definition: opencl.c:147
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:117
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
static const AVFilterPad nlmeans_opencl_inputs[]
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold void nlmeans_opencl_uninit(AVFilterContext *avctx)
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244

Definition at line 432 of file vf_nlmeans_opencl.c.