Abort search if close enough

Stop searching when quality is very close to the threshold. Sometimes saves a couple of encoding steps.