Why are the AC-3 family so widely used for surround sound in broadcast, film, and streaming? And how does lossless compression (FLAC) differ from lossy codecs?
AC-3 is Dolby's codec, which spread widely under the name Dolby Digital across DVDs, digital broadcasting, and home AV equipment. Its signature use is carrying 5.1-channel surround in a single stream. E-AC-3 (Dolby Digital Plus) is its successor, extending it to code more efficiently and support a wider range of channel configurations. Both codecs belong to the same perceptual-coding family as the previous lessons, and since they are Dolby's proprietary technology, they are known to require a license to use.
The values in the table are commonly known specifications. Actual bitrates differ from service to service.
When you send AC-3/E-AC-3 as is to a TV or soundbar, the device decodes it itself. In that case the player can hand over the encoded stream untouched (passthrough) instead of decoding it to PCM, but if the device doesn't support that codec, you get no sound or it collapses to stereo. A lot of surround problems come down to "does the device know this codec?" It is similar to the hardware decoding situation from Chapter 10.
FLAC (Free Lossless Audio Codec) is a lossless codec that restores audio bit-for-bit identical to the original PCM. It fits the samples with linear prediction and writes the remaining error compactly with Rice coding, which resembles the "prediction → residual → entropy coding" structure you already know from Chapter 3. In exchange, since nothing is thrown away as in perceptual coding, the size savings are limited. It varies with the music, so it is hard to give an exact ratio, but it is generally known to shrink files to somewhere around half of the original PCM.
The standard practice is to use a lossless format such as FLAC or WAV (PCM) for editing and archiving, and to lossy-encode to AAC/Opus only once, at the very end, when you send it to viewers. It is the same structure as keeping a master on the video side (an editing codec like ProRes from Chapter 9) and producing only the delivery copy as H.264/AV1.
ffmpeg -i master.wav -c:a flac -compression_level 8 master.flac
# If the PCM hashes of the two files match, it was restored losslessly
ffmpeg -i master.wav -map 0:a -f hash -hash md5 -
ffmpeg -i master.flac -map 0:a -f hash -hash md5 -Dolby's perceptual coding codec. Widely delivers 5.1 surround on DVD and in broadcast.
The extended version of AC-3. Higher efficiency and a wider range of channel configurations.
An open-source lossless audio codec. Restores audio bit-for-bit identical to the original PCM.
Sending the encoded audio stream as is to an external device without decoding it.
A method where the exact original samples can be restored after compression.
What happens when you decode a FLAC file back to WAV (PCM)?