OpenShot Audio Library | OpenShotAudio: juce_FloatVectorOperations.h Source File

OpenShot Audio Library | OpenShotAudio 0.3.2

Loading...
Searching...
No Matches
juce_FloatVectorOperations.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26#ifndef JUCE_SNAP_TO_ZERO
27 #if JUCE_INTEL
28 #define JUCE_SNAP_TO_ZERO(n) if (! (n < -1.0e-8f || n > 1.0e-8f)) n = 0;
29 #else
30 #define JUCE_SNAP_TO_ZERO(n) ignoreUnused (n)
31 #endif
32#endif
33class ScopedNoDenormals;
34
35//==============================================================================
42 class JUCE_API FloatVectorOperations
43{
44public:
45 //==============================================================================
47 static void JUCE_CALLTYPE clear (float* dest, int numValues) noexcept;
48
50 static void JUCE_CALLTYPE clear (double* dest, int numValues) noexcept;
51
53 static void JUCE_CALLTYPE fill (float* dest, float valueToFill, int numValues) noexcept;
54
56 static void JUCE_CALLTYPE fill (double* dest, double valueToFill, int numValues) noexcept;
57
59 static void JUCE_CALLTYPE copy (float* dest, const float* src, int numValues) noexcept;
60
62 static void JUCE_CALLTYPE copy (double* dest, const double* src, int numValues) noexcept;
63
65 static void JUCE_CALLTYPE copyWithMultiply (float* dest, const float* src, float multiplier, int numValues) noexcept;
66
68 static void JUCE_CALLTYPE copyWithMultiply (double* dest, const double* src, double multiplier, int numValues) noexcept;
69
71 static void JUCE_CALLTYPE add (float* dest, float amountToAdd, int numValues) noexcept;
72
74 static void JUCE_CALLTYPE add (double* dest, double amountToAdd, int numValues) noexcept;
75
77 static void JUCE_CALLTYPE add (float* dest, const float* src, float amount, int numValues) noexcept;
78
80 static void JUCE_CALLTYPE add (double* dest, const double* src, double amount, int numValues) noexcept;
81
83 static void JUCE_CALLTYPE add (float* dest, const float* src, int numValues) noexcept;
84
86 static void JUCE_CALLTYPE add (double* dest, const double* src, int numValues) noexcept;
87
89 static void JUCE_CALLTYPE add (float* dest, const float* src1, const float* src2, int num) noexcept;
90
92 static void JUCE_CALLTYPE add (double* dest, const double* src1, const double* src2, int num) noexcept;
93
95 static void JUCE_CALLTYPE subtract (float* dest, const float* src, int numValues) noexcept;
96
98 static void JUCE_CALLTYPE subtract (double* dest, const double* src, int numValues) noexcept;
99
101 static void JUCE_CALLTYPE subtract (float* dest, const float* src1, const float* src2, int num) noexcept;
102
104 static void JUCE_CALLTYPE subtract (double* dest, const double* src1, const double* src2, int num) noexcept;
105
107 static void JUCE_CALLTYPE addWithMultiply (float* dest, const float* src, float multiplier, int numValues) noexcept;
108
110 static void JUCE_CALLTYPE addWithMultiply (double* dest, const double* src, double multiplier, int numValues) noexcept;
111
113 static void JUCE_CALLTYPE addWithMultiply (float* dest, const float* src1, const float* src2, int num) noexcept;
114
116 static void JUCE_CALLTYPE addWithMultiply (double* dest, const double* src1, const double* src2, int num) noexcept;
117
119 static void JUCE_CALLTYPE subtractWithMultiply (float* dest, const float* src, float multiplier, int numValues) noexcept;
120
122 static void JUCE_CALLTYPE subtractWithMultiply (double* dest, const double* src, double multiplier, int numValues) noexcept;
123
125 static void JUCE_CALLTYPE subtractWithMultiply (float* dest, const float* src1, const float* src2, int num) noexcept;
126
128 static void JUCE_CALLTYPE subtractWithMultiply (double* dest, const double* src1, const double* src2, int num) noexcept;
129
131 static void JUCE_CALLTYPE multiply (float* dest, const float* src, int numValues) noexcept;
132
134 static void JUCE_CALLTYPE multiply (double* dest, const double* src, int numValues) noexcept;
135
137 static void JUCE_CALLTYPE multiply (float* dest, const float* src1, const float* src2, int numValues) noexcept;
138
140 static void JUCE_CALLTYPE multiply (double* dest, const double* src1, const double* src2, int numValues) noexcept;
141
143 static void JUCE_CALLTYPE multiply (float* dest, float multiplier, int numValues) noexcept;
144
146 static void JUCE_CALLTYPE multiply (double* dest, double multiplier, int numValues) noexcept;
147
149 static void JUCE_CALLTYPE multiply (float* dest, const float* src, float multiplier, int num) noexcept;
150
152 static void JUCE_CALLTYPE multiply (double* dest, const double* src, double multiplier, int num) noexcept;
153
155 static void JUCE_CALLTYPE negate (float* dest, const float* src, int numValues) noexcept;
156
158 static void JUCE_CALLTYPE negate (double* dest, const double* src, int numValues) noexcept;
159
161 static void JUCE_CALLTYPE abs (float* dest, const float* src, int numValues) noexcept;
162
164 static void JUCE_CALLTYPE abs (double* dest, const double* src, int numValues) noexcept;
165
167 static void JUCE_CALLTYPE convertFixedToFloat (float* dest, const int* src, float multiplier, int numValues) noexcept;
168
170 static void JUCE_CALLTYPE min (float* dest, const float* src, float comp, int num) noexcept;
171
173 static void JUCE_CALLTYPE min (double* dest, const double* src, double comp, int num) noexcept;
174
176 static void JUCE_CALLTYPE min (float* dest, const float* src1, const float* src2, int num) noexcept;
177
179 static void JUCE_CALLTYPE min (double* dest, const double* src1, const double* src2, int num) noexcept;
180
182 static void JUCE_CALLTYPE max (float* dest, const float* src, float comp, int num) noexcept;
183
185 static void JUCE_CALLTYPE max (double* dest, const double* src, double comp, int num) noexcept;
186
188 static void JUCE_CALLTYPE max (float* dest, const float* src1, const float* src2, int num) noexcept;
189
191 static void JUCE_CALLTYPE max (double* dest, const double* src1, const double* src2, int num) noexcept;
192
194 static void JUCE_CALLTYPE clip (float* dest, const float* src, float low, float high, int num) noexcept;
195
197 static void JUCE_CALLTYPE clip (double* dest, const double* src, double low, double high, int num) noexcept;
198
200 static Range<float> JUCE_CALLTYPE findMinAndMax (const float* src, int numValues) noexcept;
201
203 static Range<double> JUCE_CALLTYPE findMinAndMax (const double* src, int numValues) noexcept;
204
206 static float JUCE_CALLTYPE findMinimum (const float* src, int numValues) noexcept;
207
209 static double JUCE_CALLTYPE findMinimum (const double* src, int numValues) noexcept;
210
212 static float JUCE_CALLTYPE findMaximum (const float* src, int numValues) noexcept;
213
215 static double JUCE_CALLTYPE findMaximum (const double* src, int numValues) noexcept;
216
218 static void JUCE_CALLTYPE enableFlushToZeroMode (bool shouldEnable) noexcept;
219
226 static void JUCE_CALLTYPE disableDenormalisedNumberSupport (bool shouldDisable = true) noexcept;
227
229 static bool JUCE_CALLTYPE areDenormalsDisabled() noexcept;
230
231private:
232 friend ScopedNoDenormals;
233
234 static intptr_t JUCE_CALLTYPE getFpStatusRegister() noexcept;
235 static void JUCE_CALLTYPE setFpStatusRegister (intptr_t) noexcept;
236};
237
238//==============================================================================
245 class ScopedNoDenormals
246{
247public:
248 ScopedNoDenormals() noexcept;
249 ~ScopedNoDenormals() noexcept;
250
251private:
252 #if JUCE_USE_SSE_INTRINSICS || (JUCE_USE_ARM_NEON || defined (__arm64__) || defined (__aarch64__))
253 intptr_t fpsr;
254 #endif
255};
256
257} // namespace juce
juce::FloatVectorOperations
Definition: juce_FloatVectorOperations.h:43
juce::Range
Definition: juce_Range.h:40
juce::ScopedNoDenormals
Definition: juce_FloatVectorOperations.h:246