Jeffrey Bush
73ce174b24
Additional checks in Xpress Dictionary Fill and Add. Should fix #20 .
2015-09-28 03:34:01 -07:00
Jeffrey Bush
4fca365f4c
Allow null input/output buffers if available is 0, fixing #19 .
2015-09-28 03:25:57 -07:00
Jeffrey Bush
8ba2fb0949
Possible fix to #17 .
...
Because the inflate methods return MSCOMP_STREAM_END or MSCOMP_POSSIBLE_STREAM_END instead of MSCOMP_OK when they are at a stopping point, MSCOMP_OK actually becomes an error message (that gets translated to MSCOMP_BUF_ERROR). A similar method was already in use for ALL_AT_ONCE_WRAPPER_COMPRESS.
2015-09-15 23:31:44 -07:00
Jeffrey Bush
90829b848d
Fixed whitespace.
2015-09-15 23:01:24 -07:00
Jeffrey Bush
e22df7d307
Added a buffer offerflow check fixing #18 .
2015-09-15 22:50:33 -07:00
coderforlife
78101d2eba
Improved byte-order detection and usage.
2015-09-11 12:01:17 -07:00
coderforlife
254f814428
Fixed problem with general header compling in regular C.
2015-09-11 12:00:35 -07:00
coderforlife
a179b8d46c
Removed one of the restricted pointers that caused GCC pre-4.9.2 to fail to compile.
2015-05-28 19:09:18 -07:00
Jeffrey Bush
39f51004b8
Added restrict to many pointers in LZNT1. Does not seem to have helped or hurt performance with GCC so leaving them in. May try to add them to other algorithms eventually.
2015-05-25 16:32:25 -07:00
Jeffrey Bush
73af8f022c
Fixed problems with non-unaligned access methods that produced the wrong byte order and updated Xpress Huffman compression to be able to use non-unaligned accesses.
2015-04-17 16:24:02 -07:00
Jeffrey Bush
3ab0ab7c9f
Minor update.
2015-04-17 15:20:05 -07:00
Jeffrey Bush
837a292aec
Added a new compile time configuration option MSCOMP_WITHOUT_UNALIGNED_ACCESS that makes it so there are no unaligned accesses to work on #15 . This is not yet complete - Xpress Huffman compression still has many unaligned accesses.
2015-04-17 15:14:13 -07:00
Jeffrey Bush
1cfac269a8
Finally fixed #4 . The problem is that on Windows the stack is 4-byte aligned and GCC assumes (for some optimizations) 16-byte alignment. A GCC stack alignment fix was added to functions that needed it.
...
Also increased XPRESS Huffman max compressed size which helps #14 .
2015-03-19 20:52:50 -07:00
Jeffrey Bush
1095f73d1e
Addressed some bugs with XPRESS Huffman compression of uncompromisable data and decompression of invalid data. This partially helps #14 .
2015-03-18 14:25:54 -07:00
Jeffrey Bush
66e93e7581
Fixing some warnings with gcc -Wextra -pedantic -Wuninitialized. The remaining warnings are mostly about variadic macros.
2015-03-18 12:56:44 -07:00
Jeffrey Bush
941fbb4860
Minor changes.
2015-03-18 12:02:06 -07:00
Jeffrey Bush
ce1d61cf62
Forgot to commit sorting.h when re-adding package-merge algorithm. Fixes #12 .
2015-03-18 11:47:21 -07:00
Jeffrey Bush
e877ca5554
Corrected XPRESS Huffman compression to max size and added checks to make sure it always stays under the max size. In addition many other changes were made for improved performance.
2015-03-17 22:39:05 -07:00
Jeffrey Bush
14d766a224
The SSE copy method was actually incorrect (more needed to be copied initially and the input needed to be shifted back). Once these were fixed it was slower than the original fast copy so it was removed.
2015-03-17 22:35:41 -07:00
Jeffrey Bush
dce8c3ac6a
Played around with SSE optimizations like prefetch and 128-bit copies. I couldn't get prefetching to really help during decompression but 128-bit copies helped in XPRESS (Huffman) decompression.
2015-03-16 15:11:55 -07:00
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