Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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).
Expand Down Expand Up @@ -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!
```

---
Expand Down Expand Up @@ -94,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
Expand All @@ -114,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
Expand Down
39 changes: 23 additions & 16 deletions README_cn.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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,解压缩时指定)。
提示:字典越小压缩率越低,而缓冲区较小时只影响解压缩速度。
Expand Down Expand Up @@ -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;多线程需要占用较多的内存。
```

---
Expand Down Expand Up @@ -91,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
Expand All @@ -111,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%

---
## 联系
Expand Down
2 changes: 1 addition & 1 deletion compress/tuz_enc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
68 changes: 24 additions & 44 deletions compress/tuz_enc_private/tuz_enc_match.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// tuz_enc_match.cpp
// tuz_enc_match.cpp
/*
The MIT License (MIT)
Copyright (c) 2012-2022 HouSisong All Rights Reserved.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -117,7 +117,7 @@ namespace _tuz_private{
if ((matchCountLimit--)<=0) break;
++it_right;
}
if (dict_pos<=maxDictPos)
if ((kShortPos<dict_pos)&&(dict_pos<=maxDictPos))
_MatchedAt(false,dict_pos);
}
}
Expand Down Expand Up @@ -148,43 +148,23 @@ void TMatch::_getCostByMatch(const tuz_byte* cur0,std::vector<TUInt>& cost){
}
}



#define _MatchedAtBy_byLiteralLen(isSamePos){ \
const size_t saveDictCost=coder.getSavedDictPosBit<isSamePos>(dict_pos,isHaveData); \
const size_t curSaveCost=cost[curi-1]+saveDictCost; \
assert(curSaveCost<kNullCostValue); \
const size_t dictCost=curSaveCost+coder.getSavedDictLenBit<isSamePos>(match_len,dict_pos); \
const size_t ni=curi+match_len-1; \
const size_t cost_ni=cost[ni]; \
if (dictCost<cost_ni){ \
cost[ni]=(TUInt)dictCost; \
matchLen[ni]=(TLCPInt)match_len; \
dictPos[ni]=(TPosInt)dict_pos; \
} }
void TMatch::_cost_match_byLiteralLen(const size_t match_len,const size_t dict_pos,
const size_t curi,std::vector<TUInt>& 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<TUInt>& 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<costSize){
size_t mlen=matchLen[i];
if (mlen==0){
++unmatched_len;
}else{
++i;
continue;
}

{//next match is same pos?
const size_t curPos=dictPos[i];
size_t nextPos=curPos-1; //not same
size_t j=i+mlen;
Expand All @@ -196,24 +176,24 @@ void TMatch::_getCostByLiteralLen(std::vector<TUInt>& 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]){
const size_t unmatched_len=i-unmatched_first+1;
size_t curSaveDataCost=cost[unmatched_first-1]+coder.getSavedDataBit(unmatched_len);
if (curSaveDataCost+best_win_cost<cost[i]){
for (size_t j=unmatched_fill0_i+1;j<=i;++j)
matchLen[j]=0;
unmatched_fill0_i=i;
}else 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;
}
Expand Down
2 changes: 0 additions & 2 deletions compress/tuz_enc_private/tuz_enc_match.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ namespace _tuz_private{
void _initCost(std::vector<TUInt>& cost,size_t costSize);
void _getCost(const tuz_byte* cur0);
void _getCostByMatch(const tuz_byte* cur0,std::vector<TUInt>& cost);
void _cost_match_byLiteralLen(const size_t match_len,const size_t dict_pos,
const size_t curi,std::vector<TUInt>& cost);
void _getCostByLiteralLen(std::vector<TUInt>& cost);
};

Expand Down
2 changes: 1 addition & 1 deletion compress/tuz_enc_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions decompress/tuz_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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){
Expand Down
3 changes: 2 additions & 1 deletion decompress/tuz_dec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion decompress/tuz_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading