Time the bm_scanline conversion. It's about 1500 cycles total, spending around 35 cycles/pixel inside the loop.

Use -O3 instead of -Os, it appears to be a bit faster (3%, one cycle/pixel).