Commit 5a1f7852 authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add ssim filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 346624be
......@@ -7,6 +7,7 @@ version <next>:
- little-endian ADPCM_THP decoder
- Hap decoder and encoder
- DirectDraw Surface image/texture decoder
- ssim filter
version 2.7:
......
......@@ -8834,6 +8834,64 @@ in [-30,0] will filter edges. Default value is 0.
If a chroma option is not explicitly set, the corresponding luma value
is set.
@section ssim
Obtain the SSIM (Structural SImilarity Metric) between two input videos.
This filter takes in input two input videos, the first input is
considered the "main" source and is passed unchanged to the
output. The second input is used as a "reference" video for computing
the SSIM.
Both video inputs must have the same resolution and pixel format for
this filter to work correctly. Also it assumes that both inputs
have the same number of frames, which are compared one by one.
The filter stores the calculated SSIM of each frame.
The description of the accepted parameters follows.
@table @option
@item stats_file, f
If specified the filter will use the named file to save the PSNR of
each individual frame.
@end table
The file printed if @var{stats_file} is selected, contains a sequence of
key/value pairs of the form @var{key}:@var{value} for each compared
couple of frames.
A description of each shown parameter follows:
@table @option
@item n
sequential number of the input frame, starting from 1
@item Y, U, V, R, G, B
SSIM of the compared frames for the component specified by the suffix.
@item All
SSIM of the compared frames for the whole frame.
@item dB
Same as above but in dB representation.
@end table
For example:
@example
movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
[main][ref] ssim="stats_file=stats.log" [out]
@end example
On this example the input file being processed is compared with the
reference file @file{ref_movie.mpg}. The SSIM of each individual frame
is stored in @file{stats.log}.
Another example with both psnr and ssim at same time:
@example
ffmpeg -i main.mpg -i ref.mpg -lavfi "ssim;[0:v][1:v]psnr" -f null -
@end example
@section stereo3d
Convert between different stereoscopic image formats.
......
......@@ -197,6 +197,7 @@ OBJS-$(CONFIG_SIGNALSTATS_FILTER) += vf_signalstats.o
OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o
OBJS-$(CONFIG_SPLIT_FILTER) += split.o
OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o
OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o dualinput.o framesync.o
OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o
OBJS-$(CONFIG_SUBTITLES_FILTER) += vf_subtitles.o
OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
......
......@@ -212,6 +212,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SMARTBLUR, smartblur, vf);
REGISTER_FILTER(SPLIT, split, vf);
REGISTER_FILTER(SPP, spp, vf);
REGISTER_FILTER(SSIM, ssim, vf);
REGISTER_FILTER(STEREO3D, stereo3d, vf);
REGISTER_FILTER(SUBTITLES, subtitles, vf);
REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
......
......@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 5
#define LIBAVFILTER_VERSION_MINOR 17
#define LIBAVFILTER_VERSION_MINOR 18
#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