Preprocesses data for compression.