FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_dctdnoiz.c File Reference
#include "libavcodec/avfft.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "drawutils.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  DCTdnoizContext
 

Macros

#define NBITS   4
 A simple, relatively efficient and extremely slow DCT image denoiser.
 
#define BSIZE   (1<<(NBITS))
 
#define OFFSET(x)   offsetof(DCTdnoizContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  { VAR_C, VAR_VARS_NB }
 

Functions

 AVFILTER_DEFINE_CLASS (dctdnoiz)
 
static float * dct_block (DCTdnoizContext *ctx, const float *src, int src_linesize)
 
static void idct_block (DCTdnoizContext *ctx, float *dst, int dst_linesize)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static void color_decorrelation (float dct3ch[3][3], float **dst, int dst_linesize, const uint8_t *src, int src_linesize, int w, int h)
 
static void color_correlation (float dct3ch[3][3], uint8_t *dst, int dst_linesize, float **src, int src_linesize, int w, int h)
 
static void filter_plane (AVFilterContext *ctx, float *dst, int dst_linesize, const float *src, int src_linesize, int w, int h)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const char *const var_names [] = { "c", NULL }
 
static const AVOption dctdnoiz_options []
 
static const AVFilterPad dctdnoiz_inputs []
 
static const AVFilterPad dctdnoiz_outputs []
 
AVFilter avfilter_vf_dctdnoiz
 

Macro Definition Documentation

#define NBITS   4

A simple, relatively efficient and extremely slow DCT image denoiser.

See Also
http://www.ipol.im/pub/art/2011/ys-dct/

Definition at line 32 of file vf_dctdnoiz.c.

Referenced by init().

#define BSIZE   (1<<(NBITS))

Definition at line 33 of file vf_dctdnoiz.c.

Referenced by config_input(), dct_block(), filter_plane(), idct_block(), and init().

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

Definition at line 59 of file vf_dctdnoiz.c.

Definition at line 60 of file vf_dctdnoiz.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
VAR_C 
VAR_VARS_NB 

Definition at line 36 of file vf_dctdnoiz.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( dctdnoiz  )
static float* dct_block ( DCTdnoizContext ctx,
const float *  src,
int  src_linesize 
)
static

Definition at line 72 of file vf_dctdnoiz.c.

Referenced by filter_plane().

static void idct_block ( DCTdnoizContext ctx,
float *  dst,
int  dst_linesize 
)
static

Definition at line 109 of file vf_dctdnoiz.c.

Referenced by filter_plane().

static int config_input ( AVFilterLink inlink)
static

Definition at line 134 of file vf_dctdnoiz.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 188 of file vf_dctdnoiz.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 212 of file vf_dctdnoiz.c.

static void color_decorrelation ( float  dct3ch[3][3],
float **  dst,
int  dst_linesize,
const uint8_t src,
int  src_linesize,
int  w,
int  h 
)
static

Definition at line 222 of file vf_dctdnoiz.c.

Referenced by filter_frame().

static void color_correlation ( float  dct3ch[3][3],
uint8_t dst,
int  dst_linesize,
float **  src,
int  src_linesize,
int  w,
int  h 
)
static

Definition at line 246 of file vf_dctdnoiz.c.

Referenced by filter_frame().

static void filter_plane ( AVFilterContext ctx,
float *  dst,
int  dst_linesize,
const float *  src,
int  src_linesize,
int  w,
int  h 
)
static

Definition at line 270 of file vf_dctdnoiz.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 320 of file vf_dctdnoiz.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 386 of file vf_dctdnoiz.c.

Variable Documentation

const char* const var_names[] = { "c", NULL }
static

Definition at line 35 of file vf_dctdnoiz.c.

Referenced by init().

const AVOption dctdnoiz_options[]
static
Initial value:
= {
{ "sigma", "set noise sigma constant", OFFSET(sigma), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 999, .flags = FLAGS },
{ "s", "set noise sigma constant", OFFSET(sigma), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 999, .flags = FLAGS },
{ "overlap", "set number of block overlapping pixels", OFFSET(overlap), AV_OPT_TYPE_INT, {.i64=(1<<NBITS)-1}, 0, (1<<NBITS)-1, .flags = FLAGS },
{ "expr", "set coefficient factor expression", OFFSET(expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "e", "set coefficient factor expression", OFFSET(expr_str), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ NULL }
}

Definition at line 61 of file vf_dctdnoiz.c.

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

Definition at line 404 of file vf_dctdnoiz.c.

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

Definition at line 414 of file vf_dctdnoiz.c.

AVFilter avfilter_vf_dctdnoiz
Initial value:
= {
.name = "dctdnoiz",
.description = NULL_IF_CONFIG_SMALL("Denoise frames using 2D DCT."),
.priv_size = sizeof(DCTdnoizContext),
.init = init,
.priv_class = &dctdnoiz_class,
}

Definition at line 422 of file vf_dctdnoiz.c.