Commit 7b43120c authored by Clément Bœsch's avatar Clément Bœsch

lavfi: add dctdnoiz filter.

parent 48de04f4
......@@ -46,6 +46,7 @@ version <next>:
- RedSpark demuxer
- ADPCM IMA Radical decoder
- zmq filters
- DCT denoiser filter (dctdnoiz)
version 1.2:
......
......@@ -2129,6 +2129,7 @@ blackframe_filter_deps="gpl"
boxblur_filter_deps="gpl"
colormatrix_filter_deps="gpl"
cropdetect_filter_deps="gpl"
dctdnoiz_filter_deps="avcodec"
delogo_filter_deps="gpl"
deshake_filter_deps="avcodec"
deshake_filter_select="dsputil"
......
......@@ -2655,6 +2655,59 @@ curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
@end example
@end itemize
@section dctdnoiz
Denoise frames using 2D DCT (frequency domain filtering).
This filter is not designed for real time and can be extremely slow.
The filter accepts the following options:
@table @option
@item sigma, s
Set the noise sigma constant.
This @var{sigma} defines a hard threshold of @code{3 * sigma}; every DCT
coefficient (absolute value) below this threshold with be dropped.
If you need a more advanced filtering, see @option{expr}.
Default is @code{0}.
@item overlap
Set number overlapping pixels for each block. Each block is of size
@code{16x16}. Since the filter can be slow, you may want to reduce this value,
at the cost of a less effective filter and the risk of various artefacts.
If the overlapping value doesn't allow to process the whole input width or
height, a warning will be displayed and according borders won't be denoised.
Default value is @code{15}.
@item expr, e
Set the coefficient factor expression.
For each coefficient of a DCT block, this expression will be evaluated as a
multiplier value for the coefficient.
If this is option is set, the @option{sigma} option will be ignored.
The absolute value of the coefficient can be accessed through the @var{c}
variable.
@end table
@subsection Examples
Apply a denoise with a @option{sigma} of @code{4.5}:
@example
dctdnoiz=4.5
@end example
The same operation can be achieved using the expression system:
@example
dctdnoiz=e='gte(c, 4.5*3)'
@end example
@anchor{decimate}
@section decimate
......
......@@ -116,6 +116,7 @@ OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o
OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o
OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
OBJS-$(CONFIG_DCTDNOIZ_FILTER) += vf_dctdnoiz.o
OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o
OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o
......
......@@ -114,6 +114,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(CROP, crop, vf);
REGISTER_FILTER(CROPDETECT, cropdetect, vf);
REGISTER_FILTER(CURVES, curves, vf);
REGISTER_FILTER(DCTDNOIZ, dctdnoiz, vf);
REGISTER_FILTER(DECIMATE, decimate, vf);
REGISTER_FILTER(DELOGO, delogo, vf);
REGISTER_FILTER(DESHAKE, deshake, vf);
......
......@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 66
#define LIBAVFILTER_VERSION_MINOR 67
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment