]> Git Repo - qemu.git/commitdiff
audio: fix saturation nonlinearity in clip_* functions
authorVolker Rümelin <[email protected]>
Sun, 8 Mar 2020 19:33:20 +0000 (20:33 +0100)
committerGerd Hoffmann <[email protected]>
Mon, 16 Mar 2020 09:18:07 +0000 (10:18 +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 <[email protected]>
Message-id: 20200308193321[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
audio/mixeng_template.h

index fc8e1d4d9ebf4ed48da683c98760499b39bce82a..bc8509e423f6341c5d75b47420c950d6b3a40447 100644 (file)
@@ -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;
     }
 
This page took 0.022488 seconds and 4 git commands to generate.