logoalt Hacker News

Nibnib: Image compression with extreme decompression speed

148 points • by raphlinus • last Friday at 4:17 AM • 24 comments • view on HN

Comments

raphlinus • today at 1:10 AM

If you have an Adafruit Fruit Jam, you can run the demo on that board [1]. It can stream 640x480 video off an SD card at 60fps, as well as display a static image from flash.

Also possibly of interest to HN, the decoder[2] is written in a new low level language called symbolasm[3], which seeks to combine the advantages of assembly language (it's possible to reason about and optimize performance with few limits) with some of the affordances of C, especially named variables and struct fields.

[1]: https://github.com/raphlinus/vic-2350

[2]: https://github.com/raphlinus/vic-2350/blob/main/image.sy

[3]: https://github.com/raphlinus/symbolasm

➕ show 3 replies
augment_me • yesterday at 9:27 PM

1) IMO pointless to put an emphasis on extreme decompression speed but not show numbers against JPEG even

2) BCx essentially does the same codebooking/paletting but more efficiently by allowing you to interpolate between two palette entries for an even larger compression

➕ show 2 replies
zahlman • yesterday at 9:07 PM

This seems like straining the definition of "compression". We have a delta-coding filter and then palettization? That's it?

Edit: I should say, I find it surprising (but cool) that it apparently works so well. I would have expected errors to accumulate since the decoder has to un-delta-code. I saw mention of Floyd-Steinberg dithering and presumably that's what it's for; seems hard to get it working across multiple colour axes simultaneously, but the complexity is all in the encoder, so.

➕ show 1 reply
Retr0id • yesterday at 9:27 PM

Worth noting that something perf-optimized for RP2350 is almost certainly not going to be optimal on a modern desktop-class core (with deep pipelines and wide ILP/SIMD).

➕ show 1 reply
wiml • yesterday at 9:05 PM

Fun. Vaguely reminiscent of the Amiga HAM video mode.

vardump • yesterday at 10:34 PM

This reminds me a bit of Amiga HAM. Similar horizontal fringing.

I guess you could also call Amiga's HAM graphics mode a compression method. Getting 12-bit (4096 colors) with just 6 input bits, with the original Amiga chipset, often called as "OCS".

Or later 262144 colors with 8 input bits, with the AGA chipset.

whitten • yesterday at 10:27 PM

I'm impressed. The imbalance between encoding and decoding speeds seems a useful strategy when you are building special purpose hardware and software applications. It seems if you're making a central source of data that is able to tolerate a much slower write process versus a quick read process that this approach can be advantageous. Maybe using this core method in a problem space which maps to the radio/signal broadcast process of many receivers but a central source of truth. I can imagine if you had an information base that changed slowly or which was pre-processed in a batch fashion, that it could use this method. It doesn't even need for the central data to be decoded into a graphical image.

I think this radio model could map the problem space for a centralized system that maintained a list of items and their prices which needed to be broadcast to the retail outlets on a regular basis.

Or a common cache storage to make some complex data manipulation calculations centrally performed available to a large number of satellites who just need the end results but do not have the need to do local calculation.

➕ show 2 replies