Basic x86 optimizations. 7x speedup on vertical pass, up to 4x speedup on horizontal pass.