Patent ID: 7961783

Claim:
A method of rate control in a video encoder comprising: utilizing the video encoder to perform a first encoding step to encode macroblocks of a current frame by utilizing a first quantization parameter to thereby generate a residual signal for the current frame; utilizing the video encoder to estimate a number of header bits for each macroblock mode according to the residual signal to thereby estimate a total number of header bits for the current frame; utilizing the video encoder to estimate an available number of texture bits according to the total number of header bits for the current frame; utilizing the video encoder to determine a second quantization parameter according to the estimated available number of texture bits; utilizing the video encoder to perform a second encoding step to encode the residual signal for the current frame by utilizing the second quantization parameter allocating a total number of target bits to the current frame; determining a number of texture bits according to the total number of target bits and the estimated total number of header bits for the current frame; and determining the second quantization parameter according to rate and distortion values of a rate and distortion optimization process and the number of texture bits identifying coded blocks in the encoded macroblocks of the current frame after the first encoding step; modeling distortion for the coded blocks to generate an estimated distortion for the coded blocks; and modeling the number of texture bits for the current frame to generate the estimated number of bits for the coded blocks.