FFmpeg
dpxenc.c
Go to the documentation of this file.
1 /*
2  * DPX (.dpx) image encoder
3  * Copyright (c) 2011 Peter Ross <pross@xvid.org>
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/common.h"
23 #include "libavutil/intreadwrite.h"
24 #include "libavutil/imgutils.h"
25 #include "avcodec.h"
26 #include "codec_internal.h"
27 #include "encode.h"
28 #include "version.h"
29 #include "dpx.h"
30 
31 typedef struct DPXContext {
36  int planar;
37 } DPXContext;
38 
40 {
41  DPXContext *s = avctx->priv_data;
43 
44  s->big_endian = !!(desc->flags & AV_PIX_FMT_FLAG_BE);
45  s->bits_per_component = desc->comp[0].depth;
46  s->num_components = desc->nb_components;
47  s->descriptor = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? 51 : 50;
48  s->planar = !!(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
49 
50  switch (avctx->pix_fmt) {
51  case AV_PIX_FMT_ABGR:
52  s->descriptor = 52;
53  break;
56  case AV_PIX_FMT_GRAY8:
57  s->descriptor = 6;
58  break;
63  case AV_PIX_FMT_RGB24:
66  case AV_PIX_FMT_RGBA:
67  break;
68  case AV_PIX_FMT_RGB48LE:
69  case AV_PIX_FMT_RGB48BE:
70  if (avctx->bits_per_raw_sample)
71  s->bits_per_component = avctx->bits_per_raw_sample;
72  break;
73  }
74 
75  return 0;
76 }
77 
78 static av_always_inline void write16_internal(int big_endian, void *p, int value)
79 {
80  if (big_endian) AV_WB16(p, value);
81  else AV_WL16(p, value);
82 }
83 
84 static av_always_inline void write32_internal(int big_endian, void *p, int value)
85 {
86  if (big_endian) AV_WB32(p, value);
87  else AV_WL32(p, value);
88 }
89 
90 #define write16(p, value) write16_internal(s->big_endian, p, value)
91 #define write32(p, value) write32_internal(s->big_endian, p, value)
92 
93 static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic,
94  uint8_t *dst)
95 {
96  DPXContext *s = avctx->priv_data;
97  const uint8_t *src = pic->data[0];
98  int x, y;
99 
100  for (y = 0; y < avctx->height; y++) {
101  for (x = 0; x < avctx->width; x++) {
102  int value;
103  if (s->big_endian) {
104  value = ((AV_RB16(src + 6*x + 4) & 0xFFC0U) >> 4)
105  | ((AV_RB16(src + 6*x + 2) & 0xFFC0U) << 6)
106  | ((AV_RB16(src + 6*x + 0) & 0xFFC0U) << 16);
107  } else {
108  value = ((AV_RL16(src + 6*x + 4) & 0xFFC0U) >> 4)
109  | ((AV_RL16(src + 6*x + 2) & 0xFFC0U) << 6)
110  | ((AV_RL16(src + 6*x + 0) & 0xFFC0U) << 16);
111  }
112  write32(dst, value);
113  dst += 4;
114  }
115  src += pic->linesize[0];
116  }
117 }
118 
119 static void encode_gbrp10(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
120 {
121  DPXContext *s = avctx->priv_data;
122  const uint8_t *src[3] = {pic->data[0], pic->data[1], pic->data[2]};
123  int x, y, i;
124 
125  for (y = 0; y < avctx->height; y++) {
126  for (x = 0; x < avctx->width; x++) {
127  int value;
128  if (s->big_endian) {
129  value = (AV_RB16(src[0] + 2*x) << 12)
130  | (AV_RB16(src[1] + 2*x) << 2)
131  | ((unsigned)AV_RB16(src[2] + 2*x) << 22);
132  } else {
133  value = (AV_RL16(src[0] + 2*x) << 12)
134  | (AV_RL16(src[1] + 2*x) << 2)
135  | ((unsigned)AV_RL16(src[2] + 2*x) << 22);
136  }
137  write32(dst, value);
138  dst += 4;
139  }
140  for (i = 0; i < 3; i++)
141  src[i] += pic->linesize[i];
142  }
143 }
144 
145 static void encode_gbrp12(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
146 {
147  DPXContext *s = avctx->priv_data;
148  const uint16_t *src[3] = {(uint16_t*)pic->data[0],
149  (uint16_t*)pic->data[1],
150  (uint16_t*)pic->data[2]};
151  int x, y, i, pad;
152  pad = avctx->width*6;
153  pad = (FFALIGN(pad, 4) - pad) >> 1;
154  for (y = 0; y < avctx->height; y++) {
155  for (x = 0; x < avctx->width; x++) {
156  uint16_t value[3];
157  if (s->big_endian) {
158  value[1] = AV_RB16(src[0] + x) << 4;
159  value[2] = AV_RB16(src[1] + x) << 4;
160  value[0] = AV_RB16(src[2] + x) << 4;
161  } else {
162  value[1] = AV_RL16(src[0] + x) << 4;
163  value[2] = AV_RL16(src[1] + x) << 4;
164  value[0] = AV_RL16(src[2] + x) << 4;
165  }
166  for (i = 0; i < 3; i++, dst += 2)
167  write16(dst, value[i]);
168  }
169  for (i = 0; i < pad; i++, dst += 2)
170  AV_WN16(dst, 0);
171  for (i = 0; i < 3; i++)
172  src[i] += pic->linesize[i]/2;
173  }
174 }
175 
177  const AVFrame *frame, int *got_packet)
178 {
179  DPXContext *s = avctx->priv_data;
180  int size, ret, need_align, len;
181  uint8_t *buf;
182  int color_trc, color_spec;
183 
184 #define HEADER_SIZE 1664 /* DPX Generic header */
185  if (s->bits_per_component == 10)
186  size = avctx->height * avctx->width * 4;
187  else if (s->bits_per_component == 12) {
188  // 3 components, 12 bits put on 16 bits
189  len = avctx->width*6;
190  size = FFALIGN(len, 4);
191  need_align = size - len;
192  size *= avctx->height;
193  } else {
194  // N components, M bits
195  len = avctx->width * s->num_components * s->bits_per_component >> 3;
196  size = FFALIGN(len, 4);
197  need_align = size - len;
198  size *= avctx->height;
199  }
200  if ((ret = ff_get_encode_buffer(avctx, pkt, size + HEADER_SIZE, 0)) < 0)
201  return ret;
202  buf = pkt->data;
203 
204  memset(buf, 0, HEADER_SIZE);
205 
206  /* File information header */
207  write32(buf, MKBETAG('S','D','P','X'));
208  write32(buf + 4, HEADER_SIZE);
209  memcpy (buf + 8, "V1.0", 4);
210  write32(buf + 20, 1); /* new image */
211  write32(buf + 24, HEADER_SIZE);
212  if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT))
213  memcpy (buf + 160, LIBAVCODEC_IDENT, FFMIN(sizeof(LIBAVCODEC_IDENT), 100));
214  write32(buf + 660, 0xFFFFFFFF); /* unencrypted */
215 
216  /* Image information header */
217  write16(buf + 768, 0); /* orientation; left to right, top to bottom */
218  write16(buf + 770, 1); /* number of elements */
219  write32(buf + 772, avctx->width);
220  write32(buf + 776, avctx->height);
221  buf[800] = s->descriptor;
222 
223  switch (avctx->color_trc) {
224  case AVCOL_TRC_BT709:
225  color_trc = DPX_TRC_ITU_R_709_4;
226  break;
227  default:
228  av_log(avctx, AV_LOG_WARNING, "unsupported color transfer\n");
230  color_trc = DPX_TRC_UNSPECIFIED_VIDEO;
231  break;
232  case AVCOL_TRC_GAMMA28:
233  color_trc = DPX_TRC_ITU_R_624_4_PAL;
234  break;
235  case AVCOL_TRC_SMPTE170M:
236  color_trc = DPX_TRC_SMPTE_170;
237  break;
238  case AVCOL_TRC_LINEAR:
239  color_trc = DPX_TRC_LINEAR;
240  break;
241  }
242  buf[801] = color_trc;
243 
244  switch (avctx->color_primaries) {
245  case AVCOL_PRI_BT709:
246  color_spec = DPX_COL_SPEC_ITU_R_709_4;
247  break;
248  default:
249  av_log(avctx, AV_LOG_WARNING, "unsupported colorimetric specification\n");
251  color_spec = DPX_COL_SPEC_UNSPECIFIED_VIDEO;
252  break;
253  case AVCOL_PRI_BT470BG:
254  color_spec = DPX_COL_SPEC_ITU_R_624_4_PAL;
255  break;
256  case AVCOL_PRI_SMPTE170M:
257  color_spec = DPX_COL_SPEC_SMPTE_170;
258  break;
259  }
260  buf[802] = color_spec;
261 
262  buf[803] = s->bits_per_component;
263  write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
264  1 : 0); /* packing method */
265  write32(buf + 808, HEADER_SIZE); /* data offset */
266 
267  /* Image source information header */
268  write32(buf + 1628, avctx->sample_aspect_ratio.num);
269  write32(buf + 1632, avctx->sample_aspect_ratio.den);
270 
271  switch(s->bits_per_component) {
272  case 8:
273  case 16:
274  if (need_align) {
275  int j;
276  const uint8_t *src = frame->data[0];
277  uint8_t *dst = pkt->data + HEADER_SIZE;
278  size = (len + need_align) * avctx->height;
279  for (j=0; j<avctx->height; j++) {
280  memcpy(dst, src, len);
281  memset(dst + len, 0, need_align);
282  dst += len + need_align;
283  src += frame->linesize[0];
284  }
285  } else {
287  (const uint8_t**)frame->data, frame->linesize,
288  avctx->pix_fmt,
289  avctx->width, avctx->height, 1);
290  }
291  if (size < 0)
292  return size;
293  break;
294  case 10:
295  if (s->planar)
296  encode_gbrp10(avctx, frame, buf + HEADER_SIZE);
297  else
298  encode_rgb48_10bit(avctx, frame, buf + HEADER_SIZE);
299  break;
300  case 12:
301  encode_gbrp12(avctx, frame, buf + HEADER_SIZE);
302  break;
303  default:
304  av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component);
305  return -1;
306  }
307 
308  size += HEADER_SIZE;
309 
310  write32(buf + 16, size); /* file size */
311 
312  *got_packet = 1;
313 
314  return 0;
315 }
316 
318  .p.name = "dpx",
319  CODEC_LONG_NAME("DPX (Digital Picture Exchange) image"),
320  .p.type = AVMEDIA_TYPE_VIDEO,
321  .p.id = AV_CODEC_ID_DPX,
322  .p.capabilities = AV_CODEC_CAP_DR1,
323  .priv_data_size = sizeof(DPXContext),
324  .init = encode_init,
333 };
DPX_COL_SPEC_ITU_R_624_4_PAL
@ DPX_COL_SPEC_ITU_R_624_4_PAL
Definition: dpx.h:52
CODEC_PIXFMTS
#define CODEC_PIXFMTS(...)
Definition: codec_internal.h:386
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:216
AV_CODEC_ID_DPX
@ AV_CODEC_ID_DPX
Definition: codec_id.h:180
LIBAVCODEC_IDENT
#define LIBAVCODEC_IDENT
Definition: version.h:43
AV_WL32
#define AV_WL32(p, v)
Definition: intreadwrite.h:422
AV_PIX_FMT_GBRP10BE
@ AV_PIX_FMT_GBRP10BE
planar GBR 4:4:4 30bpp, big-endian
Definition: pixfmt.h:169
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3441
DPX_TRC_SMPTE_170
@ DPX_TRC_SMPTE_170
Definition: dpx.h:35
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:670
write16
#define write16(p, value)
Definition: dpxenc.c:90
dpx.h
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
AVPacket::data
uint8_t * data
Definition: packet.h:552
DPXContext::descriptor
int descriptor
Definition: dpxenc.c:35
encode.h
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:664
FFCodec
Definition: codec_internal.h:127
version.h
DPX_COL_SPEC_SMPTE_170
@ DPX_COL_SPEC_SMPTE_170
Definition: dpx.h:51
write16_internal
static av_always_inline void write16_internal(int big_endian, void *p, int value)
Definition: dpxenc.c:78
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:448
DPXContext::bits_per_component
int bits_per_component
Definition: dpxenc.c:33
encode_frame
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: dpxenc.c:176
AV_PIX_FMT_GRAY16BE
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
Definition: pixfmt.h:104
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
ff_dpx_encoder
const FFCodec ff_dpx_encoder
Definition: dpxenc.c:317
AVCOL_TRC_GAMMA28
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition: pixfmt.h:667
AVCodecContext::flags
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:488
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:353
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:48
AVCodecContext::color_primaries
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:645
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
av_cold
#define av_cold
Definition: attributes.h:90
write32_internal
static av_always_inline void write32_internal(int big_endian, void *p, int value)
Definition: dpxenc.c:84
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
DPX_TRC_ITU_R_709_4
@ DPX_TRC_ITU_R_709_4
Definition: dpx.h:32
AV_PIX_FMT_GBRP12LE
@ AV_PIX_FMT_GBRP12LE
planar GBR 4:4:4 36bpp, little-endian
Definition: pixfmt.h:280
DPX_TRC_ITU_R_624_4_PAL
@ DPX_TRC_ITU_R_624_4_PAL
Definition: dpx.h:36
AVCodecContext::bits_per_raw_sample
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:1553
AV_PIX_FMT_FLAG_ALPHA
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
Definition: pixdesc.h:147
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
write32
#define write32(p, value)
Definition: dpxenc.c:91
AV_PIX_FMT_GBRP10LE
@ AV_PIX_FMT_GBRP10LE
planar GBR 4:4:4 30bpp, little-endian
Definition: pixfmt.h:170
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:639
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:326
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_WB16
#define AV_WB16(p, v)
Definition: intreadwrite.h:401
DPXContext::planar
int planar
Definition: dpxenc.c:36
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_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
DPXContext::num_components
int num_components
Definition: dpxenc.c:34
AV_WB32
#define AV_WB32(p, v)
Definition: intreadwrite.h:415
DPXContext
Definition: dpxenc.c:31
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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:553
codec_internal.h
encode_gbrp12
static void encode_gbrp12(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
Definition: dpxenc.c:145
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:424
size
int size
Definition: twinvq_data.h:10344
MKBETAG
#define MKBETAG(a, b, c, d)
Definition: macros.h:56
DPX_COL_SPEC_UNSPECIFIED_VIDEO
@ DPX_COL_SPEC_UNSPECIFIED_VIDEO
Definition: dpx.h:46
AV_WL16
#define AV_WL16(p, v)
Definition: intreadwrite.h:408
HEADER_SIZE
#define HEADER_SIZE
AVCOL_TRC_BT709
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition: pixfmt.h:663
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
common.h
av_always_inline
#define av_always_inline
Definition: attributes.h:49
value
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 value
Definition: writing_filters.txt:86
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AV_PIX_FMT_FLAG_BE
#define AV_PIX_FMT_FLAG_BE
Pixel format is big-endian.
Definition: pixdesc.h:116
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:179
len
int len
Definition: vorbis_enc_data.h:426
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
avcodec.h
ret
ret
Definition: filter_design.txt:187
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
AV_PIX_FMT_GBRP12BE
@ AV_PIX_FMT_GBRP12BE
planar GBR 4:4:4 36bpp, big-endian
Definition: pixfmt.h:279
DPX_TRC_UNSPECIFIED_VIDEO
@ DPX_TRC_UNSPECIFIED_VIDEO
Definition: dpx.h:30
U
#define U(x)
Definition: vpx_arith.h:37
AVCodecContext
main external API structure.
Definition: avcodec.h:431
encode_gbrp10
static void encode_gbrp10(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
Definition: dpxenc.c:119
encode_rgb48_10bit
static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
Definition: dpxenc.c:93
ff_get_encode_buffer
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
Definition: encode.c:106
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_FLAG_PLANAR
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition: pixdesc.h:132
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:668
encode_init
static av_cold int encode_init(AVCodecContext *avctx)
Definition: dpxenc.c:39
desc
const char * desc
Definition: libsvtav1.c:79
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
AV_CODEC_FLAG_BITEXACT
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
Definition: avcodec.h:322
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
DPX_TRC_LINEAR
@ DPX_TRC_LINEAR
Definition: dpx.h:28
av_image_copy_to_buffer
int av_image_copy_to_buffer(uint8_t *dst, int dst_size, const uint8_t *const src_data[4], const int src_linesize[4], enum AVPixelFormat pix_fmt, int width, int height, int align)
Copy image data from an image into a buffer.
Definition: imgutils.c:501
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
AVPacket
This structure stores compressed data.
Definition: packet.h:529
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:458
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:592
imgutils.h
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:472
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
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
DPXContext::big_endian
int big_endian
Definition: dpxenc.c:32
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_WN16
#define AV_WN16(p, v)
Definition: intreadwrite.h:368