#include <revolution/cx/CXStreamingUncompression.h>
typedef struct { u8* destp; // 4B s32 destCount; // 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 540B } CXUncompContextHuffman;
This is the context structure for saving the state of data uncompression when Huffman-compressed data is being read from the Card and 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 is 4-bit encoded data, there will be no problems if the 'tree' member array size is 32 bytes, so it is all right even if the provided region is 480 bytes smaller than sizeof( CXUncompContextHufffman ).
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 region where uncompressed data will be written |
| destCount | Remaining write size |
| treep | For storing Huffman encoding table, current pointer |
| srcTmp | For storing data while reading |
| destTmp | For storing data while writing |
| treeSize | For storing the size of the Huffman encoding table |
| srcTmpCnt | For storing data size while reading |
| destTmpCnt | For storing data size while writing |
| bitSize | Encoded bit size |
| headerSize | For storing the compressed header size while reading |
| tree | Buffer for reading Huffman encoding table |
CXInitUncompContextHuffman, CXReadUncompHuffman, CXUncompContextLZ,CXUncompContextRL
07/06/2006 Initial version.
CONFIDENTIAL