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