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:
- Conversion of the integer samples to floating-point samples and scaling
- Replay gain computation
- Computation of the psychoacoustic properties
- Application of the modified discrete cosine transformation (MDCT)
- Quantization
- 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.
|