Y
Hacker News
new
|
ask
|
show
|
jobs
by
d23
1702 days ago
Cool post! Thanks for submitting. I would never in a million years have thought to try out a polynomial fit for something like this. Unsurprisingly, it was slower, but still cool to even see you thinking that way at all.
1 comments
klyrs
1702 days ago
While I'm big on lookup tables for jobs like this, I'd have reached for bitmasks long before that polynomial...
link
kardos
1702 days ago
Hard to compete with a 4-byte lookup table, but for decoding the 256-byte table can become: return ((dibit | (dibit -1))>>1) & 3;
link