The computation does not rely on floating point, the patch on the same page for ffmpeg uses only integer arithmetic; the javascript version is merely an interactive play-thing. Showing how to use these short procedural masks both for high bitdepth -> 1bit, as well as -> 4bit or 8bit. Meaning the same formula is fit for driving both high fps 1bit dithers; as well as high fidelity grayscale stills using slower waveforms. "A dither" started out as recreational programming as well; but turnd out interesting enough that I spent too much time optimizing and tuning it's visual characteristics. Fun to find something computationally cheap; that is equvilanet to the much more expensive computation of "void and dither" which creates masks that yield specific green/blue noise frequency distributions (using a, eew, patented algorithm).
IIRC on my x86 laptop it was less than ~50% slower than using a LUT. This is sufficient for my current prototype hacks replacing it with a 2d LUT/mask is among low hanging fruits I'll care about at a later stage when/if I care about battery life or need to do more computations per frame.
Use it if you want to, (I should probably wipe some dust of the tiny little framebuffer abstraction "library" I am using and put it out there, with a bit of help static binaries I build with the toolchain I use should work on kobo's as well as some kindles.)
|