Asterisk - The Open Source Telephony Project
18.5.0
|
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) |
struct ast_module * | AST_MODULE_SELF_SYM (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 | 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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, } |
static int | _dqlntab [16] |
static int | _fitab [16] |
static int | _witab [16] |
static const 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 60 of file codec_g726.c.
#define BUFFER_SAMPLES 8096 /* size for the translation buffers */ |
Definition at line 59 of file codec_g726.c.
#define WANT_ASM |
Definition at line 43 of file codec_g726.c.
|
static |
Definition at line 903 of file codec_g726.c.
|
static |
Definition at line 903 of file codec_g726.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 903 of file codec_g726.c.
|
static |
Definition at line 205 of file codec_g726.c.
References ilog2(), and retval.
Referenced by predictor_pole(), and predictor_zero().
|
static |
Definition at line 588 of file codec_g726.c.
References _dqlntab, _fitab, _witab, g726_state::dq, predictor_pole(), predictor_zero(), reconstruct(), g726_state::sr, step_size(), and update().
Referenced by g726aal2tolin_framein(), and g726tolin_framein().
|
static |
Definition at line 634 of file codec_g726.c.
References _dqlntab, _fitab, _witab, d, g726_state::dq, predictor_pole(), predictor_zero(), qtab_721, quantize(), reconstruct(), g726_state::sr, step_size(), and update().
Referenced by lintog726_framein(), and lintog726aal2_framein().
|
static |
Definition at line 123 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 703 of file codec_g726.c.
References ast_frame::data, ast_frame::datalen, ast_trans_pvt::datalen, g726_coder_pvt::g726, g726_decode(), ast_trans_pvt::i16, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_frame::samples, ast_trans_pvt::samples, and tmp().
|
static |
decode packed 4-bit G726 values (RFC3551 packing) and store in buffer.
Definition at line 744 of file codec_g726.c.
References ast_frame::data, ast_frame::datalen, ast_trans_pvt::datalen, g726_coder_pvt::g726, g726_decode(), ast_trans_pvt::i16, ast_trans_pvt::outbuf, ast_frame::ptr, ast_trans_pvt::pvt, ast_frame::samples, ast_trans_pvt::samples, and tmp().
|
static |
compress and store data (4-bit G726 samples, RFC3551 packing) in outbuf
Definition at line 763 of file codec_g726.c.
References ast_trans_pvt::c, d, 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_frame::samples, ast_trans_pvt::samples, and tmp().
|
static |
init a new instance of g726_coder_pvt.
Definition at line 693 of file codec_g726.c.
References g726_coder_pvt::g726, g726_init_state(), ast_trans_pvt::pvt, and tmp().
|
static |
compress and store data (4-bit G726 samples, AAL2 packing) in outbuf
Definition at line 722 of file codec_g726.c.
References ast_trans_pvt::c, d, 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_frame::samples, ast_trans_pvt::samples, and tmp().
|
static |
Definition at line 881 of file codec_g726.c.
References AST_MODFLAG_DEFAULT, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ast_register_translator, ASTERISK_GPL_KEY, and unload_module().
|
static |
Definition at line 233 of file codec_g726.c.
References g726_state::a, fmult(), and g726_state::sr.
Referenced by g726_decode(), g726_encode(), and quan().
|
static |
Definition at line 224 of file codec_g726.c.
References g726_state::b, g726_state::dq, and fmult().
Referenced by g726_decode(), g726_encode(), and quan().
|
static |
Definition at line 160 of file codec_g726.c.
References g726_state::a, g726_state::b, g726_state::dq, predictor_pole(), predictor_zero(), g726_state::sr, and table.
Referenced by quantize().
|
static |
Definition at line 276 of file codec_g726.c.
References abs, ilog2(), and quan().
Referenced by g726_encode().
|
static |
Definition at line 331 of file codec_g726.c.
References g726_state::dq.
Referenced by bridge_p2p_rtp_write(), g726_decode(), and g726_encode().
|
static |
Definition at line 247 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 868 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, abs, 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 ast_bridge_publish_state(), ast_channel_publish_final_snapshot(), ast_channel_publish_snapshot(), AST_TEST_DEFINE(), bridge_publish_state_from_blob(), bridge_snapshot_update(), bridge_snapshot_update_create(), bridge_snapshot_update_dtor(), bridge_topics_destroy(), cache_update(), cache_update_cb(), caching_topic_exec(), cel_snapshot_update_cb(), channel_snapshot_update(), channel_snapshot_update_create(), channel_snapshot_update_dtor(), config_device(), config_line(), connectedline_write(), endpoint_cache_clear(), find_route(), g726_decode(), g726_encode(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_channel_snapshot_update_message(), load_module(), load_pktccops_config(), redirecting_write(), stasis_cache_update_dtor(), sub_bridge_update_handler(), sub_channel_update_handler(), sub_endpoint_update_handler(), unload_module(), update_create(), and updates().
|
static |
Definition at line 903 of file codec_g726.c.
|
static |
Definition at line 101 of file codec_g726.c.
Referenced by g726_decode(), and g726_encode().
|
static |
Definition at line 112 of file codec_g726.c.
Referenced by g726_decode(), and g726_encode().
|
static |
Definition at line 105 of file codec_g726.c.
Referenced by g726_decode(), and g726_encode().
|
static |
Definition at line 903 of file codec_g726.c.
|
static |
Definition at line 826 of file codec_g726.c.
|
static |
Definition at line 784 of file codec_g726.c.
|
static |
Definition at line 805 of file codec_g726.c.
|
static |
Definition at line 847 of file codec_g726.c.
|
static |
Definition at line 96 of file codec_g726.c.
Referenced by g726_encode().