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 
34 #include <assert.h>
35 
36 
37 static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
38  int buf_size)
39 {
40  int i;
41  uint32_t state;
42  ParseContext *pc = &h->parse_context;
43 // mb_addr= pc->mb_addr - 1;
44  state = pc->state;
45  if (state > 13)
46  state = 7;
47 
48  for (i = 0; i < buf_size; i++) {
49  if (state == 7) {
50  i += h->h264dsp.h264_find_start_code_candidate(buf + i, buf_size - i);
51  if (i < buf_size)
52  state = 2;
53  } else if (state <= 2) {
54  if (buf[i] == 1)
55  state ^= 5; // 2->7, 1->4, 0->5
56  else if (buf[i])
57  state = 7;
58  else
59  state >>= 1; // 2->1, 1->0, 0->0
60  } else if (state <= 5) {
61  int nalu_type = buf[i] & 0x1F;
62  if (nalu_type == NAL_SEI || nalu_type == NAL_SPS ||
63  nalu_type == NAL_PPS || nalu_type == NAL_AUD) {
64  if (pc->frame_start_found) {
65  i++;
66  goto found;
67  }
68  } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA ||
69  nalu_type == NAL_IDR_SLICE) {
70  if (pc->frame_start_found) {
71  state += 8;
72  continue;
73  } else
74  pc->frame_start_found = 1;
75  }
76  state = 7;
77  } else {
78  if (buf[i] & 0x80)
79  goto found;
80  state = 7;
81  }
82  }
83  pc->state = state;
84  return END_NOT_FOUND;
85 
86 found:
87  pc->state = 7;
88  pc->frame_start_found = 0;
89  return i - (state & 5);
90 }
91 
93 {
94  H264Context *h = s->priv_data;
95 
96  h->slice_type_nos = s->pict_type & 3;
97 
99  get_ue_golomb(&h->gb); // redundant_pic_count
100 
101  if (ff_set_ref_count(h) < 0)
102  return AVERROR_INVALIDDATA;
103 
104  if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
105  int list;
106  for (list = 0; list < h->list_count; list++) {
107  if (get_bits1(&h->gb)) {
108  int index;
109  for (index = 0; ; index++) {
110  unsigned int reordering_of_pic_nums_idc = get_ue_golomb_31(&h->gb);
111 
112  if (reordering_of_pic_nums_idc < 3)
113  get_ue_golomb(&h->gb);
114  else if (reordering_of_pic_nums_idc > 3) {
116  "illegal reordering_of_pic_nums_idc %d\n",
117  reordering_of_pic_nums_idc);
118  return AVERROR_INVALIDDATA;
119  } else
120  break;
121 
122  if (index >= h->ref_count[list]) {
124  "reference count %d overflow\n", index);
125  return AVERROR_INVALIDDATA;
126  }
127  }
128  }
129  }
130  }
131 
135 
136  if (get_bits1(&h->gb)) { // adaptive_ref_pic_marking_mode_flag
137  int i;
138  for (i = 0; i < MAX_MMCO_COUNT; i++) {
139  MMCOOpcode opcode = get_ue_golomb_31(&h->gb);
140  if (opcode > (unsigned) MMCO_LONG) {
142  "illegal memory management control operation %d\n",
143  opcode);
144  return AVERROR_INVALIDDATA;
145  }
146  if (opcode == MMCO_END)
147  return 0;
148  else if (opcode == MMCO_RESET)
149  return 1;
150 
151  if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG)
152  get_ue_golomb(&h->gb);
153  if (opcode == MMCO_SHORT2LONG || opcode == MMCO_LONG2UNUSED ||
154  opcode == MMCO_LONG || opcode == MMCO_SET_MAX_LONG)
155  get_ue_golomb_31(&h->gb);
156  }
157  }
158 
159  return 0;
160 }
161 
171  AVCodecContext *avctx,
172  const uint8_t *buf, int buf_size)
173 {
174  H264Context *h = s->priv_data;
175  const uint8_t *buf_end = buf + buf_size;
176  unsigned int pps_id;
177  unsigned int slice_type;
178  int state = -1, got_reset = 0;
179  const uint8_t *ptr;
180  int field_poc[2];
181 
182  /* set some sane default values */
184  s->key_frame = 0;
186 
187  h->avctx = avctx;
189 
190  if (!buf_size)
191  return 0;
192 
193  for (;;) {
194  int src_length, dst_length, consumed;
195  buf = avpriv_find_start_code(buf, buf_end, &state);
196  if (buf >= buf_end)
197  break;
198  --buf;
199  src_length = buf_end - buf;
200  switch (state & 0x1f) {
201  case NAL_SLICE:
202  case NAL_IDR_SLICE:
203  // Do not walk the whole buffer just to decode slice header
204  if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) {
205  /* IDR or disposable slice
206  * No need to decode many bytes because MMCOs shall not be present. */
207  if (src_length > 60)
208  src_length = 60;
209  } else {
210  /* To decode up to MMCOs */
211  if (src_length > 1000)
212  src_length = 1000;
213  }
214  break;
215  }
216  ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
217  if (ptr == NULL || dst_length < 0)
218  break;
219 
220  init_get_bits(&h->gb, ptr, 8 * dst_length);
221  switch (h->nal_unit_type) {
222  case NAL_SPS:
224  break;
225  case NAL_PPS:
227  break;
228  case NAL_SEI:
230  break;
231  case NAL_IDR_SLICE:
232  s->key_frame = 1;
233 
234  h->prev_frame_num = 0;
235  h->prev_frame_num_offset = 0;
236  h->prev_poc_msb =
237  h->prev_poc_lsb = 0;
238  /* fall through */
239  case NAL_SLICE:
240  get_ue_golomb(&h->gb); // skip first_mb_in_slice
241  slice_type = get_ue_golomb_31(&h->gb);
242  s->pict_type = golomb_to_pict_type[slice_type % 5];
243  if (h->sei_recovery_frame_cnt >= 0) {
244  /* key frame, since recovery_frame_cnt is set */
245  s->key_frame = 1;
246  }
247  pps_id = get_ue_golomb(&h->gb);
248  if (pps_id >= MAX_PPS_COUNT) {
250  "pps_id %u out of range\n", pps_id);
251  return -1;
252  }
253  if (!h->pps_buffers[pps_id]) {
255  "non-existing PPS %u referenced\n", pps_id);
256  return -1;
257  }
258  h->pps = *h->pps_buffers[pps_id];
259  if (!h->sps_buffers[h->pps.sps_id]) {
261  "non-existing SPS %u referenced\n", h->pps.sps_id);
262  return -1;
263  }
264  h->sps = *h->sps_buffers[h->pps.sps_id];
266 
267  avctx->profile = ff_h264_get_profile(&h->sps);
268  avctx->level = h->sps.level_idc;
269 
270  if (h->sps.frame_mbs_only_flag) {
272  } else {
273  if (get_bits1(&h->gb)) { // field_pic_flag
274  h->picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); // bottom_field_flag
275  } else {
277  }
278  }
279 
280  if (h->nal_unit_type == NAL_IDR_SLICE)
281  get_ue_golomb(&h->gb); /* idr_pic_id */
282  if (h->sps.poc_type == 0) {
283  h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb);
284 
285  if (h->pps.pic_order_present == 1 &&
288  }
289 
290  if (h->sps.poc_type == 1 &&
292  h->delta_poc[0] = get_se_golomb(&h->gb);
293 
294  if (h->pps.pic_order_present == 1 &&
296  h->delta_poc[1] = get_se_golomb(&h->gb);
297  }
298 
299  /* Decode POC of this picture.
300  * The prev_ values needed for decoding POC of the next picture are not set here. */
301  field_poc[0] = field_poc[1] = INT_MAX;
302  ff_init_poc(h, field_poc, &s->output_picture_number);
303 
304  /* Continue parsing to check if MMCO_RESET is present.
305  * FIXME: MMCO_RESET could appear in non-first slice.
306  * Maybe, we should parse all undisposable non-IDR slice of this
307  * picture until encountering MMCO_RESET in a slice of it. */
308  if (h->nal_ref_idc && h->nal_unit_type != NAL_IDR_SLICE) {
309  got_reset = scan_mmco_reset(s);
310  if (got_reset < 0)
311  return got_reset;
312  }
313 
314  /* Set up the prev_ values for decoding POC of the next picture. */
315  h->prev_frame_num = got_reset ? 0 : h->frame_num;
316  h->prev_frame_num_offset = got_reset ? 0 : h->frame_num_offset;
317  if (h->nal_ref_idc != 0) {
318  if (!got_reset) {
319  h->prev_poc_msb = h->poc_msb;
320  h->prev_poc_lsb = h->poc_lsb;
321  } else {
322  h->prev_poc_msb = 0;
323  h->prev_poc_lsb =
324  h->picture_structure == PICT_BOTTOM_FIELD ? 0 : field_poc[0];
325  }
326  }
327 
328  if (h->sps.pic_struct_present_flag) {
329  switch (h->sei_pic_struct) {
332  s->repeat_pict = 0;
333  break;
337  s->repeat_pict = 1;
338  break;
341  s->repeat_pict = 2;
342  break;
344  s->repeat_pict = 3;
345  break;
347  s->repeat_pict = 5;
348  break;
349  default:
350  s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0;
351  break;
352  }
353  } else {
354  s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0;
355  }
356 
357  if (h->picture_structure == PICT_FRAME) {
359  if (h->sps.pic_struct_present_flag) {
360  switch (h->sei_pic_struct) {
364  break;
368  break;
369  default:
371  break;
372  }
373  } else {
374  if (field_poc[0] < field_poc[1])
376  else if (field_poc[0] > field_poc[1])
378  else
380  }
381  } else {
384  else
387  }
388 
389  return 0; /* no need to evaluate the rest */
390  }
391  buf += consumed;
392  }
393  /* didn't find a picture! */
394  av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n");
395  return -1;
396 }
397 
399  AVCodecContext *avctx,
400  const uint8_t **poutbuf, int *poutbuf_size,
401  const uint8_t *buf, int buf_size)
402 {
403  H264Context *h = s->priv_data;
404  ParseContext *pc = &h->parse_context;
405  int next;
406 
407  if (!h->got_first) {
408  h->got_first = 1;
409  if (avctx->extradata_size) {
410  h->avctx = avctx;
411  // must be done like in the decoder.
412  // otherwise opening the parser, creating extradata,
413  // and then closing and opening again
414  // will cause has_b_frames to be always set.
415  // NB: estimate_timings_from_pts behaves exactly like this.
416  if (!avctx->has_b_frames)
417  h->low_delay = 1;
419  }
420  }
421 
423  next = buf_size;
424  } else {
425  next = h264_find_frame_end(h, buf, buf_size);
426 
427  if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
428  *poutbuf = NULL;
429  *poutbuf_size = 0;
430  return buf_size;
431  }
432 
433  if (next < 0 && next != END_NOT_FOUND) {
434  assert(pc->last_index + next >= 0);
435  h264_find_frame_end(h, &pc->buffer[pc->last_index + next], -next); // update state
436  }
437  }
438 
439  parse_nal_units(s, avctx, buf, buf_size);
440 
441  if (h->sei_cpb_removal_delay >= 0) {
445  } else {
446  s->dts_sync_point = INT_MIN;
447  s->dts_ref_dts_delta = INT_MIN;
448  s->pts_dts_delta = INT_MIN;
449  }
450 
451  if (s->flags & PARSER_FLAG_ONCE) {
453  }
454 
455  *poutbuf = buf;
456  *poutbuf_size = buf_size;
457  return next;
458 }
459 
460 static int h264_split(AVCodecContext *avctx,
461  const uint8_t *buf, int buf_size)
462 {
463  int i;
464  uint32_t state = -1;
465  int has_sps = 0;
466 
467  for (i = 0; i <= buf_size; i++) {
468  if ((state & 0xFFFFFF1F) == 0x107)
469  has_sps = 1;
470  /* if((state&0xFFFFFF1F) == 0x101 ||
471  * (state&0xFFFFFF1F) == 0x102 ||
472  * (state&0xFFFFFF1F) == 0x105) {
473  * }
474  */
475  if ((state & 0xFFFFFF00) == 0x100 && (state & 0xFFFFFF1F) != 0x107 &&
476  (state & 0xFFFFFF1F) != 0x108 && (state & 0xFFFFFF1F) != 0x109) {
477  if (has_sps) {
478  while (i > 4 && buf[i - 5] == 0)
479  i--;
480  return i - 4;
481  }
482  }
483  if (i < buf_size)
484  state = (state << 8) | buf[i];
485  }
486  return 0;
487 }
488 
490 {
491  H264Context *h = s->priv_data;
492  ParseContext *pc = &h->parse_context;
493 
494  av_free(pc->buffer);
496 }
497 
499 {
500  H264Context *h = s->priv_data;
501  h->thread_context[0] = h;
502  h->slice_context_count = 1;
503  ff_h264dsp_init(&h->h264dsp, 8, 1);
504  return 0;
505 }
506 
509  .priv_data_size = sizeof(H264Context),
510  .parser_init = init,
511  .parser_parse = h264_parse,
512  .parser_close = close,
513  .split = h264_split,
514 };
#define PICT_BOTTOM_FIELD
Definition: mpegvideo.h:645
int ff_h264_decode_seq_parameter_set(H264Context *h)
Decode SPS.
Definition: h264_ps.c:297
#define PICT_TOP_FIELD
Definition: mpegvideo.h:644
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
GetBitContext gb
Definition: h264.h:267
5: top field, bottom field, top field repeated, in that order
Definition: h264.h:139
int sei_cpb_removal_delay
cpb_removal_delay in picture timing SEI message, see H.264 C.1.2
Definition: h264.h:608
int low_delay
Definition: h264.h:288
int(* h264_find_start_code_candidate)(const uint8_t *buf, int size)
Search buf from the start for up to size bytes.
Definition: h264dsp.h:116
int delta_poc[2]
Definition: h264.h:499
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:137
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:577
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:219
7: frame doubling
Definition: h264.h:141
#define MAX_PPS_COUNT
Definition: h264.h:43
enum AVFieldOrder field_order
Definition: avcodec.h:3706
static int scan_mmco_reset(AVCodecParserContext *s)
Definition: h264_parser.c:92
int codec_ids[5]
Definition: avcodec.h:3728
int frame_mbs_only_flag
Definition: h264.h:165
MMCOOpcode
Memory management control operation opcode.
Definition: h264.h:236
int ff_h264_get_profile(SPS *sps)
Compute profile from profile_idc and constraint_set?_flags.
Definition: h264.c:3032
H264Context.
Definition: h264.h:258
int prev_poc_msb
poc_msb of the last reference pic for POC type 0
Definition: h264.h:501
int dts_ref_dts_delta
Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base.
Definition: avcodec.h:3666
4: bottom field, top field, in that order
Definition: h264.h:138
int profile
profile
Definition: avcodec.h:2596
int frame_start_found
Definition: parser.h:34
int picture_structure
Definition: h264.h:375
int slice_type_nos
S free slice type (SI/SP are remapped to I/P)
Definition: h264.h:368
Macro definitions for various function/variable attributes.
static const uint8_t golomb_to_pict_type[5]
Definition: h264data.h:38
enum AVPictureStructure picture_structure
Indicate whether a picture is coded as a frame, top field or bottom field.
Definition: avcodec.h:3716
uint8_t
#define av_cold
Definition: attributes.h:66
int prev_frame_num_offset
for POC type 2
Definition: h264.h:504
#define PICT_FRAME
Definition: mpegvideo.h:646
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:37
Definition: h264.h:108
unsigned int ref_count[2]
num_ref_idx_l0/1_active_minus1 + 1
Definition: h264.h:401
int redundant_pic_cnt_present
redundant_pic_cnt_present_flag
Definition: h264.h:225
int frame_num
Definition: h264.h:500
int got_first
this flag is != 0 if we've parsed a frame
Definition: h264.h:483
#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:1332
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:155
ParseContext parse_context
Definition: h264.h:266
int nal_unit_type
Definition: h264.h:474
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:2830
PPS pps
current pps
Definition: h264.h:358
0: frame
Definition: h264.h:134
int weighted_pred
weighted_pred_flag
Definition: h264.h:218
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:148
int delta_pic_order_always_zero_flag
Definition: h264.h:157
static char * split(char *message, char delim)
Definition: af_channelmap.c:86
int ff_pred_weight_table(H264Context *h)
Definition: h264.c:2636
int frame_num_offset
for POC type 2
Definition: h264.h:503
av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
Definition: h264dsp.c:84
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:170
SPS sps
current sps
Definition: h264.h:357
int size_in_bits
Definition: get_bits.h:56
PPS * pps_buffers[MAX_PPS_COUNT]
Definition: h264.h:489
int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
Decode PPS.
Definition: h264_ps.c:524
int level
level
Definition: avcodec.h:2679
int poc_lsb
Definition: h264.h:496
int ff_set_ref_count(H264Context *h)
Definition: h264.c:3291
unsigned int list_count
Definition: h264.h:402
AVCodecParser ff_h264_parser
Definition: h264_parser.c:507
int pic_order_present
pic_order_present_flag
Definition: h264.h:214
SPS * sps_buffers[MAX_SPS_COUNT]
Definition: h264.h:488
struct H264Context * thread_context[MAX_THREADS]
Definition: h264.h:544
int pts_dts_delta
Presentation delay of current frame in units of AVCodecContext.time_base.
Definition: avcodec.h:3680
NULL
Definition: eval.c:55
AVCodecContext * avctx
Definition: h264.h:259
uint8_t * buffer
Definition: parser.h:29
H264 / AVC / MPEG4 part10 codec data table
Definition: h264.h:109
1: top field
Definition: h264.h:135
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:505
int ff_h264_decode_sei(H264Context *h)
Decode SEI.
Definition: h264_sei.c:202
int poc_msb
Definition: h264.h:497
main external API structure.
Definition: avcodec.h:1054
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:489
Definition: h264.h:237
2: bottom field
Definition: h264.h:136
uint32_t state
contains the last few bytes in MSB order
Definition: parser.h:33
int extradata_size
Definition: avcodec.h:1163
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:575
static int h264_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Definition: h264_parser.c:460
int index
Definition: gxfenc.c:72
#define MAX_MMCO_COUNT
Definition: h264.h:45
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:212
int log2_max_poc_lsb
log2_max_pic_order_cnt_lsb_minus4
Definition: h264.h:156
6: bottom field, top field, bottom field repeated, in that order
Definition: h264.h:140
int sei_buffering_period_present
Buffering period SEI flag.
Definition: h264.h:644
static uint32_t state
Definition: trasher.c:27
int output_picture_number
Picture number incremented in presentation or output order.
Definition: avcodec.h:3724
int pic_struct_present_flag
Definition: h264.h:195
Definition: h264.h:103
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:5003
const uint8_t * avpriv_find_start_code(const uint8_t *restrict p, const uint8_t *end, uint32_t *restrict state)
Definition: utils.c:2302
#define PARSER_FLAG_ONCE
Definition: avcodec.h:3607
int slice_context_count
Definition: h264.h:559
common internal api header.
int log2_max_frame_num
log2_max_frame_num_minus4 + 4
Definition: h264.h:154
Bi-dir predicted.
Definition: avutil.h:255
#define PARSER_FLAG_COMPLETE_FRAMES
Definition: avcodec.h:3606
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:498
int prev_poc_lsb
poc_lsb of the last reference pic for POC type 0
Definition: h264.h:502
Definition: h264.h:107
int ff_h264_decode_extradata(H264Context *h)
Definition: h264.c:1458
int delta_poc_bottom
Definition: h264.h:498
int repeat_pict
This field is used for proper frame duration computation in lavf.
Definition: avcodec.h:3590
H264DSPContext h264dsp
Definition: h264.h:262
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:398
8: frame tripling
Definition: h264.h:142
exp golomb vlc stuff
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
Definition: avcodec.h:3620
int sei_recovery_frame_cnt
recovery_frame_cnt from SEI message
Definition: h264.h:617
int level_idc
Definition: h264.h:151
int dts_sync_point
Synchronization point for start of timestamp generation.
Definition: avcodec.h:3651
int nal_ref_idc
Definition: h264.h:473
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:603