VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gr::Avc Namespace Reference

Classes for decoding H.264 parameter sets. More...

Classes

class  Configuration
 Contains AVC configuration parameters, initialised from an "avcC" file segment or from an SDP "fmtp" attribute string, held as lists of SPS and PPS sub-structures. More...
 
class  Sps
 A Sequence Parameter Set (SPS) structure. More...
 
class  Pps
 A Picture Sequence Parameter Set (PPS) structure. More...
 
class  Rbsp
 Provides static helper functions that relate to RBSP formatting. More...
 

Typedefs

typedef G::bit_iterator< const
char * > 
bit_iterator_t
 
typedef G::bit_stream
< bit_iterator_t
bit_stream_t
 

Functions

std::ostream & operator<< (std::ostream &, const Avc::Sps &)
 
std::ostream & operator<< (std::ostream &, const Avc::Pps &)
 

Detailed Description

Classes for decoding H.264 parameter sets.

H.264 is the standard for Advanced Video Coding (AVC).

The AVC design separates out its configuration parameters from the stream of video images (frames), with the configuration being communicated completely out-of-band (eg. SDP) or in distinctly-typed network packets (SPS and PPS NALUs) or in special file segments (eg. "avcC" boxes).

Once the parameter sets have been established the video frames can simply refer to them by their id. In the simplest case there is one sequence parameter set (SPS) and one picture parameter set (PPS) used by all video frames.

The job of decoding parameter sets can sometimes be delegated to a H.264 decoder by presenting them as extra data at session setup, or by adding them to the data stream as SPS and PPS NALUs.

The H.264 standard is defined in terms of a bitstream syntax. A bytestream format, RBSP, is also defined with a final stop bit set to 1 followed by a set of padding bits set to 0. A RBSP bytestream can be byte-stuffed in order that easily-identifiable markers can be put inbetween the set of RBSP buffers that make up a higher-level bytestream. The RBSP byte-stuffing replaces all 00-00-00, 00-00-01, 00-00-02 or 00-00-03 sequences with 00-00-03-00, 00-00-03-01, 00-00-03-02 or 00-00-03-03 respectively, thereby freeing up 00-00-00, 00-00-01 and 00-00-02 to be used as inter-RBSP markers.

H.264 NALUs are made up of a single byte-stuffed RBSP buffer with a one-byte header to identify the NALU type. When NALUs are chained together they are separated by 00-00-01 markers, with an additional four-byte 00-00-00-01 start-code marker at the front. Other NALU packing schemes use NALU-length fields between the separate NALUs (mp4-avcC, rtp-avc), or use base64 encoding of each NALU with comma separators (fmtp), but even in these cases the NALUs themselves are byte-stuffed.

See Also
ISO/IEC 14496-15 (non-free) 5.2.4.1.1 5.2.3 5.3.4.1.2, and libav's ff_isom_write_avcc().