All pastes #383625 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-06 14:46 UTC
rendered paste body
inline void convertF32toS16LE(float* input, qint16* output, int size)  {
	for (int i = 0; i < size; ++i) {
		qint32 tmp = qBound(-((qint32)2147483647)-1, (qint32)(*input++ * 2147483647.0 + 0.5), (qint32)2147483647);
		*output++ = tmp >> 16;
	}
}