em_inflate.c

Fast, small, in-memory inflate (zlib, deflate and gzip decompression)
git clone git://git.finwo.net/lib/em_inflate.c
Log | Files | Refs | README | LICENSE

commit 375c3317ce0fa917802ff160a4379cbe2bc6f84e
parent bab8fb95236819ed80c442657bb79141ae85d74b
Author: Emmanuel Marty <emmanuel@fgl.com>
Date:   Wed, 29 May 2019 17:29:59 +0200

Add README and LICENSE
Diffstat:
ALICENSE | 19+++++++++++++++++++
AREADME.md | 31+++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2019 Emmanuel Marty + +This software is provided 'as-is', without any express or implied warranty. In +no event will the authors be held liable for any damages arising from the use of +this software. + +Permission is granted to anyone to use this software for any purpose, including +commercial applications, and to alter it and redistribute it freely, subject to +the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/README.md b/README.md @@ -0,0 +1,31 @@ +em_inflate -- Fast, in-memory, single file decompressor for gzip and zlib +========================================================================= + +em_inflate is a one-file, single function call, memory-to-memory decompressor for the gzip and zlib bitstream formats: + +[RFC 1950]https://www.ietf.org/rfc/rfc1950.txt +[RFC 1952]https://www.ietf.org/rfc/rfc1952.txt + +You just need to add em_inflate.c and em_inflate.h to your project and call em_inflate() to decompress some data. + +em_inflate is less than 1,200 lines of C (including 300 lines of two different flavors of checksums), and decompresses faster than zlib. + +enwik8 decompression (gzip bitstream, 100,000,000 bytes compressed to 36,445,248 with gzip -9): + Decompressor Time (microseconds), core i7 + zlib inflate 1.2.11 426,167 (100%) + em_inflate (verify checksum) 358,118 (84%) + em_inflate (skip checksum) 275,847 (64%) + +large raw texture decompression (zlib bitstream, 32,212,992 bytes compressed to 13,721,537 with gzip -9): + Decompressor Time (microseconds), core i7 + zlib inflate 1.2.11 127,945 (100%) + em_inflate (verify checksum) 114,369 (89%) + em_inflate (skip checksum) 105,476 (82%) + +Code size (linux x86_64, clang 6.0.0 -O3, most of the rodata is checksum tables) + With checksums 10,334 (code) + 4,624 (rodata) 14,958 + Without checksums 8,510 (code) + 518 (rodata) 9,028 + +em_inflate is developed by Emmanuel Marty. gzip crc32 checksum by Stephen Brumme. adler checksum computation by Mark Adler. All code is licensed +under the zlib license, with the gzip crc32 code under a zlib-like license. All mentions are included in the sourcecode. +