gstreamer/gst/goom/goom_tools.h
Bastien Nocera a7bc7485b1 configure.ac: Add checks for Flex/Yacc/Bison and other furry animals, for the new goom 2k4 based plugin
Original commit message from CVS:
2008-02-23  Bastien Nocera  <hadess@hadess.net>

* configure.ac: Add checks for Flex/Yacc/Bison and other
furry animals, for the new goom 2k4 based plugin

* gst/goom/*: Update to use goom 2k4, uses liboil to detect
CPU optimisations (not working yet), move the old plugin to...

* gst/goom2k1/*: ... here, in case somebody is sick enough

Fixes #515073
2008-02-23 01:51:37 +00:00

33 lines
794 B
C

#ifndef _GOOMTOOLS_H
#define _GOOMTOOLS_H
/**
* Random number generator wrapper for faster random number.
*/
#define GOOM_NB_RAND 0x10000
typedef struct _GOOM_RANDOM {
int array[GOOM_NB_RAND];
unsigned short pos;
} GoomRandom;
GoomRandom *goom_random_init(int i);
void goom_random_free(GoomRandom *grandom);
inline static int goom_random(GoomRandom *grandom) {
grandom->pos++; /* works because pos is an unsigned short */
return grandom->array[grandom->pos];
}
inline static int goom_irand(GoomRandom *grandom, int i) {
grandom->pos++;
return grandom->array[grandom->pos] % i;
}
/* called to change the specified number of value in the array, so that the array does not remain the same*/
void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange);
#endif