46 #define BUFFER_SAMPLES 8096 56 static int indsft[8] = { -1, -1, -1, -1, 2, 4, 6, 8 };
63 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73,
64 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279,
65 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963,
66 1060, 1166, 1282, 1411, 1552
99 sign = encoded & 0x08;
102 diff = (((encoded << 1) + 1) * step) >> 3;
111 if ((encoded >> 1) & step & 0x1)
126 else if (state->
signal < -2047)
138 else if (state->
signal < 0)
149 return state->
signal << 4;
176 diff = csig - state->
signal;
180 encoded = (-diff << 2) / step;
185 encoded = (diff << 2) / step;
233 unsigned char *src = f->
data.
ptr;
268 for (i = 0; i < pvt->
samples; i += 2) {
290 .
name =
"adpcmtolin",
310 .
name =
"lintoadpcm",
struct ast_frame * ast_trans_frameout(struct ast_trans_pvt *pvt, int datalen, int samples)
generic frameout function
int datalen
actual space used in outbuf
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_frame * adpcm_sample(void)
Workspace for translating ADPCM signals to signed linear.
static int load_module(void)
Descriptor of a translator.
static struct ast_translator lintoadpcm
Support for translation of data formats. translate.c.
static int adpcm(short csig, struct adpcm_state *state)
static struct ast_frame * slin8_sample(void)
static int inbuf(struct baseio *bio, FILE *fi)
utility used by inchar(), for base_encode()
static int lintoadpcm_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
fill input buffer with 16-bit signed linear PCM values.
Configuration File Parser.
static struct ast_frame * lintoadpcm_frameout(struct ast_trans_pvt *pvt)
convert inbuf and store into frame
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given tranlator.
A set of macros to manage forward-linked lists.
static struct ast_translator adpcmtolin
union ast_trans_pvt::@327 outbuf
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
Module has failed to load, may be in an inconsistent state.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
static int adpcmtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
decode 4-bit adpcm frame data and store in output buffer
Data structure associated with a single frame of data.
Workspace for translating signed linear signals to ADPCM.
union ast_frame::@263 data
int16_t inbuf[BUFFER_SAMPLES]
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int unload_module(void)
static short decode(int encoded, struct adpcm_state *state)