The present invention allows an image to be coded within a target size
without necessitating the image to be input again during the coding of
the image, with a mode reflecting a user's intention for coding. To solve
this problem, input image data is coded at coding unit 102 and stored
into first and second memories, respectively. Coding sequence unit 108
monitors the quantity of codes. When a set value is determined to be
reached, coding sequence unit 108 makes data in first memory to be
discarded and directs coding means to further increase a quantization
step, and continues coding. As previous coded data is stored in second
memory, the data is re-coded with the same quantization step as that of
coding unit 102 after changing of a parameter at re-coding unit 109, and
the re-coded data is stored into first and second memory. At this moment,
coding unit 102 and re-coding unit 109 perform an operation and coding on
quantization error according to a mode of quantization operation
designated at mode designation unit 125.