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

Go to the source code of this file.

Data Structures

struct  ThreadData
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (removegrain)
 
static int query_formats (AVFilterContext *ctx)
 
static int mode01 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int cmp_int (const void *p1, const void *p2)
 
static int mode02 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode03 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode04 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode05 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode06 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode07 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode08 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode09 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode10 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode1112 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode1314 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode1516 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode17 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode18 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode19 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode20 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode21 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode22 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode23 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int mode24 (int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption removegrain_options []
 
static const AVFilterPad removegrain_inputs []
 
static const AVFilterPad removegrain_outputs []
 
AVFilter ff_vf_removegrain
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 34 of file vf_removegrain.c.

◆ FLAGS

Definition at line 35 of file vf_removegrain.c.

◆ REMOVE_GRAIN_SORT_AXIS

#define REMOVE_GRAIN_SORT_AXIS
Value:
const int ma1 = FFMAX(a1, a8); \
const int mi1 = FFMIN(a1, a8); \
const int ma2 = FFMAX(a2, a7); \
const int mi2 = FFMIN(a2, a7); \
const int ma3 = FFMAX(a3, a6); \
const int mi3 = FFMIN(a3, a6); \
const int ma4 = FFMAX(a4, a5); \
const int mi4 = FFMIN(a4, a5);
#define a1
Definition: regdef.h:47
#define a3
Definition: regdef.h:49
#define FFMAX(a, b)
Definition: common.h:94
#define FFMIN(a, b)
Definition: common.h:96
#define a2
Definition: regdef.h:48
#define a5
Definition: regdef.h:51
#define a4
Definition: regdef.h:50

Definition at line 66 of file vf_removegrain.c.

Referenced by mode05(), mode06(), mode07(), mode08(), mode09(), mode17(), mode23(), and mode24().

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( removegrain  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 47 of file vf_removegrain.c.

◆ mode01()

static int mode01 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 76 of file vf_removegrain.c.

Referenced by config_input().

◆ cmp_int()

static int cmp_int ( const void p1,
const void p2 
)
static

Definition at line 84 of file vf_removegrain.c.

Referenced by mode02(), mode03(), and mode04().

◆ mode02()

static int mode02 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 91 of file vf_removegrain.c.

Referenced by config_input().

◆ mode03()

static int mode03 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 100 of file vf_removegrain.c.

Referenced by config_input().

◆ mode04()

static int mode04 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 109 of file vf_removegrain.c.

Referenced by config_input().

◆ mode05()

static int mode05 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 118 of file vf_removegrain.c.

Referenced by config_input().

◆ mode06()

static int mode06 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 141 of file vf_removegrain.c.

Referenced by config_input().

◆ mode07()

static int mode07 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 173 of file vf_removegrain.c.

Referenced by config_input().

◆ mode08()

static int mode08 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 205 of file vf_removegrain.c.

Referenced by config_input().

◆ mode09()

static int mode09 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 237 of file vf_removegrain.c.

Referenced by config_input().

◆ mode10()

static int mode10 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 259 of file vf_removegrain.c.

Referenced by config_input().

◆ mode1112()

static int mode1112 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 284 of file vf_removegrain.c.

Referenced by config_input().

◆ mode1314()

static int mode1314 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 292 of file vf_removegrain.c.

Referenced by config_input().

◆ mode1516()

static int mode1516 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 310 of file vf_removegrain.c.

Referenced by config_input().

◆ mode17()

static int mode17 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 329 of file vf_removegrain.c.

Referenced by config_input().

◆ mode18()

static int mode18 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 339 of file vf_removegrain.c.

Referenced by config_input().

◆ mode19()

static int mode19 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 361 of file vf_removegrain.c.

Referenced by config_input().

◆ mode20()

static int mode20 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 369 of file vf_removegrain.c.

Referenced by config_input().

◆ mode21()

static int mode21 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 377 of file vf_removegrain.c.

Referenced by config_input().

◆ mode22()

static int mode22 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 395 of file vf_removegrain.c.

Referenced by config_input().

◆ mode23()

static int mode23 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 408 of file vf_removegrain.c.

Referenced by config_input().

◆ mode24()

static int mode24 ( int  c,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8 
)
static

Definition at line 432 of file vf_removegrain.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 466 of file vf_removegrain.c.

◆ filter_slice()

static int filter_slice ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 523 of file vf_removegrain.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 591 of file vf_removegrain.c.

Variable Documentation

◆ removegrain_options

const AVOption removegrain_options[]
static
Initial value:
= {
{ "m0", "set mode for 1st plane", OFFSET(mode[0]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
{ "m1", "set mode for 2nd plane", OFFSET(mode[1]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
{ "m2", "set mode for 3rd plane", OFFSET(mode[2]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
{ "m3", "set mode for 4th plane", OFFSET(mode[3]), AV_OPT_TYPE_INT, {.i64=0}, 0, 24, FLAGS },
{NULL}
}
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)
mode
Use these values in ebur128_init (or'ed).
Definition: ebur128.h:83

Definition at line 37 of file vf_removegrain.c.

◆ removegrain_inputs

const AVFilterPad removegrain_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)

Definition at line 633 of file vf_removegrain.c.

◆ removegrain_outputs

const AVFilterPad removegrain_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 643 of file vf_removegrain.c.

◆ ff_vf_removegrain

AVFilter ff_vf_removegrain
Initial value:
= {
.name = "removegrain",
.description = NULL_IF_CONFIG_SMALL("Remove grain."),
.priv_size = sizeof(RemoveGrainContext),
.priv_class = &removegrain_class,
}
#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
static int flags
Definition: log.c:55
static int query_formats(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad removegrain_inputs[]
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad removegrain_outputs[]

Definition at line 651 of file vf_removegrain.c.