Skip to content

Commit 730270b

Browse files
committed
Merge branch 'trigonometric' into devel
* Implemented SIMD-optimized trigonometric functions sinf and cosf. * Implemented Lanczos filter kernel computation function.
2 parents 3885490 + 0f5df20 commit 730270b

Some content is hidden

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

49 files changed

+8125
-55
lines changed

CHANGELOG

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*******************************************************************************
44

55
=== 1.0.30 ===
6+
* Implemented SIMD-optimized trigonometric functions sinf and cosf.
7+
* Implemented Lanczos filter kernel computation function.
68
* Updated build scripts.
79

810
=== 1.0.29 ===

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

+3
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@
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/cos.h>
2829
#include <lsp-plug.in/dsp/common/pmath/exp.h>
2930
#include <lsp-plug.in/dsp/common/pmath/fmop_kx.h>
3031
#include <lsp-plug.in/dsp/common/pmath/fmop_vv.h>
32+
#include <lsp-plug.in/dsp/common/pmath/lanczos.h>
3133
#include <lsp-plug.in/dsp/common/pmath/log.h>
3234
#include <lsp-plug.in/dsp/common/pmath/lramp.h>
3335
#include <lsp-plug.in/dsp/common/pmath/minmax.h>
3436
#include <lsp-plug.in/dsp/common/pmath/normalize.h>
3537
#include <lsp-plug.in/dsp/common/pmath/op_kx.h>
3638
#include <lsp-plug.in/dsp/common/pmath/op_vv.h>
3739
#include <lsp-plug.in/dsp/common/pmath/pow.h>
40+
#include <lsp-plug.in/dsp/common/pmath/sin.h>
3841
#include <lsp-plug.in/dsp/common/pmath/sqr.h>
3942
#include <lsp-plug.in/dsp/common/pmath/sqrt.h>
4043

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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: 10 апр. 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_COS_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_COS_H_
24+
25+
/**
26+
* Calculate cosine function: dst[i] = cos(dst[i])
27+
*
28+
* @param dst destination vector
29+
* @param count number of elements
30+
*/
31+
LSP_DSP_LIB_SYMBOL(void, cosf1, float *dst, size_t count);
32+
33+
/**
34+
* Calculate cosine function: dst[i] = cos(src[i])
35+
*
36+
* @param dst destination vector
37+
* @param src source vector
38+
* @param count number of elements
39+
*/
40+
LSP_DSP_LIB_SYMBOL(void, cosf2, float *dst, const float *src, size_t count);
41+
42+
/**
43+
* Calculate cosine function with generated argument: dst[i] = cos(k*i + p)
44+
*
45+
* @param dst destination vector
46+
* @param k phase step
47+
* @param p initial phase
48+
* @param count number of elements
49+
*/
50+
LSP_DSP_LIB_SYMBOL(void, cosf_kp1, float *dst, float k, float p, size_t count);
51+
52+
53+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_COS_H_ */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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: 10 апр. 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_LANCZOS_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_LANCZOS_H_
24+
25+
/**
26+
* Calculate lanczos filter response function with generated argument:
27+
*
28+
* for each x = PI * (k*i - p)
29+
*
30+
* { 1.0 if fabsf(x) <= 1e-6
31+
* dst[i] = { sinc(x) * sinc(x*a)/(a * x^2) if fabsf(x) < t and fabsf(x) >= 1e-6
32+
* { 0.0 otherwise
33+
*
34+
* @param dst destination vector
35+
* @param src source vector
36+
* @param k number of samples per lobe multiplied by PI
37+
* @param p shift in lobes multiplied by PI
38+
* @param t the number of lobes multiplied by PI
39+
* @param a reverse number of lobes
40+
* @param count number of elements
41+
*/
42+
LSP_DSP_LIB_SYMBOL(void, lanczos1, float *dst, float k, float p, float t, float a, size_t count);
43+
44+
45+
46+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_SINCSINC_H_ */
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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: 9 апр. 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_SIN_H_
23+
#define LSP_PLUG_IN_DSP_COMMON_PMATH_SIN_H_
24+
25+
/**
26+
* Calculate sine function: dst[i] = sin(dst[i])
27+
*
28+
* @param dst destination vector
29+
* @param count number of elements
30+
*/
31+
LSP_DSP_LIB_SYMBOL(void, sinf1, float *dst, size_t count);
32+
33+
/**
34+
* Calculate sine function: dst[i] = sin(src[i])
35+
*
36+
* @param dst destination vector
37+
* @param src source vector
38+
* @param count number of elements
39+
*/
40+
LSP_DSP_LIB_SYMBOL(void, sinf2, float *dst, const float *src, size_t count);
41+
42+
/**
43+
* Calculate sine function with generated argument: dst[i] = sin(k*i + p)
44+
*
45+
* @param dst destination vector
46+
* @param k phase step
47+
* @param p initial phase
48+
* @param count number of elements
49+
*/
50+
LSP_DSP_LIB_SYMBOL(void, sinf_kp1, float *dst, float k, float p, size_t count);
51+
52+
53+
#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_SIN_H_ */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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: 13 апр. 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 PRIVATE_DSP_ARCH_AARCH64_ASIMD_PMATH_H_
23+
#define PRIVATE_DSP_ARCH_AARCH64_ASIMD_PMATH_H_
24+
25+
#ifndef PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL
26+
#error "This header should not be included directly"
27+
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL */
28+
29+
#include <private/dsp/arch/aarch64/asimd/pmath/abs_vv.h>
30+
#include <private/dsp/arch/aarch64/asimd/pmath/cos.h>
31+
#include <private/dsp/arch/aarch64/asimd/pmath/exp.h>
32+
#include <private/dsp/arch/aarch64/asimd/pmath/fmop_kx.h>
33+
#include <private/dsp/arch/aarch64/asimd/pmath/fmop_vv.h>
34+
#include <private/dsp/arch/aarch64/asimd/pmath/lanczos.h>
35+
#include <private/dsp/arch/aarch64/asimd/pmath/log.h>
36+
#include <private/dsp/arch/aarch64/asimd/pmath/lramp.h>
37+
#include <private/dsp/arch/aarch64/asimd/pmath/minmax.h>
38+
#include <private/dsp/arch/aarch64/asimd/pmath/op_kx.h>
39+
#include <private/dsp/arch/aarch64/asimd/pmath/op_vv.h>
40+
#include <private/dsp/arch/aarch64/asimd/pmath/pow.h>
41+
#include <private/dsp/arch/aarch64/asimd/pmath/sin.h>
42+
#include <private/dsp/arch/aarch64/asimd/pmath/sqr.h>
43+
#include <private/dsp/arch/aarch64/asimd/pmath/ssqrt.h>
44+
45+
#endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_PMATH_H_ */

0 commit comments

Comments
 (0)