Patent ID: 7515761

Claim:
An encoding device performing run-length encoding and variable-length encoding, comprising: an input portion for sequentially inputting one block of m×n input data; a comparing and determining portion for determining for each individual data unit of the one block of m×n input data whether its value is 0 (zero); an information register for storing determination result information on the results of the determination by the comparing and determining portion; a data buffer for storing the one block of m×n input data; a write control portion for sequentially updating addresses in the data buffer and writes the one block of m×n input data to the data buffer, the write control portion updating addresses and writing the input data simultaneous with the comparing and determining portion determining whether each individual data unit of the input data has a value of 0 (zero); a read control portion for controlling selective reading output data from the data buffer in such a manner that only data having a value that is not 0 (zero) are selectively read out based on the determination result information stored in the information register; a run-length encoding portion for performing run-length encoding by calculating the interval between the bit position corresponding to the current data selectively read out in the information register and the bit position corresponding to the last data selectively read out in the information register at the same time that the read control portion selectively reads output data from the data buffer; and a variable-length encoding portion for performing variable-length encoding using as a data pair the output data that have been read selectively from the data buffer and the number of consecutive data having a value of 0 (zero) that is obtained by the run-length encoding portion, wherein the input data is written into the data buffer simultaneously with output data from the data buffer being transferred to the run-length encoding portion.