summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sconv.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-10-03 02:34:59 +0200
committerLennart Poettering <lennart@poettering.net>2008-10-03 02:34:59 +0200
commit33b186e74dc2de6fa363d10d3450c354ec99f864 (patch)
tree5404257a2dd9c2547eeb08ddb30417f49a096d4b /src/pulsecore/sconv.c
parent1bb5e58fb38f3cd4b2c389dd3da294b004eade56 (diff)
user lrint() and friends in inner loops instead of normal C casts to speed up a few things
Diffstat (limited to 'src/pulsecore/sconv.c')
-rw-r--r--src/pulsecore/sconv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index 733a46ae..6c4d420e 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -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));
}
}