# HG changeset patch # User Mychaela Falconia # Date 1714960645 0 # Node ID 9aa554f8cf3981edbac052b9144d899f08b25781 # Parent b22f13fd0f6af446a6186740fe6482716552f190 libtwamr: integrate e_homing.c diff -r b22f13fd0f6a -r 9aa554f8cf39 libtwamr/Makefile --- 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 diff -r b22f13fd0f6a -r 9aa554f8cf39 libtwamr/e_homing.c --- /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; +} diff -r b22f13fd0f6a -r 9aa554f8cf39 libtwamr/e_homing.h --- /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 diff -r b22f13fd0f6a -r 9aa554f8cf39 libtwamr/namespace.list --- 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