summaryrefslogtreecommitdiff
path: root/src/util.h
blob: 4666b06271db18d96024833fd8e1324816e30dae (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
33
34
35
#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);

double
frame_average(struct video_frame *frame);

void
print_time(int64_t msec);

#endif /* _UTIL_H_ */