3 ms·
There seem to be a few constraints regarding the object count (255 with just one byte). Even though you could say that most icons won't be complex enough to nee
by grenoire 10y ago
There seem to be a few constraints regarding the object count (255 with just one byte). Even though you could say that most icons won't be complex enough to need that, it's an unnecessary limitation that saves two or three bytes at best.
Other than that, pretty incredible work. Vector image compression at encoding level is definitely interesting. I alsolove posts in which binary formats are explained, so...
- wongarsu 10y agoVariable length integers could have easily increased the object count limit with only a very small increase in size. VLQ[1] would have been one good choice, but various other schemes would have allowed the same size as a one-byte encoding with up to about 250 objects while still allowing larger numbers. But of course that increases encoder and decoder complexity. For icons, a 255 style/path limit seems reasonable and keeps the code simple. [1]: https://en.wikipedia.org/wiki/Variable-length_quantity https://en.wikipedia.org/wiki/Variable-length_quantity
- Mindless2112 10y agoPrefixVarint [1] is usually a better choice than VLQ. It's faster to decode and requires the same number of bits. [1] https://news.ycombinator.com/item?id=11263378 https://news.ycombinator.com/item?id=11263378