Dual pass compression/decompression reimplemented