Libav
h264_parser.c
Go to the documentation of this file.
1 /*
2  * H.26L/H.264/AVC/JVT/14496-10/... parser
3  * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
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 
28 #include "libavutil/attributes.h"
29 #include "parser.h"
30 #include "h264data.h"
31 #include "golomb.h"
32 #include "internal.h"
33 #include "mpegutils.h"
34 
35 #include <assert.h>
36 
37 
38 static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
39  int buf_size)
40 {
41  int i;
42  uint32_t state;
43  ParseContext *pc = &h->parse_context;
44 // mb_addr= pc->mb_addr - 1;
45  state = pc->state;
46  if (state > 13)
47  state = 7;
48 
49  for (i = 0; i < buf_size; i++) {
50  if (state == 7) {
51  i += h->h264dsp.startcode_find_candidate(buf + i, buf_size - i);
52  if (i < buf_size)
53  state = 2;
54  } else if (state <= 2) {
55  if (buf[i] == 1)
56  state ^= 5; // 2->7, 1->4, 0->5
57  else if (buf[i])
58  state = 7;
59  else
60  state >>= 1; // 2->1, 1->0, 0->0
61  } else if (state <= 5) {
62  int nalu_type = buf[i] & 0x1F;
63  if (nalu_type == NAL_SEI || nalu_type == NAL_SPS ||
64  nalu_type == NAL_PPS || nalu_type == NAL_AUD) {
65  if (pc->frame_start_found) {
66  i++;
67  goto found;
68  }
69  } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA ||
70  nalu_type == NAL_IDR_SLICE) {
71  if (pc->frame_start_found) {
72  state += 8;
73  continue;
74  } else
75  pc->frame_start_found = 1;
76  }
77  state = 7;
78  } else {
79  if (buf[i] & 0x80)
80  goto found;
81  state = 7;
82  }
83  }
84  pc->state = state;
85  return END_NOT_FOUND;
86 
87 found:
88  pc->state = 7;
89  pc->frame_start_found = 0;
90  return i - (state & 5);
91 }
92 
94 {
95  H264Context *h = s->priv_data;
96 
97  h->slice_type_nos = s->pict_type & 3;
98 
100  get_ue_golomb(&h->gb); // redundant_pic_count
101 
102  if (ff_set_ref_count(h) < 0)
103  return AVERROR_INVALIDDATA;
104 
105  if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
106  int list;
107  for (list = 0; list < h->list_count; list++) {
108  if (get_bits1(&h->gb)) {
109  int index;
110  for (index = 0; ; index++) {
111  unsigned int reordering_of_pic_nums_idc = get_ue_golomb_31(&h->gb);
112 
113  if (reordering_of_pic_nums_idc < 3)
114  get_ue_golomb(&h->gb);
115  else if (reordering_of_pic_nums_idc > 3) {
117  "illegal reordering_of_pic_nums_idc %d\n",
118  reordering_of_pic_nums_idc);
119  return AVERROR_INVALIDDATA;
120  } else
121  break;
122 
123  if (index >= h->ref_count[list]) {
125  "reference count %d overflow\n", index);
126  return AVERROR_INVALIDDATA;
127  }
128  }
129  }
130  }
131  }
132 
136 
137  if (get_bits1(&h->gb)) { // adaptive_ref_pic_marking_mode_flag
138  int i;
139  for (i = 0; i < MAX_MMCO_COUNT; i++) {
140  MMCOOpcode opcode = get_ue_golomb_31(&h->gb);
141  if (opcode > (unsigned) MMCO_LONG) {
143  "illegal memory management control operation %d\n",
144  opcode);
145  return AVERROR_INVALIDDATA;
146  }
147  if (opcode == MMCO_END)
148  return 0;
149  else if (opcode == MMCO_RESET)
150  return 1;
151 
152  if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG)
153  get_ue_golomb(&h->gb);
154  if (opcode == MMCO_SHORT2LONG || opcode == MMCO_LONG2UNUSED ||
155  opcode == MMCO_LONG || opcode == MMCO_SET_MAX_LONG)
156  get_ue_golomb_31(&h->gb);
157  }
158  }
159 
160  return 0;
161 }
162 
172  AVCodecContext *avctx,
173  const uint8_t *buf, int buf_size)
174 {
175  H264Context *h = s->priv_data;
176  const uint8_t *buf_end = buf + buf_size;
177  unsigned int pps_id;
178  unsigned int slice_type;
179  int state = -1, got_reset = 0;
180  const uint8_t *ptr;
181  int field_poc[2];
182 
183  /* set some sane default values */
185  s->key_frame = 0;
187 
188  h->avctx = avctx;
190 
191  if (!buf_size)
192  return 0;
193 
194  for (;;) {
195  int src_length, dst_length, consumed;
196  buf = avpriv_find_start_code(buf, buf_end, &state);
197  if (buf >= buf_end)
198  break;
199  --buf;
200  src_length = buf_end - buf;
201  switch (state & 0x1f) {
202  case NAL_SLICE:
203  case NAL_IDR_SLICE:
204  // Do not walk the whole buffer just to decode slice header
205  if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) {
206  /* IDR or disposable slice
207  * No need to decode many bytes because MMCOs shall not be present. */
208  if (src_length > 60)
209  src_length = 60;
210  } else {
211  /* To decode up to MMCOs */
212  if (src_length > 1000)
213  src_length = 1000;
214  }
215  break;
216  }
217  ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
218  if (!ptr || dst_length < 0)
219  break;
220 
221  init_get_bits(&h->gb, ptr, 8 * dst_length);
222  switch (h->nal_unit_type) {
223  case NAL_SPS:
225  break;
226  case NAL_PPS:
228  break;
229  case NAL_SEI:
231  break;
232  case NAL_IDR_SLICE:
233  s->key_frame = 1;
234 
235  h->prev_frame_num = 0;
236  h->prev_frame_num_offset = 0;
237  h->prev_poc_msb =
238  h->prev_poc_lsb = 0;
239  /* fall through */
240  case NAL_SLICE:
241  get_ue_golomb(&h->gb); // skip first_mb_in_slice
242  slice_type = get_ue_golomb_31(&h->gb);
243  s->pict_type = golomb_to_pict_type[slice_type % 5];
244  if (h->sei_recovery_frame_cnt >= 0) {
245  /* key frame, since recovery_frame_cnt is set */
246  s->key_frame = 1;
247  }
248  pps_id = get_ue_golomb(&h->gb);
249  if (pps_id >= MAX_PPS_COUNT) {
251  "pps_id %u out of range\n", pps_id);
252  return -1;
253  }
254  if (!h->pps_buffers[pps_id]) {
256  "non-existing PPS %u referenced\n", pps_id);
257  return -1;
258  }
259  h->pps = *h->pps_buffers[pps_id];
260  if (!h->sps_buffers[h->pps.sps_id]) {
262  "non-existing SPS %u referenced\n", h->pps.sps_id);
263  return -1;
264  }
265  h->sps = *h->sps_buffers[h->pps.sps_id];
267 
268  avctx->profile = ff_h264_get_profile(&h->sps);
269  avctx->level = h->sps.level_idc;
270 
271  if (h->sps.frame_mbs_only_flag) {
273  } else {
274  if (get_bits1(&h->gb)) { // field_pic_flag
275  h->picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); // bottom_field_flag
276  } else {
278  }
279  }
280 
281  if (h->nal_unit_type == NAL_IDR_SLICE)
282  get_ue_golomb(&h->gb); /* idr_pic_id */
283  if (h->sps.poc_type == 0) {
284  h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb);
285 
286  if (h->pps.pic_order_present == 1 &&
289  }
290 
291  if (h->sps.poc_type == 1 &&
293  h->delta_poc[0] = get_se_golomb(&h->gb);
294 
295  if (h->pps.pic_order_present == 1 &&
297  h->delta_poc[1] = get_se_golomb(&h->gb);
298  }
299 
300  /* Decode POC of this picture.
301  * The prev_ values needed for decoding POC of the next picture are not set here. */
302  field_poc[0] = field_poc[1] = INT_MAX;
303  ff_init_poc(h, field_poc, &s->output_picture_number);
304 
305  /* Continue parsing to check if MMCO_RESET is present.
306  * FIXME: MMCO_RESET could appear in non-first slice.
307  * Maybe, we should parse all undisposable non-IDR slice of this
308  * picture until encountering MMCO_RESET in a slice of it. */
309  if (h->nal_ref_idc && h->nal_unit_type != NAL_IDR_SLICE) {
310  got_reset = scan_mmco_reset(s);
311  if (got_reset < 0)
312  return got_reset;
313  }
314 
315  /* Set up the prev_ values for decoding POC of the next picture. */
316  h->prev_frame_num = got_reset ? 0 : h->frame_num;
317  h->prev_frame_num_offset = got_reset ? 0 : h->frame_num_offset;
318  if (h->nal_ref_idc != 0) {
319  if (!got_reset) {
320  h->prev_poc_msb = h->poc_msb;
321  h->prev_poc_lsb = h->poc_lsb;
322  } else {
323  h->prev_poc_msb = 0;
324  h->prev_poc_lsb =
325  h->picture_structure == PICT_BOTTOM_FIELD ? 0 : field_poc[0];
326  }
327  }
328 
329  if (h->sps.pic_struct_present_flag) {
330  switch (h->sei_pic_struct) {
333  s->repeat_pict = 0;
334  break;
338  s->repeat_pict = 1;
339  break;
342  s->repeat_pict = 2;
343  break;
345  s->repeat_pict = 3;
346  break;
348  s->repeat_pict = 5;
349  break;
350  default:
351  s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0;
352  break;
353  }
354  } else {
355  s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0;
356  }
357 
358  if (h->picture_structure == PICT_FRAME) {
360  if (h->sps.pic_struct_present_flag) {
361  switch (h->sei_pic_struct) {
365  break;
369  break;
370  default:
372  break;
373  }
374  } else {
375  if (field_poc[0] < field_poc[1])
377  else if (field_poc[0] > field_poc[1])
379  else
381  }
382  } else {
385  else
388  }
389 
390  return 0; /* no need to evaluate the rest */
391  }
392  buf += consumed;
393  }
394  /* didn't find a picture! */
395  av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n");
396  return -1;
397 }
398 
400  AVCodecContext *avctx,
401  const uint8_t **poutbuf, int *poutbuf_size,
402  const uint8_t *buf, int buf_size)
403 {
404  H264Context *h = s->priv_data;
405  ParseContext *pc = &h->parse_context;
406  int next;
407 
408  if (!h->got_first) {
409  h->got_first = 1;
410  if (avctx->extradata_size) {
411  h->avctx = avctx;
412  // must be done like in the decoder.
413  // otherwise opening the parser, creating extradata,
414  // and then closing and opening again
415  // will cause has_b_frames to be always set.
416  // NB: estimate_timings_from_pts behaves exactly like this.
417  if (!avctx->has_b_frames)
418  h->low_delay = 1;
420  }
421  }
422 
424  next = buf_size;
425  } else {
426  next = h264_find_frame_end(h, buf, buf_size);
427 
428  if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
429  *poutbuf = NULL;
430  *poutbuf_size = 0;
431  return buf_size;
432  }
433 
434  if (next < 0 && next != END_NOT_FOUND) {
435  assert(pc->last_index + next >= 0);
436  h264_find_frame_end(h, &pc->buffer[pc->last_index + next], -next); // update state
437  }
438  }
439 
440  parse_nal_units(s, avctx, buf, buf_size);
441 
442  if (h->sei_cpb_removal_delay >= 0) {
446  } else {
447  s->dts_sync_point = INT_MIN;
448  s->dts_ref_dts_delta = INT_MIN;
449  s->pts_dts_delta = INT_MIN;
450  }
451 
452  if (s->flags & PARSER_FLAG_ONCE) {
454  }
455 
456  *poutbuf = buf;
457  *poutbuf_size = buf_size;
458  return next;
459 }
460 
461 static int h264_split(AVCodecContext *avctx,
462  const uint8_t *buf, int buf_size)
463 {
464  int i;
465  uint32_t state = -1;
466  int has_sps = 0;
467 
468  for (i = 0; i <= buf_size; i++) {
469  if ((state & 0xFFFFFF1F) == 0x107)
470  has_sps = 1;
471  /* if((state&0xFFFFFF1F) == 0x101 ||
472  * (state&0xFFFFFF1F) == 0x102 ||
473  * (state&0xFFFFFF1F) == 0x105) {
474  * }
475  */
476  if ((state & 0xFFFFFF00) == 0x100 && (state & 0xFFFFFF1F) != 0x107 &&
477  (state & 0xFFFFFF1F) != 0x108 && (state & 0xFFFFFF1F) != 0x109) {
478  if (has_sps) {
479  while (i > 4 && buf[i - 5] == 0)
480  i--;
481  return i - 4;
482  }
483  }
484  if (i < buf_size)
485  state = (state << 8) | buf[i];
486  }
487  return 0;
488 }
489 
491 {
492  H264Context *h = s->priv_data;
493  ParseContext *pc = &h->parse_context;
494 
495  av_free(pc->buffer);
497 }
498 
500 {
501  H264Context *h = s->priv_data;
502  h->thread_context[0] = h;
503  h->slice_context_count = 1;
504  ff_h264dsp_init(&h->h264dsp, 8, 1);
505  return 0;
506 }
507 
510  .priv_data_size = sizeof(H264Context),
511  .parser_init = init,
512  .parser_parse = h264_parse,
513  .parser_close = close,
514  .split = h264_split,
515 };
int ff_h264_decode_seq_parameter_set(H264Context *h)
Decode SPS.
Definition: h264_ps.c:299
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
GetBitContext gb
Definition: h264.h:311
5: top field, bottom field, top field repeated, in that order
Definition: h264.h:147
int sei_cpb_removal_delay
cpb_removal_delay in picture timing SEI message, see H.264 C.1.2
Definition: h264.h:659
int low_delay
Definition: h264.h:332
int delta_poc[2]
Definition: h264.h:543
static int get_se_golomb(GetBitContext *gb)
read signed exp golomb code.
Definition: golomb.h:179
3: top field, bottom field, in that order
Definition: h264.h:145
const uint8_t * ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length)
Decode a network abstraction layer unit.
Definition: h264.c:216
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:240
int weighted_bipred_idc
Definition: h264.h:227
7: frame doubling
Definition: h264.h:149
#define MAX_PPS_COUNT
Definition: h264.h:50
enum AVFieldOrder field_order
Definition: avcodec.h:3800
static int scan_mmco_reset(AVCodecParserContext *s)
Definition: h264_parser.c:93
#define PARSER_FLAG_ONCE
Definition: avcodec.h:3701
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...
int frame_mbs_only_flag
Definition: h264.h:173
MMCOOpcode
Memory management control operation opcode.
Definition: h264.h:244
int ff_h264_get_profile(SPS *sps)
Compute profile from profile_idc and constraint_set?_flags.
Definition: h264.c:1188
H264Context.
Definition: h264.h:303
int prev_poc_msb
poc_msb of the last reference pic for POC type 0
Definition: h264.h:545
int dts_ref_dts_delta
Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base.
Definition: avcodec.h:3760
Definition: h264.h:114
4: bottom field, top field, in that order
Definition: h264.h:146
int profile
profile
Definition: avcodec.h:2622
int frame_start_found
Definition: parser.h:34
int picture_structure
Definition: h264.h:419
int slice_type_nos
S free slice type (SI/SP are remapped to I/P)
Definition: h264.h:412
Definition: h264.h:116
static const uint8_t golomb_to_pict_type[5]
Definition: h264data.h:37
enum AVPictureStructure picture_structure
Indicate whether a picture is coded as a frame, top field or bottom field.
Definition: avcodec.h:3810
uint8_t
int prev_frame_num_offset
for POC type 2
Definition: h264.h:548
void ff_h264_reset_sei(H264Context *h)
Reset SEI values at the beginning of the frame.
Definition: h264_sei.c:37
Definition: h264.h:110
static int h264_find_frame_end(H264Context *h, const uint8_t *buf, int buf_size)
Definition: h264_parser.c:38
Definition: h264.h:117
unsigned int ref_count[2]
num_ref_idx_l0/1_active_minus1 + 1
Definition: h264.h:445
#define PICT_BOTTOM_FIELD
Definition: mpegutils.h:34
int redundant_pic_cnt_present
redundant_pic_cnt_present_flag
Definition: h264.h:233
int(* startcode_find_candidate)(const uint8_t *buf, int size)
Search buf from the start for up to size bytes.
Definition: h264dsp.h:116
int frame_num
Definition: h264.h:544
int got_first
this flag is != 0 if we've parsed a frame
Definition: h264.h:527
#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:1339
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:186
static int get_ue_golomb(GetBitContext *gb)
read unsigned exp golomb code.
Definition: golomb.h:53
int poc_type
pic_order_cnt_type
Definition: h264.h:163
ParseContext parse_context
Definition: h264.h:310
int nal_unit_type
Definition: h264.h:518
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
Definition: parser.c:217
int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)
Definition: h264.c:1103
#define PARSER_FLAG_COMPLETE_FRAMES
Definition: avcodec.h:3700
PPS pps
current pps
Definition: h264.h:402
0: frame
Definition: h264.h:142
int weighted_pred
weighted_pred_flag
Definition: h264.h:226
#define PICT_TOP_FIELD
Definition: mpegutils.h:33
int delta_pic_order_always_zero_flag
Definition: h264.h:165
static char * split(char *message, char delim)
Definition: af_channelmap.c:86
int ff_pred_weight_table(H264Context *h)
Definition: h264.c:975
Definition: h264.h:115
int frame_num_offset
for POC type 2
Definition: h264.h:547
av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
Definition: h264dsp.c:57
int last_index
Definition: parser.h:31
static int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Parse NAL units of found picture and decode some basic information.
Definition: h264_parser.c:171
SPS sps
current sps
Definition: h264.h:401
int size_in_bits
Definition: get_bits.h:56
PPS * pps_buffers[MAX_PPS_COUNT]
Definition: h264.h:533
int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
Decode PPS.
Definition: h264_ps.c:534
int level
level
Definition: avcodec.h:2705
int poc_lsb
Definition: h264.h:540
int ff_set_ref_count(H264Context *h)
Definition: h264.c:1248
unsigned int list_count
Definition: h264.h:446
AVCodecParser ff_h264_parser
Definition: h264_parser.c:508
int pic_order_present
pic_order_present_flag
Definition: h264.h:222
struct H264Context * thread_context[H264_MAX_THREADS]
Definition: h264.h:588
SPS * sps_buffers[MAX_SPS_COUNT]
Definition: h264.h:532
int pts_dts_delta
Presentation delay of current frame in units of AVCodecContext.time_base.
Definition: avcodec.h:3774
NULL
Definition: eval.c:55
AVCodecContext * avctx
Definition: h264.h:304
uint8_t * buffer
Definition: parser.h:29
#define av_cold
Definition: attributes.h:66
H264 / AVC / MPEG4 part10 codec data table
1: top field
Definition: h264.h:143
static int get_ue_golomb_31(GetBitContext *gb)
read unsigned exp golomb code, constraint to a max of 31.
Definition: golomb.h:96
int prev_frame_num
frame_num of the last pic for POC type 1/2
Definition: h264.h:549
int ff_h264_decode_sei(H264Context *h)
Decode SEI.
Definition: h264_sei.c:219
int poc_msb
Definition: h264.h:541
int codec_ids[5]
Definition: avcodec.h:3822
main external API structure.
Definition: avcodec.h:1050
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:490
Definition: h264.h:245
2: bottom field
Definition: h264.h:144
uint32_t state
contains the last few bytes in MSB order
Definition: parser.h:33
int extradata_size
Definition: avcodec.h:1165
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:271
SEI_PicStructType sei_pic_struct
pic_struct in picture timing SEI message
Definition: h264.h:619
static int h264_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Definition: h264_parser.c:461
int index
Definition: gxfenc.c:72
#define MAX_MMCO_COUNT
Definition: h264.h:52
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:375
#define END_NOT_FOUND
Definition: parser.h:40
unsigned int sps_id
Definition: h264.h:220
int log2_max_poc_lsb
log2_max_pic_order_cnt_lsb_minus4
Definition: h264.h:164
6: bottom field, top field, bottom field repeated, in that order
Definition: h264.h:148
int sei_buffering_period_present
Buffering period SEI flag.
Definition: h264.h:695
static uint32_t state
Definition: trasher.c:27
int output_picture_number
Picture number incremented in presentation or output order.
Definition: avcodec.h:3818
int pic_struct_present_flag
Definition: h264.h:203
av_cold void ff_h264_free_context(H264Context *h)
Free any data that may have been allocated in the H264 context like SPS, PPS etc. ...
Definition: h264.c:1816
const uint8_t * avpriv_find_start_code(const uint8_t *restrict p, const uint8_t *end, uint32_t *restrict state)
Definition: utils.c:2394
int slice_context_count
Definition: h264.h:603
common internal api header.
int log2_max_frame_num
log2_max_frame_num_minus4 + 4
Definition: h264.h:162
Bi-dir predicted.
Definition: avutil.h:255
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499
#define PICT_FRAME
Definition: mpegutils.h:35
int prev_poc_lsb
poc_lsb of the last reference pic for POC type 0
Definition: h264.h:546
int ff_h264_decode_extradata(H264Context *h)
Definition: h264.c:544
int delta_poc_bottom
Definition: h264.h:542
int repeat_pict
This field is used for proper frame duration computation in lavf.
Definition: avcodec.h:3684
H264DSPContext h264dsp
Definition: h264.h:307
static int h264_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: h264_parser.c:399
8: frame tripling
Definition: h264.h:150
exp golomb vlc stuff
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
Definition: avcodec.h:3714
int sei_recovery_frame_cnt
recovery_frame_cnt from SEI message
Definition: h264.h:668
int level_idc
Definition: h264.h:159
int dts_sync_point
Synchronization point for start of timestamp generation.
Definition: avcodec.h:3745
int nal_ref_idc
Definition: h264.h:517
Predicted.
Definition: avutil.h:254
int sei_dpb_output_delay
dpb_output_delay in picture timing SEI message, see H.264 C.2.2
Definition: h264.h:654