aboutsummaryrefslogtreecommitdiff
path: root/src/lzsshuffman/lzsshuffmanencoder.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/lzsshuffman/lzsshuffmanencoder.nim')
-rw-r--r--src/lzsshuffman/lzsshuffmanencoder.nim5
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
17import lists
18import ../bitio/bitwriter 17import ../bitio/bitwriter
19import ../lzss/listpolyfill, ../lzss/lzssnode, ../lzss/lzsschain, ../lzss/lzssencoder 18import ../lzss/lzssnode, ../lzss/lzsschain, ../lzss/lzssencoder
20import ../huffman/huffmantree, ../huffman/huffmantreebuilder, ../huffman/huffmanencoder 19import ../huffman/huffmantree, ../huffman/huffmantreebuilder, ../huffman/huffmanencoder
21import lzsshuffmansymbol 20import 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
26proc writeChain*(lzssChain: LzssChain, symbolEncoder, positionEncoder: HuffmanEncoder[uint16, uint16], bitWriter: BitWriter) = 25proc 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))