Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -107,6 +107,7 @@ typedef struct AudioFFTDeNoiseContext { · 106 unmodified lines | ||
| 107 | 107 | |
| 108 | 108 | int format; |
| 109 | 109 | size_t sample_size; |
| 110 | + size_t complex_sample_size; | |
| 110 | 111 | |
| 111 | 112 | float noise_reduction; |
| 112 | 113 | float noise_floor; |
| @@ -627,7 +628,6 @@ static int config_input(AVFilterLink *inlink) · 514 unmodified lines | ||
| 627 | 628 | { |
| 628 | 629 | AVFilterContext *ctx = inlink->dst; |
| 629 | 630 | AudioFFTDeNoiseContext *s = ctx->priv; |
| 630 | − size_t complex_sample_size; | |
| 631 | 631 | double wscale, sar, sum, sdiv; |
| 632 | 632 | int i, j, k, m, n, ret, tx_type; |
| 633 | 633 | double dscale = 1.; |
| @@ -639,13 +639,13 @@ static int config_input(AVFilterLink *inlink) · 5 unmodified lines | ||
| 639 | 639 | switch (s->format) { |
| 640 | 640 | case AV_SAMPLE_FMT_FLTP: |
| 641 | 641 | s->sample_size = sizeof(float); |
| 642 | − complex_sample_size = sizeof(AVComplexFloat); | |
| 642 | + s->complex_sample_size = sizeof(AVComplexFloat); | |
| 643 | 643 | tx_type = AV_TX_FLOAT_RDFT; |
| 644 | 644 | scale = &fscale; |
| 645 | 645 | break; |
| 646 | 646 | case AV_SAMPLE_FMT_DBLP: |
| 647 | 647 | s->sample_size = sizeof(double); |
| 648 | − complex_sample_size = sizeof(AVComplexDouble); | |
| 648 | + s->complex_sample_size = sizeof(AVComplexDouble); | |
| 649 | 649 | tx_type = AV_TX_DOUBLE_RDFT; |
| 650 | 650 | scale = &dscale; |
| 651 | 651 | break; |
| @@ -753,7 +753,7 @@ static int config_input(AVFilterLink *inlink) · 101 unmodified lines | ||
| 753 | 753 | dnch->rel_var = av_calloc(s->bin_count, sizeof(*dnch->rel_var)); |
| 754 | 754 | dnch->min_abs_var = av_calloc(s->bin_count, sizeof(*dnch->min_abs_var)); |
| 755 | 755 | 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); | |
| 757 | 757 | ret = av_tx_init(&dnch->fft, &dnch->tx_fn, tx_type, 0, s->fft_length2, scale, 0); |
| 758 | 758 | if (ret < 0) |
| 759 | 759 | return ret; |
| @@ -931,7 +931,7 @@ static void sample_noise_block(AudioFFTDeNoiseContext *s, · 171 unmodified lines | ||
| 931 | 931 | break; |
| 932 | 932 | } |
| 933 | 933 | |
| 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); | |
| 935 | 935 | |
| 936 | 936 | edge = s->noise_band_edge[0]; |
| 937 | 937 | j = edge; |
| @@ -1074,14 +1074,14 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_job · 136 unmodified lines | ||
| 1074 | 1074 | break; |
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 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); | |
| 1078 | 1078 | |
| 1079 | 1079 | process_frame(ctx, s, dnch, |
| 1080 | 1080 | dnch->prior, |
| 1081 | 1081 | dnch->prior_band_excit, |
| 1082 | 1082 | s->track_noise); |
| 1083 | 1083 | |
| 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); | |
| 1085 | 1085 | |
| 1086 | 1086 | switch (s->format) { |
| 1087 | 1087 | case AV_SAMPLE_FMT_FLTP: |