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

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

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

revision 319 by schoenebeck, Mon Dec 13 00:46:42 2004 UTC revision 361 by schoenebeck, Wed Feb 9 01:22:18 2005 UTC
# Line 25  Line 25 
25    
26  #include <math.h>  #include <math.h>
27    
28    #include "../../common/global.h"
29    
30  /// ln(2) / 2  /// ln(2) / 2
31  #define LN_2_2                  0.34657359f  #define LN_2_2                  0.34657359f
32    
# Line 44  namespace LinuxSampler { Line 46  namespace LinuxSampler {
46       * between multiple filters.       * between multiple filters.
47       */       */
48      struct biquad_param_t {      struct biquad_param_t {
         bq_t a1;  
         bq_t a2;  
49          bq_t b0;          bq_t b0;
50          bq_t b1;          bq_t b1;
51          bq_t b2;          bq_t b2;
52            bq_t a1;
53            bq_t a2;
54      };      };
55    
56      /**      /**
# Line 58  namespace LinuxSampler { Line 60  namespace LinuxSampler {
60      class BiquadFilter {      class BiquadFilter {
61          protected:          protected:
62              // following five variables are only used if no external biquad_param_t reference is used              // following five variables are only used if no external biquad_param_t reference is used
             bq_t a1;  
             bq_t a2;  
63              bq_t b0;              bq_t b0;
64              bq_t b1;              bq_t b1;
65              bq_t b2;              bq_t b2;
66                bq_t a1;
67                bq_t a2;
68              // following four variables are used to buffer the feedback              // following four variables are used to buffer the feedback
69              bq_t x1;              bq_t x1;
70              bq_t x2;              bq_t x2;
# Line 121  namespace LinuxSampler { Line 123  namespace LinuxSampler {
123                  return y;                  return y;
124              }              }
125    
126    #if ARCH_X86
127              // expects to find input in xmm0 (xmm0 stays unmodified) and finally leaves output in xmm6              // expects to find input in xmm0 (xmm0 stays unmodified) and finally leaves output in xmm6
128              inline void Apply4StepsSSE(biquad_param_t* param) {              inline void Apply4StepsSSE(biquad_param_t* param) {
129                  __asm__ __volatile__ (                  __asm__ __volatile__ (
# Line 207  namespace LinuxSampler { Line 210  namespace LinuxSampler {
210                        "r" (&param->b0)  /* %2 */                        "r" (&param->b0)  /* %2 */
211                  );                  );
212              }              }
213    #endif // ARCH_X86
214    
215              inline bq_t ApplyFB(bq_t x, const bq_t fb) {              inline bq_t ApplyFB(bq_t x, const bq_t fb) {
216                  bq_t y;                  bq_t y;
# Line 238  namespace LinuxSampler { Line 242  namespace LinuxSampler {
242                  return y;                  return y;
243              }              }
244    
245    #if ARCH_X86
246              // expects to find input in xmm0 (xmm0 stays unmodified) and finally leaves output in xmm7              // expects to find input in xmm0 (xmm0 stays unmodified) and finally leaves output in xmm7
247              inline void ApplyFB4StepsSSE(biquad_param_t* param, const bq_t &fb) {              inline void ApplyFB4StepsSSE(biquad_param_t* param, const bq_t &fb) {
248                  float xs, ys;                  float xs, ys;
# Line 433  namespace LinuxSampler { Line 438  namespace LinuxSampler {
438                      ::                      ::
439                  );                  );
440              }              }
441    #endif // ARCH_X86
442      };      };
443    
444      class LowpassFilter : public BiquadFilter {      class LowpassFilter : public BiquadFilter {

Legend:
Removed from v.319  
changed lines
  Added in v.361

  ViewVC Help
Powered by ViewVC