149 |
|
|
150 |
protected: |
protected: |
151 |
|
|
152 |
inline static int getSample(sample_t* src, int pos) { |
inline static int32_t getSample(sample_t* src, int pos) { |
153 |
if (BITDEPTH24) { |
if (BITDEPTH24) { |
154 |
pos *= 3; |
pos *= 3; |
155 |
#if WORDS_BIGENDIAN |
#if WORDS_BIGENDIAN |
158 |
#else |
#else |
159 |
// 24bit read optimization: |
// 24bit read optimization: |
160 |
// a misaligned 32bit read and subquent 8 bit shift is faster (on x86) than reading 3 single bytes and shifting them |
// a misaligned 32bit read and subquent 8 bit shift is faster (on x86) than reading 3 single bytes and shifting them |
161 |
return (*((int *)(&((char *)(src))[pos])))<<8; |
return (*((int32_t *)(&((char *)(src))[pos])))<<8; |
162 |
#endif |
#endif |
163 |
} else { |
} else { |
164 |
return src[pos]; |
return src[pos]; |