[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/6] audio: fix saturation nonlinearity in clip_* functions
From: |
Gerd Hoffmann |
Subject: |
[PULL 5/6] audio: fix saturation nonlinearity in clip_* functions |
Date: |
Mon, 16 Mar 2020 12:30:14 +0100 |
From: Volker RĂ¼melin <address@hidden>
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>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <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 fc8e1d4d9ebf..bc8509e423f6 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.18.2
- [PULL 0/6] Audio 20200316 patches, Gerd Hoffmann, 2020/03/16
- [PULL 1/6] qapi/audio: add documentation for AudioFormat, Gerd Hoffmann, 2020/03/16
- [PULL 4/6] audio: change mixing engine float range to [-1.f, 1.f], Gerd Hoffmann, 2020/03/16
- [PULL 3/6] audio: consistency changes, Gerd Hoffmann, 2020/03/16
- [PULL 6/6] audio: add audiodev format=f32 option documentation, Gerd Hoffmann, 2020/03/16
- [PULL 5/6] audio: fix saturation nonlinearity in clip_* functions,
Gerd Hoffmann <=
- [PULL 2/6] audio: change naming scheme of FLOAT_CONV macros, Gerd Hoffmann, 2020/03/16
- Re: [PULL 0/6] Audio 20200316 patches, Peter Maydell, 2020/03/16