Patent ID: 7426309

Claim:
A method of controlling an encoding rate of a video encoder, the method comprising the steps of: (a) calculating a target number of bits-per-picture of a current picture type by using the average number of encoding bits-per-picture and the average target number of bits-per-picture of each picture type I, P, and B of a previous group of pictures (GOP) and a buffer balance value; (b) calculating a quantizer scale value corresponding to a first macroblock-row of the current picture type by using the average quantizer scale value of a previous picture of the same type as the current picture and using the target number of bits; (c) calculating a target number of bits per unit row and a number of encoding bits per unit row in a previous row for each macroblock-row of the current picture type, calculating a quantizer scale value corresponding to the current row by using functions of the target number of bits-per-picture and the number of encoding bits per unit row, and calculating a total number of encoding bits-per-picture of the current picture type; (d) storing the quantizer scale value calculated in step (c), and outputting the quantizer scale values of the previous macroblock-rows and of the previous picture types; and (e) calculating the buffer balance value by using the total number of encoding bits-per-picture and the average target number of bits-per-picture of the current picture type.