53#define LPC10_BYTES_IN_COMPRESSED_FRAME (LPC10_BITS_IN_COMPRESSED_FRAME + 7)/8
55#define BUFFER_SAMPLES 8000
85 if (*
c & (0x80 >> (x & 7)))
97 unsigned char mask=0x80;
118 while (
len + LPC10_BYTES_IN_COMPRESSED_FRAME <= f->datalen) {
141 printf(
"Decoded %d, expected %d\n",
len, f->
datalen);
174 tmpbuf[x] = (
float)
tmp->buf[x +
samples] / 32768.0;
182 tmp->longer = 1 -
tmp->longer;
212 .
name =
"lpc10tolin",
234 .
name =
"lintolpc10",
struct sla_ringing_trunk * last
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_frame * lintolpc10_frameout(struct ast_trans_pvt *pvt)
static int lpc10_dec_new(struct ast_trans_pvt *pvt)
static void lpc10_destroy(struct ast_trans_pvt *arg)
static void build_bits(unsigned char *c, INT32 *bits)
static int lintolpc10_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static struct ast_translator lpc10tolin
static struct ast_translator lintolpc10
static int load_module(void)
static int lpc10tolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static int lpc10_enc_new(struct ast_trans_pvt *pvt)
static int unload_module(void)
static void extract_bits(INT32 *bits, unsigned char *c)
#define LPC10_BYTES_IN_COMPRESSED_FRAME
Copyright (C) 2008, Digium, Inc.
static struct ast_frame * lpc10_sample(void)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
Configuration File Parser.
A set of macros to manage forward-linked lists.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
struct lpc10_decoder_state * create_lpc10_decoder_state(void)
int lpc10_decode(INT32 *bits, real *speech, struct lpc10_decoder_state *st)
#define LPC10_SAMPLES_PER_FRAME
struct lpc10_encoder_state * create_lpc10_encoder_state(void)
#define LPC10_BITS_IN_COMPRESSED_FRAME
int lpc10_encode(real *speech, INT32 *bits, struct lpc10_encoder_state *st)
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
static struct ast_frame * slin8_sample(void)
Data structure associated with a single frame of data.
union ast_frame::@226 data
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
int datalen
actual space used in outbuf
union ast_trans_pvt::@287 outbuf
Descriptor of a translator.
short buf[BUFFER_SAMPLES]
struct lpc10_decoder_state * dec
union lpc10_coder_pvt::@146 lpc10
struct lpc10_encoder_state * enc
Support for translation of data formats. translate.c.
#define ast_register_translator(t)
See __ast_register_translator()
int ast_unregister_translator(struct ast_translator *t)
Unregister a translator Unregisters the given translator.
struct ast_frame * ast_trans_frameout(struct ast_trans_pvt *pvt, int datalen, int samples)
generic frameout function