Repositories: SCAD
Main | Log | Branches | Tags | Bugs | Wiki | Login

SCAD (Simple Compression and Decompression) is a really simple compression and decompression pair of functions loosely derived from LZ77 with the main focus being simplicity of the implementation, especially the decoder which is around 26 lines of C code.

Both the encoder and the decorer are available as single C functions that can be copy/pasted in a project. Note that the encoder uses a very slow brute force algorithm which can take several minutes - up to hours - for even a few MBs, so you may want to optimize/parallelize it a bit for anything that isn't meant to be preprocesser over night. Also note that the decoder (nor the encoder or any other included test) makes any tests for failure or bad data - if you care about those, modify the code to add them. For my use cases, these tests aren't necessary.

Other pages:

As the code is so small, consider it released under the Public Domain. If your country does not accept PD, then consider it released under the following license (commonly known as the zlib license):

Copyright (c) 2018 Kostas Michalopoulos

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.

   © 2009‑2017 Kostas Michalopoulos