3 ms·
These kinds of formats have been somewhat explored by camera makers for their raw formats. Since the computing resources in the cameras can be quite limited the
by pedrocr 5y ago
These kinds of formats have been somewhat explored by camera makers for their raw formats. Since the computing resources in the cameras can be quite limited there are a few formats that try to occupy this space of simplicity with still some tricks for compression. Samsung's various SRW encodings remind me most of this:
https://github.com/pedrocr/rawloader/blob/a59bb78d156277781ad404d0c783edc4a0abce3d/src/decoders/srw.rs https://github.com/pedrocr/rawloader/blob/a59bb78d156277781a...
- formerly_proven 5y agoLossy RAW is sometimes even simpler than that. E.g. Nikon's old compression was just remapping values in a log-like fashion, which reduced resolution in the brightest few stops[1] to save a few bits per sample. [1] Perception is pretty logarithmic as usual, so for a 14-bit readout, half the values represent the brightest stop and a little bit, the other half holds the other 12+ stops.
- pedrocr 5y agoThe simplest form is just to pack 10 or 12 bit values. There's all kinds of variations of that: https://github.com/pedrocr/rawloader/blob/a59bb78d156277781ad404d0c783edc4a0abce3d/src/decoders/packed.rs https://github.com/pedrocr/rawloader/blob/a59bb78d156277781a... There are a few formats that use a curve and less bits. They do become lossy and doing dithering on decompress is useful to avoid banding. The Nikon one you mention was only used very early and is decoded by decode_8bit_wtable() in that file. It's just looking up the 8 bit value in the table and then adding some randomness to prevent the banding.
- IshKebab 5y agoYeah I don't think there are any new ideas here. RLE, differential encoding and dictionary encoding have all existed for decades. The interesting thing is that it comes close to PNG.