about summary refs log tree commit diff
path: root/converter/other/fiasco/codec/bintree.h
blob: 3dc88ac1015de502e5edddaa1c619b286c8c085a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 *  bintree.h
 *
 *  Written by:		Ullrich Hafner
 *		
 *  This file is part of FIASCO (Fractal Image And Sequence COdec)
 *  Copyright (C) 1994-2000 Ullrich Hafner
 */

/*
 *  $Date: 2000/06/14 20:50:51 $
 *  $Author: hafner $
 *  $Revision: 5.1 $
 *  $State: Exp $
 */

#ifndef _BINTREE_H
#define _BINTREE_H

#include "wfa.h"
#include "types.h"

typedef struct tree
/*
 *  Used for estimating the number of bits needed for storing the
 *  tree array. For each level a different context is used.
 *  The binary alphabet consists of the two symbols NO_RANGE and RANGE,
 *  which indicate whether there exists a tree edge or not.
 */
{
   unsigned counts [MAXLEVEL];		/* # NO_RANGE symbols at given level */
   unsigned total [MAXLEVEL];		/* total number of symbols at  ''   */
} tree_t;

real_t
tree_bits (bool_t child, unsigned level, const tree_t *model);
void
init_tree_model (tree_t *tree_model);
void
tree_update (bool_t child, unsigned level, tree_t *model);

#endif /* not _BINTREE_H */