fork/rust-sdks

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

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

livekit/livekit-ffi@0.13.0
1.6 KiB39 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
4#define SIMD_ALIGNED_FREE free
5#define SIMD_ALIGNED_MALLOC malloc
6#define PFFFT_SIMD_DISABLE
7#define PFFFT_DOUBLE 0
8#include "pffft-wrap.c"
9
10#include "filter.h"
11#include "rdft_t.h"
12
13static void * setup(int len) {return pffft_new_setup(len, PFFFT_REAL);}
14static void delete_setup(void * setup) {pffft_destroy_setup(setup);}
15static void forward  (int length, void * setup, float * h, float * scratch) {pffft_transform        (setup, h, h, scratch, PFFFT_FORWARD); (void)length;}
16static void oforward (int length, void * setup, float * h, float * scratch) {pffft_transform_ordered(setup, h, h, scratch, PFFFT_FORWARD); (void)length;}
17static void backward (int length, void * setup, float * H, float * scratch) {pffft_transform        (setup, H, H, scratch, PFFFT_BACKWARD);(void)length;}
18static void obackward(int length, void * setup, float * H, float * scratch) {pffft_transform_ordered(setup, H, H, scratch, PFFFT_BACKWARD);(void)length;}
19static void convolve(int length, void * setup, float * H, float const * with) { pffft_zconvolve(setup, H, with, H);  (void)length;}
20static int multiplier(void) {return 1;}
21static int flags(void) {return RDFT_NEEDS_SCRATCH;}
22
23fn_t _soxr_rdft32_cb[] = {
24  (fn_t)setup,
25  (fn_t)setup,
26  (fn_t)delete_setup,
27  (fn_t)forward,
28  (fn_t)oforward,
29  (fn_t)backward,
30  (fn_t)obackward,
31  (fn_t)convolve,
32  (fn_t)_soxr_ordered_partial_convolve_f,
33  (fn_t)multiplier,
34  (fn_t)pffft_reorder_back,
35  (fn_t)malloc,
36  (fn_t)calloc,
37  (fn_t)free,
38  (fn_t)flags,
39};