3 #define audio_sample_size 32 5 #if audio_sample_size == 32 7 #define audio_sample_asm dword 8 #elif audio_sample_size == 64 10 #define audio_sample_asm qword 12 #error wrong audio_sample_size 15 #define audio_sample_bytes (audio_sample_size/8) 36 return (
t_uint64)floor((
double)p_sample_rate * p_time + 0.5);
40 PFC_ASSERT(p_sample_rate > 0);
41 return (
double)p_samples / (double)p_sample_rate;
45 #if defined(_MSC_VER) && defined(_M_IX86) 62 #elif defined(_MSC_VER) && defined(_M_X64) 65 return (
t_int32)_mm_cvtss_si32(_mm_load_ss(&p_val));
74 static inline double scale_to_gain(
double scale) {
return 20.0*log10(scale); }
static audio_sample convert_to_int32_calculate_peak(const audio_sample *p_source, t_size p_count, t_int32 *p_output, audio_sample p_scale)
static t_int32 rint32(float p_val)
static audio_sample gain_to_scale(double p_gain)
static audio_sample calculate_peak(const audio_sample *p_source, t_size p_count)
static void convert_from_int32(const t_int32 *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale)
static void add_offset(audio_sample *p_buffer, audio_sample p_delta, t_size p_count)
static void convert_from_int16(const t_int16 *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale)
static t_int32 rint32(audio_sample val)
static void remove_denormals(audio_sample *p_buffer, t_size p_count)
static void convert_to_int16(const audio_sample *p_source, t_size p_count, t_int16 *p_output, audio_sample p_scale)
static double samples_to_time(t_uint64 p_samples, t_uint32 p_sample_rate)
static void convert_to_int32(const audio_sample *p_source, t_size p_count, t_int32 *p_output, audio_sample p_scale)
static double scale_to_gain(double scale)
static t_int64 rint64(audio_sample val)
static audio_sample decodeFloat24ptr(const void *sourcePtr)
static const audio_sample float16scale
static audio_sample decodeFloat24ptrbs(const void *sourcePtr)
static void scale(const audio_sample *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale)
p_source/p_output can point to same buffer
static audio_sample decodeFloat16(uint16_t source)
static t_uint64 time_to_samples(double p_time, t_uint32 p_sample_rate)
static audio_sample convert_to_int16_calculate_peak(const audio_sample *p_source, t_size p_count, t_int16 *p_output, audio_sample p_scale)