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 16<h2>Syntax</h2> 17<DL><DD><PRE class="construction"> 18#include <revolution/cx.h> 19 20u32 CXCompressHuffman( const u8 *srcp, u32 size, u8 *dstp, u8 huffBitSize, u8 *work ); 21</PRE></dd></dl> 22 23<h2>Arguments</h2> 24<TABLE class="arguments" border="1"> 25 <TBODY> 26 <TR> 27<TH>srcp</TH> 28<TD>The source address where the data to compress is stored.</TD> 29 </TR> 30 <TR> 31<TH>size</TH> 32<TD>The data size of the source to compress.</TD> 33 </TR> 34 <TR> 35<TH>dstp</TH> 36<TD>Needs a pointer to the compression destination buffer and a region greater than the source data size. Needs a 4-byte alignment.</TD> 37 </TR> 38 <TR> 39<TH>huffBitSize</TH> 40<TD>The bit size (4 or 8) to Huffman encode.</TD> 41 </TR> 42 <TR> 43<TH>work</TH> 44<TD>The work buffer used in Huffman compression. It requires the size of <CODE>CX_HUFFMAN_COMPRESS_WORK_SIZE</CODE>.<BR>Needs a 4-byte alignment.</TD> 45 </TR> 46 </TBODY> 47</TABLE> 48 49<h2>Return Values</h2> 50<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> 51 52<H2>Description</H2> 53<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> 54 55<h2>See Also</h2> 56<p class="reference"> 57<A href="CXGetUncompressedSize.html">CXGetUncompressedSize</A>, 58<A href="CXUncompressHuffman.html">CXUncompressHuffman</A>, 59<A href="CXSecureUncompressHuffman.html">CXSecureUncompressHuffman</A>, 60<A href="CXInitUncompContextHuffman.html">CXInitUncompContextHuffman</A>, 61<A href="CXReadUncompHuffman.html">CXReadUncompHuffman</A>, 62<A href="CXIsFinishedUncompHuffman.html">CXIsFinishedUncompHuffman</A>, 63<A href="../tools/ntcompress.html">ntcompress</A> 64</p> 65 66<H2>Revision History</H2> 67<P> 682007/09/03 Corrected error in the See Also section.<BR>2006/07/06 Initial version.<BR> 69</P> 70 71<hr><p>CONFIDENTIAL</p></body> 72</html> 73