From 33b186e74dc2de6fa363d10d3450c354ec99f864 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 3 Oct 2008 02:34:59 +0200 Subject: user lrint() and friends in inner loops instead of normal C casts to speed up a few things --- src/pulsecore/sconv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/sconv.c') 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)); } } -- cgit