Libav
libschroedingerenc.c
Go to the documentation of this file.
1 /*
2  * Dirac encoder support via Schroedinger libraries
3  * Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
4  *
5  * This file is part of Libav.
6  *
7  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
30 #include <schroedinger/schro.h>
31 #include <schroedinger/schrodebug.h>
32 #include <schroedinger/schrovideoformat.h>
33 
34 #include "libavutil/attributes.h"
35 #include "avcodec.h"
36 #include "internal.h"
37 #include "libschroedinger.h"
38 #include "bytestream.h"
39 
40 
42 typedef struct SchroEncoderParams {
44  SchroVideoFormat *format;
45 
47  SchroFrameFormat frame_format;
48 
51 
53  SchroEncoder* encoder;
54 
56  unsigned char *enc_buf;
57 
60 
63 
66 
69 
70  /* counter for frames submitted to encoder, used as dts */
71  int64_t dts;
73 
78 {
79  int num_formats = sizeof(schro_pixel_format_map) /
80  sizeof(schro_pixel_format_map[0]);
81  int idx;
82 
83  SchroEncoderParams *p_schro_params = avctx->priv_data;
84 
85  for (idx = 0; idx < num_formats; ++idx) {
86  if (schro_pixel_format_map[idx].ff_pix_fmt == avctx->pix_fmt) {
87  p_schro_params->format->chroma_format =
88  schro_pixel_format_map[idx].schro_pix_fmt;
89  return 0;
90  }
91  }
92 
93  av_log(avctx, AV_LOG_ERROR,
94  "This codec currently only supports planar YUV 4:2:0, 4:2:2"
95  " and 4:4:4 formats.\n");
96 
97  return -1;
98 }
99 
101 {
102  SchroEncoderParams *p_schro_params = avctx->priv_data;
103  SchroVideoFormatEnum preset;
104 
105  /* Initialize the libraries that libschroedinger depends on. */
106  schro_init();
107 
108  /* Create an encoder object. */
109  p_schro_params->encoder = schro_encoder_new();
110 
111  if (!p_schro_params->encoder) {
112  av_log(avctx, AV_LOG_ERROR,
113  "Unrecoverable Error: schro_encoder_new failed. ");
114  return -1;
115  }
116 
117  /* Initialize the format. */
118  preset = ff_get_schro_video_format_preset(avctx);
119  p_schro_params->format =
120  schro_encoder_get_video_format(p_schro_params->encoder);
121  schro_video_format_set_std_video_format(p_schro_params->format, preset);
122  p_schro_params->format->width = avctx->width;
123  p_schro_params->format->height = avctx->height;
124 
125  if (set_chroma_format(avctx) == -1)
126  return -1;
127 
128  if (avctx->color_primaries == AVCOL_PRI_BT709) {
129  p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_HDTV;
130  } else if (avctx->color_primaries == AVCOL_PRI_BT470BG) {
131  p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_625;
132  } else if (avctx->color_primaries == AVCOL_PRI_SMPTE170M) {
133  p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_525;
134  }
135 
136  if (avctx->colorspace == AVCOL_SPC_BT709) {
137  p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_HDTV;
138  } else if (avctx->colorspace == AVCOL_SPC_BT470BG) {
139  p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_SDTV;
140  }
141 
142  if (avctx->color_trc == AVCOL_TRC_BT709) {
143  p_schro_params->format->transfer_function = SCHRO_TRANSFER_CHAR_TV_GAMMA;
144  }
145 
146  if (ff_get_schro_frame_format(p_schro_params->format->chroma_format,
147  &p_schro_params->frame_format) == -1) {
148  av_log(avctx, AV_LOG_ERROR,
149  "This codec currently supports only planar YUV 4:2:0, 4:2:2"
150  " and 4:4:4 formats.\n");
151  return -1;
152  }
153 
154  p_schro_params->format->frame_rate_numerator = avctx->time_base.den;
155  p_schro_params->format->frame_rate_denominator = avctx->time_base.num;
156 
157  p_schro_params->frame_size = avpicture_get_size(avctx->pix_fmt,
158  avctx->width,
159  avctx->height);
160 
161  avctx->coded_frame = av_frame_alloc();
162  if (!avctx->coded_frame)
163  return AVERROR(ENOMEM);
164 
165  if (!avctx->gop_size) {
166  schro_encoder_setting_set_double(p_schro_params->encoder,
167  "gop_structure",
168  SCHRO_ENCODER_GOP_INTRA_ONLY);
169 
170  if (avctx->coder_type == FF_CODER_TYPE_VLC)
171  schro_encoder_setting_set_double(p_schro_params->encoder,
172  "enable_noarith", 1);
173  } else {
174  schro_encoder_setting_set_double(p_schro_params->encoder,
175  "au_distance", avctx->gop_size);
176  avctx->has_b_frames = 1;
177  p_schro_params->dts = -1;
178  }
179 
180  /* FIXME - Need to handle SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY. */
181  if (avctx->flags & CODEC_FLAG_QSCALE) {
182  if (!avctx->global_quality) {
183  /* lossless coding */
184  schro_encoder_setting_set_double(p_schro_params->encoder,
185  "rate_control",
186  SCHRO_ENCODER_RATE_CONTROL_LOSSLESS);
187  } else {
188  int quality;
189  schro_encoder_setting_set_double(p_schro_params->encoder,
190  "rate_control",
191  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY);
192 
193  quality = avctx->global_quality / FF_QP2LAMBDA;
194  if (quality > 10)
195  quality = 10;
196  schro_encoder_setting_set_double(p_schro_params->encoder,
197  "quality", quality);
198  }
199  } else {
200  schro_encoder_setting_set_double(p_schro_params->encoder,
201  "rate_control",
202  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE);
203 
204  schro_encoder_setting_set_double(p_schro_params->encoder,
205  "bitrate", avctx->bit_rate);
206  }
207 
208  if (avctx->flags & CODEC_FLAG_INTERLACED_ME)
209  /* All material can be coded as interlaced or progressive
210  irrespective of the type of source material. */
211  schro_encoder_setting_set_double(p_schro_params->encoder,
212  "interlaced_coding", 1);
213 
214  schro_encoder_setting_set_double(p_schro_params->encoder, "open_gop",
215  !(avctx->flags & CODEC_FLAG_CLOSED_GOP));
216 
217  /* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
218  * and libdirac support other bit-depth data. */
219  schro_video_format_set_std_signal_range(p_schro_params->format,
220  SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
221 
222  /* Set the encoder format. */
223  schro_encoder_set_video_format(p_schro_params->encoder,
224  p_schro_params->format);
225 
226  /* Set the debug level. */
227  schro_debug_set_level(avctx->debug);
228 
229  schro_encoder_start(p_schro_params->encoder);
230 
231  /* Initialize the encoded frame queue. */
232  ff_schro_queue_init(&p_schro_params->enc_frame_queue);
233  return 0;
234 }
235 
237  const AVFrame *frame)
238 {
239  SchroEncoderParams *p_schro_params = avctx->priv_data;
240  SchroFrame *in_frame;
241  /* Input line size may differ from what the codec supports. Especially
242  * when transcoding from one format to another. So use avpicture_layout
243  * to copy the frame. */
244  in_frame = ff_create_schro_frame(avctx, p_schro_params->frame_format);
245 
246  if (in_frame)
247  avpicture_layout((const AVPicture *)frame, avctx->pix_fmt,
248  avctx->width, avctx->height,
249  in_frame->components[0].data,
250  p_schro_params->frame_size);
251 
252  return in_frame;
253 }
254 
256 {
257  FFSchroEncodedFrame *enc_frame = data;
258 
259  av_freep(&enc_frame->p_encbuf);
260  av_free(enc_frame);
261 }
262 
264  const AVFrame *frame, int *got_packet)
265 {
266  int enc_size = 0;
267  SchroEncoderParams *p_schro_params = avctx->priv_data;
268  SchroEncoder *encoder = p_schro_params->encoder;
269  struct FFSchroEncodedFrame *p_frame_output = NULL;
270  int go = 1;
271  SchroBuffer *enc_buf;
272  int presentation_frame;
273  int parse_code;
274  int last_frame_in_sequence = 0;
275  int pkt_size, ret;
276 
277  if (!frame) {
278  /* Push end of sequence if not already signalled. */
279  if (!p_schro_params->eos_signalled) {
280  schro_encoder_end_of_stream(encoder);
281  p_schro_params->eos_signalled = 1;
282  }
283  } else {
284  /* Allocate frame data to schro input buffer. */
285  SchroFrame *in_frame = libschroedinger_frame_from_data(avctx, frame);
286  /* Load next frame. */
287  schro_encoder_push_frame(encoder, in_frame);
288  }
289 
290  if (p_schro_params->eos_pulled)
291  go = 0;
292 
293  /* Now check to see if we have any output from the encoder. */
294  while (go) {
295  int err;
296  SchroStateEnum state;
297  state = schro_encoder_wait(encoder);
298  switch (state) {
299  case SCHRO_STATE_HAVE_BUFFER:
300  case SCHRO_STATE_END_OF_STREAM:
301  enc_buf = schro_encoder_pull(encoder, &presentation_frame);
302  if (enc_buf->length <= 0)
303  return AVERROR_BUG;
304  parse_code = enc_buf->data[4];
305 
306  /* All non-frame data is prepended to actual frame data to
307  * be able to set the pts correctly. So we don't write data
308  * to the frame output queue until we actually have a frame
309  */
310  if ((err = av_reallocp(&p_schro_params->enc_buf,
311  p_schro_params->enc_buf_size +
312  enc_buf->length)) < 0) {
313  p_schro_params->enc_buf_size = 0;
314  return err;
315  }
316 
317  memcpy(p_schro_params->enc_buf + p_schro_params->enc_buf_size,
318  enc_buf->data, enc_buf->length);
319  p_schro_params->enc_buf_size += enc_buf->length;
320 
321 
322  if (state == SCHRO_STATE_END_OF_STREAM) {
323  p_schro_params->eos_pulled = 1;
324  go = 0;
325  }
326 
327  if (!SCHRO_PARSE_CODE_IS_PICTURE(parse_code)) {
328  schro_buffer_unref(enc_buf);
329  break;
330  }
331 
332  /* Create output frame. */
333  p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
334  /* Set output data. */
335  p_frame_output->size = p_schro_params->enc_buf_size;
336  p_frame_output->p_encbuf = p_schro_params->enc_buf;
337  if (SCHRO_PARSE_CODE_IS_INTRA(parse_code) &&
338  SCHRO_PARSE_CODE_IS_REFERENCE(parse_code))
339  p_frame_output->key_frame = 1;
340 
341  /* Parse the coded frame number from the bitstream. Bytes 14
342  * through 17 represesent the frame number. */
343  p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
344 
345  ff_schro_queue_push_back(&p_schro_params->enc_frame_queue,
346  p_frame_output);
347  p_schro_params->enc_buf_size = 0;
348  p_schro_params->enc_buf = NULL;
349 
350  schro_buffer_unref(enc_buf);
351 
352  break;
353 
354  case SCHRO_STATE_NEED_FRAME:
355  go = 0;
356  break;
357 
358  case SCHRO_STATE_AGAIN:
359  break;
360 
361  default:
362  av_log(avctx, AV_LOG_ERROR, "Unknown Schro Encoder state\n");
363  return -1;
364  }
365  }
366 
367  /* Copy 'next' frame in queue. */
368 
369  if (p_schro_params->enc_frame_queue.size == 1 &&
370  p_schro_params->eos_pulled)
371  last_frame_in_sequence = 1;
372 
373  p_frame_output = ff_schro_queue_pop(&p_schro_params->enc_frame_queue);
374 
375  if (!p_frame_output)
376  return 0;
377 
378  pkt_size = p_frame_output->size;
379  if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0)
380  pkt_size += p_schro_params->enc_buf_size;
381  if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
382  av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", pkt_size);
383  goto error;
384  }
385 
386  memcpy(pkt->data, p_frame_output->p_encbuf, p_frame_output->size);
387  avctx->coded_frame->key_frame = p_frame_output->key_frame;
388  /* Use the frame number of the encoded frame as the pts. It is OK to
389  * do so since Dirac is a constant frame rate codec. It expects input
390  * to be of constant frame rate. */
391  pkt->pts =
392  avctx->coded_frame->pts = p_frame_output->frame_num;
393  pkt->dts = p_schro_params->dts++;
394  enc_size = p_frame_output->size;
395 
396  /* Append the end of sequence information to the last frame in the
397  * sequence. */
398  if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0) {
399  memcpy(pkt->data + enc_size, p_schro_params->enc_buf,
400  p_schro_params->enc_buf_size);
401  enc_size += p_schro_params->enc_buf_size;
402  av_freep(&p_schro_params->enc_buf);
403  p_schro_params->enc_buf_size = 0;
404  }
405 
406  if (p_frame_output->key_frame)
407  pkt->flags |= AV_PKT_FLAG_KEY;
408  *got_packet = 1;
409 
410 error:
411  /* free frame */
412  libschroedinger_free_frame(p_frame_output);
413  return ret;
414 }
415 
416 
418 {
419  SchroEncoderParams *p_schro_params = avctx->priv_data;
420 
421  /* Close the encoder. */
422  schro_encoder_free(p_schro_params->encoder);
423 
424  /* Free data in the output frame queue. */
425  ff_schro_queue_free(&p_schro_params->enc_frame_queue,
427 
428 
429  /* Free the encoder buffer. */
430  if (p_schro_params->enc_buf_size)
431  av_freep(&p_schro_params->enc_buf);
432 
433  /* Free the video format structure. */
434  av_freep(&p_schro_params->format);
435 
436  av_frame_free(&avctx->coded_frame);
437 
438  return 0;
439 }
440 
441 
443  .name = "libschroedinger",
444  .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
445  .type = AVMEDIA_TYPE_VIDEO,
446  .id = AV_CODEC_ID_DIRAC,
447  .priv_data_size = sizeof(SchroEncoderParams),
449  .encode2 = libschroedinger_encode_frame,
451  .capabilities = CODEC_CAP_DELAY,
452  .pix_fmts = (const enum AVPixelFormat[]){
454  },
455 };
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: pixfmt.h:346
This structure describes decoded (raw) audio or video data.
Definition: frame.h:135
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:70
AVFrame * coded_frame
the picture in the bitstream
Definition: avcodec.h:2548
uint16_t key_frame
key frame flag.
SchroFrame * ff_create_schro_frame(AVCodecContext *avctx, SchroFrameFormat schro_frame_fmt)
Create a Schro frame based on the dimensions and frame format passed.
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: pixfmt.h:350
int num
numerator
Definition: rational.h:44
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1270
int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size)
Copy pixel data from an AVPicture into a buffer.
Definition: avpicture.c:49
libschroedinger encoder private data
int frame_size
frame size
four components are given, that's all.
Definition: avcodec.h:3042
data structures common to libschroedinger decoder and encoder
AVCodec.
Definition: avcodec.h:2812
enum AVPixelFormat ff_pix_fmt
Macro definitions for various function/variable attributes.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1175
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
static void libschroedinger_free_frame(void *data)
#define av_cold
Definition: attributes.h:66
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:57
#define AV_RB32
Definition: intreadwrite.h:130
uint32_t frame_num
encoded frame number.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:211
const char data[16]
Definition: mxf.c:70
int coder_type
coder type
Definition: avcodec.h:2194
uint8_t * data
Definition: avcodec.h:973
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
Definition: mem.c:140
contains a single encoded frame returned from Dirac or Schroedinger
int size
Queue size.
uint8_t * p_encbuf
encoded frame data
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: avcodec.h:1019
static int set_chroma_format(AVCodecContext *avctx)
Works out Schro-compatible chroma format.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
int has_b_frames
Size of the frame reordering buffer in the decoder.
Definition: avcodec.h:1355
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:186
SchroEncoder * encoder
Schroedinger encoder handle.
#define CODEC_FLAG_INTERLACED_ME
interlaced motion estimation
Definition: avcodec.h:662
SchroFrameFormat frame_format
Schroedinger frame format.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:713
void * ff_schro_queue_pop(FFSchroQueue *queue)
Return the first element in the queue.
#define AVERROR(e)
Definition: error.h:43
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:69
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1144
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: pixfmt.h:307
#define CODEC_FLAG_QSCALE
Use fixed qscale.
Definition: avcodec.h:611
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:169
const char * name
Name of the codec implementation.
Definition: avcodec.h:2819
FFSchroQueue enc_frame_queue
queue storing encoded frames
SchroVideoFormat * format
Schroedinger video format.
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:979
int ff_get_schro_frame_format(SchroChromaFormat schro_pix_fmt, SchroFrameFormat *schro_frame_fmt)
Sets the Schroedinger frame format corresponding to the Schro chroma format passed.
static const struct @37 schro_pixel_format_map[]
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:69
int enc_buf_size
Size of encoder buffer.
int bit_rate
the average bitrate
Definition: avcodec.h:1114
int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data)
Add an element to the end of the queue.
void ff_schro_queue_free(FFSchroQueue *queue, void(*free_func)(void *))
Free the queue resources.
av_cold void ff_schro_queue_init(FFSchroQueue *queue)
Initialise the queue.
A simple queue implementation used in libschroedinger.
int width
picture width / height.
Definition: avcodec.h:1229
static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:311
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:1761
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
Definition: utils.c:1257
static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
int eos_signalled
end of sequence signalled
also ITU-R BT1361
Definition: pixfmt.h:323
NULL
Definition: eval.c:55
Libavcodec external API header.
int debug
debug
Definition: avcodec.h:2378
main external API structure.
Definition: avcodec.h:1050
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:490
unsigned char * enc_buf
buffer to store encoder output before writing it to the frame queue
#define AVERROR_BUG
Bug detected, please report the issue.
Definition: error.h:60
#define FF_CODER_TYPE_VLC
Definition: avcodec.h:2182
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:1775
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:1768
SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avctx)
Returns the video format preset matching the input video dimensions and time base.
int eos_pulled
end of sequence pulled
#define CODEC_FLAG_CLOSED_GOP
Definition: avcodec.h:663
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:1130
static SchroFrame * libschroedinger_frame_from_data(AVCodecContext *avctx, const AVFrame *frame)
static uint32_t state
Definition: trasher.c:27
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
Definition: avcodec.h:1255
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:65
common internal api header.
AVCodec ff_libschroedinger_encoder
int den
denominator
Definition: rational.h:45
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499
static int libschroedinger_encode_close(AVCodecContext *avctx)
void * priv_data
Definition: avcodec.h:1092
uint32_t size
encoded frame size
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
Definition: avpicture.c:85
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:191
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
Definition: avutil.h:207
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:972
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:312
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63
This structure stores compressed data.
Definition: avcodec.h:950
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:966