Skip to content

Commit 69077b9

Browse files
jenshannoschwalmTurboGit
authored andcommitted
1 parent c3e89f0 commit 69077b9

File tree

2 files changed

+27
-30
lines changed

2 files changed

+27
-30
lines changed

src/develop/openmp_maths.h

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,41 @@
2323
#pragma once
2424

2525

26-
#if defined(_OPENMP) && !defined(_WIN32) && (!defined(__GNUC__) || __GNUC__ >= 12)
26+
#if defined(_OPENMP) && !defined(_WIN32) && !defined(__GNUC__)
27+
// GCC and CLANG have declarations in standard headers if and only if the architecture and compile options support vectorization, so
28+
// don't try to override that here - causes dynamic-link errors at startup.
29+
DT_OMP_DECLARE_SIMD()
30+
extern float fmaxf(const float x, const float y);
2731

28-
#ifndef __GNUC__ // GCC 12 compiles but fails at runtime due to missing library function
29-
DT_OMP_DECLARE_SIMD()
30-
extern float fmaxf(const float x, const float y);
31-
#endif
32+
DT_OMP_DECLARE_SIMD()
33+
extern float fminf(const float x, const float y);
3234

33-
#ifndef __GNUC__ // GCC 12 compiles but fails at runtime due to missing library function
34-
DT_OMP_DECLARE_SIMD()
35-
extern float fminf(const float x, const float y);
36-
#endif
35+
DT_OMP_DECLARE_SIMD()
36+
extern float fabsf(const float x);
3737

38-
DT_OMP_DECLARE_SIMD()
39-
extern float fabsf(const float x);
40-
41-
DT_OMP_DECLARE_SIMD()
42-
extern float powf(const float x, const float y);
38+
DT_OMP_DECLARE_SIMD()
39+
extern float powf(const float x, const float y);
4340

44-
DT_OMP_DECLARE_SIMD()
45-
extern float sqrtf(const float x);
41+
DT_OMP_DECLARE_SIMD()
42+
extern float sqrtf(const float x);
4643

47-
DT_OMP_DECLARE_SIMD()
48-
extern float cbrtf(const float x);
44+
DT_OMP_DECLARE_SIMD()
45+
extern float cbrtf(const float x);
4946

50-
DT_OMP_DECLARE_SIMD()
51-
extern float log2f(const float x);
47+
DT_OMP_DECLARE_SIMD()
48+
extern float log2f(const float x);
5249

53-
DT_OMP_DECLARE_SIMD()
54-
extern float exp2f(const float x);
50+
DT_OMP_DECLARE_SIMD()
51+
extern float exp2f(const float x);
5552

56-
DT_OMP_DECLARE_SIMD()
57-
extern float log10f(const float x);
53+
DT_OMP_DECLARE_SIMD()
54+
extern float log10f(const float x);
5855

59-
DT_OMP_DECLARE_SIMD()
60-
extern float expf(const float x);
56+
DT_OMP_DECLARE_SIMD()
57+
extern float expf(const float x);
6158

62-
DT_OMP_DECLARE_SIMD()
63-
extern float logf(const float x);
59+
DT_OMP_DECLARE_SIMD()
60+
extern float logf(const float x);
6461

6562
#endif
6663

src/iop/rawdenoise.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
This file is part of darktable,
3-
Copyright (C) 2011-2024 darktable developers.
3+
Copyright (C) 2011-2025 darktable developers.
44
55
66
darktable is free software: you can redistribute it and/or modify
@@ -226,7 +226,7 @@ static void wavelet_denoise(const float *const restrict in, float *const restric
226226
const float *const restrict inp = in + (size_t)row * roi->width + offset;
227227
const int senselwidth = (roi->width-offset+1)/2;
228228
for(int col = 0; col < senselwidth; col++)
229-
fimgp[col] = sqrtf(fmaxf(0.0f, inp[2*col]));
229+
fimgp[col] = sqrtf(MAX(0.0f, inp[2*col]));
230230
}
231231

232232
// perform the wavelet decomposition and denoising

0 commit comments

Comments
 (0)