diff options
author | Leo Chan <leochanj@live.unc.edu> | 2020-10-22 01:53:21 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-22 01:56:35 -0400 |
commit | d17b33131c14864bd1eae275f49a3f148e21cf29 (patch) | |
tree | 0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/benchmarks/sift/src/c/diffss.c | |
parent | 601ed25a4c5b66cb75315832c15613a727db2c26 (diff) |
Squashed commit of the sb-vbs branch.
Includes the SD-VBS benchmarks modified to:
- Use libextra to loop as realtime jobs
- Preallocate memory before starting their main computation
- Accept input via stdin instead of via argc
Does not include the SD-VBS matlab code.
Fixes libextra execution in LITMUS^RT.
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/c/diffss.c')
-rw-r--r-- | SD-VBS/benchmarks/sift/src/c/diffss.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/sift/src/c/diffss.c b/SD-VBS/benchmarks/sift/src/c/diffss.c new file mode 100644 index 0000000..683cbe7 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/diffss.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /******************************** | ||
2 | Author: Sravanthi Kota Venkata | ||
3 | ********************************/ | ||
4 | |||
5 | #include "sift.h" | ||
6 | |||
7 | /** | ||
8 | DIFFSS Difference of scale space | ||
9 | Returns a scale space DSS obtained by subtracting | ||
10 | consecutive levels of the scale space SS. | ||
11 | |||
12 | In SIFT, this function is used to compute the difference of | ||
13 | Gaussian scale space from the Gaussian scale space of an image. | ||
14 | **/ | ||
15 | |||
16 | F2D** diffss(F2D** ss, int num, int intervals) | ||
17 | { | ||
18 | F2D** dss; | ||
19 | int o, sizeM, sizeN, s, i, j; | ||
20 | F2D *current, *in1, *in2; | ||
21 | |||
22 | dss = malloc(num*intervals*sizeof(F2D*)); | ||
23 | |||
24 | for(o=0; o<num; o++) | ||
25 | { | ||
26 | for(s=0; s<(intervals-1); s++) | ||
27 | { | ||
28 | sizeM = ss[o*intervals+s]->height; | ||
29 | sizeN = ss[o*intervals+s]->width; | ||
30 | |||
31 | dss[o*intervals+s] = fMallocHandle(sizeM, sizeN); | ||
32 | |||
33 | current = dss[o*intervals+s]; | ||
34 | in1 = ss[o*intervals+s+1]; | ||
35 | in2 = ss[o*intervals+s]; | ||
36 | |||
37 | for(i=0; i<sizeM; i++) | ||
38 | { | ||
39 | for(j=0; j<sizeN; j++) | ||
40 | { | ||
41 | subsref(current,i,j) = subsref(in1,i,j) - subsref(in2,i,j); | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | |||
47 | return dss; | ||
48 | |||
49 | } | ||
50 | |||
51 | |||
52 | |||
53 | |||