I. sequence_parameter_set_rbsp_t
1. unsignedprofile_idc: it refers to the profile corresponding to the code stream.
1.1 baseline Profile)
The bitstream that follows the baseline profile should follow the following constraints:
A) only I and P slices exist.
B) The Nal unit stream should not have nal_unit_type values ranging from 2 to 4, including 2 and 4.
C) The frame_mbs_only_fag of the sequence parameter set (SPS) should be equal to 1
D) The weighted_pred_flag and weighted_bipred_idc of the image parameter value (PSP) should both be 0
E) The entropy_coding_mode_flag of the image parameter value (PSP) should be equal to 0.
F) The num_slice_groups_minus1 of the image parameter value (PSP) should be between 0 and 7, including 0 and 7.
G) the level corresponding to the baseline profile should be satisfied.
The profile_idc that conforms to the baseline profile is assigned 66. the decoder that meets the baseline of a certain level should be able to decode all the profile_idc streams equal to 66 or constrained_set0_flag (will be introduced later) as 1 and level_idc (in Level Section) the bitstream is less than or equal to a specified level.
1.2 Main Profile)
The code streams that comply with the main profile must comply with the following constraints:
A) only I, P, and B slices exist.
B) The Nal unit stream does not include a value whose nal_unit_type value range is within 2-4. Including 2 and 4.
C. slices in random order are not allowed.
D) num_slice_groups_minus1 of the image parameter set (PSP) should be 0 only
E) The redundant_pic_cnt_present_flag of the image parameter set (PSP) should only be 0
F) the level required by the primary profile must be reached.
The profile_idc of the code stream that conforms to the main profile should be 77. The decoder that complies with the primary profile of the specified level should be able to decode all streams whose profile_idc is 77 or whose constrained_set1_flag value is 1 and whose level_idc value is less than or equal to the specified level.
1.3 extended Profile)
The code streams that meet the extended profile must comply with the following constraints:
A) The value of direct_8x8_inference_flag in the sequence parameter set should be 1.
B) The value of entropy_coding_mode_flag in the image parameter set should be 0.
C) the value range of num_slice_groups_minus1 in the image parameter set is 0 to 7, including 0 and 7.
D) the level specified for the extended profile should be reached
The decoder that complies with the specified level-level extended profile can decode all profile_idc values of 88 or constrained_set2_flag values of 1, and level_idc is less than or equal to the specified level-level code stream.
The decoder that complies with the specified level-level extended profile can decode all profile_idc values of 66 or constrained_set0_flag values of 1, and level_idc is less than or equal to the specified level-level code stream.
2. constrained_set0_flag
When the constrained_set0_flag value is 1, it indicates that the bitstream should follow all the approx. constrained_set0_flag values of baselineprofile to 0, indicating that the bitstream does not have to follow all constraints of the baseline profile.
3. constrained_set1_flag
When the constrained_set1_flag value is 1, it indicates that the code stream should comply with all the constraints of the main profile (mainprofile.
when the constrained_set1_flag value is 0, it indicates that the bitstream does not have to comply with all the constraints of the main profile.
4. constrained_set2_flag
when the value of constrained_set2_flag is 1, it indicates that the bitstream should follow all the approx. bundles of extended profile. when the constrained_set2_flag value is 0, it indicates that the bitstream does not have to follow all constraints of the extended profile.
Note: when more than one value in constraint_set0_flag, constraint_set1_flag, or constraint_set2_flag is 1,
The code stream must meet all specified profile constraints.
5. level_idc
It refers to the level corresponding to the bitstream.
5.1 level constraints independent from Profile
Let fr be a variable like this:
A) if image N is a frame, FR is set to 1/172
B) If image N is a field, FR is set to 1/(172*2)
The specified level under any profile must meet the following constraints:
A) theoretically, the removal time of access unit N from cardiopulmonary bypass satisfies the following constraints: T (N)-T (n-1) is more efficient than Max (picsizeinmbs, maxmbps, fr) the value is large or equal. maxmbps indicates the value of image N in the Level Table. picsizeinmbs indicates the number of macro blocks in image n.
B) If image N is an output image and it is not the last output image of the code stream, the continuous output image difference obtained from DPB satisfies the following requirements: DT (n)> = max (picsizeinmbs, maxmbps, Fr), maxmbps refers to the corresponding value for image n.
Picsizeinmbs refers to the macro block of image n.
C) the sum of numbytesinnalunit variables of accessible unit 0 is less than or equal to 256 * chromaformatfactor * (picsizeinmbs + maxmbps * tr (0)-TRN (0)/mincr, maxmbps and mincr are the corresponding values of image 0 in the Level Table, and picsizeinmbs are the number of macro blocks of image 0.
D) the sum of numbytesinnalunit values of accessable Unit N is less than or equal to 256 * chromaformatfactor * maxmbps * (TR (N)-TRN (n-1)/mincr, the value of maxmbps and mincr is the value of image N in the level table.
E) picwidthinmbs * frameheightinmbs <= maxfs, Which is the value specified in the level table.
F) picwidthinmbs <= SQRT (maxfs * 8)
G) frameheightinmbs <= SQRT (maxfs * 8)
H) max_dec_frame_buffering <= maxdpbsize. maxdpbsize is equal to min (1024 * maxdpb/(picwidthinmbs * frameheightinmbs * 256 * chromaformatfactor, 16). maxdpb is the maxdpb value for 1024, max_dec_frame_buffering is also called the DPB size value.
(I) For the VCL HRD parameter value, for at least one schedselidx value, bitrate [schedselidx] <= 1000 * maxbr and cpbsize [schedselidx] <= 1000 * maxcardiopulmonary bypass. Maxbr and maxcardiopulmonary bypass correspond to the value of level-level tables for 1000 bits/s and 1000-bit units. The bitstream should be a value from 0 to cpb_cnt_minus1, including 0 and
Cpb_cnt_minus1.cpbsize [schedselidx] is also called the cardiopulmonary bypass (ECC) size value.
J) for the nal HRD parameter, bitrate [schselidx] <= 1200 * maxbr and cpbsize [schedselidx] <= 1200 * maxecc, maxbr and maxcardiopulmonary are the value of 1200 bits/s and 1200-bit unit values under the limit level. The bitstream must satisfy at least one value in schedselidx from 0 to cpb_cnt_minus1.
K) in the brightness frame sampling, the element range of the Vertical Motion Vector cannot exceed maxvmvr. The value of maxvmvr is provided in the level limit table.
L) in the brightness frame sampling unit, the range of the horizontal motion vector cannot exceed-2048 to 2047.75, including-2048 and 2047.75.
M) the number of motion vectors of two consecutive Macros in the decoded order cannot exceed maxmvsper2mb (for the last split of the front Macro Block
The first slice of the slice and the next macro block is also applicable). The maxmvsper2mb value is provided in the level limit table.
N) the bitwise value of macroblock_layer () of any macro block cannot exceed 128 + 2048 * chromaformatfactor. depending on the entropy_coding_mode_flag value, the value of macroblock_layer () is calculated in the following way. If the value of entropy_coding_mode_flag is 0, the value of macroblock_layer () is determined by
In other cases, the macroblock_layer () value of a macro block is given by read_bits (1.
5.2 profile-related level
For the baseline profile, the level constraints of the primary profile and the extended profile can be queried in the H.264 document.
6. seq_parameter_set_id
Seq_parameter_set_id specifies the sequence parameter set specified by the image parameter set. Seq_parameter_set_id value should be from 0 to 31, including 0 and 31
Note: When available, encoder should use different seq_parameter_set_id values when SPS values are different, rather than changing the values in the syntax structure of the seq_parameter_set_id parameter set of a specific value.
7. log2_max_frame_num_minus4
Log2_max_frame_num_minus4 specifies the value of the variable maxframenum, maxframenum = 2 (log2_max_frame_num_minus4 + 4)
The value of log2_max_frame_num_minus should be between 0 and 12, including 0 and 12.
8. pic_order_cnt_type
Pic_order_cnt_type specifies the method for decoding the image sequence. The pic_order_cnt_type value is 0, 1, 2.
Pic_order_cnt_type is not set to 2 when an encoding video sequence is as follows:
A) accessible units that contain non-reference frames, followed by a non-reference accessible Unit
B) Two accessible units, including one of the two fields, constitute a complementary non-reference field pair, followed by an accessible unit that includes non-reference images.
C) an accessible unit that contains a non-reference field, followed by an accessible unit that contains another non-reference image, which does not form a complementary non-reference field pair.
9. log2_max_pic_order_cnt_lsb_minus4
Log2_max_pic_order_cnt_lsb_minus4 indicates the value of the variable maxpicordercntlsb, which is the calculated value of the image sequence used during decoding:
Maxpicordercntlsb = 2 (log2_max_pic_order_cnt_lsb_minus4 + 4)
The value of log2_max_pic_order_cnt_lsb_minus4 includes 0 and 12, and the value between them.
10. delta_pic_order_always_zero_flag
When delta_pic_order_always_zero_flag is equal to 1, it indicates that delta_pic_order_cnt [0] And delta_pic_order_cnt [1] do not exist in the sequence segment header and are considered as 0. When the delta_pic_order_always_zero_flag value is equal to 0, it indicates that delta_pic_order_cnt [0] exists in the sequence slice header, while delta_pic_order_cnt [1] may exist in the sequence slice header.
11. offset_for_non_ref_pic
Offset_for_non_ref_pic is used to calculate the sequence value of an unreferenced image. The value range of offset_for_non_ref_pic is (-2) ^ (31) to 2 ^ (31)-1, including the boundary value.
12. offset_for_top_to_bottom_field
Offset_for_top_to_bottom_field is used to calculate the Sequence Value of the next image in a frame. The value range of offset_for_top_to_bottom_field is (-2) ^ (31) to (2) ^ (31)-1, including the boundary value.
13. num_ref_frames_in_pic_order_cnt_cycle
Num_ref_frames_in_pic_order_cnt_cycle is used to calculate the Image Sequence Value During decoding. Num_ref_frames_in_pic_order_cnt_cycle can be set between 0 and 255, including the boundary value.
14. offset_for_ref_frame [I]
Offset_for_ref_frame [I] is an element in the num_ref_frames_in_pic_order_cnt_cycle column, which is used in the decoding sequence values during the decoding process. The value of offset_for_ref_frame [I] is (-2) ^ 31 to (2) ^ (31)-1, including the boundary value.
15. num_ref_frames
Num_ref_frames specifies the maximum number of long-term and short-term reference frames, complementary reference field pairs, and non-paired reference fields used for inter-Frame Prediction in any sequence during decoding. Num_ref_frames also determines the operation size of the sliding window. The num_ref_frames value ranges from 0 to 16, including the boundary value.
16. gaps_in_frame_num_value_allowed_flag
The value of gaps_in_frame_num_value_allowed_flag indicates the difference between the value allowed by frame_num and the value of frame_num In the decoding process.
17. pic_width_in_mbs_minus1
Pic_width_in_mbs_minus1 and 1 indicate the width of each decoded image. The variable value of the image width in the macro block unit is:
Picwidthinmbs = pic_width_in_mbs_minus1 + 1;
For the brightness element, the value of the Image Width variable is picwidthinsamplesl = picwidthinmbs * 16;
For the color element, the value of the Image Width variable is picwidthinsamplesc = picwidthinmbs * 8.
18. pic_height_in_map_units_minus1
Pic_height_in_map_units_minus1 indicates the height of a decoder frame or a slice group in the field. The value of the picheightinmapunits variable and picsizeinmapunits:
Picheightinmapunits = pic_height_in_map_units_minus1 + 1;
Picsizeinmapunits = picwidthinmbs * picheightinmapunits
19. frame_mbs_only_flag
Frame_mbs_only_flag is equal to 0, indicating that the video sequence encoding image may be a encoding field or frame. Frame_mbs_only_flag is equal to 1, indicating that the encoding images of each video sequence contain only frame Macro Block encoding frames.
It depends on the value of frame_mbs_only_flag. pic_height_in_map_units_minus1 is defined as follows:
For example, if frame_mbs_only_flag is equal to 0, pic_height_in_map_units_minus1 indicates the field height of the macro block unit.
For example, if frame_mbs_only_flag is equal to 1, pic_height_in_map_units_minus1 indicates the field width of the macro block unit.
Frameheightinmbs value:
Frameheightinmbs = (2-frame_mbs_only_flag) * picheightinmapunits
20. mb_adaptive_frame_field_flag
Mb_adaptive_frame_field_flag is equal to 0, indicating that frames and field macro blocks cannot be switched within an image. Mb_adaptive_frame_field_flag is equal to 1, indicating that switching between a frame and a field is possible. When mb_adaptive_frame_field_flag is not set, it should be assigned to 0.
21. direct_8x8_inference_flag
Direct_8x8_inference_flag indicates the method for generating B _skip, B _direct_16x16, and B _direct_8x8 In the brightness motion vector. When frame_mbs_only_flag is 0, direct_8x8_inference_flag should be 1
22. frame_cropping_flag
Frame_cropping_flag is equal to 1, indicating the next frame shear offset parameter used in SPS. Frame_cropping_flag is equal to 0, indicating that the frame shear offset does not exist.
23. frame_crop_left_offset, frame_crop_right_offset, frame_crop_top_offset, and frame_crop_bottom_offset indicate the sample value of a frame in a window.
24. vui_parameters_present_flag
Vui_parameters_present_flag is equal to 1, indicating that vui_parameters () exists in the bitstream. vui_parameters_present_flag is equal to 0, indicating that vui_parameters () does not exist in the bitstream.
H.264 SPS/PPS Member values