FreeCalypso > hg > gsm-codec-lib
changeset 361:9aa554f8cf39
libtwamr: integrate e_homing.c
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 06 May 2024 01:57:25 +0000 |
parents | b22f13fd0f6a |
children | 9cbd1b5d061f |
files | libtwamr/Makefile libtwamr/e_homing.c libtwamr/e_homing.h libtwamr/namespace.list |
diffstat | 4 files changed, 109 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libtwamr/Makefile Mon May 06 01:49:57 2024 +0000 +++ b/libtwamr/Makefile Mon May 06 01:57:25 2024 +0000 @@ -5,9 +5,9 @@ c8_31pf.o c_g_aver.o calc_cor.o calc_en.o cbsearch.o convolve.o cor_h.o\ d1035pf.o d2_11pf.o d2_9pf.o d3_14pf.o d4_17pf.o d8_31pf.o d_gain_c.o \ d_gain_p.o d_plsf.o d_plsf_3.o d_plsf_5.o dec_gain.o dec_lag3.o \ - dec_lag6.o dhf_check.o dhf_tables.o gains_tab.o gc_pred.o gmed_n.o \ - graytab.o inv_sqrt.o log2.o lsp_lsf.o oper_32b.o pow2.o prmno.o \ - q_plsf3_tab.o q_plsf5_tab.o qua_gain_tab.o reorder.o s10_8pf.o \ + dec_lag6.o dhf_check.o dhf_tables.o e_homing.o gains_tab.o gc_pred.o \ + gmed_n.o graytab.o inv_sqrt.o log2.o lsp_lsf.o oper_32b.o pow2.o \ + prmno.o q_plsf3_tab.o q_plsf5_tab.o qua_gain_tab.o reorder.o s10_8pf.o \ set_sign.o sqrt_l.o tls_flags.o window.o HDRS= namespace.h LIB= libtwamr.a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libtwamr/e_homing.c Mon May 06 01:57:25 2024 +0000 @@ -0,0 +1,70 @@ +/* +***************************************************************************** +* +* GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 +* R99 Version 3.3.0 +* REL-4 Version 4.1.0 +* +***************************************************************************** +* +* File : e_homing.c +* +***************************************************************************** +*/ + +/* +***************************************************************************** +* MODULE INCLUDE FILE AND VERSION ID +***************************************************************************** +*/ + +#include "namespace.h" +#include "e_homing.h" + +/* +***************************************************************************** +* INCLUDE FILES +***************************************************************************** +*/ + +#include "typedef.h" +#include "cnst.h" + +/* +***************************************************************************** +* PUBLIC PROGRAM CODE +***************************************************************************** +*/ + +/* +******************************************************************************** +* +* Function : encoder_homing_frame_test +* In : input_frame[] one frame of speech samples +* Out : none +* Calls : none +* Tables : none +* Compile Defines : none +* Return : 0 input frame does not match the encoder homing frame pattern +* 1 input frame matches the encoder homing frame pattern +* Information : Checks if all samples of the input frame matches the encoder +* homing frame pattern, which is 0x0008 for all samples. +* +******************************************************************************** +*/ + +Word16 encoder_homing_frame_test (Word16 input_frame[]) +{ + Word16 i, j; + + /* check 160 input samples for matching EHF_MASK: defined in e_homing.h */ + for (i = 0; i < L_FRAME; i++) + { + j = input_frame[i] ^ EHF_MASK; + + if (j) + break; + } + + return !j; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libtwamr/e_homing.h Mon May 06 01:57:25 2024 +0000 @@ -0,0 +1,35 @@ +/* +******************************************************************************** +* +* GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 +* R99 Version 3.3.0 +* REL-4 Version 4.1.0 +* +******************************************************************************** +* File : e_homing.h +* Purpose : Definition of encoder homing frame pattern and +* declaration of encoder homing function prototype. +* +******************************************************************************** +*/ + +#ifndef e_homing_h +#define e_homing_h "$Id $" + +/* +***************************************************************************** +* INCLUDE FILES +***************************************************************************** +*/ + +#include "typedef.h" + +/* +******************************************************************************** +* DECLARATION OF PROTOTYPES +******************************************************************************** +*/ + +Word16 encoder_homing_frame_test (Word16 input_frame[]); + +#endif
--- a/libtwamr/namespace.list Mon May 06 01:49:57 2024 +0000 +++ b/libtwamr/namespace.list Mon May 06 01:57:25 2024 +0000 @@ -51,3 +51,4 @@ code_8i40_31bits code_10i40_35bits search_10and8i40 decode_2i40_9bits decode_2i40_11bits decode_3i40_14bits decode_4i40_17bits dec_8i40_31bits dec_10i40_35bits +encoder_homing_frame_test