A system and method is provided for variable bit rate encoding using a
complexity ratio. Quantization parameter is calculated using a complexity
ratio, which is equal to a local complexity divided by a global
complexity. Complex pictures are allocated a larger bit budget relative
to simple pictures. With the larger bit budget the quality of complex
pictures can be maintained while reducing the overall size of the encoded
video stream.