Releases: lsleonard/tiny-data-compression
v1.1.6: Random data check added
- Modified random data check and added a later check for random data.
- Added an early call to single value mode.
- Updated unused extended string mode to calculate high bit clear during processing and check for overflow as late as possible.
v1.1.5: Add adaptive text mode
- Added adaptive text mode that looks for occurrences of characters
that are common to a particular data type when fewer than 3/4 of
the input values are matched by a predefined character. Defined
XML and HTML based on '<', '>', '/' and '"'. Defined C or other
code files based on '*', '=', ';' and '\t'. Eight characters
common to the text type are defined in the last 8 characters of
the characters encoded. - Added compression of high bit in unique characters in string mode
when the high bit is 0 for all values. - Set the initial loop in td64 to 7/16 of input values for 24 or
more inputs. This provides a better result for adaptive text mode.
v1.1.4: Add bit text mode
- Added bit text mode that uses variable length encoding bits
to maximize compression. td5 still uses the fixed bit text mode. - Changed the random data metric to use number values init
loop * 7/8 + 1 to be threshold for random data. - Implemented a static global for decoding bit text mode and
string mode to limit reads of input values.
v1.1.3: Fix bugs in td5 and td5d
- Fixed bugs in td5 and td5d functions.
- Recognize random data starting at 16 input values.
v1.1.2: Updates related to using 7-bit mode
- Moved 7-bit mode defines to td64.h because they are used
outside of the 7-bit mode. - When fewer than minimum values to use 7-bit mode of 16, don't
accumulate high bit when reasonable. Main loop keeps this in because
time required is minimal. - When fewer than 24 input values, but greater than or equal to minimum
values of 16 to use 7-bit mode, use 6% as minimum compression for
compression modes used prior to 7-bit mode.
v1.1.1
Initial release of tiny data compression as td512: High-speed lossless tiny data compression of 1 to 512 bytes.
Main program reads a file into memory that is compressed by calling td512 repeatedly. When complete, the compressed data is written to a file and read for decompression by calling td512d. td512 is based on the td64 interface, also included in this release, that compresses 1 to 64 bytes.
td512 filename [loopCount]]
filename is required argument 1.
loopCount is optional argument 2 (default: 1). Looping is performed over the entire input file.
The release includes the interface td64 that integrates several compression modes to compress 1 to 64 bytes: fixed bit, text mode, single value, string mode, and 7-bit encoding and decoding. td64 returns the number of compressed bytes or 0 if compression failed or a negative value if an error occurred. Values are returned only if compression succeeds. Decoding of the td64 values requires the caller to supply the number of original bytes.