1 /*
2  * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
3  * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
4  * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
5  */
6 
7 /* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast_alaw.c,v 1.2 1996/07/05 17:23:46 jutta Exp $ */
8 
9 #include	"toast.h"
10 
11 /*  toast_alaw.c -- manipulate A-law encoded sound.
12  */
13 
14 extern FILE	* in, * out;
15 
16 #define	A2S(x)	(a2s[  (unsigned char )(x)       ])
17 #define	S2A(x)	(s2a[ ((unsigned short)(x)) >> 4 ])
18 
19 static unsigned short a2s[] = {
20 
21  60032, 60288, 59520, 59776, 61056, 61312, 60544, 60800,
22  57984, 58240, 57472, 57728, 59008, 59264, 58496, 58752,
23  62784, 62912, 62528, 62656, 63296, 63424, 63040, 63168,
24  61760, 61888, 61504, 61632, 62272, 62400, 62016, 62144,
25  43520, 44544, 41472, 42496, 47616, 48640, 45568, 46592,
26  35328, 36352, 33280, 34304, 39424, 40448, 37376, 38400,
27  54528, 55040, 53504, 54016, 56576, 57088, 55552, 56064,
28  50432, 50944, 49408, 49920, 52480, 52992, 51456, 51968,
29  65192, 65208, 65160, 65176, 65256, 65272, 65224, 65240,
30  65064, 65080, 65032, 65048, 65128, 65144, 65096, 65112,
31  65448, 65464, 65416, 65432, 65512, 65528, 65480, 65496,
32  65320, 65336, 65288, 65304, 65384, 65400, 65352, 65368,
33  64160, 64224, 64032, 64096, 64416, 64480, 64288, 64352,
34  63648, 63712, 63520, 63584, 63904, 63968, 63776, 63840,
35  64848, 64880, 64784, 64816, 64976, 65008, 64912, 64944,
36  64592, 64624, 64528, 64560, 64720, 64752, 64656, 64688,
37   5504,  5248,  6016,  5760,  4480,  4224,  4992,  4736,
38   7552,  7296,  8064,  7808,  6528,  6272,  7040,  6784,
39   2752,  2624,  3008,  2880,  2240,  2112,  2496,  2368,
40   3776,  3648,  4032,  3904,  3264,  3136,  3520,  3392,
41  22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944,
42  30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136,
43  11008, 10496, 12032, 11520,  8960,  8448,  9984,  9472,
44  15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568,
45    344,   328,   376,   360,   280,   264,   312,   296,
46    472,   456,   504,   488,   408,   392,   440,   424,
47     88,    72,   120,   104,    24,     8,    56,    40,
48    216,   200,   248,   232,   152,   136,   184,   168,
49   1376,  1312,  1504,  1440,  1120,  1056,  1248,  1184,
50   1888,  1824,  2016,  1952,  1632,  1568,  1760,  1696,
51    688,   656,   752,   720,   560,   528,   624,   592,
52    944,   912,  1008,   976,   816,   784,   880,   848
53 
54 };
55 
56 
57 static unsigned char  s2a[] = {
58 
59 	213,212,215,214,209,208,211,210,221,220,223,222,217,216,219,218,
60 	197,196,199,198,193,192,195,194,205,204,207,206,201,200,203,202,
61 	245,245,244,244,247,247,246,246,241,241,240,240,243,243,242,242,
62 	253,253,252,252,255,255,254,254,249,249,248,248,251,251,250,250,
63 	229,229,229,229,228,228,228,228,231,231,231,231,230,230,230,230,
64 	225,225,225,225,224,224,224,224,227,227,227,227,226,226,226,226,
65 	237,237,237,237,236,236,236,236,239,239,239,239,238,238,238,238,
66 	233,233,233,233,232,232,232,232,235,235,235,235,234,234,234,234,
67 	149,149,149,149,149,149,149,149,148,148,148,148,148,148,148,148,
68 	151,151,151,151,151,151,151,151,150,150,150,150,150,150,150,150,
69 	145,145,145,145,145,145,145,145,144,144,144,144,144,144,144,144,
70 	147,147,147,147,147,147,147,147,146,146,146,146,146,146,146,146,
71 	157,157,157,157,157,157,157,157,156,156,156,156,156,156,156,156,
72 	159,159,159,159,159,159,159,159,158,158,158,158,158,158,158,158,
73 	153,153,153,153,153,153,153,153,152,152,152,152,152,152,152,152,
74 	155,155,155,155,155,155,155,155,154,154,154,154,154,154,154,154,
75 	133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
76 	132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
77 	135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,
78 	134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,
79 	129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,
80 	128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
81 	131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,
82 	130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,
83 	141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,
84 	140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,
85 	143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,
86 	142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,
87 	137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,
88 	136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,
89 	139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
90 	138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,
91 	181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
92 	181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
93 	180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
94 	180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
95 	183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,
96 	183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,
97 	182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,
98 	182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,
99 	177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,
100 	177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,
101 	176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
102 	176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
103 	179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
104 	179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,
105 	178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,
106 	178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,
107 	189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,
108 	189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,
109 	188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,
110 	188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,
111 	191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,
112 	191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,
113 	190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
114 	190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,
115 	185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
116 	185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,
117 	184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,
118 	184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,
119 	187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,
120 	187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,
121 	186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,
122 	186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,
123 	165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
124 	165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
125 	165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
126 	165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
127 	164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
128 	164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
129 	164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
130 	164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
131 	167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
132 	167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
133 	167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
134 	167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,
135 	166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,
136 	166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,
137 	166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,
138 	166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,
139 	161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
140 	161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
141 	161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
142 	161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
143 	160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,
144 	160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,
145 	160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,
146 	160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,
147 	163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,
148 	163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,
149 	163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,
150 	163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,
151 	162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,
152 	162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,
153 	162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,
154 	162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,
155 	173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
156 	173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
157 	173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
158 	173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
159 	172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
160 	172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
161 	172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
162 	172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
163 	175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,
164 	175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,
165 	175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,
166 	175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,
167 	174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,
168 	174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,
169 	174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,
170 	174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,
171 	169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,
172 	169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,
173 	169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,
174 	169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,
175 	168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,
176 	168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,
177 	168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,
178 	168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,
179 	171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
180 	171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
181 	171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
182 	171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,
183 	170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
184 	170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
185 	170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
186 	170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,
187 	 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
188 	 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
189 	 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
190 	 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
191 	 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
192 	 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
193 	 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
194 	 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
195 	 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
196 	 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
197 	 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
198 	 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
199 	 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
200 	 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
201 	 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
202 	 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
203 	 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
204 	 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
205 	 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
206 	 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
207 	 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
208 	 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
209 	 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
210 	 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
211 	 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
212 	 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
213 	 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
214 	 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
215 	 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
216 	 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
217 	 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
218 	 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
219 	 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
220 	 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
221 	 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
222 	 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
223 	 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
224 	 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
225 	 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
226 	 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
227 	 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
228 	 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
229 	 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
230 	 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
231 	 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
232 	 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
233 	 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
234 	 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
235 	 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
236 	 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
237 	 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
238 	 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
239 	 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
240 	 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
241 	 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
242 	 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
243 	 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
244 	 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
245 	 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
246 	 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
247 	 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
248 	 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
249 	 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
250 	 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
251 	 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
252 	 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
253 	 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
254 	 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
255 	 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
256 	 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
257 	 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
258 	 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
259 	 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
260 	 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
261 	 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
262 	 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
263 	 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
264 	 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
265 	 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
266 	 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
267 	 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
268 	 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
269 	 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
270 	 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
271 	 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
272 	 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
273 	 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
274 	 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
275 	 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
276 	 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
277 	 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
278 	 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
279 	 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
280 	 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
281 	 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
282 	 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
283 	 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
284 	 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
285 	  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,
286 	  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,
287 	 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
288 	 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
289 	 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
290 	 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
291 	  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,
292 	  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
293 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
294 	  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
295 	  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,
296 	  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,
297 	  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,
298 	  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
299 	 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
300 	 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25,
301 	 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31,
302 	 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29,
303 	 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,
304 	 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17,
305 	 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
306 	 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21,
307 	106,106,106,106,107,107,107,107,104,104,104,104,105,105,105,105,
308 	110,110,110,110,111,111,111,111,108,108,108,108,109,109,109,109,
309 	 98, 98, 98, 98, 99, 99, 99, 99, 96, 96, 96, 96, 97, 97, 97, 97,
310 	102,102,102,102,103,103,103,103,100,100,100,100,101,101,101,101,
311 	122,122,123,123,120,120,121,121,126,126,127,127,124,124,125,125,
312 	114,114,115,115,112,112,113,113,118,118,119,119,116,116,117,117,
313 	 74, 75, 72, 73, 78, 79, 76, 77, 66, 67, 64, 65, 70, 71, 68, 69,
314 	 90, 91, 88, 89, 94, 95, 92, 93, 82, 83, 80, 81, 86, 87, 84, 85
315 };
316 
317 int alaw_input P1((buf), gsm_signal * buf)
318 {
319 	int  i, c;
320 
321 	for (i = 0; i < 160 && (c = fgetc(in)) != EOF; i++) buf[i] = A2S( c );
322 	if (c == EOF && ferror(in)) return -1;
323 	return i;
324 }
325 
326 int alaw_output P1((buf), gsm_signal * buf)
327 {
328 	int  i;
329 
330 	for (i = 0; i < 160; i++, buf++)
331 		if (fputc( S2A( *buf ), out) == EOF) return -1;
332 	return 0;
333 }
334 
335