annotate homing.c @ 0:9008dbc8ca74

import original C code from GSM 06.06
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 14 Jun 2024 23:27:16 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /**************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * File Name: homing.c
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Purpose:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * This file contains the following functions:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 * decoderHomingFrameTest() - checks if a frame of input speech
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 * parameters matches the Decoder Homing
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * Frame pattern.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 * decoderReset() - called by resetDec() to reset all of the state
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 * variables for the decoder
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 * encoderHomingFrameTest() - checks if a frame of input samples
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 * matches the Encoder Homing Frame pattern.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 * encoderReset() - called by resetEnc() to reset all the state
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 * variables for the encoder.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 * resetDec() - calls functions to reset the state variables for the
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 * decoder, and for the receive DTX and Comfort Noise.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 * resetEnc() - calls functions to reset the state variables for the
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 * encoder and VAD, and for the transmit DTX and
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 * Comfort Noise.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 * dtxResetTx() - called by resetEnc() to reset all of the transmit
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 * DTX and Comfort Noise state variables
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 * dtxResetRx() - called by resetDec() to reset all of the receive
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 * DTX and Comfort Noise state variables
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 | Include Files |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "typedefs.h"
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #include "vad.h"
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #include "dtx.h"
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #include "homing.h"
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 | Local Defines |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #define EHF_MASK 0x0008 /* Encoder Homing Frame pattern */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #define LMAX 142 /* largest lag (integer sense) */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #define CG_INT_MACS 6 /* Number of multiply-accumulates in
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 * one interpolation */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #define NUM_CLOSED 3 /* maximum number of lags searched */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #define LPCSTARTINDEX 25 /* where the LPC analysis window
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 * starts */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #define INBUFFSZ LPCSTARTINDEX + A_LEN /* input buffer size */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #define LTP_LEN 147 /* maximum ltp lag */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #define LSMAX (LMAX + CG_INT_MACS/2)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 #define HNW_BUFF_LEN LSMAX
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 * FUNCTION NAME: decoderHomingFrameTest
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 * Checks if a frame of input speech parameters matches the Decoder
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 * Homing Frame pattern, which is:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 * parameter decimal value hexidecimal value
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 * --------- ------------- -----------------
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 * R0 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 * LPC1 881 0x0371
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 * LPC2 350 0x015E
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 * LPC3 195 0x00c3
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 * INT_LPC 1 0x0001
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 * MODE 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 * CODE1_1 71 0x0047
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 * CODE2_1 74 0x004a
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 * GSP0_1 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 * CODE1_2 9 0x0009
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 * CODE2_2 38 0x0026
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 * GSP0_2 7 0x0007
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 * CODE1_3 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 * CODE2_3 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 * GSP0_3 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 * CODE1_4 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 * CODE2_4 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 * GSP0_4 0 0x0000
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 * pswSpeechPara[] - one frame of speech parameters
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 * in decoder input format
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 * iLastPara - the number of consecutive parameters in
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 * pswSpeechPara[] to match.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 * 0 input frame does not match the Decoder Homing Frame pattern.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 * 1 input frame matches the Decoder Homing Frame pattern.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 * pswSpeechPara
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 int decoderHomingFrameTest(Shortword pswSpeechPara[], int iLastPara)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 /* the n[] array contains the number of bits in each speech parameter */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 static int n[] = {5, 11, 9, 8, 1, 2, 7, 7, 5, 7, 7, 5, 7, 7, 5, 7, 7, 5};
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 static Shortword dhf_mask[] =
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 0x0000, /* R0 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 0x0371, /* LPC1 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 0x015E, /* LPC2 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 0x00c3, /* LPC3 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 0x0001, /* INT_LPC */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 0x0000, /* MODE */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 0x0047, /* CODE1_1 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 0x004a, /* CODE2_1 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 0x0000, /* GSP0_1 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 0x0009, /* CODE1_2 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 0x0026, /* CODE2_2 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 0x0007, /* GSP0_2 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 0x0000, /* CODE1_3 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 0x0000, /* CODE2_3 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 0x0000, /* GSP0_3 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 0x0000, /* CODE1_4 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 0x0000, /* CODE2_4 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 0x0000 /* GSP0_4 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 };
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 int i;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 int j;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 for (i = 0; i < iLastPara; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 j = ((pswSpeechPara[i] & ~(~0 << n[i])) ^ dhf_mask[i]);
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 if (j)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 break;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 return !j;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 * FUNCTION NAME: decoderReset
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 * resets all of the state variables for the decoder
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 void decoderReset(void)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 | External declarations for decoder variables which need to be reset |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 /* variables defined in sp_dec.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 /* ----------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 extern Shortword gswPostFiltAgcGain,
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 gpswPostFiltStateNum[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 gpswPostFiltStateDenom[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 swPostEmphasisState,
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 pswSynthFiltState[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 pswOldFrmKsDec[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 pswOldFrmAsDec[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 pswOldFrmPFNum[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 pswOldFrmPFDenom[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 swOldR0Dec,
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 pswLtpStateBaseDec[LTP_LEN + S_LEN],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 pswPPreState[LTP_LEN + S_LEN];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 extern Shortword swMuteFlagOld; /* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 /* variables defined in err_conc.c *//* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 /* ------------------------------- *//* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 extern Longword plSubfrEnergyMem[4]; /* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 extern Shortword swLevelMem[4],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 lastR0, /* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 pswLastGood[18], /* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 swState,
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 swLastFlag; /* error concealment */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 | Automatic Variables |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 int i;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 | Executable code |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 /* reset all the decoder state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 /* ------------------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 swOldR0Dec = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 gswPostFiltAgcGain = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 swPostEmphasisState = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 for (i = 0; i < NP; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 gpswPostFiltStateNum[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 gpswPostFiltStateDenom[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 pswSynthFiltState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 pswOldFrmKsDec[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 pswOldFrmAsDec[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 pswOldFrmPFNum[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 pswOldFrmPFDenom[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 for (i = 0; i < (LTP_LEN + S_LEN); i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 pswLtpStateBaseDec[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 pswPPreState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 /* reset all the error concealment state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 /* ----------------------------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 swMuteFlagOld = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 lastR0 = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 swState = 7;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 swLastFlag = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 for (i = 0; i < 3; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 plSubfrEnergyMem[i] = 80;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 swLevelMem[i] = -72;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 for (i = 0; i < 18; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 pswLastGood[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 * FUNCTION NAME: encoderHomingFrameTest
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 * Checks if a frame of input samples matches the Encoder Homing Frame
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 * pattern, which is 0x0008 for all 160 samples in the frame.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 * pswSpeech[] one frame of speech samples
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 * 0 input frame does not match the Encoder Homing Frame pattern.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 * 1 input frame matches the Encoder Homing Frame pattern.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 * pswSpeech
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 int encoderHomingFrameTest(Shortword pswSpeech[])
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 int i;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 Shortword j;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 for (i = 0; i < F_LEN; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 j = pswSpeech[i] ^ EHF_MASK;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 if (j)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 break;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 return !j;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 * FUNCTION NAME: encoderReset
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 * resets all of the state variables for the encoder
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 void encoderReset(void)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 | External declarations for encoder variables which need to be reset |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 /* variables defined in sp_enc.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 /* ----------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 extern Shortword swOldR0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 extern Shortword swOldR0Index;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 extern struct NormSw psnsWSfrmEngSpace[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 extern Shortword pswHPFXState[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 extern Shortword pswHPFYState[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 extern Shortword pswOldFrmKs[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 extern Shortword pswOldFrmAs[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 extern Shortword pswOldFrmSNWCoefs[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 extern Shortword pswWgtSpeechSpace[];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 extern Shortword pswSpeech[]; /* input speech */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 extern Shortword swPtch;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 /* variables defined in sp_frm.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 /* ----------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 extern Shortword pswAnalysisState[NP];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 extern Shortword pswWStateNum[NP],
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 pswWStateDenom[NP];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 /* variables defined in sp_sfrm.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 /* ------------------------------ */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 extern Shortword pswLtpStateBase[LTP_LEN + S_LEN];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 extern Shortword pswHState[NP];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 extern Shortword pswHNWState[HNW_BUFF_LEN];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 | Automatic Variables |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 int i;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 | Executable code |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 /* reset all the encoder state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 /* ------------------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 swOldR0Index = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 swOldR0 = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 for (i = 0; i < 2 * N_SUB; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 psnsWSfrmEngSpace[i].man = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 psnsWSfrmEngSpace[i].sh = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 for (i = 0; i < 4; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 pswHPFXState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 for (i = 0; i < 8; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 pswHPFYState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 for (i = 0; i < NP; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 pswOldFrmKs[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 pswOldFrmAs[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 pswOldFrmSNWCoefs[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 pswAnalysisState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 pswWStateNum[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 pswWStateDenom[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 pswHState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 for (i = 0; i < (F_LEN + LMAX + CG_INT_MACS / 2); i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 pswWgtSpeechSpace[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 for (i = 0; i < INBUFFSZ; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 pswSpeech[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 for (i = 0; i < (LTP_LEN + S_LEN); i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 pswLtpStateBase[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 for (i = 0; i < HNW_BUFF_LEN; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 pswHNWState[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 swPtch = 1;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 * FUNCTION NAME: resetDec
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 * resets all of the state variables for the decoder, and for the
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 * receive DTX and Comfort Noise.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 void resetDec(void)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 decoderReset(); /* reset all the state variables in
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 * the speech decoder */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 dtxResetRx(); /* reset all the receive DTX and CN
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 * state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 * FUNCTION NAME: resetEnc
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 * resets all of the state variables for the encoder and VAD, and for
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 * the transmit DTX and Comfort Noise.
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 void resetEnc(void)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 encoderReset(); /* reset all the state variables in
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 * the speech encoder */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 vad_reset(); /* reset all the VAD state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 dtxResetTx(); /* reset all the transmit DTX and CN
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 * state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 * FUNCTION NAME: dtxResetTx
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 * reset all the transmit DTX and CN state variables
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525 void dtxResetTx(void)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 | External declarations for encoder variables which need to be reset |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 /* variables defined in sp_enc.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 /* ----------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 extern Shortword swTxGsHistPtr;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 /* variables defined in dtx.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 /* -------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 extern Shortword swVadFrmCnt; /* Indicates the number of sequential
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 * frames where VAD == 0 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 extern short int siUpdPointer;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 extern Shortword swNElapsed;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 | Automatic Variables |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 | Executable code |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 /* reset all the transmit DTX and CN state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 /* ------------------------------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 swTxGsHistPtr = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 swVadFrmCnt = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 siUpdPointer = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 swNElapsed = 50;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 }
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 /***************************************************************************
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 * FUNCTION NAME: dtxResetRx
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 * PURPOSE:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 * reset all the receive DTX and CN state variables
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 * INPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 * OUTPUT:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 * RETURN:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 * None
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 * REFERENCES: Sub-clause 10 of GSM Recomendation 06.02
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 *
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 * KEYWORDS:
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 **************************************************************************/
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 void dtxResetRx(void)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 {
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 | External declarations for encoder variables which need to be reset |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 /* variables defined in sp_dec.c */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 /* ----------------------------- */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 extern Shortword swRxDTXState;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 extern Shortword swDecoMode;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609 extern Shortword swDtxMuting;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 extern Shortword swDtxBfiCnt;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 extern Shortword swOldR0IndexDec;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 extern Shortword swRxGsHistPtr;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 extern Longword pL_RxGsHist[(OVERHANG - 1) * N_SUB];
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 | Automatic Variables |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 int i;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 /*_________________________________________________________________________
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 | |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 | Executable code |
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 |_________________________________________________________________________|
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 /* reset all the receive DTX and CN state variables */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 /* ------------------------------------------------ */
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 swRxDTXState = CNINTPER - 1;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 swDecoMode = SPEECH;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 swDtxMuting = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 swDtxBfiCnt = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 swOldR0IndexDec = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 swRxGsHistPtr = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 for (i = 0; i < (OVERHANG - 1) * N_SUB; i++)
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 pL_RxGsHist[i] = 0;
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647
9008dbc8ca74 import original C code from GSM 06.06
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 }