Blame src/config2a.h

Packit 679830
/* config2a.h -- configuration for the LZO2A algorithm
Packit 679830
Packit 679830
   This file is part of the LZO real-time data compression library.
Packit 679830
Packit 679830
   Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
Packit 679830
   All Rights Reserved.
Packit 679830
Packit 679830
   The LZO library is free software; you can redistribute it and/or
Packit 679830
   modify it under the terms of the GNU General Public License as
Packit 679830
   published by the Free Software Foundation; either version 2 of
Packit 679830
   the License, or (at your option) any later version.
Packit 679830
Packit 679830
   The LZO library is distributed in the hope that it will be useful,
Packit 679830
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 679830
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 679830
   GNU General Public License for more details.
Packit 679830
Packit 679830
   You should have received a copy of the GNU General Public License
Packit 679830
   along with the LZO library; see the file COPYING.
Packit 679830
   If not, write to the Free Software Foundation, Inc.,
Packit 679830
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 679830
Packit 679830
   Markus F.X.J. Oberhumer
Packit 679830
   <markus@oberhumer.com>
Packit 679830
   http://www.oberhumer.com/opensource/lzo/
Packit 679830
 */
Packit 679830
Packit 679830
Packit 679830
/* WARNING: this file should *not* be used by applications. It is
Packit 679830
   part of the implementation of the library and is subject
Packit 679830
   to change.
Packit 679830
 */
Packit 679830
Packit 679830
Packit 679830
#ifndef __LZO_CONFIG2A_H
Packit 679830
#define __LZO_CONFIG2A_H 1
Packit 679830
Packit 679830
#include "lzo_conf.h"
Packit 679830
#include "lzo/lzo2a.h"
Packit 679830
Packit 679830
Packit 679830
/***********************************************************************
Packit 679830
// algorithm configuration
Packit 679830
************************************************************************/
Packit 679830
Packit 679830
/* dictionary depth (0 - 6) - this only affects the compressor.
Packit 679830
 * 0 is fastest, 6 is best compression ratio */
Packit 679830
#if !defined(DDBITS)
Packit 679830
#  define DDBITS    0
Packit 679830
#endif
Packit 679830
Packit 679830
/* compression level (1 - 9) - this only affects the compressor.
Packit 679830
 * 1 is fastest, 9 is best compression ratio */
Packit 679830
#if !defined(CLEVEL)
Packit 679830
#  define CLEVEL    1           /* fastest by default */
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
/* check configuration */
Packit 679830
#if (DDBITS < 0 || DDBITS > 6)
Packit 679830
#  error "invalid DDBITS"
Packit 679830
#endif
Packit 679830
#if (CLEVEL < 1 || CLEVEL > 9)
Packit 679830
#  error "invalid CLEVEL"
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
/***********************************************************************
Packit 679830
// internal configuration
Packit 679830
************************************************************************/
Packit 679830
Packit 679830
#if 1
Packit 679830
#define SWD_N        8191           /* size of ring buffer */
Packit 679830
#else
Packit 679830
#define SWD_N       16383           /* size of ring buffer */
Packit 679830
#endif
Packit 679830
Packit 679830
#define M1_MIN_LEN  2
Packit 679830
#define M1_MAX_LEN  5
Packit 679830
#define M2_MIN_LEN  3
Packit 679830
#define M3_MIN_LEN  3
Packit 679830
Packit 679830
Packit 679830
/* add a special code so that the decompressor can detect the
Packit 679830
 * end of the compressed data block (overhead is 3 bytes per block) */
Packit 679830
#define LZO_EOF_CODE 1
Packit 679830
Packit 679830
#undef LZO_DETERMINISTIC
Packit 679830
Packit 679830
Packit 679830
/***********************************************************************
Packit 679830
// algorithm internal configuration
Packit 679830
************************************************************************/
Packit 679830
Packit 679830
/* choose the hashing strategy */
Packit 679830
#ifndef LZO_HASH
Packit 679830
#define LZO_HASH        LZO_HASH_LZO_INCREMENTAL_A
Packit 679830
#endif
Packit 679830
Packit 679830
/* config */
Packit 679830
#define DD_BITS         DDBITS
Packit 679830
#ifndef D_BITS
Packit 679830
#define D_BITS          14
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
Packit 679830
/***********************************************************************
Packit 679830
// optimization and debugging
Packit 679830
************************************************************************/
Packit 679830
Packit 679830
/* Collect statistics */
Packit 679830
#if 0 && !defined(LZO_COLLECT_STATS)
Packit 679830
#  define LZO_COLLECT_STATS 1
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
/***********************************************************************
Packit 679830
//
Packit 679830
************************************************************************/
Packit 679830
Packit 679830
/* get bits */
Packit 679830
#define _NEEDBITS \
Packit 679830
    { _NEEDBYTE; b |= ((lzo_uint32_t) _NEXTBYTE) << k; k += 8; assert(k <= 32); }
Packit 679830
#define NEEDBITS(j)     { assert((j) < 8); if (k < (j)) _NEEDBITS }
Packit 679830
Packit 679830
/* set bits */
Packit 679830
#define SETBITS(j,x)    { b |= ((lzo_uint32_t)(x)) << k; k += (j); assert(k <= 32); }
Packit 679830
Packit 679830
/* access bits */
Packit 679830
#define MASKBITS(j)     (b & ((((lzo_uint32_t)1 << (j)) - 1)))
Packit 679830
Packit 679830
/* drop bits */
Packit 679830
#define DUMPBITS(j)     { assert(k >= j); b >>= (j); k -= (j); }
Packit 679830
Packit 679830
Packit 679830
Packit 679830
#endif /* already included */
Packit 679830
Packit 679830
/*
Packit 679830
vi:ts=4:et
Packit 679830
*/
Packit 679830