Path: blob/master/src/java.desktop/share/native/libjavajpeg/jchuff.h
41149 views
/*1* reserved comment block2* DO NOT REMOVE OR ALTER!3*/4/*5* jchuff.h6*7* Copyright (C) 1991-1997, Thomas G. Lane.8* This file is part of the Independent JPEG Group's software.9* For conditions of distribution and use, see the accompanying README file.10*11* This file contains declarations for Huffman entropy encoding routines12* that are shared between the sequential encoder (jchuff.c) and the13* progressive encoder (jcphuff.c). No other modules need to see these.14*/1516/* The legal range of a DCT coefficient is17* -1024 .. +1023 for 8-bit data;18* -16384 .. +16383 for 12-bit data.19* Hence the magnitude should always fit in 10 or 14 bits respectively.20*/2122#if BITS_IN_JSAMPLE == 823#define MAX_COEF_BITS 1024#else25#define MAX_COEF_BITS 1426#endif2728/* Derived data constructed for each Huffman table */2930typedef struct {31unsigned int ehufco[256]; /* code for each symbol */32char ehufsi[256]; /* length of code for each symbol */33/* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */34} c_derived_tbl;3536/* Short forms of external names for systems with brain-damaged linkers. */3738#ifdef NEED_SHORT_EXTERNAL_NAMES39#define jpeg_make_c_derived_tbl jMkCDerived40#define jpeg_gen_optimal_table jGenOptTbl41#endif /* NEED_SHORT_EXTERNAL_NAMES */4243/* Expand a Huffman table definition into the derived format */44EXTERN(void) jpeg_make_c_derived_tbl45JPP((j_compress_ptr cinfo, boolean isDC, int tblno,46c_derived_tbl ** pdtbl));4748/* Generate an optimal table definition given the specified counts */49EXTERN(void) jpeg_gen_optimal_table50JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));515253