#include <revolution/cx/CXStreamingUncompression.h>
typedef struct
{
u8* destp; // 4B
s32 destCount; // 4B
s32 forceDestCount; // 4B
u8* treep; // 4B
u32 srcTmp; // 4B
u32 destTmp; // 4B
s16 treeSize; // 2B
u8 srcTmpCnt; // 1B
u8 destTmpCnt; // 1B
u8 bitSize; // 1B
u8 headerSize; // 1B
u8 padding_[2]; // 2B
u8 tree[0x200]; // 512B
// Total 544B
} CXUncompContextHuffman;
This is the context structure for saving the state of data uncompression when Huffman-compressed data is being read from the card and is undergoing streaming uncompression. The context is initialized by the CXInitUncompContextHuffman function and used by the CXReadUncompHuffman function to save the uncompression state.
If the compressed data uses a 4-bit encoding, the tree member variable can use an array size of 32 bytes. You may therefore give a region that is 480 bytes smaller than sizeof( CXUncompContextHuffman ).
If the compressed data is 8-bit encoded data you need 512 bytes, so you cannot trim the size of the structure.
| destp | Pointer to destination region where uncompressed data will be written. |
|---|---|
| destCount | Remaining write size. |
| forceDestCount | Uncompression destination size that is forcibly set. |
| treep | For storing Huffman encoding table, current pointer. |
| srcTmp | For storing data while it is being loaded. |
| destTmp | For storing data while it is being written. |
| treeSize | For storing the size of the Huffman encoding table. |
| srcTmpCnt | For storing the size of the data currently being loaded. |
| destTmpCnt | For storing the size of the data currently being written. |
| bitSize | Encoding bit size. |
| headerSize | For storing the compressed header size while reading. |
| tree | Buffer for loading Huffman encoding table. |
CXInitUncompContextHuffman, CXReadUncompHuffman, CXUncompContextLZ, CXUncompContextRL
2006/09/03 Reflected changes to the structure definition.
2006/07/06 Initial version.
CONFIDENTIAL