FFmpeg
Data Structures | Macros | Functions | Variables
vf_owdenoise.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"
#include "video.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 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 enum AVPixelFormat pix_fmts []
 
static const AVFilterPad owdenoise_inputs []
 
const AVFilter ff_vf_owdenoise
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 55 of file vf_owdenoise.c.

◆ FLAGS

Definition at line 56 of file vf_owdenoise.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( owdenoise  )

◆ decompose()

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

Definition at line 110 of file vf_owdenoise.c.

Referenced by decompose2D().

◆ compose()

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

Definition at line 129 of file vf_owdenoise.c.

Referenced by compose2D().

◆ decompose2D()

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 147 of file vf_owdenoise.c.

Referenced by decompose2D2().

◆ compose2D()

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 160 of file vf_owdenoise.c.

Referenced by compose2D2().

◆ decompose2D2()

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

Definition at line 173 of file vf_owdenoise.c.

Referenced by filter().

◆ compose2D2()

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

Definition at line 181 of file vf_owdenoise.c.

Referenced by filter().

◆ 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 189 of file vf_owdenoise.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 252 of file vf_owdenoise.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 317 of file vf_owdenoise.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 339 of file vf_owdenoise.c.

Variable Documentation

◆ owdenoise_options

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

Definition at line 57 of file vf_owdenoise.c.

◆ dither

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 68 of file vf_owdenoise.c.

Referenced by filter().

◆ coeff

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

Definition at line 79 of file vf_owdenoise.c.

Referenced by adpcm_decode_frame(), adx_decode_header(), alf_coeff(), alf_coeff_cc(), alf_filter_cc(), alf_filter_chroma(), alf_filter_luma(), alf_get_coeff_and_clip(), alf_recon_coeff_and_clip(), ana_convert(), assemble_freq_bands_c(), bandwidth_expansion(), bitreduction(), calc_power(), cfhd_decode(), check_multiply3x3(), check_rgb2yuv(), check_yuv2rgb(), check_yuv2yuv(), check_yuv2yuvX(), chs_filter_band_data(), code_filter_coeffs(), coeff_unpack_golomb(), convert_channel(), convert_lpc(), copy_TMPL(), dct_quantize_refine(), dct_quantize_trellis_c(), decode_block(), decode_block_coeffs_internal(), decode_channel(), decode_hf_c(), decode_strip(), decode_subblock1(), decompose(), decor_c(), deemphasis_c(), dequant(), dmix_add_c(), dmix_sub_c(), encode_block(), encode_subband(), eval_poly(), ff_adx_calculate_coeffs(), ff_dcaadpcm_predict(), ff_eac3_apply_spectral_extension(), ff_eval_poly(), ff_lpc_calc_coefs(), ff_vc1_inv_trans_4x4_mmi(), filter0(), filter1(), filter_frame(), filter_frame_fixed(), filter_frame_float(), fir_quantum(), get_block(), get_coeff(), init_dequantizer(), init_pass2(), initFilter(), lbr_bank_c(), lmcs_scale_chroma(), mlp_filter_channel(), parse_dmix_coeffs(), postfilter(), predict(), prescale_down_mix(), psy_3gpp_init(), scale_clip(), scale_coeff(), scaling_derive(), test_deemphasis(), undo_down_mix(), unpack_coeffs(), unpack_vlcs(), vlc_decode_block(), vp5_parse_coeff(), vp6_parse_coeff(), vp6_parse_coeff_huffman(), write_matrix_params(), yuv2rgb_full_1_template_lasx(), yuv2rgb_full_1_template_lsx(), yuv2rgb_full_2_template_lasx(), yuv2rgb_full_2_template_lsx(), yuv2rgb_full_X_template_lasx(), and yuv2rgb_full_X_template_lsx().

◆ icoeff

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

Definition at line 94 of file vf_owdenoise.c.

Referenced by colormap_slice(), and compose().

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ owdenoise_inputs

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

Definition at line 349 of file vf_owdenoise.c.

◆ ff_vf_owdenoise

const AVFilter ff_vf_owdenoise
Initial value:
= {
.name = "owdenoise",
.description = NULL_IF_CONFIG_SMALL("Denoise using wavelets."),
.priv_size = sizeof(OWDenoiseContext),
.priv_class = &owdenoise_class,
}

Definition at line 358 of file vf_owdenoise.c.

owdenoise_inputs
static const AVFilterPad owdenoise_inputs[]
Definition: vf_owdenoise.c:349
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_owdenoise.c:317
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:162
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:478
OFFSET
#define OFFSET(x)
Definition: vf_owdenoise.c:55
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:476
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:481
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:490
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:108
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:491
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:237
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:475
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:489
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
OWDenoiseContext
Definition: vf_owdenoise.c:44
AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_YUV440P10
Definition: pixfmt.h:480
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:479
FLAGS
#define FLAGS
Definition: vf_owdenoise.c:56
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:106
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_owdenoise.c:252
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:483
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:485
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:174
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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:147
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_owdenoise.c:339
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:477
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_owdenoise.c:301
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:482
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:487
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
M_SQRT2
#define M_SQRT2
Definition: mathematics.h:109
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:79
AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:484
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:488
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:173
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:486