The logic for 16bit is faster than the one for 32bit (it's only 3 variable shifts though). However, of course we can simply use the slower method for all output depths.