Patent ID: 7916783

Claim:
A method for rate distortion optimization (RDO) based rate control comprising: Step 1: performing bit allocation for every picture in a GOP which includes an I frame, a P frame, or a B frame, and based on the allocated bits a predicted quantization parameter being used to do a first rate distortion optimization mode selection for every macroblock in the current picture, wherein the predicted quantization parameter is the quantization parameter of a previous macroblock, and a coding mode minimizing the following formula is selected as the initial coding mode for the current macroblock: D(s,c,MODE|QP)+λ MODE R(s,c,MODE|QP) wherein s is the luma value of the original macroblock, c is the luma value of the reconstructed macroblock, λ MODE is the lagrangian constant; for I/P frame, λ MODE =0.85×2 Q m-1 /3 ; for B frame, λ MODE =4×0.85×2 Q m-1 /3 ; D(s, c,MODE|QP) is used to evaluate the distortion of the current macroblock after it is coded with mode MODE; R(s,c,MODE|QP) is the bits used to code the macroblock with mode MODE; QP is a quantization parameter for the current macroblock, and is equal to the predicted quantization parameter in the first rate distortion mode selection; Step 2: the information collected from the first rate distortion mode selection being used to calculate a final quantization parameter for rate control, and if the final quantization parameter is different from the predicted, a second rate distortion mode selection will be executed again.