ov511.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. #ifndef __LINUX_OV511_H
  2. #define __LINUX_OV511_H
  3. #include <asm/uaccess.h>
  4. #include <linux/videodev.h>
  5. #include <media/v4l2-common.h>
  6. #include <media/v4l2-ioctl.h>
  7. #include <linux/usb.h>
  8. #include <linux/mutex.h>
  9. #define OV511_DEBUG /* Turn on debug messages */
  10. #ifdef OV511_DEBUG
  11. #define PDEBUG(level, fmt, args...) \
  12. if (debug >= (level)) \
  13. printk(KERN_INFO KBUILD_MODNAME "[%s:%d] \n" fmt, \
  14. __func__, __LINE__ , ## args)
  15. #else
  16. #define PDEBUG(level, fmt, args...) do {} while(0)
  17. #endif
  18. /* This macro restricts an int variable to an inclusive range */
  19. #define RESTRICT_TO_RANGE(v,mi,ma) { \
  20. if ((v) < (mi)) (v) = (mi); \
  21. else if ((v) > (ma)) (v) = (ma); \
  22. }
  23. /* --------------------------------- */
  24. /* DEFINES FOR OV511 AND OTHER CHIPS */
  25. /* --------------------------------- */
  26. /* USB IDs */
  27. #define VEND_OMNIVISION 0x05A9
  28. #define PROD_OV511 0x0511
  29. #define PROD_OV511PLUS 0xA511
  30. #define PROD_OV518 0x0518
  31. #define PROD_OV518PLUS 0xA518
  32. #define VEND_MATTEL 0x0813
  33. #define PROD_ME2CAM 0x0002
  34. /* --------------------------------- */
  35. /* OV51x REGISTER MNEMONICS */
  36. /* --------------------------------- */
  37. /* Camera interface register numbers */
  38. #define R511_CAM_DELAY 0x10
  39. #define R511_CAM_EDGE 0x11
  40. #define R511_CAM_PXCNT 0x12
  41. #define R511_CAM_LNCNT 0x13
  42. #define R511_CAM_PXDIV 0x14
  43. #define R511_CAM_LNDIV 0x15
  44. #define R511_CAM_UV_EN 0x16
  45. #define R511_CAM_LINE_MODE 0x17
  46. #define R511_CAM_OPTS 0x18
  47. /* Snapshot mode camera interface register numbers */
  48. #define R511_SNAP_FRAME 0x19
  49. #define R511_SNAP_PXCNT 0x1A
  50. #define R511_SNAP_LNCNT 0x1B
  51. #define R511_SNAP_PXDIV 0x1C
  52. #define R511_SNAP_LNDIV 0x1D
  53. #define R511_SNAP_UV_EN 0x1E
  54. #define R511_SNAP_OPTS 0x1F
  55. /* DRAM register numbers */
  56. #define R511_DRAM_FLOW_CTL 0x20
  57. #define R511_DRAM_ARCP 0x21
  58. #define R511_DRAM_MRC 0x22
  59. #define R511_DRAM_RFC 0x23
  60. /* ISO FIFO register numbers */
  61. #define R51x_FIFO_PSIZE 0x30 /* 2 bytes wide w/ OV518(+) */
  62. #define R511_FIFO_OPTS 0x31
  63. /* Parallel IO register numbers */
  64. #define R511_PIO_OPTS 0x38
  65. #define R511_PIO_DATA 0x39
  66. #define R511_PIO_BIST 0x3E
  67. #define R518_GPIO_IN 0x55 /* OV518(+) only */
  68. #define R518_GPIO_OUT 0x56 /* OV518(+) only */
  69. #define R518_GPIO_CTL 0x57 /* OV518(+) only */
  70. #define R518_GPIO_PULSE_IN 0x58 /* OV518(+) only */
  71. #define R518_GPIO_PULSE_CLEAR 0x59 /* OV518(+) only */
  72. #define R518_GPIO_PULSE_POL 0x5a /* OV518(+) only */
  73. #define R518_GPIO_PULSE_EN 0x5b /* OV518(+) only */
  74. #define R518_GPIO_RESET 0x5c /* OV518(+) only */
  75. /* I2C registers */
  76. #define R511_I2C_CTL 0x40
  77. #define R518_I2C_CTL 0x47 /* OV518(+) only */
  78. #define R51x_I2C_W_SID 0x41
  79. #define R51x_I2C_SADDR_3 0x42
  80. #define R51x_I2C_SADDR_2 0x43
  81. #define R51x_I2C_R_SID 0x44
  82. #define R51x_I2C_DATA 0x45
  83. #define R51x_I2C_CLOCK 0x46
  84. #define R51x_I2C_TIMEOUT 0x47
  85. /* I2C snapshot registers */
  86. #define R511_SI2C_SADDR_3 0x48
  87. #define R511_SI2C_DATA 0x49
  88. /* System control registers */
  89. #define R51x_SYS_RESET 0x50
  90. /* Reset type definitions */
  91. #define OV511_RESET_UDC 0x01
  92. #define OV511_RESET_I2C 0x02
  93. #define OV511_RESET_FIFO 0x04
  94. #define OV511_RESET_OMNICE 0x08
  95. #define OV511_RESET_DRAM 0x10
  96. #define OV511_RESET_CAM_INT 0x20
  97. #define OV511_RESET_OV511 0x40
  98. #define OV511_RESET_NOREGS 0x3F /* All but OV511 & regs */
  99. #define OV511_RESET_ALL 0x7F
  100. #define R511_SYS_CLOCK_DIV 0x51
  101. #define R51x_SYS_SNAP 0x52
  102. #define R51x_SYS_INIT 0x53
  103. #define R511_SYS_PWR_CLK 0x54 /* OV511+/OV518(+) only */
  104. #define R511_SYS_LED_CTL 0x55 /* OV511+ only */
  105. #define R511_SYS_USER 0x5E
  106. #define R511_SYS_CUST_ID 0x5F
  107. /* OmniCE (compression) registers */
  108. #define R511_COMP_PHY 0x70
  109. #define R511_COMP_PHUV 0x71
  110. #define R511_COMP_PVY 0x72
  111. #define R511_COMP_PVUV 0x73
  112. #define R511_COMP_QHY 0x74
  113. #define R511_COMP_QHUV 0x75
  114. #define R511_COMP_QVY 0x76
  115. #define R511_COMP_QVUV 0x77
  116. #define R511_COMP_EN 0x78
  117. #define R511_COMP_LUT_EN 0x79
  118. #define R511_COMP_LUT_BEGIN 0x80
  119. /* --------------------------------- */
  120. /* ALTERNATE NUMBERS */
  121. /* --------------------------------- */
  122. /* Alternate numbers for various max packet sizes (OV511 only) */
  123. #define OV511_ALT_SIZE_992 0
  124. #define OV511_ALT_SIZE_993 1
  125. #define OV511_ALT_SIZE_768 2
  126. #define OV511_ALT_SIZE_769 3
  127. #define OV511_ALT_SIZE_512 4
  128. #define OV511_ALT_SIZE_513 5
  129. #define OV511_ALT_SIZE_257 6
  130. #define OV511_ALT_SIZE_0 7
  131. /* Alternate numbers for various max packet sizes (OV511+ only) */
  132. #define OV511PLUS_ALT_SIZE_0 0
  133. #define OV511PLUS_ALT_SIZE_33 1
  134. #define OV511PLUS_ALT_SIZE_129 2
  135. #define OV511PLUS_ALT_SIZE_257 3
  136. #define OV511PLUS_ALT_SIZE_385 4
  137. #define OV511PLUS_ALT_SIZE_513 5
  138. #define OV511PLUS_ALT_SIZE_769 6
  139. #define OV511PLUS_ALT_SIZE_961 7
  140. /* Alternate numbers for various max packet sizes (OV518(+) only) */
  141. #define OV518_ALT_SIZE_0 0
  142. #define OV518_ALT_SIZE_128 1
  143. #define OV518_ALT_SIZE_256 2
  144. #define OV518_ALT_SIZE_384 3
  145. #define OV518_ALT_SIZE_512 4
  146. #define OV518_ALT_SIZE_640 5
  147. #define OV518_ALT_SIZE_768 6
  148. #define OV518_ALT_SIZE_896 7
  149. /* --------------------------------- */
  150. /* OV7610 REGISTER MNEMONICS */
  151. /* --------------------------------- */
  152. /* OV7610 registers */
  153. #define OV7610_REG_GAIN 0x00 /* gain setting (5:0) */
  154. #define OV7610_REG_BLUE 0x01 /* blue channel balance */
  155. #define OV7610_REG_RED 0x02 /* red channel balance */
  156. #define OV7610_REG_SAT 0x03 /* saturation */
  157. /* 04 reserved */
  158. #define OV7610_REG_CNT 0x05 /* Y contrast */
  159. #define OV7610_REG_BRT 0x06 /* Y brightness */
  160. /* 08-0b reserved */
  161. #define OV7610_REG_BLUE_BIAS 0x0C /* blue channel bias (5:0) */
  162. #define OV7610_REG_RED_BIAS 0x0D /* read channel bias (5:0) */
  163. #define OV7610_REG_GAMMA_COEFF 0x0E /* gamma settings */
  164. #define OV7610_REG_WB_RANGE 0x0F /* AEC/ALC/S-AWB settings */
  165. #define OV7610_REG_EXP 0x10 /* manual exposure setting */
  166. #define OV7610_REG_CLOCK 0x11 /* polarity/clock prescaler */
  167. #define OV7610_REG_COM_A 0x12 /* misc common regs */
  168. #define OV7610_REG_COM_B 0x13 /* misc common regs */
  169. #define OV7610_REG_COM_C 0x14 /* misc common regs */
  170. #define OV7610_REG_COM_D 0x15 /* misc common regs */
  171. #define OV7610_REG_FIELD_DIVIDE 0x16 /* field interval/mode settings */
  172. #define OV7610_REG_HWIN_START 0x17 /* horizontal window start */
  173. #define OV7610_REG_HWIN_END 0x18 /* horizontal window end */
  174. #define OV7610_REG_VWIN_START 0x19 /* vertical window start */
  175. #define OV7610_REG_VWIN_END 0x1A /* vertical window end */
  176. #define OV7610_REG_PIXEL_SHIFT 0x1B /* pixel shift */
  177. #define OV7610_REG_ID_HIGH 0x1C /* manufacturer ID MSB */
  178. #define OV7610_REG_ID_LOW 0x1D /* manufacturer ID LSB */
  179. /* 0e-0f reserved */
  180. #define OV7610_REG_COM_E 0x20 /* misc common regs */
  181. #define OV7610_REG_YOFFSET 0x21 /* Y channel offset */
  182. #define OV7610_REG_UOFFSET 0x22 /* U channel offset */
  183. /* 23 reserved */
  184. #define OV7610_REG_ECW 0x24 /* Exposure white level for AEC */
  185. #define OV7610_REG_ECB 0x25 /* Exposure black level for AEC */
  186. #define OV7610_REG_COM_F 0x26 /* misc settings */
  187. #define OV7610_REG_COM_G 0x27 /* misc settings */
  188. #define OV7610_REG_COM_H 0x28 /* misc settings */
  189. #define OV7610_REG_COM_I 0x29 /* misc settings */
  190. #define OV7610_REG_FRAMERATE_H 0x2A /* frame rate MSB + misc */
  191. #define OV7610_REG_FRAMERATE_L 0x2B /* frame rate LSB */
  192. #define OV7610_REG_ALC 0x2C /* Auto Level Control settings */
  193. #define OV7610_REG_COM_J 0x2D /* misc settings */
  194. #define OV7610_REG_VOFFSET 0x2E /* V channel offset adjustment */
  195. #define OV7610_REG_ARRAY_BIAS 0x2F /* Array bias -- don't change */
  196. /* 30-32 reserved */
  197. #define OV7610_REG_YGAMMA 0x33 /* misc gamma settings (7:6) */
  198. #define OV7610_REG_BIAS_ADJUST 0x34 /* misc bias settings */
  199. #define OV7610_REG_COM_L 0x35 /* misc settings */
  200. /* 36-37 reserved */
  201. #define OV7610_REG_COM_K 0x38 /* misc registers */
  202. /* --------------------------------- */
  203. /* I2C ADDRESSES */
  204. /* --------------------------------- */
  205. #define OV7xx0_SID 0x42
  206. #define OV6xx0_SID 0xC0
  207. #define OV8xx0_SID 0xA0
  208. #define KS0127_SID 0xD8
  209. #define SAA7111A_SID 0x48
  210. /* --------------------------------- */
  211. /* MISCELLANEOUS DEFINES */
  212. /* --------------------------------- */
  213. #define I2C_CLOCK_PRESCALER 0x03
  214. #define FRAMES_PER_DESC 10 /* FIXME - What should this be? */
  215. #define MAX_FRAME_SIZE_PER_DESC 993 /* For statically allocated stuff */
  216. #define PIXELS_PER_SEG 256 /* Pixels per segment */
  217. #define OV511_ENDPOINT_ADDRESS 1 /* Isoc endpoint number */
  218. #define OV511_NUMFRAMES 2
  219. #if OV511_NUMFRAMES > VIDEO_MAX_FRAME
  220. #error "OV511_NUMFRAMES is too high"
  221. #endif
  222. #define OV511_NUMSBUF 2
  223. /* Control transfers use up to 4 bytes */
  224. #define OV511_CBUF_SIZE 4
  225. /* Size of usb_make_path() buffer */
  226. #define OV511_USB_PATH_LEN 64
  227. /* Bridge types */
  228. enum {
  229. BRG_UNKNOWN,
  230. BRG_OV511,
  231. BRG_OV511PLUS,
  232. BRG_OV518,
  233. BRG_OV518PLUS,
  234. };
  235. /* Bridge classes */
  236. enum {
  237. BCL_UNKNOWN,
  238. BCL_OV511,
  239. BCL_OV518,
  240. };
  241. /* Sensor types */
  242. enum {
  243. SEN_UNKNOWN,
  244. SEN_OV76BE,
  245. SEN_OV7610,
  246. SEN_OV7620,
  247. SEN_OV7620AE,
  248. SEN_OV6620,
  249. SEN_OV6630,
  250. SEN_OV6630AE,
  251. SEN_OV6630AF,
  252. SEN_OV8600,
  253. SEN_KS0127,
  254. SEN_KS0127B,
  255. SEN_SAA7111A,
  256. };
  257. enum {
  258. STATE_SCANNING, /* Scanning for start */
  259. STATE_HEADER, /* Parsing header */
  260. STATE_LINES, /* Parsing lines */
  261. };
  262. /* Buffer states */
  263. enum {
  264. BUF_NOT_ALLOCATED,
  265. BUF_ALLOCATED,
  266. };
  267. /* --------- Definition of ioctl interface --------- */
  268. #define OV511_INTERFACE_VER 101
  269. /* LED options */
  270. enum {
  271. LED_OFF,
  272. LED_ON,
  273. LED_AUTO,
  274. };
  275. /* Raw frame formats */
  276. enum {
  277. RAWFMT_INVALID,
  278. RAWFMT_YUV400,
  279. RAWFMT_YUV420,
  280. RAWFMT_YUV422,
  281. RAWFMT_GBR422,
  282. };
  283. struct ov511_i2c_struct {
  284. unsigned char slave; /* Write slave ID (read ID - 1) */
  285. unsigned char reg; /* Index of register */
  286. unsigned char value; /* User sets this w/ write, driver does w/ read */
  287. unsigned char mask; /* Bits to be changed. Not used with read ops */
  288. };
  289. /* ioctls */
  290. #define OV511IOC_WI2C _IOW('v', BASE_VIDIOCPRIVATE + 5, \
  291. struct ov511_i2c_struct)
  292. #define OV511IOC_RI2C _IOWR('v', BASE_VIDIOCPRIVATE + 6, \
  293. struct ov511_i2c_struct)
  294. /* ------------- End IOCTL interface -------------- */
  295. struct usb_ov511; /* Forward declaration */
  296. struct ov511_sbuf {
  297. struct usb_ov511 *ov;
  298. unsigned char *data;
  299. struct urb *urb;
  300. spinlock_t lock;
  301. int n;
  302. };
  303. enum {
  304. FRAME_UNUSED, /* Unused (no MCAPTURE) */
  305. FRAME_READY, /* Ready to start grabbing */
  306. FRAME_GRABBING, /* In the process of being grabbed into */
  307. FRAME_DONE, /* Finished grabbing, but not been synced yet */
  308. FRAME_ERROR, /* Something bad happened while processing */
  309. };
  310. struct ov511_regvals {
  311. enum {
  312. OV511_DONE_BUS,
  313. OV511_REG_BUS,
  314. OV511_I2C_BUS,
  315. } bus;
  316. unsigned char reg;
  317. unsigned char val;
  318. };
  319. struct ov511_frame {
  320. int framenum; /* Index of this frame */
  321. unsigned char *data; /* Frame buffer */
  322. unsigned char *tempdata; /* Temp buffer for multi-stage conversions */
  323. unsigned char *rawdata; /* Raw camera data buffer */
  324. unsigned char *compbuf; /* Temp buffer for decompressor */
  325. int depth; /* Bytes per pixel */
  326. int width; /* Width application is expecting */
  327. int height; /* Height application is expecting */
  328. int rawwidth; /* Actual width of frame sent from camera */
  329. int rawheight; /* Actual height of frame sent from camera */
  330. int sub_flag; /* Sub-capture mode for this frame? */
  331. unsigned int format; /* Format for this frame */
  332. int compressed; /* Is frame compressed? */
  333. volatile int grabstate; /* State of grabbing */
  334. int scanstate; /* State of scanning */
  335. int bytes_recvd; /* Number of image bytes received from camera */
  336. long bytes_read; /* Amount that has been read() */
  337. wait_queue_head_t wq; /* Processes waiting */
  338. int snapshot; /* True if frame was a snapshot */
  339. };
  340. #define DECOMP_INTERFACE_VER 4
  341. /* Compression module operations */
  342. struct ov51x_decomp_ops {
  343. int (*decomp_400)(unsigned char *, unsigned char *, unsigned char *,
  344. int, int, int);
  345. int (*decomp_420)(unsigned char *, unsigned char *, unsigned char *,
  346. int, int, int);
  347. int (*decomp_422)(unsigned char *, unsigned char *, unsigned char *,
  348. int, int, int);
  349. struct module *owner;
  350. };
  351. struct usb_ov511 {
  352. struct video_device *vdev;
  353. struct usb_device *dev;
  354. int customid;
  355. char *desc;
  356. unsigned char iface;
  357. char usb_path[OV511_USB_PATH_LEN];
  358. /* Determined by sensor type */
  359. int maxwidth;
  360. int maxheight;
  361. int minwidth;
  362. int minheight;
  363. int brightness;
  364. int colour;
  365. int contrast;
  366. int hue;
  367. int whiteness;
  368. int exposure;
  369. int auto_brt; /* Auto brightness enabled flag */
  370. int auto_gain; /* Auto gain control enabled flag */
  371. int auto_exp; /* Auto exposure enabled flag */
  372. int backlight; /* Backlight exposure algorithm flag */
  373. int mirror; /* Image is reversed horizontally */
  374. int led_policy; /* LED: off|on|auto; OV511+ only */
  375. struct mutex lock; /* Serializes user-accessible operations */
  376. int user; /* user count for exclusive use */
  377. int streaming; /* Are we streaming Isochronous? */
  378. int grabbing; /* Are we grabbing? */
  379. int compress; /* Should the next frame be compressed? */
  380. int compress_inited; /* Are compression params uploaded? */
  381. int lightfreq; /* Power (lighting) frequency */
  382. int bandfilt; /* Banding filter enabled flag */
  383. unsigned char *fbuf; /* Videodev buffer area */
  384. unsigned char *tempfbuf; /* Temporary (intermediate) buffer area */
  385. unsigned char *rawfbuf; /* Raw camera data buffer area */
  386. int sub_flag; /* Pix Array subcapture on flag */
  387. int subx; /* Pix Array subcapture x offset */
  388. int suby; /* Pix Array subcapture y offset */
  389. int subw; /* Pix Array subcapture width */
  390. int subh; /* Pix Array subcapture height */
  391. int curframe; /* Current receiving sbuf */
  392. struct ov511_frame frame[OV511_NUMFRAMES];
  393. struct ov511_sbuf sbuf[OV511_NUMSBUF];
  394. wait_queue_head_t wq; /* Processes waiting */
  395. int snap_enabled; /* Snapshot mode enabled */
  396. int bridge; /* Type of bridge (BRG_*) */
  397. int bclass; /* Class of bridge (BCL_*) */
  398. int sensor; /* Type of image sensor chip (SEN_*) */
  399. int packet_size; /* Frame size per isoc desc */
  400. int packet_numbering; /* Is ISO frame numbering enabled? */
  401. /* Framebuffer/sbuf management */
  402. int buf_state;
  403. struct mutex buf_lock;
  404. struct ov51x_decomp_ops *decomp_ops;
  405. /* Stop streaming while changing picture settings */
  406. int stop_during_set;
  407. int stopped; /* Streaming is temporarily paused */
  408. /* Video decoder stuff */
  409. int input; /* Composite, S-VIDEO, etc... */
  410. int num_inputs; /* Number of inputs */
  411. int norm; /* NTSC / PAL / SECAM */
  412. int has_decoder; /* Device has a video decoder */
  413. int pal; /* Device is designed for PAL resolution */
  414. /* I2C interface */
  415. struct mutex i2c_lock; /* Protect I2C controller regs */
  416. unsigned char primary_i2c_slave; /* I2C write id of sensor */
  417. /* Control transaction stuff */
  418. unsigned char *cbuf; /* Buffer for payload */
  419. struct mutex cbuf_lock;
  420. };
  421. /* Used to represent a list of values and their respective symbolic names */
  422. struct symbolic_list {
  423. int num;
  424. char *name;
  425. };
  426. #define NOT_DEFINED_STR "Unknown"
  427. /* Returns the name of the matching element in the symbolic_list array. The
  428. * end of the list must be marked with an element that has a NULL name.
  429. */
  430. static inline char *
  431. symbolic(struct symbolic_list list[], int num)
  432. {
  433. int i;
  434. for (i = 0; list[i].name != NULL; i++)
  435. if (list[i].num == num)
  436. return (list[i].name);
  437. return (NOT_DEFINED_STR);
  438. }
  439. /* Compression stuff */
  440. #define OV511_QUANTABLESIZE 64
  441. #define OV518_QUANTABLESIZE 32
  442. #define OV511_YQUANTABLE { \
  443. 0, 1, 1, 2, 2, 3, 3, 4, \
  444. 1, 1, 1, 2, 2, 3, 4, 4, \
  445. 1, 1, 2, 2, 3, 4, 4, 4, \
  446. 2, 2, 2, 3, 4, 4, 4, 4, \
  447. 2, 2, 3, 4, 4, 5, 5, 5, \
  448. 3, 3, 4, 4, 5, 5, 5, 5, \
  449. 3, 4, 4, 4, 5, 5, 5, 5, \
  450. 4, 4, 4, 4, 5, 5, 5, 5 \
  451. }
  452. #define OV511_UVQUANTABLE { \
  453. 0, 2, 2, 3, 4, 4, 4, 4, \
  454. 2, 2, 2, 4, 4, 4, 4, 4, \
  455. 2, 2, 3, 4, 4, 4, 4, 4, \
  456. 3, 4, 4, 4, 4, 4, 4, 4, \
  457. 4, 4, 4, 4, 4, 4, 4, 4, \
  458. 4, 4, 4, 4, 4, 4, 4, 4, \
  459. 4, 4, 4, 4, 4, 4, 4, 4, \
  460. 4, 4, 4, 4, 4, 4, 4, 4 \
  461. }
  462. #define OV518_YQUANTABLE { \
  463. 5, 4, 5, 6, 6, 7, 7, 7, \
  464. 5, 5, 5, 5, 6, 7, 7, 7, \
  465. 6, 6, 6, 6, 7, 7, 7, 8, \
  466. 7, 7, 6, 7, 7, 7, 8, 8 \
  467. }
  468. #define OV518_UVQUANTABLE { \
  469. 6, 6, 6, 7, 7, 7, 7, 7, \
  470. 6, 6, 6, 7, 7, 7, 7, 7, \
  471. 6, 6, 6, 7, 7, 7, 7, 8, \
  472. 7, 7, 7, 7, 7, 7, 8, 8 \
  473. }
  474. #endif