OpenFFmpeg
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_size;
37  int block_size;
38  int fft_length;
39  int coeff_size;
40  int input_size;
41  int input_offset;
42 
43  int *output_offset;
44  int *part_index;
45 
46  AVFrame *sum;
47  AVFrame *block;
48  AVFrame *buffer;
49  AVFrame *coeff;
50  AVFrame *input;
51  AVFrame *output;
52 
53  RDFTContext **rdft, **irdft;
55 
56 typedef struct AudioFIRDSPContext {
57  void (*fcmul_add)(float *sum, const float *t, const float *c,
58  ptrdiff_t len);
60 
61 typedef struct AudioFIRContext {
62  const AVClass *class;
63 
64  float wet_gain;
65  float dry_gain;
66  float length;
67  int gtype;
68  float ir_gain;
69  int ir_format;
70  float max_ir_len;
71  int response;
72  int w, h;
73  AVRational frame_rate;
74  int ir_channel;
75  int minp;
76  int maxp;
77 
78  float gain;
79 
80  int eof_coeffs;
81  int have_coeffs;
82  int nb_taps;
83  int nb_channels;
84  int nb_coef_channels;
85  int one2many;
86 
87  AudioFIRSegment seg[1024];
88  int nb_segments;
89 
90  AVFrame *in[2];
91  AVFrame *video;
92  int min_part_size;
93  int64_t pts;
94 
95  AudioFIRDSPContext afirdsp;
96  AVFloatDSPContext *fdsp;
97 
99 
100 void ff_afir_init(AudioFIRDSPContext *s);
101 void ff_afir_init_x86(AudioFIRDSPContext *s);
102 
103 #endif /* AVFILTER_AFIR_H */
This structure describes decoded (raw) audio or video data.
Definition: frame.h:268
Definition: rdft.h:28
Main libavfilter public API header.
AVOptions.
Definition: af_afir.h:56
Definition: float_dsp.h:24
FFT functions.
Describe the class of an AVClass context structure.
Definition: log.h:67
Rational number (pair of numerator and denominator).
Definition: rational.h:58
Definition: af_afir.h:34
common internal and external API header
Definition: af_afir.h:61
internal API functions