Data is compressed, which includes first through sixth patterns having
respective first through sixth values, where the first pattern precedes
the second pattern in the data, the third pattern precedes the fourth
pattern in the data, and the fifth pattern precedes the sixth pattern in
the data. Compression includes outputting a first code and the second
value if the second value exceeds the first value by more than a
predetermined amount, outputting a second code and a difference between
the third and fourth values if the fourth value does not exceed the third
value by more than the predetermined amount, and outputting the fifth
value and the sixth value if the sixth value exceeds the fifth value by a
predefined number.