1. A data compression device which sequentially inputs data, comprising: a prediction error calculation part which predicts a value of data before inputting the data, and each time the data is inputted, calculates a difference between a value of the input data which is inputted and a prediction value which is predicted for the input data, as a prediction error; a prediction error encoding part which encodes a value of the prediction error calculated and generates a prediction error code, each time the prediction error is calculated by the prediction error calculation part; a run-length counting part which counts a run-length of the prediction error calculated by the prediction error calculation part; a run-length encoding part which encodes the run-length counted by the run-length counting part and generates a run-length code, when the value of the prediction error changes; a code connecting part which connects the run-length code generated, to a prediction error code of a prediction error corresponding to the run-length code and generates a connected code, each time the run-length code is generated by the run-length encoding part; a code selection part which selects, via a processor, either one of the prediction error code for the prediction error and the connected code, as an output code, depending on the value of the prediction error calculated by the prediction error calculation part; and a specifying/instructing part which, prior to data input by the prediction error calculation part, specifies a particular value for a plurality of pieces of to-be-inputted data which are to be inputted by the prediction error calculation part, and instructs the code selection part to select the connected code as the output code for the prediction error of the value specified; wherein the code selection part selects the connected code for the prediction error, as the output code when the value of the prediction error calculated by the prediction error calculation part is the value instructed by the specifying/instructing part, and selects the prediction error code for the prediction error, as the output code when the value of the prediction error calculated by the prediction error calculation part is a different value.