FFmpeg
Data Structures | Macros | Functions | Variables
vf_atadenoise.c File Reference

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

#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
 
#define FILTER_ROW(type, name)
 

Functions

 AVFILTER_DEFINE_CLASS (atadenoise)
 
static int query_formats (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int filter_slice (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

#define FF_BUFQUEUE_SIZE   129

Definition at line 33 of file vf_atadenoise.c.

#define SIZE   FF_BUFQUEUE_SIZE

Definition at line 40 of file vf_atadenoise.c.

Referenced by filter_slice().

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

Definition at line 66 of file vf_atadenoise.c.

Definition at line 67 of file vf_atadenoise.c.

#define FILTER_ROW (   type,
  name 
)

Definition at line 132 of file vf_atadenoise.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( atadenoise  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 83 of file vf_atadenoise.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 115 of file vf_atadenoise.c.

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

Definition at line 179 of file vf_atadenoise.c.

Referenced by blend_frame().

static int config_input ( AVFilterLink inlink)
static

Definition at line 225 of file vf_atadenoise.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 256 of file vf_atadenoise.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 325 of file vf_atadenoise.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 345 of file vf_atadenoise.c.

Variable Documentation

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 }
}
#define NULL
Definition: coverity.c:32
ptrdiff_t size
Definition: opengl_enc.c:100
#define SIZE
Definition: vf_atadenoise.c:40
#define OFFSET(x)
Definition: vf_atadenoise.c:66
#define FLAGS
Definition: vf_atadenoise.c:67
static const struct @317 planes[]

Definition at line 69 of file vf_atadenoise.c.

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

Definition at line 352 of file vf_atadenoise.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)

Definition at line 362 of file vf_atadenoise.c.

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,
}
static int query_formats(AVFilterContext *ctx)
Definition: vf_atadenoise.c:83
static const AVFilterPad inputs[]
static av_cold int init(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 av_cold void uninit(AVFilterContext *ctx)
#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
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static const AVFilterPad outputs[]

Definition at line 371 of file vf_atadenoise.c.