History

avfilter/af_afftdn: use log10 instead to get noise levels

Paul B Mahol committed 4 years ago

Commit 26292d41 parent 4a96baa1 file · +2 −2Browse files

Unified · Split

libavfilter/af_afftdn.c+2−2
@@ -974,7 +974,7 @@ static void finish_sample_noise(AudioFFTDeNoiseContext *s, · 973 unmodified lines
974974 dnch->noise_band_var[i] -= dnch->noise_band_avr[i] * dnch->noise_band_avr[i] +
975975 dnch->noise_band_avi[i] * dnch->noise_band_avi[i];
976976 dnch->noise_band_auto_var[i] = dnch->noise_band_var[i];
977− sample_noise[i] = (1.0 / C) * log(dnch->noise_band_var[i] / s->floor) - 100.0;
977+ sample_noise[i] = 10.0 * log10(dnch->noise_band_var[i] / s->floor) - 100.0;
978978 }
979979 if (s->noise_band_count < NB_PROFILE_BANDS) {
980980 for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++)
@@ -1091,7 +1091,7 @@ static void get_auto_noise_levels(AudioFFTDeNoiseContext *s, · 110 unmodified lines
10911091 {
10921092 if (s->noise_band_count > 0) {
10931093 for (int i = 0; i < s->noise_band_count; i++) {
1094− levels[i] = (1.0 / C) * log(dnch->noise_band_auto_var[i] / s->floor) - 100.0;
1094+ levels[i] = 10.0 * log10(dnch->noise_band_auto_var[i] / s->floor) - 100.0;
10951095 }
10961096 if (s->noise_band_count < NB_PROFILE_BANDS) {
10971097 for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t