diff options
author | pacien | 2018-11-30 17:08:01 +0100 |
---|---|---|
committer | pacien | 2018-11-30 17:08:01 +0100 |
commit | e88f60b63cb05f56a61060a953c726b7a78c0652 (patch) | |
tree | f7ee9b401ae92e7eb3fe8d9e352e20da3d2e9243 /src | |
parent | 8af38da097b8358cb273baa37c748120461c718e (diff) | |
download | gziplike-e88f60b63cb05f56a61060a953c726b7a78c0652.tar.gz |
isolate huffman encoding module
Diffstat (limited to 'src')
-rw-r--r-- | src/huffman/huffmandecoder.nim (renamed from src/huffmandecoder.nim) | 3 | ||||
-rw-r--r-- | src/huffman/huffmanencoder.nim (renamed from src/huffmanencoder.nim) | 3 | ||||
-rw-r--r-- | src/huffman/huffmantree.nim (renamed from src/huffmantree.nim) | 2 | ||||
-rw-r--r-- | src/huffman/huffmantreebuilder.nim (renamed from src/huffmantreebuilder.nim) | 2 | ||||
-rw-r--r-- | src/lzsschain.nim | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/src/huffmandecoder.nim b/src/huffman/huffmandecoder.nim index 5cf4ca5..9a58b55 100644 --- a/src/huffmandecoder.nim +++ b/src/huffman/huffmandecoder.nim | |||
@@ -14,7 +14,8 @@ | |||
14 | # You should have received a copy of the GNU Affero General Public License | 14 | # You should have received a copy of the GNU Affero General Public License |
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | import huffmantree, bitio/bitreader | 17 | import ../bitio/bitreader |
18 | import huffmantree | ||
18 | 19 | ||
19 | type HuffmanDecoder*[T: SomeUnsignedInt] = object | 20 | type HuffmanDecoder*[T: SomeUnsignedInt] = object |
20 | tree: HuffmanTreeNode[T] | 21 | tree: HuffmanTreeNode[T] |
diff --git a/src/huffmanencoder.nim b/src/huffman/huffmanencoder.nim index 05ed64f..3ed41ec 100644 --- a/src/huffmanencoder.nim +++ b/src/huffman/huffmanencoder.nim | |||
@@ -15,7 +15,8 @@ | |||
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | import tables | 17 | import tables |
18 | import integers, huffmantree, bitio/bitwriter | 18 | import ../integers, ../bitio/bitwriter |
19 | import huffmantree | ||
19 | 20 | ||
20 | type HuffmanEncoder*[T, U: SomeUnsignedInt] = object | 21 | type HuffmanEncoder*[T, U: SomeUnsignedInt] = object |
21 | codebook: TableRef[T, U] | 22 | codebook: TableRef[T, U] |
diff --git a/src/huffmantree.nim b/src/huffman/huffmantree.nim index 6208ecf..1140694 100644 --- a/src/huffmantree.nim +++ b/src/huffman/huffmantree.nim | |||
@@ -15,7 +15,7 @@ | |||
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | import tables, heapqueue | 17 | import tables, heapqueue |
18 | import integers, bitio/bitreader, bitio/bitwriter | 18 | import ../integers, ../bitio/bitreader, ../bitio/bitwriter |
19 | 19 | ||
20 | const valueLengthFieldBitLength* = 6 # 64 | 20 | const valueLengthFieldBitLength* = 6 # 64 |
21 | 21 | ||
diff --git a/src/huffmantreebuilder.nim b/src/huffman/huffmantreebuilder.nim index 5b33d34..4169099 100644 --- a/src/huffmantreebuilder.nim +++ b/src/huffman/huffmantreebuilder.nim | |||
@@ -15,7 +15,7 @@ | |||
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | import tables, heapqueue | 17 | import tables, heapqueue |
18 | import huffmantree, lzssencoder | 18 | import huffmantree |
19 | 19 | ||
20 | type WeighedHuffmanTreeNode[T] = ref object | 20 | type WeighedHuffmanTreeNode[T] = ref object |
21 | weight: int | 21 | weight: int |
diff --git a/src/lzsschain.nim b/src/lzsschain.nim index 073aa5e..44200f2 100644 --- a/src/lzsschain.nim +++ b/src/lzsschain.nim | |||
@@ -15,7 +15,7 @@ | |||
15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <https://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | import lists, tables, sugar | 17 | import lists, tables, sugar |
18 | import polyfill, integers, lzssnode, huffmantree | 18 | import polyfill, integers, lzssnode, huffman/huffmantree |
19 | 19 | ||
20 | const maxChainByteLength = 32_000 * wordBitLength | 20 | const maxChainByteLength = 32_000 * wordBitLength |
21 | 21 | ||