From 95d5373afef9366135ccde4559c7dfaa5a4b930d Mon Sep 17 00:00:00 2001 From: Vladimir Sadovnikov Date: Sun, 24 Nov 2024 19:06:07 +0300 Subject: [PATCH] Bugfixes --- include/private/dsp/arch/aarch64/asimd/pcomplex.h | 4 ++-- include/private/dsp/arch/arm/neon-d32/pcomplex.h | 4 ++-- include/private/dsp/arch/generic/pan.h | 4 ++-- include/private/dsp/arch/generic/pcomplex.h | 2 +- include/private/dsp/arch/x86/avx/pcomplex.h | 6 +++--- include/private/dsp/arch/x86/avx512/pcomplex.h | 2 +- include/private/dsp/arch/x86/sse/pcomplex.h | 2 +- include/private/dsp/arch/x86/sse3/pcomplex.h | 2 +- src/main/x86/avx.cpp | 4 ++-- src/main/x86/sse.cpp | 4 ++-- src/main/x86/sse3.cpp | 4 ++-- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/private/dsp/arch/aarch64/asimd/pcomplex.h b/include/private/dsp/arch/aarch64/asimd/pcomplex.h index 0d0043c1..1f5774e5 100644 --- a/include/private/dsp/arch/aarch64/asimd/pcomplex.h +++ b/include/private/dsp/arch/aarch64/asimd/pcomplex.h @@ -1657,8 +1657,8 @@ namespace lsp IF_ARCH_AARCH64( static float pcomplex_corr_const[] __lsp_aligned16 = { - LSP_DSP_VEC4(1e-20f), - LSP_DSP_VEC4(1e-20f) + LSP_DSP_VEC4(1e-36f), + LSP_DSP_VEC4(1e-36f) }; ); diff --git a/include/private/dsp/arch/arm/neon-d32/pcomplex.h b/include/private/dsp/arch/arm/neon-d32/pcomplex.h index 752ec486..d89ebc95 100644 --- a/include/private/dsp/arch/arm/neon-d32/pcomplex.h +++ b/include/private/dsp/arch/arm/neon-d32/pcomplex.h @@ -1495,8 +1495,8 @@ namespace lsp IF_ARCH_ARM( static float pcomplex_corr_const[] __lsp_aligned16 = { - LSP_DSP_VEC4(1e-20f), - LSP_DSP_VEC4(1e-20f) + LSP_DSP_VEC4(1e-36f), + LSP_DSP_VEC4(1e-36f) }; ); diff --git a/include/private/dsp/arch/generic/pan.h b/include/private/dsp/arch/generic/pan.h index a25795b0..a8eabffa 100644 --- a/include/private/dsp/arch/generic/pan.h +++ b/include/private/dsp/arch/generic/pan.h @@ -40,7 +40,7 @@ namespace lsp const float sl = fabsf(l[i]); const float sr = fabsf(r[i]); const float den = sl + sr; - dst[i] = (den > 1e-5f) ? sr / den : dfl; + dst[i] = (den > 1e-18f) ? sr / den : dfl; } } @@ -51,7 +51,7 @@ namespace lsp const float sl = l[i] * l[i]; const float sr = r[i] * r[i]; const float den = sl + sr; - dst[i] = (den > 1e-10f) ? sr / den : dfl; + dst[i] = (den > 1e-36f) ? sr / den : dfl; } } diff --git a/include/private/dsp/arch/generic/pcomplex.h b/include/private/dsp/arch/generic/pcomplex.h index 81d98691..cf19b4a8 100644 --- a/include/private/dsp/arch/generic/pcomplex.h +++ b/include/private/dsp/arch/generic/pcomplex.h @@ -379,7 +379,7 @@ namespace lsp const float den = (a*a + b*b)*(c*c + d*d); const float nom = a*c + b*d; - *dst_corr = (den > 1e-20f) ? nom / sqrtf(den) : 0.0f; + *dst_corr = (den >= 1e-36f) ? nom / sqrtf(den) : 0.0f; src1 += 2; src2 += 2; diff --git a/include/private/dsp/arch/x86/avx/pcomplex.h b/include/private/dsp/arch/x86/avx/pcomplex.h index b5d78b05..ee2c75ea 100644 --- a/include/private/dsp/arch/x86/avx/pcomplex.h +++ b/include/private/dsp/arch/x86/avx/pcomplex.h @@ -1290,7 +1290,7 @@ namespace lsp IF_ARCH_X86( static const float pcomplex_corr_const[] __lsp_aligned32 = { - LSP_DSP_VEC8(1e-20f), + LSP_DSP_VEC8(1e-36f), }; ); @@ -1308,7 +1308,7 @@ namespace lsp __ASM_EMIT("xor %[off], %[off]") /* x8 blocks */ __ASM_EMIT("sub $8, %[count]") /* count -= 8 */ - __ASM_EMIT("movaps %[CC], %%xmm7") /* xmm7 = threshold */ + __ASM_EMIT("vmovaps %[CC], %%ymm7") /* ymm7 = threshold */ __ASM_EMIT("jb 2f") __ASM_EMIT("1:") __ASM_EMIT("vmovups 0x00(%[src1], %[off], 2), %%xmm0") /* xmm0 = a0 b0 a1 b1 */ @@ -1431,7 +1431,7 @@ namespace lsp __ASM_EMIT("xor %[off], %[off]") /* x8 blocks */ __ASM_EMIT("sub $8, %[count]") /* count -= 8 */ - __ASM_EMIT("movaps %[CC], %%xmm7") /* xmm7 = threshold */ + __ASM_EMIT("vmovaps %[CC], %%ymm7") /* ymm7 = threshold */ __ASM_EMIT("jb 2f") __ASM_EMIT("1:") __ASM_EMIT("vmovups 0x00(%[src1], %[off], 2), %%xmm0") /* xmm0 = a0 b0 a1 b1 */ diff --git a/include/private/dsp/arch/x86/avx512/pcomplex.h b/include/private/dsp/arch/x86/avx512/pcomplex.h index bd8e7245..5c413faf 100644 --- a/include/private/dsp/arch/x86/avx512/pcomplex.h +++ b/include/private/dsp/arch/x86/avx512/pcomplex.h @@ -1329,7 +1329,7 @@ namespace lsp IF_ARCH_X86( static const float pcomplex_corr_const[] __lsp_aligned64 = { - LSP_DSP_VEC16(1e-20f), + LSP_DSP_VEC16(1e-36f), }; ); diff --git a/include/private/dsp/arch/x86/sse/pcomplex.h b/include/private/dsp/arch/x86/sse/pcomplex.h index ef1c200f..3ac47d95 100644 --- a/include/private/dsp/arch/x86/sse/pcomplex.h +++ b/include/private/dsp/arch/x86/sse/pcomplex.h @@ -1254,7 +1254,7 @@ namespace lsp IF_ARCH_X86( static const float pcomplex_corr_const[] __lsp_aligned16 = { - LSP_DSP_VEC4(1e-20f), + LSP_DSP_VEC4(1e-36f), }; ); diff --git a/include/private/dsp/arch/x86/sse3/pcomplex.h b/include/private/dsp/arch/x86/sse3/pcomplex.h index 5cc69f0e..2348c508 100644 --- a/include/private/dsp/arch/x86/sse3/pcomplex.h +++ b/include/private/dsp/arch/x86/sse3/pcomplex.h @@ -740,7 +740,7 @@ namespace lsp IF_ARCH_X86_64( static const float pcomplex_corr_const[] __lsp_aligned16 = { - LSP_DSP_VEC4(1e-20f), + LSP_DSP_VEC4(1e-36f), }; ); diff --git a/src/main/x86/avx.cpp b/src/main/x86/avx.cpp index ca8af39d..ab5cf2d3 100644 --- a/src/main/x86/avx.cpp +++ b/src/main/x86/avx.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2023 Linux Studio Plugins Project - * (C) 2023 Vladimir Sadovnikov + * Copyright (C) 2024 Linux Studio Plugins Project + * (C) 2024 Vladimir Sadovnikov * * This file is part of lsp-dsp-lib * Created on: 31 мар. 2020 г. diff --git a/src/main/x86/sse.cpp b/src/main/x86/sse.cpp index 3943f879..f266432b 100644 --- a/src/main/x86/sse.cpp +++ b/src/main/x86/sse.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2020 Linux Studio Plugins Project - * (C) 2020 Vladimir Sadovnikov + * Copyright (C) 2024 Linux Studio Plugins Project + * (C) 2024 Vladimir Sadovnikov * * This file is part of lsp-dsp-lib * Created on: 31 мар. 2020 г. diff --git a/src/main/x86/sse3.cpp b/src/main/x86/sse3.cpp index 92a28cbb..80d08931 100644 --- a/src/main/x86/sse3.cpp +++ b/src/main/x86/sse3.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2020 Linux Studio Plugins Project - * (C) 2020 Vladimir Sadovnikov + * Copyright (C) 2024 Linux Studio Plugins Project + * (C) 2024 Vladimir Sadovnikov * * This file is part of lsp-dsp-lib * Created on: 31 мар. 2020 г.