Bitcrush effect plugin

This commit is contained in:
Vesa
2014-12-07 00:07:30 +02:00
parent fd6e49c906
commit f742854642
10 changed files with 670 additions and 1 deletions

View File

@@ -130,7 +130,17 @@ static inline int fast_rand()
return( (unsigned)( next / 65536 ) % 32768 );
}
static inline double fastRand( double range )
{
static const double fast_rand_ratio = 1.0f / FAST_RAND_MAX;
return fast_rand() * range * fast_rand_ratio;
}
static inline float fastRandf( float range )
{
static const float fast_rand_ratio = 1.0f / FAST_RAND_MAX;
return fast_rand() * range * fast_rand_ratio;
}
// source: http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/
static inline double fastPow( double a, double b )
@@ -241,5 +251,4 @@ static inline float fastSqrt( float n )
return u.f;
}
#endif