MythTV  master
AVCParser.cpp
Go to the documentation of this file.
1 // MythTV headers
2 #include "AVCParser.h"
3 #include <iostream>
4 
6 #include "recorders/dtvrecorder.h" // for FrameRate
7 
8 #include <cmath>
9 #include <strings.h>
10 
11 #include "bitreader.h"
12 #include "bytereader.h"
13 
14 /*
15  Most of the comments below were cut&paste from ITU-T Rec. H.264
16  as found here: http://www.itu.int/rec/T-REC-H.264/e
17  */
18 
19 /*
20  Useful definitions:
21 
22  * access unit: A set of NAL units always containing exactly one
23  primary coded picture. In addition to the primary coded picture, an
24  access unit may also contain one or more redundant coded pictures
25  or other NAL units not containing slices or slice data partitions
26  of a coded picture. The decoding of an access unit always results
27  in a decoded picture.
28 
29  * instantaneous decoding refresh (IDR) access unit: An access unit in
30  which the primary coded picture is an IDR picture.
31 
32  * instantaneous decoding refresh (IDR) picture: A coded picture
33  containing only slices with I or SI slice types that causes the
34  decoding process to mark all reference pictures as "unused for
35  reference" immediately after decoding the IDR picture. After the
36  decoding of an IDR picture all following coded pictures in decoding
37  order can be decoded without inter prediction from any picture
38  decoded prior to the IDR picture. The first picture of each coded
39  video sequence is an IDR picture.
40 
41  * NAL unit: A syntax structure containing an indication of the type
42  of data to follow and bytes containing that data in the form of an
43  RBSP interspersed as necessary with emulation prevention bytes.
44 
45  * raw byte sequence payload (RBSP): A syntax structure containing an
46  integer number of bytes that is encapsulated in a NAL unit. An RBSP
47  is either empty or has the form of a string of data bits containing
48  syntax elements followed by an RBSP stop bit and followed by zero
49  or more subsequent bits equal to 0.
50 
51  * raw byte sequence payload (RBSP) stop bit: A bit equal to 1 present
52  within a raw byte sequence payload (RBSP) after a string of data
53  bits. The location of the end of the string of data bits within an
54  RBSP can be identified by searching from the end of the RBSP for
55  the RBSP stop bit, which is the last non-zero bit in the RBSP.
56 
57  * parity: The parity of a field can be top or bottom.
58 
59  * picture: A collective term for a field or a frame.
60 
61  * picture parameter set: A syntax structure containing syntax
62  elements that apply to zero or more entire coded pictures as
63  determined by the m_picParameterSetId syntax element found in each
64  slice header.
65 
66  * primary coded picture: The coded representation of a picture to be
67  used by the decoding process for a bitstream conforming to this
68  Recommendation | International Standard. The primary coded picture
69  contains all macroblocks of the picture. The only pictures that
70  have a normative effect on the decoding process are primary coded
71  pictures. See also redundant coded picture.
72 
73  * VCL: Video Coding Layer
74 
75  - The VCL is specified to efficiently represent the content of the
76  video data. The NAL is specified to format that data and provide
77  header information in a manner appropriate for conveyance on a
78  variety of communication channels or storage media. All data are
79  contained in NAL units, each of which contains an integer number of
80  bytes. A NAL unit specifies a generic format for use in both
81  packet-oriented and bitstream systems. The format of NAL units for
82  both packet-oriented transport and byte stream is identical except
83  that each NAL unit can be preceded by a start code prefix and extra
84  padding bytes in the byte stream format.
85 
86 */
87 
88 void AVCParser::Reset(void)
89 {
91 
92  m_bottomFieldFlag = -1;
95  m_deltaPicOrderCnt.fill(0);
96  m_fieldPicFlag = -1;
97  m_frameMbsOnlyFlag = -1;
98  m_frameNum = -1;
99  // The value of m_idrPicId shall be in the range of 0 to 65535, inclusive.
100  m_idrPicId = 65536;
101  m_log2MaxFrameNum = 0;
103  m_nalRefIdc = 111; // != [0|1|2|3]
105  m_numRefFrames = 0;
106  m_picOrderCntLsb = 0;
107  m_picOrderCntType = 0;
109  m_picParameterSetId = -1;
112  m_prevDeltaPicOrderCnt.fill(0);
113  m_prevFieldPicFlag = -1;
114  m_prevFrameNum = -1;
115  m_prevIdrPicId = 65536;
116  m_prevNALRefIdc = 111; // != [0|1|2|3]
121  m_redundantPicCnt = 0;
125 
126  resetRBSP();
127 }
128 
129 
131 {
132  switch (type)
133  {
134  case UNKNOWN:
135  return "UNKNOWN";
136  case SLICE:
137  return "SLICE";
138  case SLICE_DPA:
139  return "SLICE_DPA";
140  case SLICE_DPB:
141  return "SLICE_DPB";
142  case SLICE_DPC:
143  return "SLICE_DPC";
144  case SLICE_IDR:
145  return "SLICE_IDR";
146  case SEI:
147  return "SEI";
148  case SPS:
149  return "SPS";
150  case PPS:
151  return "PPS";
152  case AU_DELIMITER:
153  return "AU_DELIMITER";
154  case END_SEQUENCE:
155  return "END_SEQUENCE";
156  case END_STREAM:
157  return "END_STREAM";
158  case FILLER_DATA:
159  return "FILLER_DATA";
160  case SPS_EXT:
161  return "SPS_EXT";
162  }
163  return "OTHER";
164 }
165 
167 {
168  /*
169  An access unit consists of one primary coded picture, zero or more
170  corresponding redundant coded pictures, and zero or more non-VCL NAL
171  units. The association of VCL NAL units to primary or redundant coded
172  pictures is described in subclause 7.4.1.2.5.
173 
174  The first access unit in the bitstream starts with the first NAL unit
175  of the bitstream.
176 
177  The first of any of the following NAL units after the last VCL NAL
178  unit of a primary coded picture specifies the start of a new access
179  unit.
180 
181  – access unit delimiter NAL unit (when present)
182  – sequence parameter set NAL unit (when present)
183  – picture parameter set NAL unit (when present)
184  – SEI NAL unit (when present)
185  – NAL units with m_nalUnitType in the range of 14 to 18, inclusive
186  – first VCL NAL unit of a primary coded picture (always present)
187  */
188 
189  /*
190  7.4.1.2.4 Detection of the first VCL NAL unit of a primary coded
191  picture This subclause specifies constraints on VCL NAL unit syntax
192  that are sufficient to enable the detection of the first VCL NAL unit
193  of each primary coded picture.
194 
195  Any coded slice NAL unit or coded slice data partition A NAL unit of
196  the primary coded picture of the current access unit shall be
197  different from any coded slice NAL unit or coded slice data partition
198  A NAL unit of the primary coded picture of the previous access unit in
199  one or more of the following ways.
200 
201  - frame_num differs in value. The value of frame_num used to
202  test this condition is the value of frame_num that appears in
203  the syntax of the slice header, regardless of whether that value
204  is inferred to have been equal to 0 for subsequent use in the
205  decoding process due to the presence of
206  memory_management_control_operation equal to 5.
207  Note: If the current picture is an IDR picture FrameNum and
208  PrevRefFrameNum are set equal to 0.
209  - m_picParameterSetId differs in value.
210  - m_fieldPicFlag differs in value.
211  - bottom_field_flag is present in both and differs in value.
212  - nal_ref_idc differs in value with one of the nal_ref_idc
213  values being equal to 0.
214  - m_picOrderCntType is equal to 0 for both and either
215  m_picOrderCntLsb differs in value, or m_deltaPicOrderCntBottom
216  differs in value.
217  - m_picOrderCntType is equal to 1 for both and either
218  m_deltaPicOrderCnt[0] differs in value, or
219  m_deltaPicOrderCnt[1] differs in value.
220  - m_nalUnitType differs in value with one of the m_nalUnitType values
221  being equal to 5.
222  - m_nalUnitType is equal to 5 for both and m_idrPicId differs in
223  value.
224 
225  NOTE – Some of the VCL NAL units in redundant coded pictures or some
226  non-VCL NAL units (e.g. an access unit delimiter NAL unit) may also
227  be used for the detection of the boundary between access units, and
228  may therefore aid in the detection of the start of a new primary
229  coded picture.
230 
231  */
232 
233  bool result = false;
234 
235  if (m_prevFrameNum != -1)
236  {
237  // Need previous slice information for comparison
238 
240  result = true; // NOLINT(bugprone-branch-clone)
241  else if (m_prevPicParameterSetId != -1 &&
243  result = true;
245  result = true;
246  else if ((m_bottomFieldFlag != -1 && m_prevBottomFieldFlag != -1) &&
248  result = true;
249  else if ((m_nalRefIdc == 0 || m_prevNALRefIdc == 0) &&
251  result = true;
252  else if ((m_picOrderCntType == 0 && m_prevPicOrderCntType == 0) &&
255  result = true;
256  else if ((m_picOrderCntType == 1 && m_prevPicOrderCntType == 1) &&
259  result = true;
260  else if ((m_nalUnitType == SLICE_IDR ||
263  result = true;
264  else if ((m_nalUnitType == SLICE_IDR &&
267  result = true;
268  }
269 
281 
282  return result;
283 }
284 
285 uint32_t AVCParser::addBytes(const uint8_t *bytes,
286  const uint32_t byte_count,
287  const uint64_t stream_offset)
288 {
289  const uint8_t *startP = bytes;
290 
291  m_stateChanged = false;
292  m_onFrame = false;
293  m_onKeyFrame = false;
294 
295  while (startP < bytes + byte_count && !m_onFrame)
296  {
297  const uint8_t *endP =
299 
300  bool found_start_code = ByteReader::start_code_is_valid(m_syncAccumulator);
301 
302  /* Between startP and endP we potentially have some more
303  * bytes of a NAL that we've been parsing (plus some bytes of
304  * start code)
305  */
307  {
308  if (!fillRBSP(startP, endP - startP, found_start_code))
309  {
310  resetRBSP();
311  return endP - bytes;
312  }
313  processRBSP(found_start_code); /* Call may set have_uinfinished_NAL
314  * to false */
315  }
316 
317  /* Dealt with everything up to endP */
318  startP = endP;
319 
320  if (found_start_code)
321  {
323  {
324  /* We've found a new start code, without completely
325  * parsing the previous NAL. Either there's a
326  * problem with the stream or with this parser.
327  */
328  LOG(VB_GENERAL, LOG_ERR,
329  "AVCParser::addBytes: Found new start "
330  "code, but previous NAL is incomplete!");
331  }
332 
333  /* Prepare for accepting the new NAL */
334  resetRBSP();
335 
336  /* If we find the start of an AU somewhere from here
337  * to the next start code, the offset to associate with
338  * it is the one passed in to this call, not any of the
339  * subsequent calls.
340  */
341  m_pktOffset = stream_offset; // + (startP - bytes);
342 
343 /*
344  m_nalUnitType specifies the type of RBSP data structure contained in
345  the NAL unit as specified in Table 7-1. VCL NAL units
346  are specified as those NAL units having m_nalUnitType
347  equal to 1 to 5, inclusive. All remaining NAL units
348  are called non-VCL NAL units:
349 
350  0 Unspecified
351  1 Coded slice of a non-IDR picture slice_layer_without_partitioning_rbsp( )
352  2 Coded slice data partition A slice_data_partition_a_layer_rbsp( )
353  3 Coded slice data partition B slice_data_partition_b_layer_rbsp( )
354  4 Coded slice data partition C slice_data_partition_c_layer_rbsp( )
355  5 Coded slice of an IDR picture slice_layer_without_partitioning_rbsp( )
356  6 Supplemental enhancement information (SEI) 5 sei_rbsp( )
357  7 Sequence parameter set (SPS) seq_parameter_set_rbsp( )
358  8 Picture parameter set pic_parameter_set_rbsp( )
359  9 Access unit delimiter access_unit_delimiter_rbsp( )
360  10 End of sequence end_of_seq_rbsp( )
361  11 End of stream end_of_stream_rbsp( )
362 */
364  m_nalRefIdc = (m_syncAccumulator >> 5) & 0x3;
365 
366  bool good_nal_unit = true;
367  if (m_nalRefIdc)
368  {
369  /* nal_ref_idc shall be equal to 0 for all NAL units having
370  * m_nalUnitType equal to 6, 9, 10, 11, or 12.
371  */
372  if (m_nalUnitType == SEI ||
375  good_nal_unit = false;
376  }
377  else
378  {
379  /* nal_ref_idc shall not be equal to 0 for NAL units with
380  * m_nalUnitType equal to 5
381  */
382  if (m_nalUnitType == SLICE_IDR)
383  good_nal_unit = false;
384  }
385 
386  if (good_nal_unit)
387  {
388  if (m_nalUnitType == SPS || m_nalUnitType == PPS ||
390  {
391  /* This is a NAL we need to parse. We may have the body
392  * of it in the part of the stream past to us this call,
393  * or we may get the rest in subsequent calls to addBytes.
394  * Either way, we set m_haveUnfinishedNAL, so that we
395  * start filling the rbsp buffer
396  */
397  m_haveUnfinishedNAL = true;
398  }
399  else if (m_nalUnitType == AU_DELIMITER)
400  {
401  set_AU_pending();
402  }
403  }
404  else
405  LOG(VB_GENERAL, LOG_ERR,
406  "AVCParser::addbytes: malformed NAL units");
407  } //found start code
408  }
409 
410  return startP - bytes;
411 }
412 
413 
414 void AVCParser::processRBSP(bool rbsp_complete)
415 {
416  auto br = BitReader(m_rbspBuffer, m_rbspIndex);
417 
418  if (m_nalUnitType == SEI)
419  {
420  /* SEI cannot be parsed without knowing its size. If
421  * we haven't got the whole rbsp, return and wait for
422  * the rest
423  */
424  if (!rbsp_complete)
425  return;
426 
427  set_AU_pending();
428 
429  decode_SEI(br);
430  }
431  else if (m_nalUnitType == SPS)
432  {
433  /* Best wait until we have the whole thing */
434  if (!rbsp_complete)
435  return;
436 
437  set_AU_pending();
438 
439  if (!m_seenSPS)
441 
442  decode_SPS(br);
443  }
444  else if (m_nalUnitType == PPS)
445  {
446  /* Best wait until we have the whole thing */
447  if (!rbsp_complete)
448  return;
449 
450  set_AU_pending();
451 
452  decode_PPS(br);
453  }
454  else
455  {
456  /* Need only parse the header. So return only
457  * if we have insufficient bytes */
458  if (!rbsp_complete && m_rbspIndex < MAX_SLICE_HEADER_SIZE)
459  return;
460 
461  decode_Header(br);
462 
463  if (new_AU())
464  set_AU_pending();
465  }
466 
467  /* If we got this far, we managed to parse a sufficient
468  * prefix of the current NAL. We can go onto the next. */
469  m_haveUnfinishedNAL = false;
470 
472  {
473  /* Once we know the slice type of a new AU, we can
474  * determine if it is a keyframe or just a frame
475  */
476  m_auPending = false;
478 
479  m_onFrame = true;
481 
483  {
484  m_onKeyFrame = true;
486  }
487  }
488 }
489 
490 /*
491  7.4.3 Slice header semantics
492 */
494 {
495  m_isKeyframe = false;
496 
497  if (m_log2MaxFrameNum == 0)
498  {
499  /* SPS has not been parsed yet */
500  return false;
501  }
502 
503  /*
504  m_firstMbInSlice specifies the address of the first macroblock
505  in the slice. When arbitrary slice order is not allowed as
506  specified in Annex A, the value of first_mb_in_slice is
507  constrained as follows.
508 
509  – If m_separateColourPlaneFlag is equal to 0, the value of
510  first_mb_in_slice shall not be less than the value of
511  first_mb_in_slice for any other slice of the current picture
512  that precedes the current slice in decoding order.
513 
514  – Otherwise (m_separateColourPlaneFlag is equal to 1), the value of
515  first_mb_in_slice shall not be less than the value of
516  first_mb_in_slice for any other slice of the current picture
517  that precedes the current slice in decoding order and has the
518  same value of colour_plane_id.
519  */
520  /* uint first_mb_in_slice = */ br.get_ue_golomb();
521 
522  /*
523  slice_type specifies the coding type of the slice according to
524  Table 7-6. e.g. P, B, I, SP, SI
525 
526  When m_nalUnitType is equal to 5 (IDR picture), slice_type shall
527  be equal to 2, 4, 7, or 9 (I or SI)
528  */
530 
531  /* s->pict_type = golomb_to_pict_type[slice_type % 5];
532  */
533 
534  /*
535  m_picParameterSetId specifies the picture parameter set in
536  use. The value of m_picParameterSetId shall be in the range of
537  0 to 255, inclusive.
538  */
540 
541  /*
542  m_separateColourPlaneFlag equal to 1 specifies that the three
543  colour components of the 4:4:4 chroma format are coded
544  separately. m_separateColourPlaneFlag equal to 0 specifies that
545  the colour components are not coded separately. When
546  m_separateColourPlaneFlag is not present, it shall be inferred
547  to be equal to 0. When m_separateColourPlaneFlag is equal to 1,
548  the primary coded picture consists of three separate components,
549  each of which consists of coded samples of one colour plane (Y,
550  Cb or Cr) that each use the monochrome coding syntax. In this
551  case, each colour plane is associated with a specific
552  colour_plane_id value.
553  */
555  br.get_bits(2); // colour_plane_id
556 
557  /*
558  frame_num is used as an identifier for pictures and shall be
559  represented by m_log2MaxFrameNum_minus4 + 4 bits in the
560  bitstream....
561 
562  If the current picture is an IDR picture, frame_num shall be equal to 0.
563 
564  When m_maxNumRefFrames is equal to 0, slice_type shall be equal
565  to 2, 4, 7, or 9.
566  */
568 
569  /*
570  m_fieldPicFlag equal to 1 specifies that the slice is a slice of a
571  coded field. m_fieldPicFlag equal to 0 specifies that the slice is a
572  slice of a coded frame. When m_fieldPicFlag is not present it shall be
573  inferred to be equal to 0.
574 
575  bottom_field_flag equal to 1 specifies that the slice is part of a
576  coded bottom field. bottom_field_flag equal to 0 specifies that the
577  picture is a coded top field. When this syntax element is not present
578  for the current slice, it shall be inferred to be equal to 0.
579  */
580  if (!m_frameMbsOnlyFlag)
581  {
582  m_fieldPicFlag = br.get_bits(1);
584  }
585  else
586  {
587  m_fieldPicFlag = 0;
588  m_bottomFieldFlag = -1;
589  }
590 
591  /*
592  m_idrPicId identifies an IDR picture. The values of m_idrPicId
593  in all the slices of an IDR picture shall remain unchanged. When
594  two consecutive access units in decoding order are both IDR
595  access units, the value of m_idrPicId in the slices of the first
596  such IDR access unit shall differ from the m_idrPicId in the
597  second such IDR access unit. The value of m_idrPicId shall be in
598  the range of 0 to 65535, inclusive.
599  */
600  if (m_nalUnitType == SLICE_IDR)
601  {
602  m_idrPicId = br.get_ue_golomb();
603  m_isKeyframe = true;
604  }
605  else
607 
608  /*
609  m_picOrderCntLsb specifies the picture order count modulo
610  MaxPicOrderCntLsb for the top field of a coded frame or for a coded
611  field. The size of the m_picOrderCntLsb syntax element is
612  m_log2MaxPicOrderCntLsbMinus4 + 4 bits. The value of the
613  pic_order_cnt_lsb shall be in the range of 0 to MaxPicOrderCntLsb – 1,
614  inclusive.
615 
616  m_deltaPicOrderCntBottom specifies the picture order count
617  difference between the bottom field and the top field of a coded
618  frame.
619  */
620  if (m_picOrderCntType == 0)
621  {
623 
624  if ((m_picOrderPresentFlag == 1) && !m_fieldPicFlag)
626  else
628  }
629  else
631 
632  /*
633  m_deltaPicOrderAlwaysZeroFlag equal to 1 specifies that
634  m_deltaPicOrderCnt[ 0 ] and m_deltaPicOrderCnt[ 1 ] are not
635  present in the slice headers of the sequence and shall be
636  inferred to be equal to 0. m_deltaPicOrderAlwaysZeroFlag
637  equal to 0 specifies that m_deltaPicOrderCnt[ 0 ] is present in
638  the slice headers of the sequence and m_deltaPicOrderCnt[ 1 ]
639  may be present in the slice headers of the sequence.
640  */
642  {
644  }
645  else if (m_picOrderCntType == 1)
646  {
647  /*
648  m_deltaPicOrderCnt[ 0 ] specifies the picture order count
649  difference from the expected picture order count for the top
650  field of a coded frame or for a coded field as specified in
651  subclause 8.2.1. The value of m_deltaPicOrderCnt[ 0 ] shall
652  be in the range of -2^31 to 2^31 - 1, inclusive. When this
653  syntax element is not present in the bitstream for the
654  current slice, it shall be inferred to be equal to 0.
655 
656  m_deltaPicOrderCnt[ 1 ] specifies the picture order count
657  difference from the expected picture order count for the
658  bottom field of a coded frame specified in subclause
659  8.2.1. The value of m_deltaPicOrderCnt[ 1 ] shall be in the
660  range of -2^31 to 2^31 - 1, inclusive. When this syntax
661  element is not present in the bitstream for the current
662  slice, it shall be inferred to be equal to 0.
663  */
665 
666  if ((m_picOrderPresentFlag == 1) && !m_fieldPicFlag)
668  else
669  m_deltaPicOrderCnt[1] = 0;
670  }
671 
672  /*
673  m_redundantPicCnt shall be equal to 0 for slices and slice data
674  partitions belonging to the primary coded picture. The
675  m_redundantPicCnt shall be greater than 0 for coded slices and
676  coded slice data partitions in redundant coded pictures. When
677  m_redundantPicCnt is not present, its value shall be inferred to
678  be equal to 0. The value of m_redundantPicCnt shall be in the
679  range of 0 to 127, inclusive.
680  */
682 
683  return true;
684 }
685 
686 /*
687  * libavcodec used for example
688  */
690 {
691  m_seenSPS = true;
692 
693  int profile_idc = br.get_bits(8);
694  br.get_bits(1); // constraint_set0_flag
695  br.get_bits(1); // constraint_set1_flag
696  br.get_bits(1); // constraint_set2_flag
697  br.get_bits(1); // constraint_set3_flag
698  br.get_bits(4); // reserved
699  br.get_bits(8); // level_idc
700  br.get_ue_golomb(); // sps_id
701 
702  if (profile_idc == 100 || profile_idc == 110 || profile_idc == 122 ||
703  profile_idc == 244 || profile_idc == 44 || profile_idc == 83 ||
704  profile_idc == 86 || profile_idc == 118 || profile_idc == 128 )
705  { // high profile
707  if (m_chromaFormatIdc == 3)
708  m_separateColourPlaneFlag = (br.get_bits(1) == 1);
709 
710  br.get_ue_golomb(); // bit_depth_luma_minus8
711  br.get_ue_golomb(); // bit_depth_chroma_minus8
712  br.get_bits(1); // qpprime_y_zero_transform_bypass_flag
713 
714  if (br.get_bits(1)) // seq_scaling_matrix_present_flag
715  {
716  for (int idx = 0; idx < ((m_chromaFormatIdc != 3) ? 8 : 12); ++idx)
717  {
718  if (br.get_bits(1)) // Scaling list present
719  {
720  int lastScale = 8;
721  int nextScale = 8;
722  int sl_n = ((idx < 6) ? 16 : 64);
723  for(int sl_i = 0; sl_i < sl_n; ++sl_i)
724  {
725  if (nextScale != 0)
726  {
727  int deltaScale = br.get_se_golomb();
728  nextScale = (lastScale + deltaScale + 256) % 256;
729  }
730  lastScale = (nextScale == 0) ? lastScale : nextScale;
731  }
732  }
733  }
734  }
735  }
736 
737  /*
738  m_log2MaxFrameNum_minus4 specifies the value of the variable
739  MaxFrameNum that is used in frame_num related derivations as
740  follows:
741 
742  MaxFrameNum = 2( m_log2MaxFrameNum_minus4 + 4 )
743  */
744  m_log2MaxFrameNum = br.get_ue_golomb() + 4;
745 
746  /*
747  m_picOrderCntType specifies the method to decode picture order
748  count (as specified in subclause 8.2.1). The value of
749  m_picOrderCntType shall be in the range of 0 to 2, inclusive.
750  */
752  if (m_picOrderCntType == 0)
753  {
754  /*
755  m_log2MaxPicOrderCntLsbMinus4 specifies the value of the
756  variable MaxPicOrderCntLsb that is used in the decoding
757  process for picture order count as specified in subclause
758  8.2.1 as follows:
759 
760  MaxPicOrderCntLsb = 2( m_log2MaxPicOrderCntLsbMinus4 + 4 )
761 
762  The value of m_log2MaxPicOrderCntLsbMinus4 shall be in
763  the range of 0 to 12, inclusive.
764  */
766  }
767  else if (m_picOrderCntType == 1)
768  {
769  /*
770  m_deltaPicOrderAlwaysZeroFlag equal to 1 specifies that
771  m_deltaPicOrderCnt[ 0 ] and m_deltaPicOrderCnt[ 1 ] are
772  not present in the slice headers of the sequence and shall
773  be inferred to be equal to
774  0. m_deltaPicOrderAlwaysZeroFlag
775  */
777 
778  /*
779  offset_for_non_ref_pic is used to calculate the picture
780  order count of a non-reference picture as specified in
781  8.2.1. The value of offset_for_non_ref_pic shall be in the
782  range of -231 to 231 - 1, inclusive.
783  */
784  [[maybe_unused]] int offset_for_non_ref_pic = br.get_se_golomb();
785 
786  /*
787  offset_for_top_to_bottom_field is used to calculate the
788  picture order count of a bottom field as specified in
789  subclause 8.2.1. The value of offset_for_top_to_bottom_field
790  shall be in the range of -231 to 231 - 1, inclusive.
791  */
792  [[maybe_unused]] int offset_for_top_to_bottom_field = br.get_se_golomb();
793 
794  /*
795  offset_for_ref_frame[ i ] is an element of a list of
796  m_numRefFrames_in_pic_order_cnt_cycle values used in the
797  decoding process for picture order count as specified in
798  subclause 8.2.1. The value of offset_for_ref_frame[ i ]
799  shall be in the range of -231 to 231 - 1, inclusive.
800  */
801  uint tmp = br.get_ue_golomb();
802  for (uint idx = 0; idx < tmp; ++idx)
803  br.get_se_golomb(); // offset_for_ref_frame[i]
804  }
805 
806  /*
807  m_numRefFrames specifies the maximum number of short-term and
808  long-term reference frames, complementary reference field pairs,
809  and non-paired reference fields that may be used by the decoding
810  process for inter prediction of any picture in the
811  sequence. m_numRefFrames also determines the size of the sliding
812  window operation as specified in subclause 8.2.5.3. The value of
813  m_numRefFrames shall be in the range of 0 to MaxDpbSize (as
814  specified in subclause A.3.1 or A.3.2), inclusive.
815  */
817  /*
818  gaps_in_frame_num_value_allowed_flag specifies the allowed
819  values of frame_num as specified in subclause 7.4.3 and the
820  decoding process in case of an inferred gap between values of
821  frame_num as specified in subclause 8.2.5.2.
822  */
823  /* bool gaps_in_frame_num_allowed_flag = */ br.get_bits(1);
824 
825  /*
826  pic_width_in_mbs_minus1 plus 1 specifies the width of each
827  decoded picture in units of macroblocks. 16 macroblocks in a row
828  */
829  m_picWidth = (br.get_ue_golomb() + 1) * 16;
830  /*
831  pic_height_in_map_units_minus1 plus 1 specifies the height in
832  slice group map units of a decoded frame or field. 16
833  macroblocks in each column.
834  */
835  m_picHeight = (br.get_ue_golomb() + 1) * 16;
836 
837  /*
838  m_frameMbsOnlyFlag equal to 0 specifies that coded pictures of
839  the coded video sequence may either be coded fields or coded
840  frames. m_frameMbsOnlyFlag equal to 1 specifies that every
841  coded picture of the coded video sequence is a coded frame
842  containing only frame macroblocks.
843  */
845  if (!m_frameMbsOnlyFlag)
846  {
847  m_picHeight *= 2;
848 
849  /*
850  mb_adaptive_frame_field_flag equal to 0 specifies no
851  switching between frame and field macroblocks within a
852  picture. mb_adaptive_frame_field_flag equal to 1 specifies
853  the possible use of switching between frame and field
854  macroblocks within frames. When mb_adaptive_frame_field_flag
855  is not present, it shall be inferred to be equal to 0.
856  */
857  br.get_bits(1); // mb_adaptive_frame_field_flag
858  }
859 
860  br.get_bits(1); // direct_8x8_inference_flag
861 
862  /*
863  frame_cropping_flag equal to 1 specifies that the frame cropping
864  offset parameters follow next in the sequence parameter
865  set. frame_cropping_flag equal to 0 specifies that the frame
866  cropping offset parameters are not present.
867  */
868  if (br.get_bits(1)) // frame_cropping_flag
869  {
874  }
875 
876  /*
877  vui_parameters_present_flag equal to 1 specifies that the
878  vui_parameters( ) syntax structure as specified in Annex E is
879  present. vui_parameters_present_flag equal to 0 specifies that
880  the vui_parameters( ) syntax structure as specified in Annex E
881  is not present.
882  */
883  if (br.get_bits(1)) // vui_parameters_present_flag
884  vui_parameters(br, false);
885 }
886 
887 void AVCParser::parse_SPS(uint8_t *sps, uint32_t sps_size,
888  bool& interlaced, int32_t& max_ref_frames)
889 {
890  auto br = BitReader(sps, sps_size);
891  decode_SPS(br);
892  interlaced = (m_frameMbsOnlyFlag == 0);
893  max_ref_frames = m_numRefFrames;
894 }
895 
897 {
898  /*
899  m_picParameterSetId identifies the picture parameter set that
900  is referred to in the slice header. The value of
901  m_picParameterSetId shall be in the range of 0 to 255,
902  inclusive.
903  */
905 
906  /*
907  m_seqParameterSetId refers to the active sequence parameter
908  set. The value of m_seqParameterSetId shall be in the range of
909  0 to 31, inclusive.
910  */
912  br.get_bits(1); // entropy_coding_mode_flag;
913 
914  /*
915  m_picOrderPresentFlag equal to 1 specifies that the picture
916  order count related syntax elements are present in the slice
917  headers as specified in subclause 7.3.3. m_picOrderPresentFlag
918  equal to 0 specifies that the picture order count related syntax
919  elements are not present in the slice headers.
920  */
922 
923 #if 0 // Rest not currently needed, and requires <math.h>
924  uint num_slice_groups = br.get_ue_golomb() + 1;
925  if (num_slice_groups > 1) // num_slice_groups (minus 1)
926  {
927  uint idx;
928 
929  switch (br.get_ue_golomb()) // slice_group_map_type
930  {
931  case 0:
932  for (idx = 0; idx < num_slice_groups; ++idx)
933  br.get_ue_golomb(); // run_length_minus1[idx]
934  break;
935  case 1:
936  for (idx = 0; idx < num_slice_groups; ++idx)
937  {
938  br.get_ue_golomb(); // top_left[idx]
939  br.get_ue_golomb(); // bottom_right[idx]
940  }
941  break;
942  case 3:
943  case 4:
944  case 5:
945  br.get_bits(1); // slice_group_change_direction_flag
946  br.get_ue_golomb(); // slice_group_change_rate_minus1
947  break;
948  case 6:
949  uint pic_size_in_map_units = br.get_ue_golomb() + 1;
950  // TODO bit hacks: combine https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
951  // with https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn
952  // to replace floating point below
953  uint num_bits = (int)ceil(log2(num_slice_groups));
954  for (idx = 0; idx < pic_size_in_map_units; ++idx)
955  {
956  br.get_bits(num_bits); //slice_group_id[idx]
957  }
958  }
959  }
960 
961  br.get_ue_golomb(); // num_ref_idx_10_active_minus1
962  br.get_ue_golomb(); // num_ref_idx_11_active_minus1
963  br.get_bits(1); // weighted_pred_flag;
964  br.get_bits(2); // weighted_bipred_idc
965  br.get_se_golomb(); // pic_init_qp_minus26
966  br.get_se_golomb(); // pic_init_qs_minus26
967  br.get_se_golomb(); // chroma_qp_index_offset
968  br.get_bits(1); // deblocking_filter_control_present_flag
969  br.get_bits(1); // constrained_intra_pref_flag
971 #endif
972 }
973 
975 {
976  int recovery_frame_cnt = -1;
977 #if 0
978  bool exact_match_flag = false;
979  bool broken_link_flag = false;
980  int changing_group_slice_idc = -1;
981 #endif
982 
983  int type = 0;
984  int size = 0;
985 
986  /* A message requires at least 2 bytes, and then
987  * there's the stop bit plus alignment, so there
988  * can be no message in less than 24 bits */
989  while (br.get_bits_left() >= 24)
990  {
991  do {
992  type += br.show_bits(8);
993  } while (br.get_bits(8) == 0xFF);
994 
995  do {
996  size += br.show_bits(8);
997  } while (br.get_bits(8) == 0xFF);
998 
999  switch (type)
1000  {
1002  recovery_frame_cnt = br.get_ue_golomb();
1003 #if 0
1004  exact_match_flag = (br.get_bits(1) != 0U);
1005  broken_link_flag = (br.get_bits(1) != 0U);
1006  changing_group_slice_idc = br.get_bits(2);
1007 #endif
1008  m_auContainsKeyframeMessage = (recovery_frame_cnt == 0);
1009  if ((size - 12) > 0)
1010  br.skip_bits((size - 12) * 8);
1011  return;
1012 
1013  default:
1014  br.skip_bits(size * 8);
1015  break;
1016  }
1017  }
1018 }
1019 
1020 // Following the lead of libavcodec, ignore the left cropping.
1022 {
1023  uint ChromaArrayType = m_separateColourPlaneFlag ? 0 : m_chromaFormatIdc;
1024  uint CropUnitX = 1;
1025  uint SubWidthC = m_chromaFormatIdc == 3 ? 1 : 2;
1026  if (ChromaArrayType != 0)
1027  CropUnitX = SubWidthC;
1028  uint crop = CropUnitX * m_frameCropRightOffset;
1029  return m_picWidth - crop;
1030 }
1031 
1032 // Following the lead of libavcodec, ignore the top cropping.
1034 {
1035  uint ChromaArrayType = m_separateColourPlaneFlag ? 0 : m_chromaFormatIdc;
1036  uint CropUnitY = 2 - m_frameMbsOnlyFlag;
1037  uint SubHeightC = m_chromaFormatIdc <= 1 ? 2 : 1;
1038  if (ChromaArrayType != 0)
1039  CropUnitY *= SubHeightC;
1040  uint crop = CropUnitY * m_frameCropBottomOffset;
1041  return m_picHeight - crop;
1042 }
1043 
1045 {
1046  if (m_bottomFieldFlag == -1)
1047  return FRAME;
1049 }
1050 
1051 /* H.264
1052 
1053  num_units_in_tick is the number of time units of a clock operating
1054  at the frequency time_scale Hz that corresponds to one increment
1055  (called a clock tick) of a clock tick counter. num_units_in_tick
1056  shall be greater than 0. A clock tick is the minimum interval of
1057  time that can be represented in the coded data. For example, when
1058  the frame rate of a video signal is 30 000 ÷ 1001 Hz, time_scale
1059  may be equal to 60 000 and num_units_in_tick may be equal to
1060  1001. See Equation C-1.
1061 */
1062 
1063 double AVCParser::frameRate(void) const
1064 {
1065  uint64_t num = 500 * (uint64_t)m_timeScale; /* 1000 * 0.5 */
1066  double fps = ( m_unitsInTick != 0 ? num / (double)m_unitsInTick : 0 ) / 1000;
1067 
1068  return fps;
1069 }
1070 
1072 {
1073  if (m_unitsInTick == 0)
1074  result = FrameRate(0);
1075  else if (m_timeScale & 0x1)
1076  result = FrameRate(m_timeScale, m_unitsInTick * 2);
1077  else
1078  result = FrameRate(m_timeScale / 2, m_unitsInTick);
1079 }
AVCParser::getFrameRate
void getFrameRate(FrameRate &result) const override
Definition: AVCParser.cpp:1071
bytereader.h
H2645Parser::FRAME
@ FRAME
Definition: H2645Parser.h:44
H2645Parser::m_seenSPS
bool m_seenSPS
Definition: H2645Parser.h:151
H2645Parser::m_frameCropRightOffset
uint m_frameCropRightOffset
Definition: H2645Parser.h:132
H2645Parser::m_frameStartOffset
uint64_t m_frameStartOffset
Definition: H2645Parser.h:116
AVCParser::PPS
@ PPS
Definition: AVCParser.h:82
H2645Parser::fillRBSP
bool fillRBSP(const uint8_t *byteP, uint32_t byte_count, bool found_start_code)
Definition: H2645Parser.cpp:134
H2645Parser::m_separateColourPlaneFlag
bool m_separateColourPlaneFlag
Definition: H2645Parser.h:152
AVCParser::m_sliceType
uint m_sliceType
Definition: AVCParser.h:178
AVCParser::END_SEQUENCE
@ END_SEQUENCE
Definition: AVCParser.h:84
AVCParser::m_prevPicOrderCntType
uint8_t m_prevPicOrderCntType
Definition: AVCParser.h:194
dtvrecorder.h
H2645Parser::m_keyframeStartOffset
uint64_t m_keyframeStartOffset
Definition: H2645Parser.h:117
AVCParser::m_prevIdrPicId
uint m_prevIdrPicId
Definition: AVCParser.h:175
AVCParser::m_prevNALRefIdc
uint8_t m_prevNALRefIdc
Definition: AVCParser.h:193
AVCParser::m_deltaPicOrderCnt
std::array< int, 2 > m_deltaPicOrderCnt
Definition: AVCParser.h:161
AVCParser::parse_SPS
void parse_SPS(uint8_t *sps, uint32_t sps_size, bool &interlaced, int32_t &max_ref_frames)
Definition: AVCParser.cpp:887
AVCParser::NAL_type_str
QString NAL_type_str(int8_t type) override
Definition: AVCParser.cpp:130
AVCParser::AU_DELIMITER
@ AU_DELIMITER
Definition: AVCParser.h:83
H2645Parser::m_unitsInTick
uint32_t m_unitsInTick
Definition: H2645Parser.h:126
H2645Parser::field_type
field_type
Definition: H2645Parser.h:43
H2645Parser::m_picWidth
uint m_picWidth
Definition: H2645Parser.h:135
H2645Parser::m_pktOffset
uint64_t m_pktOffset
Definition: H2645Parser.h:118
H2645Parser::FIELD_BOTTOM
@ FIELD_BOTTOM
Definition: H2645Parser.h:46
AVCParser::m_deltaPicOrderAlwaysZeroFlag
uint8_t m_deltaPicOrderAlwaysZeroFlag
Definition: AVCParser.h:190
H2645Parser::m_frameCropLeftOffset
uint m_frameCropLeftOffset
Definition: H2645Parser.h:131
H2645Parser::Reset
virtual void Reset(void)
Definition: H2645Parser.cpp:93
BitReader::get_bits
uint32_t get_bits(unsigned n)
Read 0-32 bits.
Definition: bitreader.h:86
H2645Parser::FIELD_TOP
@ FIELD_TOP
Definition: H2645Parser.h:45
AVCParser::m_prevPicOrderCntLsb
int m_prevPicOrderCntLsb
Definition: AVCParser.h:168
AVCParser::m_frameNum
int m_frameNum
Definition: AVCParser.h:162
AVCParser::m_iIsKeyframe
bool m_iIsKeyframe
Definition: AVCParser.h:197
H2645Parser::MAX_SLICE_HEADER_SIZE
static constexpr uint16_t MAX_SLICE_HEADER_SIZE
Definition: H2645Parser.h:41
AVCParser::SLICE_DPB
@ SLICE_DPB
Definition: AVCParser.h:77
x3
static int x3
Definition: mythsocket.cpp:52
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
AVCParser::m_nalRefIdc
uint8_t m_nalRefIdc
Definition: AVCParser.h:191
AVCParser::m_redundantPicCnt
uint m_redundantPicCnt
Definition: AVCParser.h:176
AVCParser::m_prevPicParameterSetId
int m_prevPicParameterSetId
Definition: AVCParser.h:169
AVCParser::m_prevBottomFieldFlag
int8_t m_prevBottomFieldFlag
Definition: AVCParser.h:185
AVCParser::SLICE_DPA
@ SLICE_DPA
Definition: AVCParser.h:76
AVCParser::SEI
@ SEI
Definition: AVCParser.h:80
BitReader::get_ue_golomb_31
int get_ue_golomb_31()
read unsigned exp golomb code, constraint to a max of 31.
Definition: bitreader.h:136
AVCParser::SLICE_DPC
@ SLICE_DPC
Definition: AVCParser.h:78
AVCParser::m_prevDeltaPicOrderCnt
std::array< int, 2 > m_prevDeltaPicOrderCnt
Definition: AVCParser.h:166
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
AVCParser::m_prevDeltaPicOrderCntBottom
int m_prevDeltaPicOrderCntBottom
Definition: AVCParser.h:165
bitreader.h
H2645Parser::vui_parameters
void vui_parameters(BitReader &br, bool hevc)
Definition: H2645Parser.cpp:215
AVCParser::m_log2MaxFrameNum
uint m_log2MaxFrameNum
Definition: AVCParser.h:172
BitReader
Definition: bitreader.h:38
BitReader::get_se_golomb
int get_se_golomb()
read signed exp golomb code.
Definition: bitreader.h:144
mythlogging.h
AVCParser::m_picOrderCntLsb
int m_picOrderCntLsb
Definition: AVCParser.h:163
AVCParser::pictureHeightCropped
uint pictureHeightCropped(void) const override
Definition: AVCParser.cpp:1033
AVCParser::decode_Header
bool decode_Header(BitReader &br)
Definition: AVCParser.cpp:493
H2645Parser::m_rbspIndex
uint32_t m_rbspIndex
Definition: H2645Parser.h:123
AVCParser::decode_PPS
void decode_PPS(BitReader &br)
Definition: AVCParser.cpp:896
AVCParser::processRBSP
void processRBSP(bool rbsp_complete)
Definition: AVCParser.cpp:414
AVCParser::m_fieldPicFlag
int8_t m_fieldPicFlag
Definition: AVCParser.h:181
H2645Parser::m_frameCropBottomOffset
uint m_frameCropBottomOffset
Definition: H2645Parser.h:130
AVCParser::new_AU
bool new_AU(void)
Definition: AVCParser.cpp:166
AVCParser::SLICE_IDR
@ SLICE_IDR
Definition: AVCParser.h:79
x1
static int x1
Definition: mythsocket.cpp:50
AVCParser::m_picOrderPresentFlag
int8_t m_picOrderPresentFlag
Definition: AVCParser.h:184
AVCParser::getFieldType
field_type getFieldType(void) const override
Definition: AVCParser.cpp:1044
AVCParser::m_auContainsKeyframeMessage
bool m_auContainsKeyframeMessage
Definition: AVCParser.h:196
FrameRate
Definition: recorderbase.h:37
AVCParser::m_deltaPicOrderCntBottom
int m_deltaPicOrderCntBottom
Definition: AVCParser.h:160
H2645Parser::m_rbspBuffer
uint8_t * m_rbspBuffer
Definition: H2645Parser.h:139
H2645Parser::m_auOffset
uint64_t m_auOffset
Definition: H2645Parser.h:115
H2645Parser::m_auPending
bool m_auPending
Definition: H2645Parser.h:144
H2645Parser::m_onKeyFrame
bool m_onKeyFrame
Definition: H2645Parser.h:150
AVCParser::SLICE
@ SLICE
Definition: AVCParser.h:75
uint
unsigned int uint
Definition: compat.h:81
H2645Parser::m_spsOffset
uint64_t m_spsOffset
Definition: H2645Parser.h:119
AVCParser::m_redundantPicCntPresentFlag
int8_t m_redundantPicCntPresentFlag
Definition: AVCParser.h:188
AVCParser::m_seqParameterSetId
uint m_seqParameterSetId
Definition: AVCParser.h:177
AVCParser::decode_SPS
void decode_SPS(BitReader &br)
Definition: AVCParser.cpp:689
AVCParser::m_nalUnitType
int8_t m_nalUnitType
Definition: AVCParser.h:183
strings.h
AVCParser::frameRate
double frameRate(void) const
Definition: AVCParser.cpp:1063
H2645Parser::m_stateChanged
bool m_stateChanged
Definition: H2645Parser.h:153
AVCParser.h
ByteReader::start_code_is_valid
bool start_code_is_valid(uint32_t start_code)
Test whether a start code found by find_start_code() is valid.
Definition: bytereader.h:54
H2645Parser::m_timeScale
uint32_t m_timeScale
Definition: H2645Parser.h:125
H2645Parser::m_onFrame
bool m_onFrame
Definition: H2645Parser.h:149
H2645Parser::m_isKeyframe
bool m_isKeyframe
Definition: H2645Parser.h:147
H2645Parser::m_haveUnfinishedNAL
bool m_haveUnfinishedNAL
Definition: H2645Parser.h:146
H2645Parser::m_frameCropTopOffset
uint m_frameCropTopOffset
Definition: H2645Parser.h:133
AVCParser::set_AU_pending
void set_AU_pending(void)
Definition: AVCParser.h:139
H2645Parser::m_syncAccumulator
uint32_t m_syncAccumulator
Definition: H2645Parser.h:124
musicbrainzngs.compat.bytes
bytes
Definition: compat.py:49
AVCParser::m_bottomFieldFlag
int8_t m_bottomFieldFlag
Definition: AVCParser.h:180
AVCParser::SEI_TYPE_RECOVERY_POINT
@ SEI_TYPE_RECOVERY_POINT
Definition: AVCParser.h:79
AVCParser::FILLER_DATA
@ FILLER_DATA
Definition: AVCParser.h:86
H2645Parser::m_chromaFormatIdc
int8_t m_chromaFormatIdc
Definition: H2645Parser.h:142
AVCParser::m_prevNalUnitType
int8_t m_prevNalUnitType
Definition: AVCParser.h:187
H2645Parser::SLICE_UNDEF
@ SLICE_UNDEF
Definition: H2645Parser.h:99
AVCParser::m_picParameterSetId
int m_picParameterSetId
Definition: AVCParser.h:164
H2645Parser::m_picHeight
uint m_picHeight
Definition: H2645Parser.h:134
AVCParser::NALisSlice
static bool NALisSlice(int8_t nal_type)
Definition: AVCParser.h:111
AVCParser::decode_SEI
void decode_SEI(BitReader &br)
Definition: AVCParser.cpp:974
AVCParser::pictureWidthCropped
uint pictureWidthCropped(void) const override
Definition: AVCParser.cpp:1021
H2645Parser::UNKNOWN
@ UNKNOWN
Definition: H2645Parser.h:85
AVCParser::SPS
@ SPS
Definition: AVCParser.h:81
BitReader::get_bits_left
int64_t get_bits_left()
Definition: bitreader.h:156
BitReader::show_bits
uint32_t show_bits(unsigned n)
Definition: bitreader.h:66
AVCParser::SPS_EXT
@ SPS_EXT
Definition: AVCParser.h:87
AVCParser::m_prevFrameNum
int m_prevFrameNum
Definition: AVCParser.h:167
BitReader::skip_bits
void skip_bits(unsigned n)
Definition: bitreader.h:48
AVCParser::m_picOrderCntType
uint8_t m_picOrderCntType
Definition: AVCParser.h:192
AVCParser::m_idrPicId
uint m_idrPicId
Definition: AVCParser.h:171
H2645Parser::resetRBSP
void resetRBSP(void)
Definition: H2645Parser.cpp:127
AVCParser::m_prevFieldPicFlag
int8_t m_prevFieldPicFlag
Definition: AVCParser.h:186
AVCParser::m_log2MaxPicOrderCntLsb
uint m_log2MaxPicOrderCntLsb
Definition: AVCParser.h:173
BitReader::get_ue_golomb
int get_ue_golomb()
Read an unsigned Exp-Golomb code in the range 0 to 8190 (2^13 - 2).
Definition: bitreader.h:105
AVCParser::Reset
void Reset(void) override
Definition: AVCParser.cpp:88
AVCParser::addBytes
uint32_t addBytes(const uint8_t *bytes, uint32_t byte_count, uint64_t stream_offset) override
Definition: AVCParser.cpp:285
AVCParser::m_numRefFrames
uint m_numRefFrames
Definition: AVCParser.h:174
ByteReader::find_start_code_truncated
const MTV_PUBLIC uint8_t * find_start_code_truncated(const uint8_t *p, const uint8_t *end, uint32_t *start_code)
By preserving the start_code value between subsequent calls, the caller can detect start codes across...
Definition: bytereader.cpp:81
AVCParser::m_frameMbsOnlyFlag
int8_t m_frameMbsOnlyFlag
Definition: AVCParser.h:182
AVCParser::END_STREAM
@ END_STREAM
Definition: AVCParser.h:85
AVCParser::isKeySlice
static bool isKeySlice(uint slice_type)
Definition: AVCParser.h:103