Blame src/stats1b.h

Packit Service 5195f2
/* stats1b.h -- statistics for the the LZO library
Packit Service 5195f2
Packit Service 5195f2
   This file is part of the LZO real-time data compression library.
Packit Service 5195f2
Packit Service 5195f2
   Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
Packit Service 5195f2
   All Rights Reserved.
Packit Service 5195f2
Packit Service 5195f2
   The LZO library is free software; you can redistribute it and/or
Packit Service 5195f2
   modify it under the terms of the GNU General Public License as
Packit Service 5195f2
   published by the Free Software Foundation; either version 2 of
Packit Service 5195f2
   the License, or (at your option) any later version.
Packit Service 5195f2
Packit Service 5195f2
   The LZO library is distributed in the hope that it will be useful,
Packit Service 5195f2
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 5195f2
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 5195f2
   GNU General Public License for more details.
Packit Service 5195f2
Packit Service 5195f2
   You should have received a copy of the GNU General Public License
Packit Service 5195f2
   along with the LZO library; see the file COPYING.
Packit Service 5195f2
   If not, write to the Free Software Foundation, Inc.,
Packit Service 5195f2
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit Service 5195f2
Packit Service 5195f2
   Markus F.X.J. Oberhumer
Packit Service 5195f2
   <markus@oberhumer.com>
Packit Service 5195f2
   http://www.oberhumer.com/opensource/lzo/
Packit Service 5195f2
 */
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
/* WARNING: this file should *not* be used by applications. It is
Packit Service 5195f2
   part of the implementation of the library and is subject
Packit Service 5195f2
   to change.
Packit Service 5195f2
 */
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
#ifndef __LZO_STATS1B_H
Packit Service 5195f2
#define __LZO_STATS1B_H 1
Packit Service 5195f2
Packit Service 5195f2
#ifdef __cplusplus
Packit Service 5195f2
extern "C" {
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
/***********************************************************************
Packit Service 5195f2
// Collect statistical information when compressing.
Packit Service 5195f2
// Useful for finetuning the compression algorithm.
Packit Service 5195f2
// Examine the symbol 'lzo1b_stats' with a debugger.
Packit Service 5195f2
************************************************************************/
Packit Service 5195f2
Packit Service 5195f2
#if (LZO_COLLECT_STATS)
Packit Service 5195f2
#  define LZO_STATS(expr)   expr
Packit Service 5195f2
#else
Packit Service 5195f2
#  define LZO_STATS(expr)   ((void) 0)
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
#if (LZO_COLLECT_STATS)
Packit Service 5195f2
Packit Service 5195f2
typedef struct
Packit Service 5195f2
{
Packit Service 5195f2
/* algorithm configuration */
Packit Service 5195f2
    unsigned r_bits;
Packit Service 5195f2
    unsigned m3o_bits;
Packit Service 5195f2
    unsigned dd_bits;
Packit Service 5195f2
    unsigned clevel;
Packit Service 5195f2
Packit Service 5195f2
/* internal configuration */
Packit Service 5195f2
    unsigned d_bits;
Packit Service 5195f2
    long min_lookahead;
Packit Service 5195f2
    long max_lookbehind;
Packit Service 5195f2
    const char *compress_id;
Packit Service 5195f2
Packit Service 5195f2
/* counts */
Packit Service 5195f2
    long lit_runs;
Packit Service 5195f2
    long r0short_runs;
Packit Service 5195f2
    long r0fast_runs;
Packit Service 5195f2
    long r0long_runs;
Packit Service 5195f2
    long m1_matches;
Packit Service 5195f2
    long m2_matches;
Packit Service 5195f2
    long m3_matches;
Packit Service 5195f2
    long m4_matches;
Packit Service 5195f2
    long r1_matches;
Packit Service 5195f2
Packit Service 5195f2
/* */
Packit Service 5195f2
    long lit_run[R0MIN];
Packit Service 5195f2
    long m2_match[M2_MAX_LEN + 1];
Packit Service 5195f2
    long m3_match[M3_MAX_LEN + 1];
Packit Service 5195f2
#if (M3O_BITS < 8)
Packit Service 5195f2
    long lit_runs_after_m3_match;
Packit Service 5195f2
    long lit_run_after_m3_match[LZO_SIZE(8-M3O_BITS)];
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
/* */
Packit Service 5195f2
    long matches;
Packit Service 5195f2
    long match_bytes;
Packit Service 5195f2
    long literals;
Packit Service 5195f2
    long literal_overhead;
Packit Service 5195f2
    long literal_bytes;
Packit Service 5195f2
    double literal_overhead_percent;
Packit Service 5195f2
Packit Service 5195f2
/* */
Packit Service 5195f2
    long unused_dict_entries;
Packit Service 5195f2
    double unused_dict_entries_percent;
Packit Service 5195f2
Packit Service 5195f2
/* */
Packit Service 5195f2
    long in_len;
Packit Service 5195f2
    long out_len;
Packit Service 5195f2
}
Packit Service 5195f2
lzo1b_stats_t;
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
void _lzo1b_stats_init(lzo1b_stats_t *lzo_stats);
Packit Service 5195f2
void _lzo1b_stats_calc(lzo1b_stats_t *lzo_stats);
Packit Service 5195f2
Packit Service 5195f2
extern lzo1b_stats_t * const lzo1b_stats;
Packit Service 5195f2
Packit Service 5195f2
#define lzo_stats_t     lzo1b_stats_t
Packit Service 5195f2
#define lzo_stats       lzo1b_stats
Packit Service 5195f2
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
Packit Service 5195f2
#ifdef __cplusplus
Packit Service 5195f2
} /* extern "C" */
Packit Service 5195f2
#endif
Packit Service 5195f2
Packit Service 5195f2
#endif /* already included */
Packit Service 5195f2
Packit Service 5195f2
/*
Packit Service 5195f2
vi:ts=4:et
Packit Service 5195f2
*/