FFmpeg
Data Structures | Macros | Functions | Variables
vf_yaepblur.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  YAEPContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define PRE_CALCULATE_ROW(type, name)
 
#define FILTER_SLICE(type, name)
 
#define OFFSET(x)   offsetof(YAEPContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int pre_calculate_col (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
 AVFILTER_DEFINE_CLASS (yaepblur)
 

Variables

static const AVFilterPad yaep_inputs []
 
static const AVFilterPad yaep_outputs []
 
static const AVOption yaepblur_options []
 
const AVFilter ff_vf_yaepblur
 

Detailed Description

yaep(yet another edge preserving) blur filter

This implementation is based on an algorithm described in "J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980."

Definition in file vf_yaepblur.c.

Macro Definition Documentation

◆ PRE_CALCULATE_ROW

#define PRE_CALCULATE_ROW (   type,
  name 
)

Definition at line 98 of file vf_yaepblur.c.

◆ FILTER_SLICE

#define FILTER_SLICE (   type,
  name 
)

Definition at line 165 of file vf_yaepblur.c.

◆ OFFSET

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

Definition at line 323 of file vf_yaepblur.c.

◆ FLAGS

Definition at line 324 of file vf_yaepblur.c.

Function Documentation

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 55 of file vf_yaepblur.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 62 of file vf_yaepblur.c.

◆ pre_calculate_col()

static int pre_calculate_col ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 135 of file vf_yaepblur.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 220 of file vf_yaepblur.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 270 of file vf_yaepblur.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( yaepblur  )

Variable Documentation

◆ yaep_inputs

const AVFilterPad yaep_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 305 of file vf_yaepblur.c.

◆ yaep_outputs

const AVFilterPad yaep_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 315 of file vf_yaepblur.c.

◆ yaepblur_options

const AVOption yaepblur_options[]
static
Initial value:
= {
{ "radius", "set window radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=3}, 0, INT_MAX, .flags=FLAGS },
{ "r" , "set window radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=3}, 0, INT_MAX, .flags=FLAGS },
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=1}, 0, 0xF, .flags=FLAGS },
{ "p", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=1}, 0, 0xF, .flags=FLAGS },
{ "sigma", "set blur strength", OFFSET(sigma), AV_OPT_TYPE_INT, {.i64=128}, 1, INT_MAX, .flags=FLAGS },
{ "s", "set blur strength", OFFSET(sigma), AV_OPT_TYPE_INT, {.i64=128}, 1, INT_MAX, .flags=FLAGS },
{ NULL }
}

Definition at line 326 of file vf_yaepblur.c.

◆ ff_vf_yaepblur

const AVFilter ff_vf_yaepblur
Initial value:
= {
.name = "yaepblur",
.description = NULL_IF_CONFIG_SMALL("Yet another edge preserving blur filter."),
.priv_size = sizeof(YAEPContext),
.priv_class = &yaepblur_class,
}

Definition at line 338 of file vf_yaepblur.c.

yaep_outputs
static const AVFilterPad yaep_outputs[]
Definition: vf_yaepblur.c:315
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_yaepblur.c:220
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_yaepblur.c:62
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_yaepblur.c:270
yaep_inputs
static const AVFilterPad yaep_inputs[]
Definition: vf_yaepblur.c:305
YAEPContext
Definition: vf_yaepblur.c:35
inputs
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
Definition: filter_design.txt:243
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
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
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:336
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yaepblur.c:55
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:842
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:126
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
planes
static const struct @322 planes[]
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
OFFSET
#define OFFSET(x)
Definition: vf_yaepblur.c:323
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
FLAGS
#define FLAGS
Definition: vf_yaepblur.c:324