Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
e7caa18b
Commit
e7caa18b
authored
Mar 10, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_afftdn: remove special handling for first and last bin
parent
ea777333
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
39 deletions
+6
-39
af_afftdn.c
libavfilter/af_afftdn.c
+6
-39
No files found.
libavfilter/af_afftdn.c
View file @
e7caa18b
...
...
@@ -309,20 +309,9 @@ static void process_frame(AudioFFTDeNoiseContext *s, DeNoiseChannel *dnch,
double
*
prior
,
double
*
prior_band_excit
,
int
track_noise
)
{
double
d1
,
d2
,
d3
,
gain
;
int
n
,
i1
;
d1
=
fft_data
[
0
].
re
*
fft_data
[
0
].
re
;
dnch
->
noisy_data
[
0
]
=
d1
;
d2
=
d1
/
dnch
->
abs_var
[
0
];
d3
=
RATIO
*
prior
[
0
]
+
RRATIO
*
fmax
(
d2
-
1
.
0
,
0
.
0
);
gain
=
d3
/
(
1
.
0
+
d3
);
gain
*=
(
gain
+
M_PI_4
/
fmax
(
d2
,
1.0E-6
));
prior
[
0
]
=
(
d2
*
gain
);
dnch
->
clean_data
[
0
]
=
(
d1
*
gain
);
gain
=
sqrt
(
gain
);
dnch
->
gain
[
0
]
=
gain
;
n
=
0
;
for
(
int
i
=
1
;
i
<
s
->
fft_length2
;
i
++
)
{
int
n
=
0
,
i1
;
for
(
int
i
=
0
;
i
<
s
->
fft_length2
;
i
++
)
{
d1
=
fft_data
[
i
].
re
*
fft_data
[
i
].
re
+
fft_data
[
i
].
im
*
fft_data
[
i
].
im
;
if
(
d1
>
s
->
sample_floor
)
n
=
i
;
...
...
@@ -337,19 +326,7 @@ static void process_frame(AudioFFTDeNoiseContext *s, DeNoiseChannel *dnch,
gain
=
sqrt
(
gain
);
dnch
->
gain
[
i
]
=
gain
;
}
d1
=
fft_data
[
0
].
im
*
fft_data
[
0
].
im
;
if
(
d1
>
s
->
sample_floor
)
n
=
s
->
fft_length2
;
dnch
->
noisy_data
[
s
->
fft_length2
]
=
d1
;
d2
=
d1
/
dnch
->
abs_var
[
s
->
fft_length2
];
d3
=
RATIO
*
prior
[
s
->
fft_length2
]
+
RRATIO
*
fmax
(
d2
-
1
.
0
,
0
.
0
);
gain
=
d3
/
(
1
.
0
+
d3
);
gain
*=
gain
+
M_PI_4
/
fmax
(
d2
,
1.0E-6
);
prior
[
s
->
fft_length2
]
=
d2
*
gain
;
dnch
->
clean_data
[
s
->
fft_length2
]
=
d1
*
gain
;
gain
=
sqrt
(
gain
);
dnch
->
gain
[
s
->
fft_length2
]
=
gain
;
if
(
n
>
s
->
fft_length2
-
2
)
{
n
=
s
->
bin_count
;
i1
=
s
->
noise_band_count
;
...
...
@@ -472,7 +449,7 @@ static void process_frame(AudioFFTDeNoiseContext *s, DeNoiseChannel *dnch,
dnch
->
gain
[
s
->
fft_length2
]
=
limit_gain
(
dnch
->
gain
[
s
->
fft_length2
],
s
->
max_gain
);
}
for
(
int
i
=
1
;
i
<
s
->
fft_length2
;
i
++
)
{
for
(
int
i
=
0
;
i
<
s
->
fft_length2
;
i
++
)
{
if
(
dnch
->
amt
[
i
]
>
dnch
->
abs_var
[
i
])
{
dnch
->
gain
[
i
]
=
1
.
0
;
}
else
if
(
dnch
->
amt
[
i
]
>
dnch
->
min_abs_var
[
i
])
{
...
...
@@ -483,13 +460,7 @@ static void process_frame(AudioFFTDeNoiseContext *s, DeNoiseChannel *dnch,
}
}
gain
=
dnch
->
gain
[
0
];
dnch
->
clean_data
[
0
]
=
(
gain
*
gain
*
dnch
->
noisy_data
[
0
]);
fft_data
[
0
].
re
*=
gain
;
gain
=
dnch
->
gain
[
s
->
fft_length2
];
dnch
->
clean_data
[
s
->
fft_length2
]
=
(
gain
*
gain
*
dnch
->
noisy_data
[
s
->
fft_length2
]);
fft_data
[
0
].
im
*=
gain
;
for
(
int
i
=
1
;
i
<
s
->
fft_length2
;
i
++
)
{
for
(
int
i
=
0
;
i
<
s
->
fft_length2
;
i
++
)
{
gain
=
dnch
->
gain
[
i
];
dnch
->
clean_data
[
i
]
=
(
gain
*
gain
*
dnch
->
noisy_data
[
i
]);
fft_data
[
i
].
re
*=
gain
;
...
...
@@ -911,10 +882,6 @@ static void sample_noise_block(AudioFFTDeNoiseContext *s,
k
=
0
;
n
=
j
;
edgemax
=
fmin
(
s
->
fft_length2
,
s
->
noise_band_edge
[
15
]);
dnch
->
fft_out
[
s
->
fft_length2
].
re
=
dnch
->
fft_out
[
0
].
im
;
dnch
->
fft_out
[
0
].
im
=
0
.
0
;
dnch
->
fft_out
[
s
->
fft_length2
].
im
=
0
.
0
;
for
(
int
i
=
j
;
i
<=
edgemax
;
i
++
)
{
if
((
i
==
j
)
&&
(
i
<
edgemax
))
{
if
(
j
>
edge
)
{
...
...
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