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 #ifndef __RAND_T_H 12 #define __RAND_T_H 13 14 #include "misc.h" 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 typedef struct { 21 const float* FilterCoeff; 22 Uint64_t Mask; 23 double Add; 24 float Dither; 25 float ErrorHistory [2] [16]; // max. 2 channels, 16th order Noise shaping 26 float DitherHistory [2] [16]; 27 int LastRandomNumber [2]; 28 } dither_t; 29 30 extern dither_t Dither; 31 extern double doubletmp; 32 static const unsigned char Parity [256]; 33 unsigned int random_int ( void ); 34 extern double scalar16 ( const float* x, const float* y ); 35 extern double Random_Equi ( double mult ); 36 extern double Random_Triangular ( double mult ); 37 void Init_Dither ( int bits, int shapingtype ); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif /* __RAND_T_H */ 44 45