lzoruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/{README.txt → README} +3 -7
- data/ext/extconf.rb +4 -1
- metadata +24 -131
- data/ext/compr1b.h +0 -81
- data/ext/compr1c.h +0 -81
- data/ext/config1.h +0 -61
- data/ext/config1a.h +0 -196
- data/ext/config1b.h +0 -140
- data/ext/config1c.h +0 -145
- data/ext/config1f.h +0 -97
- data/ext/config1x.h +0 -118
- data/ext/config1y.h +0 -66
- data/ext/config1z.h +0 -65
- data/ext/config2a.h +0 -155
- data/ext/lzo/lzo1.h +0 -96
- data/ext/lzo/lzo1a.h +0 -96
- data/ext/lzo/lzo1b.h +0 -160
- data/ext/lzo/lzo1c.h +0 -160
- data/ext/lzo/lzo1f.h +0 -108
- data/ext/lzo/lzo1x.h +0 -177
- data/ext/lzo/lzo1y.h +0 -145
- data/ext/lzo/lzo1z.h +0 -150
- data/ext/lzo/lzo2a.h +0 -92
- data/ext/lzo/lzo_asm.h +0 -139
- data/ext/lzo/lzoconf.h +0 -417
- data/ext/lzo/lzodefs.h +0 -1807
- data/ext/lzo/lzoutil.h +0 -73
- data/ext/lzo1.c +0 -635
- data/ext/lzo1_99.c +0 -130
- data/ext/lzo1_cm.ch +0 -52
- data/ext/lzo1_d.ch +0 -155
- data/ext/lzo1a.c +0 -657
- data/ext/lzo1a_99.c +0 -130
- data/ext/lzo1a_cm.ch +0 -242
- data/ext/lzo1a_cr.ch +0 -128
- data/ext/lzo1a_de.h +0 -158
- data/ext/lzo1b_1.c +0 -46
- data/ext/lzo1b_2.c +0 -46
- data/ext/lzo1b_3.c +0 -46
- data/ext/lzo1b_4.c +0 -46
- data/ext/lzo1b_5.c +0 -46
- data/ext/lzo1b_6.c +0 -46
- data/ext/lzo1b_7.c +0 -46
- data/ext/lzo1b_8.c +0 -46
- data/ext/lzo1b_9.c +0 -46
- data/ext/lzo1b_99.c +0 -49
- data/ext/lzo1b_9x.c +0 -365
- data/ext/lzo1b_c.ch +0 -270
- data/ext/lzo1b_cc.c +0 -167
- data/ext/lzo1b_cc.h +0 -93
- data/ext/lzo1b_cm.ch +0 -294
- data/ext/lzo1b_cr.ch +0 -126
- data/ext/lzo1b_d.ch +0 -282
- data/ext/lzo1b_d1.c +0 -46
- data/ext/lzo1b_d2.c +0 -46
- data/ext/lzo1b_de.h +0 -344
- data/ext/lzo1b_r.ch +0 -117
- data/ext/lzo1b_rr.c +0 -43
- data/ext/lzo1b_sm.ch +0 -210
- data/ext/lzo1b_tm.ch +0 -99
- data/ext/lzo1b_xx.c +0 -98
- data/ext/lzo1c_1.c +0 -46
- data/ext/lzo1c_2.c +0 -46
- data/ext/lzo1c_3.c +0 -46
- data/ext/lzo1c_4.c +0 -46
- data/ext/lzo1c_5.c +0 -46
- data/ext/lzo1c_6.c +0 -46
- data/ext/lzo1c_7.c +0 -46
- data/ext/lzo1c_8.c +0 -46
- data/ext/lzo1c_9.c +0 -46
- data/ext/lzo1c_99.c +0 -49
- data/ext/lzo1c_9x.c +0 -379
- data/ext/lzo1c_cc.c +0 -167
- data/ext/lzo1c_cc.h +0 -93
- data/ext/lzo1c_d1.c +0 -46
- data/ext/lzo1c_d2.c +0 -46
- data/ext/lzo1c_rr.c +0 -43
- data/ext/lzo1c_xx.c +0 -98
- data/ext/lzo1f_1.c +0 -312
- data/ext/lzo1f_9x.c +0 -345
- data/ext/lzo1f_d.ch +0 -223
- data/ext/lzo1f_d1.c +0 -46
- data/ext/lzo1f_d2.c +0 -46
- data/ext/lzo1x_1.c +0 -50
- data/ext/lzo1x_1k.c +0 -50
- data/ext/lzo1x_1l.c +0 -50
- data/ext/lzo1x_1o.c +0 -50
- data/ext/lzo1x_9x.c +0 -881
- data/ext/lzo1x_c.ch +0 -351
- data/ext/lzo1x_d.ch +0 -466
- data/ext/lzo1x_d1.c +0 -46
- data/ext/lzo1x_d2.c +0 -46
- data/ext/lzo1x_d3.c +0 -108
- data/ext/lzo1x_o.c +0 -45
- data/ext/lzo1x_oo.ch +0 -366
- data/ext/lzo1y_1.c +0 -50
- data/ext/lzo1y_9x.c +0 -42
- data/ext/lzo1y_d1.c +0 -46
- data/ext/lzo1y_d2.c +0 -46
- data/ext/lzo1y_d3.c +0 -45
- data/ext/lzo1y_o.c +0 -45
- data/ext/lzo1z_9x.c +0 -42
- data/ext/lzo1z_d1.c +0 -46
- data/ext/lzo1z_d2.c +0 -46
- data/ext/lzo1z_d3.c +0 -45
- data/ext/lzo2a_9x.c +0 -357
- data/ext/lzo2a_d.ch +0 -188
- data/ext/lzo2a_d1.c +0 -46
- data/ext/lzo2a_d2.c +0 -46
- data/ext/lzo_conf.h +0 -323
- data/ext/lzo_crc.c +0 -167
- data/ext/lzo_dict.h +0 -316
- data/ext/lzo_dll.ch +0 -64
- data/ext/lzo_init.c +0 -176
- data/ext/lzo_mchw.ch +0 -242
- data/ext/lzo_ptr.c +0 -92
- data/ext/lzo_ptr.h +0 -154
- data/ext/lzo_str.c +0 -71
- data/ext/lzo_swd.ch +0 -707
- data/ext/lzo_util.c +0 -165
- data/ext/miniacc.h +0 -6553
- data/ext/stats1a.h +0 -137
- data/ext/stats1b.h +0 -142
- data/ext/stats1c.h +0 -61
data/ext/lzo1a_99.c
DELETED
@@ -1,130 +0,0 @@
|
|
1
|
-
/* lzo1a_99.c -- implementation of the LZO1A-99 algorithm
|
2
|
-
|
3
|
-
This file is part of the LZO real-time data compression library.
|
4
|
-
|
5
|
-
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
|
6
|
-
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
|
7
|
-
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
|
8
|
-
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
|
9
|
-
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
|
10
|
-
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
|
11
|
-
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
12
|
-
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
13
|
-
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
14
|
-
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
15
|
-
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
16
|
-
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
17
|
-
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
18
|
-
All Rights Reserved.
|
19
|
-
|
20
|
-
The LZO library is free software; you can redistribute it and/or
|
21
|
-
modify it under the terms of the GNU General Public License as
|
22
|
-
published by the Free Software Foundation; either version 2 of
|
23
|
-
the License, or (at your option) any later version.
|
24
|
-
|
25
|
-
The LZO library is distributed in the hope that it will be useful,
|
26
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28
|
-
GNU General Public License for more details.
|
29
|
-
|
30
|
-
You should have received a copy of the GNU General Public License
|
31
|
-
along with the LZO library; see the file COPYING.
|
32
|
-
If not, write to the Free Software Foundation, Inc.,
|
33
|
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
34
|
-
|
35
|
-
Markus F.X.J. Oberhumer
|
36
|
-
<markus@oberhumer.com>
|
37
|
-
http://www.oberhumer.com/opensource/lzo/
|
38
|
-
*/
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
#define COMPRESS_ID 99
|
43
|
-
|
44
|
-
#define DDBITS 3
|
45
|
-
#define CLEVEL 9
|
46
|
-
|
47
|
-
|
48
|
-
/***********************************************************************
|
49
|
-
//
|
50
|
-
************************************************************************/
|
51
|
-
|
52
|
-
#define LZO_NEED_DICT_H
|
53
|
-
#include "config1a.h"
|
54
|
-
|
55
|
-
|
56
|
-
/***********************************************************************
|
57
|
-
// compression internal entry point.
|
58
|
-
************************************************************************/
|
59
|
-
|
60
|
-
static int
|
61
|
-
_lzo1a_do_compress ( const lzo_bytep in, lzo_uint in_len,
|
62
|
-
lzo_bytep out, lzo_uintp out_len,
|
63
|
-
lzo_voidp wrkmem,
|
64
|
-
lzo_compress_t func )
|
65
|
-
{
|
66
|
-
int r;
|
67
|
-
|
68
|
-
/* don't try to compress a block that's too short */
|
69
|
-
if (in_len <= 0)
|
70
|
-
{
|
71
|
-
*out_len = 0;
|
72
|
-
r = LZO_E_OK;
|
73
|
-
}
|
74
|
-
else if (in_len <= MIN_LOOKAHEAD + 1)
|
75
|
-
{
|
76
|
-
#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE)
|
77
|
-
*out_len = 0;
|
78
|
-
r = LZO_E_NOT_COMPRESSIBLE;
|
79
|
-
#else
|
80
|
-
*out_len = pd(STORE_RUN(out,in,in_len), out);
|
81
|
-
r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR;
|
82
|
-
#endif
|
83
|
-
}
|
84
|
-
else
|
85
|
-
r = func(in,in_len,out,out_len,wrkmem);
|
86
|
-
|
87
|
-
return r;
|
88
|
-
}
|
89
|
-
|
90
|
-
|
91
|
-
/***********************************************************************
|
92
|
-
//
|
93
|
-
************************************************************************/
|
94
|
-
|
95
|
-
#if !defined(COMPRESS_ID)
|
96
|
-
#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL)
|
97
|
-
#endif
|
98
|
-
|
99
|
-
|
100
|
-
#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1a_cm.ch"
|
101
|
-
#include "lzo1b_c.ch"
|
102
|
-
|
103
|
-
|
104
|
-
/***********************************************************************
|
105
|
-
//
|
106
|
-
************************************************************************/
|
107
|
-
|
108
|
-
#define LZO_COMPRESS \
|
109
|
-
LZO_CPP_ECONCAT3(lzo1a_,COMPRESS_ID,_compress)
|
110
|
-
|
111
|
-
#define LZO_COMPRESS_FUNC \
|
112
|
-
LZO_CPP_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func)
|
113
|
-
|
114
|
-
|
115
|
-
/***********************************************************************
|
116
|
-
//
|
117
|
-
************************************************************************/
|
118
|
-
|
119
|
-
LZO_PUBLIC(int)
|
120
|
-
LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len,
|
121
|
-
lzo_bytep out, lzo_uintp out_len,
|
122
|
-
lzo_voidp wrkmem )
|
123
|
-
{
|
124
|
-
return _lzo1a_do_compress(in,in_len,out,out_len,wrkmem,do_compress);
|
125
|
-
}
|
126
|
-
|
127
|
-
|
128
|
-
/*
|
129
|
-
vi:ts=4:et
|
130
|
-
*/
|
data/ext/lzo1a_cm.ch
DELETED
@@ -1,242 +0,0 @@
|
|
1
|
-
/* lzo1a_cm.ch -- implementation of the LZO1A compression algorithm
|
2
|
-
|
3
|
-
This file is part of the LZO real-time data compression library.
|
4
|
-
|
5
|
-
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
|
6
|
-
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
|
7
|
-
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
|
8
|
-
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
|
9
|
-
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
|
10
|
-
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
|
11
|
-
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
12
|
-
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
13
|
-
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
14
|
-
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
15
|
-
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
16
|
-
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
17
|
-
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
18
|
-
All Rights Reserved.
|
19
|
-
|
20
|
-
The LZO library is free software; you can redistribute it and/or
|
21
|
-
modify it under the terms of the GNU General Public License as
|
22
|
-
published by the Free Software Foundation; either version 2 of
|
23
|
-
the License, or (at your option) any later version.
|
24
|
-
|
25
|
-
The LZO library is distributed in the hope that it will be useful,
|
26
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28
|
-
GNU General Public License for more details.
|
29
|
-
|
30
|
-
You should have received a copy of the GNU General Public License
|
31
|
-
along with the LZO library; see the file COPYING.
|
32
|
-
If not, write to the Free Software Foundation, Inc.,
|
33
|
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
34
|
-
|
35
|
-
Markus F.X.J. Oberhumer
|
36
|
-
<markus@oberhumer.com>
|
37
|
-
http://www.oberhumer.com/opensource/lzo/
|
38
|
-
*/
|
39
|
-
|
40
|
-
|
41
|
-
/* WARNING: this file should *not* be used by applications. It is
|
42
|
-
part of the implementation of the library and is subject
|
43
|
-
to change.
|
44
|
-
*/
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
/***********************************************************************
|
49
|
-
// code the match in LZO1 compatible format
|
50
|
-
************************************************************************/
|
51
|
-
|
52
|
-
#define THRESHOLD (M2_MIN_LEN - 1)
|
53
|
-
#define MSIZE LZO_SIZE(M2L_BITS)
|
54
|
-
|
55
|
-
|
56
|
-
/***********************************************************************
|
57
|
-
//
|
58
|
-
************************************************************************/
|
59
|
-
|
60
|
-
#if (DD_BITS == 0)
|
61
|
-
|
62
|
-
/* we already matched M2_MIN_LEN bytes,
|
63
|
-
* m_pos also already advanced M2_MIN_LEN bytes */
|
64
|
-
ip += M2_MIN_LEN;
|
65
|
-
assert(m_pos < ip);
|
66
|
-
|
67
|
-
/* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes
|
68
|
-
* to see if we get more than a M2 match */
|
69
|
-
#define M2_OR_M3 (MATCH_M2)
|
70
|
-
|
71
|
-
#else /* (DD_BITS == 0) */
|
72
|
-
|
73
|
-
/* we already matched m_len bytes */
|
74
|
-
assert(m_len >= M2_MIN_LEN);
|
75
|
-
ip += m_len;
|
76
|
-
assert(ip <= in_end);
|
77
|
-
|
78
|
-
#define M2_OR_M3 (m_len <= M2_MAX_LEN)
|
79
|
-
|
80
|
-
#endif /* (DD_BITS == 0) */
|
81
|
-
|
82
|
-
|
83
|
-
if (M2_OR_M3)
|
84
|
-
{
|
85
|
-
/* we've found a short match */
|
86
|
-
assert(ip <= in_end);
|
87
|
-
|
88
|
-
/* 2a) compute match parameters */
|
89
|
-
#if (DD_BITS == 0)
|
90
|
-
assert(pd(ip,m_pos) == m_off);
|
91
|
-
--ip; /* ran one too far, point back to non-match */
|
92
|
-
m_len = ip - ii;
|
93
|
-
#endif
|
94
|
-
assert(m_len >= M2_MIN_LEN);
|
95
|
-
assert(m_len <= M2_MAX_LEN);
|
96
|
-
|
97
|
-
assert(m_off >= M2_MIN_OFFSET);
|
98
|
-
assert(m_off <= M2_MAX_OFFSET);
|
99
|
-
assert(ii-m_off == m_pos_sav);
|
100
|
-
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
|
101
|
-
|
102
|
-
/* 2b) code the match */
|
103
|
-
m_off -= M2_MIN_OFFSET;
|
104
|
-
/* code short match len + low offset bits */
|
105
|
-
*op++ = LZO_BYTE(((m_len - THRESHOLD) << M2O_BITS) |
|
106
|
-
(m_off & M2O_MASK));
|
107
|
-
/* code high offset bits */
|
108
|
-
*op++ = LZO_BYTE(m_off >> M2O_BITS);
|
109
|
-
|
110
|
-
|
111
|
-
if (ip >= ip_end)
|
112
|
-
{
|
113
|
-
ii = ip;
|
114
|
-
break;
|
115
|
-
}
|
116
|
-
|
117
|
-
|
118
|
-
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
|
119
|
-
|
120
|
-
#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3)
|
121
|
-
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
|
122
|
-
++ii;
|
123
|
-
do {
|
124
|
-
DVAL_NEXT(dv,ii);
|
125
|
-
#if 0
|
126
|
-
UPDATE_D(dict,drun,dv,ii,in);
|
127
|
-
#else
|
128
|
-
dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
|
129
|
-
#endif
|
130
|
-
MI
|
131
|
-
} while (++ii < ip);
|
132
|
-
DVAL_NEXT(dv,ii);
|
133
|
-
assert(ii == ip);
|
134
|
-
DVAL_ASSERT(dv,ip);
|
135
|
-
#elif (CLEVEL >= 3)
|
136
|
-
SI DI DI XI
|
137
|
-
#elif (CLEVEL >= 2)
|
138
|
-
SI DI XI
|
139
|
-
#else
|
140
|
-
XI
|
141
|
-
#endif
|
142
|
-
}
|
143
|
-
|
144
|
-
else
|
145
|
-
|
146
|
-
{
|
147
|
-
/* we've found a long match - see how far we can still go */
|
148
|
-
const lzo_bytep end;
|
149
|
-
|
150
|
-
assert(ip <= in_end);
|
151
|
-
assert(ii == ip - (M2_MAX_LEN + 1));
|
152
|
-
assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0);
|
153
|
-
|
154
|
-
#if (DD_BITS > 0)
|
155
|
-
assert(m_len == (lzo_uint)(ip-ii));
|
156
|
-
m_pos = ip - m_off;
|
157
|
-
assert(m_pos == m_pos_sav + m_len);
|
158
|
-
#endif
|
159
|
-
|
160
|
-
if (pd(in_end,ip) <= (M3_MAX_LEN - M3_MIN_LEN))
|
161
|
-
end = in_end;
|
162
|
-
else
|
163
|
-
{
|
164
|
-
end = ip + (M3_MAX_LEN - M3_MIN_LEN);
|
165
|
-
assert(end < in_end);
|
166
|
-
}
|
167
|
-
|
168
|
-
while (ip < end && *m_pos == *ip)
|
169
|
-
m_pos++, ip++;
|
170
|
-
assert(ip <= in_end);
|
171
|
-
|
172
|
-
/* 2a) compute match parameters */
|
173
|
-
m_len = pd(ip, ii);
|
174
|
-
assert(m_len >= M3_MIN_LEN);
|
175
|
-
assert(m_len <= M3_MAX_LEN);
|
176
|
-
|
177
|
-
assert(m_off >= M3_MIN_OFFSET);
|
178
|
-
assert(m_off <= M3_MAX_OFFSET);
|
179
|
-
assert(ii-m_off == m_pos_sav);
|
180
|
-
assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0);
|
181
|
-
assert(pd(ip,m_pos) == m_off);
|
182
|
-
|
183
|
-
/* 2b) code the match */
|
184
|
-
m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET;
|
185
|
-
/* code long match flag + low offset bits */
|
186
|
-
*op++ = LZO_BYTE(((MSIZE - 1) << M3O_BITS) | (m_off & M3O_MASK));
|
187
|
-
/* code high offset bits */
|
188
|
-
*op++ = LZO_BYTE(m_off >> M3O_BITS);
|
189
|
-
/* code match len */
|
190
|
-
*op++ = LZO_BYTE(m_len - M3_MIN_LEN);
|
191
|
-
|
192
|
-
|
193
|
-
if (ip >= ip_end)
|
194
|
-
{
|
195
|
-
ii = ip;
|
196
|
-
break;
|
197
|
-
}
|
198
|
-
|
199
|
-
|
200
|
-
/* 2c) Insert phrases (beginning with ii+1) into the dictionary. */
|
201
|
-
#if (CLEVEL == 9)
|
202
|
-
/* Insert the whole match (ii+1)..(ip-1) into dictionary. */
|
203
|
-
/* This is not recommended because it can be slow. */
|
204
|
-
++ii;
|
205
|
-
do {
|
206
|
-
DVAL_NEXT(dv,ii);
|
207
|
-
#if 0
|
208
|
-
UPDATE_D(dict,drun,dv,ii,in);
|
209
|
-
#else
|
210
|
-
dict[ DINDEX(dv,ii) ] = DENTRY(ii,in);
|
211
|
-
#endif
|
212
|
-
MI
|
213
|
-
} while (++ii < ip);
|
214
|
-
DVAL_NEXT(dv,ii);
|
215
|
-
assert(ii == ip);
|
216
|
-
DVAL_ASSERT(dv,ip);
|
217
|
-
#elif (CLEVEL >= 8)
|
218
|
-
SI DI DI DI DI DI DI DI DI XI
|
219
|
-
#elif (CLEVEL >= 7)
|
220
|
-
SI DI DI DI DI DI DI DI XI
|
221
|
-
#elif (CLEVEL >= 6)
|
222
|
-
SI DI DI DI DI DI DI XI
|
223
|
-
#elif (CLEVEL >= 5)
|
224
|
-
SI DI DI DI DI XI
|
225
|
-
#elif (CLEVEL >= 4)
|
226
|
-
SI DI DI DI XI
|
227
|
-
#elif (CLEVEL >= 3)
|
228
|
-
SI DI DI XI
|
229
|
-
#elif (CLEVEL >= 2)
|
230
|
-
SI DI XI
|
231
|
-
#else
|
232
|
-
XI
|
233
|
-
#endif
|
234
|
-
}
|
235
|
-
|
236
|
-
/* ii now points to the start of the next literal run */
|
237
|
-
assert(ii == ip);
|
238
|
-
|
239
|
-
|
240
|
-
/*
|
241
|
-
vi:ts=4:et
|
242
|
-
*/
|
data/ext/lzo1a_cr.ch
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
/* lzo1a_cr.ch -- literal run handling for the the LZO1A algorithm
|
2
|
-
|
3
|
-
This file is part of the LZO real-time data compression library.
|
4
|
-
|
5
|
-
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
|
6
|
-
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
|
7
|
-
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
|
8
|
-
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
|
9
|
-
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
|
10
|
-
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
|
11
|
-
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
12
|
-
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
13
|
-
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
14
|
-
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
15
|
-
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
16
|
-
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
17
|
-
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
18
|
-
All Rights Reserved.
|
19
|
-
|
20
|
-
The LZO library is free software; you can redistribute it and/or
|
21
|
-
modify it under the terms of the GNU General Public License as
|
22
|
-
published by the Free Software Foundation; either version 2 of
|
23
|
-
the License, or (at your option) any later version.
|
24
|
-
|
25
|
-
The LZO library is distributed in the hope that it will be useful,
|
26
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28
|
-
GNU General Public License for more details.
|
29
|
-
|
30
|
-
You should have received a copy of the GNU General Public License
|
31
|
-
along with the LZO library; see the file COPYING.
|
32
|
-
If not, write to the Free Software Foundation, Inc.,
|
33
|
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
34
|
-
|
35
|
-
Markus F.X.J. Oberhumer
|
36
|
-
<markus@oberhumer.com>
|
37
|
-
http://www.oberhumer.com/opensource/lzo/
|
38
|
-
*/
|
39
|
-
|
40
|
-
|
41
|
-
/* WARNING: this file should *not* be used by applications. It is
|
42
|
-
part of the implementation of the LZO package and is subject
|
43
|
-
to change.
|
44
|
-
*/
|
45
|
-
|
46
|
-
|
47
|
-
#ifndef __LZO1A_CR_H
|
48
|
-
#define __LZO1A_CR_H
|
49
|
-
|
50
|
-
|
51
|
-
/***********************************************************************
|
52
|
-
// code a literal run
|
53
|
-
************************************************************************/
|
54
|
-
|
55
|
-
static lzo_bytep
|
56
|
-
store_run(lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len)
|
57
|
-
{
|
58
|
-
register lzo_bytep op;
|
59
|
-
register const lzo_bytep ip;
|
60
|
-
register lzo_uint t;
|
61
|
-
|
62
|
-
op = oo;
|
63
|
-
ip = ii;
|
64
|
-
assert(r_len > 0);
|
65
|
-
|
66
|
-
/* code a long R0 run */
|
67
|
-
if (r_len >= 512)
|
68
|
-
{
|
69
|
-
unsigned r_bits = 6; /* 256 << 6 == 16384 */
|
70
|
-
lzo_uint tt = 32768u;
|
71
|
-
|
72
|
-
while (r_len >= (t = tt))
|
73
|
-
{
|
74
|
-
r_len -= t;
|
75
|
-
*op++ = 0; *op++ = (R0MAX - R0MIN);
|
76
|
-
MEMCPY8_DS(op, ip, t);
|
77
|
-
LZO_STATS(lzo_stats->r0long_runs++);
|
78
|
-
}
|
79
|
-
tt >>= 1;
|
80
|
-
do {
|
81
|
-
if (r_len >= (t = tt))
|
82
|
-
{
|
83
|
-
r_len -= t;
|
84
|
-
*op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits);
|
85
|
-
MEMCPY8_DS(op, ip, t);
|
86
|
-
LZO_STATS(lzo_stats->r0long_runs++);
|
87
|
-
}
|
88
|
-
tt >>= 1;
|
89
|
-
} while (--r_bits > 0);
|
90
|
-
}
|
91
|
-
assert(r_len < 512);
|
92
|
-
|
93
|
-
while (r_len >= (t = R0FAST))
|
94
|
-
{
|
95
|
-
r_len -= t;
|
96
|
-
*op++ = 0; *op++ = (R0FAST - R0MIN);
|
97
|
-
MEMCPY8_DS(op, ip, t);
|
98
|
-
LZO_STATS(lzo_stats->r0fast_runs++);
|
99
|
-
}
|
100
|
-
|
101
|
-
t = r_len;
|
102
|
-
if (t >= R0MIN)
|
103
|
-
{
|
104
|
-
/* code a short R0 run */
|
105
|
-
*op++ = 0; *op++ = LZO_BYTE(t - R0MIN);
|
106
|
-
MEMCPY_DS(op, ip, t);
|
107
|
-
LZO_STATS(lzo_stats->r0short_runs++);
|
108
|
-
}
|
109
|
-
else if (t > 0)
|
110
|
-
{
|
111
|
-
/* code a short literal run */
|
112
|
-
LZO_STATS(lzo_stats->lit_runs++);
|
113
|
-
LZO_STATS(lzo_stats->lit_run[t]++);
|
114
|
-
*op++ = LZO_BYTE(t);
|
115
|
-
MEMCPY_DS(op, ip, t);
|
116
|
-
}
|
117
|
-
|
118
|
-
return op;
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
#endif /* already included */
|
124
|
-
|
125
|
-
/*
|
126
|
-
vi:ts=4:et
|
127
|
-
*/
|
128
|
-
|