FreeCalypso > hg > gsm-codec-lib
comparison libtwamr/e_homing.c @ 361:9aa554f8cf39
libtwamr: integrate e_homing.c
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 06 May 2024 01:57:25 +0000 |
parents | |
children | 2a094af3d384 |
comparison
equal
deleted
inserted
replaced
360:b22f13fd0f6a | 361:9aa554f8cf39 |
---|---|
1 /* | |
2 ***************************************************************************** | |
3 * | |
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 | |
5 * R99 Version 3.3.0 | |
6 * REL-4 Version 4.1.0 | |
7 * | |
8 ***************************************************************************** | |
9 * | |
10 * File : e_homing.c | |
11 * | |
12 ***************************************************************************** | |
13 */ | |
14 | |
15 /* | |
16 ***************************************************************************** | |
17 * MODULE INCLUDE FILE AND VERSION ID | |
18 ***************************************************************************** | |
19 */ | |
20 | |
21 #include "namespace.h" | |
22 #include "e_homing.h" | |
23 | |
24 /* | |
25 ***************************************************************************** | |
26 * INCLUDE FILES | |
27 ***************************************************************************** | |
28 */ | |
29 | |
30 #include "typedef.h" | |
31 #include "cnst.h" | |
32 | |
33 /* | |
34 ***************************************************************************** | |
35 * PUBLIC PROGRAM CODE | |
36 ***************************************************************************** | |
37 */ | |
38 | |
39 /* | |
40 ******************************************************************************** | |
41 * | |
42 * Function : encoder_homing_frame_test | |
43 * In : input_frame[] one frame of speech samples | |
44 * Out : none | |
45 * Calls : none | |
46 * Tables : none | |
47 * Compile Defines : none | |
48 * Return : 0 input frame does not match the encoder homing frame pattern | |
49 * 1 input frame matches the encoder homing frame pattern | |
50 * Information : Checks if all samples of the input frame matches the encoder | |
51 * homing frame pattern, which is 0x0008 for all samples. | |
52 * | |
53 ******************************************************************************** | |
54 */ | |
55 | |
56 Word16 encoder_homing_frame_test (Word16 input_frame[]) | |
57 { | |
58 Word16 i, j; | |
59 | |
60 /* check 160 input samples for matching EHF_MASK: defined in e_homing.h */ | |
61 for (i = 0; i < L_FRAME; i++) | |
62 { | |
63 j = input_frame[i] ^ EHF_MASK; | |
64 | |
65 if (j) | |
66 break; | |
67 } | |
68 | |
69 return !j; | |
70 } |