FFmpeg
Data Structures | Macros | Functions | Variables
vf_owdenoise.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  OWDenoiseContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (owdenoise)
 
static void decompose (float *dst_l, float *dst_h, const float *src, int linesize, int w)
 
static void compose (float *dst, const float *src_l, const float *src_h, int linesize, int w)
 
static void decompose2D (float *dst_l, float *dst_h, const float *src, int xlinesize, int ylinesize, int step, int w, int h)
 
static void compose2D (float *dst, const float *src_l, const float *src_h, int xlinesize, int ylinesize, int step, int w, int h)
 
static void decompose2D2 (float *dst[4], float *src, float *temp[2], int linesize, int step, int w, int h)
 
static void compose2D2 (float *dst, float *src[4], float *temp[2], int linesize, int step, int w, int h)
 
static void filter (OWDenoiseContext *s, uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int width, int height, double strength)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption owdenoise_options []
 
static const uint8_t dither [8][8]
 
static const double coeff [2][5]
 
static const double icoeff [2][5]
 
static const AVFilterPad owdenoise_inputs []
 
static const AVFilterPad owdenoise_outputs []
 
AVFilter ff_vf_owdenoise
 

Macro Definition Documentation

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

Definition at line 48 of file vf_owdenoise.c.

Definition at line 49 of file vf_owdenoise.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( owdenoise  )
static void decompose ( float *  dst_l,
float *  dst_h,
const float *  src,
int  linesize,
int  w 
)
inlinestatic

Definition at line 103 of file vf_owdenoise.c.

Referenced by decompose2D().

static void compose ( float *  dst,
const float *  src_l,
const float *  src_h,
int  linesize,
int  w 
)
inlinestatic

Definition at line 122 of file vf_owdenoise.c.

Referenced by compose2D().

static void decompose2D ( float *  dst_l,
float *  dst_h,
const float *  src,
int  xlinesize,
int  ylinesize,
int  step,
int  w,
int  h 
)
inlinestatic

Definition at line 140 of file vf_owdenoise.c.

Referenced by decompose2D2().

static void compose2D ( float *  dst,
const float *  src_l,
const float *  src_h,
int  xlinesize,
int  ylinesize,
int  step,
int  w,
int  h 
)
inlinestatic

Definition at line 153 of file vf_owdenoise.c.

Referenced by compose2D2().

static void decompose2D2 ( float *  dst[4],
float *  src,
float *  temp[2],
int  linesize,
int  step,
int  w,
int  h 
)
static

Definition at line 166 of file vf_owdenoise.c.

Referenced by filter().

static void compose2D2 ( float *  dst,
float *  src[4],
float *  temp[2],
int  linesize,
int  step,
int  w,
int  h 
)
static

Definition at line 174 of file vf_owdenoise.c.

Referenced by filter().

static void filter ( OWDenoiseContext s,
uint8_t dst,
int  dst_linesize,
const uint8_t src,
int  src_linesize,
int  width,
int  height,
double  strength 
)
static

Definition at line 182 of file vf_owdenoise.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 245 of file vf_owdenoise.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 294 of file vf_owdenoise.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 317 of file vf_owdenoise.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 339 of file vf_owdenoise.c.

Variable Documentation

const AVOption owdenoise_options[]
static
Initial value:
= {
{ "depth", "set depth", OFFSET(depth), AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, FLAGS },
{ "luma_strength", "set luma strength", OFFSET(luma_strength), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0, 1000, FLAGS },
{ "ls", "set luma strength", OFFSET(luma_strength), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0, 1000, FLAGS },
{ "chroma_strength", "set chroma strength", OFFSET(chroma_strength), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0, 1000, FLAGS },
{ "cs", "set chroma strength", OFFSET(chroma_strength), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0, 1000, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_owdenoise.c:48
#define FLAGS
Definition: vf_owdenoise.c:49

Definition at line 50 of file vf_owdenoise.c.

const uint8_t dither[8][8]
static
Initial value:
= {
{ 0, 48, 12, 60, 3, 51, 15, 63 },
{ 32, 16, 44, 28, 35, 19, 47, 31 },
{ 8, 56, 4, 52, 11, 59, 7, 55 },
{ 40, 24, 36, 20, 43, 27, 39, 23 },
{ 2, 50, 14, 62, 1, 49, 13, 61 },
{ 34, 18, 46, 30, 33, 17, 45, 29 },
{ 10, 58, 6, 54, 9, 57, 5, 53 },
{ 42, 26, 38, 22, 41, 25, 37, 21 },
}

Definition at line 61 of file vf_owdenoise.c.

Referenced by filter().

const double coeff[2][5]
static
Initial value:
= {
{
0.6029490182363579 * M_SQRT2,
0.2668641184428723 * M_SQRT2,
-0.07822326652898785 * M_SQRT2,
-0.01686411844287495 * M_SQRT2,
0.02674875741080976 * M_SQRT2,
},{
1.115087052456994 / M_SQRT2,
-0.5912717631142470 / M_SQRT2,
-0.05754352622849957 / M_SQRT2,
0.09127176311424948 / M_SQRT2,
}
}
#define M_SQRT2
Definition: mathematics.h:61

Definition at line 72 of file vf_owdenoise.c.

Referenced by adpcm_decode_frame(), bitreduction(), calc_power(), cfhd_decode(), check_multiply3x3(), check_rgb2yuv(), check_yuv2rgb(), check_yuv2yuv(), chs_filter_band_data(), code_filter_coeffs(), code_matrix_coeffs(), coeff_unpack_golomb(), colorlevel_slice_16(), colorlevel_slice_8(), convert_coeffs(), copy_TMPL(), dct_quantize_refine(), dct_quantize_trellis_c(), decode_block(), decode_block_coeffs_internal(), decode_channel(), decode_hf_c(), decode_subblock1(), decompose(), deemphasis_c(), encode_block(), encode_subband(), ff_dcaadpcm_predict(), ff_dirac_golomb_read_16bit(), ff_dirac_golomb_read_32bit(), ff_eac3_apply_spectral_extension(), ff_lpc_calc_coefs(), ff_vc1_inv_trans_4x4_mmi(), ff_vc1_inv_trans_4x8_dc_mmi(), ff_vc1_inv_trans_8x4_dc_mmi(), filter_frame(), filter_frame_fixed(), filter_frame_float(), fir_quantum(), get_block(), init_dequantizer(), init_pass2(), initFilter(), mlp_filter_channel(), parse_dmix_coeffs(), prescale_down_mix(), psy_3gpp_init(), undo_down_mix(), unpack_coeffs(), unpack_dct_coeffs(), unpack_vlcs(), vlc_decode_block(), vp5_parse_coeff(), vp6_parse_coeff(), vp6_parse_coeff_huffman(), and write_matrix_params().

const double icoeff[2][5]
static
Initial value:
= {
{
1.115087052456994 / M_SQRT2,
0.5912717631142470 / M_SQRT2,
-0.05754352622849957 / M_SQRT2,
-0.09127176311424948 / M_SQRT2,
},{
0.6029490182363579 * M_SQRT2,
-0.2668641184428723 * M_SQRT2,
-0.07822326652898785 * M_SQRT2,
0.01686411844287495 * M_SQRT2,
0.02674875741080976 * M_SQRT2,
}
}
#define M_SQRT2
Definition: mathematics.h:61

Definition at line 87 of file vf_owdenoise.c.

Referenced by compose().

const AVFilterPad owdenoise_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_owdenoise.c:317
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_owdenoise.c:245

Definition at line 349 of file vf_owdenoise.c.

const AVFilterPad owdenoise_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 359 of file vf_owdenoise.c.

AVFilter ff_vf_owdenoise
Initial value:
= {
.name = "owdenoise",
.description = NULL_IF_CONFIG_SMALL("Denoise using wavelets."),
.priv_size = sizeof(OWDenoiseContext),
.priv_class = &owdenoise_class,
}
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad owdenoise_outputs[]
Definition: vf_owdenoise.c:359
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
static int query_formats(AVFilterContext *ctx)
Definition: vf_owdenoise.c:294
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_owdenoise.c:339
static const AVFilterPad owdenoise_inputs[]
Definition: vf_owdenoise.c:349

Definition at line 367 of file vf_owdenoise.c.