First implementation of scan optimisation as done by jpgcrush. Many parameters are currently hardcoded which should be changed. Implementation is missing for monochrome.