aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/jpeg.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/jpeg.h')
-rw-r--r--drivers/media/video/gspca/jpeg.h283
1 files changed, 158 insertions, 125 deletions
diff --git a/drivers/media/video/gspca/jpeg.h b/drivers/media/video/gspca/jpeg.h
index d823b47bd4e6..7d2df9720025 100644
--- a/drivers/media/video/gspca/jpeg.h
+++ b/drivers/media/video/gspca/jpeg.h
@@ -24,171 +24,207 @@
24 * 24 *
25 */ 25 */
26 26
27/* start of jpeg frame + quantization table */ 27/*
28static const unsigned char quant[][0x88] = { 28 * generation options
29/* index 0 - Q40*/ 29 * CONEX_CAM Conexant if present
30 { 30 * QUANT_VAL quantization table (0..8)
31 */
32
33/*
34 * JPEG header:
35 * - start of jpeg frame
36 * - quantization table
37 * - huffman table
38 * - start of SOF0
39 */
40static const u8 jpeg_head[] = {
31 0xff, 0xd8, /* jpeg */ 41 0xff, 0xd8, /* jpeg */
32 0xff, 0xdb, 0x00, 0x84, /* DQT */ 42 0xff, 0xdb, 0x00, 0x84, /* DQT */
43#if QUANT_VAL == 0
44/* index 0 - Q40*/
330, /* quantization table part 1 */ 450, /* quantization table part 1 */
34 20, 14, 15, 18, 15, 13, 20, 18, 16, 18, 23, 21, 20, 24, 30, 50, 46 0x14, 0x0e, 0x0f, 0x12, 0x0f, 0x0d, 0x14, 0x12,
35 33, 30, 28, 28, 30, 61, 44, 46, 36, 50, 73, 64, 76, 75, 71, 64, 47 0x10, 0x12, 0x17, 0x15, 0x14, 0x18, 0x1e, 0x32,
36 70, 69, 80, 90, 115, 98, 80, 85, 109, 86, 69, 70, 100, 136, 101, 48 0x21, 0x1e, 0x1c, 0x1c, 0x1e, 0x3d, 0x2c, 0x2e,
37 109, 49 0x24, 0x32, 0x49, 0x40, 0x4c, 0x4b, 0x47, 0x40,
38 119, 123, 129, 130, 129, 78, 96, 141, 151, 140, 125, 150, 115, 50 0x46, 0x45, 0x50, 0x5a, 0x73, 0x62, 0x50, 0x55,
39 126, 129, 124, 51 0x6d, 0x56, 0x45, 0x46, 0x64, 0x88, 0x65, 0x6d,
52 0x77, 0x7b, 0x81, 0x82, 0x81, 0x4e, 0x60, 0x8d,
53 0x97, 0x8c, 0x7d, 0x96, 0x73, 0x7e, 0x81, 0x7c,
401, /* quantization table part 2 */ 541, /* quantization table part 2 */
41 21, 23, 23, 30, 26, 30, 59, 33, 33, 59, 124, 83, 70, 83, 124, 124, 55 0x15, 0x17, 0x17, 0x1e, 0x1a, 0x1e, 0x3b, 0x21,
42 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 56 0x21, 0x3b, 0x7c, 0x53, 0x46, 0x53, 0x7c, 0x0c,
43 124, 124, 124, 57 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
44 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 58 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
45 124, 124, 124, 59 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
46 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 60 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
47 124, 124, 124}, 61 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
62 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
63#elif QUANT_VAL == 1
48/* index 1 - Q50 */ 64/* index 1 - Q50 */
49 {
50 0xff, 0xd8,
51 0xff, 0xdb, 0x00, 0x84, /* DQT */
520, 650,
53 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40, 66 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e,
54 26, 24, 22, 22, 24, 49, 35, 37, 29, 40, 58, 51, 61, 60, 57, 51, 67 0x0d, 0x0e, 0x12, 0x11, 0x10, 0x13, 0x18, 0x28,
55 56, 55, 64, 72, 92, 78, 64, 68, 87, 69, 55, 56, 80, 109, 81, 87, 68 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23, 0x25,
56 95, 98, 103, 104, 103, 62, 77, 113, 121, 112, 100, 120, 92, 101, 69 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33,
57 103, 99, 70 0x38, 0x37, 0x40, 0x48, 0x5c, 0x4e, 0x40, 0x44,
71 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51, 0x57,
72 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71,
73 0x79, 0x70, 0x64, 0x78, 0x5c, 0x65, 0x67, 0x63,
581, 741,
59 17, 18, 18, 24, 21, 24, 47, 26, 26, 47, 99, 66, 56, 66, 99, 99, 75 0x11, 0x12, 0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a,
60 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 76 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42, 0x63, 0x63,
61 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 77 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
62 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}, 78 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
79 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
80 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
81 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
82 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63,
83#elif QUANT_VAL == 2
63/* index 2 Q60 */ 84/* index 2 Q60 */
64 {
65 0xff, 0xd8,
66 0xff, 0xdb, 0x00, 0x84, /* DQT */
670, 850,
68 13, 9, 10, 11, 10, 8, 13, 11, 10, 11, 14, 14, 13, 15, 19, 32, 86 0x0d, 0x09, 0x0a, 0x0b, 0x0a, 0x08, 0x0d, 0x0b,
69 21, 19, 18, 18, 19, 39, 28, 30, 23, 32, 46, 41, 49, 48, 46, 41, 87 0x0a, 0x0b, 0x0e, 0x0e, 0x0d, 0x0f, 0x13, 0x20,
70 45, 44, 51, 58, 74, 62, 51, 54, 70, 55, 44, 45, 64, 87, 65, 70, 88 0x15, 0x13, 0x12, 0x12, 0x13, 0x27, 0x1c, 0x1e,
71 76, 78, 82, 83, 82, 50, 62, 90, 97, 90, 80, 96, 74, 81, 82, 79, 89 0x17, 0x20, 0x2e, 0x29, 0x31, 0x30, 0x2e, 0x29,
90 0x2d, 0x2c, 0x33, 0x3a, 0x4a, 0x3e, 0x33, 0x36,
91 0x46, 0x37, 0x2c, 0x2d, 0x40, 0x57, 0x41, 0x46,
92 0x4c, 0x4e, 0x52, 0x53, 0x52, 0x32, 0x3e, 0x5a,
93 0x61, 0x5a, 0x50, 0x60, 0x4a, 0x51, 0x52, 0x4f,
721, 941,
73 14, 14, 14, 19, 17, 19, 38, 21, 21, 38, 79, 53, 45, 53, 79, 79, 95 0x0e, 0x0e, 0x0e, 0x13, 0x11, 0x13, 0x26, 0x15,
74 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 96 0x15, 0x26, 0x4f, 0x35, 0x2d, 0x35, 0x4f, 0x4f,
75 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 97 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
76 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79}, 98 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
99 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
100 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
101 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
102 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f,
103#elif QUANT_VAL == 3
77/* index 3 - Q70 */ 104/* index 3 - Q70 */
78 {
79 0xff, 0xd8,
80 0xff, 0xdb, 0x00, 0x84, /* DQT */
810, 1050,
82 10, 7, 7, 8, 7, 6, 10, 8, 8, 8, 11, 10, 10, 11, 14, 24, 106 0x0a, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0a, 0x08,
83 16, 14, 13, 13, 14, 29, 21, 22, 17, 24, 35, 31, 37, 36, 34, 31, 107 0x08, 0x08, 0x0b, 0x0a, 0x0a, 0x0b, 0x0e, 0x18,
84 34, 33, 38, 43, 55, 47, 38, 41, 52, 41, 33, 34, 48, 65, 49, 52, 108 0x10, 0x0e, 0x0d, 0x0d, 0x0e, 0x1d, 0x15, 0x16,
85 57, 59, 62, 62, 62, 37, 46, 68, 73, 67, 60, 72, 55, 61, 62, 59, 109 0x11, 0x18, 0x23, 0x1f, 0x25, 0x24, 0x22, 0x1f,
110 0x22, 0x21, 0x26, 0x2b, 0x37, 0x2f, 0x26, 0x29,
111 0x34, 0x29, 0x21, 0x22, 0x30, 0x41, 0x31, 0x34,
112 0x39, 0x3b, 0x3e, 0x3e, 0x3e, 0x25, 0x2e, 0x44,
113 0x49, 0x43, 0x3c, 0x48, 0x37, 0x3d, 0x3e, 0x3b,
861, 1141,
87 10, 11, 11, 14, 13, 14, 28, 16, 16, 28, 59, 40, 34, 40, 59, 59, 115 0x0a, 0x0b, 0x0b, 0x0e, 0x0d, 0x0e, 0x1c, 0x10,
88 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 116 0x10, 0x1c, 0x3b, 0x28, 0x22, 0x28, 0x3b, 0x3b,
89 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 117 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
90 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59}, 118 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
119 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
120 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
121 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
122 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
123#elif QUANT_VAL == 4
91/* index 4 - Q80 */ 124/* index 4 - Q80 */
92 {
93 0xff, 0xd8,
94 0xff, 0xdb, 0x00, 0x84, /* DQT */
950, 1250,
96 6, 4, 5, 6, 5, 4, 6, 6, 5, 6, 7, 7, 6, 8, 10, 16, 126 0x06, 0x04, 0x05, 0x06, 0x05, 0x04, 0x06, 0x06,
97 10, 10, 9, 9, 10, 20, 14, 15, 12, 16, 23, 20, 24, 24, 23, 20, 127 0x05, 0x06, 0x07, 0x07, 0x06, 0x08, 0x0a, 0x10,
98 22, 22, 26, 29, 37, 31, 26, 27, 35, 28, 22, 22, 32, 44, 32, 35, 128 0x0a, 0x0a, 0x09, 0x09, 0x0a, 0x14, 0x0e, 0x0f,
99 38, 39, 41, 42, 41, 25, 31, 45, 48, 45, 40, 48, 37, 40, 41, 40, 129 0x0c, 0x10, 0x17, 0x14, 0x18, 0x18, 0x17, 0x14,
130 0x16, 0x16, 0x1a, 0x1d, 0x25, 0x1f, 0x1a, 0x1b,
131 0x23, 0x1c, 0x16, 0x16, 0x20, 0x2c, 0x20, 0x23,
132 0x26, 0x27, 0x29, 0x2a, 0x29, 0x19, 0x1f, 0x2d,
133 0x30, 0x2d, 0x28, 0x30, 0x25, 0x28, 0x29, 0x28,
1001, 1341,
101 7, 7, 7, 10, 8, 10, 19, 10, 10, 19, 40, 26, 22, 26, 40, 40, 135 0x07, 0x07, 0x07, 0x0a, 0x08, 0x0a, 0x13, 0x0a,
102 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 136 0x0a, 0x13, 0x28, 0x1a, 0x16, 0x1a, 0x28, 0x28,
103 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 137 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
104 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40}, 138 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
139 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
140 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
141 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
142 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28,
143#elif QUANT_VAL == 5
105/* index 5 - Q85 */ 144/* index 5 - Q85 */
106 {
107 0xff, 0xd8,
108 0xff, 0xdb, 0x00, 0x84, /* DQT */
1090, 1450,
110 5, 3, 4, 4, 4, 3, 5, 4, 4, 4, 5, 5, 5, 6, 7, 12, 146 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04,
111 8, 7, 7, 7, 7, 15, 11, 11, 9, 12, 17, 15, 18, 18, 17, 15, 147 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, 0x0c,
112 17, 17, 19, 22, 28, 23, 19, 20, 26, 21, 17, 17, 24, 33, 24, 26, 148 0x08, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0b, 0x0b,
113 29, 29, 31, 31, 31, 19, 23, 34, 36, 34, 30, 36, 28, 30, 31, 30, 149 0x09, 0x0c, 0x11, 0x0f, 0x12, 0x12, 0x11, 0x0f,
150 0x11, 0x11, 0x13, 0x16, 0x1c, 0x17, 0x13, 0x14,
151 0x1a, 0x15, 0x11, 0x11, 0x18, 0x21, 0x18, 0x1a,
152 0x1d, 0x1d, 0x1f, 0x1f, 0x1f, 0x13, 0x17, 0x22,
153 0x24, 0x22, 0x1e, 0x24, 0x1c, 0x1e, 0x1f, 0x1e,
1141, 1541,
115 5, 5, 5, 7, 6, 7, 14, 8, 8, 14, 30, 20, 17, 20, 30, 30, 155 0x05, 0x05, 0x05, 0x07, 0x06, 0x07, 0x0e, 0x08,
116 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 156 0x08, 0x0e, 0x1e, 0x14, 0x11, 0x14, 0x1e, 0x1e,
117 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 157 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
118 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, 158 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
159 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
160 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
161 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
162 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e,
163#elif QUANT_VAL == 6
119/* index 6 - 86 */ 164/* index 6 - 86 */
120{
121 0xff, 0xd8,
122 0xff, 0xdb, 0x00, 0x84, /* DQT */
1230, 1650,
124 0x04, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x04, 166 0x04, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x04,
125 0x04, 0x04, 0x05, 0x05, 0x04, 0x05, 0x07, 0x0B, 167 0x04, 0x04, 0x05, 0x05, 0x04, 0x05, 0x07, 0x0B,
126 0x07, 0x07, 0x06, 0x06, 0x07, 0x0E, 0x0A, 0x0A, 168 0x07, 0x07, 0x06, 0x06, 0x07, 0x0e, 0x0a, 0x0a,
127 0x08, 0x0B, 0x10, 0x0E, 0x11, 0x11, 0x10, 0x0E, 169 0x08, 0x0B, 0x10, 0x0e, 0x11, 0x11, 0x10, 0x0e,
128 0x10, 0x0F, 0x12, 0x14, 0x1A, 0x16, 0x12, 0x13, 170 0x10, 0x0f, 0x12, 0x14, 0x1a, 0x16, 0x12, 0x13,
129 0x18, 0x13, 0x0F, 0x10, 0x16, 0x1F, 0x17, 0x18, 171 0x18, 0x13, 0x0f, 0x10, 0x16, 0x1f, 0x17, 0x18,
130 0x1B, 0x1B, 0x1D, 0x1D, 0x1D, 0x11, 0x16, 0x20, 172 0x1b, 0x1b, 0x1d, 0x1d, 0x1d, 0x11, 0x16, 0x20,
131 0x22, 0x1F, 0x1C, 0x22, 0x1A, 0x1C, 0x1D, 0x1C, 173 0x22, 0x1f, 0x1c, 0x22, 0x1a, 0x1c, 0x1d, 0x1c,
1321, 1741,
133 0x05, 0x05, 0x05, 0x07, 0x06, 0x07, 0x0D, 0x07, 175 0x05, 0x05, 0x05, 0x07, 0x06, 0x07, 0x0D, 0x07,
134 0x07, 0x0D, 0x1C, 0x12, 0x10, 0x12, 0x1C, 0x1C, 176 0x07, 0x0D, 0x1c, 0x12, 0x10, 0x12, 0x1c, 0x1c,
135 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 177 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
136 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 178 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
137 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 179 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
138 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 180 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
139 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 181 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
140 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 182 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
141 }, 183#elif QUANT_VAL == 7
142/* index 7 - 88 */ 184/* index 7 - 88 */
143{
144 0xff, 0xd8,
145 0xff, 0xdb, 0x00, 0x84, /* DQT */
1460, 1850,
147 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x04, 0x03, 186 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x04, 0x03,
148 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x06, 0x0A, 187 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x06, 0x0a,
149 0x06, 0x06, 0x05, 0x05, 0x06, 0x0C, 0x08, 0x09, 188 0x06, 0x06, 0x05, 0x05, 0x06, 0x0C, 0x08, 0x09,
150 0x07, 0x0A, 0x0E, 0x0C, 0x0F, 0x0E, 0x0E, 0x0C, 189 0x07, 0x0a, 0x0e, 0x0c, 0x0f, 0x0e, 0x0e, 0x0c,
151 0x0D, 0x0D, 0x0F, 0x11, 0x16, 0x13, 0x0F, 0x10, 190 0x0d, 0x0d, 0x0f, 0x11, 0x16, 0x13, 0x0f, 0x10,
152 0x15, 0x11, 0x0D, 0x0D, 0x13, 0x1A, 0x13, 0x15, 191 0x15, 0x11, 0x0d, 0x0d, 0x13, 0x1a, 0x13, 0x15,
153 0x17, 0x18, 0x19, 0x19, 0x19, 0x0F, 0x12, 0x1B, 192 0x17, 0x18, 0x19, 0x19, 0x19, 0x0f, 0x12, 0x1b,
154 0x1D, 0x1B, 0x18, 0x1D, 0x16, 0x18, 0x19, 0x18, 193 0x1d, 0x1b, 0x18, 0x1d, 0x16, 0x18, 0x19, 0x18,
1551, 1941,
156 0x04, 0x04, 0x04, 0x06, 0x05, 0x06, 0x0B, 0x06, 195 0x04, 0x04, 0x04, 0x06, 0x05, 0x06, 0x0B, 0x06,
157 0x06, 0x0B, 0x18, 0x10, 0x0D, 0x10, 0x18, 0x18, 196 0x06, 0x0B, 0x18, 0x10, 0x0d, 0x10, 0x18, 0x18,
158 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 197 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
159 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 198 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
160 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 199 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
161 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 200 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
162 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 201 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
163 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 202 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
164}, 203#elif QUANT_VAL == 8
165/* index 8 - ?? */ 204/* index 8 - ?? */
166{
167 0xff, 0xd8,
168 0xff, 0xdb, 0x00, 0x84, /* DQT */
1690, 2050,
170 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 206 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
171 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05, 207 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05,
172 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x04, 0x05, 208 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x04, 0x05,
173 0x04, 0x05, 0x07, 0x06, 0x08, 0x08, 0x07, 0x06, 209 0x04, 0x05, 0x07, 0x06, 0x08, 0x08, 0x07, 0x06,
174 0x07, 0x07, 0x08, 0x09, 0x0C, 0x0A, 0x08, 0x09, 210 0x07, 0x07, 0x08, 0x09, 0x0c, 0x0a, 0x08, 0x09,
175 0x0B, 0x09, 0x07, 0x07, 0x0A, 0x0E, 0x0A, 0x0B, 211 0x0B, 0x09, 0x07, 0x07, 0x0a, 0x0e, 0x0a, 0x0b,
176 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x08, 0x0A, 0x0E, 212 0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x08, 0x0a, 0x0e,
177 0x0F, 0x0E, 0x0D, 0x0F, 0x0C, 0x0D, 0x0D, 0x0C, 213 0x0f, 0x0e, 0x0d, 0x0f, 0x0c, 0x0d, 0x0d, 0x0c,
1781, 2141,
179 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x06, 0x03, 215 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x06, 0x03,
180 0x03, 0x06, 0x0C, 0x08, 0x07, 0x08, 0x0C, 0x0C, 216 0x03, 0x06, 0x0c, 0x08, 0x07, 0x08, 0x0c, 0x0c,
181 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 217 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
182 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 218 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
183 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 219 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
184 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 220 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
185 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 221 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
186 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C 222 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
187} 223#else
188}; 224#error "Invalid quantization table"
225#endif
189 226
190/* huffman table + start of SOF0 */ 227/* huffman table */
191static unsigned char huffman[] = {
192 0xff, 0xc4, 0x01, 0xa2, 228 0xff, 0xc4, 0x01, 0xa2,
193 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 229 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01,
194 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 230 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -260,7 +296,7 @@ static unsigned char huffman[] = {
260 */ 296 */
261 297
262/* end of header */ 298/* end of header */
263static unsigned char eoh[] = { 299static u8 eoh[] = {
264 0x00, /* quant Y */ 300 0x00, /* quant Y */
265 0x02, 0x11, 0x01, /* samples CbCr - quant CbCr */ 301 0x02, 0x11, 0x01, /* samples CbCr - quant CbCr */
266 0x03, 0x11, 0x01, 302 0x03, 0x11, 0x01,
@@ -273,17 +309,14 @@ static unsigned char eoh[] = {
273/* -- output the JPEG header -- */ 309/* -- output the JPEG header -- */
274static void jpeg_put_header(struct gspca_dev *gspca_dev, 310static void jpeg_put_header(struct gspca_dev *gspca_dev,
275 struct gspca_frame *frame, 311 struct gspca_frame *frame,
276 int qindex,
277 int samplesY) 312 int samplesY)
278{ 313{
279#ifndef CONEX_CAM 314#ifndef CONEX_CAM
280 unsigned char tmpbuf[8]; 315 u8 tmpbuf[8];
281#endif 316#endif
282 317
283 gspca_frame_add(gspca_dev, FIRST_PACKET, frame, 318 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
284 (unsigned char *) quant[qindex], sizeof quant[0]); 319 jpeg_head, sizeof jpeg_head);
285 gspca_frame_add(gspca_dev, INTER_PACKET, frame,
286 (unsigned char *) huffman, sizeof huffman);
287#ifndef CONEX_CAM 320#ifndef CONEX_CAM
288 tmpbuf[0] = gspca_dev->height >> 8; 321 tmpbuf[0] = gspca_dev->height >> 8;
289 tmpbuf[1] = gspca_dev->height & 0xff; 322 tmpbuf[1] = gspca_dev->height & 0xff;