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 "atadenoise.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|AV_OPT_FLAG_RUNTIME_PARAM
 
#define VF   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define FILTER_ROW(type, name)
 
#define FILTER_ROW_SERIAL(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)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
 

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 41 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.

Definition at line 68 of file vf_atadenoise.c.

#define FILTER_ROW (   type,
  name 
)

Definition at line 141 of file vf_atadenoise.c.

#define FILTER_ROW_SERIAL (   type,
  name 
)

Definition at line 188 of file vf_atadenoise.c.

Function Documentation

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

Definition at line 87 of file vf_atadenoise.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 124 of file vf_atadenoise.c.

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

Definition at line 237 of file vf_atadenoise.c.

Referenced by blend_frame().

static int config_input ( AVFilterLink inlink)
static

Definition at line 283 of file vf_atadenoise.c.

Referenced by process_command().

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 317 of file vf_atadenoise.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 386 of file vf_atadenoise.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 406 of file vf_atadenoise.c.

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  arg,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 413 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, VF },
{ "p", "set what planes to filter", OFFSET(planes), AV_OPT_TYPE_FLAGS, {.i64=7}, 0, 15, FLAGS },
{ "a", "set variant of algorithm", OFFSET(algorithm),AV_OPT_TYPE_INT, {.i64=PARALLEL}, 0, NB_ATAA-1, FLAGS, "a" },
{ "p", "parallel", 0, AV_OPT_TYPE_CONST, {.i64=PARALLEL}, 0, 0, FLAGS, "a" },
{ "s", "serial", 0, AV_OPT_TYPE_CONST, {.i64=SERIAL}, 0, 0, FLAGS, "a" },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define VF
Definition: vf_atadenoise.c:68
static const struct @328 planes[]
ptrdiff_t size
Definition: opengl_enc.c:100
#define SIZE
Definition: vf_atadenoise.c:41
#define OFFSET(x)
Definition: vf_atadenoise.c:66
#define FLAGS
Definition: vf_atadenoise.c:67

Definition at line 70 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 428 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 438 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:87
static int process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
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:564
static const AVFilterPad outputs[]

Definition at line 447 of file vf_atadenoise.c.