Patent ID: 8374451

Claim:
An image processing device comprising: a variable-length-table selecting unit configured to select a variable-length table corresponding to an average value obtained by averaging encoding values corresponding to upper-adjoining encoding blocks and left-adjoining encoding blocks of an encoding block as an encoding target in encoding an input image that is line-scanned in units of scan blocks, wherein each scan block is constituted by a plurality of encoding blocks including a plurality of pixels, wherein the variable-length-table selecting unit equates an encoding value of the upper-adjoining encoding block with that of the left-adjoining encoding block when the encoding block is at an upper end of a scan block; a variable-length encoding unit configured to perform variable-length encoding on the encoding block by using the variable-length table; a pre-encoding unit configured to encode the input image by quantizing the input image using a quantization step based on at least a quantization factor, thereby generating the encoding target data; a basic quantization factor determining unit configured to determine a basic quantization factor in which a generated code quantity obtained by performing main encoding on the input image is predicted to be approximate to a target code quantity on the basis of a generated code quantity obtained by preforming variable-length encoding on the encoding target data by the variable-length encoding unit; a main encoding unit configured to perform main encoding on the input image on the basis of the basic quantization factor determined by the basic quantization factor determining unit; and a back search unit configured to perform division on only a first half portion of tramsformation coefficients of the input image on which orthogonal transformation has been performed when the hack search unit detects quantization factors used in a previous encoding.