10725
|
1 /* This program is licensed under the GNU Library General Public License, version 2,
|
|
2 * a copy of which is included with this program (with filename LICENSE.LGPL).
|
|
3 *
|
|
4 * (c) 2002 John Edwards
|
|
5 *
|
|
6 * rand_t header.
|
|
7 *
|
|
8 * last modified: $ID:$
|
|
9 */
|
|
10
|
|
11 #include "common.h"
|
|
12
|
|
13 #ifndef __RAND_T_H
|
|
14 #define __RAND_T_H
|
|
15
|
|
16 #ifdef __cplusplus
|
|
17 extern "C" {
|
|
18 #endif
|
|
19
|
|
20 #ifndef FIXED_POINT
|
|
21
|
|
22 typedef struct {
|
|
23 const float32_t* FilterCoeff;
|
|
24 uint64_t Mask;
|
|
25 double Add;
|
|
26 float32_t Dither;
|
|
27 float32_t ErrorHistory [2] [16]; // max. 2 channels, 16th order Noise shaping
|
|
28 float32_t DitherHistory [2] [16];
|
|
29 int32_t LastRandomNumber [2];
|
|
30 } dither_t;
|
|
31
|
|
32 extern dither_t Dither;
|
|
33 extern double doubletmp;
|
|
34 //static const uint8_t Parity [256];
|
|
35 uint32_t random_int ( void );
|
|
36 extern double scalar16 ( const float32_t* x, const float32_t* y );
|
|
37 extern double Random_Equi ( double mult );
|
|
38 extern double Random_Triangular ( double mult );
|
10989
|
39 void Init_Dither ( uint8_t bits, uint8_t shapingtype );
|
10725
|
40
|
|
41 #endif
|
|
42
|
|
43 #ifdef __cplusplus
|
|
44 }
|
|
45 #endif
|
|
46
|
|
47 #endif
|