Patent ID: 8437565

Claim:
A method of encoding a portion of an image represented by quantized coefficient data, the method comprising: updating rate statistic information based on quantized coefficient data corresponding to a first codeblock; selecting a first set of fractional bitplanes corresponding to the first codeblock to store in a buffer based on rate statistic information updated based on quantized coefficient data corresponding to the first codeblock, a data margin value, and a codeblock overhead estimate; storing said selected first set of fractional bitplanes in said buffer; updating said rate statistic information based on quantized coefficient data corresponding to a second codeblock; selecting a second set of fractional bitplanes corresponding to the second codeblock to be output from the buffer as a function of the updated rate statistic information; formatting the second set of fractional bitplanes corresponding to the second codeblock; updating the codeblock overhead estimate based on the amount of data added to the second set of fractional bitplanes corresponding to the second codeblock; updating information indicating the amount of data included in an encoded image output based on the amount of data added to the second set of fractional biplanes corresponding to the second codeblock by said formatting and the amount of data included in said second set of fractional bitplanes; determining if the amount of data included in the encoded image output exceeds a target amount based on the total amount of data available for encoding the portion of the image for which data has been included in the encoded image output; adjusting said data margin value based on said determination; and selecting a second set of fractional bitplanes corresponding to the first codeblock to be output from the buffer as a function of the updated rate statistic information and said updated information indicating the amount of data included in the encoded image output.