Everything does, technically--but mostly by an immeasurable amount. The only options that affect second pass quality, by definition, are those that apply themselves unevenly to different parts of the video, changing the bitrate and/or frame distribution. The only option I have found that measurably affects second pass quality is --subme, which generally gives bad results at below 3 or so, probably due to reduced quality frame decision in the first pass. AFAIK the frame decision algorithm doesn't allow subme higher than 4, so higher isn't as useful in that regard. --subme 3 --me hex --partitions none will give a fast but still pretty accurate first pass.