Sunday, April 29, 2018

H264/AVC What is SPS and PPS?

SPS and PPS both contains information than an H.264 decoder needs to decode the video data, for e.g. the resolution and frame rate of a video.

for video codecs,
PPS = Picture Parameter Set(PPS contains data common for entire picture)
SPS = Sequence Parameter set (SPS contains data common to SOP, sequence of pictures )

When picture is partitioned into multiple multiple slices say for e.g. for the purposes of transmitting over RTP, likely that it loses the Sequence header and Picture header. A first frame of the picture packet not only contains the picture data, but also some of the important information about the picture header. Loss of this can cause completely incorrectly constructed picture data. So, even if not all packets were lost, if the first packet was lost, almost bad quality picture will be reconstructed or not all reconstructed depending on the implementation.

To circumvent this issue, at the Transport layer a work around was introduced to send the picture header as many as packets. H263 format specified in RFC 2429 specifies this. However, later when H264/AVC was introduced, this issue was considered as an architectural problem in codec itself and SPS and PPS parameter set concept was introduced.

Parameter set can be either part of bitstream or can be received by a decoder through other means such as out of band transmission or hard coding in the decoder.

Note: Sometimes the picture header also contains GOP, Group of picture that contains information whether the previous frames are needed inorder to reconstruct the current frame. I.e. this is an entirely new picture frame mostly. 

references:
https://en.wikipedia.org/wiki/Group_of_pictures
https://cardinalpeak.com/blog/the-h-264-sequence-parameter-set/

No comments:

Post a Comment