Re-integrate export-optimization branch.
[ardour.git] / libs / audiographer / src / gdither / gdither_types_internal.h
1 /*
2  *  Copyright (C) 2002 Steve Harris <steve@plugin.org.uk>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  */
19
20 #ifndef GDITHER_TYPES_H
21 #define GDITHER_TYPES_H
22
23 #include <stdint.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #define GDITHER_SH_BUF_SIZE 8
30 #define GDITHER_SH_BUF_MASK 7
31
32 /* this must agree with whats in gdither_types.h */
33 typedef enum {
34     GDitherNone = 0,
35     GDitherRect,
36     GDitherTri,
37     GDitherShaped
38 } GDitherType;
39
40 typedef enum {
41     GDither8bit = 8,
42     GDither16bit = 16,
43     GDither32bit = 32,
44     GDitherFloat = 25,
45     GDitherDouble = 54
46 } GDitherSize;
47
48 typedef struct {
49     uint32_t phase;
50     float buffer[GDITHER_SH_BUF_SIZE];
51 } GDitherShapedState;
52
53 typedef struct GDither_s {
54     GDitherType type;
55     uint32_t channels;
56     uint32_t bit_depth;
57     uint32_t dither_depth;
58     float scale;
59     uint32_t post_scale;
60     float post_scale_fp;
61     float bias;
62
63     int   clamp_u;
64
65     int   clamp_l;
66     float *tri_state;
67     GDitherShapedState *shaped_state;
68 } *GDither;
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif