Many MPEG-2 encoding applications are realtime; this implies that the video
signal must be encoded with no significant lookahead. However, there exist
non-real-time applications that do enable us to first analyze a video sequ
ence entirely, and, using the analysis results, to optimize a second encodi
ng pass of the same data. One example of such an application is the digital
video disk (DVD), which is designed to facilitate a variable-bit-rate (VBR
) output stream. In that case, it is possible to let the MPEG-2 encoder pro
duce a video sequence with a constant visual quality over time. This is in
contrast to constant-bit-rate (CBR) systems, where the rate is constant but
the visual quality Varies with the coding difficulty. This paper describes
a two-pass encoding system that has as its objective to produce an optimiz
ed VER data stream in a second pass. In a first pass, the video sequence is
encoded with CBR, while statistics concerning coding complexity are gather
ed. Next, the first-pass data is processed to prepare the control parameter
s for the second pass, which performs the actual VER compression. In this o
ff-line processing stage, we determine the target number of bits for each p
icture in the sequence, such that we realize the VER objective. This means
that the available bits are appropriately distributed over the different Vi
deo segments such that constant visual quality is obtained. To be able to q
uantify the constant visual quality, perceptual experiments are described a
nd a practical model is fitted to them. Exceptional cases such as scene cha
nges and fades are detected and dealt with appropriately. We also ensure th
at the second-pass compression process does not violate the decoder buffer
boundaries. Finally, the encoding is performed again, but now under control
of the processed first-pass data. During the running of this second pass,
a run-time bit-production control mechanism monitors the accuracy and valid
ity of the first-pass data, correcting errors in prediction and observing t
he buffer boundaries. Results are compared to CBR operation.