nalucommon.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*!
  2. **************************************************************************************
  3. * \file
  4. * nalucommon.h
  5. * \brief
  6. * NALU handling common to encoder and decoder
  7. * \author
  8. * Main contributors (see contributors.h for copyright, address and affiliation details)
  9. * - Stephan Wenger <[email protected]>
  10. * - Karsten Suehring <[email protected]>
  11. ***************************************************************************************
  12. */
  13. #ifndef _NALUCOMMON_H_
  14. #define _NALUCOMMON_H_
  15. #define MAXRBSPSIZE 64000
  16. #define MAXNALUSIZE 64000
  17. //! values for nal_unit_type
  18. typedef enum {
  19. NALU_TYPE_SLICE = 1,
  20. NALU_TYPE_DPA = 2,
  21. NALU_TYPE_DPB = 3,
  22. NALU_TYPE_DPC = 4,
  23. NALU_TYPE_IDR = 5,
  24. NALU_TYPE_SEI = 6,
  25. NALU_TYPE_SPS = 7,
  26. NALU_TYPE_PPS = 8,
  27. NALU_TYPE_AUD = 9,
  28. NALU_TYPE_EOSEQ = 10,
  29. NALU_TYPE_EOSTREAM = 11,
  30. NALU_TYPE_FILL = 12
  31. } NaluType;
  32. //! values for nal_ref_idc
  33. typedef enum {
  34. NALU_PRIORITY_HIGHEST = 3,
  35. NALU_PRIORITY_HIGH = 2,
  36. NALU_PRIORITY_LOW = 1,
  37. NALU_PRIORITY_DISPOSABLE = 0
  38. } NalRefIdc;
  39. //! NAL unit structure
  40. typedef struct nalu_t
  41. {
  42. int startcodeprefix_len; //!< 4 for parameter sets and first slice in picture, 3 for everything else (suggested)
  43. unsigned len; //!< Length of the NAL unit (Excluding the start code, which does not belong to the NALU)
  44. unsigned max_size; //!< NAL Unit Buffer size
  45. int forbidden_bit; //!< should be always FALSE
  46. NaluType nal_unit_type; //!< NALU_TYPE_xxxx
  47. NalRefIdc nal_reference_idc; //!< NALU_PRIORITY_xxxx
  48. byte *buf; //!< contains the first byte followed by the EBSP
  49. uint16 lost_packets; //!< true, if packet loss is detected
  50. } NALU_t;
  51. //! allocate one NAL Unit
  52. extern NALU_t *AllocNALU(int);
  53. //! free one NAL Unit
  54. extern void FreeNALU(NALU_t *n);
  55. #endif