Jeffrey Bush
fdc815abef
Removed old code from HuffmanDecoder
2015-03-16 14:59:02 -07:00
Jeffrey Bush
e99e328faf
Removing Peek_Not0 and updating Peek to work really fast for 0 and non-0. Few other minor Huffman decoder changes.
2015-03-13 18:34:09 -07:00
Jeffrey Bush
3b3e29ed69
Adding comment about bzip2 inspiration and removing sorting library.
2015-03-13 18:32:35 -07:00
Jeffrey Bush
7b7ed8cbf4
Completely changed the Huffman encoder to use an algorithm inspired by bzip2. This increases compression speed by more than 100%! That is its twice as fast! Downside is that compression ratio is slightly worse (but just barely: 32.792% to 32.853% or 167kb in 269MB). It also uses less stack (total 17kb).
2015-03-13 18:25:24 -07:00
Jeffrey Bush
345d9752b4
Improved the package-merge algorithm on the Huffman Encoder to use stack memory (its a lot of it - 519 kb now!). This improves its speed quite a bit (compression speed increases by 25%).
2015-03-13 18:20:07 -07:00
Jeffrey Bush
511e1215ae
More improvements to XPRESS Huffman decompression speed.
2015-03-13 00:43:59 -07:00
Jeffrey Bush
2f995338d1
Added xpress_huff_max_compressed_size function.
...
It is untested but logically makes sense. However, it may require catching really poorly compressed chunks (if the compressed data is larger than the uncompressed data, not counting the 256 byte Huffman data). I am unsure if this situation can ever occur though.
2015-03-12 22:47:45 -07:00
Jeffrey Bush
5308b1b2f8
Made FAST_COPY a little more compatible and fixed a new bug in XPRESS decompression.
2015-03-12 21:06:55 -07:00
Jeffrey Bush
b4264bb650
Improved the speed of the XPRESS Huffman decompressor, mainly by adding a fast decompression loop, along improving HuffmanDecoder and InputBitstream.
2015-03-12 20:43:14 -07:00
Jeffrey Bush
8efdeb1012
Updated comments in internal.h to describe undefined values from the intrinsic functions and many other things.
2015-03-12 20:41:55 -07:00
Jeffrey Bush
da4fd73e24
Updated comments slightly.
2015-03-12 17:57:06 -07:00
Jeffrey Bush
6fa0409de5
Generalized the fast-copy routine used by decompressors (along with fixing some length-checks). Also added ASSERT_ALWAYS which does both assert and ALWAYS on the given command.
2015-03-12 17:55:24 -07:00
Jeffrey Bush
bb8562fe8b
Made highbit/log2 function use compiler intrinsics if available. If not available it uses a slower method than before (but no static table).
2015-03-11 21:54:48 -07:00
Jeffrey Bush
f305590ff2
WindowsPos should always be inlined.
2015-03-11 20:01:45 -07:00
Jeffrey Bush
32a8ce209b
Found which loop was causing the access violation with GCC tree-vectorization and put it into the source so tree-vectorization is not disabled globally. Also improved Huffman encoder slightly, mainly by changing merge sort to use insertion sort when "small".
2015-03-11 20:01:04 -07:00
Jeffrey Bush
4fea9774b9
Fixed #10 .
2015-03-05 23:40:39 -08:00
Jeffrey Bush
b24b7b8bf4
Improved XpressDictionary to skip pathological cases (hoping to find a match after searching a bunch) and a new hash function. These were inspired by zlib.
2015-03-05 16:25:01 -08:00
Jeffrey Bush
84c3d91db6
Updated default LZNT1 dictionary to be simpler, match the API of the new SA LZNT1 dictionary (except returns indicating memory allocation problems), and even slightly faster. Updated comments.
2015-03-04 21:45:55 -08:00
Jeffrey Bush
4937a619b1
Fixed a bug with the generalized decompressor and expanded which warnings are ignored by uninit variable used.
2015-03-04 16:19:34 -08:00
Jeffrey Bush
549737a5ba
Updated some comments and some minor pieces of code.
2015-03-04 00:06:11 -08:00
Jeffrey Bush
7fa1790ab4
Made default LZNT1 dictionary the non-SA one.
2015-03-03 20:57:04 -08:00
Jeffrey Bush
7df6abf11a
Added a new dictionary for LZNT1. It is slower than the old one (which is still default) but uses significantly less memory and no dynamic allocations. It is still being worked on and may get "up to speed" one day.
2015-03-03 20:40:47 -08:00
Jeffrey Bush
8cd4d3bffc
Removed a temporary file.
2015-03-03 20:36:05 -08:00
Jeffrey Bush
dd1a5eaf9c
Added import for the always/never debugging.
2015-03-03 20:31:23 -08:00
Jeffrey Bush
b3381fb014
Fixed bugs with the new streamable interface (never returning STREAM_END) and the testing framework not setting the right flag along with various other small bug fixes and optimizations.
...
Also added detailed descriptions to mscomp.h about when the various return codes are used, etc.
Note: LZNT1 compression streaming is still bugged due to an experimental dictionary in development.
2015-03-03 17:41:17 -08:00
Jeffrey Bush
8c2b0a8c6b
Removed xxx_uncompressed_size functions (since they were not constant-time and basically did decompression without writing).
...
Removed finish argument from xxx_inflate as it is not used in frameworks like this and was only being used for error detection (which was moved to xxx_inflate_end).
Changed finish argument of xxx_deflate to flush, which supports MSCOMP_NO_FLUSH (equivilent to old finish=false), MSCOMP_FINISH (equivilent to old finish=true), and MSCOMP_FLUSH which will try to get all current read input into the output and not buffer it (similar to finishing except the stream is not terminated).
2015-02-12 17:01:30 -08:00
Jeffrey Bush
62e73cc836
Reorganized code some more to allow it to be easier to bundle into other libraries and fixed some includes.
2015-02-12 12:29:53 -08:00