153a5a1b3Sopenharmony_ci#ifndef foog711hfoo
253a5a1b3Sopenharmony_ci#define foog711hfoo
353a5a1b3Sopenharmony_ci
453a5a1b3Sopenharmony_ci/* g711.h - include for G711 u-law and a-law conversion routines
553a5a1b3Sopenharmony_ci**
653a5a1b3Sopenharmony_ci** Copyright (C) 2001 Chris Bagwell
753a5a1b3Sopenharmony_ci**
853a5a1b3Sopenharmony_ci** Permission to use, copy, modify, and distribute this software and its
953a5a1b3Sopenharmony_ci** documentation for any purpose and without fee is hereby granted, provided
1053a5a1b3Sopenharmony_ci** that the above copyright notice appear in all copies and that both that
1153a5a1b3Sopenharmony_ci** copyright notice and this permission notice appear in supporting
1253a5a1b3Sopenharmony_ci** documentation.  This software is provided "as is" without express or
1353a5a1b3Sopenharmony_ci** implied warranty.
1453a5a1b3Sopenharmony_ci*/
1553a5a1b3Sopenharmony_ci
1653a5a1b3Sopenharmony_ci/** Copied from sox -- Lennart Poettering */
1753a5a1b3Sopenharmony_ci
1853a5a1b3Sopenharmony_ci#include <inttypes.h>
1953a5a1b3Sopenharmony_ci
2053a5a1b3Sopenharmony_ci#ifdef FAST_ALAW_CONVERSION
2153a5a1b3Sopenharmony_ciextern uint8_t _st_13linear2alaw[0x2000];
2253a5a1b3Sopenharmony_ciextern int16_t _st_alaw2linear16[256];
2353a5a1b3Sopenharmony_ci#define st_13linear2alaw(sw) (_st_13linear2alaw[(sw + 0x1000)])
2453a5a1b3Sopenharmony_ci#define st_alaw2linear16(uc) (_st_alaw2linear16[uc])
2553a5a1b3Sopenharmony_ci#else
2653a5a1b3Sopenharmony_ciunsigned char st_13linear2alaw(int16_t pcm_val);
2753a5a1b3Sopenharmony_ciint16_t st_alaw2linear16(unsigned char);
2853a5a1b3Sopenharmony_ci#endif
2953a5a1b3Sopenharmony_ci
3053a5a1b3Sopenharmony_ci#ifdef FAST_ULAW_CONVERSION
3153a5a1b3Sopenharmony_ciextern uint8_t _st_14linear2ulaw[0x4000];
3253a5a1b3Sopenharmony_ciextern int16_t _st_ulaw2linear16[256];
3353a5a1b3Sopenharmony_ci#define st_14linear2ulaw(sw) (_st_14linear2ulaw[(sw + 0x2000)])
3453a5a1b3Sopenharmony_ci#define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc])
3553a5a1b3Sopenharmony_ci#else
3653a5a1b3Sopenharmony_ciunsigned char st_14linear2ulaw(int16_t pcm_val);
3753a5a1b3Sopenharmony_ciint16_t st_ulaw2linear16(unsigned char);
3853a5a1b3Sopenharmony_ci#endif
3953a5a1b3Sopenharmony_ci
4053a5a1b3Sopenharmony_ci#endif
41