Debian Codegraph @

converter/other/fiasco/codec/domain-pool.h

raw
1 /*
2 * domain-pool.h
3 *
4 * Written by: Ullrich Hafner
5 *
6 * This file is part of FIASCO (Fractal Image And Sequence COdec)
7 * Copyright (C) 1994-2000 Ullrich Hafner
8 */
9
10 /*
11 * $Date: 2000/06/14 20:50:51 $
12 * $Author: hafner $
13 * $Revision: 5.1 $
14 * $State: Exp $
15 */
16
17 #ifndef _DOMAIN_POOL_H
18 #define _DOMAIN_POOL_H
19
20 #include "cwfa.h"
21 #include "types.h"
22
23 typedef struct domain_pool
24 {
25 void *model; /* probability model */
26 word_t *(*generate) (unsigned level, int y_state, const wfa_t *wfa,
27 const void *model);
28 /*
29 * Generate set of domain images which may be used for an approximation.
30 * Use parameters 'level', 'y_state' and 'wfa' to make the decision.
31 */
32 real_t (*bits) (const word_t *domains, const word_t *used_domains,
33 unsigned level, int y_state, const wfa_t *wfa,
34 const void *model);
35 /*
36 * Compute bit-rate of a range approximation with domains given by
37 * the -1 terminated list 'used_domains'.
38 */
39 void (*update) (const word_t *domains, const word_t *used_domains,
40 unsigned level, int y_state, const wfa_t *wfa,
41 void *model);
42 /*
43 * Update the probability model according to the chosen approximation.
44 * (given by the -1 terminated list 'used_domains').
45 */
46 bool_t (*append) (unsigned state, unsigned level, const wfa_t *wfa,
47 void *model);
48 /*
49 * Try to append a new state to the domain pool.
50 */
51 void (*chroma) (unsigned max_domains, const wfa_t *wfa, void *model);
52 /*
53 * Derive a new domain pool that will be used for chroma channel
54 * coding
55 */
56 void (*free) (struct domain_pool *pool);
57 /*
58 * Discard the given domain pool struct.
59 */
60 void (*model_free) (void *model);
61 /*
62 * Free given probability model.
63 */
64 void *(*model_duplicate) (const void *src);
65 /*
66 * Duplicate the given probability model (i.e. alloc and copy).
67 */
68 } domain_pool_t;
69
70 domain_pool_t *
71 alloc_domain_pool (const char *domain_pool_name, unsigned max_domains,
72 unsigned max_edges, const wfa_t *wfa);
73
74 #endif /* not _DOMAIN_POOL_H */
75