/[svn]/linuxsampler/trunk/src/engines/gig/Synthesizer.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Synthesizer.h

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

revision 1424 by schoenebeck, Sun Oct 14 22:00:17 2007 UTC revision 1484 by senoner, Thu Nov 15 13:24:41 2007 UTC
# Line 134  namespace LinuxSampler { namespace gig { Line 134  namespace LinuxSampler { namespace gig {
134                  return 1;                  return 1;
135              }              }
136    
137              static int getSample(sample_t* src, int pos) {              inline static int getSample(sample_t* src, int pos) {
138                  if (BITDEPTH24) {                  if (BITDEPTH24) {
139                      pos *= 3;                      pos *= 3;
140                        #if WORDS_BIGENDIAN
141                      unsigned char* p = (unsigned char*)src;                      unsigned char* p = (unsigned char*)src;
142                      return p[pos] << 8 | p[pos + 1] << 16 | p[pos + 2] << 24;                      return p[pos] << 8 | p[pos + 1] << 16 | p[pos + 2] << 24;
143                        #else
144                        // 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
146                        return (*((int *)(&((char *)(src))[pos])))<<8;
147                        #endif
148                  } else {                  } else {
149                      return src[pos];                      return src[pos];
150                  }                  }

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

  ViewVC Help
Powered by ViewVC