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
b5958ff8
Commit
b5958ff8
authored
Dec 23, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_convolve: unbreak non-power of 2 width&height filtering
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b943bc34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
vf_convolve.c
libavfilter/vf_convolve.c
+20
-7
No files found.
libavfilter/vf_convolve.c
View file @
b5958ff8
...
@@ -112,11 +112,13 @@ static int config_input_main(AVFilterLink *inlink)
...
@@ -112,11 +112,13 @@ static int config_input_main(AVFilterLink *inlink)
for
(
i
=
0
;
i
<
s
->
nb_planes
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_planes
;
i
++
)
{
int
w
=
s
->
planewidth
[
i
];
int
w
=
s
->
planewidth
[
i
];
int
h
=
s
->
planeheight
[
i
];
int
h
=
s
->
planeheight
[
i
];
int
n
=
FFMAX
(
w
,
h
)
*
10
/
9
;
int
n
=
FFMAX
(
w
,
h
);
n
+=
n
/
2
;
for
(
fft_bits
=
1
;
1
<<
fft_bits
<
n
;
fft_bits
++
);
for
(
fft_bits
=
1
;
1
<<
fft_bits
<
n
;
fft_bits
++
);
s
->
fft_bits
[
i
]
=
fft_bits
;
s
->
fft_bits
[
i
]
=
fft_bits
+
1
;
s
->
fft_len
[
i
]
=
1
<<
s
->
fft_bits
[
i
];
s
->
fft_len
[
i
]
=
1
<<
s
->
fft_bits
[
i
];
if
(
!
(
s
->
fft_hdata
[
i
]
=
av_calloc
(
s
->
fft_len
[
i
],
s
->
fft_len
[
i
]
*
sizeof
(
FFTComplex
))))
if
(
!
(
s
->
fft_hdata
[
i
]
=
av_calloc
(
s
->
fft_len
[
i
],
s
->
fft_len
[
i
]
*
sizeof
(
FFTComplex
))))
...
@@ -173,7 +175,20 @@ static void fft_horizontal(ConvolveContext *s, FFTComplex *fft_hdata,
...
@@ -173,7 +175,20 @@ static void fft_horizontal(ConvolveContext *s, FFTComplex *fft_hdata,
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
}
}
}
}
for
(;
x
<
n
/
2
;
x
++
)
{
fft_hdata
[
y
*
n
+
x
].
re
=
0
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
}
for
(;
x
<
n
;
x
++
)
{
for
(;
x
<
n
;
x
++
)
{
fft_hdata
[
y
*
n
+
x
].
re
=
fft_hdata
[
y
*
n
+
n
-
x
-
1
].
re
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
}
}
for
(;
y
<
n
/
2
;
y
++
)
{
for
(
x
=
0
;
x
<
n
;
x
++
)
{
fft_hdata
[
y
*
n
+
x
].
re
=
0
;
fft_hdata
[
y
*
n
+
x
].
re
=
0
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
}
}
...
@@ -181,7 +196,7 @@ static void fft_horizontal(ConvolveContext *s, FFTComplex *fft_hdata,
...
@@ -181,7 +196,7 @@ static void fft_horizontal(ConvolveContext *s, FFTComplex *fft_hdata,
for
(;
y
<
n
;
y
++
)
{
for
(;
y
<
n
;
y
++
)
{
for
(
x
=
0
;
x
<
n
;
x
++
)
{
for
(
x
=
0
;
x
<
n
;
x
++
)
{
fft_hdata
[
y
*
n
+
x
].
re
=
0
;
fft_hdata
[
y
*
n
+
x
].
re
=
fft_hdata
[(
n
-
y
-
1
)
*
n
+
x
].
re
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
fft_hdata
[
y
*
n
+
x
].
im
=
0
;
}
}
}
}
...
@@ -202,10 +217,7 @@ static void fft_vertical(ConvolveContext *s, FFTComplex *fft_hdata, FFTComplex *
...
@@ -202,10 +217,7 @@ static void fft_vertical(ConvolveContext *s, FFTComplex *fft_hdata, FFTComplex *
fft_vdata
[
y
*
n
+
x
].
re
=
fft_hdata
[
x
*
n
+
y
].
re
;
fft_vdata
[
y
*
n
+
x
].
re
=
fft_hdata
[
x
*
n
+
y
].
re
;
fft_vdata
[
y
*
n
+
x
].
im
=
fft_hdata
[
x
*
n
+
y
].
im
;
fft_vdata
[
y
*
n
+
x
].
im
=
fft_hdata
[
x
*
n
+
y
].
im
;
}
}
for
(;
x
<
n
;
x
++
)
{
fft_vdata
[
y
*
n
+
x
].
re
=
0
;
fft_vdata
[
y
*
n
+
x
].
im
=
0
;
}
av_fft_permute
(
s
->
fft
[
plane
],
fft_vdata
+
y
*
n
);
av_fft_permute
(
s
->
fft
[
plane
],
fft_vdata
+
y
*
n
);
av_fft_calc
(
s
->
fft
[
plane
],
fft_vdata
+
y
*
n
);
av_fft_calc
(
s
->
fft
[
plane
],
fft_vdata
+
y
*
n
);
}
}
...
@@ -218,6 +230,7 @@ static void ifft_vertical(ConvolveContext *s, int n, int plane)
...
@@ -218,6 +230,7 @@ static void ifft_vertical(ConvolveContext *s, int n, int plane)
for
(
y
=
0
;
y
<
n
;
y
++
)
{
for
(
y
=
0
;
y
<
n
;
y
++
)
{
av_fft_permute
(
s
->
ifft
[
plane
],
s
->
fft_vdata
[
plane
]
+
y
*
n
);
av_fft_permute
(
s
->
ifft
[
plane
],
s
->
fft_vdata
[
plane
]
+
y
*
n
);
av_fft_calc
(
s
->
ifft
[
plane
],
s
->
fft_vdata
[
plane
]
+
y
*
n
);
av_fft_calc
(
s
->
ifft
[
plane
],
s
->
fft_vdata
[
plane
]
+
y
*
n
);
for
(
x
=
0
;
x
<
n
;
x
++
)
{
for
(
x
=
0
;
x
<
n
;
x
++
)
{
s
->
fft_hdata
[
plane
][
x
*
n
+
y
].
re
=
s
->
fft_vdata
[
plane
][
y
*
n
+
x
].
re
;
s
->
fft_hdata
[
plane
][
x
*
n
+
y
].
re
=
s
->
fft_vdata
[
plane
][
y
*
n
+
x
].
re
;
s
->
fft_hdata
[
plane
][
x
*
n
+
y
].
im
=
s
->
fft_vdata
[
plane
][
y
*
n
+
x
].
im
;
s
->
fft_hdata
[
plane
][
x
*
n
+
y
].
im
=
s
->
fft_vdata
[
plane
][
y
*
n
+
x
].
im
;
...
...
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