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

Go to the source code of this file.

Data Structures

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

Macros

#define FF_BUFQUEUE_SIZE   129
 
#define SIZE   FF_BUFQUEUE_SIZE
 
#define OFFSET(x)   offsetof(ATADenoiseContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (atadenoise)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int filter_slice8 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption atadenoise_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_atadenoise
 

Detailed Description

Adaptive Temporal Averaging Denoiser, based on paper "Video Denoising Based on Adaptive Temporal Averaging" by David Bartovčak and Miroslav Vrankić

Definition in file vf_atadenoise.c.

Macro Definition Documentation

◆ FF_BUFQUEUE_SIZE

#define FF_BUFQUEUE_SIZE   129

Definition at line 33 of file vf_atadenoise.c.

◆ SIZE

#define SIZE   FF_BUFQUEUE_SIZE

Definition at line 40 of file vf_atadenoise.c.

◆ OFFSET

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

Definition at line 62 of file vf_atadenoise.c.

◆ FLAGS

Definition at line 63 of file vf_atadenoise.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( atadenoise  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 79 of file vf_atadenoise.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 111 of file vf_atadenoise.c.

◆ filter_slice8()

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

Definition at line 128 of file vf_atadenoise.c.

Referenced by config_input().

◆ filter_slice16()

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

Definition at line 205 of file vf_atadenoise.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 282 of file vf_atadenoise.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 312 of file vf_atadenoise.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 381 of file vf_atadenoise.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 401 of file vf_atadenoise.c.

Variable Documentation

◆ atadenoise_options

const AVOption atadenoise_options[]
static
Initial value:
= {
{ "0a", "set threshold A for 1st plane", OFFSET(fthra[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0, 0.3, FLAGS },
{ "0b", "set threshold B for 1st plane", OFFSET(fthrb[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 5.0, FLAGS },
{ "1a", "set threshold A for 2nd plane", OFFSET(fthra[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0, 0.3, FLAGS },
{ "1b", "set threshold B for 2nd plane", OFFSET(fthrb[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 5.0, FLAGS },
{ "2a", "set threshold A for 3rd plane", OFFSET(fthra[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0, 0.3, FLAGS },
{ "2b", "set threshold B for 3rd plane", OFFSET(fthrb[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.04}, 0, 5.0, FLAGS },
{ "s", "set how many frames to use", OFFSET(size), AV_OPT_TYPE_INT, {.i64=9}, 5, SIZE, FLAGS },
{ "p", "set what planes to filter", OFFSET(planes), AV_OPT_TYPE_FLAGS, {.i64=7}, 0, 15, FLAGS },
{ NULL }
}

Definition at line 65 of file vf_atadenoise.c.

◆ inputs

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

Definition at line 408 of file vf_atadenoise.c.

◆ outputs

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

Definition at line 418 of file vf_atadenoise.c.

◆ ff_vf_atadenoise

AVFilter ff_vf_atadenoise
Initial value:
= {
.name = "atadenoise",
.description = NULL_IF_CONFIG_SMALL("Apply an Adaptive Temporal Averaging Denoiser."),
.priv_size = sizeof(ATADenoiseContext),
.priv_class = &atadenoise_class,
.init = init,
}

Definition at line 427 of file vf_atadenoise.c.

request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_atadenoise.c:381
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_atadenoise.c:111
SIZE
#define SIZE
Definition: vf_atadenoise.c:40
FLAGS
#define FLAGS
Definition: vf_atadenoise.c:63
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: vf_atadenoise.c:312
NULL
#define NULL
Definition: coverity.c:32
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_atadenoise.c:401
OFFSET
#define OFFSET(x)
Definition: vf_atadenoise.c:62
planes
static const struct @314 planes[]
ATADenoiseContext
Definition: vf_atadenoise.c:42
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
size
int size
Definition: twinvq_data.h:11134
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:226
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_atadenoise.c:282
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_atadenoise.c:79
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
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:222
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:133
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
inputs
static const AVFilterPad inputs[]
Definition: vf_atadenoise.c:408
outputs
static const AVFilterPad outputs[]
Definition: vf_atadenoise.c:418