You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.0KB

  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. #ifndef AVFILTER_AFIR_H
  21. #define AVFILTER_AFIR_H
  22. #include "libavutil/audio_fifo.h"
  23. #include "libavutil/common.h"
  24. #include "libavutil/float_dsp.h"
  25. #include "libavutil/opt.h"
  26. #include "libavcodec/avfft.h"
  27. #include "audio.h"
  28. #include "avfilter.h"
  29. #include "formats.h"
  30. #include "internal.h"
  31. #define MAX_IR_DURATION 30
  32. typedef struct AudioFIRContext {
  33. const AVClass *class;
  34. float wet_gain;
  35. float dry_gain;
  36. float length;
  37. int again;
  38. float gain;
  39. int eof_coeffs;
  40. int have_coeffs;
  41. int nb_coeffs;
  42. int nb_taps;
  43. int part_size;
  44. int part_index;
  45. int coeff_size;
  46. int block_size;
  47. int nb_partitions;
  48. int nb_channels;
  49. int ir_length;
  50. int fft_length;
  51. int nb_coef_channels;
  52. int one2many;
  53. int nb_samples;
  54. int want_skip;
  55. int need_padding;
  56. RDFTContext **rdft, **irdft;
  57. float **sum;
  58. float **block;
  59. FFTComplex **coeff;
  60. AVAudioFifo *fifo[2];
  61. AVFrame *in[2];
  62. AVFrame *buffer;
  63. int64_t pts;
  64. int index;
  65. AVFloatDSPContext *fdsp;
  66. void (*fcmul_add)(float *sum, const float *t, const float *c,
  67. ptrdiff_t len);
  68. } AudioFIRContext;
  69. void ff_afir_init_x86(AudioFIRContext *s);
  70. #endif /* AVFILTER_AFIR_H */