bsp
jchuff.h
00001 /*
00002  * jchuff.h
00003  *
00004  * Copyright (C) 1991-1995, Thomas G. Lane.
00005  * This file is part of the Independent JPEG Group's software.
00006  * For conditions of distribution and use, see the accompanying README file.
00007  *
00008  * This file contains declarations for Huffman entropy encoding routines
00009  * that are shared between the sequential encoder (jchuff.c) and the
00010  * progressive encoder (jcphuff.c).  No other modules need to see these.
00011  */
00012 
00013 /* Derived data constructed for each Huffman table */
00014 
00015 typedef struct
00016 {
00017     unsigned int ehufco[256];   /* code for each symbol */
00018     char ehufsi[256];           /* length of code for each symbol */
00019     /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
00020 } c_derived_tbl;
00021 
00022 /* Short forms of external names for systems with brain-damaged linkers. */
00023 
00024 #ifdef NEED_SHORT_EXTERNAL_NAMES
00025 #define jpeg_make_c_derived_tbl jMkCDerived
00026 #define jpeg_gen_optimal_table  jGenOptTbl
00027 #endif /* NEED_SHORT_EXTERNAL_NAMES */
00028 
00029 /* Expand a Huffman table definition into the derived format */
00030 EXTERN void jpeg_make_c_derived_tbl JPP((j_compress_ptr cinfo,
00031                                         JHUFF_TBL * htbl, c_derived_tbl ** pdtbl));
00032 
00033 /* Generate an optimal table definition given the specified counts */
00034 EXTERN void jpeg_gen_optimal_table JPP((j_compress_ptr cinfo,
00035                                         JHUFF_TBL * htbl, long freq[]));
 All Classes Functions