FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vf_ssim.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2013 Loren Merritt
3  * Copyright (c) 2015 Paul B Mahol
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /* Computes the Structural Similarity Metric between two video streams.
23  * original algorithm:
24  * Z. Wang, A. C. Bovik, H. R. Sheikh and E. P. Simoncelli,
25  * "Image quality assessment: From error visibility to structural similarity,"
26  * IEEE Transactions on Image Processing, vol. 13, no. 4, pp. 600-612, Apr. 2004.
27  *
28  * To improve speed, this implementation uses the standard approximation of
29  * overlapped 8x8 block sums, rather than the original gaussian weights.
30  */
31 
32 /*
33  * @file
34  * Caculate the SSIM between two input videos.
35  */
36 
37 #include "libavutil/avstring.h"
38 #include "libavutil/opt.h"
39 #include "libavutil/pixdesc.h"
40 #include "avfilter.h"
41 #include "dualinput.h"
42 #include "drawutils.h"
43 #include "formats.h"
44 #include "internal.h"
45 #include "ssim.h"
46 #include "video.h"
47 
48 typedef struct SSIMContext {
49  const AVClass *class;
51  FILE *stats_file;
54  uint64_t nb_frames;
55  double ssim[4], ssim_total;
56  char comps[4];
57  float coefs[4];
59  int planewidth[4];
60  int planeheight[4];
61  int *temp;
62  int is_rgb;
64 } SSIMContext;
65 
66 #define OFFSET(x) offsetof(SSIMContext, x)
67 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
68 
69 static const AVOption ssim_options[] = {
70  {"stats_file", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
71  {"f", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
72  { NULL }
73 };
74 
76 
77 static void set_meta(AVDictionary **metadata, const char *key, char comp, float d)
78 {
79  char value[128];
80  snprintf(value, sizeof(value), "%0.2f", d);
81  if (comp) {
82  char key2[128];
83  snprintf(key2, sizeof(key2), "%s%c", key, comp);
84  av_dict_set(metadata, key2, value, 0);
85  } else {
86  av_dict_set(metadata, key, value, 0);
87  }
88 }
89 
90 static void ssim_4x4xn(const uint8_t *main, ptrdiff_t main_stride,
91  const uint8_t *ref, ptrdiff_t ref_stride,
92  int (*sums)[4], int width)
93 {
94  int x, y, z;
95 
96  for (z = 0; z < width; z++) {
97  uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0;
98 
99  for (y = 0; y < 4; y++) {
100  for (x = 0; x < 4; x++) {
101  int a = main[x + y * main_stride];
102  int b = ref[x + y * ref_stride];
103 
104  s1 += a;
105  s2 += b;
106  ss += a*a;
107  ss += b*b;
108  s12 += a*b;
109  }
110  }
111 
112  sums[z][0] = s1;
113  sums[z][1] = s2;
114  sums[z][2] = ss;
115  sums[z][3] = s12;
116  main += 4;
117  ref += 4;
118  }
119 }
120 
121 static float ssim_end1(int s1, int s2, int ss, int s12)
122 {
123  static const int ssim_c1 = (int)(.01*.01*255*255*64 + .5);
124  static const int ssim_c2 = (int)(.03*.03*255*255*64*63 + .5);
125 
126  int fs1 = s1;
127  int fs2 = s2;
128  int fss = ss;
129  int fs12 = s12;
130  int vars = fss * 64 - fs1 * fs1 - fs2 * fs2;
131  int covar = fs12 * 64 - fs1 * fs2;
132 
133  return (float)(2 * fs1 * fs2 + ssim_c1) * (float)(2 * covar + ssim_c2)
134  / ((float)(fs1 * fs1 + fs2 * fs2 + ssim_c1) * (float)(vars + ssim_c2));
135 }
136 
137 static float ssim_endn(const int (*sum0)[4], const int (*sum1)[4], int width)
138 {
139  float ssim = 0.0;
140  int i;
141 
142  for (i = 0; i < width; i++)
143  ssim += ssim_end1(sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0],
144  sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1],
145  sum0[i][2] + sum0[i + 1][2] + sum1[i][2] + sum1[i + 1][2],
146  sum0[i][3] + sum0[i + 1][3] + sum1[i][3] + sum1[i + 1][3]);
147  return ssim;
148 }
149 
150 static float ssim_plane(SSIMDSPContext *dsp,
151  uint8_t *main, int main_stride,
152  uint8_t *ref, int ref_stride,
153  int width, int height, void *temp)
154 {
155  int z = 0, y;
156  float ssim = 0.0;
157  int (*sum0)[4] = temp;
158  int (*sum1)[4] = sum0 + (width >> 2) + 3;
159 
160  width >>= 2;
161  height >>= 2;
162 
163  for (y = 1; y < height; y++) {
164  for (; z <= y; z++) {
165  FFSWAP(void*, sum0, sum1);
166  dsp->ssim_4x4_line(&main[4 * z * main_stride], main_stride,
167  &ref[4 * z * ref_stride], ref_stride,
168  sum0, width);
169  }
170 
171  ssim += dsp->ssim_end_line((const int (*)[4])sum0, (const int (*)[4])sum1, width - 1);
172  }
173 
174  return ssim / ((height - 1) * (width - 1));
175 }
176 
177 static double ssim_db(double ssim, double weight)
178 {
179  return 10 * log10(weight / (weight - ssim));
180 }
181 
183  const AVFrame *ref)
184 {
185  AVDictionary **metadata = avpriv_frame_get_metadatap(main);
186  SSIMContext *s = ctx->priv;
187  float c[4], ssimv = 0.0;
188  int i;
189 
190  s->nb_frames++;
191 
192  for (i = 0; i < s->nb_components; i++) {
193  c[i] = ssim_plane(&s->dsp, main->data[i], main->linesize[i],
194  ref->data[i], ref->linesize[i],
195  s->planewidth[i], s->planeheight[i], s->temp);
196  ssimv += s->coefs[i] * c[i];
197  s->ssim[i] += c[i];
198  }
199  for (i = 0; i < s->nb_components; i++) {
200  int cidx = s->is_rgb ? s->rgba_map[i] : i;
201  set_meta(metadata, "lavfi.ssim.", s->comps[i], c[cidx]);
202  }
203  s->ssim_total += ssimv;
204 
205  set_meta(metadata, "lavfi.ssim.All", 0, ssimv);
206  set_meta(metadata, "lavfi.ssim.dB", 0, ssim_db(ssimv, 1.0));
207 
208  if (s->stats_file) {
209  fprintf(s->stats_file, "n:%"PRId64" ", s->nb_frames);
210 
211  for (i = 0; i < s->nb_components; i++) {
212  int cidx = s->is_rgb ? s->rgba_map[i] : i;
213  fprintf(s->stats_file, "%c:%f ", s->comps[i], c[cidx]);
214  }
215 
216  fprintf(s->stats_file, "All:%f (%f)\n", ssimv, ssim_db(ssimv, 1.0));
217  }
218 
219  return main;
220 }
221 
223 {
224  SSIMContext *s = ctx->priv;
225 
226  if (s->stats_file_str) {
227  if (!strcmp(s->stats_file_str, "-")) {
228  s->stats_file = stdout;
229  } else {
230  s->stats_file = fopen(s->stats_file_str, "w");
231  if (!s->stats_file) {
232  int err = AVERROR(errno);
233  char buf[128];
234  av_strerror(err, buf, sizeof(buf));
235  av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n",
236  s->stats_file_str, buf);
237  return err;
238  }
239  }
240  }
241 
242  s->dinput.process = do_ssim;
243  s->dinput.shortest = 1;
244  s->dinput.repeatlast = 0;
245  return 0;
246 }
247 
249 {
250  static const enum AVPixelFormat pix_fmts[] = {
258  };
259 
260  AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
261  if (!fmts_list)
262  return AVERROR(ENOMEM);
263  return ff_set_common_formats(ctx, fmts_list);
264 }
265 
266 static int config_input_ref(AVFilterLink *inlink)
267 {
269  AVFilterContext *ctx = inlink->dst;
270  SSIMContext *s = ctx->priv;
271  int sum = 0, i;
272 
273  s->nb_components = desc->nb_components;
274 
275  if (ctx->inputs[0]->w != ctx->inputs[1]->w ||
276  ctx->inputs[0]->h != ctx->inputs[1]->h) {
277  av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n");
278  return AVERROR(EINVAL);
279  }
280  if (ctx->inputs[0]->format != ctx->inputs[1]->format) {
281  av_log(ctx, AV_LOG_ERROR, "Inputs must be of same pixel format.\n");
282  return AVERROR(EINVAL);
283  }
284 
285  s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0;
286  s->comps[0] = s->is_rgb ? 'R' : 'Y';
287  s->comps[1] = s->is_rgb ? 'G' : 'U';
288  s->comps[2] = s->is_rgb ? 'B' : 'V';
289  s->comps[3] = 'A';
290 
291  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
292  s->planeheight[0] = s->planeheight[3] = inlink->h;
293  s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
294  s->planewidth[0] = s->planewidth[3] = inlink->w;
295  for (i = 0; i < s->nb_components; i++)
296  sum += s->planeheight[i] * s->planewidth[i];
297  for (i = 0; i < s->nb_components; i++)
298  s->coefs[i] = (double) s->planeheight[i] * s->planewidth[i] / sum;
299 
300  s->temp = av_malloc((2 * inlink->w + 12) * sizeof(*s->temp));
301  if (!s->temp)
302  return AVERROR(ENOMEM);
303 
306  if (ARCH_X86)
307  ff_ssim_init_x86(&s->dsp);
308 
309  return 0;
310 }
311 
312 static int config_output(AVFilterLink *outlink)
313 {
314  AVFilterContext *ctx = outlink->src;
315  SSIMContext *s = ctx->priv;
316  AVFilterLink *mainlink = ctx->inputs[0];
317  int ret;
318 
319  outlink->w = mainlink->w;
320  outlink->h = mainlink->h;
321  outlink->time_base = mainlink->time_base;
322  outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio;
323  outlink->frame_rate = mainlink->frame_rate;
324 
325  if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
326  return ret;
327 
328  return 0;
329 }
330 
331 static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
332 {
333  SSIMContext *s = inlink->dst->priv;
334  return ff_dualinput_filter_frame(&s->dinput, inlink, buf);
335 }
336 
337 static int request_frame(AVFilterLink *outlink)
338 {
339  SSIMContext *s = outlink->src->priv;
340  return ff_dualinput_request_frame(&s->dinput, outlink);
341 }
342 
344 {
345  SSIMContext *s = ctx->priv;
346 
347  if (s->nb_frames > 0) {
348  char buf[256];
349  int i;
350  buf[0] = 0;
351  for (i = 0; i < s->nb_components; i++) {
352  int c = s->is_rgb ? s->rgba_map[i] : i;
353  av_strlcatf(buf, sizeof(buf), " %c:%f (%f)", s->comps[i], s->ssim[c] / s->nb_frames,
354  ssim_db(s->ssim[c], s->nb_frames));
355  }
356  av_log(ctx, AV_LOG_INFO, "SSIM%s All:%f (%f)\n", buf,
357  s->ssim_total / s->nb_frames, ssim_db(s->ssim_total, s->nb_frames));
358  }
359 
361 
362  if (s->stats_file && s->stats_file != stdout)
363  fclose(s->stats_file);
364 
365  av_freep(&s->temp);
366 }
367 
368 static const AVFilterPad ssim_inputs[] = {
369  {
370  .name = "main",
371  .type = AVMEDIA_TYPE_VIDEO,
372  .filter_frame = filter_frame,
373  },{
374  .name = "reference",
375  .type = AVMEDIA_TYPE_VIDEO,
376  .filter_frame = filter_frame,
377  .config_props = config_input_ref,
378  },
379  { NULL }
380 };
381 
382 static const AVFilterPad ssim_outputs[] = {
383  {
384  .name = "default",
385  .type = AVMEDIA_TYPE_VIDEO,
386  .config_props = config_output,
387  .request_frame = request_frame,
388  },
389  { NULL }
390 };
391 
393  .name = "ssim",
394  .description = NULL_IF_CONFIG_SMALL("Calculate the SSIM between two video streams."),
395  .init = init,
396  .uninit = uninit,
397  .query_formats = query_formats,
398  .priv_size = sizeof(SSIMContext),
399  .priv_class = &ssim_class,
400  .inputs = ssim_inputs,
401  .outputs = ssim_outputs,
402 };
#define NULL
Definition: coverity.c:32
const char * s
Definition: avisynth_c.h:631
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2222
This structure describes decoded (raw) audio or video data.
Definition: frame.h:184
FFDualInputContext dinput
Definition: vf_ssim.c:50
AVOption.
Definition: opt.h:245
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_ssim.c:343
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
Main libavfilter public API header.
else temp
Definition: vf_mcdeint.c:259
const char * desc
Definition: nvenc.c:89
int nb_components
Definition: vf_ssim.c:53
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:180
const char * b
Definition: vf_curves.c:109
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:92
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
const char * name
Pad name.
Definition: internal.h:59
int ff_dualinput_filter_frame(FFDualInputContext *s, AVFilterLink *inlink, AVFrame *in)
Definition: dualinput.c:76
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:313
static av_cold int init(AVFilterContext *ctx)
Definition: vf_ssim.c:222
uint8_t
#define av_cold
Definition: attributes.h:82
#define av_malloc(s)
AVOptions.
static const AVFilterPad ssim_inputs[]
Definition: vf_ssim.c:368
int shortest
terminate stream when the second input terminates
Definition: dualinput.h:36
#define height
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:101
static void ssim_4x4xn(const uint8_t *main, ptrdiff_t main_stride, const uint8_t *ref, ptrdiff_t ref_stride, int(*sums)[4], int width)
Definition: vf_ssim.c:90
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
static float ssim_end1(int s1, int s2, int ss, int s12)
Definition: vf_ssim.c:121
void ff_dualinput_uninit(FFDualInputContext *s)
Definition: dualinput.c:87
static AVFrame * do_ssim(AVFilterContext *ctx, AVFrame *main, const AVFrame *ref)
Definition: vf_ssim.c:182
#define av_log(a,...)
A filter pad used for either input or output.
Definition: internal.h:53
#define FLAGS
Definition: vf_ssim.c:67
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:568
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:101
#define s2
Definition: regdef.h:39
#define AVERROR(e)
Definition: error.h:43
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
uint8_t rgba_map[4]
Definition: vf_ssim.c:58
void ff_ssim_init_x86(SSIMDSPContext *dsp)
Definition: vf_ssim_init.c:33
void * priv
private data for use by the filter
Definition: avfilter.h:320
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
int planewidth[4]
Definition: vf_ssim.c:59
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:83
#define OFFSET(x)
Definition: vf_ssim.c:66
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
#define width
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
static int request_frame(AVFilterLink *outlink)
Definition: vf_ssim.c:337
AVFormatContext * ctx
Definition: movenc.c:48
AVFrame *(* process)(AVFilterContext *ctx, AVFrame *main, const AVFrame *second)
Definition: dualinput.h:35
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
Definition: drawutils.c:35
static const AVOption ssim_options[]
Definition: vf_ssim.c:69
static const uint8_t vars[2][12]
Definition: camellia.c:179
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
misc drawing utilities
AVDictionary ** avpriv_frame_get_metadatap(AVFrame *frame)
Definition: frame.c:46
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:215
#define ss
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
FILE * stats_file
Definition: vf_ssim.c:51
int repeatlast
repeat last second frame
Definition: dualinput.h:37
void * buf
Definition: avisynth_c.h:553
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: vf_ssim.c:331
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:69
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:68
static int config_input_ref(AVFilterLink *inlink)
Definition: vf_ssim.c:266
AVFILTER_DEFINE_CLASS(ssim)
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:142
int planeheight[4]
Definition: vf_ssim.c:60
float coefs[4]
Definition: vf_ssim.c:57
void(* ssim_4x4_line)(const uint8_t *buf, ptrdiff_t buf_stride, const uint8_t *ref, ptrdiff_t ref_stride, int(*sums)[4], int w)
Definition: ssim.h:28
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
Definition: avstring.c:101
uint64_t nb_frames
Definition: vf_ssim.c:54
const char * name
Filter name.
Definition: avfilter.h:146
#define s1
Definition: regdef.h:38
#define snprintf
Definition: snprintf.h:34
int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
Definition: dualinput.c:43
static float ssim_plane(SSIMDSPContext *dsp, uint8_t *main, int main_stride, uint8_t *ref, int ref_stride, int width, int height, void *temp)
Definition: vf_ssim.c:150
static int weight(int i, int blen, int offset)
Definition: diracdec.c:1429
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
SSIMDSPContext dsp
Definition: vf_ssim.c:63
char comps[4]
Definition: vf_ssim.c:56
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:198
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
Definition: error.c:105
static double ssim_db(double ssim, double weight)
Definition: vf_ssim.c:177
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:107
static double c[64]
double ssim_total
Definition: vf_ssim.c:55
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:76
static int config_output(AVFilterLink *outlink)
Definition: vf_ssim.c:312
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:69
AVFilter ff_vf_ssim
Definition: vf_ssim.c:392
double ssim[4]
Definition: vf_ssim.c:55
static const AVFilterPad ssim_outputs[]
Definition: vf_ssim.c:382
Double input streams helper for filters.
A list of supported formats for one end of a filter link.
Definition: formats.h:64
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:271
float(* ssim_end_line)(const int(*sum0)[4], const int(*sum1)[4], int w)
Definition: ssim.h:31
static int query_formats(AVFilterContext *ctx)
Definition: vf_ssim.c:248
An instance of a filter.
Definition: avfilter.h:305
int ff_dualinput_request_frame(FFDualInputContext *s, AVFilterLink *outlink)
Definition: dualinput.c:82
#define av_freep(p)
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
Definition: eamad.c:83
int * temp
Definition: vf_ssim.c:61
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:100
#define FFSWAP(type, a, b)
Definition: common.h:99
int main(int argc, char **argv)
Definition: main.c:22
internal API functions
static void set_meta(AVDictionary **metadata, const char *key, char comp, float d)
Definition: vf_ssim.c:77
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
int is_rgb
Definition: vf_ssim.c:62
char * stats_file_str
Definition: vf_ssim.c:52
for(j=16;j >0;--j)
static float ssim_endn(const int(*sum0)[4], const int(*sum1)[4], int width)
Definition: vf_ssim.c:137
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58