-
Notifications
You must be signed in to change notification settings - Fork 5
/
dither.h
44 lines (36 loc) · 1.09 KB
/
dither.h
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
/* This program is licensed under the GNU Library General Public License, version 2,
* a copy of which is included with this program (with filename LICENSE.LGPL).
*
* (c) 2002 John Edwards
*
* rand_t header.
*
* last modified: $ID:$
*/
#ifndef __RAND_T_H
#define __RAND_T_H
#include "misc.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
const float* FilterCoeff;
Uint64_t Mask;
double Add;
float Dither;
float ErrorHistory [2] [16]; // max. 2 channels, 16th order Noise shaping
float DitherHistory [2] [16];
int LastRandomNumber [2];
} dither_t;
extern dither_t Dither;
extern double doubletmp;
static const unsigned char Parity [256];
unsigned int random_int ( void );
extern double scalar16 ( const float* x, const float* y );
extern double Random_Equi ( double mult );
extern double Random_Triangular ( double mult );
void Init_Dither ( int bits, int shapingtype );
#ifdef __cplusplus
}
#endif
#endif /* __RAND_T_H */