use -O3 instead of -Ofast for portability
fix bitfreq
Some sanity checking
Turn off optimization on debug
clean up unused consts, use block size instead of magical loop offset, look for frames more carefully