Files
tp/include/JSystem/JAudio2/JASCalc.h
T

46 lines
1.1 KiB
C++
Raw Normal View History

2021-03-28 22:49:05 +02:00
#ifndef JASCALC_H
#define JASCALC_H
#include "dolphin/types.h"
2023-08-01 10:17:21 +03:00
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-jaudio
*
*/
2023-08-01 10:17:21 +03:00
struct JASCalc {
2025-11-30 14:23:42 -08:00
static void imixcopy(const s16*, const s16*, s16*, u32);
static void bcopyfast(const void* src, void* dest, u32 size);
static void bcopy(const void* src, void* dest, u32 size);
static void bzerofast(void* dest, u32 size);
static void bzero(void* dest, u32 size);
static f32 pow2(f32);
2023-11-11 05:18:11 +02:00
// Could not make it work as inline - specialization is in JASCalc.cpp
2023-08-01 10:17:21 +03:00
template <typename A, typename B>
static A clamp(B x); /* {
if (std::numeric_limits<A>::min() >= x)
return std::numeric_limits<A>::min();
if (x >= std::numeric_limits<A>::max())
return std::numeric_limits<A>::max();
return x;
} */
2024-02-11 00:29:35 -05:00
static f32 clamp01(f32 i_value) {
if (i_value <= 0.0f) {
return 0.0f;
}
if (i_value >= 1.0f) {
return 1.0f;
}
return i_value;
}
2023-08-01 10:17:21 +03:00
f32 fake1();
2025-12-18 16:31:44 -05:00
f32 fake2(s32 x);
2023-08-01 10:17:21 +03:00
f32 fake3();
static const s16 CUTOFF_TO_IIR_TABLE[128][4];
2023-08-01 10:17:21 +03:00
};
2021-03-28 22:49:05 +02:00
#endif /* JASCALC_H */