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 []
 
const AVFilter ff_vf_fftdnoiz
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 72 of file vf_fftdnoiz.c.

◆ FLAGS

Definition at line 73 of file vf_fftdnoiz.c.

Enumeration Type Documentation

◆ BufferTypes

Enumerator
CURRENT 
PREV 
NEXT 
BSIZE 

Definition at line 29 of file vf_fftdnoiz.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( fftdnoiz  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 94 of file vf_fftdnoiz.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 111 of file vf_fftdnoiz.c.

◆ import_row8()

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

Definition at line 149 of file vf_fftdnoiz.c.

Referenced by config_input().

◆ export_row8()

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

Definition at line 159 of file vf_fftdnoiz.c.

Referenced by config_input().

◆ import_row16()

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

Definition at line 167 of file vf_fftdnoiz.c.

Referenced by config_input().

◆ export_row16()

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

Definition at line 178 of file vf_fftdnoiz.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 187 of file vf_fftdnoiz.c.

◆ import_plane()

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

Definition at line 250 of file vf_fftdnoiz.c.

Referenced by filter_frame().

◆ export_plane()

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

Definition at line 314 of file vf_fftdnoiz.c.

Referenced by filter_frame().

◆ filter_plane3d2()

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

Definition at line 372 of file vf_fftdnoiz.c.

Referenced by filter_frame().

◆ filter_plane3d1()

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

Definition at line 432 of file vf_fftdnoiz.c.

Referenced by filter_frame().

◆ filter_plane2d()

static void filter_plane2d ( FFTdnoizContext s,
int  plane 
)
static

Definition at line 484 of file vf_fftdnoiz.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 518 of file vf_fftdnoiz.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 618 of file vf_fftdnoiz.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 647 of file vf_fftdnoiz.c.

Variable Documentation

◆ fftdnoiz_options

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 }
}

Definition at line 74 of file vf_fftdnoiz.c.

◆ fftdnoiz_inputs

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

Definition at line 669 of file vf_fftdnoiz.c.

◆ fftdnoiz_outputs

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

Definition at line 679 of file vf_fftdnoiz.c.

◆ ff_vf_fftdnoiz

const 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,
}

Definition at line 688 of file vf_fftdnoiz.c.

request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_fftdnoiz.c:618
block_bits
static const uint8_t block_bits[]
Definition: imm4.c:103
fftdnoiz_outputs
static const AVFilterPad fftdnoiz_outputs[]
Definition: vf_fftdnoiz.c:679
inputs
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
Definition: filter_design.txt:243
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
FFTdnoizContext
Definition: vf_fftdnoiz.c:51
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_fftdnoiz.c:187
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:117
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_fftdnoiz.c:94
FLAGS
#define FLAGS
Definition: vf_fftdnoiz.c:73
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_fftdnoiz.c:111
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
OFFSET
#define OFFSET(x)
Definition: vf_fftdnoiz.c:72
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_fftdnoiz.c:647
fftdnoiz_inputs
static const AVFilterPad fftdnoiz_inputs[]
Definition: vf_fftdnoiz.c:669
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_fftdnoiz.c:518
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:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561