[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/5] audio: fix saturation nonlinearity in clip_* functions
From: |
Volker Rümelin |
Subject: |
[PATCH 5/5] audio: fix saturation nonlinearity in clip_* functions |
Date: |
Mon, 2 Mar 2020 20:10:04 +0100 |
The current positive limit for the saturation nonlinearity is
only correct if the type of the result has 8 bits or less.
Signed-off-by: Volker Rümelin <address@hidden>
---
audio/mixeng_template.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/audio/mixeng_template.h b/audio/mixeng_template.h
index fc8e1d4d9e..bc8509e423 100644
--- a/audio/mixeng_template.h
+++ b/audio/mixeng_template.h
@@ -83,10 +83,9 @@ static inline int64_t glue (conv_, ET) (IN_T v)
static inline IN_T glue (clip_, ET) (int64_t v)
{
- if (v >= 0x7f000000) {
+ if (v >= 0x7fffffffLL) {
return IN_MAX;
- }
- else if (v < -2147483648LL) {
+ } else if (v < -2147483648LL) {
return IN_MIN;
}
--
2.16.4
- [PATCH 0/5] mostly changes related to audio float samples, Volker Rümelin, 2020/03/02
- [PATCH 1/5] qapi/audio: add documentation for AudioFormat, Volker Rümelin, 2020/03/02
- [PATCH 4/5] audio: change mixing engine float range to [-1.f, 1.f], Volker Rümelin, 2020/03/02
- [PATCH 2/5] audio: change naming scheme of FLOAT_CONV macros, Volker Rümelin, 2020/03/02
- [PATCH 3/5] audio: consistency changes, Volker Rümelin, 2020/03/02
- [PATCH 5/5] audio: fix saturation nonlinearity in clip_* functions,
Volker Rümelin <=
- Re: [PATCH 0/5] mostly changes related to audio float samples, Howard Spoelstra, 2020/03/02