/[svn]/linuxsampler/trunk/src/engines/common/Resampler.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/Resampler.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1484 by senoner, Thu Nov 15 13:24:41 2007 UTC revision 1485 by senoner, Thu Nov 15 23:35:45 2007 UTC
# Line 149  namespace LinuxSampler { Line 149  namespace LinuxSampler {
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
# Line 158  namespace LinuxSampler { Line 158  namespace LinuxSampler {
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];

Legend:
Removed from v.1484  
changed lines
  Added in v.1485

  ViewVC Help
Powered by ViewVC