Adds a floating-point API to Opus

The high-level Opus encoder and decoder can now be compiled as
either fixed or float. Also, we now use the stack_alloc.h macros
in the top-level Opus code.
This commit is contained in:
Jean-Marc Valin 2011-08-17 15:53:37 -04:00
parent 8a23fe977f
commit 222494f3ea
7 changed files with 230 additions and 95 deletions

View file

@ -123,4 +123,12 @@
#define float2int(flt) ((int)(floor(.5+flt)))
#endif
static inline opus_int16 FLOAT2INT16(float x)
{
x = x*CELT_SIG_SCALE;
x = MAX32(x, -32768);
x = MIN32(x, 32767);
return (opus_int16)float2int(x);
}
#endif /* FLOAT_CAST_H */