about summary refs log tree commit diff
path: root/converter/other/fiasco/codec/wfalib.h
blob: 63723f300832703898af4561ce7d40eafa4da5f8 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 *  wfalib.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 _WFALIB_H
#define _WFALIB_H

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

typedef struct range_sort
{
   u_word_t *range_state;
   byte_t   *range_label;
   u_word_t *range_max_domain;
   bool_t   *range_subdivided;
   unsigned  range_no;
} range_sort_t;

bool_t
locate_delta_images (wfa_t *wfa);
void
sort_ranges (unsigned state, unsigned *domain,
             range_sort_t *rs, const wfa_t *wfa);
bool_t
find_range (unsigned x, unsigned y, unsigned band,
            const wfa_t *wfa, unsigned *range_state, unsigned *range_label);
void
compute_spiral (int *vorder, unsigned image_width, unsigned image_height,
                unsigned tiling_exp, bool_t inc_spiral);
void
locate_subimage (unsigned orig_level, unsigned level, unsigned bintree,
                 unsigned *x, unsigned *y, unsigned *width, unsigned *height);
void
copy_wfa (wfa_t *dst, const wfa_t *src);
void
remove_states (unsigned from, wfa_t *wfa);
void
append_edge (unsigned from, unsigned into, real_t weight,
             unsigned label, wfa_t *wfa);
word_t *
compute_hits (unsigned from, unsigned to, unsigned n, const wfa_t *wfa);
real_t
compute_final_distribution (unsigned state, const wfa_t *wfa);
wfa_t *
alloc_wfa (bool_t coding);
void
free_wfa (wfa_t *wfa);
bool_t
locate_delta_images (wfa_t *wfa);

#endif /* not _WFALIB_H */