nalucommon.h
上传用户:hjq518
上传日期:2021-12-09
资源大小:5084k
文件大小:2k
源码类别:

Audio

开发平台:

Visual C++

  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        <stewe@cs.tu-berlin.de>
  10.  *      - Karsten Suehring      <suehring@hhi.de>
  11.  ***************************************************************************************
  12.  */
  13. #ifndef _NALUCOMMON_H_
  14. #define _NALUCOMMON_H_
  15. #define MAXRBSPSIZE 64000
  16. //! values for nal_unit_type
  17. typedef enum {
  18.  NALU_TYPE_SLICE    = 1,
  19.  NALU_TYPE_DPA      = 2,
  20.  NALU_TYPE_DPB      = 3,
  21.  NALU_TYPE_DPC      = 4,
  22.  NALU_TYPE_IDR      = 5,
  23.  NALU_TYPE_SEI      = 6,
  24.  NALU_TYPE_SPS      = 7,
  25.  NALU_TYPE_PPS      = 8,
  26.  NALU_TYPE_AUD      = 9,
  27.  NALU_TYPE_EOSEQ    = 10,
  28.  NALU_TYPE_EOSTREAM = 11,
  29.  NALU_TYPE_FILL     = 12
  30. } NaluType;
  31. //! values for nal_ref_idc
  32. typedef enum {
  33.  NALU_PRIORITY_HIGHEST     = 3,
  34.  NALU_PRIORITY_HIGH        = 2,
  35.  NALU_PRIORITY_LOW         = 1,
  36.  NALU_PRIORITY_DISPOSABLE  = 0
  37. } NalRefIdc;
  38. //! NAL unit structure
  39. typedef struct
  40. {
  41.   int       startcodeprefix_len;   //!< 4 for parameter sets and first slice in picture, 3 for everything else (suggested)
  42.   unsigned  len;                   //!< Length of the NAL unit (Excluding the start code, which does not belong to the NALU)
  43.   unsigned  max_size;              //!< NAL Unit Buffer size
  44.   NaluType  nal_unit_type;         //!< NALU_TYPE_xxxx
  45.   NalRefIdc nal_reference_idc;     //!< NALU_PRIORITY_xxxx
  46.   int       forbidden_bit;         //!< should be always FALSE
  47.   byte     *buf;                   //!< contains the first byte followed by the EBSP
  48. } NALU_t;
  49. //! allocate one NAL Unit
  50. NALU_t *AllocNALU(int);
  51. //! free one NAL Unit
  52. void FreeNALU(NALU_t *n);
  53. #endif