Merge "Fix multithread encode test"