Skip to content

Commit 65807ff

Browse files
committed
Release 1.0.17
* Implemented SIMD-optimized 2-knee compressor curve and gain calculation functions. * Implemented several AVX-512 optimized packed complex functions. * Removed pcomplex_add_r function. Use pcomplex_r2c_add2 function instead. * Fixed improper formula for complex_div and pcomplex_div functions. * Implemented sqr1, sqr2, ssqr1 and ssqr2 functions. * Implemented axis_apply_lin1 function. * Updated module versions in dependencies.
2 parents fa23c53 + dc6d890 commit 65807ff

File tree

135 files changed

+14471
-3705
lines changed

Some content is hidden

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

135 files changed

+14471
-3705
lines changed

CHANGELOG

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

5+
=== 1.0.17 ===
6+
* Implemented SIMD-optimized 2-knee compressor curve and gain calculation functions.
7+
* Implemented several AVX-512 optimized packed complex functions.
8+
* Removed pcomplex_add_r function. Use pcomplex_r2c_add2 function instead.
9+
* Fixed improper formula for complex_div and pcomplex_div functions.
10+
* Implemented sqr1, sqr2, ssqr1 and ssqr2 functions.
11+
* Implemented axis_apply_lin1 function.
12+
* Updated module versions in dependencies.
13+
514
=== 1.0.16 ===
615
* Fixed improper AVX-512 detection which causes crash for several functions.
716

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2023 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 5 окт. 2023 г.
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_DYNAMICS_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_DYNAMICS_H_
24+
25+
#include <lsp-plug.in/dsp/common/types.h>
26+
27+
#include <lsp-plug.in/dsp/common/dynamics/types.h>
28+
#include <lsp-plug.in/dsp/common/dynamics/compressor.h>
29+
30+
31+
#endif /* LSP_PLUG_IN_DSP_COMMON_DYNAMICS_H_ */
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2023 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 5 окт. 2023 г.
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_DYNAMICS_COMPRESSOR_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_DYNAMICS_COMPRESSOR_H_
24+
25+
#include <lsp-plug.in/dsp/common/types.h>
26+
#include <lsp-plug.in/dsp/common/dynamics/types.h>
27+
28+
LSP_DSP_LIB_SYMBOL(void, compressor_x2_gain, float *dst, const float *src, const LSP_DSP_LIB_TYPE(compressor_x2_t) *c, size_t count);
29+
30+
LSP_DSP_LIB_SYMBOL(void, compressor_x2_curve, float *dst, const float *src, const LSP_DSP_LIB_TYPE(compressor_x2_t) *c, size_t count);
31+
32+
#endif /* LSP_PLUG_IN_DSP_COMMON_DYNAMICS_COMPRESSOR_H_ */
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2023 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 5 окт. 2023 г.
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_DYNAMICS_TYPES_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_DYNAMICS_TYPES_H_
24+
25+
#include <lsp-plug.in/dsp/common/types.h>
26+
27+
LSP_DSP_LIB_BEGIN_NAMESPACE
28+
29+
#pragma pack(push, 1)
30+
31+
/**
32+
* Compressor knee is a curve that constists of three parts:
33+
* 1. Part with constant gain amplification in the range [-inf .. start] dB
34+
* 2. Soft compression knee in the range (start .. end) dB present by the quadratic function (2nd-order polynom)
35+
* 3. Gain reduction part in the range [end .. +inf] dB present by the linear function (1st-order polynom)
36+
*
37+
* The typical algorithm of computing the compressor's curve:
38+
* 1. Take absolute value of the sample: x = fabfs(in)
39+
* 2. If x <= start then return gain*x
40+
* 3. Compute the natural logarithm of the x: lx = logf(x).
41+
* 4. If x < end then compute the gain using the 2nd-order polynom: gain = (herm[0]*lx + herm[1])*lx + herm[2]
42+
* 5. Otherwise compute the gain using the 1st-order polynom: gain = tilt[0]*lx + tilt[1]
43+
* 6. return expf(gain)
44+
*/
45+
typedef struct LSP_DSP_LIB_TYPE(compressor_knee_t)
46+
{
47+
float start; // The start of the knee, in gain units
48+
float end; // The end of the knee, in gain units
49+
float gain; // Pre-amplification gain
50+
float herm[3]; // Hermite interpolation of the knee with the 2nd-order polynom
51+
float tilt[2]; // Tilt line parameters after the knee
52+
} LSP_DSP_LIB_TYPE(compressor_knee_t);
53+
54+
55+
/**
56+
* Two-knee compressor.
57+
* The result gain/curve is a result of multiplication of gain/curve between both knees.
58+
*/
59+
typedef struct LSP_DSP_LIB_TYPE(compressor_x2_t)
60+
{
61+
LSP_DSP_LIB_TYPE(compressor_knee_t) k[2];
62+
} LSP_DSP_LIB_TYPE(compressor_x2_t);
63+
64+
#pragma pack(pop)
65+
66+
LSP_DSP_LIB_END_NAMESPACE
67+
68+
#endif /* LSP_PLUG_IN_DSP_COMMON_DYNAMICS_TYPES_H_ */

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ typedef struct LSP_DSP_LIB_TYPE(hsla_light_eff_t)
5353

5454
LSP_DSP_LIB_END_NAMESPACE
5555

56+
/** Do linear vector apply for 1D-schema:
57+
* x[i] = x[i] + norm_x * (v[i] + zero)
58+
*
59+
* @param x destination vector for X coordinate
60+
* @param v delta vector to apply
61+
* @param zero graphics zero point shift
62+
* @param norm X norming factor
63+
*/
64+
LSP_DSP_LIB_SYMBOL(void, axis_apply_lin1, float *x, const float *v, float zero, float norm, size_t count);
65+
5666
/** Do logarithmic vector apply for 1D-schema:
5767
* x[i] = x[i] + norm_x * logf(absf(v[i]*zero))
5868
*

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ LSP_DSP_LIB_SYMBOL(void, pcomplex_r2c, float *dst, const float *src, size_t coun
117117
*/
118118
LSP_DSP_LIB_SYMBOL(void, pcomplex_c2r, float *dst, const float *src, size_t count);
119119

120-
/** Convert packed complex to real and add to destination buffer
121-
*
122-
* @param dst destination real data
123-
* @param src source packed complex data
124-
* @param count number of items to convert
125-
*/
126-
LSP_DSP_LIB_SYMBOL(void, pcomplex_add_r, float *dst, const float *src, size_t count);
127-
128120
/** Get module for complex numbers: mod = sqrt(re*re + im*im)
129121
*
130122
* @param dst_mod array to sore module

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,7 @@
3535
#include <lsp-plug.in/dsp/common/pmath/op_kx.h>
3636
#include <lsp-plug.in/dsp/common/pmath/op_vv.h>
3737
#include <lsp-plug.in/dsp/common/pmath/pow.h>
38+
#include <lsp-plug.in/dsp/common/pmath/sqr.h>
39+
#include <lsp-plug.in/dsp/common/pmath/sqrt.h>
3840

3941
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_H_ */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2023 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 20 сент. 2023 г.
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_SQR_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_SQR_H_
24+
25+
#include <lsp-plug.in/dsp/common/types.h>
26+
27+
/**
28+
* Compute squares: dst[i] = dst[i]*dst[i]
29+
* @param dst destination
30+
* @param count number of elements to process
31+
*/
32+
LSP_DSP_LIB_SYMBOL(void, sqr1, float *dst, size_t count);
33+
34+
/**
35+
* Compute squares: dst[i] = src[i]*src[i]
36+
* @param dst destination
37+
* @param src source
38+
* @param count number of elements in source
39+
*/
40+
LSP_DSP_LIB_SYMBOL(void, sqr2, float *dst, const float *src, size_t count);
41+
42+
43+
44+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_SQR_H_ */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2023 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-dsp-lib
6+
* Created on: 20 сент. 2023 г.
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_SQRT_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_SQRT_H_
24+
25+
#include <lsp-plug.in/dsp/common/types.h>
26+
27+
/**
28+
* Compute saturated square roots: dst[i] = sqrt(max(dst[i], 0))
29+
* @param dst destination
30+
* @param count number of elements to process
31+
*/
32+
LSP_DSP_LIB_SYMBOL(void, ssqrt1, float *dst, size_t count);
33+
34+
/**
35+
* Compute saturated square roots: dst[i] = sqrt(max(src[i], 0))
36+
* @param dst destination
37+
* @param src source
38+
* @param count number of elements in source
39+
*/
40+
LSP_DSP_LIB_SYMBOL(void, ssqrt2, float *dst, const float *src, size_t count);
41+
42+
43+
44+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_SQRT_H_ */

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@
3030
#include <limits.h>
3131

3232
// Macro definitions
33-
#define LSP_DSP_VEC2(v) v, v
34-
#define LSP_DSP_VEC4(v) v, v, v, v
35-
#define LSP_DSP_VEC8(v) v, v, v, v, v, v, v, v
36-
#define LSP_DSP_VEC16(v) v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v
37-
#define LSP_DSP_VEC32(v) v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v
33+
#define LSP_DSP_VEC2(v) v, v
34+
#define LSP_DSP_VEC4(v) LSP_DSP_VEC2(v), LSP_DSP_VEC2(v)
35+
#define LSP_DSP_VEC8(v) LSP_DSP_VEC4(v), LSP_DSP_VEC4(v)
36+
#define LSP_DSP_VEC16(v) LSP_DSP_VEC8(v), LSP_DSP_VEC8(v)
37+
#define LSP_DSP_VEC32(v) LSP_DSP_VEC16(v), LSP_DSP_VEC16(v)
38+
39+
#define LSP_DSP_VEC2x2(a, b) a, b, a, b
40+
#define LSP_DSP_VEC4x2(a, b) LSP_DSP_VEC2x2(a, b), LSP_DSP_VEC2x2(a, b)
41+
#define LSP_DSP_VEC8x2(a, b) LSP_DSP_VEC4x2(a, b), LSP_DSP_VEC4x2(a, b)
42+
#define LSP_DSP_VEC16x2(a, b) LSP_DSP_VEC8x2(a, b), LSP_DSP_VEC8x2(a, b)
3843

3944
// Different constants
4045
#define LSP_DSP_AMPLIFICATION_THRESH 1e-8

0 commit comments

Comments
 (0)