JLChen
2020-12-10 a8c5f79b0d93adfa7f23601dd0fee30edc14f0d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
 * @file rem_h264.h Interface to H.264 header parser
 *
 * Copyright (C) 2010 Creytiv.com
 */
 
 
/** NAL unit types */
enum h264_nalu {
    H264_NALU_SLICE        = 1,
    H264_NALU_DPA          = 2,
    H264_NALU_DPB          = 3,
    H264_NALU_DPC          = 4,
    H264_NALU_IDR_SLICE    = 5,
    H264_NALU_SEI          = 6,
    H264_NALU_SPS          = 7,
    H264_NALU_PPS          = 8,
    H264_NALU_AUD          = 9,
    H264_NALU_END_SEQUENCE = 10,
    H264_NALU_END_STREAM   = 11,
    H264_NALU_FILLER_DATA  = 12,
    H264_NALU_SPS_EXT      = 13,
    H264_NALU_AUX_SLICE    = 19,
 
    H264_NALU_STAP_A       = 24,
    H264_NALU_STAP_B       = 25,
    H264_NALU_MTAP16       = 26,
    H264_NALU_MTAP24       = 27,
    H264_NALU_FU_A         = 28,
    H264_NALU_FU_B         = 29,
};
 
 
/**
 * H.264 NAL Header
 */
struct h264_nal_header {
    unsigned f:1;      /**< Forbidden zero bit (must be 0) */
    unsigned nri:2;    /**< nal_ref_idc                    */
    unsigned type:5;   /**< NAL unit type                  */
};
 
 
int h264_nal_header_encode(struct mbuf *mb, const struct h264_nal_header *hdr);
int h264_nal_header_decode(struct h264_nal_header *hdr, struct mbuf *mb);
const char *h264_nal_unit_name(enum h264_nalu nal_type);