^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* Linux driver for Philips webcam
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) (C) 2004-2006 Luc Saillard (luc@saillard.org)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) driver and thus may have bugs that are not present in the original version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Please send bug reports and support requests to <luc@saillard.org>.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) The decompression routines have been implemented by reverse-engineering the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Nemosoft binary pwcx module. Caveat emptor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifndef PWC_DEC23_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define PWC_DEC23_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct pwc_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct pwc_dec23_private
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct mutex lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) unsigned char last_cmd, last_cmd_valid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) unsigned int scalebits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) unsigned int nbitsmask, nbits; /* Number of bits of a color in the compressed stream */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) unsigned int reservoir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) unsigned int nbits_in_reservoir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) const unsigned char *stream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int temp_colors[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) unsigned char table_0004_pass1[16][1024];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned char table_0004_pass2[16][1024];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) unsigned char table_8004_pass1[16][256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned char table_8004_pass2[16][256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned int table_subblock[256][12];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) unsigned char table_bitpowermask[8][256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned int table_d800[256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned int table_dc00[256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) void pwc_dec23_init(struct pwc_device *pdev, const unsigned char *cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) void pwc_dec23_decompress(struct pwc_device *pdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) const void *src,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) void *dst);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif