pwc-kiara.c 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. /* Linux driver for Philips webcam
  2. (C) 2004 Luc Saillard (luc@saillard.org)
  3. NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
  4. driver and thus may have bugs that are not present in the original version.
  5. Please send bug reports and support requests to <luc@saillard.org>.
  6. The decompression routines have been implemented by reverse-engineering the
  7. Nemosoft binary pwcx module. Caveat emptor.
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. /* This tables contains entries for the 730/740/750 (Kiara) camera, with
  21. 4 different qualities (no compression, low, medium, high).
  22. It lists the bandwidth requirements for said mode by its alternate interface
  23. number. An alternate of 0 means that the mode is unavailable.
  24. There are 6 * 4 * 4 entries:
  25. 6 different resolutions subqcif, qsif, qcif, sif, cif, vga
  26. 6 framerates: 5, 10, 15, 20, 25, 30
  27. 4 compression modi: none, low, medium, high
  28. When an uncompressed mode is not available, the next available compressed mode
  29. will be chosen (unless the decompressor is absent). Sometimes there are only
  30. 1 or 2 compressed modes available; in that case entries are duplicated.
  31. */
  32. #include "pwc-kiara.h"
  33. #include "pwc-uncompress.h"
  34. const struct Kiara_table_entry Kiara_table[PSZ_MAX][6][4] =
  35. {
  36. /* SQCIF */
  37. {
  38. /* 5 fps */
  39. {
  40. {0, },
  41. {0, },
  42. {0, },
  43. {0, },
  44. },
  45. /* 10 fps */
  46. {
  47. {0, },
  48. {0, },
  49. {0, },
  50. {0, },
  51. },
  52. /* 15 fps */
  53. {
  54. {0, },
  55. {0, },
  56. {0, },
  57. {0, },
  58. },
  59. /* 20 fps */
  60. {
  61. {0, },
  62. {0, },
  63. {0, },
  64. {0, },
  65. },
  66. /* 25 fps */
  67. {
  68. {0, },
  69. {0, },
  70. {0, },
  71. {0, },
  72. },
  73. /* 30 fps */
  74. {
  75. {0, },
  76. {0, },
  77. {0, },
  78. {0, },
  79. },
  80. },
  81. /* QSIF */
  82. {
  83. /* 5 fps */
  84. {
  85. {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
  86. {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
  87. {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
  88. {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}},
  89. },
  90. /* 10 fps */
  91. {
  92. {2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}},
  93. {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
  94. {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
  95. {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}},
  96. },
  97. /* 15 fps */
  98. {
  99. {3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}},
  100. {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
  101. {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}},
  102. {1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
  103. },
  104. /* 20 fps */
  105. {
  106. {4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}},
  107. {3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}},
  108. {2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}},
  109. {1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}},
  110. },
  111. /* 25 fps */
  112. {
  113. {5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}},
  114. {3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}},
  115. {2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}},
  116. {1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}},
  117. },
  118. /* 30 fps */
  119. {
  120. {8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}},
  121. {5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}},
  122. {3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}},
  123. {2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}},
  124. },
  125. },
  126. /* QCIF */
  127. {
  128. /* 5 fps */
  129. {
  130. {0, },
  131. {0, },
  132. {0, },
  133. {0, },
  134. },
  135. /* 10 fps */
  136. {
  137. {0, },
  138. {0, },
  139. {0, },
  140. {0, },
  141. },
  142. /* 15 fps */
  143. {
  144. {0, },
  145. {0, },
  146. {0, },
  147. {0, },
  148. },
  149. /* 20 fps */
  150. {
  151. {0, },
  152. {0, },
  153. {0, },
  154. {0, },
  155. },
  156. /* 25 fps */
  157. {
  158. {0, },
  159. {0, },
  160. {0, },
  161. {0, },
  162. },
  163. /* 30 fps */
  164. {
  165. {0, },
  166. {0, },
  167. {0, },
  168. {0, },
  169. },
  170. },
  171. /* SIF */
  172. {
  173. /* 5 fps */
  174. {
  175. {4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}},
  176. {3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}},
  177. {2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}},
  178. {1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}},
  179. },
  180. /* 10 fps */
  181. {
  182. {0, },
  183. {6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}},
  184. {3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}},
  185. {2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}},
  186. },
  187. /* 15 fps */
  188. {
  189. {0, },
  190. {9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}},
  191. {4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}},
  192. {3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}},
  193. },
  194. /* 20 fps */
  195. {
  196. {0, },
  197. {9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}},
  198. {5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}},
  199. {3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}},
  200. },
  201. /* 25 fps */
  202. {
  203. {0, },
  204. {9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}},
  205. {6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}},
  206. {4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}},
  207. },
  208. /* 30 fps */
  209. {
  210. {0, },
  211. {9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}},
  212. {6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}},
  213. {4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}},
  214. },
  215. },
  216. /* CIF */
  217. {
  218. /* 5 fps */
  219. {
  220. {0, },
  221. {0, },
  222. {0, },
  223. {0, },
  224. },
  225. /* 10 fps */
  226. {
  227. {0, },
  228. {0, },
  229. {0, },
  230. {0, },
  231. },
  232. /* 15 fps */
  233. {
  234. {0, },
  235. {0, },
  236. {0, },
  237. {0, },
  238. },
  239. /* 20 fps */
  240. {
  241. {0, },
  242. {0, },
  243. {0, },
  244. {0, },
  245. },
  246. /* 25 fps */
  247. {
  248. {0, },
  249. {0, },
  250. {0, },
  251. {0, },
  252. },
  253. /* 30 fps */
  254. {
  255. {0, },
  256. {0, },
  257. {0, },
  258. {0, },
  259. },
  260. },
  261. /* VGA */
  262. {
  263. /* 5 fps */
  264. {
  265. {0, },
  266. {6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}},
  267. {4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}},
  268. {3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}},
  269. },
  270. /* 10 fps */
  271. {
  272. {0, },
  273. {9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}},
  274. {6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}},
  275. {4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}},
  276. },
  277. /* 15 fps */
  278. {
  279. {0, },
  280. {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
  281. {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}},
  282. {8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}},
  283. },
  284. /* 20 fps */
  285. {
  286. {0, },
  287. {0, },
  288. {0, },
  289. {0, },
  290. },
  291. /* 25 fps */
  292. {
  293. {0, },
  294. {0, },
  295. {0, },
  296. {0, },
  297. },
  298. /* 30 fps */
  299. {
  300. {0, },
  301. {0, },
  302. {0, },
  303. {0, },
  304. },
  305. },
  306. };