Unit JcHuff

Classes

Functions

jinit_huff_encoder - Nomssi } { Module initialization routine for Huffman entropy encoding.
jpeg_gen_optimal_table - Generate the optimal coding for the given counts, fill htbl.
jpeg_make_c_derived_tbl - Compute the derived values for a Huffman table.

Types

c_derived_tbl
c_derived_tbl_ptr
TLongTable
TLongTablePtr

Constants

Variables


Functions


procedure jinit_huff_encoder (cinfo : j_compress_ptr);

Nomssi } { Module initialization routine for Huffman entropy encoding. } {GLOBAL

Huffman coding optimization. This actually is optimization, in the sense that we find the best possible Huffman table(s) for the given data. We first scan the supplied data and count the number of uses of each symbol that is to be Huffman-coded. (This process must agree with the code above.) Then we build an optimal Huffman coding tree for the observed counts. The JPEG standard requires Huffman codes to be no more than 16 bits long. If some symbols have a very small but nonzero probability, the Huffman tree must be adjusted to meet the code length restriction. We currently use the adjustment method suggested in the JPEG spec. This method is *not* optimal; it may not choose the best possible limited-length code. But since the symbols involved are infrequently used, it's not clear that going to extra trouble is worthwhile. } { ENTROPY_OPT_SUPPORTED } { Module initialization routine for Huffman entropy encoding. } {GLOBAL


procedure jpeg_gen_optimal_table (cinfo : j_compress_ptr; htbl : JHUFF_TBL_PTR; var freq : TLongTable);

Generate the optimal coding for the given counts, fill htbl. Note this is also used by jcphuff.c. } {GLOBAL

procedure jpeg_make_c_derived_tbl (cinfo : j_compress_ptr; var htbl : JHUFF_TBL; var pdtbl : c_derived_tbl_ptr);

Compute the derived values for a Huffman table. Note this is also used by jcphuff.c. } {GLOBAL

Compute the derived values for a Huffman table. Note this is also used by jcphuff.c. } {GLOBAL


Types


c_derived_tbl = record
ehufco : array[0..256-1] of uInt;
ehufsi : array[0..256-1] of byte;
end;

c_derived_tbl_ptr = ^c_derived_tbl
Derived data constructed for each Huffman table } { Declarations shared with jcphuff.c
TLongTable = array[0..256] of long;
for JCHUFF und JCPHUFF
TLongTablePtr = ^TLongTable

Constants


Variables