chocolate42 / qoipond

Lossless image format inspired by QOI “Quite OK Image” format
MIT License
1 stars 1 forks source link

Implement ZSTD+Dictionary entropy coding #7

Open chocolate42 opened 2 years ago

chocolate42 commented 2 years ago

Experiments have not been successful yet, it's easy to implement but the results are near-identical to the non-dictionary ZSTD encoding. The dictionary tried was trained (with zstd --train) against the output of converting all "images" except icons_64 with --effort 5, resulting in a ~112KB dictionary that must be present at encode and decode. The current theory is that qoip files are not good candidates for dictionary encoding because the tags and planes are bit-aligned, a large enough set of QOIP files may act like noise to a dictionary as zstd --train has no concept of tags or planes.

An intermediate form that makes tags/planes byte-aligned might benefit a dictionary encoder although the extreme bloat might overwhelm the benefit.