multithread encoding support