Dead zone and rounding
A dead zone is the range of coefficient values that quantize to zero. Widening it removes more small coefficients, which can reduce the cost of coding a block but increases error. The default fixed-offset quantizers in x264 and x265 use a rounding offset that favors zero; it applies when trellis or rate-distortion optimized quantization is not used.
This simplified scalar model shows the idea. Here c is a transform coefficient and step is its quantization step size.
level = sign(c) × floor(|c| / step + offset)
floor rounds the magnitude down before the sign is put back, so the offset decides how far past a level a coefficient must be to reach it. In this model the decoder reconstructs a coefficient as level × step. It does not need to know the encoder's offset, which is not in the bitstream.
Why not round to nearest
With an offset of 0.5 the formula chooses the nearest level, and the zero band is already one step wide. A smaller offset moves each decision threshold farther from zero, so a coefficient needs a larger magnitude to reach the next nonzero level. The thresholds stay one step apart; only the central interval grows.
Try changing the offset
The curve is an illustrative model of how coefficient values are spread: concentrated near zero, with larger magnitudes less common. Move the offset and the thresholds move. Everything between a pair of thresholds becomes the same level, and the shaded area is the share that becomes zero.
The bit figure treats every coefficient as independent and drawn from this one curve. It does not model coefficient order or block signaling, so it is not a bitrate.
Reducing the offset from 0.50 to 0.17 raises the share of zeros from 39% to 56%. Modeled entropy falls by about 16%, while mean squared error roughly doubles. For this distribution, ordinary rounding with a step about 35% larger reaches the same modeled rate with about 13% less error:
| Quantizer | Step | Offset | Modeled bits | Mean squared error |
|---|---|---|---|---|
| Wider zero band | 1.00 | 0.17 | 2.08 | 0.165 |
| Round to nearest | 1.35 | 0.50 | 2.08 | 0.144 |
Real encoders code coefficient patterns using information such as position, neighboring coefficients and whether a block has any nonzero coefficients at all. Changing one coefficient to zero can therefore change the cost of signaling the rest of the block. This model leaves those effects out, so it cannot establish which offset works best in a real encoder.
What encoders use
| Encoder | Selected by | Nominal offset |
|---|---|---|
| x264 | Intra macroblock | 21/64 ≈ 0.328 |
| x264 | Inter macroblock | 11/64 ≈ 0.172 |
| x265 | I slice | 171/512 ≈ 0.334 |
| x265 | P or B slice | 85/512 ≈ 0.166 |
x264 uses these in its fixed-offset path, when trellis does not run on the block. x265 uses them in scalar quantization with --rdoq-level 0.
x264 chooses per macroblock and x265 per slice, so in x265 an intra block inside a P or B slice gets the smaller offset. In x265 a later step, sign-bit hiding, can still change levels.
In x264 the luma offsets are settings: --deadzone-inter (default 21) and --deadzone-intra (default 11) give a nominal offset of (32 − value) / 64, so a larger value widens the zero band. x264 builds integer tables from that value, with rounding and a cap. Chroma stays at the defaults. --tune grain sets both to 6, among several other changes.
Trade-offs
- Small coefficients can carry faint texture or grain. Zeroing more of them can remove visible detail. x264's grain tuning narrows the zero band.
- It is a fixed rule. The same offset applies to every coefficient, whatever that coefficient would cost to code.
- Trellis quantization replaces it. Trellis searches among levels using estimated costs that can depend on other coefficients. When x264 runs it, it starts from round-to-nearest; the dead zone settings affect only the fixed-offset path.
Sources
Read 2026-11-13, at the commits linked.
- x264 at commit c24e06c (GitHub mirror):
deadzone[], the integer bias tables, with their cap,QUANT_ONE, the defaults, the grain tuning, the choice of path, the trellis path starting from round-to-nearest. - x265 at commit 4191822 (GitHub mirror): the offsets, chosen by slice type, sign-bit hiding after quantization,
quant_c. - Not measured or cited: the Laplace curve is an illustrative model, not data. That grouping independent coefficients cannot beat their entropy is standard information theory, not taken from a source read for this page.