summaryrefslogtreecommitdiff
path: root/libavfilter/af_afftdn.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-12-03 21:25:32 +0100
committerPaul B Mahol <onemda@gmail.com>2022-12-03 21:28:54 +0100
commit7bf74f909dccbf49012d9c66adfdec4913065ef5 (patch)
treec6096f51dad83252ee5209f38d72c42ce7e2d6a5 /libavfilter/af_afftdn.c
parent710d83bdde6d598c88e9696bc4b9f6ea4b84f541 (diff)
avfilter/af_afftdn: fix invalid duplicated use of sizeof()
Diffstat (limited to 'libavfilter/af_afftdn.c')
-rw-r--r--libavfilter/af_afftdn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 2b465afcef..aa30e35d57 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -107,6 +107,7 @@ typedef struct AudioFFTDeNoiseContext {
int format;
size_t sample_size;
+ size_t complex_sample_size;
float noise_reduction;
float noise_floor;
@@ -627,7 +628,6 @@ static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AudioFFTDeNoiseContext *s = ctx->priv;
- size_t complex_sample_size;
double wscale, sar, sum, sdiv;
int i, j, k, m, n, ret, tx_type;
double dscale = 1.;
@@ -639,13 +639,13 @@ static int config_input(AVFilterLink *inlink)
switch (s->format) {
case AV_SAMPLE_FMT_FLTP:
s->sample_size = sizeof(float);
- complex_sample_size = sizeof(AVComplexFloat);
+ s->complex_sample_size = sizeof(AVComplexFloat);
tx_type = AV_TX_FLOAT_RDFT;
scale = &fscale;
break;
case AV_SAMPLE_FMT_DBLP:
s->sample_size = sizeof(double);
- complex_sample_size = sizeof(AVComplexDouble);
+ s->complex_sample_size = sizeof(AVComplexDouble);
tx_type = AV_TX_DOUBLE_RDFT;
scale = &dscale;
break;
@@ -753,7 +753,7 @@ static int config_input(AVFilterLink *inlink)
dnch->rel_var = av_calloc(s->bin_count, sizeof(*dnch->rel_var));
dnch->min_abs_var = av_calloc(s->bin_count, sizeof(*dnch->min_abs_var));
dnch->fft_in = av_calloc(s->fft_length2, s->sample_size);
- dnch->fft_out = av_calloc(s->fft_length2 + 1, complex_sample_size);
+ dnch->fft_out = av_calloc(s->fft_length2 + 1, s->complex_sample_size);
ret = av_tx_init(&dnch->fft, &dnch->tx_fn, tx_type, 0, s->fft_length2, scale, 0);
if (ret < 0)
return ret;
@@ -931,7 +931,7 @@ static void sample_noise_block(AudioFFTDeNoiseContext *s,
break;
}
- dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, sizeof(s->sample_size));
+ dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, s->sample_size);
edge = s->noise_band_edge[0];
j = edge;
@@ -1074,14 +1074,14 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_job
break;
}
- dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, sizeof(s->sample_size));
+ dnch->tx_fn(dnch->fft, dnch->fft_out, dnch->fft_in, s->sample_size);
process_frame(ctx, s, dnch,
dnch->prior,
dnch->prior_band_excit,
s->track_noise);
- dnch->itx_fn(dnch->ifft, dnch->fft_in, dnch->fft_out, sizeof(s->sample_size));
+ dnch->itx_fn(dnch->ifft, dnch->fft_in, dnch->fft_out, s->complex_sample_size);
switch (s->format) {
case AV_SAMPLE_FMT_FLTP: