1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cx_Compression.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 47717 $
14  *---------------------------------------------------------------------------*/
15 
16 /* Please see man pages for details
17 
18 
19 
20 */
21 
22 #ifndef NN_CX_COMPRESSION_H_
23 #define NN_CX_COMPRESSION_H_
24 
25 #include <nn/types.h>
26 
27 namespace nn {
28 namespace cx {
29 
30 /* Please see man pages for details
31 
32 
33 */
34 
35 /* Please see man pages for details
36 
37  */
38 const int   LZ_COMPRESS_WORK_SIZE   = (4096 + 256 + 256) * sizeof(s16);
39 
40 u32 CompressLZImpl(const u8 *srcp, u32 size, u8 *dstp, void *work, bool exFormat);
41 
42 /* Please see man pages for details
43 
44 
45 
46 
47 
48 
49 
50  */
CompressLZ(const u8 * srcp,u32 size,u8 * dstp,void * work)51 inline u32 CompressLZ(const u8 *srcp, u32 size, u8 *dstp, void *work)
52 {
53     return CompressLZImpl( srcp, size, dstp, work, false );
54 }
55 
56 /* Please see man pages for details
57 
58 
59 
60 
61 
62 
63 
64  */
CompressLZEx(const u8 * srcp,u32 size,u8 * dstp,void * work)65 inline u32 CompressLZEx(const u8 *srcp, u32 size, u8 *dstp, void* work)
66 {
67     return CompressLZImpl( srcp, size, dstp, work, true );
68 }
69 
70 /* Please see man pages for details
71 
72 
73 
74 
75 
76 
77  */
78 u32 CompressRL( const u8 *srcp, u32 size, u8 *dstp );
79 
80 /* Please see man pages for details
81 
82  */
83 const int   HUFFMAN_COMPRESS_WORK_SIZE  = 12288 + 512 + 1536;
84 
85 /* Please see man pages for details
86 
87 
88 
89 
90 
91 
92 
93 
94  */
95 u32 CompressHuffman( const u8 *srcp, u32 size, u8 *dstp, u8 huffBitSize, void *work );
96 
97 
98 
99 //----------------------------------------------------------------------
100 /* Please see man pages for details
101  *///-------------------------------------------------------------------
102 const int   DEFLATE_COMPRESS_WORK_SIZE  = 267972;
103 
104 //----------------------------------------------------------------------
105 /* Please see man pages for details
106  *///-------------------------------------------------------------------
107 const int   GZIP_COMPRESS_WORK_SIZE     = DEFLATE_COMPRESS_WORK_SIZE;
108 
109 //----------------------------------------------------------------------
110 /* Please see man pages for details
111  *///-------------------------------------------------------------------
112 const int   ZLIB_COMPRESS_WORK_SIZE     = DEFLATE_COMPRESS_WORK_SIZE;
113 
114 
115 //----------------------------------------------------------------------
116 /* Please see man pages for details
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132  *///-------------------------------------------------------------------
133 s32 CompressDeflate( void* pDst, size_t dstSize, const void* pSrc, size_t srcSize, void* pWork );
134 
135 //----------------------------------------------------------------------
136 /* Please see man pages for details
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152  *///-------------------------------------------------------------------
153 s32 CompressGzip   ( void* pDst, size_t dstSize, const void* pSrc, size_t srcSize, void* pWork );
154 
155 //----------------------------------------------------------------------
156 /* Please see man pages for details
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171 
172  *///-------------------------------------------------------------------
173 s32 CompressZlib   ( void* pDst, size_t dstSize, const void* pSrc, size_t srcSize, void* pWork );
174 
175 }   // namespace cx
176 }   // namespace nn
177 
178 /*
179 
180 */
181 
182 /* NN_CX_COMPRESSION_H_ */
183 #endif
184