30 static unsigned int myrnd(
unsigned int *seed_ptr,
int n)
32 unsigned int seed, val;
35 seed = (seed * 314159) + 1;
50 #define FRAC_ONE (1 << FRAC_BITS) 78 static unsigned int seed = 1;
82 int r,
g,
b,
x,
y, i, dx, dy, x1, y1;
101 for (y = 0; y <
h; y++) {
102 for (x = 0; x <
w; x++) {
106 g = (((x1 + y1) * 9) >>
FRAC_BITS) & 0xff;
114 for (y = 0; y <
NOISE_W; y++) {
115 for (x = 0; x <
NOISE_W; x++) {
116 r =
myrnd(&seed1, 256);
117 g =
myrnd(&seed1, 256);
118 b =
myrnd(&seed1, 256);
124 for (i = 0; i <
NB_OBJS; i++) {
127 for (y = 0; y < p->
h; y++) {
128 for (x = 0; x < p->
w; x++) {
133 r +=
myrnd(&seed1, 50);
134 g +=
myrnd(&seed1, 50);
135 b +=
myrnd(&seed1, 50);
144 int main(
int argc,
char **argv)
151 printf(
"usage: %s file|dir\n" 152 "generate a test video stream\n", argv[0]);
156 if (!freopen(argv[1],
"wb", stdout))
170 snprintf(buf,
sizeof(buf),
"%s%02d.pgm", argv[1], i);
static void put_pixel(int x, int y, int r, int g, int b)
static unsigned char * rgb_tab
static void gen_image(int num, int w, int h)
static unsigned int myrnd(unsigned int *seed_ptr, int n)
int main(int argc, char **argv)
static void pgmyuv_save(const char *filename, int w, int h, unsigned char *rgb_tab)
static int int_cos(int a)
static VObj objs[NB_OBJS]