compress data before encoding