avfilter: add nnedi filter

Port of nnedi3 vapoursynth filter.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2016-01-23 17:15:53 +01:00
parent 75f3e5e082
commit 79991b2288
7 changed files with 1325 additions and 1 deletions

View File

@ -63,6 +63,7 @@ version <next>:
- Cineform HD decoder - Cineform HD decoder
- new DCA decoder with full support for DTS-HD extensions - new DCA decoder with full support for DTS-HD extensions
- significant performance improvements in Windows Television (WTV) demuxer - significant performance improvements in Windows Television (WTV) demuxer
- nnedi deinterlacer
version 2.8: version 2.8:

1
configure vendored
View File

@ -2873,6 +2873,7 @@ mpdecimate_filter_deps="gpl"
mpdecimate_filter_select="pixelutils" mpdecimate_filter_select="pixelutils"
mptestsrc_filter_deps="gpl" mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter" negate_filter_deps="lut_filter"
nnedi_filter_deps="gpl"
ocr_filter_deps="libtesseract" ocr_filter_deps="libtesseract"
ocv_filter_deps="libopencv" ocv_filter_deps="libopencv"
owdenoise_filter_deps="gpl" owdenoise_filter_deps="gpl"

View File

@ -8490,6 +8490,115 @@ Negate input video.
It accepts an integer in input; if non-zero it negates the It accepts an integer in input; if non-zero it negates the
alpha component (if available). The default value in input is 0. alpha component (if available). The default value in input is 0.
@section nnedi
Deinterlace video using neural network edge directed interpolation.
This filter accepts the following options:
@table @option
@item weights
Mandatory option, without binary file filter can not work.
Currently file can be found here:
https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
@item deint
Set which frames to deinterlace, by default it is @code{all}.
Can be @code{all} or @code{interlaced}.
@item field
Set mode of operation.
Can be one of the following:
@table @samp
@item af
Use frame flags, both fields.
@item a
Use frame flags, single field.
@item t
Use top field only.
@item b
Use bottom field only.
@item ft
Use both fields, top first.
@item fb
Use both fields, bottom first.
@end table
@item planes
Set which planes to process, by default filter process all frames.
@item nsize
Set size of local neighborhood around each pixel, used by the predictor neural
network.
Can be one of the following:
@table @samp
@item s8x6
@item s16x6
@item s32x6
@item s48x6
@item s8x4
@item s16x4
@item s32x4
@end table
@item nns
Set the number of neurons in predicctor neural network.
Can be one of the following:
@table @samp
@item n16
@item n32
@item n64
@item n128
@item n256
@end table
@item qual
Controls the number of different neural network predictions that are blended
together to compute the final output value. Can be @code{fast}, default or
@code{slow}.
@item etype
Set which set of weights to use in the predictor.
Can be one of the following:
@table @samp
@item a
weights trained to minimize absolute error
@item s
weights trained to minimize squared error
@end table
@item pscrn
Controls whether or not the prescreener neural network is used to decide
which pixels should be processed by the predictor neural network and which
can be handled by simple cubic interpolation.
The prescreener is trained to know whether cubic interpolation will be
sufficient for a pixel or whether it should be predicted by the predictor nn.
The computational complexity of the prescreener nn is much less than that of
the predictor nn. Since most pixels can be handled by cubic interpolation,
using the prescreener generally results in much faster processing.
The prescreener is pretty accurate, so the difference between using it and not
using it is almost always unnoticeable.
Can be one of the following:
@table @samp
@item none
@item original
@item new
@end table
Default is @code{new}.
@item fapprox
Set various debugging flags.
@end table
@section noformat @section noformat
Force libavfilter not to use any of the specified pixel formats for the Force libavfilter not to use any of the specified pixel formats for the

View File

@ -187,6 +187,7 @@ OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o
OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o
OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o
OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o
OBJS-$(CONFIG_NNEDI_FILTER) += vf_nnedi.o
OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o
OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o
OBJS-$(CONFIG_NULL_FILTER) += vf_null.o OBJS-$(CONFIG_NULL_FILTER) += vf_null.o

View File

@ -208,6 +208,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(MERGEPLANES, mergeplanes, vf); REGISTER_FILTER(MERGEPLANES, mergeplanes, vf);
REGISTER_FILTER(MPDECIMATE, mpdecimate, vf); REGISTER_FILTER(MPDECIMATE, mpdecimate, vf);
REGISTER_FILTER(NEGATE, negate, vf); REGISTER_FILTER(NEGATE, negate, vf);
REGISTER_FILTER(NNEDI, nnedi, vf);
REGISTER_FILTER(NOFORMAT, noformat, vf); REGISTER_FILTER(NOFORMAT, noformat, vf);
REGISTER_FILTER(NOISE, noise, vf); REGISTER_FILTER(NOISE, noise, vf);
REGISTER_FILTER(NULL, null, vf); REGISTER_FILTER(NULL, null, vf);

View File

@ -30,7 +30,7 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6 #define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 27 #define LIBAVFILTER_VERSION_MINOR 28
#define LIBAVFILTER_VERSION_MICRO 100 #define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \

1211
libavfilter/vf_nnedi.c Normal file

File diff suppressed because it is too large Load Diff