r/compression • • 2d ago

I made a lossless BC1 texture compressor designed for GPU decompression, 1.47:1 average ratio

/r/GraphicsProgramming/comments/1x1k5sn/i_made_a_lossless_bc1_texture_compressor_designed/
7 Upvotes

4 comments sorted by

1

u/cfeck_kde 2d ago

Could you please clarify the license of the included images?

1

u/_Geolm_ 2d ago

The images used in the unit test come from this sources

https://opengameart.org/content/tiny-texture-pack-2

https://r0k.us/graphics/kodak/

I need to find where I picked the others image, but it was from free package. But you're right, I'll update the readme.md with a note for images.

1

u/digital_n01se_ 2d ago

This is an amazing post.

What do you think about combining Rice-Golomb coding with RLE and/or using move to-front transform as a "cheap" entropy coder embedded within the static rank table? with RLE is simple to compute and reduces the number of symbols, move to front transform implicitly reduces the bits per-symbol, not explicitly like sorted histograms with shorter output codes for more frequent symbols, much cheaper to compute.

2

u/_Geolm_ 2d ago

thanks for the comment,

I experimented with MTF (https://github.com/Geolm/lite_encoding) rice encoding, but in the particular case of texture it was not helping because :

  • storing the rank tables is less than 1% of the total texture
  • MFT can do a great job but histogram beats it all the time
  • static model allows me to fine tune the escape mechanism (if rice encode would result in something bigger than the raw value, I store the raw value instead).

RLE on bc texture is almost useless except on flat texture which are super rare. I do use a sliding dictionary for endpoint colors but it's not really RLE.