Patent ID: 8311352

Claim:
A lossless compression-encoding device comprising: a differential coding part that calculates a prediction value of data to be compressed, and that calculates a prediction error that is a difference between the prediction value and an actual value of the data to be compressed, the actual value being a positive value; a prediction error conversion part that performs reversal of a sign bit of the prediction error output by the differential coding part, with the prediction error in 2's complement form, in case that the reversal of the sign bit of the prediction error in 2's complement form decreases an absolute value of the prediction error; and a variable-length coding part that performs variable-length coding on the prediction error that has been processed by the prediction error conversion part to generate a variable-length code representing the prediction error, and that outputs the variable-length code as compressed data in such a manner that a code length of the compressed data decreases as the absolute value of the prediction error decreases.