I have a buffer with many positive 16bit values (which are stored as doubles) that I would like to quantize to 8bit (0-255 values).
According to Wikipedia the process would be:
- Normalize 16 bit values. I.e. find the largest and divide with this.
- Use the Q(x) formula with M=8.
So I wonder, if C have a function that can do this quantization, or does anyone know of a C implementation that I could use?
Lots of love,
Louise
Assuming the value
dis in the interval[0.0, max]:I’m not sure what you mean by “16-bit values;” double precision values are 64-bit on any system using IEEE-754. However, if you have values of another numeric type, the process is effectively the same.