![]() ![]() The first thing I did was to look at section 7 of the H.264 specification. Let’s decode this into something readable from the spec. In my trivial encoder, the h.264 SPS and PPS were hardcoded in hex as: /* h.264 bitstreams */ const uint8_t sps = In the case of my simple encoder, we emitted a single SPS and PPS at the start of the video data stream, but in the case of a more complex encoder, it would not be uncommon to see them inserted periodically in the data for two reasons - first, often a decoder will need to start decoding midstream, and second, because the encoder may wish to vary parameters for different parts of the stream in order to achieve better compression or quality goals. The PPS NAL unit contains parameters that apply to the decoding of one or more individual pictures inside a coded video sequence. The SPS NAL unit contains parameters that apply to a series of consecutive coded video pictures, referred to as a “coded video sequence” in the H.264 standard. The SPS and PPS are both types of NAL units. ![]() Recall that an H.264 bitstream contains a sequence of Network Abstraction Layer (NAL) units. Both entities contain information that an H.264 decoder needs to decode the video data, for example, the resolution and frame rate of the video. I’ve received several emails asking about precise details of things in two entities in the H.264 bitstream: the Sequence Parameter Set (SPS) and the Picture Parameter Set (PPS). This is a follow-up to my World’s Smallest H.264 Encoder post. ![]()
0 Comments
Leave a Reply. |