A data compression device includes an encoding unit that generates encoded
data by compressing image data in units of a band. Encoded data storage
units have addresses for storing encoded data for each band and a
settings receipt unit receives start address settings in the storage
units. A control unit stores the data in the storage units every time
encoded data for each band is generated. A start address acquisition unit
acquires the start address of an empty area where encoded data is not
stored. The control unit sets the start address of an empty area in a
storage unit different from the storage unit where the encoded data that
is being generated is to be stored. The encoding unit then starts to
generate encoded data for a next band, and stores the generated data in
the storage unit indicated by the start address set in the setting
receipt unit.