frontend: tune scanline implementation a bit