richgel999 / lzham_alpha

This is LZHAM Alpha8, now supplanted by LZHAM 1.x here: https://github.com/richgel999/lzham_codec
MIT License
3 stars 2 forks source link

LZHAM Lossless Data Compression Codec - Alpha8 - March 6, 2012 Copyright (c) 2009-2012 Richard Geldreich, Jr. richgel99@gmail.com MIT License

Note: This is the old alpha version of the LZHAM codec, exported from Google Code. The latest v1.x release is located on GitHub here: https://github.com/richgel999/lzham_codec

lzhamtest_x86/x64 is a simple command line test program that uses the LZHAM codec DLL to compress/decompress single files.

-- Usage examples:

-- Options

Valid dictionary sizes are [15,26] for x86, and [15,29] for x64. (See LZHAM_MIN_DICT_SIZE_LOG2, etc. defines in include/lzham.h.) The x86 version defaults to 64MB (26), and the x64 version defaults to 256MB (28). I wouldn't recommend setting the dictionary size to 512MB unless your machine has more than 4GB of physical memory.

See lzhamtest_x86/x64.exe's help text for more command line parameters.

-- Compiling LZHAM

I've successfully used cbp2mak to create makefiles from the lzham .cbp files: http://bblean.berlios.de/cbp2mak-0.2.zip

The Codeblocks workspace is "lzhamtest.workspace". The codec runs a bit slower when compiled with GCC, but the difference is less than 5%.

Visual Studio 2008 solution is "lzham.sln". The codec seems to compile and run fine with Visual Studio 2010 in my limited testing.

The codec compiles for Xbox 360 as well: lzham_x360.sln. Note that I barely spent any time verifying the codec on this platform. I made sure Alpha5 compiles for Xbox 360 but has not been retested in a while. I plan on throughly testing the codec on Xbox 360 when time permits.

LZHAM also supports plain vanilla ANSI C/C++. To see how the codec configures itself check out lzham_core.h and search for "LZHAM_ANSI_CPLUSPLUS". All platform specific stuff (unaligned loads, threading, atomic ops, etc.) should be disabled when this macro is defined. Note, the compressor doesn't use threads or atomic operations when built this way so it's going to be pretty slow. (The compressor was built from the ground up to be threaded.)

-- Known Problems

I've only compiled/tested LZHAM using the x64 version of TDM-GCC. Even though the Codeblocks project contains both x86 and x64 projects, I've had a few problems compiling LZHAM using the 32-bit (only) version of TDM-GCC. This will be fixed in the next alpha release.