59{
60 int k, walker_len = 0, walker;
62 int next_offset, match_off;
63 int match_len;
64 int old_offset, match_bits;
66
68
70 {
71 *roff = 0;
72 *rlen = clen;
73 return 0;
74 }
75
77 {
79 }
80
82 {
85 }
86
87 *roff = 0;
88 *rlen = 0;
89
91
92 next_offset = walker;
93 old_offset = next_offset;
94 *roff = old_offset;
95 if (clen == 0)
96 return 0;
98
99 do
100 {
101 if (walker_len == 0)
102 {
104 break;
105 walker =
data[
i++] << 24;
106 walker_len = 8;
107 }
108 if (walker >= 0)
109 {
110 if (walker_len < 8)
111 {
113 {
114 if (walker != 0)
115 return -1;
116 break;
117 }
118 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
119 walker_len += 8;
120 }
122 return -1;
123 dict[next_offset++] = (((
uint32) walker) >> ((
uint32) 24));
124 walker <<= 8;
125 walker_len -= 8;
126 continue;
127 }
128 walker <<= 1;
129
130 if (--walker_len == 0)
131 {
133 return -1;
134 walker =
data[
i++] << 24;
135 walker_len = 8;
136 }
137
138 if (walker >= 0)
139 {
140 if (walker_len < 8)
141 {
143 return -1;
144 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
145 walker_len += 8;
146 }
148 return -1;
149 dict[next_offset++] = (
uint8) (walker >> 24 | 0x80);
150 walker <<= 8;
151 walker_len -= 8;
152 continue;
153 }
154
155
156
157 walker <<= 1;
158 if (--walker_len < (big ? 3 : 2))
159 {
161 return -1;
162 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
163 walker_len += 8;
164 }
165
166 if (big)
167 {
168
169
170
171
172
173
175 {
176 case 7:
177 for (; walker_len < 9; walker_len += 8)
178 {
180 return -1;
181 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
182 }
183 walker <<= 3;
185 walker <<= 6;
186 walker_len -= 9;
187 break;
188
189 case 6:
190 for (; walker_len < 11; walker_len += 8)
191 {
193 return -1;
194 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
195 }
196
197 walker <<= 3;
199 walker <<= 8;
200 walker_len -= 11;
201 break;
202
203 case 5:
204 case 4:
205 for (; walker_len < 13; walker_len += 8)
206 {
208 return -1;
209 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
210 }
211
212 walker <<= 2;
214 walker <<= 11;
215 walker_len -= 13;
216 break;
217
218 default:
219 for (; walker_len < 17; walker_len += 8)
220 {
222 return -1;
223 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
224 }
225
226 walker <<= 1;
227 match_off = (((
uint32) walker) >> ((
uint32) 16)) + 2368;
228 walker <<= 16;
229 walker_len -= 17;
230 break;
231 }
232 }
233 else
234 {
235
236
237
238
239
241 {
242 case 3:
243 if (walker_len < 8)
244 {
246 return -1;
247 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
248 walker_len += 8;
249 }
250 walker <<= 2;
252 walker <<= 6;
253 walker_len -= 8;
254 break;
255
256 case 2:
257 for (; walker_len < 10; walker_len += 8)
258 {
260 return -1;
261 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
262 }
263
264 walker <<= 2;
266 walker <<= 8;
267 walker_len -= 10;
268 break;
269
270 default:
271 for (; walker_len < 14; walker_len += 8)
272 {
274 return -1;
275 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
276 }
277
278 match_off = (walker >> 18) + 320;
279 walker <<= 14;
280 walker_len -= 14;
281 break;
282 }
283 }
284 if (walker_len == 0)
285 {
287 return -1;
288 walker =
data[
i++] << 24;
289 walker_len = 8;
290 }
291
292
293 match_len = 0;
294 if (walker >= 0)
295 {
296 match_len = 3;
297 walker <<= 1;
298 walker_len--;
299 }
300 else
301 {
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318 match_bits = big ? 14 : 11;
319 do
320 {
321 walker <<= 1;
322 if (--walker_len == 0)
323 {
325 return -1;
326 walker =
data[
i++] << 24;
327 walker_len = 8;
328 }
329 if (walker >= 0)
330 break;
331 if (--match_bits == 0)
332 {
333 return -1;
334 }
335 }
336 while (1);
337 match_len = (big ? 16 : 13) - match_bits;
338 walker <<= 1;
339 if (--walker_len < match_len)
340 {
341 for (; walker_len < match_len; walker_len += 8)
342 {
344 {
345 return -1;
346 }
347 walker |= (
data[
i++] & 0xff) << (24 - walker_len);
348 }
349 }
350
351 match_bits = match_len;
352 match_len =
353 ((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 <<
354 match_bits);
355 walker <<= match_bits;
356 walker_len -= match_bits;
357 }
359 {
360 return -1;
361 }
362
363 k = (next_offset - match_off) & (big ? 65535 : 8191);
364 do
365 {
366 dict[next_offset++] = dict[
k++];
367 }
368 while (--match_len != 0);
369 }
370 while (1);
371
372
374
375 *roff = old_offset;
376 *rlen = next_offset - old_offset;
377
378 return 0;
379}
#define RDP_MPPC_DICT_SIZE
#define RDP_MPPC_COMPRESSED
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
uint8 hist[RDP_MPPC_DICT_SIZE]