FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_fftdnoiz.c File Reference
#include <float.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
#include "libavcodec/avfft.h"

Go to the source code of this file.

Data Structures

struct  PlaneContext
 
struct  FFTdnoizContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(FFTdnoizContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  BufferTypes { CURRENT, PREV, NEXT, BSIZE }
 

Functions

 AVFILTER_DEFINE_CLASS (fftdnoiz)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static void import_row8 (FFTComplex *dst, uint8_t *src, int rw)
 
static void export_row8 (FFTComplex *src, uint8_t *dst, int rw, float scale, int depth)
 
static void import_row16 (FFTComplex *dst, uint8_t *srcp, int rw)
 
static void export_row16 (FFTComplex *src, uint8_t *dstp, int rw, float scale, int depth)
 
static int config_input (AVFilterLink *inlink)
 
static void import_plane (FFTdnoizContext *s, uint8_t *srcp, int src_linesize, float *buffer, int buffer_linesize, int plane)
 
static void export_plane (FFTdnoizContext *s, uint8_t *dstp, int dst_linesize, float *buffer, int buffer_linesize, int plane)
 
static void filter_plane3d2 (FFTdnoizContext *s, int plane, float *pbuffer, float *nbuffer)
 
static void filter_plane3d1 (FFTdnoizContext *s, int plane, float *pbuffer)
 
static void filter_plane2d (FFTdnoizContext *s, int plane)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption fftdnoiz_options []
 
static const AVFilterPad fftdnoiz_inputs []
 
static const AVFilterPad fftdnoiz_outputs []
 
AVFilter ff_vf_fftdnoiz
 

Macro Definition Documentation

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

Definition at line 72 of file vf_fftdnoiz.c.

Definition at line 73 of file vf_fftdnoiz.c.

Enumeration Type Documentation

Enumerator
CURRENT 
PREV 
NEXT 
BSIZE 

Definition at line 29 of file vf_fftdnoiz.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( fftdnoiz  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 94 of file vf_fftdnoiz.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 111 of file vf_fftdnoiz.c.

static void import_row8 ( FFTComplex dst,
uint8_t src,
int  rw 
)
static

Definition at line 144 of file vf_fftdnoiz.c.

Referenced by config_input().

static void export_row8 ( FFTComplex src,
uint8_t dst,
int  rw,
float  scale,
int  depth 
)
static

Definition at line 154 of file vf_fftdnoiz.c.

Referenced by config_input().

static void import_row16 ( FFTComplex dst,
uint8_t srcp,
int  rw 
)
static

Definition at line 162 of file vf_fftdnoiz.c.

Referenced by config_input().

static void export_row16 ( FFTComplex src,
uint8_t dstp,
int  rw,
float  scale,
int  depth 
)
static

Definition at line 173 of file vf_fftdnoiz.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 182 of file vf_fftdnoiz.c.

static void import_plane ( FFTdnoizContext s,
uint8_t srcp,
int  src_linesize,
float *  buffer,
int  buffer_linesize,
int  plane 
)
static

Definition at line 245 of file vf_fftdnoiz.c.

Referenced by filter_frame().

static void export_plane ( FFTdnoizContext s,
uint8_t dstp,
int  dst_linesize,
float *  buffer,
int  buffer_linesize,
int  plane 
)
static

Definition at line 309 of file vf_fftdnoiz.c.

Referenced by filter_frame().

static void filter_plane3d2 ( FFTdnoizContext s,
int  plane,
float *  pbuffer,
float *  nbuffer 
)
static

Definition at line 367 of file vf_fftdnoiz.c.

Referenced by filter_frame().

static void filter_plane3d1 ( FFTdnoizContext s,
int  plane,
float *  pbuffer 
)
static

Definition at line 427 of file vf_fftdnoiz.c.

Referenced by filter_frame().

static void filter_plane2d ( FFTdnoizContext s,
int  plane 
)
static

Definition at line 479 of file vf_fftdnoiz.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 513 of file vf_fftdnoiz.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 613 of file vf_fftdnoiz.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 642 of file vf_fftdnoiz.c.

Variable Documentation

const AVOption fftdnoiz_options[]
static
Initial value:
= {
{ "sigma", "set denoise strength",
OFFSET(sigma), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 30, .flags = FLAGS },
{ "amount", "set amount of denoising",
OFFSET(amount), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0.01, 1, .flags = FLAGS },
{ "block", "set block log2(size)",
OFFSET(block_bits), AV_OPT_TYPE_INT, {.i64=4}, 3, 6, .flags = FLAGS },
{ "overlap", "set block overlap",
OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0.2, 0.8, .flags = FLAGS },
{ "prev", "set number of previous frames for temporal denoising",
OFFSET(nb_prev), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = FLAGS },
{ "next", "set number of next frames for temporal denoising",
OFFSET(nb_next), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, .flags = FLAGS },
{ "planes", "set planes to filter",
OFFSET(planesf), AV_OPT_TYPE_INT, {.i64=7}, 0, 15, .flags = FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_fftdnoiz.c:73
#define OFFSET(x)
Definition: vf_fftdnoiz.c:72
static const uint8_t block_bits[]
Definition: imm4.c:106

Definition at line 74 of file vf_fftdnoiz.c.

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

Definition at line 664 of file vf_fftdnoiz.c.

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

Definition at line 674 of file vf_fftdnoiz.c.

AVFilter ff_vf_fftdnoiz
Initial value:
= {
.name = "fftdnoiz",
.description = NULL_IF_CONFIG_SMALL("Denoise frames using 3D FFT."),
.priv_size = sizeof(FFTdnoizContext),
.init = init,
.priv_class = &fftdnoiz_class,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int init(AVFilterContext *ctx)
Definition: vf_fftdnoiz.c:94
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
#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 fftdnoiz_inputs[]
Definition: vf_fftdnoiz.c:664
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_fftdnoiz.c:642
static int query_formats(AVFilterContext *ctx)
Definition: vf_fftdnoiz.c:111
static const AVFilterPad fftdnoiz_outputs[]
Definition: vf_fftdnoiz.c:674

Definition at line 683 of file vf_fftdnoiz.c.