about summary refs log tree commit diff
path: root/converter/other/fiasco/codec/domain-pool.h
blob: a2c46141375923123459e814799a0cdefe2a3924 (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
67
68
69
70
71
72
73
74
75
/*
 *  domain-pool.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 _DOMAIN_POOL_H
#define _DOMAIN_POOL_H

#include "cwfa.h"
#include "types.h"

typedef struct domain_pool
{
   void	  *model;			/* probability model */
   word_t *(*generate) (unsigned level, int y_state, const wfa_t *wfa,
			const void  *model);
   /*
    *  Generate set of domain images which may be used for an approximation.
    *  Use parameters 'level', 'y_state' and 'wfa' to make the decision.
    */
   real_t (*bits) (const word_t *domains, const word_t *used_domains,
		   unsigned level, int y_state, const wfa_t *wfa,
		   const void *model);
   /*
    *  Compute bit-rate of a range approximation with domains given by
    *  the -1 terminated list 'used_domains'.
    */
   void	  (*update) (const word_t *domains, const word_t *used_domains,
		     unsigned level, int y_state, const wfa_t *wfa,
		     void *model);
   /*
    *  Update the probability model according to the chosen approximation.
    *  (given by the -1 terminated list 'used_domains').
    */
   bool_t (*append) (unsigned state, unsigned level, const wfa_t *wfa,
		     void *model);
   /*
    *  Try to append a new state to the domain pool.
    */
   void	  (*chroma) (unsigned max_domains, const wfa_t *wfa, void *model);
   /*
    *  Derive a new domain pool that will be used for chroma channel
    *  coding 
    */
   void   (*free) (struct domain_pool *pool);
   /*
    *  Discard the given domain pool struct.
    */
   void   (*model_free)	(void *model);
   /*
    *  Free given probability model.
    */
   void   *(*model_duplicate) (const void *src);
   /*
    *  Duplicate the given probability model (i.e. alloc and copy).
    */
} domain_pool_t;

domain_pool_t *
alloc_domain_pool (const char *domain_pool_name, unsigned max_domains,
		   unsigned max_edges, const wfa_t *wfa);

#endif /* not _DOMAIN_POOL_H */