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/float_dsp.h" 25 #include "libavutil/frame.h" 26 #include "libavutil/rational.h" 27 #include "libavutil/tx.h" 28 #include "avfilter.h" 29 #include "af_afirdsp.h" 30 31 typedef struct AudioFIRSegment { 32 int nb_partitions; 33 int part_size; 34 int block_size; 35 int fft_length; 36 int coeff_size; 37 int input_size; 38 int input_offset; 39 40 int *output_offset; 41 int *part_index; 42 43 AVFrame *sumin; 44 AVFrame *sumout; 45 AVFrame *blockin; 46 AVFrame *blockout; 47 AVFrame *buffer; 48 AVFrame *coeff; 49 AVFrame *input; 50 AVFrame *output; 51 52 AVTXContext **tx, **itx; 53 av_tx_fn tx_fn, itx_fn; 54 } AudioFIRSegment; 55 56 typedef struct AudioFIRContext { 57 const AVClass *class; 58 59 float wet_gain; 60 float dry_gain; 61 float length; 62 int gtype; 63 float ir_gain; 64 int ir_format; 65 float max_ir_len; 66 int response; 67 int w, h; 68 AVRational frame_rate; 69 int ir_channel; 70 int minp; 71 int maxp; 72 int nb_irs; 73 int selir; 74 int precision; 75 int format; 76 77 double gain; 78 79 int eof_coeffs[32]; 80 int have_coeffs; 81 int nb_taps; 82 int nb_channels; 83 int nb_coef_channels; 84 int one2many; 85 86 AudioFIRSegment seg[1024]; 87 int nb_segments; 88 89 AVFrame *in; 90 AVFrame *ir[32]; 91 AVFrame *video; 92 int min_part_size; 93 int64_t pts; 94 95 AudioFIRDSPContext afirdsp; 96 AVFloatDSPContext *fdsp; 97 } AudioFIRContext; 98 99 #endif /* AVFILTER_AFIR_H */ 100