af_volume.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * This file is part of Libav.
  3. *
  4. * Libav is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * Libav is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with Libav; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. /**
  19. * @file
  20. * audio volume filter
  21. */
  22. #ifndef AVFILTER_AF_VOLUME_H
  23. #define AVFILTER_AF_VOLUME_H
  24. #include "libavutil/common.h"
  25. #include "libavutil/float_dsp.h"
  26. #include "libavutil/opt.h"
  27. #include "libavutil/samplefmt.h"
  28. enum PrecisionType {
  29. PRECISION_FIXED = 0,
  30. PRECISION_FLOAT,
  31. PRECISION_DOUBLE,
  32. };
  33. enum ReplayGainType {
  34. REPLAYGAIN_DROP,
  35. REPLAYGAIN_IGNORE,
  36. REPLAYGAIN_TRACK,
  37. REPLAYGAIN_ALBUM,
  38. };
  39. typedef struct VolumeContext {
  40. const AVClass *class;
  41. AVFloatDSPContext fdsp;
  42. enum PrecisionType precision;
  43. enum ReplayGainType replaygain;
  44. double replaygain_preamp;
  45. int replaygain_noclip;
  46. double volume;
  47. int volume_i;
  48. int channels;
  49. int planes;
  50. enum AVSampleFormat sample_fmt;
  51. void (*scale_samples)(uint8_t *dst, const uint8_t *src, int nb_samples,
  52. int volume);
  53. int samples_align;
  54. } VolumeContext;
  55. void ff_volume_init_x86(VolumeContext *vol);
  56. #endif /* AVFILTER_AF_VOLUME_H */