0N/A/*
0N/A * reserved comment block
0N/A * DO NOT REMOVE OR ALTER!
0N/A */
0N/A/*
0N/A * jchuff.h
0N/A *
0N/A * Copyright (C) 1991-1997, Thomas G. Lane.
0N/A * This file is part of the Independent JPEG Group's software.
0N/A * For conditions of distribution and use, see the accompanying README file.
0N/A *
0N/A * This file contains declarations for Huffman entropy encoding routines
0N/A * that are shared between the sequential encoder (jchuff.c) and the
0N/A * progressive encoder (jcphuff.c). No other modules need to see these.
0N/A */
0N/A
0N/A/* The legal range of a DCT coefficient is
0N/A * -1024 .. +1023 for 8-bit data;
0N/A * -16384 .. +16383 for 12-bit data.
0N/A * Hence the magnitude should always fit in 10 or 14 bits respectively.
0N/A */
0N/A
0N/A#if BITS_IN_JSAMPLE == 8
0N/A#define MAX_COEF_BITS 10
0N/A#else
0N/A#define MAX_COEF_BITS 14
0N/A#endif
0N/A
0N/A/* Derived data constructed for each Huffman table */
0N/A
0N/Atypedef struct {
0N/A unsigned int ehufco[256]; /* code for each symbol */
0N/A char ehufsi[256]; /* length of code for each symbol */
0N/A /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
0N/A} c_derived_tbl;
0N/A
0N/A/* Short forms of external names for systems with brain-damaged linkers. */
0N/A
0N/A#ifdef NEED_SHORT_EXTERNAL_NAMES
0N/A#define jpeg_make_c_derived_tbl jMkCDerived
0N/A#define jpeg_gen_optimal_table jGenOptTbl
0N/A#endif /* NEED_SHORT_EXTERNAL_NAMES */
0N/A
0N/A/* Expand a Huffman table definition into the derived format */
0N/AEXTERN(void) jpeg_make_c_derived_tbl
0N/A JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
0N/A c_derived_tbl ** pdtbl));
0N/A
0N/A/* Generate an optimal table definition given the specified counts */
0N/AEXTERN(void) jpeg_gen_optimal_table
0N/A JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));