FFmpeg
Data Structures | Macros | Functions | Variables
vf_gblur.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "gblur.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

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

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (gblur)
 
static void horiz_slice_c (float *buffer, int width, int height, int steps, float nu, float bscale)
 
static int filter_horizontally (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void do_vertical_columns (float *buffer, int width, int height, int column_begin, int column_end, int steps, float nu, float boundaryscale, int column_step)
 
static int filter_vertically (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_postscale (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static void gaussianiir2d (AVFilterContext *ctx, int plane)
 
static int query_formats (AVFilterContext *ctx)
 
void ff_gblur_init (GBlurContext *s)
 
static int config_input (AVFilterLink *inlink)
 
static void set_params (float sigma, int steps, float *postscale, float *boundaryscale, float *nu)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption gblur_options []
 
static const AVFilterPad gblur_inputs []
 
static const AVFilterPad gblur_outputs []
 
AVFilter ff_vf_gblur
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 37 of file vf_gblur.c.

◆ FLAGS

Definition at line 38 of file vf_gblur.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( gblur  )

◆ horiz_slice_c()

static void horiz_slice_c ( float *  buffer,
int  width,
int  height,
int  steps,
float  nu,
float  bscale 
)
static

Definition at line 55 of file vf_gblur.c.

Referenced by ff_gblur_init().

◆ filter_horizontally()

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

Definition at line 77 of file vf_gblur.c.

Referenced by gaussianiir2d().

◆ do_vertical_columns()

static void do_vertical_columns ( float *  buffer,
int  width,
int  height,
int  column_begin,
int  column_end,
int  steps,
float  nu,
float  boundaryscale,
int  column_step 
)
static

Definition at line 96 of file vf_gblur.c.

Referenced by filter_vertically().

◆ filter_vertically()

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

Definition at line 130 of file vf_gblur.c.

Referenced by gaussianiir2d().

◆ filter_postscale()

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

Definition at line 156 of file vf_gblur.c.

Referenced by gaussianiir2d().

◆ gaussianiir2d()

static void gaussianiir2d ( AVFilterContext ctx,
int  plane 
)
static

Definition at line 175 of file vf_gblur.c.

Referenced by filter_frame().

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 193 of file vf_gblur.c.

◆ ff_gblur_init()

void ff_gblur_init ( GBlurContext s)

Definition at line 219 of file vf_gblur.c.

Referenced by checkasm_check_vf_gblur(), and config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 226 of file vf_gblur.c.

◆ set_params()

static void set_params ( float  sigma,
int  steps,
float *  postscale,
float *  boundaryscale,
float *  nu 
)
static

Definition at line 251 of file vf_gblur.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 262 of file vf_gblur.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 347 of file vf_gblur.c.

Variable Documentation

◆ gblur_options

const AVOption gblur_options[]
static
Initial value:
= {
{ "sigma", "set sigma", OFFSET(sigma), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0.0, 1024, FLAGS },
{ "steps", "set number of steps", OFFSET(steps), AV_OPT_TYPE_INT, {.i64=1}, 1, 6, FLAGS },
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ "sigmaV", "set vertical sigma", OFFSET(sigmaV), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 1024, FLAGS },
{ NULL }
}

Definition at line 40 of file vf_gblur.c.

◆ gblur_inputs

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

Definition at line 354 of file vf_gblur.c.

◆ gblur_outputs

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

Definition at line 364 of file vf_gblur.c.

◆ ff_vf_gblur

AVFilter ff_vf_gblur
Initial value:
= {
.name = "gblur",
.description = NULL_IF_CONFIG_SMALL("Apply Gaussian Blur filter."),
.priv_size = sizeof(GBlurContext),
.priv_class = &gblur_class,
}

Definition at line 372 of file vf_gblur.c.

uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_gblur.c:347
OFFSET
#define OFFSET(x)
Definition: vf_gblur.c:37
gblur_inputs
static const AVFilterPad gblur_inputs[]
Definition: vf_gblur.c:354
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
FLAGS
#define FLAGS
Definition: vf_gblur.c:38
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_gblur.c:226
gblur_outputs
static const AVFilterPad gblur_outputs[]
Definition: vf_gblur.c:364
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
planes
static const struct @314 planes[]
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:188
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:125
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:226
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_gblur.c:262
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_gblur.c:193
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:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
GBlurContext
Definition: gblur.h:32
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565