Method and encoder for encoding a digital video image stream. The encoding
includes spatial compression of still images in the video stream and temporal compression
between the still images. The spatial compression is carried out by converting
a time domain image of a macroblock to a frequency domain image of the macroblock,
taking the discrete cosine transform of the frequency domain image, transforming
the discrete cosine transformed macroblock image by a quantization factor, and
run length encoding the quantized discrete cosine transformed macroblock image.
The temporal compression is carried out by reconstructing the run length encoded,
quantized, discrete cosine transformed image of the macroblock, searching for a
best match macroblock, and constructing a motion vector between them. This forms
a bitstream of run length encoded, quantized, discrete cosine transform macroblocks
and of motion vectors. This bitstream is passed to and through an external buffer
to a transmission medium. The number encoded bits read by a host from the external
buffer is fed back to the encoder for calculation in real time of a dynamic buffer
level indicator indicative of the fullness of the external buffer. The encoder
may generate a BUFFER—EMPTY flag, BUFFER—ALMOST—FULL
flag and/or BUFFER—FULL flag for the host.