float_dsp.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg 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. * FFmpeg 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 FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVUTIL_FLOAT_DSP_H
  19. #define AVUTIL_FLOAT_DSP_H
  20. typedef struct AVFloatDSPContext {
  21. /**
  22. * Calculate the product of two vectors of floats and store the result in
  23. * a vector of floats.
  24. *
  25. * @param dst output vector
  26. * constraints: 32-byte aligned
  27. * @param src0 first input vector
  28. * constraints: 32-byte aligned
  29. * @param src1 second input vector
  30. * constraints: 32-byte aligned
  31. * @param len number of elements in the input
  32. * constraints: multiple of 16
  33. */
  34. void (*vector_fmul)(float *dst, const float *src0, const float *src1,
  35. int len);
  36. /**
  37. * Multiply a vector of floats by a scalar float and add to
  38. * destination vector. Source and destination vectors must
  39. * overlap exactly or not at all.
  40. *
  41. * @param dst result vector
  42. * constraints: 32-byte aligned
  43. * @param src input vector
  44. * constraints: 32-byte aligned
  45. * @param mul scalar value
  46. * @param len length of vector
  47. * constraints: multiple of 16
  48. */
  49. void (*vector_fmac_scalar)(float *dst, const float *src, float mul,
  50. int len);
  51. } AVFloatDSPContext;
  52. /**
  53. * Initialize a float DSP context.
  54. *
  55. * @param fdsp float DSP context
  56. * @param strict setting to non-zero avoids using functions which may not be IEEE-754 compliant
  57. */
  58. void avpriv_float_dsp_init(AVFloatDSPContext *fdsp, int strict);
  59. void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp);
  60. void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict);
  61. void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp);
  62. #endif /* AVUTIL_FLOAT_DSP_H */