Asterisk - The Open Source Telephony Project GIT-master-b023714
|
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. | |
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. | |
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 | |
static int | lintog726_new (struct ast_trans_pvt *pvt) |
init a new instance of g726_coder_pvt. | |
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 | |
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 = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .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().
Referenced by predictor_pole(), and predictor_zero().
|
static |
Definition at line 588 of file codec_g726.c.
References _dqlntab, _fitab, _witab, predictor_pole(), predictor_zero(), reconstruct(), 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, predictor_pole(), predictor_zero(), qtab_721, quantize(), reconstruct(), 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, and ast_trans_pvt::samples.
|
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, and ast_trans_pvt::samples.
|
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, and ast_trans_pvt::samples.
|
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(), and ast_trans_pvt::pvt.
|
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, and ast_trans_pvt::samples.
|
static |
Definition at line 881 of file codec_g726.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_register_translator, g726aal2tolin, g726tolin, lintog726, lintog726aal2, 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(), and g726_encode().
|
static |
Definition at line 224 of file codec_g726.c.
References g726_state::b, g726_state::dq, and fmult().
Referenced by g726_decode(), and g726_encode().
|
static |
Definition at line 160 of file codec_g726.c.
Referenced by quantize().
|
static |
Definition at line 276 of file codec_g726.c.
References abs, d, 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 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(), g726aal2tolin, g726tolin, lintog726, and lintog726aal2.
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, 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_channel_queue_connected_line_update(), ast_channel_queue_redirecting_update(), ast_channel_set_caller(), ast_channel_set_caller_event(), ast_channel_set_connected_line(), ast_channel_set_redirecting(), ast_channel_update_connected_line(), ast_channel_update_redirecting(), ast_connected_line_build_data(), ast_party_caller_set(), ast_party_connected_line_set(), ast_party_id_set(), ast_party_redirecting_set(), ast_redirecting_build_data(), AST_TEST_DEFINE(), 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(), connectedline_write(), copy_redirecting_id(), find_route(), g726_decode(), g726_encode(), handle_bridge_enter_message(), handle_bridge_leave_message(), handle_channel_snapshot_update_message(), load_module(), party_id_build_data(), redirecting_write(), send_colp_to_agent(), set_redirecting(), set_redirecting_id(), 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.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 784 of file codec_g726.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 805 of file codec_g726.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 847 of file codec_g726.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 96 of file codec_g726.c.
Referenced by g726_encode().