0 likes | 5 Views
Presentation describes high level structore of AVC(H.264) video conpressed bitstream by using Virinext Bitstream Analyzer. Report is focused on explaining how video frames are stored within an AVC/H.264 bitstream.
E N D
Detecting video frames in AVC/H.264 compressed bitstreams
AVC/H.264 video overview At a high level, video consists of a sequence of individual images or video frames; Uncompressed video requires a substantial amount of storage space; 1 second of 1920×1080/50p video requires 1920 * 1080 * 1.5 (bytes per pixel in I420) * 50 = 155.52 MB; Video compression is used to reduce storage and bitrate demands; AVC/H.264, initially released in 2003, remains one of the most popular video compression standards worldwide; We will use Virinext Bitstream Analyzer for analyzing AVC/H.264 files. ● ● ● ● ● ●
High level AVC/H.264 bitstream overview At a high level, AVC/H.264 video is a sequence of NAL Units (Network Abstraction Layer Units)
AVC/H.264 Slice NAL Unit Encoded video frames are stored within Slice NAL units; Slice can contain either a full frame or just part of a frame. A special slice type, called an IDR-slice (Instantaneous Decoding Refresh), signals a reset in frame referencing
AVC/H.264 Slice Types The following slice types are used: I-slice: Contains only intra-predicted data (spatial prediction within the slice); P-slice: Contains inter-predicted data referencing one prior slice; B-slice: Contains inter-predicted data referencing up to two different frames. ● ● ● I-slice only exploit spatial redundancy only. P- and B-slices use both intra-prediction and inter-prediction.
AVC/H.264 Slice and error propagation Slice NAL units are stored in bitstream independently; Error in a bitstream within one slice(data loss or corruption) do not affect directly other slices; Errors in decoding in some slice can lead in errors in another frames due to to incorrect predictions. ● ● ●
AVC/H.264 Slice and multithreading Slices are stored independently on bitstream level; They allows for multithreaded processing on both the encoding and decoding sides; When frame consists of multiple independent slices, this slices can be encoded and decoded in parallel. ● ● ●
AVC/H.264 frame boundary detection: AUD Access Unit Delimiter (AUD) NAL Unit is used to indicate the start of a new video frame; AUD is an optional, and it may not appear in the bitstream at all. ● ●
AVC/H.264 frame boundary detection If any of these conditions are met, the new slice belongs to a new frame; otherwise, both the last and new slices are part of the same frame. 1. lastSlice::pic_parameter_set_id != newSlice::pic_parameter_set_id 2. lastSlice::frame_num != newSlice::frame_num 3. lastSlice::field_pic_flag != newSlice::field_pic_flag 4. lastSlice::field_pic_flag == 1 && newSlice::field_pic_flag == 1 && lastSlice::bottom_field_flag != newSlice::bottom_field_flag 5. lastSlice::nal_ref_idc != newSlice::nal_ref_idc and (lastSlice::nal_ref_idc == 0 || newSlice::nal_ref_idc == 0) 6. (lastSlice::m_nalUnitType == AVC::NAL_SLICE_IDR) != (newSlice::m_nalUnitType == AVC::NAL_SLICE_IDR)
AVC/H.264 frame boundary detection If any of these conditions are met, the new slice belongs to a new frame; otherwise, both the last and new slices are part of the same frame. 7. (lastSlice::m_nalUnitType == AVC::NAL_SLICE_IDR) && (newSlice::m_nalUnitType == AVC::NAL_SLICE_IDR) && (lastSlice::idr_pic_id != newSlice::idr_pic_id) For cases when SPS::pic_order_cnt_type == 0: 8.1. lastSlice::pic_order_cnt_lsb != newSlice::pic_order_cnt_lsb 8.2. lastSlice::delta_pic_order_cnt_bottom != newSlice::delta_pic_order_cnt_bottom For cases when SPS::pic_order_cnt_type == 1: 9.1. lastSlice::delta_pic_order_cnt[0] != newSlice::delta_pic_order_cnt[0] 9.2. lastSlice::delta_pic_order_cnt[1] != newSlice::delta_pic_order_cnt[1]
AV1 video analysis with Virinext Bitstream Analyzer Screenshot of frame preview, syntax viewer and GOP widgets of AVC video file opened in Virinext Bitstream Analyzer:
References Virinext Bitsteam Analyzer - GUI tool for displaying and analyzing coded video and audio streams Detecting video frames in AVC/H.264 compressed bitstreams The structure of AVC (H264) video H.264 : Advanced video coding for generic audiovisual services Advanced Video Coding ● ● ● ● ●