Path: blob/master/3rdparty/libjpeg-turbo/src/jchuff.h
16337 views
/*1* jchuff.h2*3* This file was part of the Independent JPEG Group's software:4* Copyright (C) 1991-1997, Thomas G. Lane.5* It was modified by The libjpeg-turbo Project to include only code relevant6* to libjpeg-turbo.7* For conditions of distribution and use, see the accompanying README.ijg8* file.9*10* This file contains declarations for Huffman entropy encoding routines11* that are shared between the sequential encoder (jchuff.c) and the12* progressive encoder (jcphuff.c). No other modules need to see these.13*/1415/* The legal range of a DCT coefficient is16* -1024 .. +1023 for 8-bit data;17* -16384 .. +16383 for 12-bit data.18* Hence the magnitude should always fit in 10 or 14 bits respectively.19*/2021#if BITS_IN_JSAMPLE == 822#define MAX_COEF_BITS 1023#else24#define MAX_COEF_BITS 1425#endif2627/* Derived data constructed for each Huffman table */2829typedef struct {30unsigned int ehufco[256]; /* code for each symbol */31char ehufsi[256]; /* length of code for each symbol */32/* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */33} c_derived_tbl;3435/* Expand a Huffman table definition into the derived format */36EXTERN(void) jpeg_make_c_derived_tbl37(j_compress_ptr cinfo, boolean isDC, int tblno,38c_derived_tbl ** pdtbl);3940/* Generate an optimal table definition given the specified counts */41EXTERN(void) jpeg_gen_optimal_table42(j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]);434445