1 /* TMS51xx and TMS52xx ROM Tables */
2 
3 /* The following table is assumed to be for TMS5100
4  *
5  * US Patent 4209836
6  *           4331836
7  *           4304964
8  *           4234761
9  *           4189779
10  *           4449233
11  *
12  * All patents give interpolation coefficients
13  *  { 1, 8, 8, 8, 4, 4, 2, 2 }
14  *  This sequence will not calculate the published
15  *  fractions:
16  * 1 8 0.125
17  * 2 8 0.234
18  * 3 8 0.330
19  * 4 4 0.498
20  * 5 4 0.623
21  * 6 2 0.717
22  * 7 2 0.859
23  * 0 1 1.000
24  * (remember, 1 is the FIRST entry!)
25  *
26  * Instead,  { 1, 8, 8, 8, 4, 4, 4, 2 }
27  * will calculate those coefficients.
28  * Howeever, after simulating the actual circuit from the patent in pspice,
29  * the { 1, 8, 8, 8, 4, 4, 2, 2 } pattern is revealed as the correct one.
30  * Since the real chip uses shifters and not true division to achieve those
31  * factors, they have been replaced by the shifting coefficients:
32  * { 0, 3, 3, 3, 2, 2, 1, 1 }
33  */
34 
35 	/* quick note on derivative analysis:
36 	Judging by all the TI chips I (Lord Nightmare) have done this test on, the first derivative between successive values of the LPC tables should follow a roughly triangular or sine shaped curve, the second derivative should start at a value, increase slightly, then decrease smoothly and become negative right around where the LPC curve passes 0, finally increase slightly right near the end. If it doesn't do this, there is probably a wrong value in there somewhere. The pitch and energy tables follow similar patterns but aren't the same since they never cross 0. The chirp table doesn't follow this pattern at all.
37 	*/
38 /* chip type defines */
39 #define SUBTYPE_TMS5100         1
40 #define SUBTYPE_M58817          2
41 #define SUBTYPE_TMS5110         4
42 #define SUBTYPE_TMS5200         8
43 #define SUBTYPE_TMS5220         16
44 #define SUBTYPE_PAT4335277      32
45 #define SUBTYPE_VLM5030         64
46 
47 /* coefficient defines */
48 #define MAX_K                   10
49 #define MAX_SCALE_BITS          6
50 #define MAX_SCALE               (1<<MAX_SCALE_BITS)
51 #define COEFF_ENERGY_SENTINEL   (511)
52 #define MAX_CHIRP_SIZE          52
53 
54 struct tms5100_coeffs
55 {
56 	INT32			subtype;
57 	INT32			num_k;
58 	INT32			energy_bits;
59     INT32			pitch_bits;
60 	INT32			kbits[MAX_K];
61 	UINT16			energytable[MAX_SCALE];
62 	UINT16			pitchtable[MAX_SCALE];
63 	INT32			ktable[MAX_K][MAX_SCALE];
64 	INT16			chirptable[MAX_CHIRP_SIZE];
65 	INT8			interp_coeff[8];
66 };
67 
68 /*
69 The TMS5100NL was decapped and imaged by digshadow in April, 2013.
70 The LPC table is verified to match the decap.
71  It also matches the intended contents of US Patent 4,209,836 and several others.
72 The chirp table is verified to match the decap, and also matches the patents.
73 The TMS5100 (development name: TMC0280) and the Speak and spell's "CD2801" chip
74 are believed to be the same silicon. The 5100 may be the 'A' die revision of
75 the CD2801 based on die markings.
76 */
77 static const struct tms5100_coeffs pat4209836_coeff =
78 {
79 	/* subtype */
80 	SUBTYPE_TMS5100,
81 	10,
82 	4,
83 	5,
84 	{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
85 	/* E  */
86 	{ 0,  0,  1,  1,  2,  3,  5,  7,
87 		10,  15,  21,  30,  43,  61,  86, COEFF_ENERGY_SENTINEL }, // last rom value is actually really 0, but the tms5110.c code still requires the sentinel value to function correctly, until it is properly updated or merged with tms5220.c
88 	/* P  */
89 	{   0,  41,  43,  45,  47,  49,  51,  53,
90 		55,  58,  60,  63,  66,  70,  73,  76,
91 		79,  83,  87,  90,  94,  99, 103, 107,
92 		112, 118, 123, 129, 134, 140, 147, 153 },
93 	{
94 		/* K1  */
95 		{ -501, -497, -493, -488, -480, -471, -460, -446,
96 			-427, -405, -378, -344, -305, -259, -206, -148,
97 			-86,  -21,   45,  110,  171,  227,  277,  320,
98 			357,  388,  413,  434,  451,  464,  474,  498 },
99 		/* K2  */
100 		{ -349, -328, -305, -280, -252, -223, -192, -158,
101 			-124,  -88,  -51,  -14,  23,    60,   97,  133,
102 			167,  199,  230,  259,  286,  310,  333,  354,
103 			372,  389,  404,  417,  429,  439,  449,  506 },
104 		/* K3  */
105 		{ -397, -365, -327, -282, -229, -170, -104, -36,
106 			35,  104,  169,  228,  281,  326,  364, 396 },
107 		/* K4  */
108 		{ -369, -334, -293, -245, -191, -131, -67,  -1,
109 			64,  128,  188,  243,  291,  332, 367, 397 },
110 		/* K5  */
111 		{ -319, -286, -250, -211, -168, -122, -74, -25,
112 			24,   73,  121,  167,  210,  249, 285, 318 },
113 		/* K6  */
114 		{ -290, -252, -209, -163, -114,  -62,  -9,  44,
115 			97,  147,  194,  238,  278,  313, 344, 371 },
116 		/* K7  */
117 		{ -291, -256, -216, -174, -128, -80, -31,  19,
118 			69,  117,  163,  206,  246, 283, 316, 345 },
119 		/* K8  */
120 		{ -218, -133,  -38,  59,  152,  235, 305, 361 },
121 		/* K9  */
122 		{ -226, -157,  -82,  -3,   76,  151, 220, 280 },
123 		/* K10 */
124 		{ -179, -122,  -61,    1,   62,  123, 179, 231 },
125 	},
126 	/* Chirp table */
127 	{   0,  42, -44, 50, -78, 18, 37, 20,
128 		2, -31, -59,  2,  95, 90,  5, 15,
129 		38, -4,  -91,-91, -42,-35,-36, -4,
130 		37, 43,   34, 33,  15, -1, -8,-18,
131 		-19,-17,   -9,-10,  -6,  0,  3,  2,
132 		1,  0,    0,  0,   0,  0,  0,  0,
133 		0,  0,    0,  0 },
134 	/* interpolation coefficients */
135 	{ 3, 3, 3, 2, 2, 1, 1, 0 }
136 };
137 
138 /* The following CD2802 coefficients come from US Patents 4,403,965 and 4,946,391; They have not yet been verified using derivatives. The M58817 seems to work best with these coefficients, so its possible the engineers of that chip copied them from the TI patents.
139 ***These values have not yet been verified against a real CD2802 (used in touch & tell)***
140 */
141 static const struct tms5100_coeffs pat4403965_coeff =
142 {
143 	/* subtype */
144 	SUBTYPE_M58817,
145 	10,
146 	4,
147 	5,
148 	{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
149 	/* E   */
150 	{ 0,   1,   2,   3,   4,   6,   8,  11,
151 		16,  23,  33,  47,  63,  85, 114, 511 },
152 	/* P   */
153 	{ 0,  41,  43,  45,  47,  49,  51,  53,
154 		55,  58,  60,  63,  66,  70,  73,  76,
155 		79,  83,  87,  90,  94,  99, 103, 107,
156 	112, 118, 123, 129, 134, 140, 147, 153 },
157 	{
158 		/* K1  */
159 		{ -501, -498, -495, -490, -485, -478, -469, -459,
160 			-446, -431, -412, -389, -362, -331, -295, -253,
161 			-207, -156, -102,  -45,   13,   70,  126,  179,
162 			228,  272,  311,  345,  374,  399,  420,  437 },
163 		/* K2  */
164 		{ -376, -357, -335, -312, -286, -258, -227, -195,
165 			-161, -124,  -87,  -49,  -10,   29,   68,  106,
166 			143,  178,  212,  243,  272,  299,  324,  346,
167 			366,  384,  400,  414,  427,  438,  448,  506 },
168 		/* K3  */
169 		{ -407, -381, -349, -311, -268, -218, -162, -102,
170 			-39,   25,   89,  149,  206,  257,  302,  341 },
171 		/* K4  */
172 		{ -290, -252, -209, -163, -114,  -62,   -9,   44,
173 			97,  147,  194,  238,  278,  313,  344,  371 },
174 		/* K5  */
175 		{ -318, -283, -245, -202, -156, -107,  -56,   -3,
176 			49,  101,  150,  196,  239,  278,  313,  344 },
177 		/* K6  */
178 		{ -193, -152, -109,  -65,  -20,   26,   71,  115,
179 			158,  198,  235,  270,  301,  330,  355,  377 },
180 		/* K7  */
181 		{ -254, -218, -180, -140,  -97,  -53,   -8,   36,
182 			81,  124,  165,  204,  240,  274,  304,  332 },
183 		/* K8  */
184 		{ -205, -112,  -10,   92,  187,  269,  336,  387 },
185 		/* K9  */
186 		{ -249, -183, -110,  -19,   48,  126,  198,  261 }, // on tms5200 the 4th entry is -32
187 		/* K10 */
188 		{ -190, -133,  -73,  -10,   53,  115,  173,  227 },
189 	},
190 	/* Chirp table */
191 	{   0, 43,  -44, 51,-77, 18, 37, 20,
192 		2,-30,  -58,  3, 96, 91,  5, 15,
193 		38, -4,  -90,-91,-42,-35,-35, -3,
194 		37, 43,   35, 34, 15, -1, -8,-17,
195 		-19,-17,   -9, -9, -6,  1,  4,  3,
196 		1,  0,    0,  0,  0,  0,  0,  0,
197 		0,  0,    0,  0 },
198 	/* interpolation coefficients */
199 	{ 3, 3, 3, 2, 2, 1, 1, 0 }
200 };
201 
202 /* The following TMS5110A LPC coefficients were directly read from an actual
203 TMS5110A chip by Jarek Burczynski using the PROMOUT pin, and can be regarded
204 as established fact. However, the chirp table and the interpolation
205 coefficients still come from the patents as there doesn't seem to be an easy
206 way to read those out from the chip without decapping it.
207 The TMS5111NLL was decapped and imaged by digshadow in April, 2013.
208 The LPC table is verified to match the values from Jarek's PROMOUT dump of the TMS5110,
209 and the die even says "TMS5110AJ" on it. It uses the 'newer' 5200-style chirp table.
210 */
211 static const struct tms5100_coeffs tms5110a_coeff =
212 {
213 	/* subtype */
214 	SUBTYPE_TMS5110,
215 	10,
216 	4,
217 	5,
218 	{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
219 	/* E   */
220 	{ 0,   1,   2,   3,   4,   6,   8,  11,
221 		16,  23,  33,  47,  63,  85, 114, 511 },
222 	/* P   */
223 	{ 0,  15,  16,  17,  19,  21,  22,  25,
224 		26,  29,  32,  36,  40,  42,  46,  50,
225 		55,  60,  64,  68,  72,  76,  80,  84,
226 		86,  93, 101, 110, 120, 132, 144, 159 },
227 	{
228 		/* K1  */
229 		{ -501, -498, -497, -495, -493, -491, -488, -482,
230 			-478, -474, -469, -464, -459, -452, -445, -437,
231 			-412, -380, -339, -288, -227, -158,  -81,   -1,
232 			80,  157,  226,  287,  337,  379,  411,  436 },
233 		/* K2  */
234 		{ -328, -303, -274, -244, -211, -175, -138,  -99,
235 			-59,  -18,   24,   64,  105,  143,  180,  215,
236 			248,  278,  306,  331,  354,  374,  392,  408,
237 			422,  435,  445,  455,  463,  470,  476,  506 },
238 		/* K3  */
239 		{ -441, -387, -333, -279, -225, -171, -117,  -63,
240 			-9,   45,   98,  152,  206,  260,  314,  368 },
241 		/* K4  */
242 		{ -328, -273, -217, -161, -106,  -50,    5,   61,
243 			116,  172,  228,  283,  339,  394,  450,  506 },
244 		/* K5  */
245 		{ -328, -282, -235, -189, -142,  -96,  -50,   -3,
246 			43,   90,  136,  182,  229,  275,  322,  368 },
247 		/* K6  */
248 		{ -256, -212, -168, -123,  -79,  -35,   10,   54,
249 			98,  143,  187,  232,  276,  320,  365,  409 },
250 		/* K7  */
251 		{ -308, -260, -212, -164, -117,  -69,  -21,   27,
252 			75,  122,  170,  218,  266,  314,  361,  409 },
253 		/* K8  */
254 		{ -256, -161,  -66,   29,  124,  219,  314,  409 },
255 		/* K9  */
256 		{ -256, -176,  -96,  -15,   65,  146,  226,  307 },
257 		/* K10 */
258 		{ -205, -132,  -59,   14,   87,  160,  234,  307 },
259 	},
260 	/* Chirp table */
261 	{   0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50,
262 		0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13,
263 		0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00,
264 		0,  0,  0,  0,  0,  0,  0,  0,
265 		0,  0,  0,  0,  0,  0,  0,  0,
266 		0,  0,  0,  0,  0,  0,  0,  0,
267 		0,  0,  0,  0 },
268 	/* interpolation coefficients */
269 	{ 3, 3, 3, 2, 2, 1, 1, 0 }
270 };
271 
272 /* The following coefficients come from US Patent 4,335,277 and 4,581,757.
273 However, the K10 row of coefficients are entirely missing from both of those
274 patents.
275 The K values don't match the values read from an actual TMS5200 chip, but
276 might match the TMS5111 or some other undiscovered chip?
277 */
278 	// k* is followed by d if done transcription, c if checked for derivative aberrations
279 static const struct tms5100_coeffs pat4335277_coeff =
280 {
281 	/* subtype */
282 	SUBTYPE_PAT4335277,
283 	10,
284 	4,
285 	6,
286 	{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
287 	/* Ed   */
288 	{ 0,   1,   2,   3,   4,   6,   8,  11,
289 		16,  23,  33,  47,  63,  85, 114, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */
290 	/* Pd   */
291 	{ 0,  14,  15,  16,  17,  18,  19,  20,
292 		21,  22,  23,  24,  25,  26,  27,  28,
293 		29,  30,  31,  32,  34,  36,  38,  40,
294 		41,  43,  45,  48,  49,  51,  54,  55,
295 		57,  60,  62,  64,  68,  72,  74,  76,
296 		81,  85,  87,  90,  96,  99, 103, 107,
297 	112, 117, 122, 127, 133, 139, 145, 151,
298 	157, 164, 171, 178, 186, 194, 202, 211 },
299 	{
300 		/* K1dc  */
301 		{ -507, -505, -503, -501, -497, -493, -488, -481,
302 			-473, -463, -450, -434, -414, -390, -362, -328,
303 			-288, -242, -191, -135,  -75,  -13,   49,  110,
304 			168,  221,  269,  311,  348,  379,  404,  426 },
305 		/* K2dc  */
306 		{ -294, -266, -235, -202, -167, -130,  -92,  -52,
307 			-12,   28,   68,  108,  145,  182,  216,  248,
308 			278,  305,  330,  352,  372,  390,  406,  420,
309 			432,  443,  453,  461,  468,  474,  479,  486 },
310 		/* K3dc  */
311 		{ -449, -432, -411, -385, -354, -317, -273, -223,
312 			-167, -107,  -43,   22,   87,  148,  206,  258 },
313 		/* K4dc (first 4-5 values are probably wrong but close) */
314 		{ -321, -270, -220, -157,  -97,  -40,   25,   89,
315 			150,  207,  259,  304,  343,  376,  403,  425 },
316 		/* K5dc  */
317 		{ -373, -347, -318, -284, -247, -206, -162, -115,
318 			-65,  -15,   36,   86,  135,  181,  224,  263 },
319 		/* K6dc  */
320 		{ -213, -176, -137,  -96,  -54,  -11,   33,   75,
321 			117,  157,  195,  231,  264,  294,  322,  347 },
322 		/* K7dc  */
323 		{ -294, -264, -232, -198, -161, -122,  -82,  -41,
324 				1,   43,   84,  125,  163,  200,  234,  266 },
325 		/* K8dc  */
326 		{ -195, -117,  -32,   54,  137,  213,  279,  335 },
327 		/* K9dc  */
328 		{ -122,  -55,   15,   83, 149,  210,  264,  311  },
329 		/* K10  - this was entirely missing from the patent, and I've simply copied the real TMS5220 one, which is wrong */
330 		{ -205, -132,  -59,   14,  87,  160,  234,  307  },
331 	},
332 	/* Chirp table */
333 	{   0,  42, -44, 50, -78, 18, 37, 20,
334 		2, -31, -59,  2,  95, 90,  5, 15,
335 		38, -4,  -91,-91, -42,-35,-36, -4,
336 		37, 43,   34, 33,  15, -1, -8,-18,
337 		-19,-17,   -9,-10,  -6,  0,  3,  2,
338 		1,  0,    0,  0,   0,  0,  0,  0,
339 		0,  0,    0,  0 },
340 	/* interpolation coefficients */
341 	{ 3, 3, 3, 2, 2, 1, 1, 0 }
342 };
343 
344 /*
345 The TMS5200CNL was decapped and imaged by digshadow in March, 2013.
346 It is equivalent to the CD2501E (internally: "TMC0285") chip used
347  on the TI 99/4(A) speech module.
348 The LPC table is verified to match the decap.
349  (It was previously dumped with PROMOUT which matches as well)
350 The chirp table is verified to match the decap. (sum = 0x3da)
351 Note that the K coefficients are VERY different from the coefficients given
352  in the US 4,335,277 patent, which may have been for some sort of prototype or
353  otherwise intentionally scrambled. The energy and pitch tables, however, are
354  identical to that patent.
355 Also note, that the K coefficients are ALMOST identical to the coefficients from the CD2802.
356 The interpolation coefficients still come from the patents pending verification
357  of the interpolation counter circuit from the chip decap image.
358 NOTE FROM DECAP: immediately to the left of each of the K1,2,3,4,5,and 6
359  coefficients in the LPC rom are extra columns containing the constants
360  -510, -502, 313, 318, or in hex 0x202, 0x20A, 0x139, 0x13E.
361  Those EXACT constants DO appear (rather nonsensically) on the lpc table in US
362  patent 4,335,277. They don't seem to do anything except take up space and may
363  be a leftover from an older design predating even the patent.
364 */
365 
366 static const struct tms5100_coeffs tms5200_coeff =
367 {
368 	/* subtype */
369 	SUBTYPE_TMS5200,
370 	10,
371 	4,
372 	6,
373 	{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
374 	/* E */
375 	{ 0,   1,   2,   3,   4,   6,   8,  11,
376 		16,  23,  33,  47,  63,  85, 114,  0 },
377 	/* P */
378 	{ 0,  14,  15,  16,  17,  18,  19,  20,
379 		21,  22,  23,  24,  25,  26,  27,  28,
380 		29,  30,  31,  32,  34,  36,  38,  40,
381 		41,  43,  45,  48,  49,  51,  54,  55,
382 		57,  60,  62,  64,  68,  72,  74,  76,
383 		81,  85,  87,  90,  96,  99, 103, 107,
384 	112, 117, 122, 127, 133, 139, 145, 151,
385 	157, 164, 171, 178, 186, 194, 202, 211 },
386 	{
387 		/* K1 */
388 		{ -501, -498, -495, -490, -485, -478, -469, -459,
389 			-446, -431, -412, -389, -362, -331, -295, -253,
390 			-207, -156, -102,  -45,   13,   70,  126,  179,
391 			228,  272,  311,  345,  374,  399,  420,  437 },
392 		/* K2 */
393 		{ -376, -357, -335, -312, -286, -258, -227, -195,
394 			-161, -124,  -87,  -49,  -10,   29,   68,  106,
395 			143,  178,  212,  243,  272,  299,  324,  346,
396 			366,  384,  400,  414,  427,  438,  448,  506 },
397 		/* K3 */
398 		{ -407, -381, -349, -311, -268, -218, -162, -102,
399 			-39,   25,   89,  149,  206,  257,  302,  341 },
400 		/* K4 */
401 		{ -290, -252, -209, -163, -114,  -62,   -9,   44,
402 			97,  147,  194,  238,  278,  313,  344,  371 },
403 		/* K5 */
404 		{ -318, -283, -245, -202, -156, -107,  -56,   -3,
405 			49,  101,  150,  196,  239,  278,  313,  344 },
406 		/* K6 */
407 		{ -193, -152, -109,  -65,  -20,   26,   71,  115,
408 			158,  198,  235,  270,  301,  330,  355,  377 },
409 		/* K7 */
410 		{ -254, -218, -180, -140,  -97,  -53,   -8,   36,
411 			81,  124,  165,  204,  240,  274,  304,  332 },
412 		/* K8 */
413 		{ -205, -112,  -10,   92,  187,  269,  336,  387 },
414 		/* K9 */
415 		{ -249, -183, -110,  -32,   48,  126,  198,  261 }, // verified from decap; on the cd2802 patent the 4th entry is -19 (patent typo?)
416 		/* K10 */
417 		{ -190, -133,  -73,  -10,   53,  115,  173,  227 },
418 	},
419 	/* Chirp table */
420 	{   0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50,
421 		0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13,
422 		0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00,
423 		0,  0,  0,  0,  0,  0,  0,  0,
424 		0,  0,  0,  0,  0,  0,  0,  0,
425 		0,  0,  0,  0,  0,  0,  0,  0,
426 		0,  0,  0,  0 },
427 	/* interpolation coefficients */
428 	{ 0, 3, 3, 3, 2, 2, 1, 1 }
429 };
430 
431 /*
432 The TMS5220NL was decapped and imaged by digshadow in April, 2013.
433 The LPC table table is verified to match the decap.
434 The chirp table is verified to match the decap. (sum = 0x3da)
435 Note that all the LPC K* values match the TMS5110a table (as read via PROMOUT)
436 exactly.
437 The TMS5220CNL was decapped and imaged by digshadow in April, 2013.
438 The LPC table table is verified to match the decap and exactly matches TMS5220NL.
439 The chirp table is verified to match the decap. (sum = 0x3da)
440 */
441 static const struct tms5100_coeffs tms5220_coeff =
442 {
443 	/* subtype */
444 	SUBTYPE_TMS5220,
445 	10,
446 	4,
447 	6,
448 	{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
449 	/* E   */
450 	{ 0,   1,   2,   3,   4,   6,   8,  11,
451 		16,  23,  33,  47,  63,  85, 114,  0 },
452 	/* P   */
453 	{ 0,  15,  16,  17,  18,  19,  20,  21,
454 		22,  23,  24,  25,  26,  27,  28,  29,
455 		30,  31,  32,  33,  34,  35,  36,  37,
456 		38,  39,  40,  41,  42,  44,  46,  48,
457 		50,  52,  53,  56,  58,  60,  62,  65,
458 		68,  70,  72,  76,  78,  80,  84,  86,
459 		91,  94,  98, 101, 105, 109, 114, 118,
460 	122, 127, 132, 137, 142, 148, 153, 159 },
461 	{
462 		/* K1  */
463 		{ -501, -498, -497, -495, -493, -491, -488, -482,
464 			-478, -474, -469, -464, -459, -452, -445, -437,
465 			-412, -380, -339, -288, -227, -158,  -81,   -1,
466 			80,  157,  226,  287,  337,  379,  411,  436 },
467 		/* K2  */
468 		{ -328, -303, -274, -244, -211, -175, -138,  -99,
469 			-59,  -18,   24,   64,  105,  143,  180,  215,
470 			248,  278,  306,  331,  354,  374,  392,  408,
471 			422,  435,  445,  455,  463,  470,  476,  506 },
472 		/* K3  */
473 		{ -441, -387, -333, -279, -225, -171, -117,  -63,
474 			-9,   45,   98,  152,  206,  260,  314,  368  },
475 		/* K4  */
476 		{ -328, -273, -217, -161, -106,  -50,    5,   61,
477 			116,  172,  228,  283,  339,  394,  450,  506  },
478 		/* K5  */
479 		{ -328, -282, -235, -189, -142,  -96,  -50,   -3,
480 			43,   90,  136,  182,  229,  275,  322,  368  },
481 		/* K6  */
482 		{ -256, -212, -168, -123,  -79,  -35,   10,   54,
483 			98,  143,  187,  232,  276,  320,  365,  409  },
484 		/* K7  */
485 		{ -308, -260, -212, -164, -117,  -69,  -21,   27,
486 			75,  122,  170,  218,  266,  314,  361,  409  },
487 		/* K8  */
488 		{ -256, -161,  -66,   29,  124,  219,  314,  409  },
489 		/* K9  */
490 		{ -256, -176,  -96,  -15,   65,  146,  226,  307  },
491 		/* K10 */
492 		{ -205, -132,  -59,   14,   87,  160,  234,  307  },
493 	},
494 	/* Chirp table */
495 	{   0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50,
496 		0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13,
497 		0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00,
498 		0,  0,  0,  0,  0,  0,  0,  0,
499 		0,  0,  0,  0,  0,  0,  0,  0,
500 		0,  0,  0,  0,  0,  0,  0,  0,
501 		0,  0,  0,  0 },
502 	/* interpolation coefficients */
503 	{ 0, 3, 3, 3, 2, 2, 1, 1 }
504 };
505 
506 /* The following Sanyo VLM5030 coefficients are derived from decaps of the chip
507 done by ogoun, plus image stitching done by John McMaster. The organization of
508 coefficients beyond k2 is derived from work by Tatsuyuki Satoh.
509 The actual coefficient rom on the chip die has 5 groups of bits only:
510 Address |   K1A   |   K1B   |   K2   | Energy | Pitch |
511 Decoder |   K1A   |   K1B   |   K2   | Energy | Pitch |
512 K1A, K1B and K2 are 10 bits wide, 32 bits long each.
513 Energy and pitch are both 7 bits wide, 32 bits long each.
514 K1A holds odd values of K1, K1B holds even values.
515 K2 holds values for K2 only
516 K3 and K4 are actually the table index values <<6
517 K5 thru K10 are actually the table index values <<7
518 The concept of only having non-binary weighted reflection coefficients for the
519 first two k stages is mentioned in Markel & Gray "Linear Prediction of Speech"
520 and in Thomas Parsons' "Voice and Speech Processing"
521  */
522 static const struct tms5100_coeffs vlm5030_coeff =
523 {
524 	/* subtype */
525 	SUBTYPE_VLM5030,
526 	10,
527 	5,
528 	5,
529 	{ 6, 5, 4, 4, 3, 3, 3, 3, 3, 3 },
530 	/* E   */
531 	{ 0,  1,  2,  3,  5,  6,  7,  9,
532 		11, 13, 15, 17, 19, 22, 24, 27,
533 		31, 34, 38, 42, 47, 51, 57, 62,
534 		68, 75, 82, 89, 98,107,116,127},
535 	/* P   */
536 	{   0,  21,  22,  23,  24,  25,  26,  27,
537 		28,  29,  31,  33,  35,  37,  39,  41,
538 		43,  45,  49,  53,  57,  61,  65,  69,
539 		73,  77,  85,  93, 101, 109, 117, 125 },
540 	{
541 		/* K1  */
542 		/* (NOTE: the order of each table is correct, despite that the index MSb
543 		looks backwards) */
544 		{  390, 403, 414, 425, 434, 443, 450, 457,
545 			463, 469, 474, 478, 482, 485, 488, 491,
546 			494, 496, 498, 499, 501, 502, 503, 504,
547 			505, 506, 507, 507, 508, 508, 509, 509,
548 			-390,-376,-360,-344,-325,-305,-284,-261,
549 			-237,-211,-183,-155,-125, -95, -64, -32,
550 				0,  32,  64,  95, 125, 155, 183, 211,
551 			237, 261, 284, 305, 325, 344, 360, 376 },
552 		/* K2  */
553 		{    0,  50, 100, 149, 196, 241, 284, 325,
554 			362, 396, 426, 452, 473, 490, 502, 510,
555 				0,-510,-502,-490,-473,-452,-426,-396, /* entry 16(0x10) either has some special function, purpose unknown, or is a manufacturing error and should have been -512 */
556 			-362,-325,-284,-241,-196,-149,-100, -50 },
557 		/* K3  */
558 		/*{    0, 100, 196, 284, 362, 426, 473, 502,
559 		  -510,-490,-452,-396,-325,-241,-149, -50 },*/
560 		{    0, 64, 128, 192, 256, 320, 384, 448,
561 			-512,-448,-384,-320,-256,-192,-128, -64 },
562 		/* K4  */
563 		/*{    0, 100, 196, 284, 362, 426, 473, 502,
564 		  -510,-490,-452,-396,-325,-241,-149, -50 },*/
565 		{    0, 64, 128, 192, 256, 320, 384, 448,
566 			-512,-448,-384,-320,-256,-192,-128, -64 },
567 		/* K5  */
568 		{    0, 128, 256, 384,-512,-384,-256,-128 },
569 		/* K6  */
570 		{    0, 128, 256, 384,-512,-384,-256,-128 },
571 		/* K7  */
572 		{    0, 128, 256, 384,-512,-384,-256,-128 },
573 		/* K8  */
574 		{    0, 128, 256, 384,-512,-384,-256,-128 },
575 		/* K9  */
576 		{    0, 128, 256, 384,-512,-384,-256,-128 },
577 		/* K10 */
578 		/*{    0, 196, 362, 473,-510,-452,-325,-149 },*/
579 		{    0, 128, 256, 384,-512,-384,-256,-128 },
580 	},
581 	/* Chirp table */
582 	{   0,127,127,  0,  0,  0,  0,  0,
583 		0,  0,  0,  0,  0,  0,  0,  0,
584 		0,  0,  0,  0,  0,  0,  0,  0,
585 		0,  0,  0,  0,  0,  0,  0,  0,
586 		0,  0,  0,  0,  0,  0,  0,  0,
587 		0,  0,  0,  0,  0,  0,  0,  0,
588 		0,  0,  0,  0 },
589 	/* interpolation coefficients */
590 	{ 3, 3, 3, 2, 2, 1, 1, 0 }
591 };
592