diff options
Diffstat (limited to 'doc/api-documentation/html/lzsscomprs_8h-source.html')
-rw-r--r-- | doc/api-documentation/html/lzsscomprs_8h-source.html | 163 |
1 files changed, 83 insertions, 80 deletions
diff --git a/doc/api-documentation/html/lzsscomprs_8h-source.html b/doc/api-documentation/html/lzsscomprs_8h-source.html index 0fe73f6..a0c35c4 100644 --- a/doc/api-documentation/html/lzsscomprs_8h-source.html +++ b/doc/api-documentation/html/lzsscomprs_8h-source.html @@ -3,91 +3,94 @@ <title>lzsscomprs.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> -<!-- Generated by Doxygen 1.2.15 --> +<!-- Generated by Doxygen 1.2.17 --> <center> -<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center> -<hr><h1>lzsscomprs.h</h1><div class="fragment"><pre>00001 <font class="comment">/******************************************************************************</font> -00002 <font class="comment"> * lzsscomprs.h - definition of Class SWCompress used for data compression</font> -00003 <font class="comment"> *</font> -00004 <font class="comment"> * $Id: lzsscomprs_8h-source.html,v 1.7 2002/06/20 20:23:09 mgruner Exp $</font> -00005 <font class="comment"> *</font> -00006 <font class="comment"> * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)</font> -00007 <font class="comment"> * CrossWire Bible Society</font> -00008 <font class="comment"> * P. O. Box 2528</font> -00009 <font class="comment"> * Tempe, AZ 85280-2528</font> -00010 <font class="comment"> *</font> -00011 <font class="comment"> * This program is free software; you can redistribute it and/or modify it</font> -00012 <font class="comment"> * under the terms of the GNU General Public License as published by the</font> -00013 <font class="comment"> * Free Software Foundation version 2.</font> -00014 <font class="comment"> *</font> -00015 <font class="comment"> * This program is distributed in the hope that it will be useful, but</font> -00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> -00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> -00018 <font class="comment"> * General Public License for more details.</font> -00019 <font class="comment"> *</font> -00020 <font class="comment"> */</font> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> </center> +<hr><h1>lzsscomprs.h</h1><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span> +00002 <span class="comment"> * lzsscomprs.h - definition of Class SWCompress used for data compression</span> +00003 <span class="comment"> *</span> +00004 <span class="comment"> * $Id: lzsscomprs_8h-source.html,v 1.9 2002/10/31 11:30:15 joachim Exp $</span> +00005 <span class="comment"> *</span> +00006 <span class="comment"> * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)</span> +00007 <span class="comment"> * CrossWire Bible Society</span> +00008 <span class="comment"> * P. O. Box 2528</span> +00009 <span class="comment"> * Tempe, AZ 85280-2528</span> +00010 <span class="comment"> *</span> +00011 <span class="comment"> * This program is free software; you can redistribute it and/or modify it</span> +00012 <span class="comment"> * under the terms of the GNU General Public License as published by the</span> +00013 <span class="comment"> * Free Software Foundation version 2.</span> +00014 <span class="comment"> *</span> +00015 <span class="comment"> * This program is distributed in the hope that it will be useful, but</span> +00016 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span> +00017 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> +00018 <span class="comment"> * General Public License for more details.</span> +00019 <span class="comment"> *</span> +00020 <span class="comment"> */</span> 00021 -00022 <font class="preprocessor">#ifndef LZSSCOMPRS_H</font> -00023 <font class="preprocessor"></font><font class="preprocessor">#define LZSSCOMPRS_H</font> -00024 <font class="preprocessor"></font> -00025 <font class="preprocessor">#include <swcomprs.h></font> +00022 <span class="preprocessor">#ifndef LZSSCOMPRS_H</span> +00023 <span class="preprocessor"></span><span class="preprocessor">#define LZSSCOMPRS_H</span> +00024 <span class="preprocessor"></span> +00025 <span class="preprocessor">#include <swcomprs.h></span> 00026 -00027 <font class="preprocessor">#include <defs.h></font> +00027 <span class="preprocessor">#include <defs.h></span> 00028 -00029 <font class="comment">// The following are constant sizes used by the compression algorithm.</font> -00030 <font class="comment">//</font> -00031 <font class="comment">// N - This is the size of the ring buffer. It is set</font> -00032 <font class="comment">// to 4K. It is important to note that a position</font> -00033 <font class="comment">// within the ring buffer requires 12 bits. </font> -00034 <font class="comment">//</font> -00035 <font class="comment">// F - This is the maximum length of a character sequence</font> -00036 <font class="comment">// that can be taken from the ring buffer. It is set</font> -00037 <font class="comment">// to 18. Note that a length must be 3 before it is</font> -00038 <font class="comment">// worthwhile to store a position/length pair, so the</font> -00039 <font class="comment">// length can be encoded in only 4 bits. Or, put yet</font> -00040 <font class="comment">// another way, it is not necessary to encode a length</font> -00041 <font class="comment">// of 0-18, it is necessary to encode a length of</font> -00042 <font class="comment">// 3-18, which requires 4 bits.</font> -00043 <font class="comment">// </font> -00044 <font class="comment">// THRESHOLD - It takes 2 bytes to store an offset and</font> -00045 <font class="comment">// a length. If a character sequence only</font> -00046 <font class="comment">// requires 1 or 2 characters to store </font> -00047 <font class="comment">// uncompressed, then it is better to store</font> -00048 <font class="comment">// it uncompressed than as an offset into</font> -00049 <font class="comment">// the ring buffer.</font> -00050 <font class="comment">//</font> -00051 <font class="comment">// Note that the 12 bits used to store the position and the 4 bits</font> -00052 <font class="comment">// used to store the length equal a total of 16 bits, or 2 bytes.</font> -00053 -00054 <font class="preprocessor">#define N 4096</font> -00055 <font class="preprocessor"></font><font class="preprocessor">#define F 18</font> -00056 <font class="preprocessor"></font><font class="preprocessor">#define THRESHOLD 3</font> -00057 <font class="preprocessor"></font><font class="preprocessor">#define NOT_USED N</font> -00058 <font class="preprocessor"></font> -00059 -00060 -00061 <font class="keyword">class </font>SWDLLEXPORT LZSSCompress:<font class="keyword">public</font> SWCompress -00062 { -00063 <font class="keyword">static</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> m_ring_buffer[N + F - 1]; -00064 <font class="keyword">static</font> <font class="keywordtype">short</font> <font class="keywordtype">int</font> m_match_position; -00065 <font class="keyword">static</font> <font class="keywordtype">short</font> <font class="keywordtype">int</font> m_match_length; -00066 <font class="keyword">static</font> <font class="keywordtype">short</font> <font class="keywordtype">int</font> m_lson[N + 1]; -00067 <font class="keyword">static</font> <font class="keywordtype">short</font> <font class="keywordtype">int</font> m_rson[N + 257]; -00068 <font class="keyword">static</font> <font class="keywordtype">short</font> <font class="keywordtype">int</font> m_dad[N + 1]; -00069 <font class="keywordtype">void</font> InitTree (); -00070 <font class="keywordtype">void</font> InsertNode (<font class="keywordtype">short</font> <font class="keywordtype">int</font> Pos); -00071 <font class="keywordtype">void</font> DeleteNode (<font class="keywordtype">short</font> <font class="keywordtype">int</font> Node); -00072 <font class="keyword">public</font>: -00073 LZSSCompress (); -00074 <font class="keyword">virtual</font> ~ LZSSCompress (); -00075 <font class="keyword">virtual</font> <font class="keywordtype">void</font> Encode (<font class="keywordtype">void</font>); -00076 <font class="keyword">virtual</font> <font class="keywordtype">void</font> Decode (<font class="keywordtype">void</font>); -00077 }; -00078 -00079 <font class="preprocessor">#endif</font> -</pre></div><hr><address align="right"><small>Generated on Thu Jun 20 22:12:59 2002 for The Sword Project by +00029 SWORD_NAMESPACE_START +00030 +00031 <span class="comment">// The following are constant sizes used by the compression algorithm.</span> +00032 <span class="comment">//</span> +00033 <span class="comment">// N - This is the size of the ring buffer. It is set</span> +00034 <span class="comment">// to 4K. It is important to note that a position</span> +00035 <span class="comment">// within the ring buffer requires 12 bits. </span> +00036 <span class="comment">//</span> +00037 <span class="comment">// F - This is the maximum length of a character sequence</span> +00038 <span class="comment">// that can be taken from the ring buffer. It is set</span> +00039 <span class="comment">// to 18. Note that a length must be 3 before it is</span> +00040 <span class="comment">// worthwhile to store a position/length pair, so the</span> +00041 <span class="comment">// length can be encoded in only 4 bits. Or, put yet</span> +00042 <span class="comment">// another way, it is not necessary to encode a length</span> +00043 <span class="comment">// of 0-18, it is necessary to encode a length of</span> +00044 <span class="comment">// 3-18, which requires 4 bits.</span> +00045 <span class="comment">// </span> +00046 <span class="comment">// THRESHOLD - It takes 2 bytes to store an offset and</span> +00047 <span class="comment">// a length. If a character sequence only</span> +00048 <span class="comment">// requires 1 or 2 characters to store </span> +00049 <span class="comment">// uncompressed, then it is better to store</span> +00050 <span class="comment">// it uncompressed than as an offset into</span> +00051 <span class="comment">// the ring buffer.</span> +00052 <span class="comment">//</span> +00053 <span class="comment">// Note that the 12 bits used to store the position and the 4 bits</span> +00054 <span class="comment">// used to store the length equal a total of 16 bits, or 2 bytes.</span> +00055 +00056 <span class="preprocessor">#define N 4096</span> +00057 <span class="preprocessor"></span><span class="preprocessor">#define F 18</span> +00058 <span class="preprocessor"></span><span class="preprocessor">#define THRESHOLD 3</span> +00059 <span class="preprocessor"></span><span class="preprocessor">#define NOT_USED N</span> +00060 <span class="preprocessor"></span> +00061 +00062 +00063 <span class="keyword">class </span>SWDLLEXPORT LZSSCompress:<span class="keyword">public</span> SWCompress +00064 { +00065 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> m_ring_buffer[N + F - 1]; +00066 <span class="keyword">static</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> m_match_position; +00067 <span class="keyword">static</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> m_match_length; +00068 <span class="keyword">static</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> m_lson[N + 1]; +00069 <span class="keyword">static</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> m_rson[N + 257]; +00070 <span class="keyword">static</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> m_dad[N + 1]; +00071 <span class="keywordtype">void</span> InitTree (); +00072 <span class="keywordtype">void</span> InsertNode (<span class="keywordtype">short</span> <span class="keywordtype">int</span> Pos); +00073 <span class="keywordtype">void</span> DeleteNode (<span class="keywordtype">short</span> <span class="keywordtype">int</span> Node); +00074 <span class="keyword">public</span>: +00075 LZSSCompress (); +00076 <span class="keyword">virtual</span> ~ LZSSCompress (); +00077 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Encode (<span class="keywordtype">void</span>); +00078 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Decode (<span class="keywordtype">void</span>); +00079 }; +00080 +00081 SWORD_NAMESPACE_END +00082 <span class="preprocessor">#endif</span> +</pre></div><hr><address style="align: right;"><small>Generated on Thu Oct 31 12:11:28 2002 for The Sword Project by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 -width=110 height=53></a>1.2.15 </small></address> +width=110 height=53></a>1.2.17 </small></address> </body> </html> |