# MI_CompressLZFast

## C Specification

  `#include <nitro/mi.h>`
  `u32 MI_CompressLZFast( const u8 *srcp, u32 size, u8 *dstp, u8* work );
  `

## Arguments

srcp | The source address where the data to compress is stored.
`size` | The data size of the source to compress.
dstp | Needs a pointer to the compression destination buffer and a region greater than the source data size. Needs a 4-byte alignment.
work | Temporary work buffer used for compression. The number of bytes given by `MI_HUFFMAN_COMPRESS_WORK_SIZE` is required.

## 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 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. Processing is performed several times faster than when using `MI_CompressLZ` due to the use of a work buffer while searching the slide dictionary.

`The function writes in 8-bit units, so an address in VRAM cannot be specified in `dstp`.`
An address in VRAM can be specified in `srcp`.

## Internal Operation

Processing only takes place on the CPU, without the use of a system call or DMA.

## See Also

`MI_CompressLZ, MI_UncompressLZ*` , MI_ReadUncompLZ, MI_CompressRL, MI_CompressHuffman

## Revision History

11/29/2005 Initial version.