FFmpeg
libavcodec
h264.h
Go to the documentation of this file.
1
/*
2
* This file is part of FFmpeg.
3
*
4
* FFmpeg is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* FFmpeg is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with FFmpeg; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
19
/**
20
* @file
21
* H.264 common definitions
22
*/
23
24
#ifndef AVCODEC_H264_H
25
#define AVCODEC_H264_H
26
27
#define QP_MAX_NUM (51 + 6*6) // The maximum supported qp
28
29
/*
30
* Table 7-1 – NAL unit type codes, syntax element categories, and NAL unit type classes in
31
* T-REC-H.264-201704
32
*/
33
enum
{
34
H264_NAL_UNSPECIFIED
= 0,
35
H264_NAL_SLICE
= 1,
36
H264_NAL_DPA
= 2,
37
H264_NAL_DPB
= 3,
38
H264_NAL_DPC
= 4,
39
H264_NAL_IDR_SLICE
= 5,
40
H264_NAL_SEI
= 6,
41
H264_NAL_SPS
= 7,
42
H264_NAL_PPS
= 8,
43
H264_NAL_AUD
= 9,
44
H264_NAL_END_SEQUENCE
= 10,
45
H264_NAL_END_STREAM
= 11,
46
H264_NAL_FILLER_DATA
= 12,
47
H264_NAL_SPS_EXT
= 13,
48
H264_NAL_PREFIX
= 14,
49
H264_NAL_SUB_SPS
= 15,
50
H264_NAL_DPS
= 16,
51
H264_NAL_RESERVED17
= 17,
52
H264_NAL_RESERVED18
= 18,
53
H264_NAL_AUXILIARY_SLICE
= 19,
54
H264_NAL_EXTEN_SLICE
= 20,
55
H264_NAL_DEPTH_EXTEN_SLICE
= 21,
56
H264_NAL_RESERVED22
= 22,
57
H264_NAL_RESERVED23
= 23,
58
H264_NAL_UNSPECIFIED24
= 24,
59
H264_NAL_UNSPECIFIED25
= 25,
60
H264_NAL_UNSPECIFIED26
= 26,
61
H264_NAL_UNSPECIFIED27
= 27,
62
H264_NAL_UNSPECIFIED28
= 28,
63
H264_NAL_UNSPECIFIED29
= 29,
64
H264_NAL_UNSPECIFIED30
= 30,
65
H264_NAL_UNSPECIFIED31
= 31,
66
};
67
68
69
enum
{
70
// 7.4.2.1.1: seq_parameter_set_id is in [0, 31].
71
H264_MAX_SPS_COUNT
= 32,
72
// 7.4.2.2: pic_parameter_set_id is in [0, 255].
73
H264_MAX_PPS_COUNT
= 256,
74
75
// A.3: MaxDpbFrames is bounded above by 16.
76
H264_MAX_DPB_FRAMES
= 16,
77
// 7.4.2.1.1: max_num_ref_frames is in [0, MaxDpbFrames], and
78
// each reference frame can have two fields.
79
H264_MAX_REFS
= 2 *
H264_MAX_DPB_FRAMES
,
80
81
// 7.4.3.1: modification_of_pic_nums_idc is not equal to 3 at most
82
// num_ref_idx_lN_active_minus1 + 1 times (that is, once for each
83
// possible reference), then equal to 3 once.
84
H264_MAX_RPLM_COUNT
=
H264_MAX_REFS
+ 1,
85
86
// 7.4.3.3: in the worst case, we begin with a full short-term
87
// reference picture list. Each picture in turn is moved to the
88
// long-term list (type 3) and then discarded from there (type 2).
89
// Then, we set the length of the long-term list (type 4), mark
90
// the current picture as long-term (type 6) and terminate the
91
// process (type 0).
92
H264_MAX_MMCO_COUNT
=
H264_MAX_REFS
* 2 + 3,
93
94
// A.2.1, A.2.3: profiles supporting FMO constrain
95
// num_slice_groups_minus1 to be in [0, 7].
96
H264_MAX_SLICE_GROUPS
= 8,
97
98
// E.2.2: cpb_cnt_minus1 is in [0, 31].
99
H264_MAX_CPB_CNT
= 32,
100
101
// A.3: in table A-1 the highest level allows a MaxFS of 139264.
102
H264_MAX_MB_PIC_SIZE
= 139264,
103
// A.3.1, A.3.2: PicWidthInMbs and PicHeightInMbs are constrained
104
// to be not greater than sqrt(MaxFS * 8). Hence height/width are
105
// bounded above by sqrt(139264 * 8) = 1055.5 macroblocks.
106
H264_MAX_MB_WIDTH
= 1055,
107
H264_MAX_MB_HEIGHT
= 1055,
108
H264_MAX_WIDTH
=
H264_MAX_MB_WIDTH
* 16,
109
H264_MAX_HEIGHT
=
H264_MAX_MB_HEIGHT
* 16,
110
};
111
112
113
#endif
/* AVCODEC_H264_H */
H264_NAL_PPS
@ H264_NAL_PPS
Definition:
h264.h:42
H264_NAL_FILLER_DATA
@ H264_NAL_FILLER_DATA
Definition:
h264.h:46
H264_NAL_SLICE
@ H264_NAL_SLICE
Definition:
h264.h:35
H264_NAL_UNSPECIFIED27
@ H264_NAL_UNSPECIFIED27
Definition:
h264.h:61
H264_NAL_DEPTH_EXTEN_SLICE
@ H264_NAL_DEPTH_EXTEN_SLICE
Definition:
h264.h:55
H264_NAL_PREFIX
@ H264_NAL_PREFIX
Definition:
h264.h:48
H264_MAX_HEIGHT
@ H264_MAX_HEIGHT
Definition:
h264.h:109
H264_NAL_UNSPECIFIED25
@ H264_NAL_UNSPECIFIED25
Definition:
h264.h:59
H264_NAL_RESERVED17
@ H264_NAL_RESERVED17
Definition:
h264.h:51
H264_NAL_UNSPECIFIED31
@ H264_NAL_UNSPECIFIED31
Definition:
h264.h:65
H264_MAX_RPLM_COUNT
@ H264_MAX_RPLM_COUNT
Definition:
h264.h:84
H264_NAL_AUXILIARY_SLICE
@ H264_NAL_AUXILIARY_SLICE
Definition:
h264.h:53
H264_NAL_DPA
@ H264_NAL_DPA
Definition:
h264.h:36
H264_NAL_UNSPECIFIED24
@ H264_NAL_UNSPECIFIED24
Definition:
h264.h:58
H264_NAL_EXTEN_SLICE
@ H264_NAL_EXTEN_SLICE
Definition:
h264.h:54
H264_NAL_SPS
@ H264_NAL_SPS
Definition:
h264.h:41
H264_NAL_UNSPECIFIED29
@ H264_NAL_UNSPECIFIED29
Definition:
h264.h:63
H264_MAX_MMCO_COUNT
@ H264_MAX_MMCO_COUNT
Definition:
h264.h:92
H264_NAL_DPS
@ H264_NAL_DPS
Definition:
h264.h:50
H264_MAX_SPS_COUNT
@ H264_MAX_SPS_COUNT
Definition:
h264.h:71
H264_NAL_END_SEQUENCE
@ H264_NAL_END_SEQUENCE
Definition:
h264.h:44
H264_NAL_END_STREAM
@ H264_NAL_END_STREAM
Definition:
h264.h:45
H264_NAL_DPB
@ H264_NAL_DPB
Definition:
h264.h:37
H264_MAX_MB_PIC_SIZE
@ H264_MAX_MB_PIC_SIZE
Definition:
h264.h:102
H264_MAX_WIDTH
@ H264_MAX_WIDTH
Definition:
h264.h:108
H264_NAL_RESERVED23
@ H264_NAL_RESERVED23
Definition:
h264.h:57
H264_NAL_DPC
@ H264_NAL_DPC
Definition:
h264.h:38
H264_MAX_SLICE_GROUPS
@ H264_MAX_SLICE_GROUPS
Definition:
h264.h:96
H264_MAX_REFS
@ H264_MAX_REFS
Definition:
h264.h:79
H264_MAX_PPS_COUNT
@ H264_MAX_PPS_COUNT
Definition:
h264.h:73
H264_MAX_MB_HEIGHT
@ H264_MAX_MB_HEIGHT
Definition:
h264.h:107
H264_NAL_IDR_SLICE
@ H264_NAL_IDR_SLICE
Definition:
h264.h:39
H264_NAL_UNSPECIFIED26
@ H264_NAL_UNSPECIFIED26
Definition:
h264.h:60
H264_MAX_DPB_FRAMES
@ H264_MAX_DPB_FRAMES
Definition:
h264.h:76
H264_NAL_AUD
@ H264_NAL_AUD
Definition:
h264.h:43
H264_NAL_RESERVED22
@ H264_NAL_RESERVED22
Definition:
h264.h:56
H264_MAX_MB_WIDTH
@ H264_MAX_MB_WIDTH
Definition:
h264.h:106
H264_NAL_UNSPECIFIED30
@ H264_NAL_UNSPECIFIED30
Definition:
h264.h:64
H264_NAL_SEI
@ H264_NAL_SEI
Definition:
h264.h:40
H264_NAL_UNSPECIFIED28
@ H264_NAL_UNSPECIFIED28
Definition:
h264.h:62
H264_NAL_SUB_SPS
@ H264_NAL_SUB_SPS
Definition:
h264.h:49
H264_NAL_RESERVED18
@ H264_NAL_RESERVED18
Definition:
h264.h:52
H264_NAL_UNSPECIFIED
@ H264_NAL_UNSPECIFIED
Definition:
h264.h:34
H264_NAL_SPS_EXT
@ H264_NAL_SPS_EXT
Definition:
h264.h:47
H264_MAX_CPB_CNT
@ H264_MAX_CPB_CNT
Definition:
h264.h:99
Generated on Thu Sep 26 2024 23:14:58 for FFmpeg by
1.8.17