FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
 

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

#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_slice16(), and filter_slice8().

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

Definition at line 62 of file vf_atadenoise.c.

Definition at line 63 of file vf_atadenoise.c.

Function Documentation

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

Definition at line 79 of file vf_atadenoise.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 107 of file vf_atadenoise.c.

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

Definition at line 124 of file vf_atadenoise.c.

Referenced by config_input().

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

Definition at line 201 of file vf_atadenoise.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 278 of file vf_atadenoise.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 308 of file vf_atadenoise.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 377 of file vf_atadenoise.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 397 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:101
#define SIZE
Definition: vf_atadenoise.c:40
#define OFFSET(x)
Definition: vf_atadenoise.c:62
#define FLAGS
Definition: vf_atadenoise.c:63

Definition at line 65 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 404 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 414 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:79
static const AVFilterPad inputs[]
static int flags
Definition: log.c:57
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:179
#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
static const AVFilterPad outputs[]

Definition at line 423 of file vf_atadenoise.c.