58#define USE_ILBC_ENHANCER 0 
   59#define BUFFER_SAMPLES    8000 
   77    const unsigned int mode = attr ? attr->
mode : 30;
 
 
   98    const unsigned int mode = attr ? attr->
mode : 30;
 
  100    const unsigned int samples_per_frame = 
mode * sample_rate / 1000;
 
  101    const unsigned int octets_per_frame = (
mode == 20) ? 38 : 50;
 
  112        ast_debug(1, 
"issue 16070, ILIB ERROR. data = NULL datalen = %d src = %s\n", datalen, f->
src ? f->
src : 
"no src set");
 
  118        datalen = octets_per_frame;
 
  119        f->
samples = samples_per_frame;
 
  121        pvt->
samples += samples_per_frame;
 
  124    if (datalen % octets_per_frame) {
 
  125        ast_log(
LOG_WARNING, 
"Huh?  An ilbc frame that isn't a multiple of %u bytes long from %s (%d)?\n", octets_per_frame, f->
src, datalen);
 
  134    for (x = 0; x < datalen; x += octets_per_frame) {
 
  140        for (i = 0; i < samples_per_frame; i++)
 
  141            dst[pvt->
samples + i] = tmpf[i];
 
  142        pvt->
samples += samples_per_frame;
 
  143        pvt->
datalen += samples_per_frame * 2;
 
 
  171    const unsigned int mode = attr ? attr->
mode : 30;
 
  173    const unsigned int samples_per_frame = 
mode * sample_rate / 1000;
 
  174    const unsigned int octets_per_frame = (
mode == 20) ? 38 : 50;
 
  176    while (pvt->
samples >= samples_per_frame) {
 
  182        for (i = 0; i < samples_per_frame; i++)
 
  187        pvt->
samples -= samples_per_frame;
 
 
struct sla_ringing_trunk * last
Asterisk main include file. File version handling, generic pbx functions.
#define USE_ILBC_ENHANCER
static struct ast_translator ilbctolin
static int ilbctolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
decode a frame and store in outbuf
static struct ast_translator lintoilbc
static int lintoilbc_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
store a frame into a temporary buffer, for later decoding
static int load_module(void)
static struct ast_frame * lintoilbc_frameout(struct ast_trans_pvt *pvt)
encode the temporary buffer and generate a frame
static int lintoilbc_new(struct ast_trans_pvt *pvt)
static int unload_module(void)
static int ilbctolin_new(struct ast_trans_pvt *pvt)
static struct ast_frame * ilbc_sample(void)
short initDecode(iLBC_Dec_Inst_t *iLBCdec_inst, int mode, int use_enhancer)
void iLBC_decode(float *decblock, unsigned char *bytes, iLBC_Dec_Inst_t *iLBCdec_inst, int mode)
void iLBC_encode(unsigned char *bytes, float *block, iLBC_Enc_Inst_t *iLBCenc_inst)
short initEncode(iLBC_Enc_Inst_t *iLBCenc_inst, int mode)
Asterisk internal frame definitions.
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_debug(level,...)
Log a DEBUG message.
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.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#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)
unsigned int sample_rate
Sample rate (number of samples carried in a second)
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@239 data
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
union ast_trans_pvt::@308 outbuf
struct ast_translator * t
struct ast_format * explicit_dst
int datalen
actual space used in outbuf
Descriptor of a translator.
struct ast_codec dst_codec
int16_t buf[BUFFER_SAMPLES]
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