FFmpeg
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
 Used for passing data between threads. More...
 

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);

Definition at line 66 of file vf_removegrain.c.

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}
}

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 }
}

Definition at line 633 of file vf_removegrain.c.

◆ removegrain_outputs

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

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,
}

Definition at line 651 of file vf_removegrain.c.

a1
#define a1
Definition: regdef.h:47
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_removegrain.c:591
removegrain_inputs
static const AVFilterPad removegrain_inputs[]
Definition: vf_removegrain.c:633
RemoveGrainContext
Definition: removegrain.h:27
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_removegrain.c:47
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
a4
#define a4
Definition: regdef.h:50
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_removegrain.c:34
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:188
FFMAX
#define FFMAX(a, b)
Definition: common.h:94
FFMIN
#define FFMIN(a, b)
Definition: common.h:96
FLAGS
#define FLAGS
Definition: vf_removegrain.c:35
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
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_removegrain.c:466
a2
#define a2
Definition: regdef.h:48
removegrain_outputs
static const AVFilterPad removegrain_outputs[]
Definition: vf_removegrain.c:643
a5
#define a5
Definition: regdef.h:51
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
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
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
a3
#define a3
Definition: regdef.h:49