Patent ID: 8542730

Claim:
A system for encoding video, comprising: a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a P-slice; and a processor in communication with the storage, the processor configured to: determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock; determine an average of the quantization parameters for the neighboring macroblocks; select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks; select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter; determine a quantization parameter in the range which results in an optimal quantization of the macroblock; and encode the macroblock using the determined quantization parameter.