codec_g726.c - translate between signed linear and ITU G.726-32kbps (both RFC3551 and AAL2 codeword packing) More...
#include "asterisk.h"
#include "asterisk/lock.h"
#include "asterisk/linkedlists.h"
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/translate.h"
#include "asterisk/utils.h"
#include "log2comp.h"
#include "asterisk/slin.h"
#include "ex_g726.h"
Go to the source code of this file.
Data Structures | |
struct | g726_coder_pvt |
struct | g726_state |
Macros | |
#define | BUF_SHIFT 5 |
#define | BUFFER_SAMPLES 8096 /* size for the translation buffers */ |
#define | WANT_ASM |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | fmult (int an, int srn) |
static int | g726_decode (int i, struct g726_state *state_ptr) |
static int | g726_encode (int sl, struct g726_state *state_ptr) |
static void | g726_init_state (struct g726_state *state_ptr) |
static int | g726aal2tolin_framein (struct ast_trans_pvt *pvt, struct ast_frame *f) |
decode packed 4-bit G726 values (AAL2 packing) and store in buffer. More... | |
static int | g726tolin_framein (struct ast_trans_pvt *pvt, struct ast_frame *f) |
decode packed 4-bit G726 values (RFC3551 packing) and store in buffer. More... | |
static int | lintog726_framein (struct ast_trans_pvt *pvt, struct ast_frame *f) |
compress and store data (4-bit G726 samples, RFC3551 packing) in outbuf More... | |
static int | lintog726_new (struct ast_trans_pvt *pvt) |
init a new instance of g726_coder_pvt. More... | |
static int | lintog726aal2_framein (struct ast_trans_pvt *pvt, struct ast_frame *f) |
compress and store data (4-bit G726 samples, AAL2 packing) in outbuf More... | |
static int | load_module (void) |
static int | predictor_pole (struct g726_state *state_ptr) |
static int | predictor_zero (struct g726_state *state_ptr) |
static int | quan (int val, int *table, int size) |
static int | quantize (int d, int y, int *table, int size) |
static int | reconstruct (int sign, int dqln, int y) |
static int | reload (void) |
static int | step_size (struct g726_state *state_ptr) |
static int | unload_module (void) |
static void | update (int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "ITU G.726-32kbps G726 Transcoder" , .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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .reload = reload, } |
static int | _dqlntab [16] |
static int | _fitab [16] |
static int | _witab [16] |
static struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_translator | g726aal2tolin |
static struct ast_translator | g726tolin |
static struct ast_translator | lintog726 |
static struct ast_translator | lintog726aal2 |
static int | qtab_721 [7] = {-124, 80, 178, 246, 300, 349, 400} |
codec_g726.c - translate between signed linear and ITU G.726-32kbps (both RFC3551 and AAL2 codeword packing)
Definition in file codec_g726.c.
#define BUF_SHIFT 5 |
Definition at line 62 of file codec_g726.c.
#define BUFFER_SAMPLES 8096 /* size for the translation buffers */ |
Definition at line 61 of file codec_g726.c.
#define WANT_ASM |
Definition at line 45 of file codec_g726.c.
|
static |
Definition at line 864 of file codec_g726.c.
|
static |
Definition at line 864 of file codec_g726.c.
|
static |
Definition at line 207 of file codec_g726.c.
References ilog2().
Referenced by predictor_pole(), and predictor_zero().
|
static |
Definition at line 580 of file codec_g726.c.
References predictor_pole(), predictor_zero(), reconstruct(), step_size(), and update().
Referenced by g726aal2tolin_framein(), and g726tolin_framein().
|
static |
Definition at line 626 of file codec_g726.c.
References predictor_pole(), predictor_zero(), quantize(), reconstruct(), step_size(), and update().
Referenced by lintog726_framein(), and lintog726aal2_framein().
|
static |
Definition at line 125 of file codec_g726.c.
References g726_state::a, g726_state::ap, g726_state::b, g726_state::dml, g726_state::dms, g726_state::dq, g726_state::pk, g726_state::sr, g726_state::td, g726_state::yl, and g726_state::yu.
Referenced by lintog726_new().
|
static |
decode packed 4-bit G726 values (AAL2 packing) and store in buffer.
Definition at line 695 of file codec_g726.c.
References ast_frame::data, ast_trans_pvt::datalen, ast_frame::datalen, g726_coder_pvt::g726, g726_decode(), ast_trans_pvt::i16, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_trans_pvt::samples, and ast_frame::samples.
|
static |
decode packed 4-bit G726 values (RFC3551 packing) and store in buffer.
Definition at line 736 of file codec_g726.c.
References ast_frame::data, ast_trans_pvt::datalen, ast_frame::datalen, g726_coder_pvt::g726, g726_decode(), ast_trans_pvt::i16, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_trans_pvt::samples, and ast_frame::samples.
|
static |
compress and store data (4-bit G726 samples, RFC3551 packing) in outbuf
Definition at line 755 of file codec_g726.c.
References ast_trans_pvt::c, ast_frame::data, ast_trans_pvt::datalen, g726_coder_pvt::g726, g726_encode(), g726_coder_pvt::next_flag, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_trans_pvt::samples, and ast_frame::samples.
|
static |
init a new instance of g726_coder_pvt.
Definition at line 685 of file codec_g726.c.
References g726_coder_pvt::g726, g726_init_state(), and ast_trans_pvt::pvt.
|
static |
compress and store data (4-bit G726 samples, AAL2 packing) in outbuf
Definition at line 714 of file codec_g726.c.
References ast_trans_pvt::c, ast_frame::data, ast_trans_pvt::datalen, g726_coder_pvt::g726, g726_encode(), g726_coder_pvt::next_flag, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_trans_pvt::samples, and ast_frame::samples.
|
static |
Definition at line 842 of file codec_g726.c.
References AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_SUCCESS, ast_register_translator, and unload_module().
|
static |
Definition at line 235 of file codec_g726.c.
References g726_state::a, fmult(), and g726_state::sr.
Referenced by g726_decode(), and g726_encode().
|
static |
Definition at line 226 of file codec_g726.c.
References g726_state::b, g726_state::dq, and fmult().
Referenced by g726_decode(), and g726_encode().
|
static |
|
static |
Definition at line 278 of file codec_g726.c.
References ilog2(), and quan().
Referenced by g726_encode().
|
static |
Definition at line 331 of file codec_g726.c.
Referenced by bridge_p2p_rtp_write(), g726_decode(), and g726_encode().
|
static |
Definition at line 824 of file codec_g726.c.
References AST_MODULE_LOAD_SUCCESS.
|
static |
Definition at line 249 of file codec_g726.c.
References g726_state::ap, g726_state::yl, and g726_state::yu.
Referenced by g726_decode(), g726_encode(), and smb_pitch_shift().
|
static |
Definition at line 829 of file codec_g726.c.
References ast_unregister_translator().
Referenced by load_module().
|
static |
Definition at line 367 of file codec_g726.c.
References g726_state::a, g726_state::ap, g726_state::b, g726_state::dml, g726_state::dms, g726_state::dq, if(), ilog2(), g726_state::pk, g726_state::sr, g726_state::td, g726_state::yl, and g726_state::yu.
Referenced by config_device(), config_line(), connectedline_write(), g726_decode(), g726_encode(), load_pktccops_config(), and redirecting_write().
|
static |
Definition at line 864 of file codec_g726.c.
|
static |
Definition at line 103 of file codec_g726.c.
|
static |
Definition at line 114 of file codec_g726.c.
|
static |
Definition at line 107 of file codec_g726.c.
|
static |
Definition at line 864 of file codec_g726.c.
|
static |
Definition at line 800 of file codec_g726.c.
|
static |
Definition at line 776 of file codec_g726.c.
|
static |
Definition at line 788 of file codec_g726.c.
|
static |
Definition at line 812 of file codec_g726.c.
|
static |
Definition at line 98 of file codec_g726.c.