21 #include <ardourext/float_cast.h>
29 #define CPU_CLIPS_NEGATIVE 0
30 #define CPU_CLIPS_POSITIVE 0
40 static const float normfact = 1.0 / ((float) 0x80000000);
42 unsigned char *ucptr ;
45 ucptr = ((
unsigned char*) src) + 3 * count ;
49 dest [count] = ((float) value) * normfact ;
57 static const float normfact = 1.0 / ((float) 0x80000000);
59 unsigned char *ucptr ;
63 ucptr = ((
unsigned char*) src) + 3 * count ;
67 dest [count] = ((float) value) * normfact ;
74 static const float normfact = (1.0 * 0x7FFFFF);
76 unsigned char *ucptr ;
79 ucptr = ((
unsigned char*) dest) + 3 * count ;
84 value = lrintf (src [count] * normfact) ;
86 ucptr [1] = value >> 8 ;
87 ucptr [2] = value >> 16 ;
94 static const float normfact = (8.0 * 0x10000000);
96 unsigned char *ucptr ;
100 ucptr = ((
unsigned char*) dest) + 3 * count ;
105 scaled_value = src [count] * normfact ;
119 value = lrintf (scaled_value) ;
120 ucptr [0] = value >> 8 ;
121 ucptr [1] = value >> 16 ;
122 ucptr [2] = value >> 24 ;
129 static const float normfact = (1.0 * 0x7FFFFF);
131 unsigned char *ucptr ;
134 ucptr = ((
unsigned char*) dest) + 3 * count ;
138 value = lrintf (src [count] * normfact) ;
139 ucptr [0] = value >> 16 ;
140 ucptr [1] = value >> 8 ;
148 static const float normfact = (8.0 * 0x10000000);
150 unsigned char *ucptr ;
154 ucptr = ((
unsigned char*) dest) + 3 * count ;
158 scaled_value = src [count] * normfact ;
172 value = lrint (scaled_value) ;
173 ucptr [0] = value >> 24 ;
174 ucptr [1] = value >> 16 ;
175 ucptr [2] = value >> 8 ;
#define CPU_CLIPS_NEGATIVE
void pcm_bet2f_array(tribyte *src, int count, float *dest)
void pcm_f2bet_clip_array(const float *src, tribyte *dest, int count)
void pcm_f2let_array(float *src, tribyte *dest, int count)
#define CPU_CLIPS_POSITIVE
void pcm_f2bet_array(const float *src, tribyte *dest, int count)
void pcm_f2let_clip_array(float *src, tribyte *dest, int count)
void pcm_let2f_array(tribyte *src, int count, float *dest)