encoding.info
You are hereSourcePredictionTransformEntropy codingFiltersFramesDecisionsRate controlPerceptionQualityBitstreamSettingsEncoder map
Page 1 of 6 in Perceptual optimization

Block energy

Perceptual optimization · concept · added 2026-11-13

In Brief:
Block energy is the sum of squared deviations from a block's mean: zero for a constant block, larger with more contrast. Encoders can use it as a simple measure of how much a block varies.

Centered block energy measures how much the sample values in a block vary around their mean. It is the sum of squared deviations, so a constant block has zero energy and a higher-contrast block has more. Encoders can use it as a simple activity measure.

energy = Σ (pixel − mean)² = Σ pixel² − (Σ pixel)² / N

See it

Move the slider. The left block splits into a constant component, its mean, and the deviations from that mean. Energy is the sum of squares of the right-hand panel only. The last readout shows how a mode-1-style adaptive quantization (AQ) formula responds to this energy, as a quantization parameter (QP) offset. It is a teaching model, not a prediction of the QP x264 would give a real macroblock.

8
Block
Constant part
Deviations
above the mean below it. Stronger color is a larger deviation; gray is zero.
Standard deviation
Energy
log2(energy)
Illustrative AQ offset
Simplified demo: the texture is an invented floating-point signal centered on 128. Statistics use its unrounded values; the displayed gray pixels are rounded. The AQ readout adapts x264's aq-mode 1 formula to 64 luma samples by rescaling its reference energy, and floors the energy at 1 as x264 does. For the real calculation see Adaptive quantization in x264.

What to take from it

Sources

Read 2026-11-13, at the commits linked.