Patent ID: 7106225

Claim:
A coding apparatus that outputs a code corresponding to input data, comprising: a storing unit storing a boundary value corresponding to a group, the group being made up of a plurality of input data candidates that have a same property, the group being divided into (i) a code presence sub-group made up of one or more input data candidates which have a corresponding variable-length code on a code table, and (ii) a code absence sub-group made up of one or more input data candidates which do not have a corresponding variable-length code on the code table, the boundary value indicating a boundary between the code presence sub-group and the code absence sub-group; an obtaining unit operable to obtain input data; a first judging unit operable to judge whether the obtained input data belongs to the group; a reading unit operable to, if the first judging unit judges affirmatively, read the boundary value from the storing unit; a second judging unit operable to judge whether the obtained input data is included in the code presence sub-group, using the read boundary value; and a generating unit operable to, if the second judging unit judges negatively, generate and output a substitute code in substitution for a variable-length code corresponding to the obtained input data.