An image processing apparatus, and a method of controlling the same, for
making it possible to execute decoding of compressed image data
appropriately, in a processing time needed for decoding that will not
detract from user convenience, and in conformity with amount of code
error contained in the image. An encoded data input signal has its header
information analyzed by a header information processor, which outputs an
encoding-parameter output signal. The image information of the encoded
data input signal is decoded by a variable-length code decoder, which
produces an output signal that is a series of orthogonal transformation
coefficient sequences. These two output signals are input to a image data
reconstruction unit, which reconstructs the image data. If the encoded
data input signal contains a code error, then the encoded data input
signal is corrected using correction data. The correction data for
correcting the encoded data input signal is decided based upon the number
of detection of code errors.