51 Commits
Author SHA1 Message Date
Timofey Solomko 5e0a174fb6 Uncompressed block now added to out a little bit more efficient. 2016-12-09 11:29:36 +03:00
Timofey Solomko 78fd83dda2 Adopted removal of alignedBytes() in other code. 2016-12-09 01:08:49 +03:00
Timofey Solomko 4c310b9ce8 Removed remains of huffmantable. 2016-12-05 19:47:25 +03:00
Timofey Solomko c02c40fdb0 United two cycles through lengths array. Thus, there is no need for symbol property in HuffmanLength. Also added dots to the end of comments. 2016-12-04 22:25:19 +03:00
Timofey Solomko c09d108e30 tree property of HuffmanTree now stores only codes. findNextSymbol now returns Int instead of HuffmanLengths. 2016-12-04 19:58:41 +03:00
Timofey Solomko 892b2c9ccc HuffmanTable renamed to HuffmanTree. Its properties are now private. 2016-12-04 19:49:53 +03:00
Timofey Solomko 0b839f4d2f Additionally simplified usage of findNextSymbol. 2016-12-04 19:28:57 +03:00
Timofey Solomko fd8786a080 Made changes so bzip2 now also works. 2016-12-04 19:25:28 +03:00
Timofey Solomko ecc626abf5 Simplified findNextSymbol usage and added a new way of finding a symbol (with tree) for .reversed bitOrders. 2016-12-04 15:55:34 +03:00
Timofey Solomko 4ae8dad3d4 Another attempt of tree creation. Note that first leafs in a tree a nils. 2016-12-04 13:29:36 +03:00
Timofey Solomko 206f3148ec The real job is now done only with data with pointer objects so there is no need for startPoint property of serviceInfos. 2016-11-26 15:40:40 +03:00
Timofey Solomko 2ae6a7b252 Added new way to read bytes and used it in deflate uncompressed blocks. 2016-11-21 20:17:27 +03:00
Timofey Solomko d795e208e3 Increased performance of deflate when compressed file had a lot of repeated bytes. 2016-11-19 18:29:42 +03:00
Timofey Solomko 845a32575d Added more extension functions for integer type conversions. 2016-11-19 13:47:02 +03:00
Timofey Solomko 748d3590c6 During decoding only uint8 arrays are now used for storing intermediate results (no Data — no memory problems). 2016-11-16 20:12:37 +03:00
Timofey Solomko 615e8a1ff4 Added new enum for specifying bit order. United DataWithPointer and DataWithStraightPointer. 2016-11-15 22:32:36 +03:00
Timofey Solomko 4bc6fb22d7 Added new convenience function to DataWithPointer which returns int number directly without conversion of uint8 array. 2016-11-13 19:30:36 +03:00
Timofey Solomko 74913015cf Comment change in deflate. 2016-11-12 19:16:49 +03:00
Timofey Solomko f6c8829f14 Added a lot of comments. 2016-11-12 12:33:02 +03:00
Timofey Solomko 8c6ba843d0 Usage reversedUInt8 convert functions replaced with straight counterparts because now we get bits in reversed order. 2016-11-05 12:02:28 +03:00
Timofey Solomko 6bf72804d0 Deflate is rewritten with the use of DataWithPointer and new findNextSymbol function. 2016-11-05 00:29:46 +03:00
Timofey Solomko 24ca09f9c3 ExtraLength and extraDistance calculations are now done inside decompress function. 2016-11-01 23:49:26 +03:00
Timofey Solomko 2fcadd29f6 In Deflate.decompress Data object is used now instead of string for storing results. 2016-10-31 19:18:26 +03:00
Timofey Solomko 773c32dd44 Sometimes two bytes are not enough for finding next symbol. 2016-10-31 00:43:12 +03:00
Timofey Solomko 8f7418719f Since shift+extraDistance could be greater than 16, it could cause errors. This was fixed. 2016-10-31 00:02:20 +03:00
Timofey Solomko 385bd2fbfc Fixed incorrect calculation of mainLiterals table in case of dynamic Huffman coding. 2016-10-31 00:01:29 +03:00
Timofey Solomko 32f90ab62c Added documentation comments. 2016-10-30 16:29:42 +03:00
Timofey Solomko 5c00605852 convertToInt/convertToUInt8 functions' argument renamed to reversedUint8Array. 2016-10-30 14:45:12 +03:00
Timofey Solomko edfd49e3bf Fixed copyright notice. 2016-10-29 22:32:01 +03:00
Timofey Solomko bcaa85e0e8 Gzip related code moved into separate file; added two protocols; extended serviceInfo structure. 2016-10-29 22:27:11 +03:00
Timofey Solomko e557cce7ed Swiftlinted. 2016-10-29 21:24:40 +03:00
Timofey Solomko 3981159f7e Fixed a few swift warnings. 2016-10-29 21:17:20 +03:00
Timofey Solomko be43928774 bits function of Data extension now checks if start is the same as the end. 2016-10-29 17:55:47 +03:00
Timofey Solomko 7bab0020ff Fixed a problem with repeated strings in data. 2016-10-29 17:46:46 +03:00
Timofey Solomko 6d435e7a5e findNextSymbol now returns shift and this calculation is now correct and used everywhere. 2016-10-28 21:04:16 +03:00
Timofey Solomko c7a66d58ea Apparently, I've missed extraDistanceBits array and was reading a value from wrong array. This was fixed. 2016-10-28 21:02:31 +03:00
Timofey Solomko cdb3384740 Completed implementation of Deflate. 2016-10-28 20:00:34 +03:00
Timofey Solomko 4fff569544 Implemented dynamic coding. 2016-10-27 19:35:48 +03:00
Timofey Solomko 9f9ad78eab Added extensions, findNextSymbol; HuffmanLength moved to a separate file. 2016-10-26 21:03:19 +03:00
Timofey Solomko c06d34fb23 Data type actually has built-in subscripts, so home-made subscripts were replaced by them. 2016-10-25 23:25:35 +03:00
Timofey Solomko 78c53e6d06 Cleanuped code. 2016-10-25 23:07:13 +03:00
Timofey Solomko 47e42c4334 Added a lot of comments and rewrote some bad code. 2016-10-24 23:22:36 +03:00
Timofey Solomko cc26d2ff4c Added code for processing static Huffman block. 2016-10-24 21:31:12 +03:00
Timofey Solomko 0a4b6a3474 Fixed problem with recognizing block type. 2016-10-24 21:30:51 +03:00
Timofey Solomko a0500b84c3 Actually, if you read specifications carefully you will find out that the remaining bits should be dropped. 2016-10-24 20:31:18 +03:00
Timofey Solomko 987a3608c2 Now while-loop actually breaks. 2016-10-24 20:23:50 +03:00
Timofey Solomko 1c7ff6150b Moved UInt8 and Data extensions to a combined file. Added function to "combine" two bytes into one. 2016-10-24 20:23:26 +03:00
Timofey Solomko 1bc2c46936 Added code to process uncompressed blocks. 2016-10-24 20:21:38 +03:00
Timofey Solomko 24a1ae2ac6 Some progress was made on reading information from archive. 2016-10-24 00:22:58 +03:00
Timofey Solomko 51025f1f2d Added useful UInt8 extensions. 2016-10-24 00:21:08 +03:00