Y
Hacker News
new
|
ask
|
show
|
jobs
by
lorenzhs
3476 days ago
That only works for compile time constants, though. With a power of two sized buffer you can just store the mask and decide how large you want your buffer to be at runtime.
2 comments
_ihaque
3476 days ago
libdivide (
http://libdivide.com
) implements similar logic at runtime
link
nullc
3476 days ago
You can also compute the optimization at runtime, same as the compiler does. Libtheora contains code for this, used for quantizing video data.
link