FFmpeg
Data Structures | Macros | Functions | Variables
vf_gblur.c File Reference
#include <float.h>
#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|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (gblur)
 
static void postscale_c (float *buffer, int length, float postscale, float min, float max)
 
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 39 of file vf_gblur.c.

◆ FLAGS

Definition at line 40 of file vf_gblur.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( gblur  )

◆ postscale_c()

static void postscale_c ( float *  buffer,
int  length,
float  postscale,
float  min,
float  max 
)
static

Definition at line 57 of file vf_gblur.c.

Referenced by ff_gblur_init().

◆ horiz_slice_c()

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

Definition at line 66 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 88 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 107 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 141 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 166 of file vf_gblur.c.

Referenced by gaussianiir2d().

◆ gaussianiir2d()

static void gaussianiir2d ( AVFilterContext ctx,
int  plane 
)
static

Definition at line 186 of file vf_gblur.c.

Referenced by filter_frame().

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 204 of file vf_gblur.c.

◆ ff_gblur_init()

void ff_gblur_init ( GBlurContext s)

Definition at line 233 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 241 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 267 of file vf_gblur.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 278 of file vf_gblur.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 371 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 42 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 378 of file vf_gblur.c.

◆ gblur_outputs

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

Definition at line 388 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 396 of file vf_gblur.c.

uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_gblur.c:371
OFFSET
#define OFFSET(x)
Definition: vf_gblur.c:39
gblur_inputs
static const AVFilterPad gblur_inputs[]
Definition: vf_gblur.c:378
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
FLAGS
#define FLAGS
Definition: vf_gblur.c:40
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_gblur.c:241
gblur_outputs
static const AVFilterPad gblur_outputs[]
Definition: vf_gblur.c:388
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
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
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:882
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_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_gblur.c:278
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_gblur.c:204
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
GBlurContext
Definition: gblur.h:32
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561