Very neat. Breaking up multiplications and divisions into bit shifts, and lookup table to trade off memory for runtime, are indeed nothing new to engineers working on the low level, but this paints a very pretty picture of how this looks in practice.
7 comments
[ 5.6 ms ] story [ 20.3 ms ] threadThey could go one step further and calculate the table as needed and use it as a cache.
For an single image scaling it might get a little bit better.
1) you only need the first 1/4 of the Sine table since the remaining 3/4 are either the first 1/4 in reverse and/or with the sign flipped.
2) and of course Sine can also be used as a Cosine lookup if you add pi/2 radians to the cosine angle (wrapping around of course).
3) to avoid the size needed for a table of floats you can of course use integers (scaled by some factor) or fixed-point values.
4) and simple interpolation would get you seemingly more precision.
(Combining all the above was a bit gross so documentation and a good SPI helped.)
I used a Hewlett Packard development system with a 12" hard disk.
Good times.