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@jmvalin.ca>2023-12-13 05:45:02 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2023-12-13 05:45:02 +0300
commitc80f6efd0633ee4fa618465fa32ccb4d9767fc66 (patch)
tree5b9d80f896e1d5ba2a40e7b2f885882e7e0c7412
parentbac498867fe41a4380f5dc64b55d0c14fcffd3d8 (diff)
More missing constants
INT16_{MAX,MIN} are C99
-rw-r--r--dnn/osce.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/dnn/osce.c b/dnn/osce.c
index c7544738..02e11cb2 100644
--- a/dnn/osce.c
+++ b/dnn/osce.c
@@ -21,6 +21,10 @@
#include <stdio.h>
#endif
+#ifndef M_PI
+#define M_PI 3.141592653
+#endif
+
#define CLIP(a, min, max) (((a) < (min) ? (min) : (a)) > (max) ? (max) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))
@@ -954,8 +958,8 @@ void osce_enhance_frame(
for (i = 0; i < 320; i++)
{
float tmp = round((1U<<15) * out_buffer[i]);
- if (tmp > INT16_MAX) tmp = INT16_MAX;
- if (tmp < INT16_MIN) tmp = INT16_MIN;
+ if (tmp > 32767) tmp = 32767;
+ if (tmp < -32768) tmp = -32768;
xq[i] = (opus_int16) tmp;
}
@@ -1178,7 +1182,7 @@ void lace_demo(
for (int n=0; n < 4 * LACE_FRAME_SIZE; n ++)
{
float tmp = (1UL<<15) * buffer[n];
- tmp = CLIP(tmp, INT16_MIN, INT16_MAX);
+ tmp = CLIP(tmp, -32768, 32767);
x_out[n] = (int16_t) round(tmp);
}
@@ -1298,7 +1302,7 @@ void nolace_demo(
for (int n=0; n < 4 * LACE_FRAME_SIZE; n ++)
{
float tmp = (1UL<<15) * buffer[n];
- tmp = CLIP(tmp, INT16_MIN, INT16_MAX);
+ tmp = CLIP(tmp, -32768, 32767);
x_out[n] = (int16_t) round(tmp);
}