Amuse
dsp.h
1 #ifndef _DSP_h
2 #define _DSP_h
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <stdint.h>
9 
10 static inline int16_t DSPSampClamp(int32_t val)
11 {
12  if (val < -32768) val = -32768;
13  else if (val > 32767) val = 32767;
14  return val;
15 }
16 
17 unsigned DSPDecompressFrame(int16_t* out, const uint8_t* in,
18  const int16_t coefs[8][2], int16_t* prev1, int16_t* prev2,
19  unsigned lastSample);
20 unsigned DSPDecompressFrameStereoStride(int16_t* out, const uint8_t* in,
21  const int16_t coefs[8][2], int16_t* prev1, int16_t* prev2,
22  unsigned lastSample);
23 unsigned DSPDecompressFrameStereoDupe(int16_t* out, const uint8_t* in,
24  const int16_t coefs[8][2], int16_t* prev1, int16_t* prev2,
25  unsigned lastSample);
26 
27 unsigned DSPDecompressFrameRanged(int16_t* out, const uint8_t* in,
28  const int16_t coefs[8][2], int16_t* prev1, int16_t* prev2,
29  unsigned firstSample, unsigned lastSample);
30 
31 unsigned DSPDecompressFrameStateOnly(const uint8_t* in,
32  const int16_t coefs[8][2], int16_t* prev1, int16_t* prev2,
33  unsigned lastSample);
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif // _DSP_h