ntcompress

Description

ntcompress is a tool that creates compressed data in a format that can be handled by the CX library.

Using the Library

Start Command

% ntcompress <-d8|d16|r|l|h4|h8|lex|lh|lrc> [-s] [-<t|T>[width]] [-H] [-A(4|8|16|32)] [-o outputFile]
<inputFile>
% ntcompress -x [-o outputFile] [-s] <inputFile>

Compresses and converts the input file designated by inputFile into a designated format. Run-length compression, LZ77 extended compression, Huffman compression, and difference filter conversion are all possible.

-s option: No messages will be displayed to indicate that compression was successful.

-H option: Because header information is added to the data before it is compressed, the data size will also be appended to the data following expansion.


-A option: Use this to pad the end of the output file with zeros so that the file size is in alignment to the number of bytes specified by the n argument.


-o option: Use this to specify the output file's file name. When nothing is designated, the output file is created with the name "(input filename console part)_(compression method).bin".

-t or -T option: Use this to create the output file as a C-format text file.
By adding (1 | 2 | 4) to the option, you can choose between the u8, u16, and u32 types. (The default is u8.)
If u16 or u32 is specified, the file is output as little-endian with the -t option or as big-endian with the -T option.

-x option: Use this to allow the compressed file to be expanded on a PC using ntcompress.

Format of Options for Designating the Compression Method

The following formats can be designated for the compression method:

Options Compression Method Parameters
-d Difference filtering. Specify the bit size of the comparison unit {8|16}.
-r Run-length compression. None.
-h Huffman compression. Specify the bit size to encode {4|8}.
-lex LZ77 extended compression (*1). None.
-l LZ77 compression (for backward compatibility). None.
-lh LH format (*2). None.
-lrc LRC format (*3). None.

(*1) You can expect a higher compression ratio with the LZ77 extended compression than with LZ77 compression, but the -l option is preserved for backward compatibility. Either format can be decompressed using the same CXUncompressLZ function; however keep in mind that programs using RVL-SDK 2.4 or earlier cannot expand files compressed in the LZ77 extended format.
The extra processing required for compression/decompression is nearly equal for the LZ extended (-lex) and backward compatible (-l) versions.

(*2) This format is a mix of LZ77 and Huffman compression. Although this depends on the data, you can expect a comparatively high compression ratio. Decompression speed is slower than that obtained with run-length, Huffman, or LZ77 compression. Run-time compression is not supported.

(*3) This format is a mix of LZ77 and RangeCoder compression. Although this depends on the data, you can expect a comparatively high compression ratio. Be aware that it has the slowest decompression speed. Run-time compression is not supported.

Location

$(REVOLUTION_SDK_ROOT)/X86/bin/ntcompress.exe

See Also

CXUncompressHuffman, CXUncompressRL, CXUncompressLZ, CXReacUncompHuffman, CXReadUncompRL, CXReadUncompLZ

Revision History

2007/11/01 LH and LRC formats.
2007/04/28 Added LZ77 extended compression.
2006/11/30 Added options for alignment specifications and decompression.
2006/07/06 Initial version.


CONFIDENTIAL