Commit Graph

12 Commits

Author SHA1 Message Date
Timofey Solomko 70411024d1 Slightly updated bitSize function of EncodingHuffmanTree 2017-09-03 23:20:22 +03:00
Timofey Solomko cebf0555e5 Make HuffmanLength Comparable and use this in their sorting in HuffmanTree 2017-09-03 20:04:44 +03:00
Timofey Solomko f96f446827 More elegant solution for zero code lengths problem 2017-09-03 19:59:46 +03:00
Timofey Solomko 69fa9a2646 Remove unused inits from HuffmanTrees 2017-09-03 14:18:23 +03:00
Timofey Solomko 49228a049f Fix HuffmanTree init crash when zero codeLength is encountered 2017-09-03 14:16:59 +03:00
Timofey Solomko 5d19120b63 Add inits from new HuffmanLengths to HuffmanTrees 2017-09-03 14:00:26 +03:00
Timofey Solomko 6e9248fcd5 Remove try and throws where possible
This is because of the replacement of symbolNotFound throws with fatalErrors in compression related functions.
2017-09-02 23:24:55 +03:00
Timofey Solomko 8b6b9b9478 Add bitSize function to EncodingHuffmanTree
This function calculates expected size (in bits) of data based on data's stats.
2017-09-02 23:01:01 +03:00
Timofey Solomko cc77cfaad6 Use fatalError instead of symbolNotFound error throw in EncodingHuffmanTree
It is a programming error if symbol is not found during encoding, thus, we should use fatalError.
2017-09-02 20:07:19 +03:00
Timofey Solomko cb54a5fa02 Use tuples in inits of huffman trees 2017-09-02 20:03:21 +03:00
Timofey Solomko 12da128ddd Change EncodingHuffmanTree API to be more consistent with decoding tree and cleanup usage 2017-08-29 00:10:04 +03:00
Timofey Solomko 9827e32bdd Extract code for huffman encoding into separate class 2017-08-29 00:01:03 +03:00