1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>CXCompressHuffman</title>
9<LINK rel="stylesheet" href="../CSS/revolution.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">CXCompressHuffman</h1>
15<h2>C Specification</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;revolution/cx.h&gt;</CODE><BR> <BR> <CODE>u32 CXCompressHuffman( const u8 *srcp, u32 size, u8 *dstp, u8 huffBitSize, u8 *work );<BR></CODE></dd>
20</dl>
21<h2>Arguments</h2>
22<TABLE border="1" width="100%">
23  <TBODY>
24    <TR>
25<TD width="13%"><EM><STRONG>srcp</STRONG></EM></TD>
26<TD width="87%">The source address where the data to compress is stored.</TD>
27    </TR>
28    <TR>
29<TD><EM><STRONG>size</STRONG></EM></TD>
30<TD>The data size of the source to compress.</TD>
31    </TR>
32    <TR>
33<TD width="13%"><EM><STRONG>dstp</STRONG></EM></TD>
34<TD width="87%">Needs a pointer to the compression destination buffer and a region greater than the source data size. Needs a 4-byte alignment.</TD>
35    </TR>
36    <TR>
37<TD><EM><STRONG>huffBitSize</STRONG></EM></TD>
38<TD>The bit size (4 or 8) to Huffman encode.</TD>
39    </TR>
40    <TR>
41<TD><B><I>work</I></B></TD>
42<TD>The work buffer used in Huffman compression. It requires the size of CX_HUFFMAN_COMPRESS_WORK_SIZE.<BR>Needs a 4-byte alignment.</TD>
43    </TR>
44  </TBODY>
45</TABLE>
46
47<h2>Return Values</h2>
48<p>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.</p>
49
50<H2>Description</H2>
51<P>This function performs Huffman compression and writes to a designated memory region. A region of the same size as the source data must be prepared in the compression destination buffer.</P>
52
53<h2>See Also</h2>
54<p><CODE><A href="CXUncompressHuffman.html">CXUncompressHuffman</A> </CODE>, <A href="CXReadUncompHuffman.html">CXReadUncompHuffman</A>, <A href="CXCompressLZ.html">CXCompressLZ</A>, <A href="CXCompressRL.html">CXCompressRL</A></p>
55
56<H2>Revision History</H2>
57<P>07/06/2006 Initial version.</P>
58<hr>
59<P>CONFIDENTIAL</p>
60</BODY>
61</HTML>
62