kusano 7d535a
/* stats1a.h -- statistics for the the LZO1A algorithm
kusano 7d535a
kusano 7d535a
   This file is part of the LZO real-time data compression library.
kusano 7d535a
kusano 7d535a
   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
kusano 7d535a
   All Rights Reserved.
kusano 7d535a
kusano 7d535a
   The LZO library is free software; you can redistribute it and/or
kusano 7d535a
   modify it under the terms of the GNU General Public License as
kusano 7d535a
   published by the Free Software Foundation; either version 2 of
kusano 7d535a
   the License, or (at your option) any later version.
kusano 7d535a
kusano 7d535a
   The LZO library is distributed in the hope that it will be useful,
kusano 7d535a
   but WITHOUT ANY WARRANTY; without even the implied warranty of
kusano 7d535a
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
kusano 7d535a
   GNU General Public License for more details.
kusano 7d535a
kusano 7d535a
   You should have received a copy of the GNU General Public License
kusano 7d535a
   along with the LZO library; see the file COPYING.
kusano 7d535a
   If not, write to the Free Software Foundation, Inc.,
kusano 7d535a
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
kusano 7d535a
kusano 7d535a
   Markus F.X.J. Oberhumer
kusano 7d535a
   <markus@oberhumer.com></markus@oberhumer.com>
kusano 7d535a
   http://www.oberhumer.com/opensource/lzo/
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
kusano 7d535a
/* WARNING: this file should *not* be used by applications. It is
kusano 7d535a
   part of the implementation of the LZO package and is subject
kusano 7d535a
   to change.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
kusano 7d535a
#ifndef __LZO_STATS1A_H
kusano 7d535a
#define __LZO_STATS1A_H
kusano 7d535a
kusano 7d535a
#ifdef __cplusplus
kusano 7d535a
extern "C" {
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
/***********************************************************************
kusano 7d535a
// collect statistical information when compressing
kusano 7d535a
// used for finetuning, view with a debugger
kusano 7d535a
************************************************************************/
kusano 7d535a
kusano 7d535a
#if defined(LZO_COLLECT_STATS)
kusano 7d535a
#  define LZO_STATS(expr)   expr
kusano 7d535a
#else
kusano 7d535a
#  define LZO_STATS(expr)   ((void) 0)
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
kusano 7d535a
/***********************************************************************
kusano 7d535a
//
kusano 7d535a
************************************************************************/
kusano 7d535a
kusano 7d535a
typedef struct {
kusano 7d535a
kusano 7d535a
/* configuration */
kusano 7d535a
    unsigned rbits;
kusano 7d535a
    unsigned clevel;
kusano 7d535a
kusano 7d535a
/* internal configuration */
kusano 7d535a
    unsigned dbits;
kusano 7d535a
    unsigned lbits;
kusano 7d535a
kusano 7d535a
/* constants */
kusano 7d535a
    unsigned min_match_short;
kusano 7d535a
    unsigned max_match_short;
kusano 7d535a
    unsigned min_match_long;
kusano 7d535a
    unsigned max_match_long;
kusano 7d535a
    unsigned min_offset;
kusano 7d535a
    unsigned max_offset;
kusano 7d535a
    unsigned r0min;
kusano 7d535a
    unsigned r0fast;
kusano 7d535a
    unsigned r0max;
kusano 7d535a
kusano 7d535a
/* counts */
kusano 7d535a
    long short_matches;
kusano 7d535a
    long long_matches;
kusano 7d535a
    long r1_matches;
kusano 7d535a
    long lit_runs;
kusano 7d535a
    long lit_runs_after_long_match;
kusano 7d535a
    long r0short_runs;
kusano 7d535a
    long r0fast_runs;
kusano 7d535a
    long r0long_runs;
kusano 7d535a
kusano 7d535a
/* */
kusano 7d535a
    long lit_run[RSIZE];
kusano 7d535a
    long lit_run_after_long_match[RSIZE];
kusano 7d535a
    long short_match[MAX_MATCH_SHORT + 1];
kusano 7d535a
    long long_match[MAX_MATCH_LONG + 1];
kusano 7d535a
    long marker[256];
kusano 7d535a
kusano 7d535a
/* these could prove useful for further optimizations */
kusano 7d535a
    long short_match_offset_osize[MAX_MATCH_SHORT + 1];
kusano 7d535a
    long short_match_offset_256[MAX_MATCH_SHORT + 1];
kusano 7d535a
    long short_match_offset_1024[MAX_MATCH_SHORT + 1];
kusano 7d535a
    long matches_out_of_range;
kusano 7d535a
    long matches_out_of_range_2;
kusano 7d535a
    long matches_out_of_range_4;
kusano 7d535a
    long match_out_of_range[MAX_MATCH_SHORT + 1];
kusano 7d535a
kusano 7d535a
/* */
kusano 7d535a
    long in_len;
kusano 7d535a
    long out_len;
kusano 7d535a
}
kusano 7d535a
lzo1a_stats_t;
kusano 7d535a
kusano 7d535a
extern lzo1a_stats_t *lzo1a_stats;
kusano 7d535a
kusano 7d535a
kusano 7d535a
kusano 7d535a
#ifdef __cplusplus
kusano 7d535a
} /* extern "C" */
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
#endif /* already included */
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
vi:ts=4:et
kusano 7d535a
*/