Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
SpanDSP - a series of DSP components for telephony. More...
#include "asterisk.h"
#include <math.h>
#include "asterisk/config.h"
#include "asterisk/module.h"
#include "asterisk/plc.h"
Go to the source code of this file.
Macros | |
#define | ATTENUATION_INCREMENT 0.0025 /* Attenuation per sample */ |
#define | FALSE 0 |
#define | INT16_MAX (32767) |
#define | INT16_MIN (-32767-1) |
#define | ms_to_samples(t) (((t)*DEFAULT_SAMPLE_RATE)/1000) |
#define | TRUE (!FALSE) |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int __inline__ | amdf_pitch (int min_pitch, int max_pitch, int16_t amp[], int len) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int16_t | fsaturate (double damp) |
static int | load_module (void) |
static void | normalise_history (plc_state_t *s) |
int | plc_fillin (plc_state_t *s, int16_t amp[], int len) |
Fill-in a block of missing audio samples. More... | |
plc_state_t * | plc_init (plc_state_t *s) |
Process a block of received V.29 modem audio samples. More... | |
int | plc_rx (plc_state_t *s, int16_t amp[], int len) |
Process a block of received audio samples. More... | |
static int | reload_module (void) |
static void | save_history (plc_state_t *s, int16_t *buf, int len) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "PLC" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_CORE, .requires = "extconfig", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
SpanDSP - a series of DSP components for telephony.
Definition in file plc.c.
#define ATTENUATION_INCREMENT 0.0025 /* Attenuation per sample */ |
#define ms_to_samples | ( | t | ) | (((t)*DEFAULT_SAMPLE_RATE)/1000) |
|
static |
Definition at line 108 of file plc.c.
Referenced by plc_fillin().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
|
inlinestatic |
|
static |
Definition at line 281 of file plc.c.
References AST_MODULE_LOAD_SUCCESS, and reload_module().
|
static |
Definition at line 94 of file plc.c.
References plc_state_t::buf_ptr, plc_state_t::history, PLC_HISTORY_LEN, and tmp().
Referenced by plc_fillin().
int plc_fillin | ( | plc_state_t * | s, |
int16_t | amp[], | ||
int | len | ||
) |
Fill-in a block of missing audio samples.
Fill-in a block of missing audio samples.
s | The packet loss concealer context. |
amp | The audio sample buffer. |
len | The number of samples to be synthesised. |
Definition at line 175 of file plc.c.
References amdf_pitch(), ATTENUATION_INCREMENT, CORRELATION_SPAN, fsaturate(), plc_state_t::history, len(), plc_state_t::missing_samples, normalise_history(), plc_state_t::pitch, plc_state_t::pitch_offset, plc_state_t::pitchbuf, PLC_HISTORY_LEN, PLC_PITCH_MAX, PLC_PITCH_MIN, and save_history().
Referenced by adjust_frame_for_plc().
plc_state_t * plc_init | ( | plc_state_t * | s | ) |
Process a block of received V.29 modem audio samples.
Process a block of received V.29 modem audio samples.
s | The packet loss concealer context. |
Definition at line 244 of file plc.c.
int plc_rx | ( | plc_state_t * | s, |
int16_t | amp[], | ||
int | len | ||
) |
Process a block of received audio samples.
Process a block of received audio samples.
s | The packet loss concealer context. |
amp | The audio sample buffer. |
len | The number of samples in the buffer. |
Definition at line 132 of file plc.c.
References ATTENUATION_INCREMENT, fsaturate(), len(), plc_state_t::missing_samples, plc_state_t::pitch, plc_state_t::pitch_offset, plc_state_t::pitchbuf, and save_history().
Referenced by adjust_frame_for_plc().
|
static |
Definition at line 252 of file plc.c.
References ast_config_destroy(), ast_config_load, AST_OPT_FLAG_GENERIC_PLC, AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS, ast_opt_generic_plc, ast_options, ast_set2_flag, ast_true(), ast_variable_browse(), CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, and var.
Referenced by load_module().
|
static |
Definition at line 71 of file plc.c.
References buf, plc_state_t::buf_ptr, plc_state_t::history, len(), and PLC_HISTORY_LEN.
Referenced by plc_fillin(), and plc_rx().
|
static |
|
static |
|
static |