FFmpeg
dump.c
Go to the documentation of this file.
1 /*
2  * Various pretty-printing functions for use within FFmpeg
3  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
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 #include <stdio.h>
23 #include <stdint.h>
24 
25 #include "libavutil/avstring.h"
27 #include "libavutil/display.h"
28 #include "libavutil/iamf.h"
29 #include "libavutil/intreadwrite.h"
30 #include "libavutil/log.h"
33 #include "libavutil/dovi_meta.h"
34 #include "libavutil/mathematics.h"
35 #include "libavutil/mem.h"
36 #include "libavutil/opt.h"
37 #include "libavutil/replaygain.h"
38 #include "libavutil/spherical.h"
39 #include "libavutil/stereo3d.h"
40 #include "libavutil/tdrdi.h"
41 #include "libavutil/timecode.h"
42 
43 #include "libavcodec/avcodec.h"
44 
45 #include "avformat.h"
46 #include "internal.h"
47 
48 #define HEXDUMP_PRINT(...) \
49  do { \
50  if (!f) \
51  av_log(avcl, level, __VA_ARGS__); \
52  else \
53  fprintf(f, __VA_ARGS__); \
54  } while (0)
55 
56 static void hex_dump_internal(void *avcl, FILE *f, int level,
57  const uint8_t *buf, int size)
58 {
59  int len, i, j, c;
60 
61  for (i = 0; i < size; i += 16) {
62  len = size - i;
63  if (len > 16)
64  len = 16;
65  HEXDUMP_PRINT("%08x ", i);
66  for (j = 0; j < 16; j++) {
67  if (j < len)
68  HEXDUMP_PRINT(" %02x", buf[i + j]);
69  else
70  HEXDUMP_PRINT(" ");
71  }
72  HEXDUMP_PRINT(" ");
73  for (j = 0; j < len; j++) {
74  c = buf[i + j];
75  if (c < ' ' || c > '~')
76  c = '.';
77  HEXDUMP_PRINT("%c", c);
78  }
79  HEXDUMP_PRINT("\n");
80  }
81 }
82 
83 void av_hex_dump(FILE *f, const uint8_t *buf, int size)
84 {
85  hex_dump_internal(NULL, f, 0, buf, size);
86 }
87 
88 void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
89 {
90  hex_dump_internal(avcl, NULL, level, buf, size);
91 }
92 
93 static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt,
94  int dump_payload, AVRational time_base)
95 {
96  HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
97  HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
98  HEXDUMP_PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base));
99  /* DTS is _always_ valid after av_read_frame() */
100  HEXDUMP_PRINT(" dts=");
101  if (pkt->dts == AV_NOPTS_VALUE)
102  HEXDUMP_PRINT("N/A");
103  else
104  HEXDUMP_PRINT("%0.3f", pkt->dts * av_q2d(time_base));
105  /* PTS may not be known if B-frames are present. */
106  HEXDUMP_PRINT(" pts=");
107  if (pkt->pts == AV_NOPTS_VALUE)
108  HEXDUMP_PRINT("N/A");
109  else
110  HEXDUMP_PRINT("%0.3f", pkt->pts * av_q2d(time_base));
111  HEXDUMP_PRINT("\n");
112  HEXDUMP_PRINT(" size=%d\n", pkt->size);
113  if (dump_payload)
114  hex_dump_internal(avcl, f, level, pkt->data, pkt->size);
115 }
116 
117 void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
118 {
119  pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base);
120 }
121 
122 void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload,
123  const AVStream *st)
124 {
125  pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
126 }
127 
128 
129 static void print_fps(double d, const char *postfix, int log_level)
130 {
131  uint64_t v = lrintf(d * 100);
132  if (!v)
133  av_log(NULL, log_level, "%1.4f %s", d, postfix);
134  else if (v % 100)
135  av_log(NULL, log_level, "%3.2f %s", d, postfix);
136  else if (v % (100 * 1000))
137  av_log(NULL, log_level, "%1.0f %s", d, postfix);
138  else
139  av_log(NULL, log_level, "%1.0fk %s", d / 1000, postfix);
140 }
141 
142 static void dump_dictionary(void *ctx, const AVDictionary *m,
143  const char *name, const char *indent,
144  int log_level)
145 {
146  const AVDictionaryEntry *tag = NULL;
147 
148  if (!m)
149  return;
150 
151  av_log(ctx, log_level, "%s%s:\n", indent, name);
152  while ((tag = av_dict_iterate(m, tag)))
153  if (strcmp("language", tag->key)) {
154  const char *p = tag->value;
155  av_log(ctx, log_level,
156  "%s %-16s: ", indent, tag->key);
157  while (*p) {
158  size_t len = strcspn(p, "\x8\xa\xb\xc\xd");
159  av_log(ctx, log_level, "%.*s", (int)(FFMIN(255, len)), p);
160  p += len;
161  if (*p == 0xd) av_log(ctx, log_level, " ");
162  if (*p == 0xa) av_log(ctx, log_level, "\n%s %-16s: ", indent, "");
163  if (*p) p++;
164  }
165  av_log(ctx, log_level, "\n");
166  }
167 }
168 
169 static void dump_metadata(void *ctx, const AVDictionary *m, const char *indent,
170  int log_level)
171 {
172  if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0)))
173  dump_dictionary(ctx, m, "Metadata", indent, log_level);
174 }
175 
176 /* param change side data*/
177 static void dump_paramchange(void *ctx, const AVPacketSideData *sd, int log_level)
178 {
179  int size = sd->size;
180  const uint8_t *data = sd->data;
181  uint32_t flags, sample_rate, width, height;
182 
183  if (!data || sd->size < 4)
184  goto fail;
185 
186  flags = AV_RL32(data);
187  data += 4;
188  size -= 4;
189 
191  if (size < 4)
192  goto fail;
193  sample_rate = AV_RL32(data);
194  data += 4;
195  size -= 4;
196  av_log(ctx, log_level, "sample_rate %"PRIu32", ", sample_rate);
197  }
199  if (size < 8)
200  goto fail;
201  width = AV_RL32(data);
202  data += 4;
203  size -= 4;
204  height = AV_RL32(data);
205  data += 4;
206  size -= 4;
207  av_log(ctx, log_level, "width %"PRIu32" height %"PRIu32, width, height);
208  }
209 
210  return;
211 fail:
212  av_log(ctx, AV_LOG_ERROR, "unknown param\n");
213 }
214 
215 /* replaygain side data*/
216 static void print_gain(void *ctx, const char *str, int32_t gain, int log_level)
217 {
218  av_log(ctx, log_level, "%s - ", str);
219  if (gain == INT32_MIN)
220  av_log(ctx, log_level, "unknown");
221  else
222  av_log(ctx, log_level, "%f", gain / 100000.0f);
223  av_log(ctx, log_level, ", ");
224 }
225 
226 static void print_peak(void *ctx, const char *str, uint32_t peak, int log_level)
227 {
228  av_log(ctx, log_level, "%s - ", str);
229  if (!peak)
230  av_log(ctx, log_level, "unknown");
231  else
232  av_log(ctx, log_level, "%f", (float) peak / UINT32_MAX);
233  av_log(ctx, log_level, ", ");
234 }
235 
236 static void dump_replaygain(void *ctx, const AVPacketSideData *sd, int log_level)
237 {
238  const AVReplayGain *rg;
239 
240  if (sd->size < sizeof(*rg)) {
241  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
242  return;
243  }
244  rg = (const AVReplayGain *)sd->data;
245 
246  print_gain(ctx, "track gain", rg->track_gain, log_level);
247  print_peak(ctx, "track peak", rg->track_peak, log_level);
248  print_gain(ctx, "album gain", rg->album_gain, log_level);
249  print_peak(ctx, "album peak", rg->album_peak, log_level);
250 }
251 
252 static void dump_stereo3d(void *ctx, const AVPacketSideData *sd, int log_level)
253 {
254  const AVStereo3D *stereo;
255 
256  if (sd->size < sizeof(*stereo)) {
257  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
258  return;
259  }
260 
261  stereo = (const AVStereo3D *)sd->data;
262 
263  av_log(ctx, log_level, "%s, view: %s, primary eye: %s",
266  if (stereo->baseline)
267  av_log(ctx, log_level, ", baseline: %"PRIu32"", stereo->baseline);
269  av_log(ctx, log_level, ", horizontal_disparity_adjustment: %0.4f",
272  av_log(ctx, log_level, ", horizontal_field_of_view: %0.3f", av_q2d(stereo->horizontal_field_of_view));
273 
274  if (stereo->flags & AV_STEREO3D_FLAG_INVERT)
275  av_log(ctx, log_level, " (inverted)");
276 }
277 
278 static void dump_audioservicetype(void *ctx, const AVPacketSideData *sd, int log_level)
279 {
280  const enum AVAudioServiceType *ast = (const enum AVAudioServiceType *)sd->data;
281 
282  if (sd->size < sizeof(*ast)) {
283  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
284  return;
285  }
286 
287  switch (*ast) {
289  av_log(ctx, log_level, "main");
290  break;
292  av_log(ctx, log_level, "effects");
293  break;
295  av_log(ctx, log_level, "visually impaired");
296  break;
298  av_log(ctx, log_level, "hearing impaired");
299  break;
301  av_log(ctx, log_level, "dialogue");
302  break;
304  av_log(ctx, log_level, "commentary");
305  break;
307  av_log(ctx, log_level, "emergency");
308  break;
310  av_log(ctx, log_level, "voice over");
311  break;
313  av_log(ctx, log_level, "karaoke");
314  break;
315  default:
316  av_log(ctx, AV_LOG_WARNING, "unknown");
317  break;
318  }
319 }
320 
321 static void dump_cpb(void *ctx, const AVPacketSideData *sd, int log_level)
322 {
323  const AVCPBProperties *cpb = (const AVCPBProperties *)sd->data;
324 
325  if (sd->size < sizeof(*cpb)) {
326  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
327  return;
328  }
329 
330  av_log(ctx, log_level,
331  "bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %"PRId64" ",
332  cpb->max_bitrate, cpb->min_bitrate, cpb->avg_bitrate,
333  cpb->buffer_size);
334  if (cpb->vbv_delay == UINT64_MAX)
335  av_log(ctx, log_level, "vbv_delay: N/A");
336  else
337  av_log(ctx, log_level, "vbv_delay: %"PRIu64"", cpb->vbv_delay);
338 }
339 
341  int log_level)
342 {
344  (const AVMasteringDisplayMetadata *)sd->data;
345  av_log(ctx, log_level,
346  "has_primaries:%d has_luminance:%d "
347  "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
348  "min_luminance=%f, max_luminance=%f",
349  metadata->has_primaries, metadata->has_luminance,
350  av_q2d(metadata->display_primaries[0][0]),
351  av_q2d(metadata->display_primaries[0][1]),
352  av_q2d(metadata->display_primaries[1][0]),
353  av_q2d(metadata->display_primaries[1][1]),
354  av_q2d(metadata->display_primaries[2][0]),
355  av_q2d(metadata->display_primaries[2][1]),
356  av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1]),
357  av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance));
358 }
359 
360 static void dump_content_light_metadata(void *ctx, const AVPacketSideData *sd,
361  int log_level)
362 {
364  (const AVContentLightMetadata *)sd->data;
365  av_log(ctx, log_level,
366  "MaxCLL=%d, MaxFALL=%d",
367  metadata->MaxCLL, metadata->MaxFALL);
368 }
369 
371 {
372  const AVAmbientViewingEnvironment *ambient =
373  (const AVAmbientViewingEnvironment *)sd->data;
375  "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f",
376  av_q2d(ambient->ambient_illuminance),
377  av_q2d(ambient->ambient_light_x),
378  av_q2d(ambient->ambient_light_y));
379 }
380 
381 static void dump_spherical(void *ctx, int w, int h,
382  const AVPacketSideData *sd, int log_level)
383 {
384  const AVSphericalMapping *spherical = (const AVSphericalMapping *)sd->data;
385  double yaw, pitch, roll;
386 
387  if (sd->size < sizeof(*spherical)) {
388  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
389  return;
390  }
391 
392  av_log(ctx, log_level, "%s ", av_spherical_projection_name(spherical->projection));
393 
394  if (spherical->yaw || spherical->pitch || spherical->roll) {
395  yaw = ((double)spherical->yaw) / (1 << 16);
396  pitch = ((double)spherical->pitch) / (1 << 16);
397  roll = ((double)spherical->roll) / (1 << 16);
398  av_log(ctx, log_level, "(%f/%f/%f) ", yaw, pitch, roll);
399  }
400 
401  if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR_TILE) {
402  size_t l, t, r, b;
403  av_spherical_tile_bounds(spherical, w, h,
404  &l, &t, &r, &b);
405  av_log(ctx, log_level,
407  l, t, r, b);
408  } else if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
409  av_log(ctx, log_level, "[pad %"PRIu32"] ", spherical->padding);
410  }
411 }
412 
413 static void dump_dovi_conf(void *ctx, const AVPacketSideData *sd,
414  int log_level)
415 {
418 
419  av_log(ctx, log_level, "version: %d.%d, profile: %d, level: %d, "
420  "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d, "
421  "compression: %d",
422  dovi->dv_version_major, dovi->dv_version_minor,
423  dovi->dv_profile, dovi->dv_level,
424  dovi->rpu_present_flag,
425  dovi->el_present_flag,
426  dovi->bl_present_flag,
428  dovi->dv_md_compression);
429 }
430 
431 static void dump_s12m_timecode(void *ctx, AVRational avg_frame_rate, const AVPacketSideData *sd,
432  int log_level)
433 {
434  const uint32_t *tc = (const uint32_t *)sd->data;
435 
436  if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
437  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
438  return;
439  }
440 
441  for (int j = 1; j <= tc[0]; j++) {
442  char tcbuf[AV_TIMECODE_STR_SIZE];
443  av_timecode_make_smpte_tc_string2(tcbuf, avg_frame_rate, tc[j], 0, 0);
444  av_log(ctx, log_level, "timecode - %s%s", tcbuf, j != tc[0] ? ", " : "");
445  }
446 }
447 
448 static void dump_cropping(void *ctx, const AVPacketSideData *sd)
449 {
450  uint32_t top, bottom, left, right;
451 
452  if (sd->size < sizeof(uint32_t) * 4) {
453  av_log(ctx, AV_LOG_ERROR, "invalid data\n");
454  return;
455  }
456 
457  top = AV_RL32(sd->data + 0);
458  bottom = AV_RL32(sd->data + 4);
459  left = AV_RL32(sd->data + 8);
460  right = AV_RL32(sd->data + 12);
461 
462  av_log(ctx, AV_LOG_INFO, "%d/%d/%d/%d", left, right, top, bottom);
463 }
464 
465 static void dump_tdrdi(void *ctx, const AVPacketSideData *sd)
466 {
467  const AV3DReferenceDisplaysInfo *tdrdi =
468  (const AV3DReferenceDisplaysInfo *)sd->data;
469 
470  av_log(ctx, AV_LOG_INFO, "number of reference displays: %u", tdrdi->num_ref_displays);
471 }
472 
473 static void dump_sidedata(void *ctx, const AVPacketSideData *side_data, int nb_side_data,
474  int w, int h, AVRational avg_frame_rate,
475  const char *indent, int log_level)
476 {
477  int i;
478 
479  if (nb_side_data)
480  av_log(ctx, log_level, "%sSide data:\n", indent);
481 
482  for (i = 0; i < nb_side_data; i++) {
483  const AVPacketSideData *sd = &side_data[i];
484  const char *name = av_packet_side_data_name(sd->type);
485 
486  av_log(ctx, log_level, "%s ", indent);
487  if (name)
488  av_log(ctx, AV_LOG_INFO, "%s: ", name);
489  switch (sd->type) {
491  dump_paramchange(ctx, sd, log_level);
492  break;
494  dump_replaygain(ctx, sd, log_level);
495  break;
497  av_log(ctx, log_level, "rotation of %.2f degrees",
498  av_display_rotation_get((const int32_t *)sd->data));
499  break;
501  dump_stereo3d(ctx, sd, log_level);
502  break;
504  dump_audioservicetype(ctx, sd, log_level);
505  break;
507  av_log(ctx, log_level, "%"PRId32", pict_type: %c",
508  AV_RL32(sd->data), av_get_picture_type_char(sd->data[4]));
509  break;
511  dump_cpb(ctx, sd, log_level);
512  break;
514  dump_mastering_display_metadata(ctx, sd, log_level);
515  break;
517  dump_spherical(ctx, w, h, sd, log_level);
518  break;
520  dump_content_light_metadata(ctx, sd, log_level);
521  break;
523  dump_dovi_conf(ctx, sd, log_level);
524  break;
526  dump_s12m_timecode(ctx, avg_frame_rate, sd, log_level);
527  break;
530  break;
532  dump_cropping(ctx, sd);
533  break;
535  dump_tdrdi(ctx, sd);
536  break;
537  default:
538  if (name)
539  av_log(ctx, log_level,
540  "(%"SIZE_SPECIFIER" bytes)", sd->size);
541  else
542  av_log(ctx, log_level, "unknown side data type %d "
543  "(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size);
544  break;
545  }
546 
547  av_log(ctx, log_level, "\n");
548  }
549 }
550 
551 static void dump_disposition(int disposition, int log_level)
552 {
553  if (disposition & AV_DISPOSITION_DEFAULT)
554  av_log(NULL, log_level, " (default)");
555  if (disposition & AV_DISPOSITION_DUB)
556  av_log(NULL, log_level, " (dub)");
557  if (disposition & AV_DISPOSITION_ORIGINAL)
558  av_log(NULL, log_level, " (original)");
559  if (disposition & AV_DISPOSITION_COMMENT)
560  av_log(NULL, log_level, " (comment)");
561  if (disposition & AV_DISPOSITION_LYRICS)
562  av_log(NULL, log_level, " (lyrics)");
563  if (disposition & AV_DISPOSITION_KARAOKE)
564  av_log(NULL, log_level, " (karaoke)");
565  if (disposition & AV_DISPOSITION_FORCED)
566  av_log(NULL, log_level, " (forced)");
567  if (disposition & AV_DISPOSITION_HEARING_IMPAIRED)
568  av_log(NULL, log_level, " (hearing impaired)");
569  if (disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
570  av_log(NULL, log_level, " (visual impaired)");
571  if (disposition & AV_DISPOSITION_CLEAN_EFFECTS)
572  av_log(NULL, log_level, " (clean effects)");
573  if (disposition & AV_DISPOSITION_ATTACHED_PIC)
574  av_log(NULL, log_level, " (attached pic)");
575  if (disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
576  av_log(NULL, log_level, " (timed thumbnails)");
577  if (disposition & AV_DISPOSITION_CAPTIONS)
578  av_log(NULL, log_level, " (captions)");
579  if (disposition & AV_DISPOSITION_DESCRIPTIONS)
580  av_log(NULL, log_level, " (descriptions)");
581  if (disposition & AV_DISPOSITION_METADATA)
582  av_log(NULL, log_level, " (metadata)");
583  if (disposition & AV_DISPOSITION_DEPENDENT)
584  av_log(NULL, log_level, " (dependent)");
585  if (disposition & AV_DISPOSITION_STILL_IMAGE)
586  av_log(NULL, log_level, " (still image)");
587  if (disposition & AV_DISPOSITION_NON_DIEGETIC)
588  av_log(NULL, log_level, " (non-diegetic)");
589  if (disposition & AV_DISPOSITION_MULTILAYER)
590  av_log(NULL, log_level, " (multilayer)");
591 }
592 
593 /* "user interface" functions */
594 static void dump_stream_format(const AVFormatContext *ic, int i,
595  int group_index, int index, int is_output,
596  int log_level)
597 {
598  char buf[256];
599  int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
600  const AVStream *st = ic->streams[i];
601  const FFStream *const sti = cffstream(st);
602  const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
603  const char *separator = ic->dump_separator;
604  const char *group_indent = group_index >= 0 ? " " : "";
605  const char *extra_indent = group_index >= 0 ? " " : " ";
606  AVCodecContext *avctx;
607  int ret;
608 
609  avctx = avcodec_alloc_context3(NULL);
610  if (!avctx)
611  return;
612 
614  if (ret < 0) {
615  avcodec_free_context(&avctx);
616  return;
617  }
618 
619  // Fields which are missing from AVCodecParameters need to be taken from the AVCodecContext
620  if (sti->avctx) {
621 #if FF_API_CODEC_PROPS
623  avctx->properties = sti->avctx->properties;
625 #endif
626  avctx->codec = sti->avctx->codec;
627  avctx->qmin = sti->avctx->qmin;
628  avctx->qmax = sti->avctx->qmax;
629  avctx->coded_width = sti->avctx->coded_width;
630  avctx->coded_height = sti->avctx->coded_height;
631  }
632 
633  if (separator)
634  av_opt_set(avctx, "dump_separator", separator, 0);
635  avcodec_string(buf, sizeof(buf), avctx, is_output);
636  avcodec_free_context(&avctx);
637 
638  av_log(NULL, log_level, "%s Stream #%d", group_indent, index);
639  av_log(NULL, log_level, ":%d", i);
640 
641  /* the pid is an important information, so we display it */
642  /* XXX: add a generic system */
643  if (flags & AVFMT_SHOW_IDS)
644  av_log(NULL, log_level, "[0x%x]", st->id);
645  if (lang)
646  av_log(NULL, log_level, "(%s)", lang->value);
647  av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", sti->codec_info_nb_frames,
648  st->time_base.num, st->time_base.den);
649  av_log(NULL, log_level, ": %s", buf);
650 
651  if (st->sample_aspect_ratio.num &&
653  AVRational display_aspect_ratio;
654  av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
657  1024 * 1024);
658  av_log(NULL, log_level, ", SAR %d:%d DAR %d:%d",
660  display_aspect_ratio.num, display_aspect_ratio.den);
661  }
662 
663  if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
664  int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
665  int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
666  int tbn = st->time_base.den && st->time_base.num;
667 
668  if (fps || tbr || tbn)
669  av_log(NULL, log_level, "%s", separator);
670 
671  if (fps)
672  print_fps(av_q2d(st->avg_frame_rate), tbr || tbn ? "fps, " : "fps", log_level);
673  if (tbr)
674  print_fps(av_q2d(st->r_frame_rate), tbn ? "tbr, " : "tbr", log_level);
675  if (tbn)
676  print_fps(1 / av_q2d(st->time_base), "tbn", log_level);
677  }
678 
679  if (st->start_time != AV_NOPTS_VALUE && st->start_time != 0 && st->time_base.den && st->time_base.num) {
680  const double stream_start = av_q2d(st->time_base) * st->start_time;
681  av_log(NULL, AV_LOG_INFO, ", start %.6f", stream_start);
682  }
683 
684  dump_disposition(st->disposition, log_level);
685  av_log(NULL, log_level, "\n");
686 
687  dump_metadata(NULL, st->metadata, extra_indent, log_level);
688 
690  st->codecpar->width, st->codecpar->height, st->avg_frame_rate,
691  extra_indent, log_level);
692 }
693 
694 static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed,
695  int i, int index, int is_output)
696 {
697  const AVStreamGroup *stg = ic->stream_groups[i];
698  int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
699  char buf[512];
700  int ret;
701 
702  av_log(NULL, AV_LOG_INFO, " Stream group #%d:%d", index, i);
703  if (flags & AVFMT_SHOW_IDS)
704  av_log(NULL, AV_LOG_INFO, "[0x%"PRIx64"]", stg->id);
705  av_log(NULL, AV_LOG_INFO, ":");
706 
707  switch (stg->type) {
709  const AVIAMFAudioElement *audio_element = stg->params.iamf_audio_element;
710  av_log(NULL, AV_LOG_INFO, " IAMF Audio Element:");
712  av_log(NULL, AV_LOG_INFO, "\n");
713  dump_metadata(NULL, stg->metadata, " ", AV_LOG_INFO);
714  for (int j = 0; j < audio_element->nb_layers; j++) {
715  const AVIAMFLayer *layer = audio_element->layers[j];
716  int channel_count = layer->ch_layout.nb_channels;
717  av_log(NULL, AV_LOG_INFO, " Layer %d:", j);
718  ret = av_channel_layout_describe(&layer->ch_layout, buf, sizeof(buf));
719  if (ret >= 0)
720  av_log(NULL, AV_LOG_INFO, " %s", buf);
721  av_log(NULL, AV_LOG_INFO, "\n");
722  for (int k = 0; channel_count > 0 && k < stg->nb_streams; k++) {
723  AVStream *st = stg->streams[k];
724  dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_VERBOSE);
725  printed[st->index] = 1;
726  channel_count -= st->codecpar->ch_layout.nb_channels;
727  }
728  }
729  break;
730  }
732  const AVIAMFMixPresentation *mix_presentation = stg->params.iamf_mix_presentation;
733  av_log(NULL, AV_LOG_INFO, " IAMF Mix Presentation:");
735  av_log(NULL, AV_LOG_INFO, "\n");
736  dump_metadata(NULL, stg->metadata, " ", AV_LOG_INFO);
737  dump_dictionary(NULL, mix_presentation->annotations, "Annotations", " ", AV_LOG_INFO);
738  for (int j = 0; j < mix_presentation->nb_submixes; j++) {
739  AVIAMFSubmix *sub_mix = mix_presentation->submixes[j];
740  av_log(NULL, AV_LOG_INFO, " Submix %d:\n", j);
741  for (int k = 0; k < sub_mix->nb_elements; k++) {
742  const AVIAMFSubmixElement *submix_element = sub_mix->elements[k];
743  const AVStreamGroup *audio_element = NULL;
744  for (int l = 0; l < ic->nb_stream_groups; l++)
746  ic->stream_groups[l]->id == submix_element->audio_element_id) {
747  audio_element = ic->stream_groups[l];
748  break;
749  }
750  if (audio_element) {
751  av_log(NULL, AV_LOG_INFO, " IAMF Audio Element #%d:%d",
752  index, audio_element->index);
753  if (flags & AVFMT_SHOW_IDS)
754  av_log(NULL, AV_LOG_INFO, "[0x%"PRIx64"]", audio_element->id);
755  av_log(NULL, AV_LOG_INFO, "\n");
756  dump_dictionary(NULL, submix_element->annotations, "Annotations", " ", AV_LOG_INFO);
757  }
758  }
759  for (int k = 0; k < sub_mix->nb_layouts; k++) {
760  const AVIAMFSubmixLayout *submix_layout = sub_mix->layouts[k];
761  av_log(NULL, AV_LOG_INFO, " Layout #%d:", k);
762  if (submix_layout->layout_type == 2 ||
763  submix_layout->layout_type == 3) {
764  ret = av_channel_layout_describe(&submix_layout->sound_system, buf, sizeof(buf));
765  if (ret >= 0)
766  av_log(NULL, AV_LOG_INFO, " %s", buf);
767  }
768  av_log(NULL, AV_LOG_INFO, "\n");
769  }
770  }
771  break;
772  }
774  const AVStreamGroupTileGrid *tile_grid = stg->params.tile_grid;
776  const char *ptr = NULL;
777  av_log(NULL, AV_LOG_INFO, " Tile Grid:");
778  if (avctx && stg->nb_streams && !avcodec_parameters_to_context(avctx, stg->streams[0]->codecpar)) {
779  avctx->width = tile_grid->width;
780  avctx->height = tile_grid->height;
781  avctx->coded_width = tile_grid->coded_width;
782  avctx->coded_height = tile_grid->coded_height;
783  if (ic->dump_separator)
784  av_opt_set(avctx, "dump_separator", ic->dump_separator, 0);
785  buf[0] = 0;
786  avcodec_string(buf, sizeof(buf), avctx, is_output);
787  ptr = av_stristr(buf, " ");
788  }
789  avcodec_free_context(&avctx);
790  if (ptr)
791  av_log(NULL, AV_LOG_INFO, "%s", ptr);
793  av_log(NULL, AV_LOG_INFO, "\n");
794  dump_metadata(NULL, stg->metadata, " ", AV_LOG_INFO);
795  dump_sidedata(NULL, tile_grid->coded_side_data, tile_grid->nb_coded_side_data,
796  tile_grid->width, tile_grid->height, (AVRational) {0,1},
797  " ", AV_LOG_INFO);
798  for (int i = 0; i < tile_grid->nb_tiles; i++) {
799  const AVStream *st = NULL;
800  if (tile_grid->offsets[i].idx < stg->nb_streams)
801  st = stg->streams[tile_grid->offsets[i].idx];
802  if (st && !printed[st->index]) {
803  dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_VERBOSE);
804  printed[st->index] = 1;
805  }
806  }
807  for (int i = 0; i < stg->nb_streams; i++) {
808  const AVStream *st = stg->streams[i];
809  if (!printed[st->index]) {
810  dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_INFO);
811  printed[st->index] = 1;
812  }
813  }
814  break;
815  }
817  const AVStreamGroupLCEVC *lcevc = stg->params.lcevc;
819  const char *ptr = NULL;
820  av_log(NULL, AV_LOG_INFO, " LCEVC:");
821  if (avctx && stg->nb_streams && !avcodec_parameters_to_context(avctx, stg->streams[0]->codecpar)) {
822  avctx->width = lcevc->width;
823  avctx->height = lcevc->height;
824  avctx->coded_width = lcevc->width;
825  avctx->coded_height = lcevc->height;
826  if (ic->dump_separator)
827  av_opt_set(avctx, "dump_separator", ic->dump_separator, 0);
828  buf[0] = 0;
829  avcodec_string(buf, sizeof(buf), avctx, is_output);
830  ptr = av_stristr(buf, " ");
831  }
832  avcodec_free_context(&avctx);
833  if (ptr)
834  av_log(NULL, AV_LOG_INFO, "%s", ptr);
835  av_log(NULL, AV_LOG_INFO, "\n");
836  for (int i = 0; i < stg->nb_streams; i++) {
837  const AVStream *st = stg->streams[i];
838  dump_stream_format(ic, st->index, i, index, is_output, AV_LOG_VERBOSE);
839  printed[st->index] = 1;
840  }
841  break;
842  }
843  default:
844  break;
845  }
846 }
847 
849  const char *url, int is_output)
850 {
851  int i;
852  uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;
853  if (ic->nb_streams && !printed)
854  return;
855 
856  av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
857  is_output ? "Output" : "Input",
858  index,
859  is_output ? ic->oformat->name : ic->iformat->name,
860  is_output ? "to" : "from", url);
862 
863  if (!is_output) {
864  av_log(NULL, AV_LOG_INFO, " Duration: ");
865  if (ic->duration != AV_NOPTS_VALUE) {
866  int64_t hours, mins, secs, us;
867  int64_t duration = ic->duration + (ic->duration <= INT64_MAX - 5000 ? 5000 : 0);
868  secs = duration / AV_TIME_BASE;
870  mins = secs / 60;
871  secs %= 60;
872  hours = mins / 60;
873  mins %= 60;
874  av_log(NULL, AV_LOG_INFO, "%02"PRId64":%02"PRId64":%02"PRId64".%02"PRId64"", hours, mins, secs,
875  (100 * us) / AV_TIME_BASE);
876  } else {
877  av_log(NULL, AV_LOG_INFO, "N/A");
878  }
879  if (ic->start_time != AV_NOPTS_VALUE) {
880  int secs, us;
881  av_log(NULL, AV_LOG_INFO, ", start: ");
882  secs = llabs(ic->start_time / AV_TIME_BASE);
883  us = llabs(ic->start_time % AV_TIME_BASE);
884  av_log(NULL, AV_LOG_INFO, "%s%d.%06d",
885  ic->start_time >= 0 ? "" : "-",
886  secs,
887  (int) av_rescale(us, 1000000, AV_TIME_BASE));
888  }
889  av_log(NULL, AV_LOG_INFO, ", bitrate: ");
890  if (ic->bit_rate)
891  av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", ic->bit_rate / 1000);
892  else
893  av_log(NULL, AV_LOG_INFO, "N/A");
894  av_log(NULL, AV_LOG_INFO, "\n");
895  }
896 
897  if (ic->nb_chapters)
898  av_log(NULL, AV_LOG_INFO, " Chapters:\n");
899  for (i = 0; i < ic->nb_chapters; i++) {
900  const AVChapter *ch = ic->chapters[i];
901  av_log(NULL, AV_LOG_INFO, " Chapter #%d:%d: ", index, i);
903  "start %f, ", ch->start * av_q2d(ch->time_base));
905  "end %f\n", ch->end * av_q2d(ch->time_base));
906 
908  }
909 
910  if (ic->nb_programs) {
911  int j, k, total = 0;
912  for (j = 0; j < ic->nb_programs; j++) {
913  const AVProgram *program = ic->programs[j];
914  const AVDictionaryEntry *name = av_dict_get(program->metadata,
915  "name", NULL, 0);
916  av_log(NULL, AV_LOG_INFO, " Program %d %s\n", program->id,
917  name ? name->value : "");
918  dump_metadata(NULL, program->metadata, " ", AV_LOG_INFO);
919  for (k = 0; k < program->nb_stream_indexes; k++) {
920  dump_stream_format(ic, program->stream_index[k],
921  -1, index, is_output, AV_LOG_INFO);
922  printed[program->stream_index[k]] = 1;
923  }
924  total += program->nb_stream_indexes;
925  }
926  if (total < ic->nb_streams)
927  av_log(NULL, AV_LOG_INFO, " No Program\n");
928  }
929 
930  for (i = 0; i < ic->nb_stream_groups; i++)
931  dump_stream_group(ic, printed, i, index, is_output);
932 
933  for (i = 0; i < ic->nb_streams; i++)
934  if (!printed[i])
935  dump_stream_format(ic, i, -1, index, is_output, AV_LOG_INFO);
936 
937  av_free(printed);
938 }
flags
const SwsFlags flags[]
Definition: swscale.c:61
iamf.h
AV_PKT_DATA_DISPLAYMATRIX
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: packet.h:105
av_pkt_dump2
void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
Send a nice dump of a packet to the specified file stream.
Definition: dump.c:117
FF_ENABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:73
AVIAMFSubmix::elements
AVIAMFSubmixElement ** elements
Array of submix elements.
Definition: iamf.h:565
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:216
AVIAMFAudioElement::nb_layers
unsigned int nb_layers
Number of layers, or channel groups, in the Audio Element.
Definition: iamf.h:368
AV_TIMECODE_STR_SIZE
#define AV_TIMECODE_STR_SIZE
Definition: timecode.h:33
AVFormatContext::stream_groups
AVStreamGroup ** stream_groups
A list of all stream groups in the file.
Definition: avformat.h:1351
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
dump_dovi_conf
static void dump_dovi_conf(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:413
level
uint8_t level
Definition: svq3.c:208
AVStreamGroup::id
int64_t id
Group type-specific group ID.
Definition: avformat.h:1117
program
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C program
Definition: undefined.txt:6
AVIAMFSubmix::layouts
AVIAMFSubmixLayout ** layouts
Array of submix layouts.
Definition: iamf.h:580
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
@ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
Definition: packet.h:327
AVOutputFormat::name
const char * name
Definition: avformat.h:506
AVChapter::metadata
AVDictionary * metadata
Definition: avformat.h:1227
r
const char * r
Definition: vf_curves.c:127
opt.h
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
AVStreamGroup::tile_grid
struct AVStreamGroupTileGrid * tile_grid
Definition: avformat.h:1133
AVFMT_SHOW_IDS
#define AVFMT_SHOW_IDS
Show format stream IDs numbers.
Definition: avformat.h:476
AVSphericalMapping::projection
enum AVSphericalProjection projection
Projection type.
Definition: spherical.h:104
AV_STREAM_GROUP_PARAMS_LCEVC
@ AV_STREAM_GROUP_PARAMS_LCEVC
Definition: avformat.h:1092
AV_PKT_DATA_QUALITY_STATS
@ AV_PKT_DATA_QUALITY_STATS
This side data contains quality related information from the encoder.
Definition: packet.h:129
AV_PKT_DATA_FRAME_CROPPING
@ AV_PKT_DATA_FRAME_CROPPING
The number of pixels to discard from the top/bottom/left/right border of the decoded frame to obtain ...
Definition: packet.h:340
AVFormatContext::nb_chapters
unsigned int nb_chapters
Number of chapters in AVChapter array.
Definition: avformat.h:1364
AVAmbientViewingEnvironment
Ambient viewing environment metadata as defined by H.274.
Definition: ambient_viewing_environment.h:36
av_stristr
char * av_stristr(const char *s1, const char *s2)
Locate the first case-independent occurrence in the string haystack of the string needle.
Definition: avstring.c:58
AV_DISPOSITION_ATTACHED_PIC
#define AV_DISPOSITION_ATTACHED_PIC
The stream is stored in the file as an attached picture/"cover art" (e.g.
Definition: avformat.h:670
AVIAMFAudioElement::layers
AVIAMFLayer ** layers
Definition: iamf.h:359
av_dict_count
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
Definition: dict.c:37
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
@ AV_PKT_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata (based on SMPTE-2086:2014).
Definition: packet.h:219
dump_stereo3d
static void dump_stereo3d(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:252
avcodec_string
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
Definition: avcodec.c:504
hex_dump_internal
static void hex_dump_internal(void *avcl, FILE *f, int level, const uint8_t *buf, int size)
Definition: dump.c:56
int64_t
long long int64_t
Definition: coverity.c:34
metadata
Stream codec metadata
Definition: ogg-flac-chained-meta.txt:2
AVIAMFMixPresentation::nb_submixes
unsigned int nb_submixes
Number of submixes in the presentation.
Definition: iamf.h:629
AVStreamGroup::disposition
int disposition
Stream group disposition - a combination of AV_DISPOSITION_* flags.
Definition: avformat.h:1175
AV_DISPOSITION_DEFAULT
#define AV_DISPOSITION_DEFAULT
The stream should be chosen by default among other streams of the same type, unless the user has expl...
Definition: avformat.h:617
AVFormatContext::streams
AVStream ** streams
A list of all streams in the file.
Definition: avformat.h:1332
AVPacketSideData
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
Definition: packet.h:409
w
uint8_t w
Definition: llviddspenc.c:38
AVPacket::data
uint8_t * data
Definition: packet.h:558
av_spherical_tile_bounds
void av_spherical_tile_bounds(const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.
Definition: spherical.c:40
AVAmbientViewingEnvironment::ambient_light_x
AVRational ambient_light_x
Normalized x chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
Definition: ambient_viewing_environment.h:47
b
#define b
Definition: input.c:42
AVReplayGain::album_gain
int32_t album_gain
Same as track_gain, but for the whole album.
Definition: replaygain.h:43
AVStream::avg_frame_rate
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:833
spherical.h
AVChapter::start
int64_t start
Definition: avformat.h:1226
data
const char data[16]
Definition: mxf.c:149
AV_AUDIO_SERVICE_TYPE_VOICE_OVER
@ AV_AUDIO_SERVICE_TYPE_VOICE_OVER
Definition: defs.h:243
AV_PKT_DATA_S12M_TIMECODE
@ AV_PKT_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1:2014.
Definition: packet.h:288
dump_disposition
static void dump_disposition(int disposition, int log_level)
Definition: dump.c:551
AVIAMFSubmixLayout::layout_type
enum AVIAMFSubmixLayoutType layout_type
Definition: iamf.h:517
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE
@ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE
Definition: packet.h:635
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:226
AVFormatContext::programs
AVProgram ** programs
Definition: avformat.h:1462
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:576
AV_SPHERICAL_EQUIRECTANGULAR_TILE
@ AV_SPHERICAL_EQUIRECTANGULAR_TILE
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.
Definition: spherical.h:68
AVStereo3D::baseline
uint32_t baseline
The distance between the centres of the lenses of the camera system, in micrometers.
Definition: stereo3d.h:228
mathematics.h
AVDictionary
Definition: dict.c:32
cffstream
static const av_always_inline FFStream * cffstream(const AVStream *st)
Definition: internal.h:352
AVCodecContext::qmax
int qmax
maximum quantizer
Definition: avcodec.h:1241
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:329
replaygain.h
AV_PKT_FLAG_KEY
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: packet.h:613
print_fps
static void print_fps(double d, const char *postfix, int log_level)
Definition: dump.c:129
AVContentLightMetadata
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
Definition: mastering_display_metadata.h:107
AV_PKT_DATA_DOVI_CONF
@ AV_PKT_DATA_DOVI_CONF
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2....
Definition: packet.h:280
AVStereo3D::horizontal_field_of_view
AVRational horizontal_field_of_view
Horizontal field of view, in degrees.
Definition: stereo3d.h:239
AV3DReferenceDisplaysInfo
This structure describes information about the reference display width(s) and reference viewing dista...
Definition: tdrdi.h:53
dump_cropping
static void dump_cropping(void *ctx, const AVPacketSideData *sd)
Definition: dump.c:448
print_gain
static void print_gain(void *ctx, const char *str, int32_t gain, int log_level)
Definition: dump.c:216
AVPacketSideData::size
size_t size
Definition: packet.h:411
AV_PKT_DATA_REPLAYGAIN
@ AV_PKT_DATA_REPLAYGAIN
This side data should be associated with an audio stream and contains ReplayGain information in form ...
Definition: packet.h:96
dump_mastering_display_metadata
static void dump_mastering_display_metadata(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:340
AVCodecContext::codec
const struct AVCodec * codec
Definition: avcodec.h:440
fail
#define fail()
Definition: checkasm.h:199
AVStreamGroupTileGrid
AVStreamGroupTileGrid holds information on how to combine several independent images on a single canv...
Definition: avformat.h:951
timecode.h
AVIAMFSubmixLayout
Submix layout as defined in section 3.7.6 of IAMF.
Definition: iamf.h:514
AVDOVIDecoderConfigurationRecord::dv_md_compression
uint8_t dv_md_compression
Definition: dovi_meta.h:64
dump_tdrdi
static void dump_tdrdi(void *ctx, const AVPacketSideData *sd)
Definition: dump.c:465
AVStreamGroupTileGrid::coded_width
int coded_width
Width of the canvas.
Definition: avformat.h:966
AV_DISPOSITION_STILL_IMAGE
#define AV_DISPOSITION_STILL_IMAGE
The video stream contains still images.
Definition: avformat.h:709
FFStream::avctx
struct AVCodecContext * avctx
The codec context used by avformat_find_stream_info, the parser, etc.
Definition: internal.h:156
AVChapter
Definition: avformat.h:1223
dump_cpb
static void dump_cpb(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:321
AV_DISPOSITION_FORCED
#define AV_DISPOSITION_FORCED
Track should be used during playback by default.
Definition: avformat.h:650
dump_content_light_metadata
static void dump_content_light_metadata(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:360
AVFormatContext::dump_separator
uint8_t * dump_separator
dump format separator.
Definition: avformat.h:1842
AV_DISPOSITION_TIMED_THUMBNAILS
#define AV_DISPOSITION_TIMED_THUMBNAILS
The stream is sparse, and contains thumbnail images, often corresponding to chapter markers.
Definition: avformat.h:675
AVStreamGroupTileGrid::coded_height
int coded_height
Width of the canvas.
Definition: avformat.h:972
AVCodecContext::coded_height
int coded_height
Definition: avcodec.h:607
AVStreamGroupLCEVC
AVStreamGroupLCEVC is meant to define the relation between video streams and a data stream containing...
Definition: avformat.h:1070
av_opt_set
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
Definition: opt.c:835
AVAmbientViewingEnvironment::ambient_illuminance
AVRational ambient_illuminance
Environmental illuminance of the ambient viewing environment in lux.
Definition: ambient_viewing_environment.h:40
av_reduce
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Definition: rational.c:35
AVRational::num
int num
Numerator.
Definition: rational.h:59
av_stereo3d_view_name
const char * av_stereo3d_view_name(unsigned int view)
Provide a human-readable name of a given stereo3d view.
Definition: stereo3d.c:113
AVFormatContext::bit_rate
int64_t bit_rate
Total stream bitrate in bit/s, 0 if not available.
Definition: avformat.h:1406
AV_DISPOSITION_CLEAN_EFFECTS
#define AV_DISPOSITION_CLEAN_EFFECTS
The audio stream contains music and sound effects without voice.
Definition: avformat.h:662
AVIAMFSubmixElement::annotations
AVDictionary * annotations
A dictionary of strings describing the submix in different languages.
Definition: iamf.h:490
dump_ambient_viewing_environment_metadata
static void dump_ambient_viewing_environment_metadata(void *ctx, const AVPacketSideData *sd)
Definition: dump.c:370
AV_PKT_DATA_PARAM_CHANGE
@ AV_PKT_DATA_PARAM_CHANGE
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: packet.h:69
pkt
AVPacket * pkt
Definition: movenc.c:60
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
AVFormatContext::metadata
AVDictionary * metadata
Metadata that applies to the whole file.
Definition: avformat.h:1496
av_dump_format
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)
Print detailed information about the input or output format, such as duration, bitrate,...
Definition: dump.c:848
duration
int64_t duration
Definition: movenc.c:65
av_dict_get
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
Definition: dict.c:60
av_channel_layout_describe
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
Definition: channel_layout.c:653
dump_audioservicetype
static void dump_audioservicetype(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:278
AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION
@ AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION
Definition: avformat.h:1090
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS
@ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS
Definition: packet.h:636
avcodec_alloc_context3
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
Definition: options.c:149
av_packet_side_data_name
const char * av_packet_side_data_name(enum AVPacketSideDataType type)
Definition: packet.c:270
AVChapter::end
int64_t end
chapter start/end time in time_base units
Definition: avformat.h:1226
stereo3d.h
intreadwrite.h
AVCodecParameters::sample_aspect_ratio
AVRational sample_aspect_ratio
Video only.
Definition: codec_par.h:144
AVFormatContext::nb_programs
unsigned int nb_programs
Definition: avformat.h:1461
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:549
AVFormatContext::iformat
const struct AVInputFormat * iformat
The input container format.
Definition: avformat.h:1276
AVFormatContext::chapters
AVChapter ** chapters
Definition: avformat.h:1365
dump_replaygain
static void dump_replaygain(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:236
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:134
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
AVStreamGroup::index
unsigned int index
Group index in AVFormatContext.
Definition: avformat.h:1109
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:231
AVPacketSideData::data
uint8_t * data
Definition: packet.h:410
AVDOVIDecoderConfigurationRecord::dv_profile
uint8_t dv_profile
Definition: dovi_meta.h:58
ctx
AVFormatContext * ctx
Definition: movenc.c:49
dump_metadata
static void dump_metadata(void *ctx, const AVDictionary *m, const char *indent, int log_level)
Definition: dump.c:169
FFStream::codec_info_nb_frames
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
Definition: internal.h:320
AVIAMFLayer::ch_layout
AVChannelLayout ch_layout
Definition: iamf.h:297
AV_PKT_DATA_STEREO3D
@ AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Definition: packet.h:111
nb_streams
static int nb_streams
Definition: ffprobe.c:340
AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED
@ AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED
Definition: defs.h:239
AVCodecParameters::nb_coded_side_data
int nb_coded_side_data
Amount of entries in coded_side_data.
Definition: codec_par.h:86
AVReplayGain::track_peak
uint32_t track_peak
Peak track amplitude, with 100000 representing full scale (but values may overflow).
Definition: replaygain.h:39
AVCPBProperties
This structure describes the bitrate properties of an encoded bitstream.
Definition: defs.h:282
AVDOVIDecoderConfigurationRecord::dv_version_major
uint8_t dv_version_major
Definition: dovi_meta.h:56
dump_paramchange
static void dump_paramchange(void *ctx, const AVPacketSideData *sd, int log_level)
Definition: dump.c:177
AVStereo3D::flags
int flags
Additional information about the frame packing.
Definition: stereo3d.h:212
if
if(ret)
Definition: filter_design.txt:179
AVFormatContext
Format I/O context.
Definition: avformat.h:1264
internal.h
AVStreamGroupLCEVC::height
int height
Height of the final image for presentation.
Definition: avformat.h:1084
AV_PKT_DATA_3D_REFERENCE_DISPLAYS
@ AV_PKT_DATA_3D_REFERENCE_DISPLAYS
This side data contains information about the reference display width(s) and reference viewing distan...
Definition: packet.h:357
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:767
avcodec_parameters_to_context
int avcodec_parameters_to_context(AVCodecContext *codec, const struct AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
AVStream::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avformat.h:783
NULL
#define NULL
Definition: coverity.c:32
AVDOVIDecoderConfigurationRecord::dv_level
uint8_t dv_level
Definition: dovi_meta.h:59
AVDOVIDecoderConfigurationRecord::dv_bl_signal_compatibility_id
uint8_t dv_bl_signal_compatibility_id
Definition: dovi_meta.h:63
AVStreamGroupTileGrid::coded_side_data
AVPacketSideData * coded_side_data
Additional data associated with the grid.
Definition: avformat.h:1054
avcodec_free_context
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Definition: options.c:164
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVPacketSideData::type
enum AVPacketSideDataType type
Definition: packet.h:412
AV_DISPOSITION_COMMENT
#define AV_DISPOSITION_COMMENT
The stream is a commentary track.
Definition: avformat.h:635
AVStereo3D::horizontal_disparity_adjustment
AVRational horizontal_disparity_adjustment
Relative shift of the left and right images, which changes the zero parallax plane.
Definition: stereo3d.h:234
AVIAMFLayer
A layer defining a Channel Layout in the Audio Element.
Definition: iamf.h:294
AVStream::metadata
AVDictionary * metadata
Definition: avformat.h:824
AV_DISPOSITION_METADATA
#define AV_DISPOSITION_METADATA
The subtitle stream contains time-aligned metadata that is not intended to be directly presented to t...
Definition: avformat.h:699
dump_sidedata
static void dump_sidedata(void *ctx, const AVPacketSideData *side_data, int nb_side_data, int w, int h, AVRational avg_frame_rate, const char *indent, int log_level)
Definition: dump.c:473
double
double
Definition: af_crystalizer.c:132
AV_AUDIO_SERVICE_TYPE_EMERGENCY
@ AV_AUDIO_SERVICE_TYPE_EMERGENCY
Definition: defs.h:242
AV_DISPOSITION_ORIGINAL
#define AV_DISPOSITION_ORIGINAL
The stream is in original language.
Definition: avformat.h:631
AV_DISPOSITION_MULTILAYER
#define AV_DISPOSITION_MULTILAYER
The video stream contains multiple layers, e.g.
Definition: avformat.h:714
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:180
dump_dictionary
static void dump_dictionary(void *ctx, const AVDictionary *m, const char *name, const char *indent, int log_level)
Definition: dump.c:142
AV_PKT_DATA_CONTENT_LIGHT_LEVEL
@ AV_PKT_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
Definition: packet.h:232
index
int index
Definition: gxfenc.c:90
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
AVAudioServiceType
AVAudioServiceType
Definition: defs.h:235
AVIAMFSubmixElement::audio_element_id
unsigned int audio_element_id
The id of the Audio Element this submix element references.
Definition: iamf.h:452
AV_PKT_DATA_SPHERICAL
@ AV_PKT_DATA_SPHERICAL
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
Definition: packet.h:225
AVIAMFSubmix
Submix layout as defined in section 3.7 of IAMF.
Definition: iamf.h:556
AVFormatContext::nb_streams
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Definition: avformat.h:1320
AVStereo3D::primary_eye
enum AVStereo3DPrimaryEye primary_eye
Which eye is the primary eye when rendering in 2D.
Definition: stereo3d.h:222
AVOutputFormat::flags
int flags
can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS,...
Definition: avformat.h:525
AV_STREAM_GROUP_PARAMS_TILE_GRID
@ AV_STREAM_GROUP_PARAMS_TILE_GRID
Definition: avformat.h:1091
AV_DISPOSITION_CAPTIONS
#define AV_DISPOSITION_CAPTIONS
The subtitle stream contains captions, providing a transcription and possibly a translation of audio.
Definition: avformat.h:688
av_spherical_projection_name
const char * av_spherical_projection_name(enum AVSphericalProjection projection)
Provide a human-readable name of a given AVSphericalProjection.
Definition: spherical.c:68
dump_s12m_timecode
static void dump_s12m_timecode(void *ctx, AVRational avg_frame_rate, const AVPacketSideData *sd, int log_level)
Definition: dump.c:431
f
f
Definition: af_crystalizer.c:122
AV_SPHERICAL_CUBEMAP
@ AV_SPHERICAL_CUBEMAP
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
Definition: spherical.h:61
AVPacket::size
int size
Definition: packet.h:559
height
#define height
Definition: dsp.h:89
FFStream
Definition: internal.h:128
av_stereo3d_primary_eye_name
const char * av_stereo3d_primary_eye_name(unsigned int eye)
Provide a human-readable name of a given stereo3d primary eye.
Definition: stereo3d.c:133
size
int size
Definition: twinvq_data.h:10344
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:247
AVStreamGroup::iamf_audio_element
struct AVIAMFAudioElement * iamf_audio_element
Definition: avformat.h:1131
AVReplayGain::track_gain
int32_t track_gain
Track replay gain in microbels (divide by 100000 to get the value in dB).
Definition: replaygain.h:34
AV_DISPOSITION_DUB
#define AV_DISPOSITION_DUB
The stream is not in original language.
Definition: avformat.h:625
AVCPBProperties::min_bitrate
int64_t min_bitrate
Minimum bitrate of the stream, in bits per second.
Definition: defs.h:292
AVStream::sample_aspect_ratio
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
Definition: avformat.h:822
AV_DISPOSITION_HEARING_IMPAIRED
#define AV_DISPOSITION_HEARING_IMPAIRED
The stream is intended for hearing impaired audiences.
Definition: avformat.h:654
AVPacket::dts
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
Definition: packet.h:557
AVSphericalMapping::padding
uint32_t padding
Number of pixels to pad from the edge of each cube face.
Definition: spherical.h:200
AVIAMFAudioElement
Information on how to combine one or more audio streams, as defined in section 3.6 of IAMF.
Definition: iamf.h:356
AVStreamGroupTileGrid::nb_tiles
unsigned int nb_tiles
Amount of tiles in the grid.
Definition: avformat.h:959
AVStreamGroup::lcevc
struct AVStreamGroupLCEVC * lcevc
Definition: avformat.h:1134
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:564
AVCPBProperties::avg_bitrate
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
Definition: defs.h:297
AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT
@ AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT
Definition: avformat.h:1089
AV_STEREO3D_FLAG_INVERT
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
Definition: stereo3d.h:194
AVStreamGroup::streams
AVStream ** streams
A list of streams in the group.
Definition: avformat.h:1165
dump_stream_format
static void dump_stream_format(const AVFormatContext *ic, int i, int group_index, int index, int is_output, int log_level)
Definition: dump.c:594
AVStreamGroup::iamf_mix_presentation
struct AVIAMFMixPresentation * iamf_mix_presentation
Definition: avformat.h:1132
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:221
av_get_picture_type_char
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
Definition: utils.c:40
AVCPBProperties::vbv_delay
uint64_t vbv_delay
The delay between the time the packet this structure is associated with is received and the time when...
Definition: defs.h:312
AVStreamGroupTileGrid::nb_coded_side_data
int nb_coded_side_data
Amount of entries in coded_side_data.
Definition: avformat.h:1059
HEXDUMP_PRINT
#define HEXDUMP_PRINT(...)
Definition: dump.c:48
AV_PKT_DATA_CPB_PROPERTIES
@ AV_PKT_DATA_CPB_PROPERTIES
This side data corresponds to the AVCPBProperties struct.
Definition: packet.h:142
AVStreamGroupTileGrid::width
int width
Width of the final image for presentation.
Definition: avformat.h:1036
AVSphericalMapping::roll
int32_t roll
Rotation around the forward vector [-180, 180].
Definition: spherical.h:146
log.h
lrintf
#define lrintf(x)
Definition: libm_mips.h:72
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:551
av_timecode_make_smpte_tc_string2
char * av_timecode_make_smpte_tc_string2(char *buf, AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field)
Get the timecode string from the SMPTE timecode format.
Definition: timecode.c:131
AVStreamGroup::params
union AVStreamGroup::@405 params
Group type-specific parameters.
AVCodecParameters::height
int height
Definition: codec_par.h:135
AV_TIME_BASE
#define AV_TIME_BASE
Internal time base represented as integer.
Definition: avutil.h:253
display.h
AVIAMFMixPresentation
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
Definition: iamf.h:613
AVCPBProperties::max_bitrate
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
Definition: defs.h:287
AV_DISPOSITION_KARAOKE
#define AV_DISPOSITION_KARAOKE
The stream contains karaoke audio.
Definition: avformat.h:643
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED
@ AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED
Definition: defs.h:238
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:256
AVProgram
New fields can be added to the end with minor version bumps.
Definition: avformat.h:1188
AV_DISPOSITION_DEPENDENT
#define AV_DISPOSITION_DEPENDENT
The stream is intended to be mixed with another stream before presentation.
Definition: avformat.h:705
AVMasteringDisplayMetadata
Mastering display metadata capable of representing the color volume of the display used to master the...
Definition: mastering_display_metadata.h:38
len
int len
Definition: vorbis_enc_data.h:426
av_rescale
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
Definition: mathematics.c:129
AVCodecContext::height
int height
Definition: avcodec.h:592
AVCodecParameters::coded_side_data
AVPacketSideData * coded_side_data
Additional data associated with the entire stream.
Definition: codec_par.h:81
ambient_viewing_environment.h
avcodec.h
av_cmp_q
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:89
AVIAMFSubmix::nb_layouts
unsigned int nb_layouts
Number of layouts in the submix.
Definition: iamf.h:587
AVStream::disposition
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
Definition: avformat.h:813
AV_DISPOSITION_VISUAL_IMPAIRED
#define AV_DISPOSITION_VISUAL_IMPAIRED
The stream is intended for visually impaired audiences.
Definition: avformat.h:658
tag
uint32_t tag
Definition: movenc.c:1957
AVStream::id
int id
Format-specific stream ID.
Definition: avformat.h:756
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:744
av_hex_dump_log
void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
Send a nice hexadecimal dump of a buffer to the log.
Definition: dump.c:88
AVFormatContext::oformat
const struct AVOutputFormat * oformat
The output container format.
Definition: avformat.h:1283
AVCPBProperties::buffer_size
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
Definition: defs.h:303
AVSphericalMapping::pitch
int32_t pitch
Rotation around the right vector [-90, 90].
Definition: spherical.h:145
AVStreamGroup::metadata
AVDictionary * metadata
Metadata that applies to the whole group.
Definition: avformat.h:1145
AVStereo3D::type
enum AVStereo3DType type
How views are packed within the video.
Definition: stereo3d.h:207
avformat.h
dovi_meta.h
AV_AUDIO_SERVICE_TYPE_KARAOKE
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
Definition: defs.h:244
AV_DISPOSITION_DESCRIPTIONS
#define AV_DISPOSITION_DESCRIPTIONS
The subtitle stream contains a textual description of the video content.
Definition: avformat.h:694
left
Tag MUST be and< 10hcoeff half pel interpolation filter coefficients, hcoeff[0] are the 2 middle coefficients[1] are the next outer ones and so on, resulting in a filter like:...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ... the sign of the coefficients is not explicitly stored but alternates after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,... hcoeff[0] is not explicitly stored but found by subtracting the sum of all stored coefficients with signs from 32 hcoeff[0]=32 - hcoeff[1] - hcoeff[2] - ... a good choice for hcoeff and htaps is htaps=6 hcoeff={40,-10, 2} an alternative which requires more computations at both encoder and decoder side and may or may not be better is htaps=8 hcoeff={42,-14, 6,-2}ref_frames minimum of the number of available reference frames and max_ref_frames for example the first frame after a key frame always has ref_frames=1spatial_decomposition_type wavelet type 0 is a 9/7 symmetric compact integer wavelet 1 is a 5/3 symmetric compact integer wavelet others are reserved stored as delta from last, last is reset to 0 if always_reset||keyframeqlog quality(logarithmic quantizer scale) stored as delta from last, last is reset to 0 if always_reset||keyframemv_scale stored as delta from last, last is reset to 0 if always_reset||keyframe FIXME check that everything works fine if this changes between framesqbias dequantization bias stored as delta from last, last is reset to 0 if always_reset||keyframeblock_max_depth maximum depth of the block tree stored as delta from last, last is reset to 0 if always_reset||keyframequant_table quantization tableHighlevel bitstream structure:==============================--------------------------------------------|Header|--------------------------------------------|------------------------------------|||Block0||||split?||||yes no||||......... intra?||||:Block01 :yes no||||:Block02 :....... ..........||||:Block03 ::y DC ::ref index:||||:Block04 ::cb DC ::motion x :||||......... :cr DC ::motion y :||||....... ..........|||------------------------------------||------------------------------------|||Block1|||...|--------------------------------------------|------------ ------------ ------------|||Y subbands||Cb subbands||Cr subbands||||--- ---||--- ---||--- ---|||||LL0||HL0||||LL0||HL0||||LL0||HL0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||LH0||HH0||||LH0||HH0||||LH0||HH0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HL1||LH1||||HL1||LH1||||HL1||LH1|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HH1||HL2||||HH1||HL2||||HH1||HL2|||||...||...||...|||------------ ------------ ------------|--------------------------------------------Decoding process:=================------------|||Subbands|------------||||------------|Intra DC||||LL0 subband prediction ------------|\ Dequantization ------------------- \||Reference frames|\ IDWT|------- -------|Motion \|||Frame 0||Frame 1||Compensation . OBMC v -------|------- -------|--------------. \------> Frame n output Frame Frame<----------------------------------/|...|------------------- Range Coder:============Binary Range Coder:------------------- The implemented range coder is an adapted version based upon "Range encoding: an algorithm for removing redundancy from a digitised message." by G. N. N. Martin. The symbols encoded by the Snow range coder are bits(0|1). The associated probabilities are not fix but change depending on the symbol mix seen so far. bit seen|new state ---------+----------------------------------------------- 0|256 - state_transition_table[256 - old_state];1|state_transition_table[old_state];state_transition_table={ 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, 226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0};FIXME Range Coding of integers:------------------------- FIXME Neighboring Blocks:===================left and top are set to the respective blocks unless they are outside of the image in which case they are set to the Null block top-left is set to the top left block unless it is outside of the image in which case it is set to the left block if this block has no larger parent block or it is at the left side of its parent block and the top right block is not outside of the image then the top right block is used for top-right else the top-left block is used Null block y, cb, cr are 128 level, ref, mx and my are 0 Motion Vector Prediction:=========================1. the motion vectors of all the neighboring blocks are scaled to compensate for the difference of reference frames scaled_mv=(mv *(256 *(current_reference+1)/(mv.reference+1))+128)> the median of the scaled left
Definition: snow.txt:386
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
SIZE_SPECIFIER
#define SIZE_SPECIFIER
Definition: internal.h:129
AVStreamGroup
Definition: avformat.h:1098
AVCodecContext
main external API structure.
Definition: avcodec.h:431
AVStream::index
int index
stream index in AVFormatContext
Definition: avformat.h:750
AVStreamGroup::nb_streams
unsigned int nb_streams
Number of elements in AVStreamGroup.streams.
Definition: avformat.h:1152
channel_layout.h
AVInputFormat::flags
int flags
Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, AVFMT_NOTIMESTAMPS,...
Definition: avformat.h:563
AVCodecContext::qmin
int qmin
minimum quantizer
Definition: avcodec.h:1234
AVRational::den
int den
Denominator.
Definition: rational.h:60
AVDOVIDecoderConfigurationRecord::bl_present_flag
uint8_t bl_present_flag
Definition: dovi_meta.h:62
AV_AUDIO_SERVICE_TYPE_COMMENTARY
@ AV_AUDIO_SERVICE_TYPE_COMMENTARY
Definition: defs.h:241
AVIAMFSubmixLayout::sound_system
AVChannelLayout sound_system
Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2ch, 3....
Definition: iamf.h:525
AVReplayGain::album_peak
uint32_t album_peak
Same as track_peak, but for the whole album,.
Definition: replaygain.h:47
AVStream::r_frame_rate
AVRational r_frame_rate
Real base framerate of the stream.
Definition: avformat.h:878
AVDOVIDecoderConfigurationRecord::rpu_present_flag
uint8_t rpu_present_flag
Definition: dovi_meta.h:60
AVDOVIDecoderConfigurationRecord::el_present_flag
uint8_t el_present_flag
Definition: dovi_meta.h:61
AVStreamGroupLCEVC::width
int width
Width of the final stream for presentation.
Definition: avformat.h:1080
AVFormatContext::duration
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
Definition: avformat.h:1399
AVPacket::stream_index
int stream_index
Definition: packet.h:560
dump_spherical
static void dump_spherical(void *ctx, int w, int h, const AVPacketSideData *sd, int log_level)
Definition: dump.c:381
pkt_dump_internal
static void pkt_dump_internal(void *avcl, FILE *f, int level, const AVPacket *pkt, int dump_payload, AVRational time_base)
Definition: dump.c:93
FF_DISABLE_DEPRECATION_WARNINGS
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:72
AVReplayGain
ReplayGain information (see http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1....
Definition: replaygain.h:29
AVIAMFSubmix::nb_elements
unsigned int nb_elements
Number of elements in the submix.
Definition: iamf.h:572
AVStreamGroupTileGrid::offsets
struct AVStreamGroupTileGrid::@404 * offsets
An nb_tiles sized array of offsets in pixels from the topleft edge of the canvas, indicating where ea...
AVCodecContext::coded_width
int coded_width
Bitstream width / height, may be different from width/height e.g.
Definition: avcodec.h:607
AV_PKT_DATA_AUDIO_SERVICE_TYPE
@ AV_PKT_DATA_AUDIO_SERVICE_TYPE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
Definition: packet.h:117
AV3DReferenceDisplaysInfo::num_ref_displays
uint8_t num_ref_displays
The number of reference displays that are signalled in this struct.
Definition: tdrdi.h:78
AVDOVIDecoderConfigurationRecord::dv_version_minor
uint8_t dv_version_minor
Definition: dovi_meta.h:57
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
us
#define us(width, name, range_min, range_max, subs,...)
Definition: cbs_apv.c:72
mem.h
AVStreamGroup::type
enum AVStreamGroupParamsType type
Group type.
Definition: avformat.h:1125
mastering_display_metadata.h
print_peak
static void print_peak(void *ctx, const char *str, uint32_t peak, int log_level)
Definition: dump.c:226
AVIAMFMixPresentation::annotations
AVDictionary * annotations
A dictionary of strings describing the mix in different languages.
Definition: iamf.h:641
AVFormatContext::nb_stream_groups
unsigned int nb_stream_groups
Number of elements in AVFormatContext.stream_groups.
Definition: avformat.h:1339
AVStreamGroupTileGrid::height
int height
Height of the final image for presentation.
Definition: avformat.h:1046
AVStereo3D::view
enum AVStereo3DView view
Determines which views are packed.
Definition: stereo3d.h:217
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
AVDictionaryEntry
Definition: dict.h:90
AV_AUDIO_SERVICE_TYPE_EFFECTS
@ AV_AUDIO_SERVICE_TYPE_EFFECTS
Definition: defs.h:237
AVPacket
This structure stores compressed data.
Definition: packet.h:535
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:592
int32_t
int32_t
Definition: audioconvert.c:56
AVIAMFSubmixElement
Submix element as defined in section 3.7 of IAMF.
Definition: iamf.h:446
AVCodecContext::properties
attribute_deprecated unsigned properties
Properties of the stream that gets decoded.
Definition: avcodec.h:1637
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVFormatContext::start_time
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds.
Definition: avformat.h:1389
av_stereo3d_type_name
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
Definition: stereo3d.c:93
h
h
Definition: vp9dsp_template.c:2070
av_pkt_dump_log2
void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload, const AVStream *st)
Send a nice dump of a packet to the log.
Definition: dump.c:122
AV_AUDIO_SERVICE_TYPE_DIALOGUE
@ AV_AUDIO_SERVICE_TYPE_DIALOGUE
Definition: defs.h:240
AVStereo3D
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
Definition: stereo3d.h:203
AVDictionaryEntry::value
char * value
Definition: dict.h:92
AVStream::start_time
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
Definition: avformat.h:793
avstring.h
width
#define width
Definition: dsp.h:89
AVAmbientViewingEnvironment::ambient_light_y
AVRational ambient_light_y
Normalized y chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
Definition: ambient_viewing_environment.h:54
AVStreamGroupTileGrid::idx
unsigned int idx
Index of the stream in the group this tile references.
Definition: avformat.h:990
AVChapter::time_base
AVRational time_base
time base in which the start/end timestamps are specified
Definition: avformat.h:1225
AVIAMFMixPresentation::submixes
AVIAMFSubmix ** submixes
Array of submixes.
Definition: iamf.h:622
dump_stream_group
static void dump_stream_group(const AVFormatContext *ic, uint8_t *printed, int i, int index, int is_output)
Definition: dump.c:694
AV_AUDIO_SERVICE_TYPE_MAIN
@ AV_AUDIO_SERVICE_TYPE_MAIN
Definition: defs.h:236
AVSphericalMapping
This structure describes how to handle spherical videos, outlining information about projection,...
Definition: spherical.h:100
av_dict_iterate
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
Definition: dict.c:42
AVSphericalMapping::yaw
int32_t yaw
Rotation around the up vector [-180, 180].
Definition: spherical.h:144
tdrdi.h
av_display_rotation_get
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.
Definition: display.c:35
AV_DISPOSITION_LYRICS
#define AV_DISPOSITION_LYRICS
The stream contains song lyrics.
Definition: avformat.h:639
AVDOVIDecoderConfigurationRecord
Definition: dovi_meta.h:55
AV_DISPOSITION_NON_DIEGETIC
#define AV_DISPOSITION_NON_DIEGETIC
The stream is intended to be mixed with a spatial audio track.
Definition: avformat.h:682
av_hex_dump
void av_hex_dump(FILE *f, const uint8_t *buf, int size)
Send a nice hexadecimal dump of a buffer to the specified file stream.
Definition: dump.c:83