diff options
author | Luca Risolia <luca.risolia@studio.unibo.it> | 2007-01-08 08:43:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:19 -0500 |
commit | f327ebbd004fb2f08291ca4c6637f5f27319683c (patch) | |
tree | 9f8ea1a6ae5554a7137e9c8e1c92adda8d06eab4 /Documentation/video4linux/sn9c102.txt | |
parent | 19790db00bb7ff4d6621b82933afb3423586644e (diff) |
V4L/DVB (5062): SN9C102 driver updates
- Add support for SN9C105 and SN9C120
- Add some more USB device identifiers
- Add support for OV7660
- Implement audio ioctl's and VIDIOC_ENUM_FRAMESIZES
- Add preliminary support for 0x0c45/0x6007
- Documentation updates
- Generic improvements
Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'Documentation/video4linux/sn9c102.txt')
-rw-r--r-- | Documentation/video4linux/sn9c102.txt | 246 |
1 files changed, 152 insertions, 94 deletions
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt index 8cda472db36d..2913da3d0878 100644 --- a/Documentation/video4linux/sn9c102.txt +++ b/Documentation/video4linux/sn9c102.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | SN9C10x PC Camera Controllers | 2 | SN9C1xx PC Camera Controllers |
3 | Driver for Linux | 3 | Driver for Linux |
4 | ============================= | 4 | ============================= |
5 | 5 | ||
@@ -53,20 +53,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||
53 | 53 | ||
54 | 4. Overview and features | 54 | 4. Overview and features |
55 | ======================== | 55 | ======================== |
56 | This driver attempts to support the video interface of the devices mounting the | 56 | This driver attempts to support the video interface of the devices assembling |
57 | SONiX SN9C101, SN9C102 and SN9C103 PC Camera Controllers. | 57 | the SONiX SN9C101, SN9C102, SN9C103, SN9C105 and SN9C120 PC Camera Controllers |
58 | 58 | ("SN9C1xx" from now on). | |
59 | It's worth to note that SONiX has never collaborated with the author during the | ||
60 | development of this project, despite several requests for enough detailed | ||
61 | specifications of the register tables, compression engine and video data format | ||
62 | of the above chips. Nevertheless, these informations are no longer necessary, | ||
63 | because all the aspects related to these chips are known and have been | ||
64 | described in detail in this documentation. | ||
65 | 59 | ||
66 | The driver relies on the Video4Linux2 and USB core modules. It has been | 60 | The driver relies on the Video4Linux2 and USB core modules. It has been |
67 | designed to run properly on SMP systems as well. | 61 | designed to run properly on SMP systems as well. |
68 | 62 | ||
69 | The latest version of the SN9C10x driver can be found at the following URL: | 63 | The latest version of the SN9C1xx driver can be found at the following URL: |
70 | http://www.linux-projects.org/ | 64 | http://www.linux-projects.org/ |
71 | 65 | ||
72 | Some of the features of the driver are: | 66 | Some of the features of the driver are: |
@@ -85,11 +79,11 @@ Some of the features of the driver are: | |||
85 | high compression quality (see also "Notes for V4L2 application developers" | 79 | high compression quality (see also "Notes for V4L2 application developers" |
86 | and "Video frame formats" paragraphs); | 80 | and "Video frame formats" paragraphs); |
87 | - full support for the capabilities of many of the possible image sensors that | 81 | - full support for the capabilities of many of the possible image sensors that |
88 | can be connected to the SN9C10x bridges, including, for instance, red, green, | 82 | can be connected to the SN9C1xx bridges, including, for instance, red, green, |
89 | blue and global gain adjustments and exposure (see "Supported devices" | 83 | blue and global gain adjustments and exposure (see "Supported devices" |
90 | paragraph for details); | 84 | paragraph for details); |
91 | - use of default color settings for sunlight conditions; | 85 | - use of default color settings for sunlight conditions; |
92 | - dynamic I/O interface for both SN9C10x and image sensor control and | 86 | - dynamic I/O interface for both SN9C1xx and image sensor control and |
93 | monitoring (see "Optional device control through 'sysfs'" paragraph); | 87 | monitoring (see "Optional device control through 'sysfs'" paragraph); |
94 | - dynamic driver control thanks to various module parameters (see "Module | 88 | - dynamic driver control thanks to various module parameters (see "Module |
95 | parameters" paragraph); | 89 | parameters" paragraph); |
@@ -130,8 +124,8 @@ necessary: | |||
130 | CONFIG_USB_UHCI_HCD=m | 124 | CONFIG_USB_UHCI_HCD=m |
131 | CONFIG_USB_OHCI_HCD=m | 125 | CONFIG_USB_OHCI_HCD=m |
132 | 126 | ||
133 | The SN9C103 controller also provides a built-in microphone interface. It is | 127 | The SN9C103, SN9c105 and SN9C120 controllers also provide a built-in microphone |
134 | supported by the USB Audio driver thanks to the ALSA API: | 128 | interface. It is supported by the USB Audio driver thanks to the ALSA API: |
135 | 129 | ||
136 | # Sound | 130 | # Sound |
137 | # | 131 | # |
@@ -155,18 +149,27 @@ And finally: | |||
155 | 6. Module loading | 149 | 6. Module loading |
156 | ================= | 150 | ================= |
157 | To use the driver, it is necessary to load the "sn9c102" module into memory | 151 | To use the driver, it is necessary to load the "sn9c102" module into memory |
158 | after every other module required: "videodev", "usbcore" and, depending on | 152 | after every other module required: "videodev", "v4l2_common", "compat_ioctl32", |
159 | the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". | 153 | "usbcore" and, depending on the USB host controller you have, "ehci-hcd", |
154 | "uhci-hcd" or "ohci-hcd". | ||
160 | 155 | ||
161 | Loading can be done as shown below: | 156 | Loading can be done as shown below: |
162 | 157 | ||
163 | [root@localhost home]# modprobe sn9c102 | 158 | [root@localhost home]# modprobe sn9c102 |
164 | 159 | ||
165 | At this point the devices should be recognized. You can invoke "dmesg" to | 160 | Note that the module is called "sn9c102" for historic reasons, althought it |
166 | analyze kernel messages and verify that the loading process has gone well: | 161 | does not just support the SN9C102. |
162 | |||
163 | At this point all the devices supported by the driver and connected to the USB | ||
164 | ports should be recognized. You can invoke "dmesg" to analyze kernel messages | ||
165 | and verify that the loading process has gone well: | ||
167 | 166 | ||
168 | [user@localhost home]$ dmesg | 167 | [user@localhost home]$ dmesg |
169 | 168 | ||
169 | or, to isolate all the kernel messages generated by the driver: | ||
170 | |||
171 | [user@localhost home]$ dmesg | grep sn9c102 | ||
172 | |||
170 | 173 | ||
171 | 7. Module parameters | 174 | 7. Module parameters |
172 | ==================== | 175 | ==================== |
@@ -198,10 +201,11 @@ Default: 0 | |||
198 | ------------------------------------------------------------------------------- | 201 | ------------------------------------------------------------------------------- |
199 | Name: frame_timeout | 202 | Name: frame_timeout |
200 | Type: uint array (min = 0, max = 64) | 203 | Type: uint array (min = 0, max = 64) |
201 | Syntax: <n[,...]> | 204 | Syntax: <0|n[,...]> |
202 | Description: Timeout for a video frame in seconds. This parameter is | 205 | Description: Timeout for a video frame in seconds before returning an I/O |
203 | specific for each detected camera. This parameter can be | 206 | error; 0 for infinity. This parameter is specific for each |
204 | changed at runtime thanks to the /sys filesystem interface. | 207 | detected camera and can be changed at runtime thanks to the |
208 | /sys filesystem interface. | ||
205 | Default: 2 | 209 | Default: 2 |
206 | ------------------------------------------------------------------------------- | 210 | ------------------------------------------------------------------------------- |
207 | Name: debug | 211 | Name: debug |
@@ -223,20 +227,21 @@ Default: 2 | |||
223 | 8. Optional device control through "sysfs" [1] | 227 | 8. Optional device control through "sysfs" [1] |
224 | ========================================== | 228 | ========================================== |
225 | If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled, | 229 | If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled, |
226 | it is possible to read and write both the SN9C10x and the image sensor | 230 | it is possible to read and write both the SN9C1xx and the image sensor |
227 | registers by using the "sysfs" filesystem interface. | 231 | registers by using the "sysfs" filesystem interface. |
228 | 232 | ||
229 | Every time a supported device is recognized, a write-only file named "green" is | 233 | Every time a supported device is recognized, a write-only file named "green" is |
230 | created in the /sys/class/video4linux/videoX directory. You can set the green | 234 | created in the /sys/class/video4linux/videoX directory. You can set the green |
231 | channel's gain by writing the desired value to it. The value may range from 0 | 235 | channel's gain by writing the desired value to it. The value may range from 0 |
232 | to 15 for SN9C101 or SN9C102 bridges, from 0 to 127 for SN9C103 bridges. | 236 | to 15 for the SN9C101 or SN9C102 bridges, from 0 to 127 for the SN9C103, |
233 | Similarly, only for SN9C103 controllers, blue and red gain control files are | 237 | SN9C105 and SN9C120 bridges. |
234 | available in the same directory, for which accepted values may range from 0 to | 238 | Similarly, only for the SN9C103, SN9C105 and SN9120 controllers, blue and red |
235 | 127. | 239 | gain control files are available in the same directory, for which accepted |
240 | values may range from 0 to 127. | ||
236 | 241 | ||
237 | There are other four entries in the directory above for each registered camera: | 242 | There are other four entries in the directory above for each registered camera: |
238 | "reg", "val", "i2c_reg" and "i2c_val". The first two files control the | 243 | "reg", "val", "i2c_reg" and "i2c_val". The first two files control the |
239 | SN9C10x bridge, while the other two control the sensor chip. "reg" and | 244 | SN9C1xx bridge, while the other two control the sensor chip. "reg" and |
240 | "i2c_reg" hold the values of the current register index where the following | 245 | "i2c_reg" hold the values of the current register index where the following |
241 | reading/writing operations are addressed at through "val" and "i2c_val". Their | 246 | reading/writing operations are addressed at through "val" and "i2c_val". Their |
242 | use is not intended for end-users. Note that "i2c_reg" and "i2c_val" will not | 247 | use is not intended for end-users. Note that "i2c_reg" and "i2c_val" will not |
@@ -259,61 +264,84 @@ Now let's set the green gain's register of the SN9C101 or SN9C102 chips to 2: | |||
259 | [root@localhost #] echo 0x11 > reg | 264 | [root@localhost #] echo 0x11 > reg |
260 | [root@localhost #] echo 2 > val | 265 | [root@localhost #] echo 2 > val |
261 | 266 | ||
262 | Note that the SN9C10x always returns 0 when some of its registers are read. | 267 | Note that the SN9C1xx always returns 0 when some of its registers are read. |
263 | To avoid race conditions, all the I/O accesses to the above files are | 268 | To avoid race conditions, all the I/O accesses to the above files are |
264 | serialized. | 269 | serialized. |
265 | |||
266 | The sysfs interface also provides the "frame_header" entry, which exports the | 270 | The sysfs interface also provides the "frame_header" entry, which exports the |
267 | frame header of the most recent requested and captured video frame. The header | 271 | frame header of the most recent requested and captured video frame. The header |
268 | is always 18-bytes long and is appended to every video frame by the SN9C10x | 272 | is always 18-bytes long and is appended to every video frame by the SN9C1xx |
269 | controllers. As an example, this additional information can be used by the user | 273 | controllers. As an example, this additional information can be used by the user |
270 | application for implementing auto-exposure features via software. | 274 | application for implementing auto-exposure features via software. |
271 | 275 | ||
272 | The following table describes the frame header: | 276 | The following table describes the frame header exported by the SN9C101 and |
273 | 277 | SN9C102: | |
274 | Byte # Value Description | 278 | |
275 | ------ ----- ----------- | 279 | Byte # Value or bits Description |
276 | 0x00 0xFF Frame synchronisation pattern. | 280 | ------ ------------- ----------- |
277 | 0x01 0xFF Frame synchronisation pattern. | 281 | 0x00 0xFF Frame synchronisation pattern |
278 | 0x02 0x00 Frame synchronisation pattern. | 282 | 0x01 0xFF Frame synchronisation pattern |
279 | 0x03 0xC4 Frame synchronisation pattern. | 283 | 0x02 0x00 Frame synchronisation pattern |
280 | 0x04 0xC4 Frame synchronisation pattern. | 284 | 0x03 0xC4 Frame synchronisation pattern |
281 | 0x05 0x96 Frame synchronisation pattern. | 285 | 0x04 0xC4 Frame synchronisation pattern |
282 | 0x06 0xXX Unknown meaning. The exact value depends on the chip; | 286 | 0x05 0x96 Frame synchronisation pattern |
283 | possible values are 0x00, 0x01 and 0x20. | 287 | 0x06 [3:0] Read channel gain control = (1+R_GAIN/8) |
284 | 0x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a | 288 | [7:4] Blue channel gain control = (1+B_GAIN/8) |
285 | frame counter, u is unknown, zz is a size indicator | 289 | 0x07 [ 0 ] Compression mode. 0=No compression, 1=Compression enabled |
286 | (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for | 290 | [2:1] Maximum scale factor for compression |
287 | "compression enabled" (1 = yes, 0 = no). | 291 | [ 3 ] 1 = USB fifo(2K bytes) is full |
288 | 0x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). | 292 | [ 4 ] 1 = Digital gain is finish |
289 | 0x09 0xXX Brightness sum inside Auto-Exposure area (high-byte). | 293 | [ 5 ] 1 = Exposure is finish |
290 | For a pure white image, this number will be equal to 500 | 294 | [7:6] Frame index |
291 | times the area of the specified AE area. For images | 295 | 0x08 [7:0] Y sum inside Auto-Exposure area (low-byte) |
292 | that are not pure white, the value scales down according | 296 | 0x09 [7:0] Y sum inside Auto-Exposure area (high-byte) |
293 | to relative whiteness. | 297 | where Y sum = (R/4 + 5G/16 + B/8) / 32 |
294 | 0x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). | 298 | 0x0A [7:0] Y sum outside Auto-Exposure area (low-byte) |
295 | 0x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte). | 299 | 0x0B [7:0] Y sum outside Auto-Exposure area (high-byte) |
296 | For a pure white image, this number will be equal to 125 | 300 | where Y sum = (R/4 + 5G/16 + B/8) / 128 |
297 | times the area outside of the specified AE area. For | 301 | 0x0C 0xXX Not used |
298 | images that are not pure white, the value scales down | 302 | 0x0D 0xXX Not used |
299 | according to relative whiteness. | 303 | 0x0E 0xXX Not used |
300 | according to relative whiteness. | 304 | 0x0F 0xXX Not used |
301 | 305 | 0x10 0xXX Not used | |
302 | The following bytes are used by the SN9C103 bridge only: | 306 | 0x11 0xXX Not used |
303 | 307 | ||
304 | 0x0C 0xXX Unknown meaning | 308 | The following table describes the frame header exported by the SN9C103: |
305 | 0x0D 0xXX Unknown meaning | 309 | |
306 | 0x0E 0xXX Unknown meaning | 310 | Byte # Value or bits Description |
307 | 0x0F 0xXX Unknown meaning | 311 | ------ ------------- ----------- |
308 | 0x10 0xXX Unknown meaning | 312 | 0x00 0xFF Frame synchronisation pattern |
309 | 0x11 0xXX Unknown meaning | 313 | 0x01 0xFF Frame synchronisation pattern |
314 | 0x02 0x00 Frame synchronisation pattern | ||
315 | 0x03 0xC4 Frame synchronisation pattern | ||
316 | 0x04 0xC4 Frame synchronisation pattern | ||
317 | 0x05 0x96 Frame synchronisation pattern | ||
318 | 0x06 [6:0] Read channel gain control = (1/2+R_GAIN/64) | ||
319 | 0x07 [6:0] Blue channel gain control = (1/2+B_GAIN/64) | ||
320 | [7:4] | ||
321 | 0x08 [ 0 ] Compression mode. 0=No compression, 1=Compression enabled | ||
322 | [2:1] Maximum scale factor for compression | ||
323 | [ 3 ] 1 = USB fifo(2K bytes) is full | ||
324 | [ 4 ] 1 = Digital gain is finish | ||
325 | [ 5 ] 1 = Exposure is finish | ||
326 | [7:6] Frame index | ||
327 | 0x09 [7:0] Y sum inside Auto-Exposure area (low-byte) | ||
328 | 0x0A [7:0] Y sum inside Auto-Exposure area (high-byte) | ||
329 | where Y sum = (R/4 + 5G/16 + B/8) / 32 | ||
330 | 0x0B [7:0] Y sum outside Auto-Exposure area (low-byte) | ||
331 | 0x0C [7:0] Y sum outside Auto-Exposure area (high-byte) | ||
332 | where Y sum = (R/4 + 5G/16 + B/8) / 128 | ||
333 | 0x0D [1:0] Audio frame number | ||
334 | [ 2 ] 1 = Audio is recording | ||
335 | 0x0E [7:0] Audio summation (low-byte) | ||
336 | 0x0F [7:0] Audio summation (high-byte) | ||
337 | 0x10 [7:0] Audio sample count | ||
338 | 0x11 [7:0] Audio peak data in audio frame | ||
310 | 339 | ||
311 | The AE area (sx, sy, ex, ey) in the active window can be set by programming the | 340 | The AE area (sx, sy, ex, ey) in the active window can be set by programming the |
312 | registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit | 341 | registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C1xx controllers, where one unit |
313 | corresponds to 32 pixels. | 342 | corresponds to 32 pixels. |
314 | 343 | ||
315 | [1] Part of the meaning of the frame header has been documented by Bertrik | 344 | [1] The frame headers exported by the SN9C105 and SN9C120 are not described. |
316 | Sikken. | ||
317 | 345 | ||
318 | 346 | ||
319 | 9. Supported devices | 347 | 9. Supported devices |
@@ -323,15 +351,19 @@ here. They have never collaborated with the author, so no advertising. | |||
323 | 351 | ||
324 | From the point of view of a driver, what unambiguously identify a device are | 352 | From the point of view of a driver, what unambiguously identify a device are |
325 | its vendor and product USB identifiers. Below is a list of known identifiers of | 353 | its vendor and product USB identifiers. Below is a list of known identifiers of |
326 | devices mounting the SN9C10x PC camera controllers: | 354 | devices assembling the SN9C1xx PC camera controllers: |
327 | 355 | ||
328 | Vendor ID Product ID | 356 | Vendor ID Product ID |
329 | --------- ---------- | 357 | --------- ---------- |
358 | 0x0471 0x0327 | ||
359 | 0x0471 0x0328 | ||
330 | 0x0c45 0x6001 | 360 | 0x0c45 0x6001 |
331 | 0x0c45 0x6005 | 361 | 0x0c45 0x6005 |
332 | 0x0c45 0x6007 | 362 | 0x0c45 0x6007 |
333 | 0x0c45 0x6009 | 363 | 0x0c45 0x6009 |
334 | 0x0c45 0x600d | 364 | 0x0c45 0x600d |
365 | 0x0c45 0x6011 | ||
366 | 0x0c45 0x6019 | ||
335 | 0x0c45 0x6024 | 367 | 0x0c45 0x6024 |
336 | 0x0c45 0x6025 | 368 | 0x0c45 0x6025 |
337 | 0x0c45 0x6028 | 369 | 0x0c45 0x6028 |
@@ -342,6 +374,7 @@ Vendor ID Product ID | |||
342 | 0x0c45 0x602d | 374 | 0x0c45 0x602d |
343 | 0x0c45 0x602e | 375 | 0x0c45 0x602e |
344 | 0x0c45 0x6030 | 376 | 0x0c45 0x6030 |
377 | 0x0c45 0x603f | ||
345 | 0x0c45 0x6080 | 378 | 0x0c45 0x6080 |
346 | 0x0c45 0x6082 | 379 | 0x0c45 0x6082 |
347 | 0x0c45 0x6083 | 380 | 0x0c45 0x6083 |
@@ -368,24 +401,40 @@ Vendor ID Product ID | |||
368 | 0x0c45 0x60bb | 401 | 0x0c45 0x60bb |
369 | 0x0c45 0x60bc | 402 | 0x0c45 0x60bc |
370 | 0x0c45 0x60be | 403 | 0x0c45 0x60be |
404 | 0x0c45 0x60c0 | ||
405 | 0x0c45 0x60c8 | ||
406 | 0x0c45 0x60cc | ||
407 | 0x0c45 0x60ea | ||
408 | 0x0c45 0x60ec | ||
409 | 0x0c45 0x60fa | ||
410 | 0x0c45 0x60fb | ||
411 | 0x0c45 0x60fc | ||
412 | 0x0c45 0x60fe | ||
413 | 0x0c45 0x6130 | ||
414 | 0x0c45 0x613a | ||
415 | 0x0c45 0x613b | ||
416 | 0x0c45 0x613c | ||
417 | 0x0c45 0x613e | ||
371 | 418 | ||
372 | The list above does not imply that all those devices work with this driver: up | 419 | The list above does not imply that all those devices work with this driver: up |
373 | until now only the ones that mount the following image sensors are supported; | 420 | until now only the ones that assemble the following image sensors are |
374 | kernel messages will always tell you whether this is the case: | 421 | supported; kernel messages will always tell you whether this is the case (see |
422 | "Module loading" paragraph): | ||
375 | 423 | ||
376 | Model Manufacturer | 424 | Model Manufacturer |
377 | ----- ------------ | 425 | ----- ------------ |
378 | HV7131D Hynix Semiconductor, Inc. | 426 | HV7131D Hynix Semiconductor, Inc. |
379 | MI-0343 Micron Technology, Inc. | 427 | MI-0343 Micron Technology, Inc. |
380 | OV7630 OmniVision Technologies, Inc. | 428 | OV7630 OmniVision Technologies, Inc. |
429 | OV7660 OmniVision Technologies, Inc. | ||
381 | PAS106B PixArt Imaging, Inc. | 430 | PAS106B PixArt Imaging, Inc. |
382 | PAS202BCA PixArt Imaging, Inc. | 431 | PAS202BCA PixArt Imaging, Inc. |
383 | PAS202BCB PixArt Imaging, Inc. | 432 | PAS202BCB PixArt Imaging, Inc. |
384 | TAS5110C1B Taiwan Advanced Sensor Corporation | 433 | TAS5110C1B Taiwan Advanced Sensor Corporation |
385 | TAS5130D1B Taiwan Advanced Sensor Corporation | 434 | TAS5130D1B Taiwan Advanced Sensor Corporation |
386 | 435 | ||
387 | All the available control settings of each image sensor are supported through | 436 | Some of the available control settings of each image sensor are supported |
388 | the V4L2 interface. | 437 | through the V4L2 interface. |
389 | 438 | ||
390 | Donations of new models for further testing and support would be much | 439 | Donations of new models for further testing and support would be much |
391 | appreciated. Non-available hardware will not be supported by the author of this | 440 | appreciated. Non-available hardware will not be supported by the author of this |
@@ -429,12 +478,15 @@ supplied by this driver). | |||
429 | 478 | ||
430 | 11. Video frame formats [1] | 479 | 11. Video frame formats [1] |
431 | ======================= | 480 | ======================= |
432 | The SN9C10x PC Camera Controllers can send images in two possible video | 481 | The SN9C1xx PC Camera Controllers can send images in two possible video |
433 | formats over the USB: either native "Sequential RGB Bayer" or Huffman | 482 | formats over the USB: either native "Sequential RGB Bayer" or compressed. |
434 | compressed. The latter is used to achieve high frame rates. The current video | 483 | The compression is used to achieve high frame rates. With regard to the |
435 | format may be selected or queried from the user application by calling the | 484 | SN9C101, SN9C102 and SN9C103, the compression is based on the Huffman encoding |
436 | VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 API | 485 | algorithm described below, while the SN9C105 and SN9C120 the compression is |
437 | specifications. | 486 | based on the JPEG standard. |
487 | The current video format may be selected or queried from the user application | ||
488 | by calling the VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 | ||
489 | API specifications. | ||
438 | 490 | ||
439 | The name "Sequential Bayer" indicates the organization of the red, green and | 491 | The name "Sequential Bayer" indicates the organization of the red, green and |
440 | blue pixels in one video frame. Each pixel is associated with a 8-bit long | 492 | blue pixels in one video frame. Each pixel is associated with a 8-bit long |
@@ -447,14 +499,14 @@ G[m] R[m+1] G[m+2] R[m+2] ... G[2m-2] R[2m-1] | |||
447 | ... G[n(m-2)] R[n(m-1)] | 499 | ... G[n(m-2)] R[n(m-1)] |
448 | 500 | ||
449 | The above matrix also represents the sequential or progressive read-out mode of | 501 | The above matrix also represents the sequential or progressive read-out mode of |
450 | the (n, m) Bayer color filter array used in many CCD/CMOS image sensors. | 502 | the (n, m) Bayer color filter array used in many CCD or CMOS image sensors. |
451 | 503 | ||
452 | One compressed video frame consists of a bitstream that encodes for every R, G, | 504 | The Huffman compressed video frame consists of a bitstream that encodes for |
453 | or B pixel the difference between the value of the pixel itself and some | 505 | every R, G, or B pixel the difference between the value of the pixel itself and |
454 | reference pixel value. Pixels are organised in the Bayer pattern and the Bayer | 506 | some reference pixel value. Pixels are organised in the Bayer pattern and the |
455 | sub-pixels are tracked individually and alternatingly. For example, in the | 507 | Bayer sub-pixels are tracked individually and alternatingly. For example, in |
456 | first line values for the B and G1 pixels are alternatingly encoded, while in | 508 | the first line values for the B and G1 pixels are alternatingly encoded, while |
457 | the second line values for the G2 and R pixels are alternatingly encoded. | 509 | in the second line values for the G2 and R pixels are alternatingly encoded. |
458 | 510 | ||
459 | The pixel reference value is calculated as follows: | 511 | The pixel reference value is calculated as follows: |
460 | - the 4 top left pixels are encoded in raw uncompressed 8-bit format; | 512 | - the 4 top left pixels are encoded in raw uncompressed 8-bit format; |
@@ -470,8 +522,9 @@ The pixel reference value is calculated as follows: | |||
470 | decoding. | 522 | decoding. |
471 | 523 | ||
472 | The algorithm purely describes the conversion from compressed Bayer code used | 524 | The algorithm purely describes the conversion from compressed Bayer code used |
473 | in the SN9C10x chips to uncompressed Bayer. Additional steps are required to | 525 | in the SN9C101, SN9C102 and SN9C103 chips to uncompressed Bayer. Additional |
474 | convert this to a color image (i.e. a color interpolation algorithm). | 526 | steps are required to convert this to a color image (i.e. a color interpolation |
527 | algorithm). | ||
475 | 528 | ||
476 | The following Huffman codes have been found: | 529 | The following Huffman codes have been found: |
477 | 0: +0 (relative to reference pixel value) | 530 | 0: +0 (relative to reference pixel value) |
@@ -506,13 +559,18 @@ order): | |||
506 | - Philippe Coval for having helped testing the PAS202BCA image sensor; | 559 | - Philippe Coval for having helped testing the PAS202BCA image sensor; |
507 | - Joao Rodrigo Fuzaro, Joao Limirio, Claudio Filho and Caio Begotti for the | 560 | - Joao Rodrigo Fuzaro, Joao Limirio, Claudio Filho and Caio Begotti for the |
508 | donation of a webcam; | 561 | donation of a webcam; |
562 | - Dennis Heitmann for the donation of a webcam; | ||
509 | - Jon Hollstrom for the donation of a webcam; | 563 | - Jon Hollstrom for the donation of a webcam; |
564 | - Nick McGill for the donation of a webcam; | ||
510 | - Carlos Eduardo Medaglia Dyonisio, who added the support for the PAS202BCB | 565 | - Carlos Eduardo Medaglia Dyonisio, who added the support for the PAS202BCB |
511 | image sensor; | 566 | image sensor; |
512 | - Stefano Mozzi, who donated 45 EU; | 567 | - Stefano Mozzi, who donated 45 EU; |
513 | - Andrew Pearce for the donation of a webcam; | 568 | - Andrew Pearce for the donation of a webcam; |
569 | - John Pullan for the donation of a webcam; | ||
514 | - Bertrik Sikken, who reverse-engineered and documented the Huffman compression | 570 | - Bertrik Sikken, who reverse-engineered and documented the Huffman compression |
515 | algorithm used in the SN9C10x controllers and implemented the first decoder; | 571 | algorithm used in the SN9C101, SN9C102 and SN9C103 controllers and |
572 | implemented the first decoder; | ||
516 | - Mizuno Takafumi for the donation of a webcam; | 573 | - Mizuno Takafumi for the donation of a webcam; |
517 | - an "anonymous" donator (who didn't want his name to be revealed) for the | 574 | - an "anonymous" donator (who didn't want his name to be revealed) for the |
518 | donation of a webcam. | 575 | donation of a webcam. |
576 | - an anonymous donator for the donation of four webcams. | ||