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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_afftdn.c+2−2
@@ -974,7 +974,7 @@ static void finish_sample_noise(AudioFFTDeNoiseContext *s, · 973 unmodified lines
974 dnch->noise_band_var[i] -= dnch->noise_band_avr[i] * dnch->noise_band_avr[i] +974 dnch->noise_band_var[i] -= dnch->noise_band_avr[i] * dnch->noise_band_avr[i] +
975 dnch->noise_band_avi[i] * dnch->noise_band_avi[i];975 dnch->noise_band_avi[i] * dnch->noise_band_avi[i];
976 dnch->noise_band_auto_var[i] = dnch->noise_band_var[i];976 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;
978 }978 }
979 if (s->noise_band_count < NB_PROFILE_BANDS) {979 if (s->noise_band_count < NB_PROFILE_BANDS) {
980 for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++)980 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
1091{1091{
1092 if (s->noise_band_count > 0) {1092 if (s->noise_band_count > 0) {
1093 for (int i = 0; i < s->noise_band_count; i++) {1093 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;
1095 }1095 }
1096 if (s->noise_band_count < NB_PROFILE_BANDS) {1096 if (s->noise_band_count < NB_PROFILE_BANDS) {
1097 for (int i = s->noise_band_count; i < NB_PROFILE_BANDS; i++)1097 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