istereo
diff libs/libjpeg/jchuff.h @ 26:862a3329a8f0
wohooo, added a shitload of code from zlib/libpng/libjpeg. When the good lord was raining shared libraries the iphone held a fucking umbrella...
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Thu, 08 Sep 2011 06:28:38 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/libjpeg/jchuff.h Thu Sep 08 06:28:38 2011 +0300 1.3 @@ -0,0 +1,47 @@ 1.4 +/* 1.5 + * jchuff.h 1.6 + * 1.7 + * Copyright (C) 1991-1997, Thomas G. Lane. 1.8 + * This file is part of the Independent JPEG Group's software. 1.9 + * For conditions of distribution and use, see the accompanying README file. 1.10 + * 1.11 + * This file contains declarations for Huffman entropy encoding routines 1.12 + * that are shared between the sequential encoder (jchuff.c) and the 1.13 + * progressive encoder (jcphuff.c). No other modules need to see these. 1.14 + */ 1.15 + 1.16 +/* The legal range of a DCT coefficient is 1.17 + * -1024 .. +1023 for 8-bit data; 1.18 + * -16384 .. +16383 for 12-bit data. 1.19 + * Hence the magnitude should always fit in 10 or 14 bits respectively. 1.20 + */ 1.21 + 1.22 +#if BITS_IN_JSAMPLE == 8 1.23 +#define MAX_COEF_BITS 10 1.24 +#else 1.25 +#define MAX_COEF_BITS 14 1.26 +#endif 1.27 + 1.28 +/* Derived data constructed for each Huffman table */ 1.29 + 1.30 +typedef struct { 1.31 + unsigned int ehufco[256]; /* code for each symbol */ 1.32 + char ehufsi[256]; /* length of code for each symbol */ 1.33 + /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ 1.34 +} c_derived_tbl; 1.35 + 1.36 +/* Short forms of external names for systems with brain-damaged linkers. */ 1.37 + 1.38 +#ifdef NEED_SHORT_EXTERNAL_NAMES 1.39 +#define jpeg_make_c_derived_tbl jMkCDerived 1.40 +#define jpeg_gen_optimal_table jGenOptTbl 1.41 +#endif /* NEED_SHORT_EXTERNAL_NAMES */ 1.42 + 1.43 +/* Expand a Huffman table definition into the derived format */ 1.44 +EXTERN(void) jpeg_make_c_derived_tbl 1.45 + JPP((j_compress_ptr cinfo, boolean isDC, int tblno, 1.46 + c_derived_tbl ** pdtbl)); 1.47 + 1.48 +/* Generate an optimal table definition given the specified counts */ 1.49 +EXTERN(void) jpeg_gen_optimal_table 1.50 + JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));