-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
47 lines (42 loc) · 1.09 KB
/
main.c
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
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include "_bilinear.h"
int main(void) {
const float image[] = {
2.0, 3.0, 2.0,
1.0, 2.0, 4.0,
5.0, 2.0, 3.0,
4.0, 6.0, 3.0
};
const int image_width = 3;
const float coordinates[] = {
// x y
1.2, 0.2,
0.0, 1.2,
0.9, 2.3,
0.3, 2.9,
1.9, 0.3,
0.5, 0.4,
1.0, 1.0,
0.4, 2.0,
0.1, 2.0,
1.0, 0.9,
0.0, 0.2,
1.2, 2.4,
0.9, 0.0,
0.4, 0.1,
0.8, 1.2,
1.6, 0.0
};
const int n_coordinates = 16;
float intensities_simd[n_coordinates];
float intensities_normal[n_coordinates];
_interpolation_simd(
image, image_width, coordinates, n_coordinates, intensities_simd);
_interpolation_normal(
image, image_width, coordinates, n_coordinates, intensities_normal);
for(int i = 0; i < n_coordinates; i++) {
printf("simd : intensities[%2d] = %f\n", i, intensities_simd[i]);
printf("normal : intensities[%2d] = %f\n", i, intensities_normal[i]);
}
return 0;
}