staging/easycap: make OSS compilation optional instead of ALSA
[linux-2.6/cjktty.git] / drivers / staging / easycap / easycap_testcard.c
blob0f8336b6510f980e3839b3fb5576f56f11eab23a
1 /******************************************************************************
2 * *
3 * easycap_testcard.c *
4 * *
5 ******************************************************************************/
6 /*
8 * Copyright (C) 2010 R.M. Thomas <rmthomas@sciolus.org>
11 * This is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * The software is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this software; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 /*****************************************************************************/
28 #include "easycap.h"
30 /*****************************************************************************/
31 #define TESTCARD_BYTESPERLINE (2 * 720)
32 void
33 easycap_testcard(struct easycap *peasycap, int field)
35 int total;
36 int y, u, v, r, g, b;
37 unsigned char uyvy[4];
38 int i1, line, k, m, n, more, much, barwidth, barheight;
39 unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2;
40 struct data_buffer *pfield_buffer;
42 if (NULL == peasycap) {
43 SAY("ERROR: peasycap is NULL\n");
44 return;
46 JOM(8, "%i=field\n", field);
47 switch (peasycap->width) {
48 case 720:
49 case 360: {
50 barwidth = (2 * 720) / 8;
51 break;
53 case 704:
54 case 352: {
55 barwidth = (2 * 704) / 8;
56 break;
58 case 640:
59 case 320: {
60 barwidth = (2 * 640) / 8;
61 break;
63 default: {
64 SAM("ERROR: cannot set barwidth\n");
65 return;
68 if (TESTCARD_BYTESPERLINE < barwidth) {
69 SAM("ERROR: barwidth is too large\n");
70 return;
72 switch (peasycap->height) {
73 case 576:
74 case 288: {
75 barheight = 576;
76 break;
78 case 480:
79 case 240: {
80 barheight = 480;
81 break;
83 default: {
84 SAM("ERROR: cannot set barheight\n");
85 return;
88 total = 0;
89 k = field;
90 m = 0;
91 n = 0;
93 for (line = 0; line < (barheight / 2); line++) {
94 for (i1 = 0; i1 < 8; i1++) {
95 r = (i1 * 256)/8;
96 g = (i1 * 256)/8;
97 b = (i1 * 256)/8;
99 y = 299*r/1000 + 587*g/1000 + 114*b/1000 ;
100 u = -147*r/1000 - 289*g/1000 + 436*b/1000 ; u = u + 128;
101 v = 615*r/1000 - 515*g/1000 - 100*b/1000 ; v = v + 128;
103 uyvy[0] = 0xFF & u ;
104 uyvy[1] = 0xFF & y ;
105 uyvy[2] = 0xFF & v ;
106 uyvy[3] = 0xFF & y ;
108 p1 = &bfbar[0];
109 while (p1 < &bfbar[barwidth]) {
110 *p1++ = uyvy[0] ;
111 *p1++ = uyvy[1] ;
112 *p1++ = uyvy[2] ;
113 *p1++ = uyvy[3] ;
114 total += 4;
117 p1 = &bfbar[0];
118 more = barwidth;
120 while (more) {
121 if ((FIELD_BUFFER_SIZE/PAGE_SIZE) <= m) {
122 SAM("ERROR: bad m reached\n");
123 return;
125 if (PAGE_SIZE < n) {
126 SAM("ERROR: bad n reached\n"); return;
129 if (0 > more) {
130 SAM("ERROR: internal fault\n");
131 return;
134 much = PAGE_SIZE - n;
135 if (much > more)
136 much = more;
137 pfield_buffer = &peasycap->field_buffer[k][m];
138 p2 = pfield_buffer->pgo + n;
139 memcpy(p2, p1, much);
141 p1 += much;
142 n += much;
143 more -= much;
144 if (PAGE_SIZE == n) {
145 m++;
146 n = 0;
151 return;
153 /*****************************************************************************/
154 #if defined(EASYCAP_TESTTONE)
155 /*-----------------------------------------------------------------------------
156 THE tones[] ARRAY BELOW IS THE OUTPUT OF THIS PROGRAM,
157 COMPILED gcc -o prog -lm prog.c
158 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
159 #include <stdio.h>
160 #include <math.h>
162 int main(void);
164 main(void)
166 int i1, i2, last;
167 double d1, d2;
169 last = 1024 - 1;
170 d1 = 10.0*3.14159265/1024.0;
171 printf("int tones[2048] =\n{\n");
172 for (i1 = 0; i1 <= last; i1++)
174 d2 = ((double)i1) * d1;
175 i2 = (int)(16384.0*sin(d2));
177 if (last != i1)
179 printf("%6i, ", i2); printf("%6i, ", i2);
180 if (!((i1 + 1)%5)) printf("\n");
182 else
184 printf("%6i, ", i2); printf("%6i\n};\n", i2);
187 return 0;
189 -----------------------------------------------------------------------------*/
190 int tones[2048] = {
191 0, 0, 502, 502, 1004, 1004, 1505, 1505, 2005, 2005,
192 2503, 2503, 2998, 2998, 3491, 3491, 3980, 3980, 4466, 4466,
193 4948, 4948, 5424, 5424, 5896, 5896, 6362, 6362, 6822, 6822,
194 7276, 7276, 7723, 7723, 8162, 8162, 8594, 8594, 9018, 9018,
195 9434, 9434, 9840, 9840, 10237, 10237, 10625, 10625, 11002, 11002,
196 11370, 11370, 11726, 11726, 12072, 12072, 12406, 12406, 12728, 12728,
197 13038, 13038, 13337, 13337, 13622, 13622, 13895, 13895, 14155, 14155,
198 14401, 14401, 14634, 14634, 14853, 14853, 15058, 15058, 15249, 15249,
199 15426, 15426, 15588, 15588, 15735, 15735, 15868, 15868, 15985, 15985,
200 16088, 16088, 16175, 16175, 16248, 16248, 16305, 16305, 16346, 16346,
201 16372, 16372, 16383, 16383, 16379, 16379, 16359, 16359, 16323, 16323,
202 16272, 16272, 16206, 16206, 16125, 16125, 16028, 16028, 15917, 15917,
203 15790, 15790, 15649, 15649, 15492, 15492, 15322, 15322, 15136, 15136,
204 14937, 14937, 14723, 14723, 14496, 14496, 14255, 14255, 14001, 14001,
205 13733, 13733, 13452, 13452, 13159, 13159, 12854, 12854, 12536, 12536,
206 12207, 12207, 11866, 11866, 11513, 11513, 11150, 11150, 10777, 10777,
207 10393, 10393, 10000, 10000, 9597, 9597, 9185, 9185, 8765, 8765,
208 8336, 8336, 7900, 7900, 7456, 7456, 7005, 7005, 6547, 6547,
209 6083, 6083, 5614, 5614, 5139, 5139, 4659, 4659, 4175, 4175,
210 3687, 3687, 3196, 3196, 2701, 2701, 2204, 2204, 1705, 1705,
211 1205, 1205, 703, 703, 201, 201, -301, -301, -803, -803,
212 -1305, -1305, -1805, -1805, -2304, -2304, -2801, -2801, -3294, -3294,
213 -3785, -3785, -4272, -4272, -4756, -4756, -5234, -5234, -5708, -5708,
214 -6176, -6176, -6639, -6639, -7095, -7095, -7545, -7545, -7988, -7988,
215 -8423, -8423, -8850, -8850, -9268, -9268, -9679, -9679, -10079, -10079,
216 -10471, -10471, -10853, -10853, -11224, -11224, -11585, -11585, -11935, -11935,
217 -12273, -12273, -12600, -12600, -12916, -12916, -13219, -13219, -13510, -13510,
218 -13788, -13788, -14053, -14053, -14304, -14304, -14543, -14543, -14767, -14767,
219 -14978, -14978, -15175, -15175, -15357, -15357, -15525, -15525, -15678, -15678,
220 -15817, -15817, -15940, -15940, -16049, -16049, -16142, -16142, -16221, -16221,
221 -16284, -16284, -16331, -16331, -16364, -16364, -16381, -16381, -16382, -16382,
222 -16368, -16368, -16339, -16339, -16294, -16294, -16234, -16234, -16159, -16159,
223 -16069, -16069, -15963, -15963, -15842, -15842, -15707, -15707, -15557, -15557,
224 -15392, -15392, -15212, -15212, -15018, -15018, -14810, -14810, -14589, -14589,
225 -14353, -14353, -14104, -14104, -13842, -13842, -13566, -13566, -13278, -13278,
226 -12977, -12977, -12665, -12665, -12340, -12340, -12003, -12003, -11656, -11656,
227 -11297, -11297, -10928, -10928, -10548, -10548, -10159, -10159, -9759, -9759,
228 -9351, -9351, -8934, -8934, -8509, -8509, -8075, -8075, -7634, -7634,
229 -7186, -7186, -6731, -6731, -6269, -6269, -5802, -5802, -5329, -5329,
230 -4852, -4852, -4369, -4369, -3883, -3883, -3393, -3393, -2900, -2900,
231 -2404, -2404, -1905, -1905, -1405, -1405, -904, -904, -402, -402,
232 100, 100, 603, 603, 1105, 1105, 1605, 1605, 2105, 2105,
233 2602, 2602, 3097, 3097, 3589, 3589, 4078, 4078, 4563, 4563,
234 5043, 5043, 5519, 5519, 5990, 5990, 6455, 6455, 6914, 6914,
235 7366, 7366, 7811, 7811, 8249, 8249, 8680, 8680, 9102, 9102,
236 9516, 9516, 9920, 9920, 10315, 10315, 10701, 10701, 11077, 11077,
237 11442, 11442, 11796, 11796, 12139, 12139, 12471, 12471, 12791, 12791,
238 13099, 13099, 13395, 13395, 13678, 13678, 13948, 13948, 14205, 14205,
239 14449, 14449, 14679, 14679, 14895, 14895, 15098, 15098, 15286, 15286,
240 15459, 15459, 15618, 15618, 15763, 15763, 15892, 15892, 16007, 16007,
241 16107, 16107, 16191, 16191, 16260, 16260, 16314, 16314, 16353, 16353,
242 16376, 16376, 16384, 16384, 16376, 16376, 16353, 16353, 16314, 16314,
243 16260, 16260, 16191, 16191, 16107, 16107, 16007, 16007, 15892, 15892,
244 15763, 15763, 15618, 15618, 15459, 15459, 15286, 15286, 15098, 15098,
245 14895, 14895, 14679, 14679, 14449, 14449, 14205, 14205, 13948, 13948,
246 13678, 13678, 13395, 13395, 13099, 13099, 12791, 12791, 12471, 12471,
247 12139, 12139, 11796, 11796, 11442, 11442, 11077, 11077, 10701, 10701,
248 10315, 10315, 9920, 9920, 9516, 9516, 9102, 9102, 8680, 8680,
249 8249, 8249, 7811, 7811, 7366, 7366, 6914, 6914, 6455, 6455,
250 5990, 5990, 5519, 5519, 5043, 5043, 4563, 4563, 4078, 4078,
251 3589, 3589, 3097, 3097, 2602, 2602, 2105, 2105, 1605, 1605,
252 1105, 1105, 603, 603, 100, 100, -402, -402, -904, -904,
253 -1405, -1405, -1905, -1905, -2404, -2404, -2900, -2900, -3393, -3393,
254 -3883, -3883, -4369, -4369, -4852, -4852, -5329, -5329, -5802, -5802,
255 -6269, -6269, -6731, -6731, -7186, -7186, -7634, -7634, -8075, -8075,
256 -8509, -8509, -8934, -8934, -9351, -9351, -9759, -9759, -10159, -10159,
257 -10548, -10548, -10928, -10928, -11297, -11297, -11656, -11656, -12003, -12003,
258 -12340, -12340, -12665, -12665, -12977, -12977, -13278, -13278, -13566, -13566,
259 -13842, -13842, -14104, -14104, -14353, -14353, -14589, -14589, -14810, -14810,
260 -15018, -15018, -15212, -15212, -15392, -15392, -15557, -15557, -15707, -15707,
261 -15842, -15842, -15963, -15963, -16069, -16069, -16159, -16159, -16234, -16234,
262 -16294, -16294, -16339, -16339, -16368, -16368, -16382, -16382, -16381, -16381,
263 -16364, -16364, -16331, -16331, -16284, -16284, -16221, -16221, -16142, -16142,
264 -16049, -16049, -15940, -15940, -15817, -15817, -15678, -15678, -15525, -15525,
265 -15357, -15357, -15175, -15175, -14978, -14978, -14767, -14767, -14543, -14543,
266 -14304, -14304, -14053, -14053, -13788, -13788, -13510, -13510, -13219, -13219,
267 -12916, -12916, -12600, -12600, -12273, -12273, -11935, -11935, -11585, -11585,
268 -11224, -11224, -10853, -10853, -10471, -10471, -10079, -10079, -9679, -9679,
269 -9268, -9268, -8850, -8850, -8423, -8423, -7988, -7988, -7545, -7545,
270 -7095, -7095, -6639, -6639, -6176, -6176, -5708, -5708, -5234, -5234,
271 -4756, -4756, -4272, -4272, -3785, -3785, -3294, -3294, -2801, -2801,
272 -2304, -2304, -1805, -1805, -1305, -1305, -803, -803, -301, -301,
273 201, 201, 703, 703, 1205, 1205, 1705, 1705, 2204, 2204,
274 2701, 2701, 3196, 3196, 3687, 3687, 4175, 4175, 4659, 4659,
275 5139, 5139, 5614, 5614, 6083, 6083, 6547, 6547, 7005, 7005,
276 7456, 7456, 7900, 7900, 8336, 8336, 8765, 8765, 9185, 9185,
277 9597, 9597, 10000, 10000, 10393, 10393, 10777, 10777, 11150, 11150,
278 11513, 11513, 11866, 11866, 12207, 12207, 12536, 12536, 12854, 12854,
279 13159, 13159, 13452, 13452, 13733, 13733, 14001, 14001, 14255, 14255,
280 14496, 14496, 14723, 14723, 14937, 14937, 15136, 15136, 15322, 15322,
281 15492, 15492, 15649, 15649, 15790, 15790, 15917, 15917, 16028, 16028,
282 16125, 16125, 16206, 16206, 16272, 16272, 16323, 16323, 16359, 16359,
283 16379, 16379, 16383, 16383, 16372, 16372, 16346, 16346, 16305, 16305,
284 16248, 16248, 16175, 16175, 16088, 16088, 15985, 15985, 15868, 15868,
285 15735, 15735, 15588, 15588, 15426, 15426, 15249, 15249, 15058, 15058,
286 14853, 14853, 14634, 14634, 14401, 14401, 14155, 14155, 13895, 13895,
287 13622, 13622, 13337, 13337, 13038, 13038, 12728, 12728, 12406, 12406,
288 12072, 12072, 11726, 11726, 11370, 11370, 11002, 11002, 10625, 10625,
289 10237, 10237, 9840, 9840, 9434, 9434, 9018, 9018, 8594, 8594,
290 8162, 8162, 7723, 7723, 7276, 7276, 6822, 6822, 6362, 6362,
291 5896, 5896, 5424, 5424, 4948, 4948, 4466, 4466, 3980, 3980,
292 3491, 3491, 2998, 2998, 2503, 2503, 2005, 2005, 1505, 1505,
293 1004, 1004, 502, 502, 0, 0, -502, -502, -1004, -1004,
294 -1505, -1505, -2005, -2005, -2503, -2503, -2998, -2998, -3491, -3491,
295 -3980, -3980, -4466, -4466, -4948, -4948, -5424, -5424, -5896, -5896,
296 -6362, -6362, -6822, -6822, -7276, -7276, -7723, -7723, -8162, -8162,
297 -8594, -8594, -9018, -9018, -9434, -9434, -9840, -9840, -10237, -10237,
298 -10625, -10625, -11002, -11002, -11370, -11370, -11726, -11726, -12072, -12072,
299 -12406, -12406, -12728, -12728, -13038, -13038, -13337, -13337, -13622, -13622,
300 -13895, -13895, -14155, -14155, -14401, -14401, -14634, -14634, -14853, -14853,
301 -15058, -15058, -15249, -15249, -15426, -15426, -15588, -15588, -15735, -15735,
302 -15868, -15868, -15985, -15985, -16088, -16088, -16175, -16175, -16248, -16248,
303 -16305, -16305, -16346, -16346, -16372, -16372, -16383, -16383, -16379, -16379,
304 -16359, -16359, -16323, -16323, -16272, -16272, -16206, -16206, -16125, -16125,
305 -16028, -16028, -15917, -15917, -15790, -15790, -15649, -15649, -15492, -15492,
306 -15322, -15322, -15136, -15136, -14937, -14937, -14723, -14723, -14496, -14496,
307 -14255, -14255, -14001, -14001, -13733, -13733, -13452, -13452, -13159, -13159,
308 -12854, -12854, -12536, -12536, -12207, -12207, -11866, -11866, -11513, -11513,
309 -11150, -11150, -10777, -10777, -10393, -10393, -10000, -10000, -9597, -9597,
310 -9185, -9185, -8765, -8765, -8336, -8336, -7900, -7900, -7456, -7456,
311 -7005, -7005, -6547, -6547, -6083, -6083, -5614, -5614, -5139, -5139,
312 -4659, -4659, -4175, -4175, -3687, -3687, -3196, -3196, -2701, -2701,
313 -2204, -2204, -1705, -1705, -1205, -1205, -703, -703, -201, -201,
314 301, 301, 803, 803, 1305, 1305, 1805, 1805, 2304, 2304,
315 2801, 2801, 3294, 3294, 3785, 3785, 4272, 4272, 4756, 4756,
316 5234, 5234, 5708, 5708, 6176, 6176, 6639, 6639, 7095, 7095,
317 7545, 7545, 7988, 7988, 8423, 8423, 8850, 8850, 9268, 9268,
318 9679, 9679, 10079, 10079, 10471, 10471, 10853, 10853, 11224, 11224,
319 11585, 11585, 11935, 11935, 12273, 12273, 12600, 12600, 12916, 12916,
320 13219, 13219, 13510, 13510, 13788, 13788, 14053, 14053, 14304, 14304,
321 14543, 14543, 14767, 14767, 14978, 14978, 15175, 15175, 15357, 15357,
322 15525, 15525, 15678, 15678, 15817, 15817, 15940, 15940, 16049, 16049,
323 16142, 16142, 16221, 16221, 16284, 16284, 16331, 16331, 16364, 16364,
324 16381, 16381, 16382, 16382, 16368, 16368, 16339, 16339, 16294, 16294,
325 16234, 16234, 16159, 16159, 16069, 16069, 15963, 15963, 15842, 15842,
326 15707, 15707, 15557, 15557, 15392, 15392, 15212, 15212, 15018, 15018,
327 14810, 14810, 14589, 14589, 14353, 14353, 14104, 14104, 13842, 13842,
328 13566, 13566, 13278, 13278, 12977, 12977, 12665, 12665, 12340, 12340,
329 12003, 12003, 11656, 11656, 11297, 11297, 10928, 10928, 10548, 10548,
330 10159, 10159, 9759, 9759, 9351, 9351, 8934, 8934, 8509, 8509,
331 8075, 8075, 7634, 7634, 7186, 7186, 6731, 6731, 6269, 6269,
332 5802, 5802, 5329, 5329, 4852, 4852, 4369, 4369, 3883, 3883,
333 3393, 3393, 2900, 2900, 2404, 2404, 1905, 1905, 1405, 1405,
334 904, 904, 402, 402, -100, -100, -603, -603, -1105, -1105,
335 -1605, -1605, -2105, -2105, -2602, -2602, -3097, -3097, -3589, -3589,
336 -4078, -4078, -4563, -4563, -5043, -5043, -5519, -5519, -5990, -5990,
337 -6455, -6455, -6914, -6914, -7366, -7366, -7811, -7811, -8249, -8249,
338 -8680, -8680, -9102, -9102, -9516, -9516, -9920, -9920, -10315, -10315,
339 -10701, -10701, -11077, -11077, -11442, -11442, -11796, -11796, -12139, -12139,
340 -12471, -12471, -12791, -12791, -13099, -13099, -13395, -13395, -13678, -13678,
341 -13948, -13948, -14205, -14205, -14449, -14449, -14679, -14679, -14895, -14895,
342 -15098, -15098, -15286, -15286, -15459, -15459, -15618, -15618, -15763, -15763,
343 -15892, -15892, -16007, -16007, -16107, -16107, -16191, -16191, -16260, -16260,
344 -16314, -16314, -16353, -16353, -16376, -16376, -16383, -16383, -16376, -16376,
345 -16353, -16353, -16314, -16314, -16260, -16260, -16191, -16191, -16107, -16107,
346 -16007, -16007, -15892, -15892, -15763, -15763, -15618, -15618, -15459, -15459,
347 -15286, -15286, -15098, -15098, -14895, -14895, -14679, -14679, -14449, -14449,
348 -14205, -14205, -13948, -13948, -13678, -13678, -13395, -13395, -13099, -13099,
349 -12791, -12791, -12471, -12471, -12139, -12139, -11796, -11796, -11442, -11442,
350 -11077, -11077, -10701, -10701, -10315, -10315, -9920, -9920, -9516, -9516,
351 -9102, -9102, -8680, -8680, -8249, -8249, -7811, -7811, -7366, -7366,
352 -6914, -6914, -6455, -6455, -5990, -5990, -5519, -5519, -5043, -5043,
353 -4563, -4563, -4078, -4078, -3589, -3589, -3097, -3097, -2602, -2602,
354 -2105, -2105, -1605, -1605, -1105, -1105, -603, -603, -100, -100,
355 402, 402, 904, 904, 1405, 1405, 1905, 1905, 2404, 2404,
356 2900, 2900, 3393, 3393, 3883, 3883, 4369, 4369, 4852, 4852,
357 5329, 5329, 5802, 5802, 6269, 6269, 6731, 6731, 7186, 7186,
358 7634, 7634, 8075, 8075, 8509, 8509, 8934, 8934, 9351, 9351,
359 9759, 9759, 10159, 10159, 10548, 10548, 10928, 10928, 11297, 11297,
360 11656, 11656, 12003, 12003, 12340, 12340, 12665, 12665, 12977, 12977,
361 13278, 13278, 13566, 13566, 13842, 13842, 14104, 14104, 14353, 14353,
362 14589, 14589, 14810, 14810, 15018, 15018, 15212, 15212, 15392, 15392,
363 15557, 15557, 15707, 15707, 15842, 15842, 15963, 15963, 16069, 16069,
364 16159, 16159, 16234, 16234, 16294, 16294, 16339, 16339, 16368, 16368,
365 16382, 16382, 16381, 16381, 16364, 16364, 16331, 16331, 16284, 16284,
366 16221, 16221, 16142, 16142, 16049, 16049, 15940, 15940, 15817, 15817,
367 15678, 15678, 15525, 15525, 15357, 15357, 15175, 15175, 14978, 14978,
368 14767, 14767, 14543, 14543, 14304, 14304, 14053, 14053, 13788, 13788,
369 13510, 13510, 13219, 13219, 12916, 12916, 12600, 12600, 12273, 12273,
370 11935, 11935, 11585, 11585, 11224, 11224, 10853, 10853, 10471, 10471,
371 10079, 10079, 9679, 9679, 9268, 9268, 8850, 8850, 8423, 8423,
372 7988, 7988, 7545, 7545, 7095, 7095, 6639, 6639, 6176, 6176,
373 5708, 5708, 5234, 5234, 4756, 4756, 4272, 4272, 3785, 3785,
374 3294, 3294, 2801, 2801, 2304, 2304, 1805, 1805, 1305, 1305,
375 803, 803, 301, 301, -201, -201, -703, -703, -1205, -1205,
376 -1705, -1705, -2204, -2204, -2701, -2701, -3196, -3196, -3687, -3687,
377 -4175, -4175, -4659, -4659, -5139, -5139, -5614, -5614, -6083, -6083,
378 -6547, -6547, -7005, -7005, -7456, -7456, -7900, -7900, -8336, -8336,
379 -8765, -8765, -9185, -9185, -9597, -9597, -10000, -10000, -10393, -10393,
380 -10777, -10777, -11150, -11150, -11513, -11513, -11866, -11866, -12207, -12207,
381 -12536, -12536, -12854, -12854, -13159, -13159, -13452, -13452, -13733, -13733,
382 -14001, -14001, -14255, -14255, -14496, -14496, -14723, -14723, -14937, -14937,
383 -15136, -15136, -15322, -15322, -15492, -15492, -15649, -15649, -15790, -15790,
384 -15917, -15917, -16028, -16028, -16125, -16125, -16206, -16206, -16272, -16272,
385 -16323, -16323, -16359, -16359, -16379, -16379, -16383, -16383, -16372, -16372,
386 -16346, -16346, -16305, -16305, -16248, -16248, -16175, -16175, -16088, -16088,
387 -15985, -15985, -15868, -15868, -15735, -15735, -15588, -15588, -15426, -15426,
388 -15249, -15249, -15058, -15058, -14853, -14853, -14634, -14634, -14401, -14401,
389 -14155, -14155, -13895, -13895, -13622, -13622, -13337, -13337, -13038, -13038,
390 -12728, -12728, -12406, -12406, -12072, -12072, -11726, -11726, -11370, -11370,
391 -11002, -11002, -10625, -10625, -10237, -10237, -9840, -9840, -9434, -9434,
392 -9018, -9018, -8594, -8594, -8162, -8162, -7723, -7723, -7276, -7276,
393 -6822, -6822, -6362, -6362, -5896, -5896, -5424, -5424, -4948, -4948,
394 -4466, -4466, -3980, -3980, -3491, -3491, -2998, -2998, -2503, -2503,
395 -2005, -2005, -1505, -1505, -1004, -1004, -502, -502
397 /*****************************************************************************/
398 void
399 easyoss_testtone(struct easycap *peasycap, int audio_fill)
401 int i1;
402 unsigned char *p2;
403 struct data_buffer *paudio_buffer;
405 if (NULL == peasycap) {
406 SAY("ERROR: peasycap is NULL\n");
407 return;
409 JOM(8, "%i=audio_fill\n", audio_fill);
410 paudio_buffer = &peasycap->audio_buffer[audio_fill];
411 p2 = (unsigned char *)(paudio_buffer->pgo);
412 for (i1 = 0; i1 < PAGE_SIZE; i1 += 4, p2 += 4) {
413 *p2 = (unsigned char) (0x00FF & tones[i1/2]);
414 *(p2 + 1) = (unsigned char)((0xFF00 & tones[i1/2]) >> 8);
415 *(p2 + 2) = (unsigned char) (0x00FF & tones[i1/2 + 1]);
416 *(p2 + 3) = (unsigned char)((0xFF00 & tones[i1/2 + 1]) >> 8);
418 return;
420 #endif /*EASYCAP_TESTTONE*/
421 /*****************************************************************************/