diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-12-20 07:55:05 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-12-20 07:55:05 +0300 |
commit | 34340adafc63d7480065e22b15cef32427c59728 (patch) | |
tree | ed3ad2060e33b9e5e5b8fe3449de4257a27d7c09 | |
parent | 5329f62c8cb0bd6adb6ea31163a7bde76bdbf618 (diff) |
INT16_{MIN,MAX} are C99
Also, clipping to -32767 just to be safe against later negation
-rw-r--r-- | dnn/osce.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); } |