access unit: A set of NAL units that are consecutive in decoding order and contain exactly one primary coded picture. In addition to the primary coded picture, an access unit may also contain one or more redundant coded pictures, one auxiliary coded picture, or other NAL units not containing slices or slice data partitions of a coded picture. The decoding of an access unit always results in a decoded picture.
上面是H.264標準中對access unit的定義,我們可以簡單理解,一個access unit就是幀的概念。
通過slice中的參數(shù)區(qū)分:
一. frame_num不同
二. pic_parameter_set_id不同
三. field_pic_flag不同
四. bottom_field_flag不同
五. pic_order_cnt_type(SPS)都等于零,(且pic_order_cnt_lsb或delta_pic_order_cnt_bottom不同)
六. pic_order_cnt_type(SPS)都等于1,delta_pic_order_always_zero_flag都等于零,(且delta_pic_order_cnt[0]或delta_pic_order_cnt[1]不同)
七. profile(SPS)都不等于66,且前一個slice的first_mb_in_slice>=當前slice的first_mb_in_slice
八. first_mb_in_slice都相同
九. first_mb_in_slice與前一幀的某個slice相同
通過Nal單元信息區(qū)分:
一. nal_ref_idc不同,且其中一個應(yīng)該等于零
二. nal_unit_type不同
三. nal_unit_type都等于5,且dir_pic_id不同(slice)
四. 讀到了一個AUD Unit,注:此時還沒有讀到一個slice
五. 讀到了一個SPS Unit
六. 讀到了一個PPS Unit
七. 讀到了一個SEI Unit
H.264 in MPEG2 ts or ps
an elementary stream access point is defined as follows: ISO/IEC 11172-2 video and ITU-T Rec. H.262 | ISO/IEC 13818-2 video – The first byte of a video sequence header. ISO/IEC 14496-2 visual – The first byte of the visual object sequence header. ITU-T Rec. H.264 | ISO/IEC 14496-10 video – The first byte of an AVC access unit. The SPS and PPS parameter sets referenced in this and all subsequent AVC access units in the coded video stream shall be provided after this access point in the byte stream and prior to their activation. Audio – The first byte of an audio frame
When an ITU-T Rec. H.264 | ISO/IEC 14496-10 stream is carried in an ITU-T Rec. H.222.0 | ISO/IEC 13818-1 stream, the ITU-T Rec. H.264 | ISO/IEC 14496-10 coded data shall be contained in PES packets. The ITU-T Rec. H.264 | ISO/IEC 14496-10 coded data shall comply with the byte stream format defined in Annex B of ITU-T Rec. H.264 | ISO/IEC 14496-10, with the following constraints: Each AVC access unit shall contain an access unit delimiter NAL Unit; NOTE 2 – ITU-T Rec. H.264 | ISO/IEC 14496-10 requires that an access unit delimiter NAL Unit, if present, is the first NAL Unit within an AVC access unit. Access unit delimiter NAL Units simplify the ability to detect the boundary between pictures; they avoid the need to process the content of slice headers, and they are particularly useful for the Baseline and Extended profiles where slice order can be arbitrary. Each byte stream NAL Unit that carries the access unit delimiter shall contain exactly one zero_byte syntax element. NOTE 3 – The syntax and semantics of byte stream NAL units are defined in Annex B of ITU-T Rec. H.264 | ISO/IEC 14496-10. All Sequence and Picture Parameter Sets (SPS and PPS) necessary for decoding the AVC video stream shall be present within that AVC video stream. NOTE 4 – ITU-T Rec. H.264 | ISO/IEC 14496-10 also allows delivery of SPS and PPS by external means. This Specification does not provide support for such delivery, and therefore requires SPS and PPS to be carried within the AVC video stream. Each AVC video sequence that contains hrd_parameters() with the low_delay_hrd_flag set to '1', shall carry VUI parameters in which the timing_info_present_flag shall be set to '1'. NOTE 5 – If the low_delay_hrd_flag is set to '1', then buffer underflow is allowed to occur in the STD model; see 2.14.3 and 2.14.4. Setting the timing_info_present_flag to '1' ensures that the AVC video stream contains sufficient information to determine the DPB output time and the CPB removal time of AVC access units, also in case of underflow.
H.264的分幀在Mpeg2 ts or ps內(nèi)是有規(guī)范定義的,也就是每一幀的開頭都要有AUD單元,一個AUD單元包含一個H.264 access unit。因為除非按照H.264分幀策略去分幀,否則沒有辦法區(qū)分幀,因為NAL層最多只能將slice區(qū)分,而不能找到frame。
|