The MPEG audio bitstream definition is normative. Most guidance
about encoding is informative. Thus, two MPEG-compliant bitstreams
that encode the same audio material at the same rate but on different
encoders may sound very different. On the other hand, a given MPEG
bitstream decoded on different decoders will result in essentially the same
output.
Analyze the block using a 32-band equally-spaced (analysis) filter
bank, producing
coeffs/subband (the coeffs are downsampled (subsampled, decimated)
by factor of ).
time-domain samples are transformed into
subbands with
coeffs. Notice that in a subband, each coeff can be considered as a
sample of such subband.
Scale each block of
coeffs to ensure that the entire range of the selected quantizer will be
used. Output the *scalefactor*.
Using the FFT, compute the ATH for the block (considering the
masking effects).
Let
the bit-rate selected by the user. While the generated bit-rate
:
Decrement the quantization step
for each subband ,
proportionally to the ATH in .
Compute .
The bit-rate is controlled be switching between quantizers with
different number of bits.
Output
and the quantization indexes.
2.2 Decoder
For each input frame:
"Dequantize" the coeffs of each subband.
Descale the coeffs to their original dynamic range.
Apply the 32-band synthesis filters bank.
3 Loss information analysis
Aliasing in the 32-band analysis filter bank.
^ Amplitude
| _______ _______ ____....__ _______
| / \ / \ / \ / \
| / \ / \ / \ / \
| / subband 0 X subband 1 X X sub. 31 \
+-/-----------/-\---------/-\-----....---/-\-----------\-> frequency
CBR and VBR (Variable Bit-Rate). In this last case, users usually select
the average bit-rate.
Typically, virtually lossless at 128 kbps for most human beings.
Improved subband analysis by means of the MDCT (using 32 subbands,
the low-frequency ones contains more than un bark, which generates a
poor frequency resolution in the ATH computation).
5.1 Encoder
Split into
blocks of
samples. For each block:
Performs FFT of the block to compute the ATH and windows
sequence.
Analyze the block using a 32-band equally-spaced (analysis) filter
bank, producing
coeffs/subband.
For each subband:
Analyze transients. If detected, use
a sequece of start/short*3/stop windows. Otherwise, use a long
window.
Compute MDCT. This produces
(long),
(start/stop) or
coeffs/subband (short). This step produces
coeffs/subband (long),
coeffs/subband (start/stop) and
coeffs/subband (short).
Apply scalefactors to optimize quantization.
Distortion control loop: keep (as much as possible) the quantization error
below the ATH.
Rate control loop: Let
the bit-rate selected by the user. While the generated bit-rate
:
Decrement the quantization step
for each subband ,
proportionally to the ATH in .
Compute
after encoding the quantizer indexes with (static) Huffman
coding. As in previous layers, a quantizer is selected from a
list of predefined logaritmic quantizers.
5.2
For each input frame:
Decode the Huffman codes.
“Dequantize” the coeffs of each subband.
Descale the coeffs to their original dynamic range.