Skip to content

Commit 60416e7

Browse files
committed
Release 1.0.33
* Added clamp and pmix functions. * Updated module versions in dependencies.
2 parents ae46ff5 + c1bc838 commit 60416e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+7065
-11
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.33 ===
6+
* Added clamp and pmix functions.
7+
* Updated module versions in dependencies.
8+
59
=== 1.0.32 ===
610
* Fixed compilation warnings for Clang.
711

include/lsp-plug.in/dsp/common/pcomplex.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,32 @@ LSP_DSP_LIB_SYMBOL(void, pcomplex_c2r, float *dst, const float *src, size_t coun
119119

120120
/** Get module for complex numbers: mod = sqrt(re*re + im*im)
121121
*
122-
* @param dst_mod array to sore module
122+
* @param dst_mod array to store module
123123
* @param src packed complex number data
124124
* @param count count number of elements to process
125125
*/
126126
LSP_DSP_LIB_SYMBOL(void, pcomplex_mod, float *dst_mod, const float *src, size_t count);
127127

128+
/**
129+
* Get module for complex numbers and add to destination:
130+
* dst[i] = dst[i] + sqrt(re[i]*re[i] + im[i]*im[i])
131+
*
132+
* @param dst array to add module
133+
* @param src packed complex number data
134+
* @param count count number of elements to process
135+
*/
136+
LSP_DSP_LIB_SYMBOL(void, pcomplex_mod_add2, float *dst, const float *src, size_t count);
137+
138+
/**
139+
* Get module for complex numbers and add to destination:
140+
* dst[i] = src1[i] + sqrt(re[i]*re[i] + im[i]*im[i])
141+
*
142+
* @param dst array to add module
143+
* @param src packed complex number data
144+
* @param count count number of elements to process
145+
*/
146+
LSP_DSP_LIB_SYMBOL(void, pcomplex_mod_add3, float *dst, const float *src, const float *reim, size_t count);
147+
128148
/** Convert packed complex number to polar form
129149
*
130150
* @param mod module of the complex number

include/lsp-plug.in/dsp/common/pmath.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <lsp-plug.in/dsp/common/types.h>
2626

2727
#include <lsp-plug.in/dsp/common/pmath/abs_vv.h>
28+
#include <lsp-plug.in/dsp/common/pmath/clamp.h>
2829
#include <lsp-plug.in/dsp/common/pmath/cos.h>
2930
#include <lsp-plug.in/dsp/common/pmath/exp.h>
3031
#include <lsp-plug.in/dsp/common/pmath/fmop_kx.h>
@@ -36,6 +37,7 @@
3637
#include <lsp-plug.in/dsp/common/pmath/normalize.h>
3738
#include <lsp-plug.in/dsp/common/pmath/op_kx.h>
3839
#include <lsp-plug.in/dsp/common/pmath/op_vv.h>
40+
#include <lsp-plug.in/dsp/common/pmath/pmix.h>
3941
#include <lsp-plug.in/dsp/common/pmath/pow.h>
4042
#include <lsp-plug.in/dsp/common/pmath/sin.h>
4143
#include <lsp-plug.in/dsp/common/pmath/sqr.h>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 26 нояб. 2025 г.
7+
*
8+
* lsp-dsp-lib is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* any later version.
12+
*
13+
* lsp-dsp-lib is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef LSP_PLUG_IN_DSP_COMMON_PMATH_CLAMP_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_CLAMP_H_
24+
25+
/**
26+
* Compute clamped values:
27+
* dst[i] = clamp(dst[i], min[i], max[i]) = min(max(dst[i], min[i]), max[i])
28+
*
29+
* @param dst destination array
30+
* @param min the source array with minimum allowed values
31+
* @param max the source array with maximum allowed values
32+
* @param count number of elements to process
33+
*/
34+
LSP_DSP_LIB_SYMBOL(void, clamp_vv1, float *dst, const float *min, const float *max, size_t count);
35+
36+
/**
37+
* Compute clamped values:
38+
* dst[i] = clamp(src[i], min[i], max[i]) = min(max(src[i], min[i]), max[i])
39+
*
40+
* @param dst destination array
41+
* @param src source array
42+
* @param min the source array with minimum allowed values
43+
* @param max the source array with maximum allowed values
44+
* @param count number of elements to process
45+
*/
46+
LSP_DSP_LIB_SYMBOL(void, clamp_vv2, float *dst, const float *src, const float *min, const float *max, size_t count);
47+
48+
/**
49+
* Compute clamped values:
50+
* dst[i] = clamp(dst[i], min, max) = min(max(dst[i], min), max)
51+
*
52+
* @param dst destination array
53+
* @param min the minimum allowed value
54+
* @param max the maximum allowed value
55+
* @param count number of elements to process
56+
*/
57+
LSP_DSP_LIB_SYMBOL(void, clamp_kk1, float *dst, float min, float max, size_t count);
58+
59+
/**
60+
* Compute clamped values:
61+
* dst[i] = clamp(src[i], min, max) = min(max(src[i], min), max)
62+
*
63+
* @param dst destination array to store values
64+
* @param src source array
65+
* @param min the minimum allowed value
66+
* @param max the maximum allowed value
67+
* @param count number of elements to process
68+
*/
69+
LSP_DSP_LIB_SYMBOL(void, clamp_kk2, float *dst, const float *src, float min, float max, size_t count);
70+
71+
72+
73+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_CLAMP_H_ */
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2025 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 26 нояб. 2025 г.
7+
*
8+
* lsp-dsp-lib is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* any later version.
12+
*
13+
* lsp-dsp-lib is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef LSP_PLUG_IN_DSP_COMMON_PMATH_PMIX_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_PMIX_H_
24+
25+
/**
26+
* Compute mixed value:
27+
* dst[i] = dst[i] + (src[i] - dst[i]) * k[i];
28+
*
29+
* @param dst destination array
30+
* @param src source array
31+
* @param k array with mix coefficient [0..1.0]
32+
* @param count number of elements to process
33+
*/
34+
LSP_DSP_LIB_SYMBOL(void, pmix_v1, float *dst, const float *src, const float *k, size_t count);
35+
36+
/**
37+
* Compute mixed value:
38+
* dst[i] = src1[i] + (src2[i] - src1[i]) * k[i];
39+
*
40+
* @param dst destination array
41+
* @param src1 first source array
42+
* @param src2 second source array
43+
* @param k array with mix coefficient [0..1.0]
44+
* @param count number of elements to process
45+
*/
46+
LSP_DSP_LIB_SYMBOL(void, pmix_v2, float *dst, const float *src1, const float *src2, const float *k, size_t count);
47+
48+
/**
49+
* Compute mixed value:
50+
* dst[i] = dst[i] + (src[i] - dst[i]) * k;
51+
*
52+
* @param dst destination array
53+
* @param src source array
54+
* @param k mix coefficient [0..1.0]
55+
* @param count number of elements to process
56+
*/
57+
LSP_DSP_LIB_SYMBOL(void, pmix_k1, float *dst, const float *src, float k, size_t count);
58+
59+
/**
60+
* Compute mixed value:
61+
* dst[i] = src1[i] + (src2[i] - src1[i]) * k;
62+
*
63+
* @param dst destination array
64+
* @param src1 first source array
65+
* @param src2 second source array
66+
* @param k mix coefficient [0..1.0]
67+
* @param count number of elements to process
68+
*/
69+
LSP_DSP_LIB_SYMBOL(void, pmix_k2, float *dst, const float *src1, const float *src2, float k, size_t count);
70+
71+
72+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_PMIX_H_ */

include/lsp-plug.in/dsp/common/search/minmax.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,18 @@ LSP_DSP_LIB_SYMBOL(float, sign_min, const float *src, size_t count);
7575
/** Calculate min { src }, max { src }
7676
*
7777
* @param src source vector
78+
* @param count number of elements
7879
* @param min pointer to store minimum value
7980
* @param max pointer to store maximum value
80-
* @param count number of elements
81-
* @return maximum value
8281
*/
8382
LSP_DSP_LIB_SYMBOL(void, minmax, const float *src, size_t count, float *min, float *max);
8483

8584
/** Calculate min { abs(src) }, max { abs(src) }
8685
*
8786
* @param src source vector
87+
* @param count number of elements
8888
* @param min pointer to store minimum value
8989
* @param max pointer to store maximum value
90-
* @param count number of elements
91-
* @return maximum value
9290
*/
9391
LSP_DSP_LIB_SYMBOL(void, abs_minmax, const float *src, size_t count, float *min, float *max);
9492

@@ -97,10 +95,9 @@ LSP_DSP_LIB_SYMBOL(void, abs_minmax, const float *src, size_t count, float *min,
9795
* max = src[i] : abs(src[i]) -> max
9896
*
9997
* @param src source vector
98+
* @param count number of elements
10099
* @param min pointer to store minimum value
101100
* @param max pointer to store maximum value
102-
* @param count number of elements
103-
* @return maximum value
104101
*/
105102
LSP_DSP_LIB_SYMBOL(void, sign_minmax, const float *src, size_t count, float *min, float *max);
106103

include/lsp-plug.in/dsp/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// Define version of headers
2626
#define LSP_DSP_LIB_MAJOR 1
2727
#define LSP_DSP_LIB_MINOR 0
28-
#define LSP_DSP_LIB_MICRO 32
28+
#define LSP_DSP_LIB_MICRO 33
2929

3030
#if defined(__WINDOWS__) || defined(__WIN32__) || defined(__WIN64__) || defined(_WIN64) || defined(_WIN32) || defined(__WINNT) || defined(__WINNT__)
3131
#define LSP_DSP_LIB_EXPORT_MODIFIER __declspec(dllexport)

include/private/dsp/arch/aarch64/asimd/pmath.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL */
2828

2929
#include <private/dsp/arch/aarch64/asimd/pmath/abs_vv.h>
30+
#include <private/dsp/arch/aarch64/asimd/pmath/clamp.h>
3031
#include <private/dsp/arch/aarch64/asimd/pmath/cos.h>
3132
#include <private/dsp/arch/aarch64/asimd/pmath/exp.h>
3233
#include <private/dsp/arch/aarch64/asimd/pmath/fmop_kx.h>
@@ -37,6 +38,7 @@
3738
#include <private/dsp/arch/aarch64/asimd/pmath/minmax.h>
3839
#include <private/dsp/arch/aarch64/asimd/pmath/op_kx.h>
3940
#include <private/dsp/arch/aarch64/asimd/pmath/op_vv.h>
41+
#include <private/dsp/arch/aarch64/asimd/pmath/pmix.h>
4042
#include <private/dsp/arch/aarch64/asimd/pmath/pow.h>
4143
#include <private/dsp/arch/aarch64/asimd/pmath/sin.h>
4244
#include <private/dsp/arch/aarch64/asimd/pmath/sqr.h>

0 commit comments

Comments
 (0)