PortAudio  2.0
pa_dither.h
Go to the documentation of this file.
1 #ifndef PA_DITHER_H
2 #define PA_DITHER_H
3 /*
4  * $Id$
5  * Portable Audio I/O Library triangular dither generator
6  *
7  * Based on the Open Source API proposed by Ross Bencina
8  * Copyright (c) 1999-2002 Phil Burk, Ross Bencina
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining
11  * a copy of this software and associated documentation files
12  * (the "Software"), to deal in the Software without restriction,
13  * including without limitation the rights to use, copy, modify, merge,
14  * publish, distribute, sublicense, and/or sell copies of the Software,
15  * and to permit persons to whom the Software is furnished to do so,
16  * subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
25  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  */
29 
30 /*
31  * The text above constitutes the entire PortAudio license; however,
32  * the PortAudio community also makes the following non-binding requests:
33  *
34  * Any person wishing to distribute modifications to the Software is
35  * requested to send the modifications to the original developer so that
36  * they can be incorporated into the canonical version. It is also
37  * requested that these non-binding requests be included along with the
38  * license above.
39  */
40 
47 #include "pa_types.h"
48 
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif /* __cplusplus */
54 
55 /* Note that the linear congruential algorithm requires 32 bit integers
56  * because it uses arithmetic overflow. So use PaUint32 instead of
57  * unsigned long so it will work on 64 bit systems.
58  */
59 
66 
67 
70 
71 
85 
86 
100 
101 
102 
103 #ifdef __cplusplus
104 }
105 #endif /* __cplusplus */
106 #endif /* PA_DITHER_H */
PaInt32 PaUtil_Generate16BitTriangularDither(PaUtilTriangularDitherGenerator *state)
Calculate 2 LSB dither signal with a triangular distribution. Ranged for adding to a 1 bit right-shif...
Definition: pa_dither.c:65
unsigned int PaUint32
Definition: pa_types.h:84
Definition of 16 and 32 bit integer types (PaInt16, PaInt32 etc)
signed int PaInt32
Definition: pa_types.h:83
float PaUtil_GenerateFloatTriangularDither(PaUtilTriangularDitherGenerator *state)
Calculate 2 LSB dither signal with a triangular distribution. Ranged for adding to a pre-scaled float...
Definition: pa_dither.c:93
PaUint32 randSeed1
Definition: pa_dither.h:63
PaUint32 randSeed2
Definition: pa_dither.h:64
struct PaUtilTriangularDitherGenerator PaUtilTriangularDitherGenerator
State needed to generate a dither signal.
PaUint32 previous
Definition: pa_dither.h:62
void PaUtil_InitializeTriangularDitherState(PaUtilTriangularDitherGenerator *state)
Initialize dither state.
Definition: pa_dither.c:57
State needed to generate a dither signal.
Definition: pa_dither.h:61