To provide an image coding apparatus that can generate a code that can be
decoded by a general decoding apparatus while attaining a high coding
speed. As a result of processing in a plurality of prediction units 21, a
control unit 11 generates a predicted pixel value for a pixel of interest
based on a pixel value of a predicting pixel located at a distance from
the pixel of interest, the distance being predetermined for each pixel
value prediction unit 21, counts, as a run-length for each pixel value
prediction unit 21, the number of times that the pixel value of the pixel
of interest successively correspond with the predicted pixel value,
selects any of pixel value prediction units related to a run-length of
one pixel or more, and outputs a code by referring to a predetermined
code table with respect to a distance between the pixel of interest and
the predicting pixel for the selected pixel value prediction unit 21 and
the run-length thereof. The code table is defined to include, as a
redundant code, a code related to a distance other than the distances
between the pixel of interest and the predicting pixels.