FFmpeg
dpx.c
Go to the documentation of this file.
1 /*
2  * DPX (.dpx) image decoder
3  * Copyright (c) 2009 Jimmy Christensen
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 "libavutil/avstring.h"
23 #include "libavutil/intreadwrite.h"
24 #include "libavutil/intfloat.h"
25 #include "libavutil/imgutils.h"
26 #include "libavutil/timecode.h"
27 #include "avcodec.h"
28 #include "codec_internal.h"
29 #include "decode.h"
30 #include "dpx.h"
31 
32 #include "thread.h"
33 #include "hwconfig.h"
34 #include "hwaccel_internal.h"
35 #include "config_components.h"
36 
37 static unsigned int read16(const uint8_t **ptr, int is_big)
38 {
39  unsigned int temp;
40  if (is_big) {
41  temp = AV_RB16(*ptr);
42  } else {
43  temp = AV_RL16(*ptr);
44  }
45  *ptr += 2;
46  return temp;
47 }
48 
49 static unsigned int read32(const uint8_t **ptr, int is_big)
50 {
51  unsigned int temp;
52  if (is_big) {
53  temp = AV_RB32(*ptr);
54  } else {
55  temp = AV_RL32(*ptr);
56  }
57  *ptr += 4;
58  return temp;
59 }
60 
61 static uint16_t read10in32_gray(const uint8_t **ptr, uint32_t *lbuf,
62  int *n_datum, int is_big, int shift)
63 {
64  uint16_t temp;
65 
66  if (*n_datum)
67  (*n_datum)--;
68  else {
69  *lbuf = read32(ptr, is_big);
70  *n_datum = 2;
71  }
72 
73  temp = *lbuf >> shift & 0x3FF;
74  *lbuf = *lbuf >> 10;
75 
76  return temp;
77 }
78 
79 static uint16_t read10in32(const uint8_t **ptr, uint32_t *lbuf,
80  int *n_datum, int is_big, int shift)
81 {
82  if (*n_datum)
83  (*n_datum)--;
84  else {
85  *lbuf = read32(ptr, is_big);
86  *n_datum = 2;
87  }
88 
89  *lbuf = *lbuf << 10 | *lbuf >> shift & 0x3FFFFF;
90 
91  return *lbuf & 0x3FF;
92 }
93 
94 static uint16_t read12in32(const uint8_t **ptr, uint32_t *lbuf,
95  int *n_datum, int is_big)
96 {
97  if (*n_datum)
98  (*n_datum)--;
99  else {
100  *lbuf = read32(ptr, is_big);
101  *n_datum = 7;
102  }
103 
104  switch (*n_datum){
105  case 7: return *lbuf & 0xFFF;
106  case 6: return (*lbuf >> 12) & 0xFFF;
107  case 5: {
108  uint32_t c = *lbuf >> 24;
109  *lbuf = read32(ptr, is_big);
110  c |= *lbuf << 8;
111  return c & 0xFFF;
112  }
113  case 4: return (*lbuf >> 4) & 0xFFF;
114  case 3: return (*lbuf >> 16) & 0xFFF;
115  case 2: {
116  uint32_t c = *lbuf >> 28;
117  *lbuf = read32(ptr, is_big);
118  c |= *lbuf << 4;
119  return c & 0xFFF;
120  }
121  case 1: return (*lbuf >> 8) & 0xFFF;
122  default: return *lbuf >> 20;
123  }
124 }
125 
126 static void unpack_frame(AVCodecContext *avctx, AVFrame *p, const uint8_t *buf,
127  int elements, int endian)
128 {
129  int i, x, y;
130  DPXDecContext *dpx = avctx->priv_data;
131 
132  uint8_t *ptr[AV_NUM_DATA_POINTERS];
133  unsigned int rgbBuffer = 0;
134  int n_datum = 0;
135 
136  for (i=0; i<AV_NUM_DATA_POINTERS; i++)
137  ptr[i] = p->data[i];
138 
139  switch (avctx->bits_per_raw_sample) {
140  case 10:
141  for (x = 0; x < avctx->height; x++) {
142  uint16_t *dst[4] = {(uint16_t*)ptr[0],
143  (uint16_t*)ptr[1],
144  (uint16_t*)ptr[2],
145  (uint16_t*)ptr[3]};
146  int shift = elements > 1 ? dpx->packing == 1 ? 22 : 20 : dpx->packing == 1 ? 2 : 0;
147  for (y = 0; y < avctx->width; y++) {
148  if (elements >= 3)
149  *dst[2]++ = read10in32(&buf, &rgbBuffer,
150  &n_datum, endian, shift);
151  if (elements == 1)
152  *dst[0]++ = read10in32_gray(&buf, &rgbBuffer,
153  &n_datum, endian, shift);
154  else
155  *dst[0]++ = read10in32(&buf, &rgbBuffer,
156  &n_datum, endian, shift);
157  if (elements >= 2)
158  *dst[1]++ = read10in32(&buf, &rgbBuffer,
159  &n_datum, endian, shift);
160  if (elements == 4)
161  *dst[3]++ =
162  read10in32(&buf, &rgbBuffer,
163  &n_datum, endian, shift);
164  }
165  if (!dpx->unpadded_10bit)
166  n_datum = 0;
167  for (i = 0; i < elements; i++)
168  ptr[i] += p->linesize[i];
169  }
170  break;
171  case 12:
172  for (x = 0; x < avctx->height; x++) {
173  uint16_t *dst[4] = {(uint16_t*)ptr[0],
174  (uint16_t*)ptr[1],
175  (uint16_t*)ptr[2],
176  (uint16_t*)ptr[3]};
177  int shift = dpx->packing == 1 ? 4 : 0;
178  for (y = 0; y < avctx->width; y++) {
179  if (dpx->packing) {
180  if (elements >= 3)
181  *dst[2]++ = read16(&buf, endian) >> shift & 0xFFF;
182  *dst[0]++ = read16(&buf, endian) >> shift & 0xFFF;
183  if (elements >= 2)
184  *dst[1]++ = read16(&buf, endian) >> shift & 0xFFF;
185  if (elements == 4)
186  *dst[3]++ = read16(&buf, endian) >> shift & 0xFFF;
187  } else {
188  if (elements >= 3)
189  *dst[2]++ = read12in32(&buf, &rgbBuffer,
190  &n_datum, endian);
191  *dst[0]++ = read12in32(&buf, &rgbBuffer,
192  &n_datum, endian);
193  if (elements >= 2)
194  *dst[1]++ = read12in32(&buf, &rgbBuffer,
195  &n_datum, endian);
196  if (elements == 4)
197  *dst[3]++ = read12in32(&buf, &rgbBuffer,
198  &n_datum, endian);
199  }
200  }
201  n_datum = 0;
202  for (i = 0; i < elements; i++)
203  ptr[i] += p->linesize[i];
204  // Jump to next aligned position
205  buf += dpx->need_align;
206  }
207  break;
208  case 32:
209  if (elements == 1) {
210  av_image_copy_plane(ptr[0], p->linesize[0],
211  buf, dpx->stride,
212  elements * avctx->width * 4, avctx->height);
213  } else {
214  for (y = 0; y < avctx->height; y++) {
215  ptr[0] = p->data[0] + y * p->linesize[0];
216  ptr[1] = p->data[1] + y * p->linesize[1];
217  ptr[2] = p->data[2] + y * p->linesize[2];
218  ptr[3] = p->data[3] + y * p->linesize[3];
219  for (x = 0; x < avctx->width; x++) {
220  AV_WN32(ptr[2], AV_RN32(buf));
221  AV_WN32(ptr[0], AV_RN32(buf + 4));
222  AV_WN32(ptr[1], AV_RN32(buf + 8));
223  if (avctx->pix_fmt == AV_PIX_FMT_GBRAPF32BE ||
224  avctx->pix_fmt == AV_PIX_FMT_GBRAPF32LE) {
225  AV_WN32(ptr[3], AV_RN32(buf + 12));
226  buf += 4;
227  ptr[3] += 4;
228  }
229 
230  buf += 12;
231  ptr[2] += 4;
232  ptr[0] += 4;
233  ptr[1] += 4;
234  }
235  }
236  }
237  break;
238  case 16:
239  elements *= 2;
240  case 8:
241  if ( avctx->pix_fmt == AV_PIX_FMT_YUVA444P
242  || avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
243  for (x = 0; x < avctx->height; x++) {
244  ptr[0] = p->data[0] + x * p->linesize[0];
245  ptr[1] = p->data[1] + x * p->linesize[1];
246  ptr[2] = p->data[2] + x * p->linesize[2];
247  ptr[3] = p->data[3] + x * p->linesize[3];
248  for (y = 0; y < avctx->width; y++) {
249  *ptr[1]++ = *buf++;
250  *ptr[0]++ = *buf++;
251  *ptr[2]++ = *buf++;
252  if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P)
253  *ptr[3]++ = *buf++;
254  }
255  }
256  } else {
257  av_image_copy_plane(ptr[0], p->linesize[0],
258  buf, dpx->stride,
259  elements * avctx->width, avctx->height);
260  }
261  break;
262  }
263 }
264 
266  enum AVPixelFormat pix_fmt)
267 {
268  enum AVPixelFormat pix_fmts[] = {
269 #if CONFIG_DPX_VULKAN_HWACCEL
271 #endif
272  pix_fmt,
274  };
275 
276  return ff_get_format(avctx, pix_fmts);
277 }
278 
279 static int decode_frame(AVCodecContext *avctx, AVFrame *p,
280  int *got_frame, AVPacket *avpkt)
281 {
282  DPXDecContext *dpx = avctx->priv_data;
283 
284  enum AVPixelFormat pix_fmt;
285  const uint8_t *buf = avpkt->data;
286  int buf_size = avpkt->size;
287  uint32_t header_version, version = 0;
288  char creator[101] = { 0 };
289  char input_device[33] = { 0 };
290 
291  unsigned int offset;
292  int magic_num;
293  int i, j, ret;
294  int w, h, descriptor;
295  int yuv, color_trc, color_spec;
296  int encoding;
297 
298  if (avpkt->size <= 1634) {
299  av_log(avctx, AV_LOG_ERROR, "Packet too small for DPX header\n");
300  return AVERROR_INVALIDDATA;
301  }
302 
303  magic_num = AV_RB32(buf);
304  buf += 4;
305 
306  /* Check if the files "magic number" is "SDPX" which means it uses
307  * big-endian or XPDS which is for little-endian files */
308  if (magic_num == AV_RL32("SDPX")) {
309  dpx->endian = 0;
310  } else if (magic_num == AV_RB32("SDPX")) {
311  dpx->endian = 1;
312  } else {
313  av_log(avctx, AV_LOG_ERROR, "DPX marker not found\n");
314  return AVERROR_INVALIDDATA;
315  }
316 
317  offset = read32(&buf, dpx->endian);
318  if (avpkt->size <= offset) {
319  av_log(avctx, AV_LOG_ERROR, "Invalid data start offset\n");
320  return AVERROR_INVALIDDATA;
321  }
322 
323  header_version = read32(&buf, 0);
324  if (header_version == MKTAG('V','1','.','0'))
325  version = 1;
326  if (header_version == MKTAG('V','2','.','0'))
327  version = 2;
328  if (!version)
329  av_log(avctx, AV_LOG_WARNING, "Unknown header format version %s.\n",
330  av_fourcc2str(header_version));
331 
332  // Check encryption
333  buf = avpkt->data + 660;
334  ret = read32(&buf, dpx->endian);
335  if (ret != 0xFFFFFFFF) {
336  avpriv_report_missing_feature(avctx, "Encryption");
337  av_log(avctx, AV_LOG_WARNING, "The image is encrypted and may "
338  "not properly decode.\n");
339  }
340 
341  // Need to end in 0x304 offset from start of file
342  buf = avpkt->data + 0x304;
343  w = read32(&buf, dpx->endian);
344  h = read32(&buf, dpx->endian);
345 
346  if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
347  return ret;
348 
349  // Need to end in 0x320 to read the descriptor
350  buf += 20;
351  descriptor = buf[0];
352  color_trc = buf[1];
353  color_spec = buf[2];
354 
355  // Need to end in 0x323 to read the bits per color
356  buf += 3;
357  avctx->bits_per_raw_sample = buf[0];
358  buf++;
359  dpx->packing = read16(&buf, dpx->endian);
360  encoding = read16(&buf, dpx->endian);
361 
362  if (encoding) {
363  avpriv_report_missing_feature(avctx, "Encoding %d", encoding);
364  return AVERROR_PATCHWELCOME;
365  }
366 
367  if (avctx->bits_per_raw_sample > 31)
368  return AVERROR_INVALIDDATA;
369 
370  buf += 820;
371  avctx->sample_aspect_ratio.num = read32(&buf, dpx->endian);
372  avctx->sample_aspect_ratio.den = read32(&buf, dpx->endian);
373  if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0)
376  0x10000);
377  else
378  avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
379 
380  /* preferred frame rate from Motion-picture film header */
381  if (offset >= 1724 + 4) {
382  buf = avpkt->data + 1724;
383  i = read32(&buf, dpx->endian);
384  if(i && i != 0xFFFFFFFF) {
385  AVRational q = av_d2q(av_int2float(i), 4096);
386  if (q.num > 0 && q.den > 0)
387  avctx->framerate = q;
388  }
389  }
390 
391  /* alternative frame rate from television header */
392  if (offset >= 1940 + 4 &&
393  !(avctx->framerate.num && avctx->framerate.den)) {
394  buf = avpkt->data + 1940;
395  i = read32(&buf, dpx->endian);
396  if(i && i != 0xFFFFFFFF) {
397  AVRational q = av_d2q(av_int2float(i), 4096);
398  if (q.num > 0 && q.den > 0)
399  avctx->framerate = q;
400  }
401  }
402 
403  /* SMPTE TC from television header */
404  if (offset >= 1920 + 4) {
405  uint32_t tc;
406  uint32_t *tc_sd;
407  char tcbuf[AV_TIMECODE_STR_SIZE];
408 
409  buf = avpkt->data + 1920;
410  // read32 to native endian, av_bswap32 to opposite of native for
411  // compatibility with av_timecode_make_smpte_tc_string2 etc
412  tc = av_bswap32(read32(&buf, dpx->endian));
413 
414  if (i != 0xFFFFFFFF) {
415  AVFrameSideData *tcside;
417  sizeof(uint32_t) * 4, &tcside);
418  if (ret < 0)
419  return ret;
420 
421  if (tcside) {
422  tc_sd = (uint32_t*)tcside->data;
423  tc_sd[0] = 1;
424  tc_sd[1] = tc;
425 
427  tc_sd[1], 0, 0);
428  av_dict_set(&p->metadata, "timecode", tcbuf, 0);
429  }
430  }
431  }
432 
433  /* color range from television header */
434  if (offset >= 1964 + 4) {
435  buf = avpkt->data + 1952;
436  i = read32(&buf, dpx->endian);
437 
438  buf = avpkt->data + 1964;
439  j = read32(&buf, dpx->endian);
440 
441  if (i != 0xFFFFFFFF && j != 0xFFFFFFFF) {
442  float minCV, maxCV;
443  minCV = av_int2float(i);
444  maxCV = av_int2float(j);
445  if (avctx->bits_per_raw_sample >= 1 &&
446  minCV == 0.0f && maxCV == ((1U<<avctx->bits_per_raw_sample) - 1)) {
447  avctx->color_range = AVCOL_RANGE_JPEG;
448  } else if (avctx->bits_per_raw_sample >= 8 &&
449  minCV == (1 <<(avctx->bits_per_raw_sample - 4)) &&
450  maxCV == (235<<(avctx->bits_per_raw_sample - 8))) {
451  avctx->color_range = AVCOL_RANGE_MPEG;
452  }
453  }
454  }
455 
456  switch (descriptor) {
457  case 1: // R
458  case 2: // G
459  case 3: // B
460  case 4: // A
461  case 6: // Y
462  dpx->components = 1;
463  yuv = 1;
464  break;
465  case 50: // RGB
466  dpx->components = 3;
467  yuv = 0;
468  break;
469  case 52: // ABGR
470  case 51: // RGBA
471  dpx->components = 4;
472  yuv = 0;
473  break;
474  case 100: // UYVY422
475  dpx->components = 2;
476  yuv = 1;
477  break;
478  case 102: // UYV444
479  dpx->components = 3;
480  yuv = 1;
481  break;
482  case 103: // UYVA4444
483  dpx->components = 4;
484  yuv = 1;
485  break;
486  default:
487  avpriv_report_missing_feature(avctx, "Descriptor %d", descriptor);
488  return AVERROR_PATCHWELCOME;
489  }
490 
491  switch (avctx->bits_per_raw_sample) {
492  case 8:
493  dpx->stride = avctx->width * dpx->components;
494  break;
495  case 10:
496  if (!dpx->packing) {
497  av_log(avctx, AV_LOG_ERROR, "Packing to 32bit required\n");
498  return -1;
499  }
500  dpx->stride = (avctx->width * dpx->components + 2) / 3 * 4;
501  break;
502  case 12:
503  dpx->stride = avctx->width * dpx->components;
504  if (dpx->packing) {
505  dpx->stride *= 2;
506  } else {
507  dpx->stride *= 3;
508  if (dpx->stride % 8) {
509  dpx->stride /= 8;
510  dpx->stride++;
511  dpx->stride *= 8;
512  }
513  dpx->stride /= 2;
514  }
515  break;
516  case 16:
517  dpx->stride = 2 * avctx->width * dpx->components;
518  break;
519  case 32:
520  dpx->stride = 4 * avctx->width * dpx->components;
521  break;
522  case 1:
523  case 64:
524  avpriv_report_missing_feature(avctx, "Depth %d", avctx->bits_per_raw_sample);
525  return AVERROR_PATCHWELCOME;
526  default:
527  return AVERROR_INVALIDDATA;
528  }
529 
530  switch (color_trc) {
531  case DPX_TRC_LINEAR:
532  avctx->color_trc = AVCOL_TRC_LINEAR;
533  break;
534  case DPX_TRC_SMPTE_274:
535  case DPX_TRC_ITU_R_709_4:
536  avctx->color_trc = AVCOL_TRC_BT709;
537  break;
540  case DPX_TRC_SMPTE_170:
542  break;
544  avctx->color_trc = AVCOL_TRC_GAMMA28;
545  break;
548  /* Nothing to do */
549  break;
550  default:
551  av_log(avctx, AV_LOG_VERBOSE, "Cannot map DPX transfer characteristic "
552  "%d to color_trc.\n", color_trc);
553  break;
554  }
555 
556  switch (color_spec) {
560  break;
564  break;
568  break;
571  /* Nothing to do */
572  break;
573  default:
574  av_log(avctx, AV_LOG_VERBOSE, "Cannot map DPX color specification "
575  "%d to color_primaries.\n", color_spec);
576  break;
577  }
578 
579  if (yuv) {
580  switch (color_spec) {
583  avctx->colorspace = AVCOL_SPC_BT709;
584  break;
587  avctx->colorspace = AVCOL_SPC_BT470BG;
588  break;
592  break;
595  /* Nothing to do */
596  break;
597  default:
598  av_log(avctx, AV_LOG_INFO, "Cannot map DPX color specification "
599  "%d to colorspace.\n", color_spec);
600  break;
601  }
602  } else {
603  avctx->colorspace = AVCOL_SPC_RGB;
604  }
605 
606  av_strlcpy(creator, avpkt->data + 160, 100);
607  creator[100] = '\0';
608  av_dict_set(&p->metadata, "Creator", creator, 0);
609 
610  av_strlcpy(input_device, avpkt->data + 1556, 32);
611  input_device[32] = '\0';
612  av_dict_set(&p->metadata, "Input Device", input_device, 0);
613 
614  // Some devices do not pad 10bit samples to whole 32bit words per row
615  if (!memcmp(input_device, "Scanity", 7) ||
616  !memcmp(creator, "Lasergraphics Inc.", 18)) {
617  if (avctx->bits_per_raw_sample == 10)
618  dpx->unpadded_10bit = 1;
619  }
620 
621  // Table 3c: Runs will always break at scan line boundaries. Packing
622  // will always break to the next 32-bit word at scan-line boundaries.
623  // Unfortunately, the encoder produced invalid files, so attempt
624  // to detect it
625  // Also handle special case with unpadded content
626  dpx->need_align = FFALIGN(dpx->stride, 4);
627  if (dpx->need_align*avctx->height + (int64_t)offset > avpkt->size &&
628  (!dpx->unpadded_10bit || (avctx->width * avctx->height * dpx->components + 2) / 3 * 4 + (int64_t)offset > avpkt->size)) {
629  // Alignment seems unappliable, try without
630  if (dpx->stride*avctx->height + (int64_t)offset > avpkt->size || dpx->unpadded_10bit) {
631  av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
632  return AVERROR_INVALIDDATA;
633  } else {
634  av_log(avctx, AV_LOG_INFO, "Decoding DPX without scanline "
635  "alignment.\n");
636  dpx->need_align = 0;
637  }
638  } else {
639  dpx->need_align -= dpx->stride;
640  dpx->stride = FFALIGN(dpx->stride, 4);
641  }
642 
643  switch (1000 * descriptor + 10 * avctx->bits_per_raw_sample + dpx->endian) {
644  case 1081:
645  case 1080:
646  case 2081:
647  case 2080:
648  case 3081:
649  case 3080:
650  case 4081:
651  case 4080:
652  case 6081:
653  case 6080:
655  break;
656  case 6121:
657  case 6120:
659  break;
660  case 1320:
661  case 2320:
662  case 3320:
663  case 4320:
664  case 6320:
666  break;
667  case 1321:
668  case 2321:
669  case 3321:
670  case 4321:
671  case 6321:
673  break;
674  case 50081:
675  case 50080:
677  break;
678  case 52081:
679  case 52080:
681  break;
682  case 51081:
683  case 51080:
685  break;
686  case 50100:
687  case 50101:
689  break;
690  case 51100:
691  case 51101:
693  break;
694  case 50120:
695  case 50121:
697  break;
698  case 51120:
699  case 51121:
701  break;
702  case 6100:
703  case 6101:
705  break;
706  case 6161:
708  break;
709  case 6160:
711  break;
712  case 50161:
714  break;
715  case 50160:
717  break;
718  case 51161:
720  break;
721  case 51160:
723  break;
724  case 50320:
726  break;
727  case 50321:
729  break;
730  case 51320:
732  break;
733  case 51321:
735  break;
736  case 100081:
738  break;
739  case 102081:
741  break;
742  case 103081:
744  break;
745  default:
746  av_log(avctx, AV_LOG_ERROR, "Unsupported format %d\n",
747  1000 * descriptor + 10 * avctx->bits_per_raw_sample + dpx->endian);
748  return AVERROR_PATCHWELCOME;
749  }
750 
751  if (pix_fmt != dpx->pix_fmt) {
752  dpx->pix_fmt = pix_fmt;
753 
754  ret = get_pixel_format(avctx, pix_fmt);
755  if (ret < 0)
756  return ret;
757 
758  avctx->pix_fmt = ret;
759  }
760 
761  ff_set_sar(avctx, avctx->sample_aspect_ratio);
762 
763  if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
764  return ret;
765 
766  // Move pointer to offset from start of file
767  buf = avpkt->data + offset;
768  dpx->frame = p;
769 
770  /* Start */
771  if (avctx->hwaccel) {
772  const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel);
773 
775  if (ret < 0)
776  return ret;
777 
778  ret = hwaccel->start_frame(avctx, avpkt->buf, buf, avpkt->size - offset);
779  if (ret < 0)
780  return ret;
781 
782  ret = hwaccel->decode_slice(avctx, buf, avpkt->size - offset);
783  if (ret < 0)
784  return ret;
785 
786  ret = hwaccel->end_frame(avctx);
787  if (ret < 0)
788  return ret;
789 
791  } else {
792  unpack_frame(avctx, p, buf, dpx->components, dpx->endian);
793  }
794 
795  p->pict_type = AV_PICTURE_TYPE_I;
796  p->flags |= AV_FRAME_FLAG_KEY;
797 
798  *got_frame = 1;
799 
800  return buf_size;
801 }
802 
803 #if HAVE_THREADS
805 {
806  DPXDecContext *ssrc = src->priv_data;
807  DPXDecContext *sdst = dst->priv_data;
808 
809  sdst->pix_fmt = ssrc->pix_fmt;
810 
811  return 0;
812 }
813 #endif
814 
816 {
817  DPXDecContext *dpx = avctx->priv_data;
819  return 0;
820 }
821 
823 {
824  DPXDecContext *dpx = avctx->priv_data;
825  dpx->pix_fmt = AV_PIX_FMT_NONE;
826  return 0;
827 }
828 
830  .p.name = "dpx",
831  CODEC_LONG_NAME("DPX (Digital Picture Exchange) image"),
832  .priv_data_size = sizeof(DPXDecContext),
833  .p.type = AVMEDIA_TYPE_VIDEO,
834  .p.id = AV_CODEC_ID_DPX,
836  .init = decode_init,
837  .close = decode_end,
839  .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
840  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
842  .hw_configs = (const AVCodecHWConfigInternal *const []) {
843 #if CONFIG_DPX_VULKAN_HWACCEL
844  HWACCEL_VULKAN(dpx),
845 #endif
846  NULL
847  },
848 };
DPX_COL_SPEC_ITU_R_624_4_PAL
@ DPX_COL_SPEC_ITU_R_624_4_PAL
Definition: dpx.h:55
hwconfig.h
AVCodecContext::hwaccel
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
Definition: avcodec.h:1405
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:216
AV_TIMECODE_STR_SIZE
#define AV_TIMECODE_STR_SIZE
Definition: timecode.h:33
DPX_COL_SPEC_ITU_R_601_525
@ DPX_COL_SPEC_ITU_R_601_525
Definition: dpx.h:53
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
AV_CODEC_ID_DPX
@ AV_CODEC_ID_DPX
Definition: codec_id.h:180
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
DPX_TRC_USER_DEFINED
@ DPX_TRC_USER_DEFINED
Definition: dpx.h:29
get_pixel_format
static enum AVPixelFormat get_pixel_format(AVCodecContext *avctx, enum AVPixelFormat pix_fmt)
Definition: dpx.c:265
AVCodecContext::colorspace
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:659
ff_get_format
int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Select the (possibly hardware accelerated) pixel format.
Definition: decode.c:1207
DPXDecContext::packing
int packing
Definition: dpx.h:65
elements
static const ElemCat * elements[ELEMENT_COUNT]
Definition: signature.h:565
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: dpx.c:279
DPX_TRC_SMPTE_170
@ DPX_TRC_SMPTE_170
Definition: dpx.h:38
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:675
DPXDecContext::hwaccel_picture_private
void * hwaccel_picture_private
Definition: dpx.h:62
int64_t
long long int64_t
Definition: coverity.c:34
dpx.h
AV_FRAME_DATA_S12M_TIMECODE
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
Definition: frame.h:152
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AV_PIX_FMT_RGBA64BE
@ AV_PIX_FMT_RGBA64BE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:202
AVCodecContext::color_trc
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:652
AV_PIX_FMT_GBRAPF32LE
@ AV_PIX_FMT_GBRAPF32LE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian.
Definition: pixfmt.h:344
read10in32_gray
static uint16_t read10in32_gray(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big, int shift)
Definition: dpx.c:61
w
uint8_t w
Definition: llviddspenc.c:38
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:777
AV_PIX_FMT_GBRPF32BE
@ AV_PIX_FMT_GBRPF32BE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian.
Definition: pixfmt.h:341
AVPacket::data
uint8_t * data
Definition: packet.h:588
FFCodec
Definition: codec_internal.h:127
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:226
AVCOL_SPC_RGB
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
Definition: pixfmt.h:701
intfloat.h
ff_set_dimensions
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
Definition: utils.c:91
DPX_COL_SPEC_SMPTE_170
@ DPX_COL_SPEC_SMPTE_170
Definition: dpx.h:54
AV_PIX_FMT_GRAYF32LE
@ AV_PIX_FMT_GRAYF32LE
IEEE-754 single precision Y, 32bpp, little-endian.
Definition: pixfmt.h:364
thread.h
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
av_image_copy_plane
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
Definition: imgutils.c:374
AVCodecContext::framerate
AVRational framerate
Definition: avcodec.h:551
AV_PIX_FMT_GRAY16BE
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
Definition: pixfmt.h:104
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:706
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
FFHWAccel
Definition: hwaccel_internal.h:34
av_int2float
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
Definition: intfloat.h:40
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:558
timecode.h
DPXDecContext::stride
int stride
Definition: dpx.h:66
AVCOL_TRC_GAMMA28
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition: pixfmt.h:672
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
DPX_COL_SPEC_ITU_R_709_4
@ DPX_COL_SPEC_ITU_R_709_4
Definition: dpx.h:51
AVCodecContext::color_primaries
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:645
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
av_cold
#define av_cold
Definition: attributes.h:106
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: dpx.c:822
AV_FRAME_FLAG_KEY
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition: frame.h:642
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:562
DPX_COL_SPEC_SMPTE_274
@ DPX_COL_SPEC_SMPTE_274
Definition: dpx.h:50
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:347
ff_hwaccel_frame_priv_alloc
int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private)
Allocate a hwaccel frame private data if the provided avctx uses a hwaccel method that needs it.
Definition: decode.c:2278
intreadwrite.h
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:563
DPX_TRC_ITU_R_709_4
@ DPX_TRC_ITU_R_709_4
Definition: dpx.h:35
DPX_COL_SPEC_ITU_R_601_625
@ DPX_COL_SPEC_ITU_R_601_625
Definition: dpx.h:52
AVCOL_SPC_SMPTE170M
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
Definition: pixfmt.h:707
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
DPX_TRC_ITU_R_624_4_PAL
@ DPX_TRC_ITU_R_624_4_PAL
Definition: dpx.h:39
AVCodecContext::bits_per_raw_sample
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:1553
decode.h
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
DPX_TRC_ITU_R_601_625
@ DPX_TRC_ITU_R_601_625
Definition: dpx.h:36
DPXDecContext::components
int components
Definition: dpx.h:68
DPXDecContext::endian
int endian
Definition: dpx.h:67
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:332
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:100
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:643
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:644
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:519
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:95
AVPacket::buf
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
Definition: packet.h:571
AV_PIX_FMT_GBRAPF32BE
@ AV_PIX_FMT_GBRAPF32BE
IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian.
Definition: pixfmt.h:343
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
AVCodecContext::color_range
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: avcodec.h:669
hwaccel_internal.h
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AV_PIX_FMT_RGB48LE
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:110
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:638
AV_PIX_FMT_RGBA64LE
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
Definition: pixfmt.h:203
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:278
AV_RN32
#define AV_RN32(p)
Definition: intreadwrite.h:360
ff_set_sar
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
Definition: utils.c:106
ff_dpx_decoder
const FFCodec ff_dpx_decoder
Definition: dpx.c:829
UPDATE_THREAD_CONTEXT
#define UPDATE_THREAD_CONTEXT(func)
Definition: codec_internal.h:341
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:101
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
read12in32
static uint16_t read12in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big)
Definition: dpx.c:94
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1728
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVPacket::size
int size
Definition: packet.h:589
codec_internal.h
AV_WN32
#define AV_WN32(p, v)
Definition: intreadwrite.h:372
shift
static int shift(int a, int b)
Definition: bonk.c:261
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
av_bswap32
#define av_bswap32
Definition: bswap.h:47
AV_NUM_DATA_POINTERS
#define AV_NUM_DATA_POINTERS
Definition: frame.h:428
ff_frame_new_side_data
int ff_frame_new_side_data(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, size_t size, AVFrameSideData **psd)
Wrapper around av_frame_new_side_data, which rejects side data overridden by the demuxer.
Definition: decode.c:2126
AV_RB32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
Definition: bytestream.h:96
FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
Definition: codec_internal.h:54
avpriv_report_missing_feature
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
AVFrameSideData::data
uint8_t * data
Definition: frame.h:284
DPX_COL_SPEC_UNSPECIFIED_VIDEO
@ DPX_COL_SPEC_UNSPECIFIED_VIDEO
Definition: dpx.h:49
AVCodecHWConfigInternal
Definition: hwconfig.h:25
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:174
offset
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 offset
Definition: writing_filters.txt:86
version
version
Definition: libkvazaar.c:313
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:221
AVCOL_TRC_BT709
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition: pixfmt.h:668
av_refstruct_unref
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
Definition: refstruct.c:120
DPXDecContext::need_align
int need_align
Definition: dpx.h:70
read16
static unsigned int read16(const uint8_t **ptr, int is_big)
Definition: dpx.c:37
AV_PIX_FMT_RGB48BE
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
Definition: pixfmt.h:109
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
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
read10in32
static uint16_t read10in32(const uint8_t **ptr, uint32_t *lbuf, int *n_datum, int is_big, int shift)
Definition: dpx.c:79
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:559
decode_end
static av_cold int decode_end(AVCodecContext *avctx)
Definition: dpx.c:815
av_d2q
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
Definition: rational.c:106
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:179
AVCodecContext::height
int height
Definition: avcodec.h:592
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:631
AV_PIX_FMT_GBRPF32LE
@ AV_PIX_FMT_GBRPF32LE
IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian.
Definition: pixfmt.h:342
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:760
avcodec.h
ret
ret
Definition: filter_design.txt:187
AV_PIX_FMT_GRAYF32BE
@ AV_PIX_FMT_GRAYF32BE
IEEE-754 single precision Y, 32bpp, big-endian.
Definition: pixfmt.h:363
hwaccel
static const char * hwaccel
Definition: ffplay.c:353
AV_PIX_FMT_UYVY422
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:88
DPX_TRC_UNSPECIFIED_VIDEO
@ DPX_TRC_UNSPECIFIED_VIDEO
Definition: dpx.h:33
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
U
#define U(x)
Definition: vpx_arith.h:37
HWACCEL_VULKAN
#define HWACCEL_VULKAN(codec)
Definition: hwconfig.h:76
DPXDecContext::pix_fmt
enum AVPixelFormat pix_fmt
Definition: dpx.h:63
AVCodecContext
main external API structure.
Definition: avcodec.h:431
DPXDecContext::unpadded_10bit
int unpadded_10bit
Definition: dpx.h:69
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
DPX_TRC_ITU_R_601_525
@ DPX_TRC_ITU_R_601_525
Definition: dpx.h:37
ffhwaccel
static const FFHWAccel * ffhwaccel(const AVHWAccel *codec)
Definition: hwaccel_internal.h:168
update_thread_context
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have update_thread_context() run it in the next thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. Use ff_thread_get_buffer()(or ff_progress_frame_get_buffer() in case you have inter-frame dependencies and use the ProgressFrame API) to allocate frame buffers. Call ff_progress_frame_report() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
temp
else temp
Definition: vf_mcdeint.c:271
AVCOL_TRC_SMPTE170M
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition: pixfmt.h:673
Windows::Graphics::DirectX::Direct3D11::p
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
Definition: vsrc_gfxcapture_winrt.hpp:53
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:78
DPX_COL_SPEC_USER_DEFINED
@ DPX_COL_SPEC_USER_DEFINED
Definition: dpx.h:45
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
AV_PIX_FMT_GRAY16LE
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition: pixfmt.h:105
AVFrameSideData
Structure to hold side data for an AVFrame.
Definition: frame.h:282
DPXDecContext
Definition: dpx.h:60
DPX_TRC_LINEAR
@ DPX_TRC_LINEAR
Definition: dpx.h:31
unpack_frame
static void unpack_frame(AVCodecContext *avctx, AVFrame *p, const uint8_t *buf, int elements, int endian)
Definition: dpx.c:126
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
AVPacket
This structure stores compressed data.
Definition: packet.h:565
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:458
DPXDecContext::frame
AVFrame * frame
Definition: dpx.h:61
av_dict_set
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:86
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:592
imgutils.h
av_strlcpy
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
Definition: avstring.c:85
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
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
h
h
Definition: vp9dsp_template.c:2070
read32
static unsigned int read32(const uint8_t **ptr, int is_big)
Definition: dpx.c:49
avstring.h
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:520
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:702
DPX_TRC_SMPTE_274
@ DPX_TRC_SMPTE_274
Definition: dpx.h:34
AVCodecContext::sample_aspect_ratio
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
Definition: avcodec.h:616
src
#define src
Definition: vp8dsp.c:248
AV_RB16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:98
av_fourcc2str
#define av_fourcc2str(fourcc)
Definition: avutil.h:347