| 1 |
#ifndef OKI_CODEC_H |
| 2 |
#define OKI_CODEC_H |
| 3 |
|
| 4 |
/* |
| 5 |
Encode and decode algorithms for |
| 6 |
OKI ADPCM |
| 7 |
|
| 8 |
Only difference between MSM6295 and MSM6258 is that the nibbles are swapped. |
| 9 |
MSM6295 reads from MSB to LSB. MSM6258 reads from LSB to MSB. |
| 10 |
|
| 11 |
Dialogic 'VOX' PCM reads from MSB to LSB, therefore should use the MSM6295 functions. |
| 12 |
|
| 13 |
2019-2022 by superctr. |
| 14 |
*/ |
| 15 |
|
| 16 |
#include <stdint.h> |
| 17 |
|
| 18 |
/** |
| 19 |
* Given (len) amount of PCM samples in buffer, |
| 20 |
* return encoded ADPCM samples in outbuffer. |
| 21 |
* Output buffer should be at least (len/2) elements large. |
| 22 |
*/ |
| 23 |
void oki_encode(int16_t *buffer,uint8_t *outbuffer,long len); |
| 24 |
void oki6258_encode(int16_t *buffer,uint8_t *outbuffer,long len); |
| 25 |
|
| 26 |
/** |
| 27 |
* Given ADPCM samples in (buffer), return (len) amount of |
| 28 |
* decoded PCM samples in (outbuffer). |
| 29 |
* Output buffer should be at least (len*2) elements large. |
| 30 |
*/ |
| 31 |
void oki_decode(uint8_t *buffer,int16_t *outbuffer,long len); |
| 32 |
void oki6258_decode(uint8_t *buffer,int16_t *outbuffer,long len); |
| 33 |
|
| 34 |
#endif |