An encoder uses multi-pass VBR control strategies to provide constant or
relatively constant quality for VBR output while guaranteeing (within
tolerance) either compressed file size or, equivalently, overall average
bitrate. The control strategies include various techniques and tools,
which can be used in combination or independently. For example, in a
first pass, an audio encoder encodes a sequence of audio data partitioned
into variable-size chunks. In a second pass, the encoder encodes the
sequence according to control parameters to produce output of relatively
constant quality. The encoder sets checkpoints in the second pass to
adjust the control parameters and/or subsequent checkpoints. The encoder
selectively considers a peak bitrate constraint to limit peak bitrate.
The encoder stores auxiliary information from the first pass for use in
the second pass, which increases the speed of the second pass. Finally,
the encoder compares signatures for the input data to check consistency
between passes.