134 |
return 1; |
return 1; |
135 |
} |
} |
136 |
|
|
137 |
inline static int getSample(sample_t* src, int pos) { |
inline static int32_t getSample(sample_t* src, int pos) { |
138 |
if (BITDEPTH24) { |
if (BITDEPTH24) { |
139 |
pos *= 3; |
pos *= 3; |
140 |
#if WORDS_BIGENDIAN |
#if WORDS_BIGENDIAN |
143 |
#else |
#else |
144 |
// 24bit read optimization: |
// 24bit read optimization: |
145 |
// 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 |
146 |
return (*((int *)(&((char *)(src))[pos])))<<8; |
return (*((int32_t *)(&((char *)(src))[pos])))<<8; |
147 |
#endif |
#endif |
148 |
} else { |
} else { |
149 |
return src[pos]; |
return src[pos]; |