History

avfilter/af_afftdn: do not profile noise if number of sampled blocks is 0

Paul B Mahol committed 4 years ago

Commit b6af56c1 parent 28447a41 file · +6 −0Browse files

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

Unified · Split

libavfilter/af_afftdn.c+6−0
@@ -125,6 +125,7 @@ typedef struct AudioFFTDeNoiseContext { · 124 unmodified lines
125 125
126 int channels;126 int channels;
127 int sample_noise;127 int sample_noise;
128 int sample_noise_blocks;
128 int sample_noise_mode;129 int sample_noise_mode;
129 float sample_rate;130 float sample_rate;
130 int buffer_length;131 int buffer_length;
@@ -1039,6 +1040,7 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in) · 908 unmodified lines
1039 }1040 }
1040 s->sample_noise_mode = SAMPLE_NONE;1041 s->sample_noise_mode = SAMPLE_NONE;
1041 s->sample_noise = 1;1042 s->sample_noise = 1;
1043 s->sample_noise_blocks = 0;
1042 }1044 }
1043 1045
1044 if (s->sample_noise) {1046 if (s->sample_noise) {
@@ -1047,6 +1049,7 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in) · 2 unmodified lines
1047 1049
1048 sample_noise_block(s, dnch, s->winframe, ch);1050 sample_noise_block(s, dnch, s->winframe, ch);
1049 }1051 }
1052 s->sample_noise_blocks++;
1050 }1053 }
1051 1054
1052 if (s->sample_noise_mode == SAMPLE_STOP) {1055 if (s->sample_noise_mode == SAMPLE_STOP) {
@@ -1054,11 +1057,14 @@ static int output_frame(AVFilterLink *inlink, AVFrame *in) · 1 unmodified line
1054 DeNoiseChannel *dnch = &s->dnch[ch];1057 DeNoiseChannel *dnch = &s->dnch[ch];
1055 double sample_noise[NB_PROFILE_BANDS];1058 double sample_noise[NB_PROFILE_BANDS];
1056 1059
1060 if (s->sample_noise_blocks <= 0)
1061 break;
1057 finish_sample_noise(s, dnch, sample_noise);1062 finish_sample_noise(s, dnch, sample_noise);
1058 set_noise_profile(s, dnch, sample_noise);1063 set_noise_profile(s, dnch, sample_noise);
1059 set_parameters(s, dnch, 1, 1);1064 set_parameters(s, dnch, 1, 1);
1060 }1065 }
1061 s->sample_noise = 0;1066 s->sample_noise = 0;
1067 s->sample_noise_blocks = 0;
1062 s->sample_noise_mode = SAMPLE_NONE;1068 s->sample_noise_mode = SAMPLE_NONE;
1063 }1069 }
1064 1070

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