summaryrefslogtreecommitdiff
path: root/include/compression/bwlzh.h
diff options
context:
space:
mode:
authorDaniel Spangberg <daniels@kemi.uu.se>2013-05-15 12:31:28 (GMT)
committerDaniel Spangberg <daniels@kemi.uu.se>2013-05-15 12:31:28 (GMT)
commit2882416b599514f5a7e60b07c6a20b53a32f9027 (patch)
treefe8fd58b5023c7835af4096f32389e7cb8aaa6bb /include/compression/bwlzh.h
parent43f0748e4a4335e0eb9f81cc8a4728616ac08cf1 (diff)
Added tng_compress trajectory compression algorithms
Diffstat (limited to 'include/compression/bwlzh.h')
-rw-r--r--include/compression/bwlzh.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/include/compression/bwlzh.h b/include/compression/bwlzh.h
new file mode 100644
index 0000000..3e58d2d
--- /dev/null
+++ b/include/compression/bwlzh.h
@@ -0,0 +1,74 @@
+/* This code is part of the tng compression routines.
+ *
+ * Written by Daniel Spangberg
+ * Copyright (c) 2010, 2013, The GROMACS development team.
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ */
+
+
+#ifndef BWLZH_H
+#define BWLZH_H
+
+/* Compress the integers (positive, small integers are preferable)
+ using bwlzh compression. The unsigned char *output should be
+ allocated to be able to hold worst case. You can obtain this length
+ conveniently by calling comp_get_buflen()
+*/
+void DECLSPECDLLEXPORT bwlzh_compress(unsigned int *vals, int nvals,
+ unsigned char *output, int *output_len);
+
+void DECLSPECDLLEXPORT bwlzh_compress_no_lz77(unsigned int *vals, int nvals,
+ unsigned char *output, int *output_len);
+
+int DECLSPECDLLEXPORT bwlzh_get_buflen(int nvals);
+
+void DECLSPECDLLEXPORT bwlzh_decompress(unsigned char *input, int nvals,
+ unsigned int *vals);
+
+
+/* The routines below are mostly useful for testing, and for internal
+ use by the library. */
+
+void DECLSPECDLLEXPORT bwlzh_compress_verbose(unsigned int *vals, int nvals,
+ unsigned char *output, int *output_len);
+
+void DECLSPECDLLEXPORT bwlzh_compress_no_lz77_verbose(unsigned int *vals, int nvals,
+ unsigned char *output, int *output_len);
+
+void DECLSPECDLLEXPORT bwlzh_decompress_verbose(unsigned char *input, int nvals,
+ unsigned int *vals);
+
+/* Compress the integers (positive, small integers are preferable)
+ using huffman coding, with automatic selection of how to handle the
+ huffman dictionary. The unsigned char *huffman should be allocated
+ to be able to hold worst case. You can obtain this length
+ conveniently by calling comp_huff_buflen()
+*/
+void Ptngc_comp_huff_compress(unsigned int *vals, int nvals,
+ unsigned char *huffman, int *huffman_len);
+
+int Ptngc_comp_huff_buflen(int nvals);
+
+void Ptngc_comp_huff_decompress(unsigned char *huffman, int huffman_len,
+ unsigned int *vals);
+
+
+/* the value pointed to by chosen_algo should be
+ sent as -1 for autodetect. */
+void Ptngc_comp_huff_compress_verbose(unsigned int *vals, int nvals,
+ unsigned char *huffman, int *huffman_len,
+ int *huffdatalen,
+ int *huffman_lengths,int *chosen_algo,
+ int isvals16);
+
+#define N_HUFFMAN_ALGO 3
+char *Ptngc_comp_get_huff_algo_name(int algo);
+char *Ptngc_comp_get_algo_name(int algo);
+
+
+#endif
contact: Jan Huwald // Impressum