mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
user lrint() and friends in inner loops instead of normal C casts to speed up a few things
This commit is contained in:
parent
1bb5e58fb3
commit
33b186e74d
5 changed files with 13 additions and 13 deletions
|
|
@ -130,7 +130,7 @@ static void ulaw_from_float32ne(unsigned n, const float *a, uint8_t *b) {
|
|||
float v = *(a++);
|
||||
v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
|
||||
v *= 0x1FFF;
|
||||
*(b++) = st_14linear2ulaw((int16_t) v);
|
||||
*(b++) = st_14linear2ulaw((int16_t) lrintf(v));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ static void alaw_from_float32ne(unsigned n, const float *a, uint8_t *b) {
|
|||
float v = *a;
|
||||
v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
|
||||
v *= 0xFFF;
|
||||
*b = st_13linear2alaw((int16_t) v);
|
||||
*b = st_13linear2alaw((int16_t) lrintf(v));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue