History

avfilter/af_arnndn: unbreak filtering

Paul B Mahol committed 3 years ago

Commit 11b02fc1 parent 180a7d21 file · +5 −4Browse files

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

Unified · Split

libavfilter/af_arnndn.c+5−4
@@ -373,14 +373,15 @@ static int config_input(AVFilterLink *inlink) · 372 unmodified lines
373 373
374 for (int i = 0; i < s->channels; i++) {374 for (int i = 0; i < s->channels; i++) {
375 DenoiseState *st = &s->st[i];375 DenoiseState *st = &s->st[i];
376 float scale = 1.f;
376 377
377 if (!st->tx)378 if (!st->tx)
378 ret = av_tx_init(&st->tx, &st->tx_fn, AV_TX_FLOAT_FFT, 0, WINDOW_SIZE, NULL, 0);379 ret = av_tx_init(&st->tx, &st->tx_fn, AV_TX_FLOAT_FFT, 0, WINDOW_SIZE, &scale, 0);
379 if (ret < 0)380 if (ret < 0)
380 return ret;381 return ret;
381 382
382 if (!st->txi)383 if (!st->txi)
383 ret = av_tx_init(&st->txi, &st->txi_fn, AV_TX_FLOAT_FFT, 1, WINDOW_SIZE, NULL, 0);384 ret = av_tx_init(&st->txi, &st->txi_fn, AV_TX_FLOAT_FFT, 1, WINDOW_SIZE, &scale, 0);
384 if (ret < 0)385 if (ret < 0)
385 return ret;386 return ret;
386 }387 }
@@ -416,7 +417,7 @@ static void forward_transform(DenoiseState *st, AVComplexFloat *out, const float · 29 unmodified lines
416 x[i].im = 0;417 x[i].im = 0;
417 }418 }
418 419
419 st->tx_fn(st->tx, y, x, sizeof(float));420 st->tx_fn(st->tx, y, x, sizeof(AVComplexFloat));
420 421
421 RNN_COPY(out, y, FREQ_SIZE);422 RNN_COPY(out, y, FREQ_SIZE);
422}423}
@@ -433,7 +434,7 @@ static void inverse_transform(DenoiseState *st, float *out, const AVComplexFloat · 10 unmodified lines
433 x[i].im = -x[WINDOW_SIZE - i].im;434 x[i].im = -x[WINDOW_SIZE - i].im;
434 }435 }
435 436
436 st->txi_fn(st->txi, y, x, sizeof(float));437 st->txi_fn(st->txi, y, x, sizeof(AVComplexFloat));
437 438
438 for (int i = 0; i < WINDOW_SIZE; i++)439 for (int i = 0; i < WINDOW_SIZE; i++)
439 out[i] = y[i].re / WINDOW_SIZE;440 out[i] = y[i].re / WINDOW_SIZE;

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