encoding.info
You are hereSourcePredictionTransformEntropy codingFiltersFramesDecisionsRate controlPerceptionQualityBitstreamSettingsEncoder map
Page 1 of 4 in Rate control

Constant quantizer, constant rate factor, average bitrate and constant bitrate

Rate control · concept · added 2026-11-15

In Brief:
Rate control sets each frame's starting quantization parameter to pursue a quality or bitrate goal. A constant quantizer fixes that level; a rate factor lets bitrate vary around an encoder quality setting; average bitrate targets an average. A buffer constraint limits how much data can arrive in bursts.

Rate control chooses a starting quantization parameter (QP) for every frame; an encoder may then adjust it within the frame. The four common modes differ in what they aim at: a fixed quantizer, an encoder quality setting, an average bitrate for the whole stream, or an average bitrate under a limit on bursts. A target is not a guarantee, and whatever a mode pursues, something else has to move.

Four modes on one sequence

The sequence is ten seconds long: a quiet section, a busy one and one in between, each with an invented complexity (shaded lightest to darkest in the plots). A frame's modeled size rises with its complexity and falls as its quantizer rises. Choose a mode and its target, and compare what stays flat. The sizes are modeled and quality is not measured. The model has no frame types, and macroblock-tree, which x264 has on by default, is off.

26
← 18: finer34: coarser →
off
← 300 kbit/s1,200 kbit/s →
Average, kbit/s
QP by section
Frame size by section
Simplified demo: the complexities are invented, and a frame's size is modeled as 1.25 × complexity ÷ quantizer scale^1.1 kilobits. The quantizer scale for a QP is x264's formula. The four controllers are simplified rules adapted from x264's, with --qcomp 0.6 and macroblock-tree off: the rate factor formula with a reference complexity of 80 chosen for the demo, where x264 scales by the picture's size in macroblocks and by whether B frames and macroblock-tree are on; the average bitrate feedback with its usual bound of 4 QP between frames, started at QP 24; and the buffer rule. In its constant bitrate mode the demo keeps the average bitrate feedback running, where x264 switches it off, and it leaves out the decay x264 applies to its running sums. Not modeled: frame types, x264's size predictors (the demo knows each frame's size exactly), and macroblock-tree, which changes how the rate factor is applied. The two "by section" tiles give the averages for the quiet, busy and medium sections in that order.

With the sliders at 26 and 700:

The modes in x264

--qp sets constant quantizer, --crf the rate factor and --bitrate average bitrate in kbit/s; the default is --crf 23. Constant bitrate is not a mode of its own: it is one-pass average bitrate under a buffer whose maximum rate is no higher than the bitrate, which the next page explains. The rate factor is not a quality measure.

Frame types, filler and the feedback options
  • --qp is the QP of P frames, with I and B frames offset from it.
  • The buffer is given by --vbv-bufsize and --vbv-maxrate, and that setup turns on a minimum-rate behavior. Such a stream may still use less than the maximum rate: x264 pads with filler only under --filler, which --nal-hrd cbr turns on.
  • --ratetol (default 1.0) sets how strongly average bitrate feedback reacts to drift; it is not a band without feedback or a guarantee around the target. --qpstep (default 4) sets the usual bound on how far QP moves between frames in average bitrate. Strong feedback widens the bound, and the buffer rule acts after it.
  • x264 computes each frame's quantizer scale as its complexity raised to a power, divided by a constant derived from --crf. Its source calls the scaling of that constant arbitrary, meant to make the rate factor somewhat similar to a QP; it is not found from the video's average frame. The last page of this unit is about that power.

Trade-offs

Sources

Read 2026-11-15, at the commit linked.