jchuff.h

Go to the documentation of this file.
00001 /*
00002  * jchuff.h
00003  *
00004  * Copyright (C) 1991-1997, 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 /* The legal range of a DCT coefficient is
00014  *  -1024 .. +1023  for 8-bit data;
00015  * -16384 .. +16383 for 12-bit data.
00016  * Hence the magnitude should always fit in 10 or 14 bits respectively.
00017  */
00018 
00019 
00023 
00024 #if BITS_IN_JSAMPLE == 8
00025 #define MAX_COEF_BITS 10
00026 #else
00027 #define MAX_COEF_BITS 14
00028 #endif
00029 
00030 /* Derived data constructed for each Huffman table */
00031 
00032 typedef struct {
00033   unsigned int ehufco[256]; /* code for each symbol */
00034   char ehufsi[256];     /* length of code for each symbol */
00035   /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
00036 } c_derived_tbl;
00037 
00038 /* Short forms of external names for systems with brain-damaged linkers. */
00039 
00040 #ifdef NEED_SHORT_EXTERNAL_NAMES
00041 #define jpeg_make_c_derived_tbl jMkCDerived
00042 #define jpeg_gen_optimal_table  jGenOptTbl
00043 #endif /* NEED_SHORT_EXTERNAL_NAMES */
00044 
00045 /* Expand a Huffman table definition into the derived format */
00046 EXTERN(void) jpeg_make_c_derived_tbl
00047     JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
00048          c_derived_tbl ** pdtbl));
00049 
00050 /* Generate an optimal table definition given the specified counts */
00051 EXTERN(void) jpeg_gen_optimal_table
00052     JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));

Generated on Tue Jan 6 22:41:37 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5