Overview of AAC audio with LATM encapsulation

AAC audio compression has been standardized as a part of MPEG-2 and MPEG-4 specifications. First version was released in 1997. AAC audio can be packaged by different methods including ADTS, ADIF, LATM.

This article is a high level overview of AAC audio with LATM encapsulation. Also in the article we will show the location of some parameters of the original audio (channel count, frame size, sampling rate) in the LATM encapsulated stream. To analyze AAC/LATM audio we will use Virinext Bitstream Analyzer. You can download the evaluation version on the Download page. For license acquiring please check the Buy license page.

LATM bitstream overview

The LATM layer multiplexes several AAC Audio payloads into one bitstream. At the high level there are 3 different approach to synchronization can be used:

  • AudioSyncStream. In this case the syncword with value 0x2B7 and 11 bits length is used. AudioSyncStream also has a field which describes data duration.
  • EPAudioSyncStream. This format has the same functionality as AudioSyncStream. But, it additionally provides a longer syncword and a frame counter to detect lost frames.
  • AudioPointerStream. This format is designed for fixed length frames transmission.

For describing stream parameters AudioSpecificConfig structure is used. It is started with common audio parameters followed by structures for special audio types.

Later we will show the location of some parameters of the audio (frame size, sampling rate, channels count) in encoded AAC/LATM elementary streams. As an example we will use the file with parameters in the screenshots below.

Virinext Bitstream Analyzer with opened AAC/LATM file

Frame size

In LATM header frame size is stored in audioMuxLengthBytes field in AudioSyncStream syntax element. In the example file we have audioMuxLengthBytes  = 280 on the selected frame, that means the size of this frame is 280 bytes plus size of fields located before audioMuxLengthBytes.

Sample rate

Sampling rate is calculated based on samplingFrequencyIndex value from AudioSpecificConfig according to the following table.

Sampling rate table from AAC/ADTS specification

In the example file we have samplingFrequencyIndex = 11, that means sampling rate is 8 kHz.

Channels count

The channelConfiguration value is used for describing the number of channels and channels map by using the following table.

Channels map table from AAC/ADTS specification

In the example file we have channelConfiguration  = 1, that means audio has 1 channel.

Conclusion

We have provided a high level overview of AAC audio with LATM encapsulation and described the location of some parameters of audio in encoded bitstream. AAC audio files can be analyzed with Virinext Bitstream Analyzer. It is a GUI tool for both in-depth and high-level analysis for many encoding standards including AAC audio.