Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-12-20 07:55:05 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-12-20 07:55:05 +0300
commit34340adafc63d7480065e22b15cef32427c59728 (patch)
treeed3ad2060e33b9e5e5b8fe3449de4257a27d7c09
parent5329f62c8cb0bd6adb6ea31163a7bde76bdbf618 (diff)
INT16_{MIN,MAX} are C99
Also, clipping to -32767 just to be safe against later negation
-rw-r--r--dnn/osce.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/dnn/osce.c b/dnn/osce.c
index 5cf0c936..2a78a6ea 100644
--- a/dnn/osce.c
+++ b/dnn/osce.c
@@ -1033,9 +1033,9 @@ void osce_enhance_frame(
/* scale output */
for (i = 0; i < 320; i++)
{
- float tmp = (1U<<15) * out_buffer[i];
- if (tmp > INT16_MAX) tmp = INT16_MAX;
- if (tmp < INT16_MIN) tmp = INT16_MIN;
+ float tmp = 32768.f * out_buffer[i];
+ if (tmp > 32767.f) tmp = 32767.f;
+ if (tmp < -32767.f) tmp = -32767.f;
xq[i] = float2int(tmp);
}