Patent ID: 8923390

Claim:
A method, comprising: dividing, by a system comprising a processor, an image into blocks of video data; transforming pixels of a block of the blocks into transform coefficients; setting a value of a variable bit-stealing parameter; adjusting a size of a quantization interval of quantization intervals and a dead zone based on the variable bit-stealing parameter, wherein sizes of remaining quantization intervals of the quantization intervals are unchanged, and wherein an absolute value of the variable bit-stealing parameter is less than or equal to a determined step size of the quantization intervals minus half of a step size of a selected quantization interval of the quantization intervals associated with the dead zone; in response to encoded video data being determined to satisfy a defined condition with respect to a relationship between an amount of improvement of a video quality of the video data and a change in size of a bitstream associated with the video data, adding at least one bit to the bitstream based on the variable bit-stealing parameter; and quantizing the transform coefficients, based on the quantization intervals, by mapping a coefficient value of a transform coefficient of the transform coefficients to a quantized coefficient value, wherein the encoded video data includes the quantized coefficient value.