Coder Social home page Coder Social logo

flandreunx / minilzo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rt-thread-packages/minilzo

0.0 2.0 0.0 116 KB

A mini subset of the LZO real-time data compression library

License: GNU General Public License v2.0

Python 0.07% C 65.44% C++ 34.49%

minilzo's Introduction

miniLZO

1、介绍

LZO 是一个实时数据压缩库, miniLZO 是 LZO 压缩库的精简版本。 他能够提供非常快速的压缩和解压功能, 解压并不需要内存的支持。 这个 miniLZO 库是 RT-thread 针对官方 miniLZO 的C库的移植, 有关 miniLZO 的更多信息,请参阅 http://www.oberhumer.com/opensource/lzo/

2、获取方式

  • 使用 menuconfig
  RT-Thread online packages --->
      miscellaneous packages --->
          [*] miniLZO: A mini subset of the LZO real-time data compression library

3、示例介绍

3.1 获取示例

  • 配置使能示例选项 Enable using miniLZO sample
  • 配置包版本选为最新版 latest_version

3.2 运行示例

该示例为一个简单的文件压缩和解压的例程,需要依赖文件系统,用到的命令有两个 -c-d-c 命令压缩一个文件到另一个文件,-d 命令解压一个文件到另一个文件。
使用方式:
msh cmd 压缩: minilzo_test -c /file.bin /file.cmprs.bin
msh cmd 解压: minilzo_test -d /file.cmprs.bin /file_dcmprs.bin

msh />minilzo_test -c /file.bin /file.cmprs.bin
[minilzo]compress start : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[minilzo]compressed 469848 bytes into 363495 bytes , compression ratio is 77%!
msh />
msh />minilzo_test -d /file.cmprs.bin /file_dcmprs.bin
[minilzo]decompress start : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[minilzo]decompressed 363495 bytes into 469848 bytes !

4、注意事项

4.1 与官方源码差异

miniLZO 源码中定义了一个 LZO1X_1_MEM_COMPRESS 大小的压缩内存,占用内存 65536 字节,资源占用高,修改为最小 8192L * lzo_sizeof_dict_t 字节,占用内存 32768 字节。

对源码 minilzo.h 进行如下变动,移植官方代码的时候需要注意:

  1. 修改 LZO1X_1_MEM_COMPRESS 大小
#define LZO1X_1_MEM_COMPRESS    ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))

替换为

#define LZO1X_1_MEM_COMPRESS    ((lzo_uint32_t) (8192L * lzo_sizeof_dict_t))

5、参考资料

minilzo's People

Contributors

armink avatar bernardxiong avatar lawlieta avatar murphyzhao avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.