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
8b0575d7
Commit
8b0575d7
authored
May 16, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_colorkey: fix formula for calculation of difference
Also fixes colorhold filtering.
parent
f63939de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
vf_colorkey.c
libavfilter/vf_colorkey.c
+1
-1
ffmpeg-filter_colorkey
tests/ref/fate/ffmpeg-filter_colorkey
+10
-10
No files found.
libavfilter/vf_colorkey.c
View file @
8b0575d7
...
...
@@ -45,7 +45,7 @@ static uint8_t do_colorkey_pixel(ColorkeyContext *ctx, uint8_t r, uint8_t g, uin
int
dg
=
(
int
)
g
-
ctx
->
colorkey_rgba
[
1
];
int
db
=
(
int
)
b
-
ctx
->
colorkey_rgba
[
2
];
double
diff
=
sqrt
((
dr
*
dr
+
dg
*
dg
+
db
*
db
)
/
(
255
.
0
*
255
.
0
));
double
diff
=
sqrt
((
dr
*
dr
+
dg
*
dg
+
db
*
db
)
/
(
255
.
0
*
255
.
0
*
3
.
0
));
if
(
ctx
->
blend
>
0
.
0001
)
{
return
av_clipd
((
diff
-
ctx
->
similarity
)
/
ctx
->
blend
,
0
.
0
,
1
.
0
)
*
255
.
0
;
...
...
tests/ref/fate/ffmpeg-filter_colorkey
View file @
8b0575d7
...
...
@@ -3,13 +3,13 @@
#codec_id 0: rawvideo
#dimensions 0: 720x576
#sar 0: 0/1
0, 0, 0, 1, 622080, 0x
78efb628
0, 1, 1, 1, 622080, 0x
641f2564
0, 2, 2, 1, 622080, 0x
348f25c3
0, 3, 3, 1, 622080, 0x
6afc485a
0, 4, 4, 1, 622080, 0x
e949107f
0, 5, 5, 1, 622080, 0x
171716e5
0, 6, 6, 1, 622080, 0x
2985a01f
0, 7, 7, 1, 622080, 0x
c5ddabd7
0, 8, 8, 1, 622080, 0x
b4dd2b7f
0, 9, 9, 1, 622080, 0x
6e75ba82
0, 0, 0, 1, 622080, 0x
5775bb12
0, 1, 1, 1, 622080, 0x
84d8395a
0, 2, 2, 1, 622080, 0x
599d3a6b
0, 3, 3, 1, 622080, 0x
1df1e9dc
0, 4, 4, 1, 622080, 0x
f3255836
0, 5, 5, 1, 622080, 0x
f46bc26e
0, 6, 6, 1, 622080, 0x
76d491da
0, 7, 7, 1, 622080, 0x
2c9f3ca6
0, 8, 8, 1, 622080, 0x
5713e203
0, 9, 9, 1, 622080, 0x
47776493
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