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.

69 lines
2.1KB

  1. /*
  2. * audio resampling
  3. * Copyright (c) 2004-2012 Michael Niedermayer <michaelni@gmx.at>
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef SWRESAMPLE_RESAMPLE_H
  22. #define SWRESAMPLE_RESAMPLE_H
  23. #include "libavutil/log.h"
  24. #include "libavutil/samplefmt.h"
  25. #include "swresample_internal.h"
  26. typedef void (*resample_one_fn)(uint8_t *dst, const uint8_t *src,
  27. int n, int64_t index, int64_t incr);
  28. typedef int (*resample_fn)(struct ResampleContext *c, uint8_t *dst,
  29. const uint8_t *src, int n, int update_ctx);
  30. typedef struct ResampleContext {
  31. const AVClass *av_class;
  32. uint8_t *filter_bank;
  33. int filter_length;
  34. int filter_alloc;
  35. int ideal_dst_incr;
  36. int dst_incr;
  37. int dst_incr_div;
  38. int dst_incr_mod;
  39. int index;
  40. int frac;
  41. int src_incr;
  42. int compensation_distance;
  43. int phase_shift;
  44. int phase_mask;
  45. int linear;
  46. enum SwrFilterType filter_type;
  47. int kaiser_beta;
  48. double factor;
  49. enum AVSampleFormat format;
  50. int felem_size;
  51. int filter_shift;
  52. struct {
  53. resample_one_fn resample_one[AV_SAMPLE_FMT_NB - AV_SAMPLE_FMT_S16P];
  54. resample_fn resample_common[AV_SAMPLE_FMT_NB - AV_SAMPLE_FMT_S16P];
  55. resample_fn resample_linear[AV_SAMPLE_FMT_NB - AV_SAMPLE_FMT_S16P];
  56. } dsp;
  57. } ResampleContext;
  58. void swresample_dsp_init(ResampleContext *c);
  59. void swresample_dsp_x86_init(ResampleContext *c);
  60. #endif /* SWRESAMPLE_RESAMPLE_H */