Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2022-09-03 20:49:53 +0300
committerTimo Rothenpieler <timo@rothenpieler.org>2022-09-03 21:27:34 +0300
commit416923346a6d31563801784963d2893a8d1da1c8 (patch)
tree330563edbcea9367c81872ec2432cebfb8c5e6ba /libavfilter
parent73fada029c527fda6c248785a948c61249fd4b2d (diff)
compat/cuda: switch from powf to __powf intrinsic
The powf builtin causes crashes on older clang, so manually implement the (faster) intrinsic. The code it spawns is identical to that of nvcc.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_bilateral_cuda.cu8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_bilateral_cuda.cu b/libavfilter/vf_bilateral_cuda.cu
index 8aba3a079f..bbcfc81db5 100644
--- a/libavfilter/vf_bilateral_cuda.cu
+++ b/libavfilter/vf_bilateral_cuda.cu
@@ -34,9 +34,9 @@ extern "C"
__device__ static inline float norm_squared(float4 first_yuv, float4 second_yuv)
{
float ans = 0;
- ans += powf(first_yuv.x - second_yuv.x, 2);
- ans += powf(first_yuv.y - second_yuv.y, 2);
- ans += powf(first_yuv.z - second_yuv.z, 2);
+ ans += __powf(first_yuv.x - second_yuv.x, 2);
+ ans += __powf(first_yuv.y - second_yuv.y, 2);
+ ans += __powf(first_yuv.z - second_yuv.z, 2);
return ans;
}
@@ -52,7 +52,7 @@ __device__ static inline float calculate_w(int x, int y, int r, int c,
float sigma_space, float sigma_color)
{
float first_term, second_term;
- first_term = (powf(x - r, 2) + powf(y - c, 2)) / (2 * sigma_space * sigma_space);
+ first_term = (__powf(x - r, 2) + __powf(y - c, 2)) / (2 * sigma_space * sigma_space);
second_term = norm_squared(pixel_value, neighbor_value) / (2 * sigma_color * sigma_color);
return __expf(-first_term - second_term);
}