FFmpeg
dirac.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 Marco Gerards <marco@gnu.org>
3  * Copyright (C) 2009 David Conrad
4  * Copyright (C) 2011 Jordi Ortiz
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  * Dirac Decoder
26  * @author Marco Gerards <marco@gnu.org>, David Conrad, Jordi Ortiz <nenjordi@gmail.com>
27  */
28 
29 #include "libavutil/pixdesc.h"
30 
31 #include "dirac.h"
32 #include "golomb.h"
33 #include "mpeg12data.h"
34 
35 #if CONFIG_DIRAC_PARSE
36 
37 typedef struct dirac_source_params {
38  unsigned width;
39  unsigned height;
40  uint8_t chroma_format; ///< 0: 444 1: 422 2: 420
41 
42  uint8_t interlaced;
43  uint8_t top_field_first;
44 
45  uint8_t frame_rate_index; ///< index into dirac_frame_rate[]
46  uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[]
47 
48  uint16_t clean_width;
49  uint16_t clean_height;
50  uint16_t clean_left_offset;
51  uint16_t clean_right_offset;
52 
53  uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[]
54  uint8_t color_spec_index; ///< index into dirac_color_spec_presets[]
55 } dirac_source_params;
56 
57 /* defaults for source parameters */
58 static const dirac_source_params dirac_source_parameters_defaults[] = {
59  { 640, 480, 2, 0, 0, 1, 1, 640, 480, 0, 0, 1, 0 },
60  { 176, 120, 2, 0, 0, 9, 2, 176, 120, 0, 0, 1, 1 },
61  { 176, 144, 2, 0, 1, 10, 3, 176, 144, 0, 0, 1, 2 },
62  { 352, 240, 2, 0, 0, 9, 2, 352, 240, 0, 0, 1, 1 },
63  { 352, 288, 2, 0, 1, 10, 3, 352, 288, 0, 0, 1, 2 },
64  { 704, 480, 2, 0, 0, 9, 2, 704, 480, 0, 0, 1, 1 },
65  { 704, 576, 2, 0, 1, 10, 3, 704, 576, 0, 0, 1, 2 },
66  { 720, 480, 1, 1, 0, 4, 2, 704, 480, 8, 0, 3, 1 },
67  { 720, 576, 1, 1, 1, 3, 3, 704, 576, 8, 0, 3, 2 },
68 
69  { 1280, 720, 1, 0, 1, 7, 1, 1280, 720, 0, 0, 3, 3 },
70  { 1280, 720, 1, 0, 1, 6, 1, 1280, 720, 0, 0, 3, 3 },
71  { 1920, 1080, 1, 1, 1, 4, 1, 1920, 1080, 0, 0, 3, 3 },
72  { 1920, 1080, 1, 1, 1, 3, 1, 1920, 1080, 0, 0, 3, 3 },
73  { 1920, 1080, 1, 0, 1, 7, 1, 1920, 1080, 0, 0, 3, 3 },
74  { 1920, 1080, 1, 0, 1, 6, 1, 1920, 1080, 0, 0, 3, 3 },
75  { 2048, 1080, 0, 0, 1, 2, 1, 2048, 1080, 0, 0, 4, 4 },
76  { 4096, 2160, 0, 0, 1, 2, 1, 4096, 2160, 0, 0, 4, 4 },
77 
78  { 3840, 2160, 1, 0, 1, 7, 1, 3840, 2160, 0, 0, 3, 3 },
79  { 3840, 2160, 1, 0, 1, 6, 1, 3840, 2160, 0, 0, 3, 3 },
80  { 7680, 4320, 1, 0, 1, 7, 1, 3840, 2160, 0, 0, 3, 3 },
81  { 7680, 4320, 1, 0, 1, 6, 1, 3840, 2160, 0, 0, 3, 3 },
82 };
83 
84 /* [DIRAC_STD] Table 10.4 - Available preset pixel aspect ratio values */
85 static const AVRational dirac_preset_aspect_ratios[] = {
86  { 1, 1 },
87  { 10, 11 },
88  { 12, 11 },
89  { 40, 33 },
90  { 16, 11 },
91  { 4, 3 },
92 };
93 
94 /* [DIRAC_STD] Values 9,10 of 10.3.5 Frame Rate.
95  * Table 10.3 Available preset frame rate values
96  */
97 static const AVRational dirac_frame_rate[] = {
98  { 15000, 1001 },
99  { 25, 2 },
100 };
101 
102 /* [DIRAC_STD] This should be equivalent to Table 10.5 Available signal
103  * range presets */
104 static const struct {
105  uint8_t bitdepth;
107 } pixel_range_presets[] = {
108  { 8, AVCOL_RANGE_JPEG },
109  { 8, AVCOL_RANGE_MPEG },
110  { 10, AVCOL_RANGE_MPEG },
111  { 12, AVCOL_RANGE_MPEG },
112 };
113 
114 static const enum AVColorPrimaries dirac_primaries[] = {
118 };
119 
120 static const struct {
122  enum AVColorSpace colorspace;
123  enum AVColorTransferCharacteristic color_trc;
124 } dirac_color_presets[] = {
130 };
131 
132 /* [DIRAC_STD] Table 10.2 Supported chroma sampling formats */
133 static const enum AVPixelFormat dirac_pix_fmt[][3] = {
137 };
138 
139 /* [DIRAC_STD] 10.3 Parse Source Parameters.
140  * source_parameters(base_video_format) */
141 static int parse_source_parameters(AVDiracSeqHeader *dsh, GetBitContext *gb,
142  void *log_ctx)
143 {
144  AVRational frame_rate = { 0, 0 };
145  unsigned luma_depth = 8, luma_offset = 16;
146  int idx;
147  int chroma_x_shift, chroma_y_shift;
148  int ret;
149 
150  /* [DIRAC_STD] 10.3.2 Frame size. frame_size(video_params) */
151  /* [DIRAC_STD] custom_dimensions_flag */
152  if (get_bits1(gb)) {
153  dsh->width = get_interleaved_ue_golomb(gb); /* [DIRAC_STD] FRAME_WIDTH */
154  dsh->height = get_interleaved_ue_golomb(gb); /* [DIRAC_STD] FRAME_HEIGHT */
155  }
156 
157  /* [DIRAC_STD] 10.3.3 Chroma Sampling Format.
158  * chroma_sampling_format(video_params) */
159  /* [DIRAC_STD] custom_chroma_format_flag */
160  if (get_bits1(gb))
161  /* [DIRAC_STD] CHROMA_FORMAT_INDEX */
163  if (dsh->chroma_format > 2U) {
164  if (log_ctx)
165  av_log(log_ctx, AV_LOG_ERROR, "Unknown chroma format %d\n",
166  dsh->chroma_format);
167  return AVERROR_INVALIDDATA;
168  }
169 
170  /* [DIRAC_STD] 10.3.4 Scan Format. scan_format(video_params) */
171  /* [DIRAC_STD] custom_scan_format_flag */
172  if (get_bits1(gb))
173  /* [DIRAC_STD] SOURCE_SAMPLING */
175  if (dsh->interlaced > 1U)
176  return AVERROR_INVALIDDATA;
177 
178  /* [DIRAC_STD] 10.3.5 Frame Rate. frame_rate(video_params) */
179  if (get_bits1(gb)) { /* [DIRAC_STD] custom_frame_rate_flag */
181 
182  if (dsh->frame_rate_index > 10U)
183  return AVERROR_INVALIDDATA;
184 
185  if (!dsh->frame_rate_index) {
186  /* [DIRAC_STD] FRAME_RATE_NUMER */
187  frame_rate.num = get_interleaved_ue_golomb(gb);
188  /* [DIRAC_STD] FRAME_RATE_DENOM */
189  frame_rate.den = get_interleaved_ue_golomb(gb);
190  }
191  }
192  /* [DIRAC_STD] preset_frame_rate(video_params, index) */
193  if (dsh->frame_rate_index > 0) {
194  if (dsh->frame_rate_index <= 8)
195  frame_rate = ff_mpeg12_frame_rate_tab[dsh->frame_rate_index];
196  else
197  /* [DIRAC_STD] Table 10.3 values 9-10 */
198  frame_rate = dirac_frame_rate[dsh->frame_rate_index - 9];
199  }
200  dsh->framerate = frame_rate;
201 
202  /* [DIRAC_STD] 10.3.6 Pixel Aspect Ratio.
203  * pixel_aspect_ratio(video_params) */
204  if (get_bits1(gb)) { /* [DIRAC_STD] custom_pixel_aspect_ratio_flag */
205  /* [DIRAC_STD] index */
207 
208  if (dsh->aspect_ratio_index > 6U)
209  return AVERROR_INVALIDDATA;
210 
211  if (!dsh->aspect_ratio_index) {
214  }
215  }
216  /* [DIRAC_STD] Take value from Table 10.4 Available preset pixel
217  * aspect ratio values */
218  if (dsh->aspect_ratio_index > 0)
219  dsh->sample_aspect_ratio =
220  dirac_preset_aspect_ratios[dsh->aspect_ratio_index - 1];
221 
222  /* [DIRAC_STD] 10.3.7 Clean area. clean_area(video_params) */
223  if (get_bits1(gb)) { /* [DIRAC_STD] custom_clean_area_flag */
224  /* [DIRAC_STD] CLEAN_WIDTH */
226  /* [DIRAC_STD] CLEAN_HEIGHT */
228  /* [DIRAC_STD] CLEAN_LEFT_OFFSET */
230  /* [DIRAC_STD] CLEAN_RIGHT_OFFSET */
232  }
233 
234  /* [DIRAC_STD] 10.3.8 Signal range. signal_range(video_params)
235  * WARNING: Some adaptation seems to be done using the
236  * AVCOL_RANGE_MPEG/JPEG values */
237  if (get_bits1(gb)) { /* [DIRAC_STD] custom_signal_range_flag */
238  /* [DIRAC_STD] index */
240 
241  if (dsh->pixel_range_index > 4U)
242  return AVERROR_INVALIDDATA;
243 
244  /* This assumes either fullrange or MPEG levels only */
245  if (!dsh->pixel_range_index) {
246  luma_offset = get_interleaved_ue_golomb(gb);
247  luma_depth = av_log2(get_interleaved_ue_golomb(gb)) + 1;
248  get_interleaved_ue_golomb(gb); /* chroma offset */
249  get_interleaved_ue_golomb(gb); /* chroma excursion */
250  dsh->color_range = luma_offset ? AVCOL_RANGE_MPEG
252  }
253  }
254  /* [DIRAC_STD] Table 10.5
255  * Available signal range presets <--> pixel_range_presets */
256  if (dsh->pixel_range_index > 0) {
257  idx = dsh->pixel_range_index - 1;
258  luma_depth = pixel_range_presets[idx].bitdepth;
259  dsh->color_range = pixel_range_presets[idx].color_range;
260  }
261 
262  dsh->bit_depth = luma_depth;
263 
264  /* Full range 8 bts uses the same pix_fmts as limited range 8 bits */
265  dsh->pixel_range_index += dsh->pixel_range_index == 1;
266 
267  if (dsh->pixel_range_index < 2U)
268  return AVERROR_INVALIDDATA;
269 
270  dsh->pix_fmt = dirac_pix_fmt[dsh->chroma_format][dsh->pixel_range_index-2];
271  ret = av_pix_fmt_get_chroma_sub_sample(dsh->pix_fmt, &chroma_x_shift, &chroma_y_shift);
272  if (ret)
273  return ret;
274 
275  if ((dsh->width % (1<<chroma_x_shift)) || (dsh->height % (1<<chroma_y_shift))) {
276  if (log_ctx)
277  av_log(log_ctx, AV_LOG_ERROR, "Dimensions must be an integer multiple of the chroma subsampling\n");
278  return AVERROR_INVALIDDATA;
279  }
280 
281  /* [DIRAC_STD] 10.3.9 Colour specification. colour_spec(video_params) */
282  if (get_bits1(gb)) { /* [DIRAC_STD] custom_colour_spec_flag */
283  /* [DIRAC_STD] index */
285 
286  if (dsh->color_spec_index > 4U)
287  return AVERROR_INVALIDDATA;
288 
289  dsh->color_primaries = dirac_color_presets[idx].color_primaries;
290  dsh->colorspace = dirac_color_presets[idx].colorspace;
291  dsh->color_trc = dirac_color_presets[idx].color_trc;
292 
293  if (!dsh->color_spec_index) {
294  /* [DIRAC_STD] 10.3.9.1 Colour primaries */
295  if (get_bits1(gb)) {
296  idx = get_interleaved_ue_golomb(gb);
297  if (idx < 3U)
298  dsh->color_primaries = dirac_primaries[idx];
299  }
300  /* [DIRAC_STD] 10.3.9.2 Colour matrix */
301  if (get_bits1(gb)) {
302  idx = get_interleaved_ue_golomb(gb);
303  if (!idx)
305  else if (idx == 1)
307  }
308  /* [DIRAC_STD] 10.3.9.3 Transfer function */
309  if (get_bits1(gb) && !get_interleaved_ue_golomb(gb))
310  dsh->color_trc = AVCOL_TRC_BT709;
311  }
312  } else {
313  idx = dsh->color_spec_index;
314  dsh->color_primaries = dirac_color_presets[idx].color_primaries;
315  dsh->colorspace = dirac_color_presets[idx].colorspace;
316  dsh->color_trc = dirac_color_presets[idx].color_trc;
317  }
318 
319  return 0;
320 }
321 
322 /* [DIRAC_STD] 10. Sequence Header. sequence_header() */
324  const uint8_t *buf, size_t buf_size,
325  void *log_ctx)
326 {
327  AVDiracSeqHeader *dsh;
328  GetBitContext gb;
329  unsigned video_format, picture_coding_mode;
330  int ret;
331 
332  dsh = av_mallocz(sizeof(*dsh));
333  if (!dsh)
334  return AVERROR(ENOMEM);
335 
336  ret = init_get_bits8(&gb, buf, buf_size);
337  if (ret < 0)
338  goto fail;
339 
340  /* [DIRAC_SPEC] 10.1 Parse Parameters. parse_parameters() */
344  dsh->level = get_interleaved_ue_golomb(&gb);
345  /* [DIRAC_SPEC] sequence_header() -> base_video_format as defined in
346  * 10.2 Base Video Format, table 10.1 Dirac predefined video formats */
347  video_format = get_interleaved_ue_golomb(&gb);
348 
349  if (dsh->version.major < 2 && log_ctx)
350  av_log(log_ctx, AV_LOG_WARNING, "Stream is old and may not work\n");
351  else if (dsh->version.major > 2 && log_ctx)
352  av_log(log_ctx, AV_LOG_WARNING, "Stream may have unhandled features\n");
353 
354  if (video_format > 20U) {
356  goto fail;
357  }
358 
359  /* Fill in defaults for the source parameters. */
360  dsh->width = dirac_source_parameters_defaults[video_format].width;
361  dsh->height = dirac_source_parameters_defaults[video_format].height;
362  dsh->chroma_format = dirac_source_parameters_defaults[video_format].chroma_format;
363  dsh->interlaced = dirac_source_parameters_defaults[video_format].interlaced;
364  dsh->top_field_first = dirac_source_parameters_defaults[video_format].top_field_first;
365  dsh->frame_rate_index = dirac_source_parameters_defaults[video_format].frame_rate_index;
366  dsh->aspect_ratio_index = dirac_source_parameters_defaults[video_format].aspect_ratio_index;
367  dsh->clean_width = dirac_source_parameters_defaults[video_format].clean_width;
368  dsh->clean_height = dirac_source_parameters_defaults[video_format].clean_height;
369  dsh->clean_left_offset = dirac_source_parameters_defaults[video_format].clean_left_offset;
370  dsh->clean_right_offset = dirac_source_parameters_defaults[video_format].clean_right_offset;
371  dsh->pixel_range_index = dirac_source_parameters_defaults[video_format].pixel_range_index;
372  dsh->color_spec_index = dirac_source_parameters_defaults[video_format].color_spec_index;
373 
374  /* [DIRAC_STD] 10.3 Source Parameters
375  * Override the defaults. */
376  ret = parse_source_parameters(dsh, &gb, log_ctx);
377  if (ret < 0)
378  goto fail;
379 
380  /* [DIRAC_STD] picture_coding_mode shall be 0 for fields and 1 for frames
381  * currently only used to signal field coding */
382  picture_coding_mode = get_interleaved_ue_golomb(&gb);
383  if (picture_coding_mode != 0) {
384  if (log_ctx) {
385  av_log(log_ctx, AV_LOG_ERROR, "Unsupported picture coding mode %d",
386  picture_coding_mode);
387  }
389  goto fail;
390  }
391 
392  *pdsh = dsh;
393  return 0;
394 fail:
395  av_freep(&dsh);
396  *pdsh = NULL;
397  return ret;
398 }
399 #else
401  const uint8_t *buf, size_t buf_size,
402  void *log_ctx)
403 {
404  return AVERROR(ENOSYS);
405 }
406 #endif
av_dirac_parse_sequence_header
int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh, const uint8_t *buf, size_t buf_size, void *log_ctx)
Parse a Dirac sequence header.
Definition: dirac.c:400
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVColorTransferCharacteristic
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:496
get_interleaved_ue_golomb
static unsigned get_interleaved_ue_golomb(GetBitContext *gb)
Definition: golomb.h:143
AVDiracSeqHeader::color_trc
enum AVColorTransferCharacteristic color_trc
Definition: dirac.h:109
DiracVersionInfo::major
int major
Definition: dirac.h:77
pixdesc.h
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:599
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:499
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:406
AVDiracSeqHeader::top_field_first
uint8_t top_field_first
Definition: dirac.h:87
AVDiracSeqHeader::pixel_range_index
uint8_t pixel_range_index
index into dirac_pixel_range_presets[]
Definition: dirac.h:97
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:471
AVDiracSeqHeader::interlaced
uint8_t interlaced
Definition: dirac.h:86
AVDiracSeqHeader::color_range
enum AVColorRange color_range
Definition: dirac.h:107
AVDiracSeqHeader::sample_aspect_ratio
AVRational sample_aspect_ratio
Definition: dirac.h:104
golomb.h
exp golomb vlc stuff
AVCOL_SPC_BT470BG
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
Definition: pixfmt.h:531
AVDiracSeqHeader::level
int level
Definition: dirac.h:101
AVDiracSeqHeader::version
DiracVersionInfo version
Definition: dirac.h:112
U
#define U(x)
Definition: vp56_arith.h:37
fail
#define fail()
Definition: checkasm.h:131
GetBitContext
Definition: get_bits.h:61
av_pix_fmt_get_chroma_sub_sample
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
Definition: pixdesc.c:2690
AVRational::num
int num
Numerator.
Definition: rational.h:59
dirac.h
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:409
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AVDiracSeqHeader::bit_depth
int bit_depth
Definition: dirac.h:113
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:667
width
#define width
AVDiracSeqHeader::profile
int profile
Definition: dirac.h:100
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
color_range
color_range
Definition: vf_selectivecolor.c:44
AVCOL_PRI_BT470BG
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:478
AVDiracSeqHeader::chroma_format
uint8_t chroma_format
0: 444 1: 422 2: 420
Definition: dirac.h:84
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:479
AVDiracSeqHeader::framerate
AVRational framerate
Definition: dirac.h:103
NULL
#define NULL
Definition: coverity.c:32
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVDiracSeqHeader::colorspace
enum AVColorSpace colorspace
Definition: dirac.h:110
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:473
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:498
AVDiracSeqHeader::clean_height
uint16_t clean_height
Definition: dirac.h:93
AVDiracSeqHeader::clean_width
uint16_t clean_width
Definition: dirac.h:92
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:407
AVDiracSeqHeader::clean_right_offset
uint16_t clean_right_offset
Definition: dirac.h:95
AVDiracSeqHeader::color_spec_index
uint8_t color_spec_index
index into dirac_color_spec_presets[]
Definition: dirac.h:98
color_primaries
static const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB]
Definition: csp.c:71
AVDiracSeqHeader::frame_rate_index
uint8_t frame_rate_index
index into dirac_frame_rate[]
Definition: dirac.h:89
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:411
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:413
height
#define height
AVCOL_TRC_BT709
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition: pixfmt.h:498
interlaced
uint8_t interlaced
Definition: mxfenc.c:2042
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:525
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:264
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:582
DiracVersionInfo::minor
int minor
Definition: dirac.h:78
ff_mpeg12_frame_rate_tab
const AVRational ff_mpeg12_frame_rate_tab[]
Definition: mpeg12framerate.c:24
AVDiracSeqHeader
Definition: dirac.h:81
ret
ret
Definition: filter_design.txt:187
AVDiracSeqHeader::clean_left_offset
uint16_t clean_left_offset
Definition: dirac.h:94
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:410
mpeg12data.h
AVDiracSeqHeader::pix_fmt
enum AVPixelFormat pix_fmt
Definition: dirac.h:106
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
AVDiracSeqHeader::aspect_ratio_index
uint8_t aspect_ratio_index
index into dirac_aspect_ratio[]
Definition: dirac.h:90
AVDiracSeqHeader::width
unsigned width
Definition: dirac.h:82
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
AVDiracSeqHeader::height
unsigned height
Definition: dirac.h:83
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
AVCOL_SPC_BT709
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
Definition: pixfmt.h:527
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:564
AVDiracSeqHeader::color_primaries
enum AVColorPrimaries color_primaries
Definition: dirac.h:108
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26