A method and apparatus for rate control for a constant-bit-rate
finite-buffer-size video encoder is described. Rate control is provided
by adjusting the size of non-intra frames based on the size of intra
frames. A sliding window approach is implemented to avoid excessive
adjustment of non-intra frames located near the end of a group of
pictures. A measurement of "power" based on a sum of absolute values of
pixel values is used. The "power" measurement is used to adjust a global
complexity value, which is used to adjust the sizes of frames. The global
complexity value responds to scene changes. An embodiment of the
invention calculates and uses L1 distances and pixel block complexities
to provide rate control. An embodiment of the invention implements a
number of bit predictor block. Predictions may be performed at a
group-of-pictures level, at a picture level, and at a pixel block level.
An embodiment of the invention resets a global complexity parameter when
a scene change occurs.