configure.ac: Add checks for Flex/Yacc/Bison and other furry animals, for the new...
[platform/upstream/gst-plugins-good.git] / gst / goom / goom_tools.h
1 #ifndef _GOOMTOOLS_H
2 #define _GOOMTOOLS_H
3
4 /**
5  * Random number generator wrapper for faster random number.
6  */
7
8 #define GOOM_NB_RAND 0x10000
9
10 typedef struct _GOOM_RANDOM {
11         int array[GOOM_NB_RAND];
12         unsigned short pos;
13 } GoomRandom;
14
15 GoomRandom *goom_random_init(int i);
16 void goom_random_free(GoomRandom *grandom);
17
18 inline static int goom_random(GoomRandom *grandom) {
19         
20         grandom->pos++; /* works because pos is an unsigned short */
21         return grandom->array[grandom->pos];
22 }
23
24 inline static int goom_irand(GoomRandom *grandom, int i) {
25
26         grandom->pos++;
27         return grandom->array[grandom->pos] % i;
28 }
29
30 /* called to change the specified number of value in the array, so that the array does not remain the same*/
31 void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange);
32
33 #endif