ThinkMeta LogoDeutsch
English
LAME: Algorithm analysis

After reviewing the source code and analyzing the algorithms, three hierarchy levels were found which facilitate asynchronous programming:

1. Files:
On the highest level, LAME is processing files. Per encoding task one file is used for reading the input data and one file is used for writing the output data.

On this level, no dependencies exist between two encoding tasks, so that in general, an arbitrary number of files can be processed asynchronously.

2. Frames:
On the mid-level, the LAME encoder is processing frames. Frames are extracted from the file read in and contain 1152 audio samples each.

Each frame passes several stages in the encoder which are necessary for the production of the compressed output data. In detail these are:

  1. Conversion of the integer samples to floating-point samples and scaling
  2. Replay gain computation
  3. Computation of the psychoacoustic properties
  4. Application of the modified discrete cosine transformation (MDCT)
  5. Quantization
  6. Writing into the bit stream

Due to the one frame delay used in the algorithms, processing one frame always depends on the results of his predecessor.
The data dependencies distiguish slightly in the respective algorithms, but however, they are fundamentally very strong.

3. Sub frames (Granules)/Channels:
On the lowest level, the individual stages are processing granules and channels (left/right).

The dependencies between granules, between channels and between granules and channels distinguish in the respective algorithms and stages.