FFmpeg  2.1.1
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 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 /**
23 * @file
24 * Dirac encoder support via libschroedinger-1.0 libraries. More details about
25 * the Schroedinger project can be found at http://www.diracvideo.org/.
26 * The library implements Dirac Specification Version 2.2
27 * (http://dirac.sourceforge.net/specification.html).
28 */
29 
30 #include <schroedinger/schro.h>
31 #include <schroedinger/schrodebug.h>
32 #include <schroedinger/schrovideoformat.h>
33 
34 #include "libavutil/attributes.h"
35 #include "libavutil/avassert.h"
36 #include "avcodec.h"
37 #include "internal.h"
38 #include "libschroedinger.h"
39 #include "bytestream.h"
40 
41 
42 /** libschroedinger encoder private data */
43 typedef struct SchroEncoderParams {
44  /** Schroedinger video format */
45  SchroVideoFormat *format;
46 
47  /** Schroedinger frame format */
48  SchroFrameFormat frame_format;
49 
50  /** frame being encoded */
52 
53  /** frame size */
55 
56  /** Schroedinger encoder handle*/
57  SchroEncoder* encoder;
58 
59  /** buffer to store encoder output before writing it to the frame queue*/
60  unsigned char *enc_buf;
61 
62  /** Size of encoder buffer*/
64 
65  /** queue storing encoded frames */
67 
68  /** end of sequence signalled */
70 
71  /** end of sequence pulled */
73 
74  /* counter for frames submitted to encoder, used as dts */
75  int64_t dts;
77 
78 /**
79 * Works out Schro-compatible chroma format.
80 */
82 {
83  int num_formats = sizeof(schro_pixel_format_map) /
84  sizeof(schro_pixel_format_map[0]);
85  int idx;
86 
87  SchroEncoderParams *p_schro_params = avctx->priv_data;
88 
89  for (idx = 0; idx < num_formats; ++idx) {
90  if (schro_pixel_format_map[idx].ff_pix_fmt == avctx->pix_fmt) {
91  p_schro_params->format->chroma_format =
92  schro_pixel_format_map[idx].schro_pix_fmt;
93  return 0;
94  }
95  }
96 
97  av_log(avctx, AV_LOG_ERROR,
98  "This codec currently only supports planar YUV 4:2:0, 4:2:2"
99  " and 4:4:4 formats.\n");
100 
101  return -1;
102 }
103 
105 {
106  SchroEncoderParams *p_schro_params = avctx->priv_data;
107  SchroVideoFormatEnum preset;
108 
109  /* Initialize the libraries that libschroedinger depends on. */
110  schro_init();
111 
112  /* Create an encoder object. */
113  p_schro_params->encoder = schro_encoder_new();
114 
115  if (!p_schro_params->encoder) {
116  av_log(avctx, AV_LOG_ERROR,
117  "Unrecoverable Error: schro_encoder_new failed. ");
118  return -1;
119  }
120 
121  /* Initialize the format. */
122  preset = ff_get_schro_video_format_preset(avctx);
123  p_schro_params->format =
124  schro_encoder_get_video_format(p_schro_params->encoder);
125  schro_video_format_set_std_video_format(p_schro_params->format, preset);
126  p_schro_params->format->width = avctx->width;
127  p_schro_params->format->height = avctx->height;
128 
129  if (set_chroma_format(avctx) == -1)
130  return -1;
131 
132  if (avctx->color_primaries == AVCOL_PRI_BT709) {
133  p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_HDTV;
134  } else if (avctx->color_primaries == AVCOL_PRI_BT470BG) {
135  p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_625;
136  } else if (avctx->color_primaries == AVCOL_PRI_SMPTE170M) {
137  p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_525;
138  }
139 
140  if (avctx->colorspace == AVCOL_SPC_BT709) {
141  p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_HDTV;
142  } else if (avctx->colorspace == AVCOL_SPC_BT470BG) {
143  p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_SDTV;
144  }
145 
146  if (avctx->color_trc == AVCOL_TRC_BT709) {
147  p_schro_params->format->transfer_function = SCHRO_TRANSFER_CHAR_TV_GAMMA;
148  }
149 
150  if (ff_get_schro_frame_format(p_schro_params->format->chroma_format,
151  &p_schro_params->frame_format) == -1) {
152  av_log(avctx, AV_LOG_ERROR,
153  "This codec currently supports only planar YUV 4:2:0, 4:2:2"
154  " and 4:4:4 formats.\n");
155  return -1;
156  }
157 
158  p_schro_params->format->frame_rate_numerator = avctx->time_base.den;
159  p_schro_params->format->frame_rate_denominator = avctx->time_base.num;
160 
161  p_schro_params->frame_size = avpicture_get_size(avctx->pix_fmt,
162  avctx->width,
163  avctx->height);
164 
165  avctx->coded_frame = &p_schro_params->picture;
166 
167  if (!avctx->gop_size) {
168  schro_encoder_setting_set_double(p_schro_params->encoder,
169  "gop_structure",
170  SCHRO_ENCODER_GOP_INTRA_ONLY);
171 
172  if (avctx->coder_type == FF_CODER_TYPE_VLC)
173  schro_encoder_setting_set_double(p_schro_params->encoder,
174  "enable_noarith", 1);
175  } else {
176  schro_encoder_setting_set_double(p_schro_params->encoder,
177  "au_distance", avctx->gop_size);
178  avctx->has_b_frames = 1;
179  p_schro_params->dts = -1;
180  }
181 
182  /* FIXME - Need to handle SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY. */
183  if (avctx->flags & CODEC_FLAG_QSCALE) {
184  if (!avctx->global_quality) {
185  /* lossless coding */
186  schro_encoder_setting_set_double(p_schro_params->encoder,
187  "rate_control",
188  SCHRO_ENCODER_RATE_CONTROL_LOSSLESS);
189  } else {
190  int quality;
191  schro_encoder_setting_set_double(p_schro_params->encoder,
192  "rate_control",
193  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY);
194 
195  quality = avctx->global_quality / FF_QP2LAMBDA;
196  if (quality > 10)
197  quality = 10;
198  schro_encoder_setting_set_double(p_schro_params->encoder,
199  "quality", quality);
200  }
201  } else {
202  schro_encoder_setting_set_double(p_schro_params->encoder,
203  "rate_control",
204  SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE);
205 
206  schro_encoder_setting_set_double(p_schro_params->encoder,
207  "bitrate", avctx->bit_rate);
208  }
209 
210  if (avctx->flags & CODEC_FLAG_INTERLACED_ME)
211  /* All material can be coded as interlaced or progressive
212  irrespective of the type of source material. */
213  schro_encoder_setting_set_double(p_schro_params->encoder,
214  "interlaced_coding", 1);
215 
216  schro_encoder_setting_set_double(p_schro_params->encoder, "open_gop",
217  !(avctx->flags & CODEC_FLAG_CLOSED_GOP));
218 
219  /* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
220  * and libdirac support other bit-depth data. */
221  schro_video_format_set_std_signal_range(p_schro_params->format,
222  SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
223 
224  /* Set the encoder format. */
225  schro_encoder_set_video_format(p_schro_params->encoder,
226  p_schro_params->format);
227 
228  /* Set the debug level. */
229  schro_debug_set_level(avctx->debug);
230 
231  schro_encoder_start(p_schro_params->encoder);
232 
233  /* Initialize the encoded frame queue. */
234  ff_schro_queue_init(&p_schro_params->enc_frame_queue);
235  return 0;
236 }
237 
239  const AVFrame *frame)
240 {
241  SchroEncoderParams *p_schro_params = avctx->priv_data;
242  SchroFrame *in_frame;
243  /* Input line size may differ from what the codec supports. Especially
244  * when transcoding from one format to another. So use avpicture_layout
245  * to copy the frame. */
246  in_frame = ff_create_schro_frame(avctx, p_schro_params->frame_format);
247 
248  if (in_frame)
249  avpicture_layout((const AVPicture *)frame, avctx->pix_fmt,
250  avctx->width, avctx->height,
251  in_frame->components[0].data,
252  p_schro_params->frame_size);
253 
254  return in_frame;
255 }
256 
258 {
259  FFSchroEncodedFrame *enc_frame = data;
260 
261  av_freep(&enc_frame->p_encbuf);
262  av_free(enc_frame);
263 }
264 
266  const AVFrame *frame, int *got_packet)
267 {
268  int enc_size = 0;
269  SchroEncoderParams *p_schro_params = avctx->priv_data;
270  SchroEncoder *encoder = p_schro_params->encoder;
271  struct FFSchroEncodedFrame *p_frame_output = NULL;
272  int go = 1;
273  SchroBuffer *enc_buf;
274  int presentation_frame;
275  int parse_code;
276  int last_frame_in_sequence = 0;
277  int pkt_size, ret;
278 
279  if (!frame) {
280  /* Push end of sequence if not already signalled. */
281  if (!p_schro_params->eos_signalled) {
282  schro_encoder_end_of_stream(encoder);
283  p_schro_params->eos_signalled = 1;
284  }
285  } else {
286  /* Allocate frame data to schro input buffer. */
287  SchroFrame *in_frame = libschroedinger_frame_from_data(avctx, frame);
288  /* Load next frame. */
289  schro_encoder_push_frame(encoder, in_frame);
290  }
291 
292  if (p_schro_params->eos_pulled)
293  go = 0;
294 
295  /* Now check to see if we have any output from the encoder. */
296  while (go) {
297  SchroStateEnum state;
298  state = schro_encoder_wait(encoder);
299  switch (state) {
300  case SCHRO_STATE_HAVE_BUFFER:
301  case SCHRO_STATE_END_OF_STREAM:
302  enc_buf = schro_encoder_pull(encoder, &presentation_frame);
303  av_assert0(enc_buf->length > 0);
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  p_schro_params->enc_buf = av_realloc(p_schro_params->enc_buf,
311  p_schro_params->enc_buf_size + enc_buf->length);
312 
313  memcpy(p_schro_params->enc_buf + p_schro_params->enc_buf_size,
314  enc_buf->data, enc_buf->length);
315  p_schro_params->enc_buf_size += enc_buf->length;
316 
317 
318  if (state == SCHRO_STATE_END_OF_STREAM) {
319  p_schro_params->eos_pulled = 1;
320  go = 0;
321  }
322 
323  if (!SCHRO_PARSE_CODE_IS_PICTURE(parse_code)) {
324  schro_buffer_unref(enc_buf);
325  break;
326  }
327 
328  /* Create output frame. */
329  p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
330  /* Set output data. */
331  p_frame_output->size = p_schro_params->enc_buf_size;
332  p_frame_output->p_encbuf = p_schro_params->enc_buf;
333  if (SCHRO_PARSE_CODE_IS_INTRA(parse_code) &&
334  SCHRO_PARSE_CODE_IS_REFERENCE(parse_code))
335  p_frame_output->key_frame = 1;
336 
337  /* Parse the coded frame number from the bitstream. Bytes 14
338  * through 17 represesent the frame number. */
339  p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
340 
341  ff_schro_queue_push_back(&p_schro_params->enc_frame_queue,
342  p_frame_output);
343  p_schro_params->enc_buf_size = 0;
344  p_schro_params->enc_buf = NULL;
345 
346  schro_buffer_unref(enc_buf);
347 
348  break;
349 
350  case SCHRO_STATE_NEED_FRAME:
351  go = 0;
352  break;
353 
354  case SCHRO_STATE_AGAIN:
355  break;
356 
357  default:
358  av_log(avctx, AV_LOG_ERROR, "Unknown Schro Encoder state\n");
359  return -1;
360  }
361  }
362 
363  /* Copy 'next' frame in queue. */
364 
365  if (p_schro_params->enc_frame_queue.size == 1 &&
366  p_schro_params->eos_pulled)
367  last_frame_in_sequence = 1;
368 
369  p_frame_output = ff_schro_queue_pop(&p_schro_params->enc_frame_queue);
370 
371  if (!p_frame_output)
372  return 0;
373 
374  pkt_size = p_frame_output->size;
375  if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0)
376  pkt_size += p_schro_params->enc_buf_size;
377  if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
378  goto error;
379 
380  memcpy(pkt->data, p_frame_output->p_encbuf, p_frame_output->size);
381  avctx->coded_frame->key_frame = p_frame_output->key_frame;
382  /* Use the frame number of the encoded frame as the pts. It is OK to
383  * do so since Dirac is a constant frame rate codec. It expects input
384  * to be of constant frame rate. */
385  pkt->pts =
386  avctx->coded_frame->pts = p_frame_output->frame_num;
387  pkt->dts = p_schro_params->dts++;
388  enc_size = p_frame_output->size;
389 
390  /* Append the end of sequence information to the last frame in the
391  * sequence. */
392  if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0) {
393  memcpy(pkt->data + enc_size, p_schro_params->enc_buf,
394  p_schro_params->enc_buf_size);
395  enc_size += p_schro_params->enc_buf_size;
396  av_freep(&p_schro_params->enc_buf);
397  p_schro_params->enc_buf_size = 0;
398  }
399 
400  if (p_frame_output->key_frame)
401  pkt->flags |= AV_PKT_FLAG_KEY;
402  *got_packet = 1;
403 
404 error:
405  /* free frame */
406  libschroedinger_free_frame(p_frame_output);
407  return ret;
408 }
409 
410 
412 {
413  SchroEncoderParams *p_schro_params = avctx->priv_data;
414 
415  /* Close the encoder. */
416  schro_encoder_free(p_schro_params->encoder);
417 
418  /* Free data in the output frame queue. */
419  ff_schro_queue_free(&p_schro_params->enc_frame_queue,
421 
422 
423  /* Free the encoder buffer. */
424  if (p_schro_params->enc_buf_size)
425  av_freep(&p_schro_params->enc_buf);
426 
427  /* Free the video format structure. */
428  av_freep(&p_schro_params->format);
429 
430  return 0;
431 }
432 
433 
435  .name = "libschroedinger",
436  .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
437  .type = AVMEDIA_TYPE_VIDEO,
438  .id = AV_CODEC_ID_DIRAC,
439  .priv_data_size = sizeof(SchroEncoderParams),
441  .encode2 = libschroedinger_encode_frame,
443  .capabilities = CODEC_CAP_DELAY,
444  .pix_fmts = (const enum AVPixelFormat[]){
446  },
447 };
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
Definition: utils.c:1500
AVFrame picture
frame being encoded
This structure describes decoded (raw) audio or video data.
Definition: frame.h:96
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
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.
planar YUV 4:2:2, 16bpp, (1 Cr &amp; Cb sample per 2x1 Y samples)
Definition: avcodec.h:4538
int num
numerator
Definition: rational.h:44
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1342
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:41
libschroedinger encoder private data
int frame_size
frame size
Pixel format.
Definition: avcodec.h:4533
Picture data structure.
Definition: avcodec.h:3121
data structures common to libschroedinger decoder and encoder
AVCodec.
Definition: avcodec.h:2922
#define av_cold
Definition: avcodec.h:653
enum AVPixelFormat ff_pix_fmt
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avcodec.h:1265
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:234
static void libschroedinger_free_frame(void *data)
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:182
const char * name
Name of the codec implementation.
Definition: avcodec.h:2929
const char data[16]
Definition: mxf.c:68
int coder_type
coder type
Definition: avcodec.h:2262
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:1113
static AVFrame * frame
Definition: demuxing.c:51
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: avcodec.h:4147
int has_b_frames
Size of the frame reordering buffer in the decoder.
Definition: avcodec.h:1427
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:219
SchroEncoder * encoder
Schroedinger encoder handle.
#define CODEC_FLAG_INTERLACED_ME
interlaced motion estimation
Definition: avcodec.h:718
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:769
void * ff_schro_queue_pop(FFSchroQueue *queue)
Return the first element in the queue.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:151
int flags
CODEC_FLAG_*.
Definition: avcodec.h:1234
#define CODEC_FLAG_QSCALE
Use fixed qscale.
Definition: avcodec.h:692
FFSchroQueue enc_frame_queue
queue storing encoded frames
SchroVideoFormat * format
Schroedinger video format.
Libavcodec external API header.
AVPixelFormat
Pixel format.
Definition: pixfmt.h:66
int flags
A combination of AV_PKT_FLAG values.
Definition: avcodec.h:1069
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.
int enc_buf_size
Size of encoder buffer.
also ITU-R BT1361
Definition: avcodec.h:633
int bit_rate
the average bitrate
Definition: avcodec.h:1204
int ff_schro_queue_push_back(FFSchroQueue *queue, void *p_data)
Add an element to the end of the queue.
void * av_realloc(void *ptr, size_t size) 1(2)
Allocate or reallocate a block of memory.
Definition: mem.c:141
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.
ret
Definition: avfilter.c:961
int width
picture width / height.
Definition: avcodec.h:1314
static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:1827
#define FF_CODER_TYPE_VLC
Definition: avcodec.h:2252
static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
int eos_signalled
end of sequence signalled
planar YUV 4:2:0, 12bpp, (1 Cr &amp; Cb sample per 2x2 Y samples)
Definition: avcodec.h:4534
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL &amp; SECAM
Definition: avcodec.h:625
int debug
debug
Definition: avcodec.h:2442
main external API structure.
Definition: avcodec.h:1146
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:538
unsigned char * enc_buf
buffer to store encoder output before writing it to the frame queue
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:1841
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:1834
AVFrame * coded_frame
the picture in the bitstream
Definition: avcodec.h:2588
uint8_t * data
Definition: avcodec.h:1063
planar YUV 4:4:4, 24bpp, (1 Cr &amp; Cb sample per 1x1 Y samples)
Definition: avcodec.h:4539
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:719
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL &amp; SECAM / IEC 61966-2-4 xvYCC601 ...
Definition: frame.h:38
void * priv_data
Definition: avcodec.h:1182
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:1220
static SchroFrame * libschroedinger_frame_from_data(AVCodecContext *avctx, const AVFrame *frame)
static uint32_t state
Definition: trasher.c:27
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: avcodec.h:626
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
Definition: avcodec.h:1333
preset
Definition: vf_curves.c:46
common internal api header.
static struct @75 schro_pixel_format_map[]
AVCodec ff_libschroedinger_encoder
int den
denominator
Definition: rational.h:45
static int libschroedinger_encode_close(AVCodecContext *avctx)
#define AV_RB32(x)
Definition: intreadwrite.h:258
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:49
int key_frame
1 -&gt; keyframe, 0-&gt; not
Definition: frame.h:162
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
Definition: avcodec.h:2257
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
Definition: frame.h:35
int64_t dts
Decompression timestamp in AVStream-&gt;time_base units; the time at which the packet is decompressed...
Definition: avcodec.h:1062
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: avcodec.h:622
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
static AVPacket pkt
Definition: demuxing.c:52
This structure stores compressed data.
Definition: avcodec.h:1040
int64_t pts
Presentation timestamp in AVStream-&gt;time_base units; the time at which the decompressed packet will b...
Definition: avcodec.h:1056
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:241