jack1 codebase
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.

90 lines
3.1KB

  1. /*
  2. Copyright (C) 1999-2000 Paul Davis
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. $Id$
  15. */
  16. #ifndef __jack_memops_h__
  17. #define __jack_memops_h__
  18. #include <jack/types.h>
  19. void sample_move_d32u24_sS (char *dst, sample_t *src, unsigned long nsamples, unsigned long dst_skip, gain_t);
  20. void sample_move_d16_sS (char *dst, sample_t *src, unsigned long nsamples, unsigned long dst_skip, gain_t);
  21. void sample_move_dS_s32u24 (sample_t *dst, char *src, unsigned long nsamples, unsigned long src_skip);
  22. void sample_move_dS_s16 (sample_t *dst, char *src, unsigned long nsamples, unsigned long src_skip);
  23. void sample_merge_d16_sS (char *dst, sample_t *src, unsigned long nsamples, unsigned long dst_skip, gain_t);
  24. void sample_merge_d32u24_sS (char *dst, sample_t *src, unsigned long nsamples, unsigned long dst_skip, gain_t);
  25. static __inline__ void
  26. sample_merge (sample_t *dst, sample_t *src, unsigned long cnt, gain_t gain)
  27. {
  28. if (gain == 1.0) {
  29. while (cnt--) {
  30. *dst += *src;
  31. dst++;
  32. src++;
  33. }
  34. } else {
  35. while (cnt--) {
  36. *dst += (*src * gain);
  37. dst++;
  38. src++;
  39. }
  40. }
  41. }
  42. static __inline__ void
  43. sample_memcpy (sample_t *dst, sample_t *src, unsigned long cnt, gain_t gain)
  44. {
  45. if (gain == 1.0) {
  46. memcpy (dst, src, cnt * sizeof (sample_t));
  47. } else {
  48. while (cnt--) {
  49. *dst = (*src * gain);
  50. dst++;
  51. src++;
  52. }
  53. }
  54. }
  55. void memset_interleave (char *dst, char val, unsigned long bytes, unsigned long unit_bytes, unsigned long skip_bytes);
  56. void memcpy_fake (char *dst, char *src, unsigned long src_bytes, unsigned long foo, unsigned long bar);
  57. void memcpy_interleave_d16_s16 (char *dst, char *src, unsigned long src_bytes, unsigned long dst_skip_bytes, unsigned long src_skip_bytes);
  58. void memcpy_interleave_d32_s32 (char *dst, char *src, unsigned long src_bytes, unsigned long dst_skip_bytes, unsigned long src_skip_bytes);
  59. void merge_memcpy_interleave_d16_s16 (char *dst, char *src, unsigned long src_bytes, unsigned long dst_skip_bytes, unsigned long src_skip_bytes);
  60. void merge_memcpy_interleave_d32_s32 (char *dst, char *src, unsigned long src_bytes, unsigned long dst_skip_bytes, unsigned long src_skip_bytes);
  61. void merge_memcpy_d16_s16 (char *dst, char *src, unsigned long src_bytes, unsigned long foo, unsigned long bar);
  62. void merge_memcpy_d32_s32 (char *dst, char *src, unsigned long src_bytes, unsigned long foo, unsigned long bar);
  63. #endif /* __jack_memops_h__ */