Lossy Audio Compression
Lossy audio compression reduces data by permitting changes to the signal reconstructed during decoding.
A compact audio file can contain an excellent-sounding approximation of a recording while having very different sample values from the master. Lossy compression spends a limited data budget on a representation intended to preserve what matters perceptually.
To see where the approximation enters, follow a short section of sound through encoding and reconstruction.
1. Describe a section of the signal
Many general-audio codecs divide the waveform into overlapping sections and transform them into a representation of frequency content. The transform itself need not discard information. It provides components that the encoder can handle differently.
Other coding tools can exploit prediction, shared information between channels, or models of suitable sound types. The essential distinction remains: the encoder chooses what information will describe the section, and the decoder reconstructs from that information.
2. Decide where precision is useful
A psychoacoustic model estimates which errors are likely to be noticed. A strong sound can mask weaker sound or error in nearby frequency/time regions. The encoder can permit more error there while spending precision elsewhere.
That does not mean it simply deletes everything above a fixed frequency, or selects a list of inaudible instruments. Audibility depends on the current signal and the type of error. A quiet tone in isolation can need careful treatment even when it costs few total bits; a dense passage can have useful masking but many components to describe.
The model is an estimate. A difficult signal or inadequate data budget can expose its compromise.
3. Quantize the chosen representation
Consider two illustrative transform-component values, +0.83 and +0.12. Suppose the encoder rounds them onto steps of 0.25:
| Component | Source value | Stored grid value | Difference |
|---|---|---|---|
| A | +0.83 | +0.75 | −0.08 |
| B | +0.12 | 0 | −0.12 |
This is a toy quantizer, not the exact operation of MP3, AAC, or Opus. It shows the point where multiple possible source values become one stored value.
The decoder can recover +0.75 and 0 from the coded information. It cannot know whether the first originally was +0.83, +0.78, or another value in that quantization interval.
Using finer steps reduces those errors but usually requires more information. Real encoders allocate steps or other precision controls according to their tools and data budget. Encoding the resulting symbols efficiently can reduce file size further without adding another approximation; lossless entropy coding and lossy quantization can coexist inside one codec.
4. Reconstruct and join the sections
The decoder reverses the defined coding operations, reconstructs the signal representation, and combines overlapping sections into an output waveform.
The reconstructed waveform reflects the stored quantized values. Replaying this existing bitstream does not normally create another lossy encoding generation: it reconstructs the same represented signal each time. A later output stage can still change gain, layout, or sample rate for other reasons.
Why transients and textures are difficult
A sudden attack contains energy concentrated in time. If an encoder uses an unsuitable long window or insufficient precision, quantization error associated with that section can spread around the attack, including before it. Short-window tools help localize the problem, with their own coding tradeoffs.
Noise-like textures such as cymbals or applause distribute energy over many components. They can require substantial detail to retain a stable texture. Inadequate coding can produce fluctuating, metallic, or watery impressions.
| Audible change | Relevant kind of coding compromise |
|---|---|
| Smearing around a sharp attack | Time localization and quantization of the transient |
| Fluctuating texture | Representation of dense or noise-like content |
| Reduced upper-frequency detail | Bandwidth/precision allocation |
| Altered stereo impression | Shared or simplified channel representation |
These are mechanisms to investigate, not a rule that all tracks using a particular bitrate will exhibit the same artifact.
What another generation does
If decoded audio is passed to a new lossy encoder, that encoder receives the first reconstruction. It applies its own analysis and approximation to that signal. The new errors can combine with or change the first generation's artifacts.
Encoding the result at a high bitrate can avoid making it much worse, but it cannot identify the original information that the earlier quantizer merged together. Saving the decoded result as FLAC preserves that reconstruction exactly; it does not restore the pre-compression source.
This distinction matters in an Emby audio-transcoding session. A second encoding is a real generation change, while decoding an unchanged delivered track is not.
Compare versions for the listening job
Use the same source passage and matched listening level. Include the kinds of material that matter: quiet tones, attacks, ambience, or dialogue over music. A louder version can seem more detailed even when coding is not better.
Bitrate is a useful size/delivery constraint, but quality depends on the codec tools, encoder decisions, channels, and signal. The best master for making further versions retains the source information, so each new listening copy begins from that master rather than from an already compromised intermediate.