Added multi-thread support for codeword histogram calculation.