Get rid of some multi threaded coded in encode_frame