summaryrefslogtreecommitdiff
path: root/src/util.h
blob: bc926b6071613b4bf89a15bf33b2a0072a1a3231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef _UTIL_H_
#define _UTIL_H_

#include <stdint.h>

static inline void
pswap(void **p1, void **p2)
{
	void *tmp;

	tmp = *p1;
	*p1 = *p2;
	*p2 = tmp;
}

int
pgm_read(char *filename, unsigned char **buf, int *xsize, int *ysize);

int
pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, char *filename);

/* Store half of frame_a and half of frame_b in frame_a */
void
frame_mix(struct video_frame *frame_a, struct video_frame *frame_b);

double
frame_diff(struct video_frame *frame_a, struct video_frame *frame_b);

void
print_time(int64_t msec);

#endif /* _UTIL_H_ */