20 lines
858 B
C
20 lines
858 B
C
#ifndef XTC_DSP_H
|
|
#define XTC_DSP_H
|
|
#include "xtc_types.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
/* Single processing owner (or quiescent control thread). No allocation or I/O.
|
|
* Initialize with reset before target/process.
|
|
* Linear ramps reach the target on the Nth sample, independent of block size. */
|
|
typedef struct { float current, target; size_t remaining; } xtc_gain_ramp;
|
|
xtc_result xtc_gain_ramp_reset(xtc_gain_ramp *ramp, float value);
|
|
xtc_result xtc_gain_ramp_target(xtc_gain_ramp *ramp, float target, size_t frames);
|
|
xtc_result xtc_gain_ramp_process(xtc_gain_ramp *ramp, float *left, float *right, size_t frames);
|
|
/* Canonical silence for NaN, infinity and float subnormals; finite overloads
|
|
* are retained for mixing/headroom. This does not change CPU-wide FP flags. */
|
|
float xtc_dsp_finite(float sample);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|