LAME: Sample conversion
The encoding process in LAME requires samples to be in floating-point format
and separated by channels. Since WAV files store the samples as 16-bit integers
and the channels are interleaved, they must be converted.
This task is implemented in the class "SamplePreprocessor" which als does the
optional scaling.
Following dependencies exist for this task:
-
Input data: The samples are read from the file in 64K blocks into memory.
The task blocks if no samples are available.
-
Output data: The converted samples must be written also into memory.
The task can block if according to the memory management strategy no memory
can be provided.
In order to be able to resume following tasks as quickly as possible, memory is released
for further processing after every 1152 converted samples:
Since no frame dependencies exist in this task, the conversion can be done
independently from the remaining tasks.
The converter uses SSE4 instructions and can process 4 samples in parallel.
In principle, this can be further accelerated, when the input data is divided
up onto several converters.
With the fact that the further processing of a frame, however, is considerably
slower than the conversion performance increases will hardly be detectable by that.
|