Patent ID: 7253752

Claim:
A coding apparatus comprising: symbol-string searching means for searching a predetermined search range of a data buffer used for holding input data for a state of matching a symbol sub-string serving as a coding object of said input data; internal-state holding means used for holding a predetermined internal state; matching-length coding means for assigning a matching-length code to a matching length representing the length of said symbol sub-string in a matching state detected by said symbol-string searching means as a result of a search process in an assignment process according to an internal state held by said internal-state holding means and then updating said internal state held by said internal-state holding means in accordance with said matching length; and symbol-string coding means for coding said symbol sub-string on the basis of the position of said symbol sub-string in a matching state detected by said symbol-string searching means as a result of a search process and on the basis of said matching-length code assigned by said matching-length coding means, wherein said matching-length coding means: resets an internal state held by said internal-state holding means to a lowest stage if said matching-length code is smaller than a predetermined threshold value; drives an internal state held by said internal-state holding means to transit to a higher stage if said matching-length code is equal to a maximum value; or drives an internal state held by said internal-state holding means to transit to a lower stage if said matching-length code is at least equal to said predetermined threshold value but smaller than said maximum value.