Patent ID: 7227998

Claim:
An image processing apparatus for compression-encoding image data, comprising: a first compression encoding unit in which a quantization step can be changed; a second compression encoding unit in which the quantization step can be changed and which is adapted to decode and re-encode code data compressed by said first compression encoding unit; a code amount monitor unit adapted to monitor a code amount generated by said first compression encoding unit and determine whether the code data amount has reached a predetermined amount; a setting unit adapted to, when said code amount monitor unit determines that the code amount has reached the predetermined amount, determine and set a next quantization step in each of said first and second compression encoding units; and a control unit adapted to, when the quantization step is changed by said setting unit, cause said second compression encoding unit to re-encode the preceding code data precedingly generated by said first compression encoding unit, store the code data that has undergone re-encoding in a predetermine storage unit as code data after a parameter of said first compression encoding unit is changed, and store the code data generated by said first compression encoding unit in said storage unit as subsequent code data, wherein said setting unit includes a unit adapted to compare first predicted time required for re-encoding by said second compression encoding unit for the preceding code data with second predicted time when the code amount reaches the predetermined amount again in encoding in said first compression encoding unit and obtain the quantization step for which the first predicted time is shorter than the second predicted time so as to determine the quantization step to be set for each of said first and second compression encoding units.