30 #define OUTBUF_PADDED 1
32 #define INBUF_PADDED 1
53 #define GETB(c) (*(c).in++)
55 #define GETB(c) get_byte(&(c))
83 if (cnt > c->
in_end - src) {
91 #if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
98 memcpy(dst, src, cnt);
115 if (src < c->out_start || src > dst) {
132 if (*outlen <= 0 || *inlen <= 0) {
159 back = (
GETB(c) << 3) + ((x >> 2) & 7) + 1;
163 back = (
GETB(c) << 6) + (x >> 2) + 1;
166 back = (1 << 14) + ((x & 8) << 11);
168 back += (
GETB(c) << 6) + (x >> 2);
169 if (back == (1 << 14)) {
182 back = (1 << 11) + (
GETB(c) << 2) + (x >> 2) + 1;
185 back = (
GETB(c) << 2) + (x >> 2) + 1;
202 #include <lzo/lzo1x.h>
204 #define MAXSZ (10*1024*1024)
208 #define BENCHMARK_LIBLZO_SAFE 0
209 #define BENCHMARK_LIBLZO_UNSAFE 0
211 int main(
int argc,
char *argv[]) {
212 FILE *
in = fopen(argv[1],
"rb");
216 size_t s = fread(orig, 1, MAXSZ, in);
218 long tmp[LZO1X_MEM_COMPRESS];
222 lzo1x_999_compress(orig, s, comp, &clen, tmp);
223 for (i = 0; i < 300; i++) {
225 inlen = clen; outlen = MAXSZ;
226 #if BENCHMARK_LIBLZO_SAFE
227 if (lzo1x_decompress_safe(comp, inlen, decomp, &outlen,
NULL))
228 #elif BENCHMARK_LIBLZO_UNSAFE
229 if (lzo1x_decompress(comp, inlen, decomp, &outlen,
NULL))
236 if (memcmp(orig, decomp, s))