Skip to content

Geolm/bc_crunch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bc_crunch

C Standard Build Status

bc_crunch is a tiny, dependency-free C99 library for lossless compression of GPU-compressed texture blocks BC1, BC4, BC3, and BC5.

Huffman Branch

This branch introduces a Huffman-based backend aimed at improving decompression speed while preserving a strong compression ratio.
At the moment, it is implemented for BC1 only.

Despite the focus on fast decoding, the average compression ratio remains better than zlib.

Compression Ratio (BC1)

  • bc_crunch: 1.519476
  • zlib: 1.436144

Performance

Benchmarks were run on my M1 Pro by compressing and decompressing a 1024×1024 BC1 texture 100 times.

Compression

  • Time: 5.829384 s
  • Throughput: 8.577236 MB/s

Decompression

  • Time: 0.348752 s
  • Throughput: 143.368234 MB/s

Decompression throughput is four times (4x) higher than the arithmetic encoding implementation (35MB/s).

About

tiny dependency-free lossless compressor for BC/DXT texture streams (C99, ~1000 LoC)

Topics

Resources

License

Stars

Watchers

Forks

Contributors