From 804aac375c6b0ab5d526c52c1330117956f32bbc Mon Sep 17 00:00:00 2001 From: sisong Date: Mon, 30 Mar 2026 07:34:46 +0800 Subject: [PATCH 1/5] update some notes; small recode dec; --- README.md | 19 +++++++++++++------ README_cn.md | 23 +++++++++++++++-------- compress/tuz_enc.cpp | 2 +- compress/tuz_enc_types.h | 2 +- decompress/tuz_dec.c | 7 +++++-- decompress/tuz_dec.h | 3 ++- tinyuz_demo.cpp | 19 ++++++++++++++++--- 7 files changed, 53 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b6c2335..87aa1ff 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **tinyuz** is a lossless compression algorithm, designed for embedded systems,MCU, NB-IoT, etc., with better compression ratios. Which is characterized by a very small decompress code(ROM or flash occupancy); -The stream decompresser compiled by Mbed Studio is 626 bytes(can define to 468 bytes), +The stream decompresser compiled by Mbed Studio is 626 bytes(can define to 506 bytes), and the memory decompresser is 424 bytes(can define to 298 bytes). At the same time, the stream decompress memory(RAM occupancy) can also be very small, RAM size = dictionary size(>=1Byte, specified when compress) + cache size(>=2Byte, specified when decompress). @@ -55,16 +55,23 @@ build `tinyuz/builds/vc/tinyuz.sln` with [`Visual Studio`](https://visualstudio. ## command line usage: ``` compress : tinyuz -c[-dictSize] inputFile outputFile +compress ci: tinyuz -ci[-dictSize] inputFile outputFile deccompress: tinyuz -d[-cacheSize] inputFile outputFile + Note: -c is default compressor; + But if your compile deccompressor source code, set tuz_isNeedLiteralLine=0, + then must used -ci compressor. options: - -c[-dictSize] + -dictSize set compress dictSize; - dictSize>=1, DEFAULT -c-16m, recommended: 127, 4k, 1m, 512m, etc... - requires O(dictSize*18) bytes of memory; - -d[-cacheSize] + 1g>=dictSize>=1, DEFAULT -c-1m, recommended: 127, 4k, 16m, 256m, etc... + compress requires O(dictSize*18*parallelThreadNumber) bytes of memory; + -cacheSize set decompress cacheSize; cacheSize>=2, DEFAULT -d-256k, recommended: 64, 1k, 32k, 4m, etc... - requires (dictSize+cacheSize) bytes of memory; + decompress requires (dictSize+cacheSize) bytes of memory; + -p-parallelThreadNumber + if parallelThreadNumber>1 then open multi-thread Parallel compress mode; + DEFAULT -p-4; multi-thread requires more memory! ``` --- diff --git a/README_cn.md b/README_cn.md index 11b5084..356a979 100644 --- a/README_cn.md +++ b/README_cn.md @@ -8,8 +8,8 @@ **tinyuz** 是一个无损压缩算法,为超小型嵌入式设备(MCU、NB-IoT等)设计,保持还不错的压缩率。 特色是编译后的解压缩代码(ROM或flash占用)非常的小; -流模式解压用 Mbed Studio 编译后为 626 字节(可以调整宏定义后可以到 468 字节); -而内存模式解压为 424 字节(可以调整宏定义后可以到 298 字节)。 +流模式解压用 Mbed Studio 编译后为 626 字节(可以调整宏定义后到 506 字节); +而内存模式解压为 424 字节(可以调整宏定义后到 298 字节)。 (其他解压器用 Mbed Studio 编译后大小参考: [zlib] v1.3.1 流模式解压 约大于10k; [lzma] v22.01 流模式解压 约6k; [miniLZO] v2.10 内存模式解压为 868 字节(非安全模式 628 字节)。) 同时,流模式解压时内存(RAM占用)也可以非常的小,RAM大小= 字典大小(>=1Byte,压缩时指定) + 缓冲区大小(>=2Byte,解压缩时指定)。 提示:字典越小压缩率越低,而缓冲区较小时只影响解压缩速度。 @@ -51,17 +51,24 @@ $ git clone https://github.com/sisong/HDiffPatch.git HDiffPatch --- ## 命令行使用: ``` -压缩 : tinyuz -c[-dictSize] inputFile outputFile + 压缩: tinyuz -c[-dictSize] inputFile outputFile +ci压缩: tinyuz -ci[-dictSize] inputFile outputFile 解压缩: tinyuz -d[-cacheSize] inputFile outputFile + 注意:-c 是默认压缩器; + 但是如果你编译了解压缩器的源代码,并设置 tuz_isNeedLiteralLine=0, + 那么必须使用 -ci 压缩器。 选项说明: - -c[-dictSize] + -dictSize 设置压缩时使用的字典大小; - dictSize>=1, 默认 -c-16m, 推荐: 127、4k、1m、512m 等... - 运行时需要内存约 (dictSize*18) 字节; - -d[-cacheSize] + 1g>=dictSize>=1, 默认 -c-1m, 推荐: 127、4k、16m、256m 等... + 压缩运行时需要内存约 (dictSize*18*parallelThreadNumber) 字节; + -cacheSize 设置解压时使用的缓冲区大小; cacheSize>=2, 默认 -d-256k, 推荐: 64、1k、32k、4m 等... - 运行时需要内存 (dictSize+cacheSize) 字节; + 解压缩运行时需要内存 (dictSize+cacheSize) 字节; + -p-parallelThreadNumber + 设置线程数 parallelThreadNumber>1 时,开启多线程并行压缩模式; + 默认为-p-4;多线程需要占用较多的内存。 ``` --- diff --git a/compress/tuz_enc.cpp b/compress/tuz_enc.cpp index a223b53..5f1aa9c 100644 --- a/compress/tuz_enc.cpp +++ b/compress/tuz_enc.cpp @@ -9,7 +9,7 @@ #include "../../HDiffPatch/libParallel/parallel_channel.h" using namespace _tuz_private; -#define tuz_kDefaultDictSize (1<<24) +#define tuz_kDefaultDictSize (1<<20) const tuz_TCompressProps tuz_kDefaultCompressProps={tuz_kDefaultDictSize,tuz_kMaxOfMaxSaveLength,1, tuz_isNeedLiteralLine?true:false}; diff --git a/compress/tuz_enc_types.h b/compress/tuz_enc_types.h index 8254c95..79d9703 100644 --- a/compress/tuz_enc_types.h +++ b/compress/tuz_enc_types.h @@ -14,7 +14,7 @@ extern "C" { typedef struct tuz_TCompressProps{ //memory requires for decompress: kCodeCacheSize + dictSize - size_t dictSize; // >=1 & <=16m-1; default 64k-1; 220,255,1k,4k,64k-1,1m,... + size_t dictSize; // >=1 & <=1g; default 1m; 220,255,1k,4k,64k-1,16m,... size_t maxSaveLength; // >=127 & <64k; default 64k-1; 1023,16k-1 ... size_t threadNum; // default 1; bool isNeedLiteralLine;// default true; diff --git a/decompress/tuz_dec.c b/decompress/tuz_dec.c index 32ed962..073b32f 100644 --- a/decompress/tuz_dec.c +++ b/decompress/tuz_dec.c @@ -135,8 +135,11 @@ tuz_size_t tuz_TStream_read_dict_size(tuz_TInputStreamHandle inputStream,tuz_TIn tuz_TResult tuz_TStream_open(tuz_TStream* self,tuz_TInputStreamHandle inputStream,tuz_TInputStream_read read_code, tuz_byte* dict_and_cache,tuz_size_t dict_size,tuz_size_t cache_size){ assert((read_code!=0)&&(dict_and_cache!=0)); + assert((dict_size>0)&&(cache_size>0)); +#ifdef __RUN_MEM_SAFE_CHECK if (dict_size==0) return tuz_READ_DICT_SIZE_ERROR; if (cache_size==0) return tuz_CACHE_SIZE_ERROR; +#endif self->_code_cache.cache_begin=cache_size; self->_code_cache.cache_end=cache_size; self->_code_cache.cache_buf=dict_and_cache+dict_size; @@ -221,7 +224,7 @@ tuz_TResult tuz_TStream_decompress_partial(tuz_TStream* self,tuz_byte* cur_out_d saved_dict_pos=self->_state.dict_pos_back; }else{ saved_dict_pos=_cache_unpack_dict_pos(self); - if (saved_dict_pos>tuz_kBigPosForLen) ++saved_len; + saved_len+=(saved_dict_pos>tuz_kBigPosForLen)?1:0; } self->_state.isHaveData_back=tuz_FALSE; @@ -362,7 +365,7 @@ tuz_TResult tuz_decompress_mem(tuz_pbyte_r in_code,tuz_size_t code_size,tuz_pbyt saved_dict_pos=dict_pos_back; }else{ _mem_unpack_dict_pos(saved_dict_pos); - if (saved_dict_pos>tuz_kBigPosForLen) ++saved_len; + saved_len+=(saved_dict_pos>tuz_kBigPosForLen)?1:0; } isHaveData_back=tuz_FALSE; if (saved_dict_pos){ diff --git a/decompress/tuz_dec.h b/decompress/tuz_dec.h index ddc3e6f..b3c34e3 100644 --- a/decompress/tuz_dec.h +++ b/decompress/tuz_dec.h @@ -29,7 +29,7 @@ typedef enum tuz_TResult{ //----------------------------------------------------------------------------------------------------------------- // decompress step by step: compiled by Mbed Studio is 626 bytes -// if set tuz_isNeedLiteralLine=0 & _IS_RUN_MEM_SAFE_CHECK=0, compiled by Mbed Studio is 468 bytes +// if set tuz_isNeedLiteralLine=0 & _IS_RUN_MEM_SAFE_CHECK=0, compiled by Mbed Studio is 506 bytes (+ _IS_USED_SHARE_hpatch_lite_types=1 to 454 bytes) typedef struct tuz_TStream{ _tuz_TInputCache _code_cache; @@ -38,6 +38,7 @@ typedef struct tuz_TStream{ } tuz_TStream; //read dict_size from inputStream +//if error return 0 tuz_size_t tuz_TStream_read_dict_size(tuz_TInputStreamHandle inputStream,tuz_TInputStream_read read_code); //open tuz_TStream diff --git a/tinyuz_demo.cpp b/tinyuz_demo.cpp index c01f97d..345941a 100644 --- a/tinyuz_demo.cpp +++ b/tinyuz_demo.cpp @@ -43,12 +43,25 @@ static void printVersion(){ printf("tinyuz v" TINYUZ_VERSION_STRING "\n"); } static void printHelpInfo(){ - printf("compress : tinyuz -c[-dictSize[k|m]] inputFile outputFile\n" - "compress ci: tinyuz -ci[-dictSize[k|m]] inputFile outputFile\n" - "deccompress: tinyuz -d[-cacheSize[k|m]] inputFile outputFile\n" + printf("compress : tinyuz -c[-dictSize] inputFile outputFile\n" + "compress ci: tinyuz -ci[-dictSize] inputFile outputFile\n" + "deccompress: tinyuz -d[-cacheSize] inputFile outputFile\n" " Note: -c is default compressor;\n" " But if your compile deccompressor source code, set tuz_isNeedLiteralLine=0,\n" " then must used -ci compressor.\n" + "options:\n" + " -dictSize\n" + " set compress dictSize;\n" + " 1g>=dictSize>=1, DEFAULT -c-1m, recommended: 127, 4k, 16m, 256m, etc...\n" + " compress requires O(dictSize*18" +#if (_IS_USED_MULTITHREAD) + "*parallelThreadNumber" +#endif + ") bytes of memory;\n" + " -cacheSize\n" + " set decompress cacheSize;\n" + " cacheSize>=2, DEFAULT -d-256k, recommended: 64, 1k, 32k, 4m, etc...\n" + " decompress requires (dictSize+cacheSize) bytes of memory;\n" #if (_IS_USED_MULTITHREAD) " -p-parallelThreadNumber\n" " if parallelThreadNumber>1 then open multi-thread Parallel compress mode;\n" From 9e60c50410f03c1344f3d7f192f1eed56d263687 Mon Sep 17 00:00:00 2001 From: sisong Date: Sat, 9 May 2026 16:46:43 +0800 Subject: [PATCH 2/5] delete not used func _cost_match_byLiteralLen(); --- compress/tuz_enc_private/tuz_enc_match.cpp | 26 ---------------------- compress/tuz_enc_private/tuz_enc_match.h | 2 -- decompress/tuz_dec.c | 2 +- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/compress/tuz_enc_private/tuz_enc_match.cpp b/compress/tuz_enc_private/tuz_enc_match.cpp index 3765c6a..144a34d 100644 --- a/compress/tuz_enc_private/tuz_enc_match.cpp +++ b/compress/tuz_enc_private/tuz_enc_match.cpp @@ -148,32 +148,6 @@ void TMatch::_getCostByMatch(const tuz_byte* cur0,std::vector& cost){ } } - - - #define _MatchedAtBy_byLiteralLen(isSamePos){ \ - const size_t saveDictCost=coder.getSavedDictPosBit(dict_pos,isHaveData); \ - const size_t curSaveCost=cost[curi-1]+saveDictCost; \ - assert(curSaveCost(match_len,dict_pos); \ - const size_t ni=curi+match_len-1; \ - const size_t cost_ni=cost[ni]; \ - if (dictCost& cost){ - const size_t back_pos=dictPos[curi-1]; - const size_t isHaveData=((matchLen[curi-1]==0)&&(curi>1))?1:0; - - if (isHaveData&&(back_pos==dict_pos)){ //same pos match - _MatchedAtBy_byLiteralLen(true); - }else{ - _MatchedAtBy_byLiteralLen(false); - } - } - void TMatch::_getCostByLiteralLen(std::vector& cost){ size_t costSize=cost.size(); size_t unmatched_len=0; diff --git a/compress/tuz_enc_private/tuz_enc_match.h b/compress/tuz_enc_private/tuz_enc_match.h index 76618f3..1cd5c43 100644 --- a/compress/tuz_enc_private/tuz_enc_match.h +++ b/compress/tuz_enc_private/tuz_enc_match.h @@ -37,8 +37,6 @@ namespace _tuz_private{ void _initCost(std::vector& cost,size_t costSize); void _getCost(const tuz_byte* cur0); void _getCostByMatch(const tuz_byte* cur0,std::vector& cost); - void _cost_match_byLiteralLen(const size_t match_len,const size_t dict_pos, - const size_t curi,std::vector& cost); void _getCostByLiteralLen(std::vector& cost); }; diff --git a/decompress/tuz_dec.c b/decompress/tuz_dec.c index 073b32f..d8b7f8e 100644 --- a/decompress/tuz_dec.c +++ b/decompress/tuz_dec.c @@ -26,7 +26,7 @@ #if (_IS_USED_SHARE_hpatch_lite_types) # define _cache_success_finish _hpi_cache_success_finish -# define _cache_update _hpi__cache_update +//# define _cache_update _hpi_cache_update # define _cache_read_1byte _hpi_cache_read_1byte #else From e7deb228c07f705ee5f470b1a92efec696eb62bf Mon Sep 17 00:00:00 2001 From: sisong Date: Sun, 10 May 2026 14:39:46 +0800 Subject: [PATCH 3/5] fix cost estimation of long literals --- compress/tuz_enc_private/tuz_enc_match.cpp | 34 +++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/compress/tuz_enc_private/tuz_enc_match.cpp b/compress/tuz_enc_private/tuz_enc_match.cpp index 144a34d..abb2680 100644 --- a/compress/tuz_enc_private/tuz_enc_match.cpp +++ b/compress/tuz_enc_private/tuz_enc_match.cpp @@ -1,4 +1,4 @@ - // tuz_enc_match.cpp +// tuz_enc_match.cpp /* The MIT License (MIT) Copyright (c) 2012-2022 HouSisong All Rights Reserved. @@ -149,16 +149,22 @@ void TMatch::_getCostByMatch(const tuz_byte* cur0,std::vector& cost){ } void TMatch::_getCostByLiteralLen(std::vector& cost){ + //NOTE: current implementation does not search the optimal encoding path; + // moreover, even if the optimal goal is to be achieved, it is recommended to handle it together in the _getCostByMatch(). size_t costSize=cost.size(); - size_t unmatched_len=0; + size_t unmatched_first=1; size_t unmatched_fill0_i=0; + size_t best_win_cost=0; - size_t i=1; + size_t i=unmatched_first; while (i& cost){ ++j; } if (curPos==nextPos){ - size_t nexti=j; - unmatched_len+=nexti-i; - i=nexti; + i=j; continue; //next } - unmatched_len+=mlen; - i+=mlen-1; + i=i+mlen-1; } - size_t curSaveDataCost=cost[i-unmatched_len]+coder.getSavedDataBit(unmatched_len); - if (curSaveDataCost=cost[i]+tuz_kMinLiteralLen){ - unmatched_len=0; + best_win_cost=cost[i]-curSaveDataCost; + }else if (curSaveDataCost+best_win_cost>=cost[i]+tuz_kMinLiteralLen){ + unmatched_first=i+1; unmatched_fill0_i=i; + best_win_cost=0; } ++i; } From d34bba5473523643524fee3b66e9a258a258c123 Mon Sep 17 00:00:00 2001 From: sisong Date: Sun, 10 May 2026 15:40:01 +0800 Subject: [PATCH 4/5] slightly optimize compress speed by skip shorpos; --- compress/tuz_enc_private/tuz_enc_match.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compress/tuz_enc_private/tuz_enc_match.cpp b/compress/tuz_enc_private/tuz_enc_match.cpp index abb2680..2b0923b 100644 --- a/compress/tuz_enc_private/tuz_enc_match.cpp +++ b/compress/tuz_enc_private/tuz_enc_match.cpp @@ -54,10 +54,10 @@ namespace _tuz_private{ size_t maxDictPos=props.dictSize-1; if (maxDictPos>=(size_t)curString) maxDictPos=curString-1; + #define _kShortPosForLen (((1<<7)-1)-1) + //#define _kShortPosForLen (((1<<11)-1)-1) // better(0.2%) but slower(30%) + const TInt kShortPos=(TInt)((maxDictPos>=_kShortPosForLen)?_kShortPosForLen:maxDictPos); {// short pos match - #define _kShortPosForLen (((1<<7)-1)-1) - //#define _kShortPosForLen (((1<<9)-1)-1) // better(0.2%) but slower(30%) - const TInt kShortPos=(TInt)((maxDictPos>=_kShortPosForLen)?_kShortPosForLen:maxDictPos); for (TInt dict_pos=kShortPos;dict_pos>=0;dict_pos--){ TInt matchedString=curString-(dict_pos+1); TInt curMinLcp=_sstr_eqLen(sstring.src_end,props.maxSaveLength, @@ -117,7 +117,7 @@ namespace _tuz_private{ if ((matchCountLimit--)<=0) break; ++it_right; } - if (dict_pos<=maxDictPos) + if ((kShortPos Date: Sun, 10 May 2026 15:40:25 +0800 Subject: [PATCH 5/5] update version; --- README.md | 16 ++++++++-------- README_cn.md | 16 ++++++++-------- decompress/tuz_types.h | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 87aa1ff..7ac5884 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # [tinyuz] -[![release](https://img.shields.io/badge/release-v1.1.0-blue.svg)](https://github.com/sisong/tinyuz/releases) +[![release](https://img.shields.io/badge/release-v1.1.1-blue.svg)](https://github.com/sisong/tinyuz/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/tinyuz/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/tinyuz/pulls) [![+issue Welcome](https://img.shields.io/github/issues-raw/sisong/tinyuz?color=green&label=%2Bissue%20welcome)](https://github.com/sisong/tinyuz/issues) @@ -101,7 +101,7 @@ tuz_TResult tuz_decompress_mem(const tuz_byte* in_code,tuz_size_t code_size,tuz_ --- ## test compression ratio: ratio: compressedSize/uncompressedSize -[tinyuz] v1.1.0: test with multiple different dictSize 1MB,32KB,4KB,1KB,255B +[tinyuz] v1.1.1: test with multiple different dictSize 1MB,32KB,4KB,1KB,255B ('tuz -32k' means: tinyuz -c-32k) [zlib] v1.3.1 test with compress level 9, windowBits -15(i.e. dictSize 32KB) [QuickLZ] v1.5.0 test compress with default setting QLZ_COMPRESSION_LEVEL=3, QLZ_STREAMING_BUFFER=1048576 @@ -121,17 +121,17 @@ ratio: compressedSize/uncompressedSize aMCU.bin|45.80%|45.98%|49.64%|54.29%|60.61%|46.54%|54.49%|57.87%|56.11%|58.52%|62.21%|61.33% aMCU.bin.diff|5.75%|5.75%|5.99%|6.35%|6.89%|5.29%|9.52%|18.91%|16.78%|9.26%|12.50%|14.21% A10.jpg|99.99%|99.99%|99.99%|99.99%|99.99%|99.88%|100.00%|107.79%|108.27%|112.16%|102.91%|100.38% -AcroRd32.exe|42.12%|43.80%|46.99%|51.48%|58.29%|44.88%|52.07%|55.86%|54.17%|56.15%|61.22%|61.44% +AcroRd32.exe|42.11%|43.79%|46.98%|51.45%|58.27%|44.88%|52.07%|55.86%|54.17%|56.15%|61.22%|61.44% english.dic|28.65%|29.20%|30.10%|31.25%|33.49%|25.83%|35.50%|39.81%|36.64%|36.82%|40.86%|43.82% -FlashMX.pdf|85.34%|85.81%|87.46%|88.31%|89.90%|84.76%|100.00%|92.92%|93.40%|96.60%|89.57%|91.73% +FlashMX.pdf|83.14%|84.26%|85.97%|87.07%|89.20%|84.76%|100.00%|92.92%|93.40%|96.60%|89.57%|91.73% FP.LOG|5.26%|7.36%|10.34%|12.67%|19.27%|6.46%|8.59%|20.95%|21.51%|14.12%|11.97%|13.01% -MSO97.DLL|54.12%|56.96%|60.23%|64.38%|70.62%|57.94%|65.65%|67.75%|65.78%|70.49%|74.80%|75.57% -ohs.doc|21.03%|24.50%|27.14%|31.08%|37.50%|24.05%|25.72%|38.34%|38.15%|33.51%|28.31%|30.41% +MSO97.DLL|54.06%|56.91%|60.17%|64.31%|70.60%|57.94%|65.65%|67.75%|65.78%|70.49%|74.80%|75.57% +ohs.doc|20.88%|24.38%|26.98%|30.90%|37.29%|24.05%|25.72%|38.34%|38.15%|33.51%|28.31%|30.41% rafale.bmp|30.40%|32.66%|35.80%|40.81%|43.52%|30.23%|42.06%|37.38%|39.72%|40.30%|52.63%|55.41% vcfiu.hlp|17.79%|20.39%|24.51%|27.46%|32.39%|20.41%|24.88%|32.77%|33.87%|30.42%|32.36%|34.10% -world95.txt|23.44%|30.79%|48.07%|54.96%|65.23%|28.87%|35.17%|38.18%|51.30%|54.32%|52.04%|51.56% +world95.txt|23.44%|30.79%|48.07%|54.96%|65.22%|28.87%|35.17%|38.18%|51.30%|54.32%|52.04%|51.56% enwik8|33.22%|38.36%|44.81%|51.53%|63.38%|36.45%|44.79%|44.48%|48.04%|50.41%|54.52%|55.79% -silesia.tar|29.66%|33.27%|38.99%|44.45%|52.58%|31.98%|38.60%|42.77%|45.09%|44.27%|47.25%|47.50% +silesia.tar|29.60%|33.22%|38.93%|44.41%|52.57%|31.98%|38.60%|42.77%|45.09%|44.27%|47.25%|47.50% --- ## Contact diff --git a/README_cn.md b/README_cn.md index 356a979..8d41e80 100644 --- a/README_cn.md +++ b/README_cn.md @@ -1,5 +1,5 @@ # [tinyuz] -[![release](https://img.shields.io/badge/release-v1.1.0-blue.svg)](https://github.com/sisong/tinyuz/releases) +[![release](https://img.shields.io/badge/release-v1.1.1-blue.svg)](https://github.com/sisong/tinyuz/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/tinyuz/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/tinyuz/pulls) [![+issue Welcome](https://img.shields.io/github/issues-raw/sisong/tinyuz?color=green&label=%2Bissue%20welcome)](https://github.com/sisong/tinyuz/issues) @@ -98,7 +98,7 @@ tuz_TResult tuz_decompress_mem(const tuz_byte* in_code,tuz_size_t code_size,tuz_ --- ## 压缩率测试: 压缩率: 压缩后大小/压缩前大小 -[tinyuz] v1.1.0 测试时字典大小分别设置为 1MB,32KB,4KB,1KB,255B +[tinyuz] v1.1.1 测试时字典大小分别设置为 1MB,32KB,4KB,1KB,255B (表中'tuz -32k' 表示: tinyuz -c-32k) [zlib] v1.3.1 测试时设置压缩水平为9, 窗口比特大小设置为-15(即字典大小32KB) [QuickLZ] v1.5.0 测试时使用默认设置QLZ_COMPRESSION_LEVEL=3, QLZ_STREAMING_BUFFER=1048576 @@ -118,17 +118,17 @@ tuz_TResult tuz_decompress_mem(const tuz_byte* in_code,tuz_size_t code_size,tuz_ aMCU.bin|45.80%|45.98%|49.64%|54.29%|60.61%|46.54%|54.49%|57.87%|56.11%|58.52%|62.21%|61.33% aMCU.bin.diff|5.75%|5.75%|5.99%|6.35%|6.89%|5.29%|9.52%|18.91%|16.78%|9.26%|12.50%|14.21% A10.jpg|99.99%|99.99%|99.99%|99.99%|99.99%|99.88%|100.00%|107.79%|108.27%|112.16%|102.91%|100.38% -AcroRd32.exe|42.12%|43.80%|46.99%|51.48%|58.29%|44.88%|52.07%|55.86%|54.17%|56.15%|61.22%|61.44% +AcroRd32.exe|42.11%|43.79%|46.98%|51.45%|58.27%|44.88%|52.07%|55.86%|54.17%|56.15%|61.22%|61.44% english.dic|28.65%|29.20%|30.10%|31.25%|33.49%|25.83%|35.50%|39.81%|36.64%|36.82%|40.86%|43.82% -FlashMX.pdf|85.34%|85.81%|87.46%|88.31%|89.90%|84.76%|100.00%|92.92%|93.40%|96.60%|89.57%|91.73% +FlashMX.pdf|83.14%|84.26%|85.97%|87.07%|89.20%|84.76%|100.00%|92.92%|93.40%|96.60%|89.57%|91.73% FP.LOG|5.26%|7.36%|10.34%|12.67%|19.27%|6.46%|8.59%|20.95%|21.51%|14.12%|11.97%|13.01% -MSO97.DLL|54.12%|56.96%|60.23%|64.38%|70.62%|57.94%|65.65%|67.75%|65.78%|70.49%|74.80%|75.57% -ohs.doc|21.03%|24.50%|27.14%|31.08%|37.50%|24.05%|25.72%|38.34%|38.15%|33.51%|28.31%|30.41% +MSO97.DLL|54.06%|56.91%|60.17%|64.31%|70.60%|57.94%|65.65%|67.75%|65.78%|70.49%|74.80%|75.57% +ohs.doc|20.88%|24.38%|26.98%|30.90%|37.29%|24.05%|25.72%|38.34%|38.15%|33.51%|28.31%|30.41% rafale.bmp|30.40%|32.66%|35.80%|40.81%|43.52%|30.23%|42.06%|37.38%|39.72%|40.30%|52.63%|55.41% vcfiu.hlp|17.79%|20.39%|24.51%|27.46%|32.39%|20.41%|24.88%|32.77%|33.87%|30.42%|32.36%|34.10% -world95.txt|23.44%|30.79%|48.07%|54.96%|65.23%|28.87%|35.17%|38.18%|51.30%|54.32%|52.04%|51.56% +world95.txt|23.44%|30.79%|48.07%|54.96%|65.22%|28.87%|35.17%|38.18%|51.30%|54.32%|52.04%|51.56% enwik8|33.22%|38.36%|44.81%|51.53%|63.38%|36.45%|44.79%|44.48%|48.04%|50.41%|54.52%|55.79% -silesia.tar|29.66%|33.27%|38.99%|44.45%|52.58%|31.98%|38.60%|42.77%|45.09%|44.27%|47.25%|47.50% +silesia.tar|29.60%|33.22%|38.93%|44.41%|52.57%|31.98%|38.60%|42.77%|45.09%|44.27%|47.25%|47.50% --- ## 联系 diff --git a/decompress/tuz_types.h b/decompress/tuz_types.h index 31902cc..e070b90 100644 --- a/decompress/tuz_types.h +++ b/decompress/tuz_types.h @@ -36,7 +36,7 @@ extern "C" { #define TINYUZ_VERSION_MAJOR 1 #define TINYUZ_VERSION_MINOR 1 -#define TINYUZ_VERSION_RELEASE 0 +#define TINYUZ_VERSION_RELEASE 1 #define _TINYUZ_VERSION TINYUZ_VERSION_MAJOR.TINYUZ_VERSION_MINOR.TINYUZ_VERSION_RELEASE #define _TINYUZ_QUOTE(str) #str