FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vf_psnr.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Roger Pau MonnĂ© <roger.pau@entel.upc.edu>
3  * Copyright (c) 2011 Stefano Sabatini
4  * Copyright (c) 2013 Paul B Mahol
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * Caculate the PSNR between two input videos.
26  */
27 
28 #include "libavutil/avstring.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/pixdesc.h"
31 #include "avfilter.h"
32 #include "dualinput.h"
33 #include "drawutils.h"
34 #include "formats.h"
35 #include "internal.h"
36 #include "psnr.h"
37 #include "video.h"
38 
39 typedef struct PSNRContext {
40  const AVClass *class;
42  double mse, min_mse, max_mse, mse_comp[4];
43  uint64_t nb_frames;
44  FILE *stats_file;
46  int max[4], average_max;
47  int is_rgb;
49  char comps[4];
51  int planewidth[4];
52  int planeheight[4];
53  double planeweight[4];
55 } PSNRContext;
56 
57 #define OFFSET(x) offsetof(PSNRContext, x)
58 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
59 
60 static const AVOption psnr_options[] = {
61  {"stats_file", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
62  {"f", "Set file where to store per-frame difference information", OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
63  { NULL }
64 };
65 
67 
68 static inline unsigned pow2(unsigned base)
69 {
70  return base*base;
71 }
72 
73 static inline double get_psnr(double mse, uint64_t nb_frames, int max)
74 {
75  return 10.0 * log10(pow2(max) / (mse / nb_frames));
76 }
77 
78 static uint64_t sse_line_8bit(const uint8_t *main_line, const uint8_t *ref_line, int outw)
79 {
80  int j;
81  unsigned m2 = 0;
82 
83  for (j = 0; j < outw; j++)
84  m2 += pow2(main_line[j] - ref_line[j]);
85 
86  return m2;
87 }
88 
89 static uint64_t sse_line_16bit(const uint8_t *_main_line, const uint8_t *_ref_line, int outw)
90 {
91  int j;
92  uint64_t m2 = 0;
93  const uint16_t *main_line = (const uint16_t *) _main_line;
94  const uint16_t *ref_line = (const uint16_t *) _ref_line;
95 
96  for (j = 0; j < outw; j++)
97  m2 += pow2(main_line[j] - ref_line[j]);
98 
99  return m2;
100 }
101 
102 static inline
104  const uint8_t *main_data[4], const int main_linesizes[4],
105  const uint8_t *ref_data[4], const int ref_linesizes[4],
106  int w, int h, double mse[4])
107 {
108  int i, c;
109 
110  for (c = 0; c < s->nb_components; c++) {
111  const int outw = s->planewidth[c];
112  const int outh = s->planeheight[c];
113  const uint8_t *main_line = main_data[c];
114  const uint8_t *ref_line = ref_data[c];
115  const int ref_linesize = ref_linesizes[c];
116  const int main_linesize = main_linesizes[c];
117  uint64_t m = 0;
118  for (i = 0; i < outh; i++) {
119  m += s->dsp.sse_line(main_line, ref_line, outw);
120  ref_line += ref_linesize;
121  main_line += main_linesize;
122  }
123  mse[c] = m / (double)(outw * outh);
124  }
125 }
126 
127 static void set_meta(AVDictionary **metadata, const char *key, char comp, float d)
128 {
129  char value[128];
130  snprintf(value, sizeof(value), "%0.2f", d);
131  if (comp) {
132  char key2[128];
133  snprintf(key2, sizeof(key2), "%s%c", key, comp);
134  av_dict_set(metadata, key2, value, 0);
135  } else {
136  av_dict_set(metadata, key, value, 0);
137  }
138 }
139 
141  const AVFrame *ref)
142 {
143  PSNRContext *s = ctx->priv;
144  double comp_mse[4], mse = 0;
145  int j, c;
146  AVDictionary **metadata = avpriv_frame_get_metadatap(main);
147 
148  compute_images_mse(s, (const uint8_t **)main->data, main->linesize,
149  (const uint8_t **)ref->data, ref->linesize,
150  main->width, main->height, comp_mse);
151 
152  for (j = 0; j < s->nb_components; j++)
153  mse += comp_mse[j] * s->planeweight[j];
154 
155  s->min_mse = FFMIN(s->min_mse, mse);
156  s->max_mse = FFMAX(s->max_mse, mse);
157 
158  s->mse += mse;
159  for (j = 0; j < s->nb_components; j++)
160  s->mse_comp[j] += comp_mse[j];
161  s->nb_frames++;
162 
163  for (j = 0; j < s->nb_components; j++) {
164  c = s->is_rgb ? s->rgba_map[j] : j;
165  set_meta(metadata, "lavfi.psnr.mse.", s->comps[j], comp_mse[c]);
166  set_meta(metadata, "lavfi.psnr.psnr.", s->comps[j], get_psnr(comp_mse[c], 1, s->max[c]));
167  }
168  set_meta(metadata, "lavfi.psnr.mse_avg", 0, mse);
169  set_meta(metadata, "lavfi.psnr.psnr_avg", 0, get_psnr(mse, 1, s->average_max));
170 
171  if (s->stats_file) {
172  fprintf(s->stats_file, "n:%"PRId64" mse_avg:%0.2f ", s->nb_frames, mse);
173  for (j = 0; j < s->nb_components; j++) {
174  c = s->is_rgb ? s->rgba_map[j] : j;
175  fprintf(s->stats_file, "mse_%c:%0.2f ", s->comps[j], comp_mse[c]);
176  }
177  fprintf(s->stats_file, "psnr_avg:%0.2f ", get_psnr(mse, 1, s->average_max));
178  for (j = 0; j < s->nb_components; j++) {
179  c = s->is_rgb ? s->rgba_map[j] : j;
180  fprintf(s->stats_file, "psnr_%c:%0.2f ", s->comps[j],
181  get_psnr(comp_mse[c], 1, s->max[c]));
182  }
183  fprintf(s->stats_file, "\n");
184  }
185 
186  return main;
187 }
188 
190 {
191  PSNRContext *s = ctx->priv;
192 
193  s->min_mse = +INFINITY;
194  s->max_mse = -INFINITY;
195 
196  if (s->stats_file_str) {
197  if (!strcmp(s->stats_file_str, "-")) {
198  s->stats_file = stdout;
199  } else {
200  s->stats_file = fopen(s->stats_file_str, "w");
201  if (!s->stats_file) {
202  int err = AVERROR(errno);
203  char buf[128];
204  av_strerror(err, buf, sizeof(buf));
205  av_log(ctx, AV_LOG_ERROR, "Could not open stats file %s: %s\n",
206  s->stats_file_str, buf);
207  return err;
208  }
209  }
210  }
211 
212  s->dinput.process = do_psnr;
213  return 0;
214 }
215 
217 {
218  static const enum AVPixelFormat pix_fmts[] = {
220 #define PF_NOALPHA(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf
221 #define PF_ALPHA(suf) AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf
222 #define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf)
223  PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
231  };
232 
233  AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
234  if (!fmts_list)
235  return AVERROR(ENOMEM);
236  return ff_set_common_formats(ctx, fmts_list);
237 }
238 
239 static int config_input_ref(AVFilterLink *inlink)
240 {
242  AVFilterContext *ctx = inlink->dst;
243  PSNRContext *s = ctx->priv;
244  unsigned sum;
245  int j;
246 
247  s->nb_components = desc->nb_components;
248  if (ctx->inputs[0]->w != ctx->inputs[1]->w ||
249  ctx->inputs[0]->h != ctx->inputs[1]->h) {
250  av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n");
251  return AVERROR(EINVAL);
252  }
253  if (ctx->inputs[0]->format != ctx->inputs[1]->format) {
254  av_log(ctx, AV_LOG_ERROR, "Inputs must be of same pixel format.\n");
255  return AVERROR(EINVAL);
256  }
257 
258  s->max[0] = (1 << desc->comp[0].depth) - 1;
259  s->max[1] = (1 << desc->comp[1].depth) - 1;
260  s->max[2] = (1 << desc->comp[2].depth) - 1;
261  s->max[3] = (1 << desc->comp[3].depth) - 1;
262 
263  s->is_rgb = ff_fill_rgba_map(s->rgba_map, inlink->format) >= 0;
264  s->comps[0] = s->is_rgb ? 'r' : 'y' ;
265  s->comps[1] = s->is_rgb ? 'g' : 'u' ;
266  s->comps[2] = s->is_rgb ? 'b' : 'v' ;
267  s->comps[3] = 'a';
268 
269  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
270  s->planeheight[0] = s->planeheight[3] = inlink->h;
271  s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
272  s->planewidth[0] = s->planewidth[3] = inlink->w;
273  sum = 0;
274  for (j = 0; j < s->nb_components; j++)
275  sum += s->planeheight[j] * s->planewidth[j];
276  for (j = 0; j < s->nb_components; j++) {
277  s->planeweight[j] = (double) s->planeheight[j] * s->planewidth[j] / sum;
278  s->average_max += s->max[j] * s->planeweight[j];
279  }
280 
281  s->dsp.sse_line = desc->comp[0].depth > 8 ? sse_line_16bit : sse_line_8bit;
282  if (ARCH_X86)
283  ff_psnr_init_x86(&s->dsp, desc->comp[0].depth);
284 
285  return 0;
286 }
287 
288 static int config_output(AVFilterLink *outlink)
289 {
290  AVFilterContext *ctx = outlink->src;
291  PSNRContext *s = ctx->priv;
292  AVFilterLink *mainlink = ctx->inputs[0];
293  int ret;
294 
295  outlink->w = mainlink->w;
296  outlink->h = mainlink->h;
297  outlink->time_base = mainlink->time_base;
298  outlink->sample_aspect_ratio = mainlink->sample_aspect_ratio;
299  outlink->frame_rate = mainlink->frame_rate;
300  if ((ret = ff_dualinput_init(ctx, &s->dinput)) < 0)
301  return ret;
302 
303  return 0;
304 }
305 
306 static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
307 {
308  PSNRContext *s = inlink->dst->priv;
309  return ff_dualinput_filter_frame(&s->dinput, inlink, inpicref);
310 }
311 
312 static int request_frame(AVFilterLink *outlink)
313 {
314  PSNRContext *s = outlink->src->priv;
315  return ff_dualinput_request_frame(&s->dinput, outlink);
316 }
317 
319 {
320  PSNRContext *s = ctx->priv;
321 
322  if (s->nb_frames > 0) {
323  int j;
324  char buf[256];
325 
326  buf[0] = 0;
327  for (j = 0; j < s->nb_components; j++) {
328  int c = s->is_rgb ? s->rgba_map[j] : j;
329  av_strlcatf(buf, sizeof(buf), " %c:%f", s->comps[j],
330  get_psnr(s->mse_comp[c], s->nb_frames, s->max[c]));
331  }
332  av_log(ctx, AV_LOG_INFO, "PSNR%s average:%f min:%f max:%f\n",
333  buf,
334  get_psnr(s->mse, s->nb_frames, s->average_max),
335  get_psnr(s->max_mse, 1, s->average_max),
336  get_psnr(s->min_mse, 1, s->average_max));
337  }
338 
340 
341  if (s->stats_file && s->stats_file != stdout)
342  fclose(s->stats_file);
343 }
344 
345 static const AVFilterPad psnr_inputs[] = {
346  {
347  .name = "main",
348  .type = AVMEDIA_TYPE_VIDEO,
349  .filter_frame = filter_frame,
350  },{
351  .name = "reference",
352  .type = AVMEDIA_TYPE_VIDEO,
353  .filter_frame = filter_frame,
354  .config_props = config_input_ref,
355  },
356  { NULL }
357 };
358 
359 static const AVFilterPad psnr_outputs[] = {
360  {
361  .name = "default",
362  .type = AVMEDIA_TYPE_VIDEO,
363  .config_props = config_output,
364  .request_frame = request_frame,
365  },
366  { NULL }
367 };
368 
370  .name = "psnr",
371  .description = NULL_IF_CONFIG_SMALL("Calculate the PSNR between two video streams."),
372  .init = init,
373  .uninit = uninit,
374  .query_formats = query_formats,
375  .priv_size = sizeof(PSNRContext),
376  .priv_class = &psnr_class,
377  .inputs = psnr_inputs,
378  .outputs = psnr_outputs,
379 };
double max_mse
Definition: vf_psnr.c:42
#define PF_NOALPHA(suf)
#define NULL
Definition: coverity.c:32
double mse_comp[4]
Definition: vf_psnr.c:42
const char * s
Definition: avisynth_c.h:631
#define P
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
AVOption.
Definition: opt.h:245
Main libavfilter public API header.
const char * desc
Definition: nvenc.c:89
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:180
int planewidth[4]
Definition: vf_psnr.c:51
static AVFrame * do_psnr(AVFilterContext *ctx, AVFrame *main, const AVFrame *ref)
Definition: vf_psnr.c:140
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:357
static uint64_t sse_line_8bit(const uint8_t *main_line, const uint8_t *ref_line, int outw)
Definition: vf_psnr.c:78
char * stats_file_str
Definition: vf_psnr.c:45
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:92
int max[4]
Definition: vf_psnr.c:46
static int request_frame(AVFilterLink *outlink)
Definition: vf_psnr.c:312
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
#define OFFSET(x)
Definition: vf_psnr.c:57
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
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:117
uint8_t
#define av_cold
Definition: attributes.h:82
static double get_psnr(double mse, uint64_t nb_frames, int max)
Definition: vf_psnr.c:73
static void compute_images_mse(PSNRContext *s, const uint8_t *main_data[4], const int main_linesizes[4], const uint8_t *ref_data[4], const int ref_linesizes[4], int w, int h, double mse[4])
Definition: vf_psnr.c:103
AVOptions.
double min_mse
Definition: vf_psnr.c:42
#define PF(suf)
static double psnr(double d)
Definition: ffmpeg.c:1233
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
Definition: vf_psnr.c:306
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:356
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:101
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
void ff_dualinput_uninit(FFDualInputContext *s)
Definition: dualinput.c:87
#define av_log(a,...)
unsigned m
Definition: audioconvert.c:187
int is_rgb
Definition: vf_psnr.c:47
A filter pad used for either input or output.
Definition: internal.h:53
int width
width and height of the video frame
Definition: frame.h:236
#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 AVERROR(e)
Definition: error.h:43
uint8_t rgba_map[4]
Definition: vf_psnr.c:48
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static int config_input_ref(AVFilterLink *inlink)
Definition: vf_psnr.c:239
void * priv
private data for use by the filter
Definition: avfilter.h:320
FFDualInputContext dinput
Definition: vf_psnr.c:41
#define FFMAX(a, b)
Definition: common.h:94
char comps[4]
Definition: vf_psnr.c:49
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_psnr.c:318
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:363
int planeheight[4]
Definition: vf_psnr.c:52
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:83
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:360
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:325
#define FFMIN(a, b)
Definition: common.h:96
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
static void set_meta(AVDictionary **metadata, const char *key, char comp, float d)
Definition: vf_psnr.c:127
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
static int config_output(AVFilterLink *outlink)
Definition: vf_psnr.c:288
AVFormatContext * ctx
Definition: movenc.c:48
uint64_t nb_frames
Definition: vf_psnr.c:43
static av_cold int init(AVFilterContext *ctx)
Definition: vf_psnr.c:189
AVFrame *(* process)(AVFilterContext *ctx, AVFrame *main, const AVFrame *second)
Definition: dualinput.h:35
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:386
static unsigned pow2(unsigned base)
Definition: vf_psnr.c:68
uint64_t(* sse_line)(const uint8_t *buf, const uint8_t *ref, int w)
Definition: psnr.h:28
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:359
PSNRDSPContext dsp
Definition: vf_psnr.c:54
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
Definition: drawutils.c:35
#define INFINITY
Definition: math.h:27
FILE * stats_file
Definition: vf_psnr.c:44
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:376
#define FLAGS
Definition: vf_psnr.c:58
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
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
void * buf
Definition: avisynth_c.h:553
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
Describe the class of an AVClass context structure.
Definition: log.h:67
Filter definition.
Definition: avfilter.h:142
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
Definition: avstring.c:101
const char * name
Filter name.
Definition: avfilter.h:146
#define snprintf
Definition: snprintf.h:34
int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
Definition: dualinput.c:43
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:358
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:198
double mse
Definition: vf_psnr.c:42
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 const AVFilterPad psnr_inputs[]
Definition: vf_psnr.c:345
double planeweight[4]
Definition: vf_psnr.c:53
Y , 8bpp.
Definition: pixfmt.h:70
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:107
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:228
static double c[64]
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 const AVFilterPad psnr_outputs[]
Definition: vf_psnr.c:359
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:69
static const AVOption psnr_options[]
Definition: vf_psnr.c:60
int nb_components
Definition: vf_psnr.c:50
static int query_formats(AVFilterContext *ctx)
Definition: vf_psnr.c:216
Double input streams helper for filters.
AVFILTER_DEFINE_CLASS(psnr)
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
An instance of a filter.
Definition: avfilter.h:305
int ff_dualinput_request_frame(FFDualInputContext *s, AVFilterLink *outlink)
Definition: dualinput.c:82
static uint64_t sse_line_16bit(const uint8_t *_main_line, const uint8_t *_ref_line, int outw)
Definition: vf_psnr.c:89
AVFilter ff_vf_psnr
Definition: vf_psnr.c:369
int height
Definition: frame.h:236
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
Definition: eamad.c:83
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:100
void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
Definition: vf_psnr_init.c:28
int main(int argc, char **argv)
Definition: main.c:22
internal API functions
int depth
Number of bits in the component.
Definition: pixdesc.h:58
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
for(j=16;j >0;--j)
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
int average_max
Definition: vf_psnr.c:46