Skip to content

Commit 50a40b6

Browse files
committed
Release 1.0.19
* AVX2 optimization of search functions for maximum and minimum. * Implemented SIMD-optimized gate functions. * Fixed bun in AVX-512 implementation of mid/side conversion functions. * AVX512 optimization of packed complex functions. * Additional optimizations of parallel mathematics functions with AVX-512 instruction set.
2 parents 555b548 + 7fd6298 commit 50a40b6

File tree

125 files changed

+12611
-767
lines changed

Some content is hidden

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

125 files changed

+12611
-767
lines changed

CHANGELOG

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

5+
=== 1.0.19 ===
6+
* AVX2 optimization of search functions for maximum and minimum.
7+
* Implemented SIMD-optimized gate functions.
8+
* Fixed bun in AVX-512 implementation of mid/side conversion functions.
9+
* AVX512 optimization of packed complex functions.
10+
* Additional optimizations of parallel mathematics functions with AVX-512 instruction set.
11+
512
=== 1.0.18 ===
613
* Fixed compilation regression for 32-bit Clang compiler.
714

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <lsp-plug.in/dsp/common/dynamics/types.h>
2828
#include <lsp-plug.in/dsp/common/dynamics/compressor.h>
29+
#include <lsp-plug.in/dsp/common/dynamics/gate.h>
2930

3031

3132
#endif /* LSP_PLUG_IN_DSP_COMMON_DYNAMICS_H_ */
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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: 19 окт. 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_GATE_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_DYNAMICS_GATE_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, gate_x1_gain, float *dst, const float *src, const LSP_DSP_LIB_TYPE(gate_knee_t) *c, size_t count);
29+
30+
LSP_DSP_LIB_SYMBOL(void, gate_x1_curve, float *dst, const float *src, const LSP_DSP_LIB_TYPE(gate_knee_t) *c, size_t count);
31+
32+
33+
#endif /* LSP_PLUG_IN_DSP_COMMON_DYNAMICS_GATE_H_ */

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LSP_DSP_LIB_BEGIN_NAMESPACE
2929
#pragma pack(push, 1)
3030

3131
/**
32-
* Compressor knee is a curve that constists of three parts:
32+
* Compressor knee is a curve that consists of three parts:
3333
* 1. Part with constant gain amplification in the range [-inf .. start] dB
3434
* 2. Soft compression knee in the range (start .. end) dB present by the quadratic function (2nd-order polynom)
3535
* 3. Gain reduction part in the range [end .. +inf] dB present by the linear function (1st-order polynom)
@@ -40,7 +40,7 @@ LSP_DSP_LIB_BEGIN_NAMESPACE
4040
* 3. Compute the natural logarithm of the x: lx = logf(x).
4141
* 4. If x < end then compute the gain using the 2nd-order polynom: gain = (herm[0]*lx + herm[1])*lx + herm[2]
4242
* 5. Otherwise compute the gain using the 1st-order polynom: gain = tilt[0]*lx + tilt[1]
43-
* 6. return expf(gain)
43+
* 6. return expf(gain) * x
4444
*/
4545
typedef struct LSP_DSP_LIB_TYPE(compressor_knee_t)
4646
{
@@ -61,6 +61,30 @@ typedef struct LSP_DSP_LIB_TYPE(compressor_x2_t)
6161
LSP_DSP_LIB_TYPE(compressor_knee_t) k[2];
6262
} LSP_DSP_LIB_TYPE(compressor_x2_t);
6363

64+
65+
/**
66+
* Gate knee is a curve that consists of three parts:
67+
* 1. Part with constant gain amplification in the range [-inf .. start] dB
68+
* 2. Transition zone in the range (start .. end) dB present by the quadratic function (2nd-order polynom)
69+
* 3. Part with constant gain amplification in the range [end .. +inf] dB
70+
*
71+
* The typical algorithm of computing the gate's curve:
72+
* 1. Take absolute value of the sample: x = fabfs(in)
73+
* 2. If x <= start then return gain_start * x
74+
* 3. If x <= end then return gain_end * x
75+
* 4. Compute the natural logarithm of the x: lx = logf(x).
76+
* 5. Compute the gain using the 3rd-order polynom: gain = ((herm[0]*lx + herm[1])*lx + herm[2]*lx) + herm[3]
77+
* 6. return expf(gain) * x
78+
*/
79+
typedef struct LSP_DSP_LIB_TYPE(gate_knee_t)
80+
{
81+
float start; // The start of the knee, in gain units
82+
float end; // The end of the knee, in gain units
83+
float gain_start; // Gain below the start threshold
84+
float gain_end; // Gain above the end threshold
85+
float herm[4]; // Hermite interpolation of the knee with the 3rd-order polynom
86+
} LSP_DSP_LIB_TYPE(gate_knee_t);
87+
6488
#pragma pack(pop)
6589

6690
LSP_DSP_LIB_END_NAMESPACE

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 18
28+
#define LSP_DSP_LIB_MICRO 19
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/dynamics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL */
2828

2929
#include <private/dsp/arch/aarch64/asimd/dynamics/compressor.h>
30-
30+
#include <private/dsp/arch/aarch64/asimd/dynamics/gate.h>
3131

3232
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_DYNAMICS_H_ */

include/private/dsp/arch/aarch64/asimd/dynamics/compressor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ namespace lsp
294294
);
295295
}
296296

297+
#undef KNEE_LOAD
298+
#undef PROCESS_KNEE_SINGLE_X4
299+
#undef PROCESS_KNEE_SINGLE_X8
300+
#undef PROCESS_COMP_FULL_X8
301+
#undef PROCESS_COMP_FULL_X4
297302

298303
} /* namespace asimd */
299304
} /* namespace lsp */

0 commit comments

Comments
 (0)