Add multithreaded support in the DWT encoder.