History

avfilter/af_afftdn: fix invalid duplicated use of sizeof()

Paul B Mahol committed 3 years ago

Commit 7bf74f91 parent 710d83b1 file · +7 −7Browse files

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

Unified · Split

libavfilter/af_afftdn.c+7−7
@@ -107,6 +107,7 @@ typedef struct AudioFFTDeNoiseContext { · 106 unmodified lines
107107
108108 int format;
109109 size_t sample_size;
110+ size_t complex_sample_size;
110111
111112 float noise_reduction;
112113 float noise_floor;
@@ -627,7 +628,6 @@ static int config_input(AVFilterLink *inlink) · 514 unmodified lines
627628 {
628629 AVFilterContext *ctx = inlink->dst;
629630 AudioFFTDeNoiseContext *s = ctx->priv;
630− size_t complex_sample_size;
631631 double wscale, sar, sum, sdiv;
632632 int i, j, k, m, n, ret, tx_type;
633633 double dscale = 1.;
@@ -639,13 +639,13 @@ static int config_input(AVFilterLink *inlink) · 5 unmodified lines
639639 switch (s->format) {
640640 case AV_SAMPLE_FMT_FLTP:
641641 s->sample_size = sizeof(float);
642− complex_sample_size = sizeof(AVComplexFloat);
642+ s->complex_sample_size = sizeof(AVComplexFloat);
643643 tx_type = AV_TX_FLOAT_RDFT;
644644 scale = &fscale;
645645 break;
646646 case AV_SAMPLE_FMT_DBLP:
647647 s->sample_size = sizeof(double);
648− complex_sample_size = sizeof(AVComplexDouble);
648+ s->complex_sample_size = sizeof(AVComplexDouble);
649649 tx_type = AV_TX_DOUBLE_RDFT;
650650 scale = &dscale;
651651 break;
@@ -753,7 +753,7 @@ static int config_input(AVFilterLink *inlink) · 101 unmodified lines
753753 dnch->rel_var = av_calloc(s->bin_count, sizeof(*dnch->rel_var));
754754 dnch->min_abs_var = av_calloc(s->bin_count, sizeof(*dnch->min_abs_var));
755755 dnch->fft_in = av_calloc(s->fft_length2, s->sample_size);
756− dnch->fft_out = av_calloc(s->fft_length2 + 1, complex_sample_size);
756+ dnch->fft_out = av_calloc(s->fft_length2 + 1, s->complex_sample_size);
757757 ret = av_tx_init(&dnch->fft, &dnch->tx_fn, tx_type, 0, s->fft_length2, scale, 0);
758758 if (ret < 0)
759759 return ret;
@@ -931,7 +931,7 @@ static void sample_noise_block(AudioFFTDeNoiseContext *s, · 171 unmodified lines
931931 break;
932932 }
933933
934− dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, sizeof(s->sample_size));
934+ dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, s->sample_size);
935935
936936 edge = s->noise_band_edge[0];
937937 j = edge;
@@ -1074,14 +1074,14 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_job · 136 unmodified lines
10741074 break;
10751075 }
10761076
1077− dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, sizeof(s->sample_size));
1077+ dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, s->sample_size);
10781078
10791079 process_frame(ctx, s, dnch,
10801080 dnch->prior,
10811081 dnch->prior_band_excit,
10821082 s->track_noise);
10831083
1084− dnch->itx_fn(dnch->ifft, dnch->fft_in, dnch->fft_out, sizeof(s->sample_size));
1084+ dnch->itx_fn(dnch->ifft, dnch->fft_in, dnch->fft_out, s->complex_sample_size);
10851085
10861086 switch (s->format) {
10871087 case AV_SAMPLE_FMT_FLTP:

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