resample.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 struct ResampleContext {
  27. const AVClass *av_class;
  28. uint8_t *filter_bank;
  29. int filter_length;
  30. int filter_alloc;
  31. int ideal_dst_incr;
  32. int dst_incr;
  33. int dst_incr_div;
  34. int dst_incr_mod;
  35. int index;
  36. int frac;
  37. int src_incr;
  38. int compensation_distance;
  39. int phase_count;
  40. int linear;
  41. enum SwrFilterType filter_type;
  42. double kaiser_beta;
  43. double factor;
  44. enum AVSampleFormat format;
  45. int felem_size;
  46. int filter_shift;
  47. int phase_count_compensation; /* desired phase_count when compensation is enabled */
  48. struct {
  49. void (*resample_one)(void *dst, const void *src,
  50. int n, int64_t index, int64_t incr);
  51. int (*resample_common)(struct ResampleContext *c, void *dst,
  52. const void *src, int n, int update_ctx);
  53. int (*resample_linear)(struct ResampleContext *c, void *dst,
  54. const void *src, int n, int update_ctx);
  55. } dsp;
  56. } ResampleContext;
  57. void swri_resample_dsp_init(ResampleContext *c);
  58. void swri_resample_dsp_x86_init(ResampleContext *c);
  59. void swri_resample_dsp_arm_init(ResampleContext *c);
  60. void swri_resample_dsp_aarch64_init(ResampleContext *c);
  61. #endif /* SWRESAMPLE_RESAMPLE_H */