Having implemented ippiFilterWiener on 8u and 32f (see the next post) I turned to 16u. There is an ippiFilterWiener_16s but not an ippiFilterWiener_16u. Well, I thought, then we simply convert from 16u to 16s, and then back after the Wiener filter.
I found ippiConvert_16s16u_C1Rs and ippiConvert_16u16s_C1RSfs. These are rather mysterious functions. The latter has a scaleFactor, but no combination of these functions (I think I tried all) converts between 16u and 16s without (severe) data loss.
So, I looked at the Vector Initialization Functions and Essential Functions chapters for vector primitives to convert between 16u and 16s. No luck. Then I looked in the Vector Mathematical Functions chapter of the Intel® Math Kernel Library. No luck either .....
The saving idea then was to call ippiLUTPalette_16u with a LUT that consists of
32768 16-bit words equal to their index OR-ed with 0x8000
32768 16-bit words equal to their index CLEAR-ed with 0x8000
That finally worked, except that ippiLUTPalette_16u doesn't have an inline variant. Note that the 16u16s and 16s16u conversions have identical LUTs.
The question remains what ippiConvert_16s16u and ippiConvert_16u16s really do and why so ?