Blame src/stats1b.h

Packit 679830
/* stats1b.h -- statistics for the the LZO library
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_STATS1B_H
Packit 679830
#define __LZO_STATS1B_H 1
Packit 679830
Packit 679830
#ifdef __cplusplus
Packit 679830
extern "C" {
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
/***********************************************************************
Packit 679830
// Collect statistical information when compressing.
Packit 679830
// Useful for finetuning the compression algorithm.
Packit 679830
// Examine the symbol 'lzo1b_stats' with a debugger.
Packit 679830
************************************************************************/
Packit 679830
Packit 679830
#if (LZO_COLLECT_STATS)
Packit 679830
#  define LZO_STATS(expr)   expr
Packit 679830
#else
Packit 679830
#  define LZO_STATS(expr)   ((void) 0)
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
#if (LZO_COLLECT_STATS)
Packit 679830
Packit 679830
typedef struct
Packit 679830
{
Packit 679830
/* algorithm configuration */
Packit 679830
    unsigned r_bits;
Packit 679830
    unsigned m3o_bits;
Packit 679830
    unsigned dd_bits;
Packit 679830
    unsigned clevel;
Packit 679830
Packit 679830
/* internal configuration */
Packit 679830
    unsigned d_bits;
Packit 679830
    long min_lookahead;
Packit 679830
    long max_lookbehind;
Packit 679830
    const char *compress_id;
Packit 679830
Packit 679830
/* counts */
Packit 679830
    long lit_runs;
Packit 679830
    long r0short_runs;
Packit 679830
    long r0fast_runs;
Packit 679830
    long r0long_runs;
Packit 679830
    long m1_matches;
Packit 679830
    long m2_matches;
Packit 679830
    long m3_matches;
Packit 679830
    long m4_matches;
Packit 679830
    long r1_matches;
Packit 679830
Packit 679830
/* */
Packit 679830
    long lit_run[R0MIN];
Packit 679830
    long m2_match[M2_MAX_LEN + 1];
Packit 679830
    long m3_match[M3_MAX_LEN + 1];
Packit 679830
#if (M3O_BITS < 8)
Packit 679830
    long lit_runs_after_m3_match;
Packit 679830
    long lit_run_after_m3_match[LZO_SIZE(8-M3O_BITS)];
Packit 679830
#endif
Packit 679830
Packit 679830
/* */
Packit 679830
    long matches;
Packit 679830
    long match_bytes;
Packit 679830
    long literals;
Packit 679830
    long literal_overhead;
Packit 679830
    long literal_bytes;
Packit 679830
    double literal_overhead_percent;
Packit 679830
Packit 679830
/* */
Packit 679830
    long unused_dict_entries;
Packit 679830
    double unused_dict_entries_percent;
Packit 679830
Packit 679830
/* */
Packit 679830
    long in_len;
Packit 679830
    long out_len;
Packit 679830
}
Packit 679830
lzo1b_stats_t;
Packit 679830
Packit 679830
Packit 679830
void _lzo1b_stats_init(lzo1b_stats_t *lzo_stats);
Packit 679830
void _lzo1b_stats_calc(lzo1b_stats_t *lzo_stats);
Packit 679830
Packit 679830
extern lzo1b_stats_t * const lzo1b_stats;
Packit 679830
Packit 679830
#define lzo_stats_t     lzo1b_stats_t
Packit 679830
#define lzo_stats       lzo1b_stats
Packit 679830
Packit 679830
#endif
Packit 679830
Packit 679830
Packit 679830
#ifdef __cplusplus
Packit 679830
} /* extern "C" */
Packit 679830
#endif
Packit 679830
Packit 679830
#endif /* already included */
Packit 679830
Packit 679830
/*
Packit 679830
vi:ts=4:et
Packit 679830
*/