#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "ssim.h"
#include "video.h"
Go to the source code of this file.
|
| FRAMESYNC_DEFINE_CLASS (ssim, SSIMContext, fs) |
|
static void | set_meta (AVDictionary **metadata, const char *key, char comp, float d) |
|
static void | ssim_4x4xn_16bit (const uint8_t *main8, ptrdiff_t main_stride, const uint8_t *ref8, ptrdiff_t ref_stride, int64_t(*sums)[4], int width) |
|
static void | ssim_4x4xn_8bit (const uint8_t *main, ptrdiff_t main_stride, const uint8_t *ref, ptrdiff_t ref_stride, int(*sums)[4], int width) |
|
static float | ssim_end1x (int64_t s1, int64_t s2, int64_t ss, int64_t s12, int max) |
|
static float | ssim_end1 (int s1, int s2, int ss, int s12) |
|
static float | ssim_endn_16bit (const int64_t(*sum0)[4], const int64_t(*sum1)[4], int width, int max) |
|
static double | ssim_endn_8bit (const int(*sum0)[4], const int(*sum1)[4], int width) |
|
static int | ssim_plane_16bit (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
|
static int | ssim_plane (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
|
static double | ssim_db (double ssim, double weight) |
|
static int | do_ssim (FFFrameSync *fs) |
|
static av_cold int | init (AVFilterContext *ctx) |
|
static int | config_input_ref (AVFilterLink *inlink) |
|
static int | config_output (AVFilterLink *outlink) |
|
static int | activate (AVFilterContext *ctx) |
|
static av_cold void | uninit (AVFilterContext *ctx) |
|
◆ OFFSET
◆ FLAGS
◆ SUM_LEN
#define SUM_LEN |
( |
|
w | ) |
(((w) >> 2) + 3) |
◆ PF
#define PF |
( |
|
suf | ) |
AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf, AV_PIX_FMT_GBR##suf |
◆ FRAMESYNC_DEFINE_CLASS()
◆ set_meta()
static void set_meta |
( |
AVDictionary ** |
metadata, |
|
|
const char * |
key, |
|
|
char |
comp, |
|
|
float |
d |
|
) |
| |
|
static |
◆ ssim_4x4xn_16bit()
static void ssim_4x4xn_16bit |
( |
const uint8_t * |
main8, |
|
|
ptrdiff_t |
main_stride, |
|
|
const uint8_t * |
ref8, |
|
|
ptrdiff_t |
ref_stride, |
|
|
int64_t(*) |
sums[4], |
|
|
int |
width |
|
) |
| |
|
static |
◆ ssim_4x4xn_8bit()
static void ssim_4x4xn_8bit |
( |
const uint8_t * |
main, |
|
|
ptrdiff_t |
main_stride, |
|
|
const uint8_t * |
ref, |
|
|
ptrdiff_t |
ref_stride, |
|
|
int(*) |
sums[4], |
|
|
int |
width |
|
) |
| |
|
static |
◆ ssim_end1x()
static float ssim_end1x |
( |
int64_t |
s1, |
|
|
int64_t |
s2, |
|
|
int64_t |
ss, |
|
|
int64_t |
s12, |
|
|
int |
max |
|
) |
| |
|
static |
◆ ssim_end1()
◆ ssim_endn_16bit()
static float ssim_endn_16bit |
( |
const int64_t(*) |
sum0[4], |
|
|
const int64_t(*) |
sum1[4], |
|
|
int |
width, |
|
|
int |
max |
|
) |
| |
|
static |
◆ ssim_endn_8bit()
static double ssim_endn_8bit |
( |
const int(*) |
sum0[4], |
|
|
const int(*) |
sum1[4], |
|
|
int |
width |
|
) |
| |
|
static |
◆ ssim_plane_16bit()
◆ ssim_plane()
◆ ssim_db()
static double ssim_db |
( |
double |
ssim, |
|
|
double |
weight |
|
) |
| |
|
static |
◆ do_ssim()
◆ init()
◆ config_input_ref()
◆ config_output()
◆ activate()
◆ uninit()
◆ ssim_options
Initial value:
Definition at line 74 of file vf_ssim.c.
◆ pix_fmts
◆ ssim_inputs
Initial value:= {
{
.name = "main",
},{
.name = "reference",
},
}
Definition at line 564 of file vf_ssim.c.
◆ ssim_outputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 575 of file vf_ssim.c.
◆ ff_vf_ssim
Initial value:= {
.name = "ssim",
.preinit = ssim_framesync_preinit,
.priv_class = &ssim_class,
}
Definition at line 583 of file vf_ssim.c.
#define FILTER_PIXFMTS_ARRAY(array)
static int activate(AVFilterContext *ctx)
static int config_input_ref(AVFilterLink *inlink)
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
#define AV_PIX_FMT_GRAY16
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
static const AVFilterPad ssim_inputs[]
#define AV_PIX_FMT_GRAY14
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
#define AV_PIX_FMT_GRAY10
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad ssim_outputs[]
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
static int config_output(AVFilterLink *outlink)
static enum AVPixelFormat pix_fmts[]
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
#define AV_PIX_FMT_GRAY12