35 operator float()
const {
return toFloat(); }
37 explicit operator int()
const {
73 return fromRaw((int16_t)(((int32_t)sample) >> 9));
83 int16_t
scale(int16_t sample)
const {
93 int32_t
scale(int32_t sample)
const {
95 return (int32_t)
clampRange64(prod, INT32_MIN, INT32_MAX);
154 float scaled = in * (float)
kScale;
155 scaled += (scaled >= 0.0f ? 0.5f : -0.5f);
156 if (scaled >= 32767.0f)
return 32767;
157 if (scaled <= -32768.0f)
return -32768;
158 return (int16_t)scaled;
162 if (v > 32767)
return 32767;
163 if (v < -32768)
return -32768;
168 if (v > hi)
return hi;
169 if (v < lo)
return lo;
174 if (v > hi)
return hi;
175 if (v < lo)
return lo;