af_afir.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/common.h"
  23. #include "libavutil/float_dsp.h"
  24. #include "libavutil/opt.h"
  25. #include "libavcodec/avfft.h"
  26. #include "audio.h"
  27. #include "avfilter.h"
  28. #include "formats.h"
  29. #include "internal.h"
  30. typedef struct AudioFIRSegment {
  31. int nb_partitions;
  32. int part_size;
  33. int block_size;
  34. int fft_length;
  35. int coeff_size;
  36. int input_size;
  37. int input_offset;
  38. int *output_offset;
  39. int *part_index;
  40. AVFrame *sum;
  41. AVFrame *block;
  42. AVFrame *buffer;
  43. AVFrame *coeff;
  44. AVFrame *input;
  45. AVFrame *output;
  46. RDFTContext **rdft, **irdft;
  47. } AudioFIRSegment;
  48. typedef struct AudioFIRDSPContext {
  49. void (*fcmul_add)(float *sum, const float *t, const float *c,
  50. ptrdiff_t len);
  51. } AudioFIRDSPContext;
  52. typedef struct AudioFIRContext {
  53. const AVClass *class;
  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. float gain;
  68. int eof_coeffs;
  69. int have_coeffs;
  70. int nb_taps;
  71. int nb_channels;
  72. int nb_coef_channels;
  73. int one2many;
  74. AudioFIRSegment seg[1024];
  75. int nb_segments;
  76. AVFrame *in[2];
  77. AVFrame *video;
  78. int min_part_size;
  79. int64_t pts;
  80. AudioFIRDSPContext afirdsp;
  81. AVFloatDSPContext *fdsp;
  82. } AudioFIRContext;
  83. void ff_afir_init(AudioFIRDSPContext *s);
  84. void ff_afir_init_x86(AudioFIRDSPContext *s);
  85. #endif /* AVFILTER_AFIR_H */