Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
6512dd6c
Commit
6512dd6c
authored
Sep 03, 2022
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_bilateral_cuda: refactor use of pow to simple multiplication
parent
41692334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
vf_bilateral_cuda.cu
libavfilter/vf_bilateral_cuda.cu
+5
-6
No files found.
libavfilter/vf_bilateral_cuda.cu
View file @
6512dd6c
...
...
@@ -33,11 +33,10 @@ 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);
return ans;
float x = first_yuv.x - second_yuv.x;
float y = first_yuv.y - second_yuv.y;
float z = first_yuv.z - second_yuv.z;
return (x*x) + (y*y) + (z*z);
}
/**
...
...
@@ -52,7 +51,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 = (
((x - r) * (x - r)) + ((y - c) * (y - c)
)) / (2 * sigma_space * sigma_space);
second_term = norm_squared(pixel_value, neighbor_value) / (2 * sigma_color * sigma_color);
return __expf(-first_term - second_term);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment