diff options
Diffstat (limited to 'src/lzsshuffman/lzsshuffmanencoder.nim')
-rw-r--r-- | src/lzsshuffman/lzsshuffmanencoder.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lzsshuffman/lzsshuffmanencoder.nim b/src/lzsshuffman/lzsshuffmanencoder.nim index ea89f85..205f464 100644 --- a/src/lzsshuffman/lzsshuffmanencoder.nim +++ b/src/lzsshuffman/lzsshuffmanencoder.nim | |||
@@ -14,9 +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 lists | ||
18 | import ../bitio/bitwriter | 17 | import ../bitio/bitwriter |
19 | import ../lzss/listpolyfill, ../lzss/lzssnode, ../lzss/lzsschain, ../lzss/lzssencoder | 18 | import ../lzss/lzssnode, ../lzss/lzsschain, ../lzss/lzssencoder |
20 | import ../huffman/huffmantree, ../huffman/huffmantreebuilder, ../huffman/huffmanencoder | 19 | import ../huffman/huffmantree, ../huffman/huffmantreebuilder, ../huffman/huffmanencoder |
21 | import lzsshuffmansymbol | 20 | import lzsshuffmansymbol |
22 | 21 | ||
@@ -24,7 +23,7 @@ proc writeSymbol(bitWriter: BitWriter, encodedSymbol: tuple[bitLength: int, valu | |||
24 | bitWriter.writeBits(encodedSymbol.bitLength, encodedSymbol.value) | 23 | bitWriter.writeBits(encodedSymbol.bitLength, encodedSymbol.value) |
25 | 24 | ||
26 | proc writeChain*(lzssChain: LzssChain, symbolEncoder, positionEncoder: HuffmanEncoder[uint16, uint16], bitWriter: BitWriter) = | 25 | proc writeChain*(lzssChain: LzssChain, symbolEncoder, positionEncoder: HuffmanEncoder[uint16, uint16], bitWriter: BitWriter) = |
27 | for node in lzssChain.items: | 26 | for node in lzssChain: |
28 | case node.kind: | 27 | case node.kind: |
29 | of character: | 28 | of character: |
30 | bitWriter.writeSymbol(symbolEncoder.encode(node.character)) | 29 | bitWriter.writeSymbol(symbolEncoder.encode(node.character)) |