summaryrefslogtreecommitdiff
path: root/gs/base/shcgen.h
diff options
context:
space:
mode:
authorRalph Giles <ralph.giles@artifex.com>2008-08-29 18:46:21 +0000
committerRalph Giles <ralph.giles@artifex.com>2008-08-29 18:46:21 +0000
commit6ff2582d038f99b79178082b200bdfe73f734456 (patch)
tree6db04fc72813760fdc6912a15875ad83d57943df /gs/base/shcgen.h
parent9d36ee856e41244d3cf0469fc0004d21e6911994 (diff)
downloadghostpdl-6ff2582d038f99b79178082b200bdfe73f734456.tar.gz
Split the source tree into two new directories.
PSSRC files are now in 'gs/psi'. GLSRC files are now in 'gs/base'. This is to facilitate build modularization and merging in the ghostpdl tree. NOTE: msvc32.mak is now in psi, not src. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@9048 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/base/shcgen.h')
-rw-r--r--gs/base/shcgen.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/gs/base/shcgen.h b/gs/base/shcgen.h
new file mode 100644
index 000000000..986088869
--- /dev/null
+++ b/gs/base/shcgen.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 2001-2006 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied, modified
+ or distributed except as expressly authorized under the terms of that
+ license. Refer to licensing information at http://www.artifex.com/
+ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
+ San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* $Id$ */
+/* Interface for Huffman code generation */
+/* Requires shc.h */
+
+#ifndef shcgen_INCLUDED
+# define shcgen_INCLUDED
+
+/* Compute an optimal Huffman code from an input data set. */
+/* The client must have set all the elements of *def. */
+/* The definition is guaranteed to be well-behaved. */
+int hc_compute(hc_definition * def, const long *freqs, gs_memory_t * mem);
+
+/* Convert a definition to a byte string. */
+/* The caller must provide the byte string, of length def->num_values. */
+/* Assume (do not check) that the definition is well-behaved. */
+/* Return the actual length of the string. */
+int hc_bytes_from_definition(byte * dbytes, const hc_definition * def);
+
+/* Extract num_counts and num_values from a byte string. */
+void hc_sizes_from_bytes(hc_definition * def, const byte * dbytes, int num_bytes);
+
+/* Convert a byte string back to a definition. */
+/* The caller must initialize *def, including allocating counts and values. */
+void hc_definition_from_bytes(hc_definition * def, const byte * dbytes);
+
+/* Generate the encoding table from the definition. */
+/* The size of the encode array is def->num_values. */
+void hc_make_encoding(hce_code * encode, const hc_definition * def);
+
+/* Calculate the size of the decoding table. */
+uint hc_sizeof_decoding(const hc_definition * def, int initial_bits);
+
+/* Generate the decoding tables. */
+void hc_make_decoding(hcd_code * decode, const hc_definition * def,
+ int initial_bits);
+
+#endif /* shcgen_INCLUDED */