tcsullivan / consteval-huffman

Compile-time Huffman coding compression using C++20
The Unlicense
165 stars 10 forks source link

Optimize decoding tree to save more memory #2

Open tcsullivan opened 3 years ago

tcsullivan commented 3 years ago

See here.

Most importantly, we need to allow for larger decoding trees. Secondly though (and maybe this should be a separate issue), the decoding tree could likely be refined/redesigned to either take up less memory or work more efficiently.

tcsullivan commented 3 years ago

Forgot that the input data gets left uncompressed if compression doesn't save space. The bug was simply in decoder::end returning a byte beyond what it should have for the uncompressed scenario. I'll commit the fix for the bug, but will still leave this issue up for the possibility of enhancing the decoder tree.