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
f5559dd8
Commit
f5559dd8
authored
Aug 14, 2018
by
Mina
Committed by
Thilo Borgmann
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/vf_colorconstancy: cosmetic update
parent
729ebd3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
vf_colorconstancy.c
libavfilter/vf_colorconstancy.c
+7
-7
No files found.
libavfilter/vf_colorconstancy.c
View file @
f5559dd8
...
...
@@ -28,7 +28,6 @@
* J. van de Weijer, Th. Gevers, A. Gijsenij "Edge-Based Color Constancy".
*/
#include "libavutil/bprint.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
...
...
@@ -42,6 +41,8 @@
#define GREY_EDGE "greyedge"
#define SQRT3 1.73205080757
#define NUM_PLANES 3
#define MAX_DIFF_ORD 2
#define MAX_META_DATA 4
...
...
@@ -145,7 +146,7 @@ static int set_gauss(AVFilterContext *ctx)
sum1
=
0
.
0
;
for
(
i
=
0
;
i
<
filtersize
;
++
i
)
{
s
->
gauss
[
1
][
i
]
=
-
(
GINDX
(
filtersize
,
i
)
/
pow
(
sigma
,
2
))
*
s
->
gauss
[
0
][
i
];
sum1
+=
s
->
gauss
[
1
][
i
]
*
GINDX
(
filtersize
,
i
);
sum1
+=
s
->
gauss
[
1
][
i
]
*
GINDX
(
filtersize
,
i
);
}
for
(
i
=
0
;
i
<
filtersize
;
++
i
)
{
...
...
@@ -595,7 +596,6 @@ static int diagonal_transformation(AVFilterContext *ctx, void *arg, int jobnr, i
ThreadData
*
td
=
arg
;
AVFrame
*
in
=
td
->
in
;
AVFrame
*
out
=
td
->
out
;
double
sqrt3
=
pow
(
3
.
0
,
0
.
5
);
int
plane
;
for
(
plane
=
0
;
plane
<
NUM_PLANES
;
++
plane
)
{
...
...
@@ -610,7 +610,7 @@ static int diagonal_transformation(AVFilterContext *ctx, void *arg, int jobnr, i
unsigned
i
;
for
(
i
=
slice_start
;
i
<
slice_end
;
++
i
)
{
temp
=
src
[
i
]
/
(
s
->
white
[
plane
]
*
sqrt
3
);
temp
=
src
[
i
]
/
(
s
->
white
[
plane
]
*
SQRT
3
);
dst
[
i
]
=
av_clip_uint8
((
int
)(
temp
+
0
.
5
));
}
}
...
...
@@ -657,12 +657,12 @@ static int config_props(AVFilterLink *inlink)
double
sigma
=
s
->
sigma
;
int
ret
;
if
(
!
sigma
&&
s
->
difford
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"
Sigma can't be set to 0 when difford > 0.
\n
"
);
if
(
!
floor
(
break_off_sigma
*
sigma
+
0
.
5
)
&&
s
->
difford
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"
floor(%f * sigma) must be > 0 when difford > 0.
\n
"
,
break_off_sigma
);
return
AVERROR
(
EINVAL
);
}
s
->
filtersize
=
2
*
floor
(
break_off_sigma
*
s
->
s
igma
+
0
.
5
)
+
1
;
s
->
filtersize
=
2
*
floor
(
break_off_sigma
*
sigma
+
0
.
5
)
+
1
;
if
(
ret
=
set_gauss
(
ctx
))
{
return
ret
;
}
...
...
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