Patent ID: 7450775

Claim:
An image processing apparatus, comprising: a variable-length compression section which performs variable-length compression on image data of each block included in one page; an adjusting section which adjusts each block to a constant data length by adding to or truncating part of a variable-length code of each block obtained by compression by the variable-length compression section; a bit-length storage which stores a data length of bits added by the adjusting section to the variable-length code of each block; a determination section which determines whether the adjusting section has added respective bits to all blocks included in the one page; a variable-length-code storage which stores variable-length codes obtained by erasing the added bits from the variable-length codes of the all blocks; a block-data-length conversion section which adds respective bits of different data lengths to variable-length codes of blocks read from the variable-length-code storage, converting data lengths of the blocks into a shorter constant data length than the constant data length, if the determination section determines that the respective bits are added to the all blocks, the different data lengths being obtained by subtracting a shortest data length from a data length of each block stored in the bit-length storage; a page memory which stores the variable-length code of each block, the variable-length code having the constant data length; and an erasure section which erases the bits added to the variable-length code of each block, when the variable-length code is read from the page memory to an expansion section which performs expansion processing on the image data, wherein the variable-length compression section, the adjusting section, the bit-length storage, the determination section and the variable-length-code storage are operated when the image data is compressed, and the block-data-length conversion section, the page memory and the erasure section are operated when the image data is subjected to the expansion processing by the expansion section.