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.

67 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 index;
  38. int frac;
  39. int src_incr;
  40. int compensation_distance;
  41. int phase_shift;
  42. int phase_mask;
  43. int linear;
  44. enum SwrFilterType filter_type;
  45. int kaiser_beta;
  46. double factor;
  47. enum AVSampleFormat format;
  48. int felem_size;
  49. int filter_shift;
  50. struct {
  51. resample_one_fn resample_one[AV_SAMPLE_FMT_NB - AV_SAMPLE_FMT_S16P];
  52. resample_fn resample_common[AV_SAMPLE_FMT_NB - AV_SAMPLE_FMT_S16P];
  53. resample_fn resample_linear[AV_SAMPLE_FMT_NB - AV_SAMPLE_FMT_S16P];
  54. } dsp;
  55. } ResampleContext;
  56. void swresample_dsp_init(ResampleContext *c);
  57. void swresample_dsp_x86_init(ResampleContext *c);
  58. #endif /* SWRESAMPLE_RESAMPLE_H */