#include <audio_sample.h>
|
static void | add_offset (audio_sample *p_buffer, audio_sample p_delta, t_size p_count) |
|
static audio_sample | calculate_peak (const audio_sample *p_source, 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 void | convert_from_int32 (const t_int32 *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale) |
|
static void | convert_to_int16 (const audio_sample *p_source, t_size p_count, t_int16 *p_output, audio_sample p_scale) |
|
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) |
|
static void | convert_to_int32 (const audio_sample *p_source, t_size p_count, t_int32 *p_output, audio_sample p_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 audio_sample | decodeFloat16 (uint16_t source) |
|
static audio_sample | decodeFloat24ptr (const void *sourcePtr) |
|
static audio_sample | decodeFloat24ptrbs (const void *sourcePtr) |
|
static audio_sample | gain_to_scale (double p_gain) |
|
static void | remove_denormals (audio_sample *p_buffer, t_size p_count) |
|
static t_int32 | rint32 (audio_sample val) |
|
static t_int32 | rint32 (float p_val) |
|
static t_int32 | rint32 (audio_sample val) |
|
static t_int64 | rint64 (audio_sample val) |
|
static t_int64 | rint64 (audio_sample val) |
|
static t_int64 | rint64 (audio_sample val) |
|
static double | samples_to_time (t_uint64 p_samples, t_uint32 p_sample_rate) |
|
static void | scale (const audio_sample *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale) |
|
static double | scale_to_gain (double scale) |
|
static t_uint64 | time_to_samples (double p_time, t_uint32 p_sample_rate) |
|
Definition at line 20 of file audio_sample.h.
Definition at line 106 of file audio_math.cpp.
static audio_sample noopt_calculate_peak(const audio_sample *p_src, t_size p_num)
Definition at line 79 of file audio_math.cpp.
static void noopt_convert_from_int16(const t_int16 *p_source, t_size p_count, audio_sample *p_output, float p_scale)
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
Definition at line 99 of file audio_math.cpp.
static void noopt_convert_from_int32(const t_int32 *p_source, t_size p_count, audio_sample *p_output, float p_scale)
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
Definition at line 66 of file audio_math.cpp.
static void noopt_convert_to_16bit(const audio_sample *p_source, t_size p_count, t_int16 *p_output, float p_scale)
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
Definition at line 72 of file audio_math.cpp.
static audio_sample calculate_peak(const audio_sample *p_source, 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)
Definition at line 85 of file audio_math.cpp.
static void noopt_convert_to_32bit(const audio_sample *p_source, t_size p_count, t_int32 *p_output, float p_scale)
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
Definition at line 93 of file audio_math.cpp.
static audio_sample calculate_peak(const audio_sample *p_source, t_size p_count)
static void convert_to_int32(const audio_sample *p_source, t_size p_count, t_int32 *p_output, audio_sample p_scale)
audio_sample pfc::audio_math::decodeFloat16 |
( |
uint16_t |
source | ) |
|
|
static |
Definition at line 31 of file audio_sample.cpp.
32 const unsigned fractionBits = 10;
33 const unsigned widthBits = 16;
34 typedef uint16_t source_t;
43 typedef uint32_t out_t;
typedef float retval_t;
47 outExponentShift = (1 << (outExponent-1))-1
50 const unsigned exponentBits = widthBits - fractionBits - 1;
52 source_t fraction = source & (((source_t)1 << fractionBits)-1);
53 source >>= fractionBits;
54 int exponent = (int)( source & (((source_t)1 << exponentBits)-1) ) - (
int)((1 << (exponentBits-1))-1);
55 source >>= exponentBits;
57 if (outExponent + outExponentShift <= 0)
return 0;
59 out_t
output = (out_t)( source&1 );
60 output <<= outExponent;
61 output |= (unsigned) (exponent + outExponentShift) & ( (1<<outExponent) - 1 );
62 output <<= outFraction;
63 int shift = (int) outFraction - (
int) fractionBits;
64 if (shift < 0) output |= (out_t) (fraction >> -shift);
65 else output |= (out_t) (fraction << shift);
static const audio_sample float16scale
audio_sample pfc::audio_math::decodeFloat24ptr |
( |
const void * |
sourcePtr | ) |
|
|
static |
Definition at line 4 of file audio_sample.cpp.
10 const uint8_t * s =
reinterpret_cast<const uint8_t*
>(sourcePtr);
static const bool byte_order_is_little_endian
audio_sample pfc::audio_math::decodeFloat24ptrbs |
( |
const void * |
sourcePtr | ) |
|
|
static |
Definition at line 17 of file audio_sample.cpp.
23 const uint8_t * s =
reinterpret_cast<const uint8_t*
>(sourcePtr);
static const bool byte_order_is_little_endian
static audio_sample pfc::audio_math::gain_to_scale |
( |
double |
p_gain | ) |
|
|
inlinestatic |
Definition at line 111 of file audio_math.cpp.
112 #if audio_sample_size == 32 114 for(;p_count;p_count--)
117 if ((t & 0x007FFFFF) && !(t & 0x7F800000)) *ptr=0;
120 #elif audio_sample_size == 64 122 for(;p_count;p_count--)
125 if ((t & 0x000FFFFFFFFFFFFF) && !(t & 0x7FF0000000000000)) *ptr=0;
static t_int32 pfc::audio_math::rint32 |
( |
float |
p_val | ) |
|
|
inlinestatic |
static double pfc::audio_math::samples_to_time |
( |
t_uint64 |
p_samples, |
|
|
t_uint32 |
p_sample_rate |
|
) |
| |
|
inlinestatic |
Definition at line 39 of file audio_sample.h.
40 PFC_ASSERT(p_sample_rate > 0);
41 return (
double)p_samples / (double)p_sample_rate;
p_source/p_output can point to same buffer
Definition at line 61 of file audio_math.cpp.
static void noopt_scale(const audio_sample *p_source, t_size p_count, audio_sample *p_output, audio_sample p_scale)
static double pfc::audio_math::scale_to_gain |
( |
double |
scale | ) |
|
|
inlinestatic |
Definition at line 74 of file audio_sample.h.
74 {
return 20.0*log10(
scale); }
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 t_uint64 pfc::audio_math::time_to_samples |
( |
double |
p_time, |
|
|
t_uint32 |
p_sample_rate |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following files: