Up to the transform, nothing is lost (rounding aside). Quantization is the only lossy step. See how QP sets quality and bitrate, and how CQP, CRF and ABR differ.
The steps so far (prediction, transform) only rearranged information; they didn't discard any. Quantization is the only step in the codec pipeline that deliberately throws information away.
Quantization: level = round( coefficient / Qstep )
Inverse quantization: coefficient' = level × Qstep
The larger the Qstep → the more values collapse into the same level
→ compresses better, but the reconstruction error (distortion) also growsRather than handle Qstep directly, codecs control it indirectly through an integer called the QP (quantization parameter). As QP grows, so does Qstep (coarser quantization). H.264/HEVC were designed so that every time QP increases by 6, Qstep exactly doubles — a logarithmic scale, which also ties in with human brightness perception (the logarithmic response from Chapter 1).
Codecs include a dead zone that turns small coefficients near 0 into exactly 0. As you learned in Chapter 2, the residual distribution concentrates its probability near 0 (a Laplacian distribution), so boldly zeroing small values lets entropy coding handle the resulting runs of consecutive zeros extremely efficiently.
QP (quantization) is the knob that directly decides where you land on the R-D curve from Chapter 2. Lower the QP and D (distortion) falls but R (bits) rises; raise the QP and the opposite happens. Rate control algorithms adjust QP in real time, frame by frame and even block by block, to hit a target bitrate (or quality).
In practice you must tell three QP control modes apart. CQP (Constant QP) fixes the QP — file size is unpredictable, so it's for testing. CRF (Constant Rate Factor, in x264/x265/libaom) keeps 'perceived quality constant' by adjusting QP automatically with scene complexity — the most common choice for VOD delivery. ABR (Average Bitrate) adjusts QP to hit a target average bitrate — essential where bandwidth is fixed, such as broadcast. Which to use comes down to 'match the quality, or match the file size/bandwidth?'
How much file size varies with the content at the same CRF can be seen in our CRF size-and-quality measurement. The bitrate at x264 CRF 28 was about 2,490 kbps for one clip and about 11,623 kbps for another. To pick a CRF for the quality you want, try the CRF recommender. Which to hold fixed — CRF, 2-pass, or CQ — continues in Chapter 18.
The only step in the codec pipeline that deliberately discards information.
An integer that indirectly controls the quantization step size. A larger value means coarser quantization.
A quantization interval that turns small coefficients near 0 into exactly 0.
An algorithm that dynamically adjusts QP to hit a target bitrate or quality.
Three representative rate control modes used in practice.
Which is the only step in the codec pipeline that 'deliberately discards information'?
Which rate control mode is commonly used for VOD (video on demand) delivery when you want to keep perceived quality constant?