comparison projects/heavy/hello-world/SignalDel1.h @ 160:5bcf04234f80 heavy-updated

- added -std=c99 to Makefile for user-supplied C files (required for heavy files) - changed heavy core render.cpp file to use latest API and removed all redundant functions (e.g. foleyDesigner/touchkey stuff) - use build_pd.sh to compile and run pd files (-h for usage instructions)
author chnrx <chris.heinrichs@gmail.com>
date Thu, 05 Nov 2015 18:58:26 +0000
parents
children
comparison
equal deleted inserted replaced
159:1e7db6610600 160:5bcf04234f80
1 /**
2 * Copyright (c) 2014, 2015, Enzien Audio Ltd.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef _SIGNAL_DEL1_H_
18 #define _SIGNAL_DEL1_H_
19
20 #include "HvBase.h"
21
22 typedef struct SignalDel1 {
23 hv_bufferf_t x;
24 } SignalDel1;
25
26 hv_size_t sDel1_init(SignalDel1 *o);
27
28 void sDel1_onMessage(HvBase *_c, SignalDel1 *o, int letIn, const HvMessage *m);
29
30 static inline void __hv_del1_f(SignalDel1 *o, hv_bInf_t bIn0, hv_bOutf_t bOut) {
31 #if HV_SIMD_AVX
32 __m256 x = _mm256_permute_ps(bIn0, _MM_SHUFFLE(2,1,0,3)); // [3 0 1 2 7 4 5 6]
33 __m256 n = _mm256_permute2f128_ps(o->x,x,0x1); // [h e f g 3 0 1 2]
34 *bOut = _mm256_blend_ps(x, n, 0x11); // [g 0 1 2 3 4 5 6]
35 o->x = x;
36 #elif HV_SIMD_SSE
37 __m128 n = _mm_blend_ps(o->x, bIn0, 0x7);
38 *bOut = _mm_shuffle_ps(n, n, _MM_SHUFFLE(2,1,0,3));
39 o->x = bIn0;
40 #elif HV_SIMD_NEON
41 *bOut = vextq_f32(o->x, bIn0, 3);
42 o->x = bIn0;
43 #else
44 *bOut = o->x;
45 o->x = bIn0;
46 #endif
47 }
48
49 #endif // _SIGNAL_DEL1_H_