]> git.sesse.net Git - ffmpeg/blob - libavfilter/af_afir.h
avfilter/af_afir: use AVFrame for coeff too
[ffmpeg] / libavfilter / af_afir.h
1 /*
2  * Copyright (c) 2017 Paul B Mahol
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20
21 #ifndef AVFILTER_AFIR_H
22 #define AVFILTER_AFIR_H
23
24 #include "libavutil/common.h"
25 #include "libavutil/float_dsp.h"
26 #include "libavutil/opt.h"
27 #include "libavcodec/avfft.h"
28
29 #include "audio.h"
30 #include "avfilter.h"
31 #include "formats.h"
32 #include "internal.h"
33
34 typedef struct AudioFIRSegment {
35     int nb_partitions;
36     int part_index;
37     int part_size;
38     int block_size;
39     int fft_length;
40     int coeff_size;
41     int segment_size;
42
43     AVFrame *sum;
44     AVFrame *block;
45     AVFrame *buffer;
46     AVFrame *coeff;
47
48     RDFTContext **rdft, **irdft;
49 } AudioFIRSegment;
50
51 typedef struct AudioFIRContext {
52     const AVClass *class;
53
54     float wet_gain;
55     float dry_gain;
56     float length;
57     int gtype;
58     float ir_gain;
59     int ir_format;
60     float max_ir_len;
61     int response;
62     int w, h;
63     AVRational frame_rate;
64     int ir_channel;
65     int minp;
66     int maxp;
67
68     float gain;
69
70     int eof_coeffs;
71     int have_coeffs;
72     int nb_taps;
73     int nb_channels;
74     int nb_coef_channels;
75     int one2many;
76
77     AudioFIRSegment seg;
78
79     AVFrame *in[2];
80     AVFrame *video;
81     int64_t pts;
82
83     AVFloatDSPContext *fdsp;
84     void (*fcmul_add)(float *sum, const float *t, const float *c,
85                       ptrdiff_t len);
86 } AudioFIRContext;
87
88 void ff_afir_init_x86(AudioFIRContext *s);
89
90 #endif /* AVFILTER_AFIR_H */