Trying some different strategies for optimizing the decoder. The code in #ifdef 1 is slightly faster by my measurements, but a whole lot uglier.
Both versions run within the margin of error on my machine so we'll go with the simpler one.