Hacker News new | past | comments | ask | show | jobs | submit login

> For example, if you have a relatively wimpy camera that streams out a 160×120 grayscale image, it might be fun to see how far you can push something like combining:

I'm typically not one for self-promo but I did this with video and you can get 90% compression with exactly those three basic steps. RGB -> YUV420, delta encoding, then basically-upgraded-RLE. You can find the guide here: https://github.com/kevmo314/codec-from-scratch




Nice! The caveat being that this assumes we have little to no shot noise I guess? Since that is where lossy codecs typically beat lossless.


Yep adding noise would mess up the deltas which would reduce the efficiency. This can be mitigated with a quantizer, which I was hoping to write about next.

I suspect it's possible to achieve 99% lossy compression without getting too complex to be understandable in the toy codec with a couple more of these similar techniques.


Thanks! I just forked it. Do you know if Apache-2.0 code can be included into a closed source project?





Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: