Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
662120f2
Commit
662120f2
authored
Nov 15, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_convolution: use sqrtf as its faster
parent
1342ec52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
vf_convolution.c
libavfilter/vf_convolution.c
+6
-6
No files found.
libavfilter/vf_convolution.c
View file @
662120f2
...
...
@@ -157,7 +157,7 @@ static void filter16_prewitt(uint8_t *dstp, int width,
int
sumb
=
AV_RN16A
(
&
c
[
0
][
2
*
x
])
*
-
1
+
AV_RN16A
(
&
c
[
2
][
2
*
x
])
*
1
+
AV_RN16A
(
&
c
[
3
][
2
*
x
])
*
-
1
+
AV_RN16A
(
&
c
[
5
][
2
*
x
])
*
1
+
AV_RN16A
(
&
c
[
6
][
2
*
x
])
*
-
1
+
AV_RN16A
(
&
c
[
8
][
2
*
x
])
*
1
;
dst
[
x
]
=
av_clip
(
sqrt
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
,
0
,
peak
);
dst
[
x
]
=
av_clip
(
sqrt
f
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
,
0
,
peak
);
}
}
...
...
@@ -173,7 +173,7 @@ static void filter16_roberts(uint8_t *dstp, int width,
int
suma
=
AV_RN16A
(
&
c
[
0
][
2
*
x
])
*
1
+
AV_RN16A
(
&
c
[
1
][
2
*
x
])
*
-
1
;
int
sumb
=
AV_RN16A
(
&
c
[
4
][
2
*
x
])
*
1
+
AV_RN16A
(
&
c
[
3
][
2
*
x
])
*
-
1
;
dst
[
x
]
=
av_clip
(
sqrt
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
,
0
,
peak
);
dst
[
x
]
=
av_clip
(
sqrt
f
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
,
0
,
peak
);
}
}
...
...
@@ -191,7 +191,7 @@ static void filter16_sobel(uint8_t *dstp, int width,
int
sumb
=
AV_RN16A
(
&
c
[
0
][
2
*
x
])
*
-
1
+
AV_RN16A
(
&
c
[
2
][
2
*
x
])
*
1
+
AV_RN16A
(
&
c
[
3
][
2
*
x
])
*
-
2
+
AV_RN16A
(
&
c
[
5
][
2
*
x
])
*
2
+
AV_RN16A
(
&
c
[
6
][
2
*
x
])
*
-
1
+
AV_RN16A
(
&
c
[
8
][
2
*
x
])
*
1
;
dst
[
x
]
=
av_clip
(
sqrt
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
,
0
,
peak
);
dst
[
x
]
=
av_clip
(
sqrt
f
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
,
0
,
peak
);
}
}
...
...
@@ -211,7 +211,7 @@ static void filter_prewitt(uint8_t *dst, int width,
int
sumb
=
c0
[
x
]
*
-
1
+
c2
[
x
]
*
1
+
c3
[
x
]
*
-
1
+
c5
[
x
]
*
1
+
c6
[
x
]
*
-
1
+
c8
[
x
]
*
1
;
dst
[
x
]
=
av_clip_uint8
(
sqrt
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
);
dst
[
x
]
=
av_clip_uint8
(
sqrt
f
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
);
}
}
...
...
@@ -226,7 +226,7 @@ static void filter_roberts(uint8_t *dst, int width,
int
suma
=
c
[
0
][
x
]
*
1
+
c
[
1
][
x
]
*
-
1
;
int
sumb
=
c
[
4
][
x
]
*
1
+
c
[
3
][
x
]
*
-
1
;
dst
[
x
]
=
av_clip_uint8
(
sqrt
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
);
dst
[
x
]
=
av_clip_uint8
(
sqrt
f
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
);
}
}
...
...
@@ -246,7 +246,7 @@ static void filter_sobel(uint8_t *dst, int width,
int
sumb
=
c0
[
x
]
*
-
1
+
c2
[
x
]
*
1
+
c3
[
x
]
*
-
2
+
c5
[
x
]
*
2
+
c6
[
x
]
*
-
1
+
c8
[
x
]
*
1
;
dst
[
x
]
=
av_clip_uint8
(
sqrt
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
);
dst
[
x
]
=
av_clip_uint8
(
sqrt
f
(
suma
*
suma
+
sumb
*
sumb
)
*
scale
+
delta
);
}
}
...
...
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