CXCompressLZEx

Syntax

#include <revolution/cx.h>

u32 CXCompressLZEx( const u8 *srcp, u32 size, u8 *dstp, void* work );

Arguments

srcp The source address that stores the data to be compressed.
size The data size of the source to be compressed.
dstp Needs a pointer to the compression destination buffer, and a region greater than the source data size. Requires 4-byte alignment.
work Temporary work buffer used for compression. It requires a size equal to CX_LZ_COMPRESS_WORK_SIZE bytes.

Return Values

Returns the size of the compressed data. If the data after compression is larger than the source file, no compression will be performed and a zero will be returned.

Description

Performs LZ77 extended compression on the data, then writes it to a specified memory region. A region of the same size as the source data must be prepared in the compression destination buffer.

This function generally provides a higher compression ratio than the CXCompressLZ function.
This function is equivalent to running the ntcompress tool with the -lex option.

If data compressed in the LZ77 extended format is used with Revolution SDK version 3.0 or later versions, it can be uncompressed using the same API as for normal LZ77 compression data.

See Also

CXGetUncompressedSize
CXUncompressLZ
CXSecureUncompressLZ
CXInitUncompContextLZ
CXReadUncompLZ
CXIsFinishedUncompLZ
CXCompressLZ
ntcompress

Revision History

2009/09/25 Explained data compressed in the LZ77 extended-compression format.
2007/09/03 Corrected errors in the Description and See Also sections.
2007/04/27 Initial version.


CONFIDENTIAL