fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

Théo Monnomsoxr-sys (#438)2e4d385

main
825 B31 linesraw
1/* SoX Resampler Library      Copyright (c) 2007-13 robs@users.sourceforge.net
2 * Licence for this file: LGPL v2.1                  See LICENCE for details. */
3
4void ORDERED_CONVOLVE(int n, void * not_used, DFT_FLOAT * a, const DFT_FLOAT * b)
5{
6  int i;
7  a[0] *= b[0];
8  a[1] *= b[1];
9  for (i = 2; i < n; i += 2) {
10    DFT_FLOAT tmp = a[i];
11    a[i  ] = b[i  ] * tmp - b[i+1] * a[i+1];
12    a[i+1] = b[i+1] * tmp + b[i  ] * a[i+1];
13  }
14  (void)not_used;
15}
16
17void ORDERED_PARTIAL_CONVOLVE(int n, DFT_FLOAT * a, const DFT_FLOAT * b)
18{
19  int i;
20  a[0] *= b[0];
21  for (i = 2; i < n; i += 2) {
22    DFT_FLOAT tmp = a[i];
23    a[i  ] = b[i  ] * tmp - b[i+1] * a[i+1];
24    a[i+1] = b[i+1] * tmp + b[i  ] * a[i+1];
25  }
26  a[1] = b[i] * a[i] - b[i+1] * a[i+1];
27}
28
29#undef ORDERED_CONVOLVE
30#undef ORDERED_PARTIAL_CONVOLVE
31#undef DFT_FLOAT