00001 #ifndef NOISE_H 00002 #define NOISE_H 00003 00004 /* Can be overrriden with any code that produces whitenoise between 0.0f and 00005 * 1.0f, eg (random() / (float)RAND_MAX) should be a good source of noise, but 00006 * its expensive */ 00007 #ifndef GDITHER_NOISE 00008 #define GDITHER_NOISE gdither_noise() 00009 #endif 00010 00011 inline static float gdither_noise() 00012 { 00013 static uint32_t rnd = 23232323; 00014 rnd = (rnd * 196314165) + 907633515; 00015 00016 return rnd * 2.3283064365387e-10f; 00017 } 00018 00019 #endif
1.5.5