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
b791d0e4
Commit
b791d0e4
authored
Sep 11, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vaguedenoiser: calculate dimensions at init
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
dc669d5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
vf_vaguedenoiser.c
libavfilter/vf_vaguedenoiser.c
+21
-19
No files found.
libavfilter/vf_vaguedenoiser.c
View file @
b791d0e4
...
@@ -52,10 +52,10 @@ typedef struct VagueDenoiserContext {
...
@@ -52,10 +52,10 @@ typedef struct VagueDenoiserContext {
float
*
out
;
float
*
out
;
float
*
tmp
;
float
*
tmp
;
int
hlowsize
[
32
];
int
hlowsize
[
4
][
32
];
int
hhighsize
[
32
];
int
hhighsize
[
4
][
32
];
int
vlowsize
[
32
];
int
vlowsize
[
4
][
32
];
int
vhighsize
[
32
];
int
vhighsize
[
4
][
32
];
void
(
*
thresholding
)(
float
*
block
,
const
int
width
,
const
int
height
,
void
(
*
thresholding
)(
float
*
block
,
const
int
width
,
const
int
height
,
const
int
stride
,
const
float
threshold
,
const
int
stride
,
const
float
threshold
,
...
@@ -132,7 +132,7 @@ static int config_input(AVFilterLink *inlink)
...
@@ -132,7 +132,7 @@ static int config_input(AVFilterLink *inlink)
{
{
VagueDenoiserContext
*
s
=
inlink
->
dst
->
priv
;
VagueDenoiserContext
*
s
=
inlink
->
dst
->
priv
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
int
nsteps_width
,
nsteps_height
,
nsteps_max
;
int
p
,
i
,
nsteps_width
,
nsteps_height
,
nsteps_max
;
s
->
depth
=
desc
->
comp
[
0
].
depth
;
s
->
depth
=
desc
->
comp
[
0
].
depth
;
s
->
nb_planes
=
desc
->
nb_components
;
s
->
nb_planes
=
desc
->
nb_components
;
...
@@ -163,6 +163,20 @@ static int config_input(AVFilterLink *inlink)
...
@@ -163,6 +163,20 @@ static int config_input(AVFilterLink *inlink)
s
->
nsteps
=
FFMIN
(
s
->
nsteps
,
nsteps_max
-
2
);
s
->
nsteps
=
FFMIN
(
s
->
nsteps
,
nsteps_max
-
2
);
for
(
p
=
0
;
p
<
4
;
p
++
)
{
s
->
hlowsize
[
p
][
0
]
=
(
s
->
planewidth
[
p
]
+
1
)
>>
1
;
s
->
hhighsize
[
p
][
0
]
=
s
->
planewidth
[
p
]
>>
1
;
s
->
vlowsize
[
p
][
0
]
=
(
s
->
planeheight
[
p
]
+
1
)
>>
1
;
s
->
vhighsize
[
p
][
0
]
=
s
->
planeheight
[
p
]
>>
1
;
for
(
i
=
1
;
i
<
s
->
nsteps
;
i
++
)
{
s
->
hlowsize
[
p
][
i
]
=
(
s
->
hlowsize
[
p
][
i
-
1
]
+
1
)
>>
1
;
s
->
hhighsize
[
p
][
i
]
=
s
->
hlowsize
[
p
][
i
-
1
]
>>
1
;
s
->
vlowsize
[
p
][
i
]
=
(
s
->
vlowsize
[
p
][
i
-
1
]
+
1
)
>>
1
;
s
->
vhighsize
[
p
][
i
]
=
s
->
vlowsize
[
p
][
i
-
1
]
>>
1
;
}
}
return
0
;
return
0
;
}
}
...
@@ -441,21 +455,9 @@ static void filter(VagueDenoiserContext *s, AVFrame *in, AVFrame *out)
...
@@ -441,21 +455,9 @@ static void filter(VagueDenoiserContext *s, AVFrame *in, AVFrame *out)
s
->
thresholding
(
s
->
block
,
width
,
height
,
width
,
s
->
threshold
,
s
->
percent
,
s
->
nsteps
);
s
->
thresholding
(
s
->
block
,
width
,
height
,
width
,
s
->
threshold
,
s
->
percent
,
s
->
nsteps
);
s
->
hlowsize
[
0
]
=
(
width
+
1
)
>>
1
;
s
->
hhighsize
[
0
]
=
width
>>
1
;
s
->
vlowsize
[
0
]
=
(
height
+
1
)
>>
1
;
s
->
vhighsize
[
0
]
=
height
>>
1
;
for
(
i
=
1
;
i
<
s
->
nsteps
;
i
++
)
{
s
->
hlowsize
[
i
]
=
(
s
->
hlowsize
[
i
-
1
]
+
1
)
>>
1
;
s
->
hhighsize
[
i
]
=
s
->
hlowsize
[
i
-
1
]
>>
1
;
s
->
vlowsize
[
i
]
=
(
s
->
vlowsize
[
i
-
1
]
+
1
)
>>
1
;
s
->
vhighsize
[
i
]
=
s
->
vlowsize
[
i
-
1
]
>>
1
;
}
while
(
nsteps_invert
--
)
{
while
(
nsteps_invert
--
)
{
const
int
idx
=
s
->
vlowsize
[
nsteps_invert
]
+
s
->
vhighsize
[
nsteps_invert
];
const
int
idx
=
s
->
vlowsize
[
p
][
nsteps_invert
]
+
s
->
vhighsize
[
p
]
[
nsteps_invert
];
const
int
idx2
=
s
->
hlowsize
[
nsteps_invert
]
+
s
->
hhighsize
[
nsteps_invert
];
const
int
idx2
=
s
->
hlowsize
[
p
][
nsteps_invert
]
+
s
->
hhighsize
[
p
]
[
nsteps_invert
];
float
*
idx3
=
s
->
block
;
float
*
idx3
=
s
->
block
;
for
(
i
=
0
;
i
<
idx2
;
i
++
)
{
for
(
i
=
0
;
i
<
idx2
;
i
++
)
{
copyv
(
idx3
,
width
,
s
->
in
+
NPAD
,
idx
);
copyv
(
idx3
,
width
,
s
->
in
+
NPAD
,
idx
);
...
...
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