NAL unit type nal_unit_type in H.264

Source: Internet
Author: User
Nal_unit_type
Contents of the nal unit and rbsp syntax structure
 
0 Not Specified  
1 Encoding band of a non-IDR Image
Slice_layer_without_partitioning_rbsp ()
 
2 Encoding band data split Block
Slice_data_partition_a_layer_rbsp ()
 
3 Encoding band data split Block B
Slice_data_partition_ B _layer_rbsp ()
 
4 Encoding band data split Block C
Slice_data_partition_c_layer_rbsp ()
 
5 IDR image encoding band
Slice_layer_without_partitioning_rbsp ()
 
6 Auxiliary enhancement information (SEI)
Sei_rbsp ()
 
7 Sequence Parameter Set
Seq_parameter_set_rbsp ()
 
8 Image parameter set
Pic_parameter_set_rbsp ()
 
9 Access unit Separator
Access_unit_delimiter_rbsp ()
 
10 End of Sequence
End_of_seq_rbsp ()
 
11 Stream end
End_of_stream_rbsp ()
 
12 Fill data
Filler_data_rbsp ()
 
13 Sequence parameter set Extension
Seq_parameter_set_extension_rbsp ()
 
14... 18 Retained  
19 Encoding strip of unsegmented secondary encoding Images
Slice_layer_without_partitioning_rbsp ()
 
20... 23 Retained  
24... 31 Not Specified  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

________________________________________________________________________________________

The following table lists the types of all nal defined in the H.264 Standard
# Define nalu_type_slice 1
# Define nalu_type_dpa 2
# Define nalu_type_dpb 3
# Define nalu_type_dpc 4
# Define nalu_type_idr 5
# Define nalu_type_sei 6
# Define nalu_type_sps 7
# Define nalu_type_pps 8
# Define nalu_type_aud 9
# Define nalu_type_eoseq 10
# Define nalu_type_eostream 11
# Define nalu_type_fill 12

Therefore, when nal_unit_type is set to 7, this nal unit is SPs. When the value is 8, this nal unit is PPS.

________________________________________________________________________________________

Nal_unit:
{
Forbidden_zero_bit (1 bit)
Nal_ref_idc (2 bits)
Nal_unit_type (5 bits)
Rbsp (raw byte sequence payloads)
}

For example, if a shard takes a section of H.264 bitstream as 00 00 00 01 67 42 E0 14 da 05 82 51.
Because 67 = 0 11
00111, nal_unit_tye = 00111 = 7, so this section is SPs.
Another example: 00 00 00 01 68 CE 30 C4 80 00 00 00 00 00 00
68 = 01000, nal_unit_tye = 01000 = 8, so this section is PPS.

Forbidden_zero_bit = 0
Nal_ref_idc: When the value is not equal to 0, the content of the specified nal unit contains a sequence parameter set, an image parameter set, a reference image band, or a reference image band data segment.
Nal_unit_type: indicates the type of the rbsp data structure contained in the nal unit. The VCL nal unit refers to the NAL units whose nal_unit_type value is equal to 1 to 5 (including 1 and 5. All other NAL units are called non-vcl nal units.

When the nal_unit_type value of the nal unit of an encoded image is 5, all other vcl nal units of the same image are encoded.
The nal_unit_type value should be 5. Such an image is called an IDR image.
Note:-band data segmentation cannot be used for IDR images.

If a nal_ref_idc that contains a strip or strip data split nal unit is equal to 0, the strip or strip data split is part of a non-reference image.

Nal_ref_idc should not be equal to 0 for the nal unit of the sequence parameter set or sequence parameter set extension or image parameter set. When the nal_ref_idc of a specific image's strip or strip Data Division nal unit is equal to 0, all the strip or strip Data Division NAL units of the image should be equal to 0.

The nal_ref_idc of the IDR nal unit should not be equal to 0, that is, the nal unit whose nal_unit_type is equal to 5.
Nal_ref_idc of all NAL units whose nal_unit_type is 6, 9, 10, 11, or 12 must be 0.

________________________________________________________________________________________

The H.264 parameter set is further divided into sequence parameter set and picture parameter set ).

The sequence parameter set includes all the information of an image sequence, that is, all the image information between two IDR images.

The image parameter set includes all the relevant information of all parts of an image, including the image type and serial number. The loss of some serial numbers during decoding can be used to check whether the information package is lost or not. (Image parameter sets act on one or more image sequences and image parameter sets in a video sequence, reducing the transmission of repeated parameters. Each VCL nal unit contains an identifier, point to the relevant image parameter set. Each image parameter set contains an identifier that points to the content of the relevant sequence parameter set. Therefore, only a few pointer information is used to reference a large number of parameters, greatly reducing each VCL
The information transmitted repeatedly by the nal unit .)

Multiple different sequences and image parameter sets are stored in the decoder. The encoder selects an appropriate parameter set based on the storage location of the header of each encoding shard, the image parameter set itself also contains reference information about the sequence parameter set used.

The specific implementation methods of the parameter set are also diverse: (1) through out-of-band transmission, This method requires the parameter set to be transmitted to the decoder before the first encoding arrives through a reliable protocol; (2) Pass in-band transmission, which requires more advanced protection for the parameter set. For example, send a copy package to ensure at least one target is reached. (3) hardware processing parameter sets are used in encoder and decoder.

The sequence parameter set and image parameter set must be transmitted before decoding and activated during decoding. Once activated, the previous sequence parameter set or image parameter set becomes invalid. The image parameter set is activated by using its slice data or using its a-separated NALU. The sequence parameter set is activated by the image parameter set that uses it or the sei nalu that includes the message in the buffer period. The sequence parameter set of the same IDR image has the same seq_parameter_set_id until the last access unit of the image or the sei nalu that includes the message in the buffer period. In this case, the sequence parameter set of the next image needs to appear. The sequence parameter set of the next image is activated by sei nalu. If the sequence parameter set and image parameter set are sent through other transmission pipelines, ensure the above Transmission sequence.

Storage Unit:

A set of NAL units in the specified format are called storage units. Each storage unit corresponds to an image.Each storage unit contains a set of vcl nal units to form a master-encoded image. The VCL nal unit is composed of image entries that indicate video image sampling. You can add a prefix before the storage unit, divide the storage unit, and add the enhancement information (SEI) (image timing information) to the front of the main encoded image. The VCL nal unit attached to the primary encoded image contains the redundant representation of the same image, which is called the redundant encoded image. When the data of the primary encoded image is lost or damaged, the redundant encoded image can be decoded.

Encoding video sequence

An encoded video sequence consists of a series of continuous storage units that use the same sequence parameter set. Each video sequence can be decoded independently. The encoding sequence starts with an instant refresh storage unit (IDR ). IDR is an I-frame image, indicating that subsequent images do not need to be referenced in previous images. A nal unit stream can contain one or more encoded video sequences.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.