I managed to figure it out. I can say with confidence that "lookahead" works by default for x264. 3 b-frames are used. To turn off lookahead, you can use the lookahead_threads = 0 command. I am still testing the most optimal number of b-frames to get the best quality. I can confidently say that no more than 2, the rest of the tests are different.