18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* Linux driver for Philips webcam 38c2ecf20Sopenharmony_ci (C) 2004-2006 Luc Saillard (luc@saillard.org) 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx 68c2ecf20Sopenharmony_ci driver and thus may have bugs that are not present in the original version. 78c2ecf20Sopenharmony_ci Please send bug reports and support requests to <luc@saillard.org>. 88c2ecf20Sopenharmony_ci The decompression routines have been implemented by reverse-engineering the 98c2ecf20Sopenharmony_ci Nemosoft binary pwcx module. Caveat emptor. 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci*/ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#ifndef PWC_DEC23_H 148c2ecf20Sopenharmony_ci#define PWC_DEC23_H 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistruct pwc_device; 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_cistruct pwc_dec23_private 198c2ecf20Sopenharmony_ci{ 208c2ecf20Sopenharmony_ci struct mutex lock; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci unsigned char last_cmd, last_cmd_valid; 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci unsigned int scalebits; 258c2ecf20Sopenharmony_ci unsigned int nbitsmask, nbits; /* Number of bits of a color in the compressed stream */ 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci unsigned int reservoir; 288c2ecf20Sopenharmony_ci unsigned int nbits_in_reservoir; 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci const unsigned char *stream; 318c2ecf20Sopenharmony_ci int temp_colors[16]; 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci unsigned char table_0004_pass1[16][1024]; 348c2ecf20Sopenharmony_ci unsigned char table_0004_pass2[16][1024]; 358c2ecf20Sopenharmony_ci unsigned char table_8004_pass1[16][256]; 368c2ecf20Sopenharmony_ci unsigned char table_8004_pass2[16][256]; 378c2ecf20Sopenharmony_ci unsigned int table_subblock[256][12]; 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci unsigned char table_bitpowermask[8][256]; 408c2ecf20Sopenharmony_ci unsigned int table_d800[256]; 418c2ecf20Sopenharmony_ci unsigned int table_dc00[256]; 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci}; 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_civoid pwc_dec23_init(struct pwc_device *pdev, const unsigned char *cmd); 468c2ecf20Sopenharmony_civoid pwc_dec23_decompress(struct pwc_device *pdev, 478c2ecf20Sopenharmony_ci const void *src, 488c2ecf20Sopenharmony_ci void *dst); 498c2ecf20Sopenharmony_ci#endif 50