Changeset 19123e6624236b0f9c97a3e13df1a493436350c2 for filter.c
- Timestamp:
- 06/10/09 02:47:39 (3 years ago)
- Children:
- 430899e583d1ce72d6fb3fbf929006c61f7fdc23
- Parents:
- e7c6b41ac5a2552147e83c248b26252f2841a35e
- git-committer:
- Nedko Arnaudov <nedko@arnaudov.name> / 2009-06-10T02:47:39Z+0300
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
filter.c
r4a9e3e0 r19123e6 52 52 struct param_sect * sect_ptr) 53 53 { 54 sect_ptr->f = 0.25 ;55 sect_ptr->b = sect_ptr->g = 1.0 ;56 sect_ptr->a = sect_ptr->s1 = sect_ptr->s2 = sect_ptr->z1 = sect_ptr->z2 = 0.0 ;54 sect_ptr->f = 0.25f; 55 sect_ptr->b = sect_ptr->g = 1.0f; 56 sect_ptr->a = sect_ptr->s1 = sect_ptr->s2 = sect_ptr->z1 = sect_ptr->z2 = 0.0f; 57 57 } 58 58 … … 79 79 if (f != sect_ptr->f) 80 80 { 81 if (f < 0.5 * sect_ptr->f) f = 0.5* sect_ptr->f;82 else if (f > 2.0 * sect_ptr->f) f = 2.0* sect_ptr->f;81 if (f < 0.5f * sect_ptr->f) f = 0.5f * sect_ptr->f; 82 else if (f > 2.0f * sect_ptr->f) f = 2.0f * sect_ptr->f; 83 83 sect_ptr->f = f; 84 sect_ptr->s1 = -cos (2 * M_PI* f);84 sect_ptr->s1 = -cosf(6.283185f * f); 85 85 d1 = (sect_ptr->s1 - s1) / k; 86 86 u2 = true; … … 89 89 if (g != sect_ptr->g) 90 90 { 91 if (g < 0.5 * sect_ptr->g) g = 0.5* sect_ptr->g;92 else if (g > 2.0 * sect_ptr->g) g = 2.0* sect_ptr->g;91 if (g < 0.5f * sect_ptr->g) g = 0.5f * sect_ptr->g; 92 else if (g > 2.0f * sect_ptr->g) g = 2.0f * sect_ptr->g; 93 93 sect_ptr->g = g; 94 sect_ptr->a = 0.5 * (g - 1.0);94 sect_ptr->a = 0.5f * (g - 1.0f); 95 95 da = (sect_ptr->a - a) / k; 96 96 u2 = true; … … 99 99 if (b != sect_ptr->b) 100 100 { 101 if (b < 0.5 * sect_ptr->b) b = 0.5* sect_ptr->b;102 else if (b > 2.0 * sect_ptr->b) b = 2.0* sect_ptr->b;101 if (b < 0.5f * sect_ptr->b) b = 0.5f * sect_ptr->b; 102 else if (b > 2.0f * sect_ptr->b) b = 2.0f * sect_ptr->b; 103 103 sect_ptr->b = b; 104 104 u2 = true; … … 107 107 if (u2) 108 108 { 109 b *= 4 * f;110 sect_ptr->s2 = (1 + sect_ptr->a - b) / (1 + sect_ptr->a+ b);109 b *= 7 * f / sqrtf(g); 110 sect_ptr->s2 = (1 - b) / (1 + b); 111 111 d2 = (sect_ptr->s2 - s2) / k; 112 112 } … … 122 122 y -= s1 * sect_ptr->z1; 123 123 sect_ptr->z2 = sect_ptr->z1 + s1 * y; 124 sect_ptr->z1 = y + 1e-10 ;124 sect_ptr->z1 = y + 1e-10f; 125 125 } 126 126 }
